Patch #60.
[mono.git] / mcs / mcs / ChangeLog
1 2006-08-17  Miguel de Icaza  <miguel@novell.com>
2
3         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4         #52019 and #79064, the use of the \uXXXX sequence in source code
5         to represent unicode characters.
6
7 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
8
9         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
10         support.
11         * class.cs, ecore.cs, statement.cs: Merged to one error message.
12
13 2006-08-13  Miguel de Icaza  <miguel@novell.com>
14
15         * assign.cs: Catch attempts to assign to a method groups in += and
16         report as 1656
17
18 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
19
20         A fix for #79056
21         * cs-parser.jay: Don't destroy current array type by typeof of array's.
22
23 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
24
25         * class.cs (Method.Define): Issue a warning when generic method looks like
26         an entry point.
27         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
28         as well.
29
30 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
31  
32         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
33         looking for ctor.
34         * decl.cs (MemberCache.FindMembers): When container is interface we need to
35         search all base interfaces as a member can be ambiguous.
36         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
37         Constructor member type filter. 
38         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
39         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
40         reporting for returned memberinfos.
41         * report.cs: Updated.
42         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
43         version to work on all runtimes.
44         (TypeManager.RealMemberLookup): Removed members filtering.
45
46 2006-08-08  Raja R Harinath  <rharinath@novell.com>
47
48         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
49         (PropertyExpr.EmitAssign): Likewise.
50         * expression.cs (Indirection.EmitAssign): Likewise.
51         (LocalVariableReference.EmitAssign): Likewise.
52         (ParameterReference.EmitAssign): Likewise.
53         (Invocation.EmitArguments): Likewise.
54         (ArrayAccess.EmitAssign): Likewise.
55         (IndexerAccess.EmitAssign): Likewise.
56         (This.EmitAssign): Likewise.
57         (ConditionalLogicalOperator.Emit): Likewise.
58
59         Fix #79026
60         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
61         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
62         leave it in after returning it.
63         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
64
65 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
66
67         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
68         message.
69
70 2006-08-03  Raja R Harinath  <rharinath@novell.com>
71
72         Fix cs0146-3.cs and cs0146-4.cs.
73         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
74         enclosing types don't depend on the current type.
75
76 2006-08-02  Raja R Harinath  <rharinath@novell.com>
77
78         Fix #77963
79         * class.cs (TypeContainer.DoDefineMembers): Use
80         FindBaseMemberWithSameName on Parent, since we're interested in
81         whether we hide inherited members or not.
82         (FindBaseMemberWithSameName): Make slightly more robust.
83
84         Fix the non-generic testcase from #77396
85         * decl.cs (DeclSpace.DeclContainer): Remove override.
86
87         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
88         declspaces for doppelgangers too.
89         (UsingEntry): Implement IResolveContext.
90         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
91         'this' as the resolve context.
92         (LocalAliasEntry): Likewise.
93
94         Implement parts of #77403
95         * roottypes.cs (RootDeclSpace): New.  Used to represent the
96         toplevel declaration space.  Each namespace declaration introduces
97         a "partial" root declaretion space.
98         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
99         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
100         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
101         from 'current_namespace.SlaveDeclSpace'.
102         (namespace_declaration): Likewise.
103         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
104         check.  It can't happen now.
105         * decl.cs (DeclSpace.LookupType): Likewise.
106         * driver.cs (MainDriver): Sanity check.
107
108 2006-08-01  Raja R Harinath  <rharinath@novell.com>
109
110         * decl.cs (DeclSpace.FindNestedType): Remove.
111         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
112         LookupTypeContainer to get the container of the nested type.
113         * class.cs (TypeContainer.FindNestedType): Make non-override.
114
115 2006-07-31  Raja R Harinath  <rharinath@novell.com>
116
117         * decl.cs (DeclSpace.PartialContainer): Move field from ...
118         * class.cs (TypeContainer.PartialContainer): ... here.
119         (TypeContainer.AddBasesForPart): New helper.
120         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
121         instead.
122         * cs-parser.jay (current_class): Convert to DeclSpace.
123         (struct_declaration, interface_declaration, class_declaration):
124         Use AddBasesForPart instead of .Bases directly.
125         * const.cs, iterators.cs: Update to changes.
126
127 2006-07-28  Raja R Harinath  <rharinath@novell.com>
128
129         * class.cs (TypeContainer.AddMemberType): Rename from
130         AddToTypeContainer.
131         (TypeContainer.AddMember): Rename from AddToMemberContainer.
132         (AddTypeContainer): New.  Combine AddClassOrStruct and
133         AddInterface.
134         (AddPartial): Update.  Add 'is_partial' argument.
135         * roottypes.cs: Update to changes.
136         * cs-parser.jay (push_current_class): New helper for handling
137         current_container and current_class.
138         (struct_declaration, interface_declaration, class_declaration):
139         Use it.
140
141 2006-07-26  Raja R Harinath  <rharinath@novell.com>
142
143         * roottypes.cs: Rename from tree.cs.
144
145         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
146         * tree.cs (Tree, ITreeDump): Remove types.
147         * rootcontext.cs (tree, Tree): Remove fields.
148         (root, ToplevelTypes): New.
149         * *.cs: Update to rename.
150
151         * tree.cs (Tree.RecordDecl): Remove.
152         (RootTypes.AddToTypeContainer): Record the toplevel type in its
153         namespace here.
154         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
155
156 2006-07-23  Raja R Harinath  <harinath@gmail.com>
157
158         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
159         DoFlowAnalysis and OmitStructFlowAnalysis here.
160         (ec.With): Rename from WithUnsafe and generalize.
161         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
162         (ec.WithFlowAnalyis): New.
163         * ecore.cs, expression.cs, statement.cs: Update.
164
165 2006-07-22  Raja R Harinath  <harinath@gmail.com>
166
167         * statement.cs (Block.ResolveMeta): Simplify slightly.
168
169         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
170         multiple boolean fields.  Convert InUnsafe, constant_check_state,
171         check_state to flags.
172         (CheckState, ConstantCheckState): Update.
173         (InUnsafe): New read-only property.
174         (FlagsHandle): Rename from CheckStateHandle and convert to handle
175         arbitrary flags.
176         (WithUnsafe): New helper similar to WithCheckState.
177         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
178         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
179
180 2006-07-21  Raja R Harinath  <rharinath@novell.com>
181
182         Make comparisons use the same IL irrespective of whether they're
183         in a 'checked' or 'unchecked' context: one of the issues in #78899
184         * codegen.cs (EmitContext.CheckState): Make read-only property.
185         (EmitContext.ConstantCheckState): Likewise.
186         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
187         helper that implement a save/restore stack for CheckState
188         values.  This is the only way to change check-state.
189         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
190         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
191         (CheckedExpr.EmitBranchable): New forwarding method.
192         (UnCheckedExpr): Likewise.
193         * statement.cs (Block.ResolveMeta): Use WithCheckState.
194         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
195         (Checked.Resolve, checked.DoEmit): Likewise.
196
197 2006-07-20  Miguel de Icaza  <miguel@novell.com>
198
199         * anonymous.cs: Cache the resolved anonymous delegate, and return
200         this so that the ResolveTopBlock is only triggered once, not
201         twice.
202
203         Currently we trigger ResolvetopBlock twice due to a first pass of
204         argument check compatibility, and a second pass that does the
205         actual resolution.   
206         
207 2006-07-16  Marek Safar  <marek.safar@seznam.cz>
208
209         A fix for #70506
210         * driver.cs (MainDriver): When a file extension is missing,
211         use a default one.
212
213 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
214
215         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
216         modifiers.
217         * rootcontext.cs (Reset): Add helper_classes.
218
219 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
220
221         A fix for #78860
222         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
223         correctly.
224
225 2006-07-13  Miguel de Icaza  <miguel@novell.com>
226
227         * statement.cs (Lock): Handle expressions of type
228         TypeManager.null_type specially.  Fixes #78770
229
230 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
231
232         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
233         to an event.
234
235 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
236
237         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
238         for accessors as well.
239         * ecore.cs (EventExpr): Add AccessorTable.
240
241 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
242
243         A fix for #78738
244         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
245         for CS0122 where appropriate.
246         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
247         level attributes.
248         (Filter): Assembly can be null in the case of top level attributes.
249
250 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
251
252         A fix for #78690
253
254         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
255         is done at global level.
256
257 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
258
259         A fix for #77002, Implemented TypeForwarder support.
260
261         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
262         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
263         * typemanager.cs (): Add type_forwarder_attr_type.
264
265 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
266
267         * report.cs: Add CS0469 warning.
268
269 2006-06-21  Martin Baulig  <martin@ximian.com>
270
271         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
272         the `try'-block, so we also report CS0016 etc. there.
273
274 2006-06-21  Martin Baulig  <martin@ximian.com>
275
276         * delegate.cs
277         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
278
279 2006-06-21  Martin Baulig  <martin@ximian.com>
280
281         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
282         also report CS1686 for parameters.
283
284 2006-06-21  Martin Baulig  <martin@ximian.com>
285
286         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
287         instead of an error if the value is not implicitly convertible to
288         the switch types; fixes #77964.
289
290 2006-06-21  Raja R Harinath  <rharinath@novell.com>
291
292         Fix #78673
293         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
294         FieldBuilder is null.
295
296         Fix #78662
297         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
298         'left' and 'right' before error-checking.
299
300 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
301
302         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
303         Fixed bug #78601.
304         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
305         (FieldExpr.DoResolve): likewise.
306         (PropertyExpr.InstanceResolve): likewise.
307         (EventExpr.InstanceResolve): likewise. 
308
309 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
310
311         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
312         attribute applicable tests for attribute argument.
313
314 2006-06-02  Raja R Harinath  <rharinath@novell.com>
315
316         Fix #78079
317         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
318         (Binary.OverloadResolve_PredefinedIntegral): New.
319         (Binary.OverloadResolve_PredefinedFloating): New.
320         (Binary.OverloadResolve_PredefinedString): New.
321         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
322         Follow the standard more closely, and treat numeric promotions in
323         terms of overload resolution.
324         (Binary.CheckShiftArguments): Simplify.
325
326 2006-06-01  Raja R Harinath  <rharinath@novell.com>
327
328         * flowanalysis.cs (MyBitVector): Simplify representation.
329         (MyBitVector.Clone): Avoid allocating BitArray.
330         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
331         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
332         (*): Update.  Change all references to MyBitVector.And and
333         MyBitVector.Or to &= and |=.
334
335 2006-05-29  Raja R Harinath  <rharinath@novell.com>
336
337         Fix cs0231-[34].cs.
338         * cs-parser.jay (formal_parameter_list): Extend the pattern below
339         to param arguments too.
340
341 2006-05-26  Miguel de Icaza  <miguel@novell.com>
342
343         * cs-parser.jay: Catch another parsing form for arglist being
344         followed by other arguments.  Fixes #78313.
345
346 2006-05-24  Raja R Harinath  <rharinath@novell.com>
347
348         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
349         checking of out parameters to ...
350         (FlowBranchingToplevel.Merge): ... here.
351         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
352         set, propagate the origin upward, and only complain if there was
353         no other error.
354         (FlowBranchingException.AddContinueOrigin): Likewise.
355         (FlowBranchingException.AddReturnOrigin): Likewise.
356         (FlowBranchingException.AddGotoOrigin): Likewise.       
357
358 2006-05-23  Raja R Harinath  <rharinath@novell.com>
359
360         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
361         unreachable, skip it.
362         (FlowBranchingException.Merge): Always propagate jumps, even if
363         the finally block renders subsequent code unreachable.
364
365 2006-05-18  Raja R Harinath  <rharinath@novell.com>
366
367         Fix #77601
368         * statement.cs (Goto.Resolve): Move responsibility for resolving
369         'goto' to FlowBranching.AddGotoOrigin.
370         (Goto.SetResolvedTarget): New.  Callback to set the
371         LabeledStatement that's the target of the goto.
372         (Goto.DoEmit): Use Leave instead of Br when crossing an
373         unwind-protect boundary.
374         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
375         LookupLabel and adjust to new semantics.
376         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
377         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
378         Goto.SetResolvedTarget to update target.
379         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
380         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
381         AddBreakOrigin & co.  Delay propagation until ...
382         (FlowBranchingException.Merge): ... this.
383
384         * statement.cs (Block.Resolve): Always depend on flow-branching to
385         determine unreachability.  Kill workaround that originally emitted
386         only one statement after an "unreachable" label (see infloop in
387         test-515.cs).
388
389         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
390         This is still "wrong", but anything better would probably need a
391         multi-pass algorithm.
392         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
393         usage vector.  Force current usage vector to be reachable, to
394         optimistically signify backward jumps.
395         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
396         detected.
397         (FlowBranchingLabeled.Merge): New.  If no backward jump was
398         detected, return the original salted-away usage vector instead,
399         updated with appropriate changes.  Print unreachable warning if
400         necessary.
401         * statement.cs (Block.Resolve): Don't print unreachable warning on
402         a labeled statement.
403
404 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
405
406         * driver.cs: Pass filename without path to AssemblyBuilder's 
407         AddResourceFile. Fixes bug #78407.
408
409 2006-05-17  Raja R Harinath  <rharinath@novell.com>
410
411         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
412         * flowanalysis.cs (FlowBranchingLabeled): ... here.
413         (FlowBranching.MergeChild): Overwrite
414         reachability information from Labeled branchings too.
415
416 2006-05-16  Raja R Harinath  <rharinath@novell.com>
417
418         * statement.cs (Goto.Resolve): Merge jump origins here ...
419         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
420
421         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
422         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
423         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
424         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
425         here, ...
426         * statement.cs (Goto.Resolve): ... not here.
427         (Goto.Emit): Remove CS1632 check.
428
429 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
430
431         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
432         error message.
433
434 2006-05-11  Raja R Harinath  <rharinath@novell.com>
435
436         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
437         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
438         (FlowBranchingException.Label): Likewise.
439
440         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
441         given value.
442         (MyBitVector.Or): Use it to avoid losing information (Count).
443         (FlowBranching.MergeOrigins): Likewise.
444
445         * flowanalysis.cs (UsageVector.IsDirty): Remove.
446         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
447         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
448         (UsageVector.ToString): Simplify.
449         (UsageVector.MergeSiblings): Move here from ...
450         (FlowBranching.Merge): ... here.
451         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
452         not a MyBitVector.
453
454 2006-05-10  Raja R Harinath  <rharinath@novell.com>
455
456         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
457         null bitvector is treated as all-true.
458
459         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
460         (MyBitVector): Rationalize invariants.  'vector != null' implies
461         that we have our own copy of the bitvector.  Otherwise,
462         'InheritsFrom == null' implies all inherited bits are true.
463
464 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
465
466         * statement.cs (LocalInfo): Add IsConstant.
467         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
468         local variable for constants.
469
470 2006-05-09  Raja R Harinath  <rharinath@novell.com>
471
472         * flowanalysis.cs (MyBitVector.Empty): New.
473         (MyBitVector): Don't allow InheritedFrom to be null.
474         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
475         (UsageVector, FlowBranching): Update to changes.
476
477         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
478         recursion.  The 'Parent == null' condition isn't sufficient for
479         anonymous methods.
480         (FlowBranching.AddBreakOrigin): Likewise.
481         (FlowBranching.AddContinueOrigin): Likewise.
482         (FlowBranching.AddReturnOrigin): Likewise.
483         (FlowBranching.StealFinallyClauses): Likewise.
484         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
485         (FlowBranching.CheckOutParameters): Likewise.
486         (FlowBranchingToplevel): Terminate all the above recursions here.
487         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
488         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
489
490         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
491         toplevel block.
492         (FlowBranchingToplevel): New.  Empty for now.
493         (FlowBranching.MergeTopBlock): Update.
494         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
495         branching for the anonymous delegate.
496         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
497
498         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
499         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
500         information at the start of the merge.  Reorganize.
501
502 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
503
504         * class.cs (MethodData.Define): Method cannot implement interface accessor.
505
506 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
507
508         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
509         to newly introduced ctor.
510
511         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
512         message to one place.
513         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
514         global namespace.
515
516 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
517
518         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
519
520         * ecore.cs (Expression.ResolveAsConstant): Updated.
521
522         * statement.cs (ResolveMeta): Updated.
523
524 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
525
526         * cs-parser.jay: __arglist cannot be used in initializer.
527
528 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
529
530         A fix for #77879
531         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
532         private types.
533
534 2006-05-05  Raja R Harinath  <rharinath@novell.com>
535
536         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
537         (LabeledStatement): Add 'name' parameter.
538         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
539         (Block.AddLabel): Update to changes.
540         * cs-parser.jay (labeled_statement): Likewise.
541
542         * flowanalysis.cs (BranchingType.Labeled): New.
543         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
544         (FlowBranchingLabeled): New.  Does nothing for now, but will
545         eventually handle 'goto' flows.
546         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
547         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
548         that's terminated ...
549         (Block.Resolve): ... here.
550
551         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
552         (UsageVector.MergeFinallyOrigins): Likewise.
553         (FlowBranching.InTryOrCatch): Likewise.
554         (FlowBranching.AddFinallyVector): Likewise.
555         (FlowBranchingException): Update to changes.
556
557         Fix #78290
558         * statement.cs (Return.Resolve): Move error checking to ...
559         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
560         (FlowBranchingException): Handle return origins like break and
561         continue origins.
562         (FlowBranching.UsageVector.CheckOutParameters): Remove.
563
564 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
565
566         A fix for #76122
567         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
568         filter.
569
570 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
571
572         A fix for #77543
573         * class.cs (MethodData.Define): Do public accessor check only when method
574         implements an interface.
575
576 2006-05-04  Raja R Harinath  <rharinath@novell.com>
577
578         Remove special handling of 'break'
579         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
580         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
581         (UsageVector.Break): Remove.
582         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
583         reachability.
584         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
585
586         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
587         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
588
589 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
590
591         A fix for #75726
592         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
593         be the interface member.
594
595 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
596
597         A fix for #60069
598         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
599         for emitting small (int) values.
600
601 2006-05-03  Raja R Harinath  <rharinath@novell.com>
602
603         Fix #59427
604         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
605         control-flow passes through the 'finally' after merging-in all the
606         control-flows from 'try' and the 'catch' clauses.
607
608         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
609         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
610         always true at the only non-recursive entry point.
611         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
612         FlowBranchingBreakable.
613         (FlowBranchingLoop): Remove.
614         * statement.cs (Return.DoResolve): Update to changes.
615
616         Fix #76471, #76665
617         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
618         (FlowBranching.CreateBranching): Handle it: create a
619         FlowBranchingContinuable.
620         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
621         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
622         except that it handles the 'continue' command.
623         (FlowBranching.UsageVector.MergeOrigins): Rename from
624         MergeBreakOrigins.
625         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
626         except that it overrides AddContinueOrigin.
627         (FlowBranchingException): Override AddContinueOrigin, similar to
628         AddBreakOrigin.
629         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
630         Create a new branching around the embedded statement.
631         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
632         control flow after the embedded statement.
633         (Continue.Resolve): Move all error checking to AddContinueOrigin.
634
635         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
636         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
637         FlowBranchingBreakable.
638         (FlowBranchingSwitch): Remove.
639
640         Fix test-503.cs
641         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
642         error reporting to ...
643         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
644         Rename from 'AddBreakVector'.  Add new location argument.  Return
645         a bool indicating whether the 'break' crosses an unwind-protect.
646         (FlowBranchingException.AddBreakOrigin): Add.
647         (FlowBranchingException.Merge): Propagate 'break's to surrounding
648         flowbranching after updating with the effects of the 'finally'
649         clause.
650         (FlowBranchingBreakable): New common base class for
651         FlowBranchingLoop and FlowBranchingSwitch.
652
653         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
654         embedded statement.
655         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
656
657 2006-05-02  Raja R Harinath  <rharinath@novell.com>
658
659         * statement.cs (Do.Resolve): If the loop is infinite, set the
660         barrier.
661         (While.Resolve, For.Resolve): Set a barrier after the embedded
662         statement.  There's no direct control flow that goes from the end
663         of the embedded statement to the end of the loop.
664         * flowanalysis.cs (FlowBranching.Infinite): Remove.
665         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
666         above ensure that the reachability is correctly computed.
667
668         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
669         (UsageVector.MergeBreakOrigins): If the current path is
670         unreachable, treat it as if all parameters/locals are initialized.
671         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
672         infinite loops before merging-in break origins.
673
674         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
675         (Reachability.Reachable): Split part into ...
676         (Reachability.Unreachable): ... this.  Simplify.
677         (Reachability.IsUnreachable): Use 'Unreachable' instead.
678
679         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
680         (Reachability.SetThrowsSometimes): Likewise.
681         (FlowBranchingBlock.MergeTopBlock): Don't compare against
682         TriState.Always, use corresponding property.
683         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
684         (Block.Resolve): Likewise.  Remove some redundant checks.
685
686 2006-05-02  Raja R Harinath  <harinath@gmail.com>
687
688         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
689         (Reachability.Meet): Don't bother checking AlwaysThrows --
690         barrier is always set.
691         (FlowBranchingBlock.Merge): Likewise.
692
693 2006-05-01  Raja R Harinath  <harinath@gmail.com>
694
695         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
696         checks for unreachable.
697
698 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
699
700         A fix for #77980
701         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
702
703         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
704         whether field is really assigned.
705
706 2006-04-30  Raja R Harinath  <harinath@gmail.com>
707
708         * flowanalysis.cs (Reachability): Make 4-argument constructor
709         private.
710         (Reachability.Meet): Rename from 'And'.  Remove static variant.
711         (Reachability.Always): Rename from the highly misleading
712         'Reachability.Never'.
713         (FlowBranching.Merge): Update to changes.  Mark an impossible
714         situation with a 'throw'.
715         (*): Update to changes.
716
717 2006-04-29  Raja R Harinath  <harinath@gmail.com>
718
719         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
720         Remove 'Undefined'.
721         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
722         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
723         (*): Update to changes.
724         * statement.cs: Update to changes.
725
726 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
727
728         A fix for #78049
729         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
730
731 2006-04-28  Raja R Harinath  <harinath@gmail.com>
732
733         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
734         dummy UsageVector.
735
736         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
737         argument to two arguments: an usage-vector and a bool.  Move call
738         to FlowBranching.Merge () ...
739         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
740
741         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
742         handling of loop and switch reachability to ...
743         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
744
745 2006-04-27  Raja R Harinath  <harinath@gmail.com>
746
747         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
748         handling to FlowBranchingLoop.InLoop.
749         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
750
751 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
752
753         A fix for #78115
754         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
755         anonymous method is allowed from AnonymousContainer here.
756
757         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
758
759 2006-04-24  Raja R Harinath  <rharinath@novell.com>
760
761         Fix #78156
762         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
763
764 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
765
766         A fix for #49011.
767         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
768         (DoubleConstant.Reduce): Ditto.
769
770 2006-04-23  Raja R Harinath  <rharinath@novell.com>
771
772         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
773         Remove 'lvalue_right_side' argument.  Move parts to ...
774         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
775         (LocalVariable.DoResolveLValue): ... these.
776
777 2006-04-21  Raja R Harinath  <rharinath@novell.com>
778
779         Fix cs1655.cs
780         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
781         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
782         (LocalVariableReference.DoResolveBase): Use it to implement new
783         CS1655 check.
784         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
785         (Argument.Resolve): Simplify.  Move CS1510 check ...
786         * ecore.cs (Expression.ResolveLValue): ... here.
787         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
788         (PropertyExpr.DoResolveLValue): Likewise.
789         (FieldExpr.Report_AssignToReadonly): Likewise.
790         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
791         LValueMemberAccess or LValueMemberOutAccess on instance depending
792         on it.
793         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
794         DoResolve as appropriate.
795
796 2006-04-20  Raja R Harinath  <rharinath@novell.com>
797
798         Fix #75800
799         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
800         implicit conversions on 'out' and 'ref' arguments.
801
802         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
803         improve clarity.  Remove dead code.
804
805         Fix #66031
806         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
807         (Catch.Resolve): Resolve VarBlock if it exists.
808
809 2006-04-19  Miguel de Icaza  <miguel@novell.com>
810
811         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
812         twice, this was some residual code, the enumerator was emitted
813         properly in the two branche of if later.
814
815 2006-04-19  Raja R Harinath  <rharinath@novell.com>
816
817         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
818         cast is never an lvalue.
819         (Cast.DoResolve, Cast.ResolveRest): Combine.
820         (Argument.Emit): Simplify slightly.  Move 'Expr is
821         IMemoryLocation' check ...
822         (Argument.Resolve): ... here.
823         (Argument.Error_LValueRequired): Remove.  Inline into only user.
824
825         Simplifications.  Fix cs0191-2.cs
826         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
827         CS1649 and CS1651 to ...
828         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
829         the actual selection of the error code and message to a lookup
830         table.  Add a dummy return value to simplify callsites.
831         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
832         readonly fields of other instances of the same type.  Move CS0197
833         warning from ...
834         * expression.cs (Argument.Resolve): ... here.  Simplify code.
835         Ensure that ec.InRefOutArgumentResolving is only set during LValue
836         resolution of an out or ref argument.  The code simplification
837         above uses this invariant.
838
839 2006-04-18  Raja R Harinath  <rharinath@novell.com>
840
841         Possibly fix #77752.  Fix cs1690-[4-7].cs.
842         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
843         CheckMarshallByRefAccess.  Drop parameter.
844         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
845         warning.
846         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
847         InstanceExpression.
848         * report.cs (AllWarnings): Add CS1690.
849         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
850         for ref access too.
851         (LocalVariableReference.DoResolveBase): Update.
852
853 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
854
855         * class.cs (MethodOrOperator): Moved common parts from method class.
856         detect obsolete attributes.
857         (Method.Define): Simplified as it reuses code from base.
858         (Constructor.ValidAttributeTargets): Fixed issue found during
859         refactoring.
860         (Destructor.ValidAttributeTargets): Fixed issue found during
861         refactoring.
862         (Operator): Finished refactoring set off by #78020. Operator class is now
863         ordinary method class.
864
865         * anonymous.cs: Updated.
866
867         * decl.cs (DeclSpace): Add IsGeneric
868
869 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
870
871         * class.cs (Constructor.Emit): Don't emit the attributes twice.
872
873 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
874
875         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
876         detect obsolete attributes.
877         (Method.CreateEmitContext): Moved to MethodOrOperator.
878
879 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
880
881         A fix for #78048.
882         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
883         customized exception to make crash detection easier.
884         (MethodOrOperator): Started to work on new base class for methods and
885         operators.
886         (Method): Derives from MethodOrOperator.
887         (Constructor.Emit): Emits its own attributes.
888         (AbstractPropertyEventMethod.Emit): Ditto.
889         (Operator): Derives from MethodOrOperator, will refactor fully in extra
890         patch.
891         (Operator.Emit): It's temporary more tricky than should be.
892         
893         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
894
895         * report.cs (InternalErrorException): Add ctor with inner exception.
896
897 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
898
899         A fix for #76744.
900         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
901         only not visible.
902
903 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
904
905         A fix for #77916.
906         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
907         array.
908
909 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
910
911         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
912         attribute is present and Guid not.
913         (Interface.ApplyAttributeBuilder): Ditto.
914
915         * attribute.cs: Add error message.
916
917 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
918
919         A fix for #78020.
920
921         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
922         sources (it's composite) so hold them in extra array as they are used in
923         Emit phase only. It worked in the previous versions by mistake.
924         (Attribute.Emit): Emit attribute for more owners when exist.
925
926         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
927         it has now different behaviour.
928
929 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
930
931         * constant.cs (Constant.IsDefaultInitializer): New method.
932
933         * class.cs: Updated.
934
935         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
936         re-initialize default values. It saves KBs almost for every assembly.
937         Thanks Zoltan for the idea.
938         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
939         (ArrayCreation.DoResolve): Resolve only once.
940         (ArrayCreation.Emit): Emit static initializer only when it is faster.
941         (ArrayCreation.GetAttributableValue): Cope with optimized values.
942
943 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
944
945         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
946         From #77961.
947
948 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
949
950         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
951         in an embedded statement too.
952
953 2006-04-01  Raja R Harinath  <rharinath@novell.com>
954
955         Fix #77958
956         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
957
958 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
959
960         A fix for #77966.
961
962         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
963         was not specified.
964
965         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
966
967 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
968
969         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
970         phase.
971
972         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
973         LocalTemporary change.
974
975         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
976         TypeContainer.
977         (ClassOrStruct.DefineFieldInitializers): Implemented static field
978         initializers optimization.
979         (ClassOrStruct.TypeAttr): Moved from modifiers.
980         (Constructor.CheckBase): Don't crash when static ctor has parameters.
981         (FieldBase.ResolveInitializer): Resolves initializer.
982         (FieldBase.HasDefaultInitializer): New property.
983
984         * cs-parser.jay: Removed message.
985
986         * expression.cs (CompilerGeneratedThis): New specialization.
987
988         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
989
990 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
991
992         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
993
994 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
995
996         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
997         be now EnumConstants only.
998
999 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1000
1001         * attribute.cs, driver.cs: Reset more caches.
1002
1003 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1004
1005         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1006
1007 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1008
1009         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1010         for easier reuse. Updated all overrides.
1011         (IntegralConstant): New base class for all integral constants.
1012         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1013         of the constant range, report custom error.
1014         (UIntConstant.Reduce): Fixed uint conversion.
1015
1016         * ecore.cs, literal.cs: Reduce updates.
1017
1018 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1019
1020         A fix for #75813.
1021
1022         * class.cs (Constructor.Define): Removed extra if for default ctors.
1023         A patch from Atsushi Enomoto.
1024
1025 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1026
1027         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1028         GetAttributableValue.
1029
1030         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1031         when required.
1032
1033         * convert.cs (ImplicitConversionRequired): Error message moved to
1034         DoubleLiteral.
1035
1036         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1037         automatic implicit conversion of an output value.
1038         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1039
1040         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1041         conversion.
1042         (TypeOf.GetAttributableValue): Add extra handling for object type.
1043
1044         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1045         special error message.
1046
1047 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1048
1049         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1050         InternalCall.
1051         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1052         compatible with MS runtime.
1053
1054 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1055
1056         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1057         attribute arguments here.
1058
1059         * class.cs (Indexer.Define): The check was moved to attribute class.
1060
1061 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
1062
1063         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1064         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1065         easier.
1066
1067 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1068
1069         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1070         mcs to keep code differences small.
1071         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1072         * typemanager.cs (parameter_default_value_attribute_type): New.
1073         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1074         CS1908 check.
1075
1076 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1077
1078         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1079
1080 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1081
1082         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1083
1084         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1085         the blocks too.
1086
1087 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1088
1089         * doc-bootstrap.cs : fix build.
1090
1091 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1092
1093         * expression.cs (StringConcat.Append): Issue a warning when empty string
1094         is going to append.
1095
1096 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1097
1098         * assign.cs (CompoundAssign.ResolveSource): Removed.
1099
1100         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1101         clean up.
1102
1103         * class.cs (TypeContainer.FindMethods): Removed.
1104         (TypeContainer.CheckMemberUsage): Made static.
1105
1106         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1107
1108         * constant.cs (CheckRange): Removed unused type argument.
1109         (CheckUnsigned): Removed unused type argument.
1110
1111         * cs-parser.jay: Updated after MemberAccess clean up.
1112         Uses Length for empty string test.
1113
1114         * cs-tokenizer.cs: Uses Length for empty string test.
1115         (IsCastToken): Made static.
1116         (is_hex): Made static.
1117         (real_type_suffix): Made static.
1118
1119         * decl.cs (SetupCache): Made static.
1120         (OnGenerateDocComment): Removed unused ds argument.
1121
1122         * delegate.cs (VerifyDelegate): Removed unused argument.
1123
1124         * doc.cs: Uses Length for empty string test.
1125
1126         * driver.cs: Uses Length for empty string test.
1127
1128         * enum.cs (IsValidEnumType): Made static
1129
1130         * expression.cs (EnumLiftUp): Removed unused argument.
1131         (ResolveMethodGroup): Ditto.
1132         (BetterConversion): Ditto.
1133         (GetVarargsTypes): Ditto.
1134         (UpdateIndices): Ditto.
1135         (ValidateInitializers): Ditto.
1136         (MemberAccess.ctor): Ditto.
1137         (GetIndexersForType): Ditto.
1138
1139         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1140
1141         * iterators.cs: Updated after MemberAccess clean up.
1142
1143         * location.cs: Uses Length for empty string test.
1144
1145         * namespace.cs: Uses Length for empty string test.
1146
1147          * report.cs (CheckWarningCode): Made static.
1148
1149         * statement.cs (LabeledStatement): Removed unused argument.
1150
1151         * typemanager.cs (FilterNone): Removed.
1152
1153 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1154
1155         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1156         obsolete.
1157
1158         * class.cs: Updated.
1159
1160 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1161
1162         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1163
1164 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1165
1166         A fix for #77822.
1167
1168         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1169         reporting, it's more tricky than I thought.
1170
1171 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1172
1173         A fix for #77816.
1174
1175         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1176         host container.
1177         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1178         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1179         Add more error reporting; Fixed issue with params.
1180
1181         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1182
1183         * cs-parser.jay: AnonymousMethod requires host container.
1184
1185         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1186
1187 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1188
1189         * class.cs: Change 'TypeContainer ds' constructor argument to
1190         'DeclSpace parent'.  Some classes were missed below due to
1191         different naming convention.
1192
1193         * class.cs (MemberCore.Parent): Delete.  This makes the
1194         ParentContainer changes below enforceable by the compiler.
1195
1196         Treat pointers to enclosing declaration space as 'DeclSpace', not
1197         'TypeContainer'.
1198         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1199         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1200
1201         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1202         of TypeContainer.
1203         (Block.AddThisVariable): Likewise.
1204         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1205         (AbstractPropertyEventMethod.Emit): Likewise.
1206         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1207         (GetMethod.Define, SetMethod.Define): Likewise.
1208         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1209         (DelegateMethod.EmitMethod): Likewise.
1210
1211         Fix regression test-partial-13.cs.
1212         Rationalize use of PartialContainer.  Ensure that the partial
1213         class semantics can be tied to type-correctness, i.e., any
1214         violation will cause a compile error.
1215         * class.cs, const.cs: Access all fields that belong to class
1216         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1217         Resolve()-like functions still use 'Parent'.
1218
1219         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1220         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1221         (PropertyMethod.CheckModifiers): Remove unused argument.
1222         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1223         DeclSpace.
1224
1225 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1226
1227         Make semantics of PartialContainer simpler.
1228         * decl.cs (DeclSpace.IsPartial): Remove.
1229         * class.cs (TypeContainer.IsPartial): Likewise.
1230         (TypeContainer..ctor): Set PartialContainer to point to self.
1231         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1232         (TypeContainer.FindNestedType): Likewise.
1233         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1234
1235 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1236
1237         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1238
1239 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1240
1241         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1242         classes.
1243
1244 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1245
1246         * class.cs (Operator.Define): An error for base conversion was not
1247         reported correctly.
1248
1249 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1250
1251         * iterator.cs : yield break is allowed in try statement which has
1252           catch clauses. Fixed bug #77767.
1253
1254 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1255
1256         A fix for #77593, #77574.
1257
1258         * class.cs (MethodCore.CheckBase): Another if for operator.
1259
1260 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1261
1262         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1263         were not resolved
1264
1265         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1266         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1267         conversion test.
1268         
1269         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1270         not needed.
1271
1272         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1273         Updated after another emitcontext usage was clean up. It should help us to
1274         synchronize with gmcs easier.
1275
1276 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1277
1278         A fix for #77353.
1279
1280         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1281         (Event.Define): ditto
1282         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1283
1284         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1285         Removed redundant code and set NewSlot for Invoke method too.
1286
1287         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1288         (Parameters.MergeGenerated): New method. Use this method when you merge
1289         compiler generated argument with user arguments.
1290
1291 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1292
1293         * attribute.cs (ResolveAsTypeTerminal): Removed.
1294
1295         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1296         specialization for predefined types; 30% speed up.
1297         Finally placed obsolete check to right place.
1298         (Expression.ResolveType): Removed.
1299
1300         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1301         Updated after ResolveType was removed.
1302
1303         * expression.cs (Cast.ctor): Check void cast.
1304         (Binary.ResolveAsTypeTerminal): Is never type.
1305         (Conditional.ResolveAsTypeTerminal): Is never type.
1306
1307         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1308
1309 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1310
1311         Fix #77679.
1312         * expression.cs (ParameterReference.DoResolveBase): Change return
1313         type to bool.
1314         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1315         Update.
1316
1317         Fix #77628.
1318         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1319
1320         Fix #77642.
1321         * typemanager.cs (GetFullNameSignature): Don't nullref on
1322         protected accessors.
1323
1324 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1325
1326         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1327         these two separated members to simplify the code.
1328         (Attribute.Resolve): Refactored to use new fields and methods.
1329         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1330         implemented obsolete attribute checking.
1331         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1332         implemented obsolete checking again. It look line never ending quest ;-)
1333         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1334
1335         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1336
1337         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1338
1339         *class.cs (Property.Define): Add RegisterProperty call.
1340
1341         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1342         argument groups (only 2).
1343
1344         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1345         encoding expression to arguments.
1346         (Expression.ExprClassToResolveFlags): Just turned to property.
1347
1348         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1349         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1350         optimized as well as implemented support for zero-length attributes.
1351
1352         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1353         Add caching of PropertyInfo's.
1354
1355 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1356
1357         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1358         error multiple times.
1359
1360 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1361
1362         New partial class implementation.
1363         A fix for #77027, #77029, #77403
1364
1365         * attribute.cs (Attributable): Made attributes protected.
1366
1367         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1368         the replacements of ClassPart and PartialContainer.
1369         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1370         (TypeContainer.AddInterface): Ditto.
1371         (TypeContainer.AddPartial): The main method for partial classes. It checks
1372         for errors and merges ModFlags and attributes. At the end class is added to
1373         partial_parts list.
1374         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1375         required here.
1376         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1377         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1378         from the rest of partial classes.
1379         (TypeContainer.GetClassBases): Simplified.
1380         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1381         DefineType.
1382         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1383         (TypeContainer.HasExplicitLayout): Uses Flags now.
1384         (PartialContainer): Removed.
1385         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1386         (StaticClass): Was merged with Class.
1387         (Class.GetClassBases): class and static class bases are verified here.
1388         (Class.TypeAttr): Added static attributes when class is static.
1389         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1390         (MemberBase): In some cases we need to call parent container for partial
1391         class. It should be eliminated but it's not easy now.
1392
1393         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1394
1395         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1396         partial classed to accumulate class comments.
1397         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1398
1399         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1400
1401         * driver.cs (MainDriver): Tree.GetDecl was removed.
1402
1403         * modifiers.cs (Modifiers): Add partial modifier.
1404
1405         * tree.cs (Tree.decl): Removed.
1406         (RootTypes): Started to use this class more often for root types
1407         specializations.
1408
1409 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1410
1411         A fix for #77615
1412
1413         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1414         external interface does not have an attribute.
1415
1416 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1417
1418         Another prerequisites for new partial classs implementation.
1419         
1420         * attribute.cs (Attribute.Equal): Implemented.
1421         (Attribute.Emit): Changed as attributes can be applied more than twice.
1422         (Attributes.Emit): Check for duplicate attributes here.
1423
1424         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1425         as a parameter, clean-up.
1426
1427 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1428
1429         A fix for #77485
1430
1431         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1432         contains obsolete attribute check which can in some cases look for base
1433         type of current class which is not initialized yet.
1434         (TypeContainer.BaseType): Replacement of ptype.
1435
1436         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1437
1438 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1439
1440         First of prerequisites for new partial classs implemention.
1441         
1442         * attribute.cs (Attributable): Extended by ResolveContext;
1443         Attributes finally have correct context for resolving in all cases.
1444         (AttachTo): Attribute owner is assigned here.
1445
1446         * codegen.cs (IResolveContext): Introduce new interface to hold
1447         all information needed in resolving phase.
1448         (EmitContext): Implements IResolveContext; more clean-up needed here.
1449         
1450         * decl.cs (MemberCore): Implemented IResolveContext.
1451
1452         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1453         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1454         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1455         Refactored to use new IResolveContext instead of EmitContext; cleanup
1456
1457 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1458
1459         * codegen.cs (EmitScopeInitFromBlock): check here the
1460         capture_context, there is no need to make two calls to the
1461         EmitContext. 
1462
1463         * anonymous.cs: Add some debugging messages that might help me
1464         track other instances of this problem in the future (the
1465         regression of test 467).
1466
1467         * cs-parser.jay: track the variable block, as we need to initalize
1468         any captured variables declared in this block for the "catch"
1469         portion of the "Try" statement.
1470
1471         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1472         scope initialization for captured variables. 
1473
1474         Also, move the emit for the variables after the block location has
1475         been marked.
1476
1477 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1478
1479         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1480
1481 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1482
1483         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1484         commit yesterday, the initialization for the roots is necessary.
1485         What is not necessary is the scope activation.
1486
1487 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1488
1489         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1490         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1491         CS0206 checks.
1492         (Argument.Resolve): Remove CS0206 checks.
1493
1494 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1495
1496         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1497         scopes for all the roots, the scopes will now be emitted when the
1498         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
1499
1500         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1501         code.  This reduces a lot of existing cruft.
1502         
1503         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1504         that the ScopeInfo is generated as we enter the scope, not at the
1505         time of use, which is what we used to do before.
1506
1507         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1508         every time a Block is about to be emitted if we have a
1509         CaptureContext. 
1510
1511 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1512
1513         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1514         (Reset): Update.
1515         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1516
1517         * typemanager.cs (cons_param_array_attribute): Make private.
1518         (Reset): Set it to null.
1519         (InitCoreHelpers): Don't initialize it.
1520         (ConsParamArrayAttribute): New.  Initialize it as needed.
1521         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1522
1523 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1524
1525         * expression.cs: There might be errors reported during the
1526         selection of applicable methods.  If there are errors, do not
1527         continue execution as it will lead the compiler to crash.
1528
1529 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1530
1531         * expression.cs: Member access is not allowed on anonymous
1532         methods.  Fixes #77402.
1533
1534 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1535
1536         Fix #77401
1537         * cs-parser.jay (VariableDeclaration): Don't set
1538         current_array_type to null.
1539         (field_declaration, event_declaration, declaration_statement):
1540         Set it to null here.
1541
1542 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1543
1544         * typemanager.cs (GenericParameterPosition): New.
1545         * doc.cs: Use it.
1546
1547 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1548
1549         * doc.cs : To process "include" elements, first we should create
1550           another list than XmlNodeList, because it could result in node
1551           removal, which could result in that the XmlNodeList gives up
1552           yielding next node.
1553
1554           (Also made code identical to gmcs again.)
1555
1556 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1557
1558         * ecore.cs: Introduce an error report that we were not catching
1559         before, if not silent, we must report the error.  Gonzalo ran into
1560         it.
1561
1562 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1563
1564         A fix for bug: #76957
1565         
1566         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1567         ComputeMethodHost before creating the method, this is a new
1568         requirement. 
1569
1570         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1571         that this method references (RegisterScope).  The actual scope
1572         where the method is hosted is computed with the ComputeMethodHost
1573         before we create the method.
1574
1575         Moved the Deepest routine here.
1576
1577         (AnonymousContainer.ComputeMethodHost): New routine used to
1578         compute the proper ScopeInfo that will host the anonymous method.
1579
1580         (ScopeInfo): Deal with multiple roots.  The problem was that we
1581         did not have a unique root where all ScopeInfos could be hanged
1582         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1583         of roots.  
1584
1585         Remove AdjustMethodScope which is now computed at the end.  Remove
1586         LinkScope which did a partial link, instead link all ScopeInfos
1587         before code generation from the new "LinkScopes" routine. 
1588
1589         Simplify all the Add* routines as they no longer need to maintain
1590         the tree, they just need to record that they are using variables
1591         from a ScopeInfo.
1592
1593         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1594         routines to produce the forest of ScopeInfo trees.
1595
1596         * class.cs (TypeContainer.AppendMethod): This is just like
1597         AddMethod, but ensures that an interface implementation method
1598         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1599         methods, but at the end.
1600
1601         We use this functionality to ensure that the generated MoveNext
1602         method in the iterator class is resolved/emitted before the
1603         enumerator methods created.   
1604
1605         This is required because the MoveNext method computes the right
1606         ScopeInfo for the method.  And the other methods will eventually
1607         need to resolve and fetch information computed from the anonymous
1608         method. 
1609
1610 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1611             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1612
1613         Fix rest of #76995.
1614         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1615         the 'aliases' hash.
1616         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1617         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1618
1619 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1620
1621         Fix #76656, cs0231-2.cs.
1622         * cs-parser.jay (formal_parameter_list): Make error case catch
1623         more issues.
1624         (parenthesized_expression_0): Add CS1026 check.
1625         (invocation_expression): Remove unused { $$ = lexer.Location }.
1626
1627 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1628
1629         Fix #76824.
1630         * cs-parser.jay (statement_expression): Don't list out the
1631         individual statement-expressions.  Convert syntax error into
1632         CS0201 check.
1633
1634 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1635
1636         Fix #76874.
1637         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1638         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1639         CheckIntermediateModification.
1640         (FieldExpr.DoResolve): Add new two-argument version that
1641         allows us to resolve the InstanceExpression as an lvalue.
1642         The one-argument variant is now just a wrapper.
1643         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1644         Resolve the lhs as an lvalue if the it has a value type.
1645         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1646         from Assign.DoResolve.
1647         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1648         resolved as an lvalue.
1649         (PropertyExpr.DoResolve): Update.
1650         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1651         has a value type.  Move CS1612 check here from
1652         CheckIntermediateModification.
1653         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1654         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1655         'right_side' of a ResolveLValue on an 'out' argument.
1656         (EmptyExpression.LValueMemberAccess): New.  Used as the
1657         'right_side' of a propagated ResolveLValue on a value type.
1658         (LocalVariableReference.DoResolveBase): Recognize
1659         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1660         Add CS1654 check.
1661         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1662         EmptyExpression.Null.
1663
1664 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1665
1666         * typemanager.cs : added IsGenericParameter(). In mcs it always
1667           return false.
1668         * doc.cs : for generic parameters, use GenericParameterPosition,
1669           not FullName.
1670
1671 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1672
1673         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1674
1675 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1676
1677         This fixes the problem where we used ldfld instead of ldflda to
1678         load the "THIS" pointer on captured parameters, when THIS is a
1679         value type.  See bug #77205.
1680         
1681         * iterators.cs (CapturedThisReference.Emit): Pass false to
1682         EmitThis (we do not need the address).
1683
1684         * codegen.cs (EmitThis): it needs to know whether we need the
1685         address of `this' or not.  This is used by value types.  
1686
1687         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1688         every other call passes false.
1689
1690 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1691
1692         Fix #77221.
1693         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1694         GetOverride.
1695         * expression.cs (Invocation.OverloadResolve): Update.
1696         (Invocation.DoResolve): Avoid double resolution of invocation.
1697
1698 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1699
1700         Fix #77180.
1701         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1702         unary negation of floating point types as 0-expr; negation cannot
1703         overflow in floating point types.
1704
1705         Fix #77204.
1706         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1707         on operands of 'void' type.
1708
1709         Fix #77200.
1710         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1711         and ExclusiveOr for boolean constants too.
1712
1713 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1714
1715         Fix #75636.
1716         * expression.cs (Invocation.OverloadResolve): Replace reflected
1717         override methods with their base virtual methods, rather than
1718         skipping over them.
1719         * typemanager.cs (TypeManager.GetOverride): New.
1720
1721 2006-01-05  Jb Evain  <jbevain@gmail.com>
1722
1723         * class.cs (Property.Define, Indexer.Define): do not tag the
1724         properties as SpecialName | RTSpecialName.
1725
1726 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1727
1728         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1729         doing a low-level comparission of parameter types.  It was lacking
1730         a check for __argslist. 
1731
1732 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1733
1734         * expression.cs (ParameterReference.DoResolveBase): Allow
1735         reference parameters if they are local to this block. 
1736
1737         This allows the ref and out parameters of a delegate to be used in
1738         an anonymous method, for example:
1739
1740         delegate void set (out int x);
1741
1742         set s = delegate (out int x){
1743                 x = 0;
1744         };
1745
1746         This is used by functionality introduced late in the C# language.
1747         
1748         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1749         method that take ref and out parameters. 
1750
1751         Fixes #77119 which was a late change in the spec.
1752
1753 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1754
1755         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1756         parent if its the same scope.  Fixes #77060.
1757
1758 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1759
1760         * driver.cs: Report the case of no source files and no -out:
1761         argument provided.
1762
1763 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1764
1765         Fix #77035.
1766         * expression.cs (ComposedCast.GetSignatureForError): Define.
1767
1768 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1769
1770         Fix #76995
1771
1772         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1773         ListDictionary, to contain the ExternAliasEntry entries (in
1774         addition to the NamespaceEntry.aliases hashtable). This field is
1775         shared between the original entry and its doppelganger (bodyless 
1776         copy of it).
1777         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1778         extern_aliases field.
1779         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1780         lookup in extern_aliases.
1781
1782 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1783
1784         Fix #77006.
1785         * class.cs (TypeContainer.Mark_HasEquals): New.
1786         (TypeContainer.Mark_HasGetHashCode): New.
1787         (ClassPart): Override them.
1788         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1789
1790         Fix #77008.
1791         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1792         'parent' argument to the base constructor.
1793
1794         Remove all mention of TypeContainer from decl.cs.
1795         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1796         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1797         (DeclSpace.DeclSpace): Likewise.
1798         (DeclSpace.DefineMembers): Remove unused argument.
1799         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1800         debugging check -- we don't care if the debug code throws an
1801         InvalidCastException instead of an InternalErrorException.
1802         * class.cs (TypeContainer.DefineMembers): Update to changes.
1803         (TypeContainer.DoDefineMembers): Likewise.
1804         (TypeContainer.GetMethods): Likewise.
1805         (PropertyMember.Define): Likewise.
1806         (MemberBase.Parent): New property that forwards to
1807         MemberCore.Parent, but ensures that we get a TypeContainer.
1808         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1809         (RootContext.PopulateTypes): Likewise.  Remove special case code
1810         for !RootContext.StdLib: DefineMembers is idempotent.
1811
1812 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1813
1814         * convert.cs (ExplicitConversionCore): Check the return value from
1815         ExplicitConversionCore which can return null on failure.  Fixes #76914
1816
1817 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1818
1819         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1820
1821 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1822
1823         * doc.cs : The search for referenced namespace was insufficient to
1824           get global one as it used to do. Fixed bug #76965.
1825
1826 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1827
1828         * doc.cs : check name in cref in the last phase that whether it is
1829           namespace or not.
1830
1831 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1832
1833         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1834           Mono.C5.
1835
1836 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1837
1838         * doc.cs : so it turned out that we cannot skip override check for 
1839           interface members. Fixed bug #76954.
1840
1841 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1842
1843         * cs-tokenizer.cs : fixed bug #75984:
1844           - #warning and #error should not be handled when the source line
1845             is disabled.
1846           - #line is not checked strictly when the source line is disabled.
1847           - #define and #undef is on the other hand checked strictly at any
1848             state.
1849
1850 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1851
1852         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1853           CS1027 report.
1854
1855 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1856
1857         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1858
1859         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1860         event initializers.
1861         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1862         (FieldBase.Initializer): Initializer is now optional.
1863         (EventField.Define): Only event field can have initializer.
1864
1865         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1866
1867         * const.cs (Const): Reuse initializer.
1868
1869         * cs-parser.jay: Updated after FieldBase changes.
1870         Added current_array_type to simplify array initializers.
1871
1872         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1873
1874         * expression.cs, iterators.cs: Updated.
1875
1876         * namespace.cs (NamespaceEntry): Made UsingFound private.
1877
1878 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1879
1880         * parameterCollection.cs: Obsolete, removed.
1881         * parser.cs: Obsolete, removed.
1882
1883 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1884
1885         Fix #76849.
1886         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1887
1888         * enum.cs (Enum.Define): Set obsolete context here.
1889
1890 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1891
1892         * doc.cs :
1893           - FindDocumentedMember() now expects 1) paramList as null
1894             when "we don't have to check the number of parameters" and
1895             2) Type.EmptyTypes when "there is no arguments".
1896           - Introduced FoundMember struct to hold the exact type which was
1897             used to find the documented member (the above change broke
1898             test-xml-044; it might be better just to use DeclaringType than
1899             what MS does, like this change does, but it depends on usage.)
1900
1901 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1902
1903         * doc.cs : documented member might be from DeclaringType for nested
1904           types. Fixed bug #76782.
1905
1906 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1907
1908         * anonymous.cs: Have the param code handle leaving copies on the
1909         stack etc. Allows anonymous params to take part in the assignment
1910         code (++, +=, etc). Fixes bug #76550
1911
1912         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1913         it down to the anon code.
1914
1915         * iterators.cs: Use dummy var here
1916
1917         * codegen.cs: Handle new vars
1918
1919 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1920
1921         Fix #76849.
1922         * class.cs (MethodData.Define): Set proper Obsolete context.
1923
1924         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1925         obsolete context.
1926         (FieldExpr.DoResolve): Ditto.
1927
1928 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1929
1930         Fix #76849.
1931         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1932         parent is not obsolete.
1933
1934 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1935
1936         * doc.cs : (FindDocumentedMember) find parameterless members first
1937           and get CS0419 in the early stage. Fixed first case of bug #76727.
1938
1939 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1940
1941         Fix #76859.
1942         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1943         no error was reported.
1944
1945         *expression.cs (Binary.DoResolve): left can be null.
1946
1947 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1948
1949         Fix #76783.
1950         * class.cs (MethodData.Emit): Parameters should be labeled first.
1951
1952 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1953
1954         Fix #76761.
1955         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1956
1957 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1958
1959         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1960
1961         * class.cs (MethodCore): Parameter clean up.
1962         (IMethodData): Added ParameterInfo.
1963         (MethodData): Parameter clean up.
1964         (Indexer.Define): Parameter clean up.
1965
1966         * anonymous.cs,
1967         * codegen.cs,
1968         * cs-parser.jay,
1969         * decl.cs,
1970         * doc.cs,
1971         * ecore.cs,
1972         * flowanalysis.cs,
1973         * iterators.cs,
1974         * pending.cs,
1975         * statement.cs,
1976         * typemanager.cs: Parameter clean up.
1977
1978         * delegate.cs (Define): Get rid of duplicated code.
1979
1980         * expression.cs (ParameterReference): Removed useless parameters
1981         and simplified.
1982         (Invocation): Ditto.
1983
1984         * parameter.cs (ParamsParameter): New class, params specialization.
1985         (ArglistParameter): Attemp to separate arglist.
1986         (Parameter): Refactored to be reusable and faster.
1987         (Parameter.Modifier): Made understandable.
1988         (Parameters): Changed to be used as a class for `this' assembly
1989         parameters. Refactored to use new specialized classes.
1990
1991         * support.cs (ParameterData): Added Types property.
1992         (InternalParameters): Deleted.
1993
1994 2005-08-20  Martin Baulig  <martin@ximian.com>
1995
1996         Merging this patch from GMCS to fix #75867.
1997
1998         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1999         scope if we don't already have it.
2000
2001 2005-11-17  Martin Baulig  <martin@ximian.com>
2002
2003         * anonymous.cs
2004         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2005         inherit the scope from our parent.  Fixes #76653.
2006
2007 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2008
2009         * doc.cs : the previous patch does not actually fix the bug.
2010           PropertyInfo override check is now implemented and really fixed it.
2011         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2012
2013 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2014
2015         * doc.cs : apply "override filter" also to properties.
2016           Fixed bug #76730.
2017
2018 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2019
2020         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2021           no need to check overrides. For classes, omit those results from 
2022           interfaces since they must exist in the class. Fixed bug #76726.
2023
2024 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2025
2026         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2027           with different parameters. Fixed the second problem in #76685.
2028
2029 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2030
2031         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2032           get expected 'protected' access in CheckValidFamilyAccess()).
2033           Fixed bug #76692.
2034
2035 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2036
2037         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2038           Fixed bug #76705.  CS1569 was incorrectly commented out.
2039
2040 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2041
2042         * doc.cs : use Invocation.IsOverride() to do real override check.
2043         * expression.cs : made Invocation.IsOverride() internal.
2044
2045 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2046
2047         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2048           TypeBuilder.FindMembers() and filter overriden base members out.
2049           Fixed bug #76990.
2050
2051 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2052
2053         * doc.cs : ref/out parameters are represented as '@' (instead of
2054           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2055
2056 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2057
2058         * doc.cs : when there was no '.' in cref to methods in doc comment,
2059           then parameters were missing in the output. Fixed bug #76691.
2060
2061 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2062
2063         * driver.cs : don't output docs when there is an error.
2064           Fixed bug #76693.
2065
2066 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2067
2068         * doc.cs :
2069           Now it should detect indexers. Fixed primary concern in bug #76685.
2070           Fixed CS0419 message to not show the identical member signature in
2071           the message.
2072
2073 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2074
2075         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2076           instead of Type.FindMembers() since it does not handle events.
2077           Fixed bug #71604.
2078
2079 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2080
2081         * codegen.cs: Fixed typo (speficied -> specified).
2082
2083 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2084
2085         Fix #76369.
2086         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2087
2088 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2089
2090         * attribute.cs: Changed error message.
2091
2092         * cs-tokenizer.cs: One more check.
2093
2094 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2095
2096         * statement.cs (Block.Resolve): Ignore empty statement.
2097
2098 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2099
2100         * report.cs: Made error/warning methods more strict to avoid
2101         their misuse.
2102
2103         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2104         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2105         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2106         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2107
2108 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2109
2110         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2111         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2112
2113         * class.cs (TypeContainer.IsComImport): New property.
2114         (Constructor.Define): Create proper ctor for ComImport types.
2115
2116         * expression.cs (New.CheckComImport): Fixed.
2117
2118 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2119
2120         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2121         that a parameter has been captured does not mean that we do not
2122         have to do the rest of the processing.  This fixes the second part
2123         of #76592.  If there was another anonymous method capturing
2124         values in the past, the Scope would never be set for the second
2125         method that captured the same parameter.
2126
2127         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2128         properly manipulate the stack.   Second part of fix for #76592.
2129
2130         * expression.cs (New): Add support for invoking "new" on
2131         interfaces that have been flagged with the ComImport attribute and
2132         the CoClass.  Fixes #76637 
2133
2134         * statement.cs (Try.DoEmit): When a variable is captured, do not
2135         try to emit the vi.LocalBuilder variable as it has been captured.
2136         Create a temporary variable and store the results on the
2137         FieldBuilder.  Fixes #76642
2138
2139 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2140
2141         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2142
2143         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2144
2145         * expression.cs (Binary.DoResolve): Added && optimalization.
2146     
2147         * typemanager.cs (AddUserType): Removed useless argument.
2148
2149 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2150
2151         * statement.cs (Block.variables): Uses ListDictionary.
2152
2153 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2154
2155         Fix #75969.
2156         * class.cs (PartialContainer.EmitType): Customized to emit
2157         security attributes.
2158         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2159         for partial classes.
2160
2161 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2162
2163         Fix #76599.
2164         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2165         access has to be fixed.
2166         
2167         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2168
2169 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2170
2171         Fix #76590.
2172         * ecore.cs (NullCast.Reduce): Implemented.
2173
2174         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2175         constant type.
2176         
2177         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2178         properly.
2179         (Foreach.Resolve): Catch null properly.
2180
2181 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2182  
2183         * cs-tokenizer.cs: Warning text fix.
2184
2185         * driver.cs: AllWarningNumbers exposed on public interface.
2186
2187         * report.cs (): Reviewed warning numbers.
2188         (IsValidWarning): Use binary search.
2189
2190 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2191  
2192         * driver.cs: Implemeted resource visibility.
2193         (Resources): New class for code sharing between /res: and
2194         /linkres:
2195  
2196 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2197
2198         Fix #76568.
2199         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2200         folding.
2201         
2202         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2203         contants only.
2204         
2205         * ecore.cs (NullCast): Child is contant only.
2206         
2207         * literal.cs (NullLiteral.Reduce): null can be converted to any
2208         reference type.
2209
2210 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2211
2212         * driver.cs: Use Encoding.Default as default code page instead
2213           of ISO-28591.
2214
2215 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2216
2217         Fix #76085.
2218         * expression.cs (Invocation.Error_InvalidArguments): Handle
2219         __arglist parameters.
2220         (Invocation.VerifyArgumentsCompat): Likewise.
2221         * support.cs (ReflectionParameters.GetSignatureForError): Print
2222         __arglist parameters.
2223         (InternalParamters.GetSignatureForError): Likewise.
2224         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2225
2226 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2227
2228         * attribute.cs (GetPropertyValue): Made public.
2229
2230         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2231         Resolve.
2232         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2233         attribute.
2234         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2235         is not defined.
2236         
2237         * driver.cs: Reflect method name change.
2238         
2239         * statement.cs (Try.Resolve): Warn when try has both general
2240         exception handlers.
2241         
2242         * typemanager.cs: runtime_compatibility_attr_type new predefined
2243         type.
2244
2245 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2246
2247         Fix #76419.
2248         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2249         treat it as an empty parameter list.
2250
2251 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2252
2253         Fix #76271.     
2254         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2255         ResolveAsTypeStep silent.
2256         * statement.cs (Block.AddConstant): Mark block as used.
2257         (Block.ResolveMeta): Avoid piling on error messages
2258         if a constant initializer resolution fails.
2259
2260 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2261
2262         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2263         Remove.
2264         (NamespaceEntry.VerifyAllUsing): New.
2265         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2266         behaviour.  Delegates actual resolution of alias to ...
2267         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2268         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2269         Update.
2270         * driver.cs (Driver.MainDriver): Update.
2271         
2272         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2273         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2274         property.
2275         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2276         Remove.
2277         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2278         RootNamespace.DefineNamespacesForAll.
2279
2280 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2281
2282         * typemanager.cs (assemblies, external_aliases, modules)
2283         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2284         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2285         overhead.  Move resposibility ...
2286         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2287         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2288
2289 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2290
2291         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2292         cached_namespaces.  Improve usage.
2293         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2294         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2295         Move from GlobalRootNamespace and simplify.
2296         (RootNamespace.Global): Make instance variable.
2297         (RootNamespace.RootNamespace): Add "alias name" parameter.
2298         (GlobalRootNamespace): Simplify drastically.
2299         (Namespace.Lookup): Don't use GetNamespace.
2300         * typemanager.cs (GetRootNamespace): Rename from
2301         ComputeNamespaceForAlias.
2302         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2303
2304 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2305
2306         * anonymous.cs (AnonymousContainer): Don't crash when container
2307         doesn't exist.
2308
2309 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2310
2311         * expression.cs (Binary.DoResolve): Warn when comparing same
2312         values.
2313
2314 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2315
2316         Fix #76486.
2317         * expression.cs (Binary.DoResolve): It looks like there are no
2318         convetsion rules in enum context.
2319
2320 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2321
2322         Add support for extern alias qualifiers.
2323         * typemanager.cs: Move some LookupTypeReflection code
2324         to namespace.cs, to have cleaner code. Added some methods
2325         to help us keep track of the extern aliased references.
2326         * driver.cs: Add suport for extern alias assemblies on command
2327         line and check for their warnings/errors. Also keep track of the
2328         extern aliased assemblies.
2329         * namespace.cs: Move the global functionality of Namespace
2330         to GlobalRootNamespace/RootNamespace. Now the global namespace
2331         is GlobalRootNamespace.Globa. Also the code moved from 
2332         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2333         Finally added LocalAliasEntry (AliasEntry before) and
2334         ExternAliasEntry, to handle alias statements.
2335         * cs-parser.jay: Add support in the grammar for extern alias
2336         statement.
2337         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2338         Update callings to Namespace (now in GlobalRootNamespace).
2339
2340 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2341
2342         Fix #76371.
2343         * class.cs (TypeContainer.DefineType): Move updating of
2344         topological sort earlier in the code.
2345         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2346
2347 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2348
2349         Fix #76273.
2350         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2351         
2352         * constant.cs (Constant.TryReduce): Moved from Cast class.
2353         (Reduce): Made little bit more OO and fixed missing conversions.
2354         
2355         * ecore.cs (Reduce): Implemented.
2356         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2357         
2358         * literal.cs (Reduce): Implemented.
2359         
2360         * class.cs: Reverted Miguel's wrong commit.
2361
2362 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2363
2364         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2365
2366 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2367
2368         * cs-parser.jay, expression.cs : CS0214 was missing error location
2369           for constants. Fixed bug #76404.
2370
2371 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2372
2373         Fix #76370.
2374         * convert.cs (ExplicitConversionCore): Fixed object->enum
2375         conversion.
2376
2377 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2378
2379         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2380         InstanceExpression.
2381         (PropertyExpr.EmitCall): Likewise.
2382         * expression.cs (Invocation.EmitArguments): Handle case where
2383         arguments == null.
2384         (Invocation.EmitCall): Avoid allocating temporary variable if
2385         there are no arguments.
2386
2387 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2388
2389         Fix #76323.
2390         * convert.cs (ImplicitConversionStandard): Move conversion of
2391         void* to arbitrary pointer types ...
2392         (ExplicitConversionStandard): .. here.
2393         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2394         error to always print typenames.
2395
2396 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2397
2398         * convert.cs (GetConversionOperator): Rename from
2399         GetConversionOperators.  Move operator selection code from ...
2400         (UserDefinedConversion): ... here.
2401
2402 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2403
2404         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2405         conversion.
2406
2407 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2408
2409         * assign.cs (Assign.DoResolve): Error method changed.
2410
2411         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2412         
2413         * const.cs (ResolveValue): Reset in_transit immediately.
2414         
2415         * constant.cs: Error method changed.
2416         
2417         * convert.cs: Removed useless location parameter.
2418         (ExplicitNumericConversion): Don't do double enum check.
2419         (ExplicitConversionCore): Renamed from ExplicitConversion.
2420         (ExplicitUnsafe): Extracted from ExplicitConversion.
2421         (ExplicitConversion): Uses for error reporting.
2422         
2423         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2424         error messages.
2425         (ResolveBoolean): Uses common error method.
2426         (CastToDecimal): Get rid of ec.
2427         (CastFromDecimal): Optimized.
2428         (ConvCast): Get rid of ec.
2429         
2430         * enum.cs (ResolveValue): Reset in_transit immediately.
2431         (Emit): Return after first error.
2432         
2433         * expression.cs: Convert changes.
2434         
2435         * literal.cs: Error method changed.
2436         
2437         * statement.cs: Error method changed.
2438
2439 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2440
2441         * support.cs (SeekableStreamReader.Position): Don't error out when
2442         the requested position is just beyond the end of the current
2443         buffered data.
2444
2445 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2446
2447         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2448         try to keep in sync with the byte count of the underlying Stream.
2449         However, this limits us to a window size of 2048 characters: i.e.,
2450         the maximum lookahead of our lexer/parser can be 2048 characters.
2451
2452 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2453
2454         Fix #76255.
2455         * driver.cs: Fix compilation files with full root path.
2456
2457 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2458
2459         * report.cs (SymbolRelatedToPreviousError): Format the output so
2460         it does not use an open parenthesis that is never closed. 
2461
2462         * driver.cs: Follow coding guidelines
2463
2464 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2465
2466         Fix #72930.
2467         * const.cs (Const.ResolveValue): Check for assigning non-null
2468         value to reference type.
2469
2470 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2471
2472         * anonymous.cs: Implemented ExprClassName.
2473         
2474         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2475         delegate.
2476         
2477         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2478         check.
2479         
2480         * class.cs (StaticClass.DefineContainerMembers): Report protected
2481         members as error.
2482         
2483         * codegen.cs: if(ed) PRODUCTION.
2484         
2485         * convert.cs (Error_CannotImplicitConversion): Better error
2486         distinction.
2487         
2488         * cs-parser.jay: More error checks.
2489         
2490         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2491         
2492         * driver.cs (CSCParseOption): Enabled wrong option check.
2493         
2494         * ecore.cs (Expression.ExprClassName): Turned to property.
2495         (MemberExpr.CheckIntermediateModification): For checking boxed
2496         value types     modification.
2497         
2498         * statement.cs (Fixed.Resolve): Expression type must be
2499         convertible to fixed type.
2500         (CollectionForeach.GetEnumeratorFilter,TryType):
2501         Small refactoring for easier error checking.
2502
2503 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2504
2505         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2506         attributes.
2507         
2508         * class.cs (GeneratedBaseInitializer): New class for customization
2509         compiler generated initializers.
2510         (MemberBase.DoDefine): Check Obsolete attribute here.
2511         (FieldMember.DoDefine): Ditto.
2512         
2513         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2514         constants.
2515         
2516         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2517         (MemberCore.GetObsoleteAttribute): Removed argument.
2518         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2519         (MemberCore.CheckObsoleteType): New helper.
2520         
2521         * delegate.cs,
2522         * enum.cs,
2523         * statement.cs: Updates after MemberCore changes.
2524         
2525         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2526         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2527         
2528         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2529         obsolete attribute for compiler construct.
2530         (As.DoResolve): Cache result.
2531         
2532         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2533
2534 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2535
2536         Fix #76133.
2537         * expression.cs (This.VerifyFixed): In a value type T, the type of
2538         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2539         value type R, 'this' is treated as a value parameter.
2540
2541 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2542
2543         * statement.cs (Lock): Use the TemporaryVariable class instead of
2544         manually using local variables as those do not work when variables
2545         are captured.
2546
2547         * ecore.cs: Moved the TemporaryVariable class from being a nested
2548         class inside Foreach to be a public class that can be employed in
2549         other places. 
2550
2551 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2552
2553         * cs-parser.jay: interface_accessors replaced by
2554         accessor_declarations.
2555
2556         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2557         location.
2558         
2559         * statement.cs (GotoCase.Resolve): Convert null constant to
2560         null case.
2561         (SwitchLabel.ResolveAndReduce): Ditto.
2562         (SwitchLabel.NullStringCase): Custom null stamp.
2563         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2564         
2565         typemanager.cs (CSharpSignature): Don't skip first argument
2566         for full names.
2567
2568 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2569
2570         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2571
2572         * location.cs (InEmacs): in this mode, do not report column
2573         location as it confuses Emacs.
2574
2575 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2576
2577         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2578         expression.cs, iterators.cs, literal.cs: Store constants and
2579         literals location.
2580         
2581         * class.cs (MemberBase.ShortName): Pass location.
2582         
2583         * cs-parser.jay: Some location fixes.
2584         
2585         * ecore.cs (Expression.Location): Made virtual.
2586
2587 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2588
2589         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2590         if the underlying types are the same, otherwise we need to produce
2591         code that will do the proper cast.
2592
2593         This was exposed by Marek's constant rewrite which produced
2594         invalid code for the call site:
2595
2596         enum X : long { a }
2597         void Method (X v) {}
2598
2599         Method ((X) 5)
2600
2601         This fixes test-49.cs
2602
2603 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2604
2605         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2606           Type/Object should be allowed as well. Fixed bug #75968.
2607
2608 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2609
2610         * expression.cs : (Binary.DoResolve): when one is enum constant and
2611           another is constant 0, then return enum one *as enum type*.
2612           Fixed bug 74846.
2613
2614 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2615
2616         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2617         internal.
2618
2619         Fix #75941.
2620         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2621         flow-branching for LocalVariableReferences in case we were invoked
2622         from a MemberAccess.
2623         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2624         Carved out of ...
2625         (LocalVariableReference.DoResolveBase): ... this.
2626         (MemberAccess.Resolve): Do the check that was disabled during
2627         SimpleNameResolve.
2628
2629 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2630
2631         * class.cs :
2632           (PartialContainer.Create): check abstract/sealed/static strictly
2633           but abstract/sealed can exist only at one side. Fixed bug #75883.
2634
2635 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2636
2637         Fix #75945.
2638         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2639         specified, don't default to UnmanagedType.I4.
2640
2641 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2642
2643         * expression.cs : conditional operator should check possibly
2644           incorrect assign expression. Fixed bug #75946.
2645
2646 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2647
2648         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2649           Reverting the change. gmcs is much complex than mcs on this matter.
2650
2651 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2652
2653         * cs-tokenizer.cs : To read another token ahead of the actual 
2654           consumption, use new SavedToken and cache token instead of moving
2655           back the stream with SeekableStreamReader (it seemed problematic).
2656         * cs-parser.jay,
2657           driver.cs : Thus use StreamReader directly.
2658         * support.cs : Thus removed SeekableStreamReader.
2659
2660 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2661
2662         Fix #75934.
2663         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2664         (ScopeInfo.EmitScopeType): Use it to construct field names from
2665         names of captured locals.
2666
2667         Fix #75929.
2668         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2669         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2670         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2671         (ExplicitConversion): Remove enum cases already handled by
2672         implicit conversion.  Move implicit conversion check to the beginning.
2673         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2674         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2675         Don't treat System.Enum as a struct.
2676
2677 2005-08-30  Jb Evain  <jbevain@gmail.com>
2678
2679         * attribute.cs: handles as expression in parameters.
2680
2681 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2682
2683         Fix #75802.
2684         * class.cs (TypeContainer.VerifyClsName): Don't use a
2685         PartialContainer when verifying CLS compliance.
2686         (AbstractPropertyEventMethod): Set Parent here, ...
2687         (PropertyMethod): ... not here.
2688
2689 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2690
2691         * attribute.cs : escaped attribute name should not be allowed to be
2692           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2693
2694 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2695
2696         Fix #75927.
2697         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2698         when converting a long constant to unsigned long.
2699         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2700         detect where IsApplicable and VerifyArgumentsCompat disagree.
2701
2702 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2703         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2704
2705         Fix #75848.
2706         * class.cs (TypeContainer.CanElideInitializer): New helper.
2707         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2708         can safely emitting the initializer of a field.
2709
2710 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2711
2712         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2713           allowed inside a switch (without loop). Fixed bug #75433.
2714
2715 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2716
2717         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2718         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2719
2720 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2721
2722         * driver.cs : kinda reverting the default encoding changes (not exact 
2723           revert since I noticed that "codepage:reset" might not work fine).
2724
2725 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2726
2727         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2728           Location. Now getter and setter store location correctly.
2729           (errors/cs0111-12.cs now reports the expected location.)
2730
2731 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2732
2733         * driver.cs : Use default encoding on the environment.
2734           Removed (now that) extra parameter for SeekableStreamReader.
2735         * support.cs : (SeekableStreamReader) third .ctor() argument for
2736           StreamReader is not required (always true). preamble size could
2737           be acquired in simpler and safe way.
2738
2739 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2740
2741         * cs-parser.jay: report CS0642 at warning level 3
2742           and report CS0642 for an if else statement also
2743           fixes bug #74745. Patch by John Luke (and a bit
2744           modified by me).
2745           Removed extra CS0642 warning check for "while",
2746           "for" and "fixed".
2747         * statement.cs: In Block.Resolve(), CS0642 check
2748           is reimplemented to check a sequence of an empty
2749           statement and a block.
2750
2751           Both fix bug #66777.
2752
2753 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2754
2755         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2756         detection until I fix it.
2757         
2758         * cs-tokenizer.cs: Changed error message.
2759         
2760         * cs-parser.jay: Fixed 2 error locations.
2761         
2762         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2763         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2764         properties.
2765         
2766         * enum.cs (GetSignatureForError): Fixed.
2767         
2768         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2769         method detection.
2770         
2771         * class.cs,
2772         * typemanager.cs (RegisterProperty): Removed.
2773         
2774         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2775
2776 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2777
2778         Fix #75874.
2779         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2780         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2781
2782 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2783
2784         * expression.cs : tiny fix is required for not warning positive ulong.
2785           See test-441.cs.
2786
2787 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2788
2789         * expression.cs : add CS0652 check for constant and integral
2790           expression. Fixed bug #53974.
2791
2792 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2793
2794         * expression.cs : in DoNumericPromotions(), check if there is implicit
2795           conversion overload for string (to check CS0034). Fixed bug #52492.
2796
2797 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2798
2799         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2800
2801 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2802
2803         * ecore.cs : report location when it is *not* Null.
2804
2805 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2806
2807         * codegen.cs,
2808           ecore.cs,
2809           flowanalysis.cs,
2810           expression.cs:
2811           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2812           correctly. Fixed bug #75721.
2813
2814 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2815
2816         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2817         loop that performs 'min (pos, char_count)'.
2818
2819         Fix #75862.
2820         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2821         converted value in Operator.OnesComplement.
2822
2823 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2824
2825         * anonymous.cs: If the anon method is pulled into a helper class,
2826         it needs to be `internal' not `private'. Fixes runtime behavior on
2827         msft. bug #75704
2828
2829 2005-08-20  Martin Baulig  <martin@ximian.com>
2830
2831         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2832         scope if we don't already have it.
2833
2834         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2835         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2836         fixes #75867.
2837
2838 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2839
2840         Fix #75803
2841         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2842         is a partial class.
2843
2844 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2845
2846         The big constants rewrite
2847         Fix #75746, #75685 and more
2848         As a side effect saved 1MB for MWF ;-)
2849         
2850         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2851         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2852         enum based for corlib compilation.
2853         
2854         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2855         subtractions.
2856         
2857         * class.cs (FixedField.Define): Use ResolveAsConstant.
2858         
2859         * const.cs (IConstant): Interface constants and enums.
2860         (Const.ResolveValue): New method for constant resolvning.
2861         (ExternalConstant): Constants from imported assemblies.
2862         
2863         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2864         conversion; like enums.
2865         (Constant.ToType): Converts this constant to different type.
2866         (Constant.Increment): Adds 1.
2867         
2868         * convert.cs (ImplicitConversionRequired): Simplified.
2869         
2870         * cs-parser.jay: Create EnumMember directly.
2871         
2872         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2873         
2874         * doc.cs (GenerateEnumDocComment): Removed.
2875         
2876         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2877         (ConvertIntLiteral): Removed.
2878         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2879         
2880         * enum.cs (EnumMember): Implement IConstant.
2881         (Enum.IsValidEnumConstant): Removed.
2882         (Enum.GetNextDefaultValue): Removed.
2883         (Enum.FindMembers): Updated.
2884         (Enum.GenerateDocComment): Iterate enum members.
2885         
2886         * expression.cs (Cast.TryReduce): Handle enums correctly.
2887         (New.Constantify): Made public.
2888         (MemberAccess.DoResolve): Removed contant specific if(s).
2889         
2890         * literal.cs (NullLiteral): Implement new abstract methods.
2891         
2892         * statement.cs (GotoCase.Resolve): Use new constant methods.
2893         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2894         
2895         * typemanager.cs (LookupEnum): Removed.
2896         (IsEnumType): Fixed to work with corlib.
2897         (RegisterConstant): Removed.
2898         (LookupConstant): Removed.
2899         (GetConstant): Changed to work with IConstant.
2900
2901 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2902
2903         * location.cs : Fixed overflown (>255) column number.
2904
2905 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2906
2907         First cut of the qualified-alias-member feature.
2908         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2909         token.
2910         * cs-parser.jay (DOUBLE_COLON): New token.
2911         (namespace_or_type_name): Add rule for recognizing
2912         qualified-alias-members.
2913         (primary_expression): Likewise.
2914         (element_access): Allow QualifiedAliasMember as a possible
2915         type-bearing expression.
2916         (local_variable_type, local_variable_pointer_type): Likewise.
2917         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2918         aliases in the current and enclosing namespace declarations.
2919         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2920         * decl.cs (MemberName.is_double_colon): New.
2921         (MemberName.MemberName): Add new constructor for alias-member.
2922         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2923         * expression.cs (QualifiedAliasMember): New expression type.
2924
2925 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2926
2927         * location.cs : it borked when no argument was specified.
2928
2929 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2930
2931         * location.cs : tiny ToString() format fix.
2932
2933 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2934
2935         * statement.cs : oops, it was missing.
2936
2937 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2938
2939         A set of fixes for precise line/column location.
2940
2941         * location.cs :
2942           "token" field now holds a file/line "delta", a line number offset 
2943           from the segment, and a column number. See also:
2944           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2945           December/009508.html
2946           Removed static IsNull. Use instance IsNull property instead.
2947         * cs-tokenizer.cs :
2948           For some tokens it stores Location. For Identifier it stores
2949           LocatedToken which is a pair of string name and location.
2950           Column numbers are adjusted only at getChar().
2951         * report.cs :
2952           Use Location.ToString() for reporting (it now contains column).
2953         * cs-parser.jay :
2954           Largely modified to use LocatedToken instead of
2955           string (IDENTIFIER), and to acquire Location from some tokens.
2956         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2957           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2958           codegen.cs :
2959           Now MemberName holds Location. DeclSpace.ctor() receives Location
2960           as a parameter. Removed extra parameters to all derived classes.
2961           Replaced Location.IsNull() with instance property.
2962         * assign.cs, expression.cs :
2963           Added .ctor() overload that omits Location.
2964         * attribute.cs :
2965           Added "nameEscaped" flag that indicates the identifier was escaped
2966           in the source file. This fixes bug #57047.
2967
2968 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2969
2970         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2971         New method, looking for lo-case imported cls type.
2972
2973         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2974         here.
2975
2976         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2977
2978         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2979
2980         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2981         all_imported_types.
2982         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2983
2984         Optimized to save 3.5 MB for SWF compilation.
2985
2986 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2987
2988         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2989         (PartialContainer.Create): Moved logic AddToContainer.
2990         (PartialContainer.MarkForDuplicationCheck): Shares name.
2991         
2992         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2993         place.
2994         
2995         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2996         initialization.
2997         (Namespace.GetSignatureForError): New method.
2998         
2999         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3000         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3001
3002 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3003
3004         Fix #75669.
3005         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3006         member lookup rather than qualifier_type, since qualifier_type can
3007         be null.
3008
3009 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3010
3011         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3012         enum member.
3013
3014 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3015
3016         * statement.cs: Copy the local exception into the exception
3017         captured local.  Fixes 75674
3018
3019 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3020
3021         Fix #75658.
3022         * expression.cs (Invocation.OverloadResolve): Don't report error
3023         CS1501 if error CS1502 has been reported.
3024         (New.DoResolve): Delegate CS1501 reporting to
3025         Invocation.OverloadResolve.
3026
3027         Fix #75656.
3028         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3029         invariant-meaning-in-block property in an enclosing block if
3030         necessary.
3031
3032 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3033
3034         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3035         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3036         (Switch.CheckSwitch): Just save 50kb for SWF.
3037
3038 2005-07-27  Martin Baulig  <martin@ximian.com>
3039
3040         * anonymous.cs (CaptureContext.AddField): Added
3041         `AnonymousContainer am' argument; compute its toplevel scope if
3042         it's not already computed.  Fixes #75649.
3043
3044 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3045
3046         Fix #75628.
3047         * class.cs (Constructor.Emit): Reset block to null if the block
3048         resolve fails.
3049
3050 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3051
3052         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3053
3054 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3055
3056         * class.cs (MethodData.Define): Check whether accessor implementing
3057         interface is public.
3058
3059         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3060
3061 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3062
3063         Fix #57245
3064         * namespace.cs (LookupType): Moved same type check to...
3065         
3066         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3067         with the same name.
3068
3069 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3070
3071         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3072         already found a typebuilder.
3073         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3074         MemberNames, not strings.
3075
3076         * const.cs (Error_ExpressionMustBeConst): 
3077         Rename from Error_EpressionMustBeConst.
3078         * const.cs, class.cs, statement.cd: Update.
3079
3080 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3081
3082         Fix #65573
3083
3084         * const.cs (Const.LookupConstantValue): Report missing contant expression
3085         everytime.
3086         (Error_EpressionMustBeConstant): Only one error method.
3087
3088         * class.cs, statement.c: Updated.
3089
3090 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3091
3092         * statement.cs (Block.Flags): Add back HasVarargs.
3093         (Block.flags): Make protected.
3094         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3095
3096         * typemanager.cs (types, typecontainers, user_types): Remove.
3097         (UserTypes, TypeContainers): Likewise.
3098         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3099         (CleanUp, Reset): Update.
3100         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3101         (GetNestedType): Use Type.GetNestedType.
3102         (CoreLookupType): Take two arguments, the namespace and the
3103         basename of the type.  Update to use the Namespace.Lookup
3104         mechanism.
3105         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3106         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3107         string concatenation and substring matches.
3108         * class.cs, enum.cs, delegate.cs: Update to changes.
3109
3110 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3111
3112         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3113         Expression and made virtual.
3114
3115         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3116         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3117
3118         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3119
3120         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3121         error message.
3122
3123         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3124         change.
3125
3126 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3127
3128         Fix #57707
3129         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3130         AssemblyCultureAttribute is not used on executable.
3131
3132         * rootcontext.cs,
3133         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3134
3135 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3136
3137         Fix #60638.
3138         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3139         New.  Reports CS0252/CS0253.
3140         Mostly taken from preliminary patch by Duncak Mak.
3141         (Binary.DoResolveOperator): Store results of operator lookup.
3142         Use them to detect if we need to warn about unintended reference
3143         comparisons.
3144
3145 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3146
3147         Fix #72969.
3148         * namespace.cs (Namespace.Lookup): Add back location parameter.
3149         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3150         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3151
3152         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3153         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3154         (Namespace.LookupType): ... this.
3155         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3156         of namespaces.
3157         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3158         purported to handle pointers.
3159         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3160         CoreLookupType.
3161
3162 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3163
3164         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3165         type as namespace.
3166
3167 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3168
3169         * namespace.cs (Namespace.Lookup): Drop location parameter.
3170         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3171         (NamespaceEntry.Lookup): ... this.
3172         (NamespaceEntry.Error_AmbiguousTypeReference):
3173         Move here from DeclSpace.
3174         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3175         names ...
3176         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3177         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3178         Move to NamespaceEntry.
3179         * delegate.cs, expression.cs: Update to changes.
3180
3181 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3182
3183         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3184         CheckAttributeType and refactored.
3185         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3186         ResolveAsTypeTerminal error handling.
3187         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3188         handling.
3189         (GetSignatureForError): Print errors in same way.
3190
3191         * class.cs,
3192         * codegen.cs: Reflect attribute GetSignatureForError change.
3193
3194         * ecore.cs,
3195         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3196
3197         * namespace.cs (UsingEntry): Refactored to make fields private.
3198
3199         * assign.cs,
3200         statement.cs: Error_UnexpectedKind has extra parameter.
3201
3202 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3203
3204         * ecore.cs (IAlias): Remove.
3205         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3206         that implement the interface.
3207         * namespace.cs (Namespace): Likewise.
3208         (Namespace.declspaces): Renamed from 'defined_names'.
3209         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3210         DeclSpace instead of an IAlias.
3211         * tree.cs (Tree.AddDecl): Update.
3212
3213 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3214
3215         * statement.cs (Block.Flags); Remove HasVarargs.
3216         (Block.HasVarargs): Move to ToplevelBlock.
3217         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3218         (Block.Variables): Make protected.  Initialize variable hashtable
3219         if necessary.
3220         (Block.AddVariable): Update.
3221         (Block.Resolve): Update to changes.
3222         (ToplevelBlock.HasVarargs): New boolean.
3223         (ToplevelBlock.ThisVariable): Move here from Block.
3224         (ToplevelBlock.AddThisVariable): Likewise.
3225         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3226         * expression.cs (This.ResolveBase): Update to changes.
3227         (ArglistAccess.DoResolve): Likewise.
3228
3229 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3230
3231         Fix #75321
3232         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3233
3234         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3235         not used and not used & assigned.
3236         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3237
3238 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3239
3240         Fix #75053
3241         * expression.cs (Is.DoResolve): null is never provided type.
3242
3243 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3244
3245         Fix #52496
3246         * cs-parser.jay: Less strict event error rule to catch more errors.
3247
3248 2005-07-08  Martin Baulig  <martin@ximian.com>
3249
3250         Fix test-iter-10.cs - distinguish whether we `yield' in a property
3251         gettter (allowed) or setter (not allowed).
3252
3253         * class.cs (Accessor): Implement IIteratorContainer.
3254         (Accessor.Yields): New public field.
3255         (PropertyBase.PropertyMethod.Define): Handle iterators on a
3256         per-accessor basis.
3257
3258         * cs-parser.jay
3259         (get_accessor_declaration, set_accessor_declaration): Set the
3260         `yields' flag on the accessor, not the property.
3261         (property_declaration): Do the iterators check on a per-accessor
3262         basis and not for the whole property.
3263
3264 2005-07-08  Martin Baulig  <martin@ximian.com>
3265
3266         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3267         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3268
3269 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3270
3271         Fix #74975
3272         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3273         (ExtractSecurityPermissionSet): Cope with self referencing security
3274         attributes properly.
3275
3276         * driver.cs (SetOutputFile): Made public property OutputFile.
3277
3278 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3279
3280         Fix #75486.
3281         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3282         has_nonstatic_fields.  Make into a FieldBase pointer.
3283         (TypeContainer.AddField): Add CS0282 check.
3284         (TypeContainer.EmitType): Update.
3285
3286 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3287
3288         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3289         compare if they start with __.
3290
3291 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3292
3293         * statement.cs (Switch.SwitchGoverningType): Only look at
3294         UserCasts that don't need implicit standard conversions to one of
3295         the allowed switch types (Fixes test-322.cs).
3296         (LocalInfo.Resolve): Re-enable sanity-test.
3297
3298 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3299
3300         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3301         
3302         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3303         
3304         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3305
3306 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3307
3308         Fix #75472.
3309         * ecore.cs (SimpleName.GetSignatureForError): Add.
3310         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3311         (MemberAccess.GetSignatureForError): Add.
3312
3313 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3314  
3315         The big error and warning messages review.
3316         
3317         * anonymous.cs,
3318         * assign.cs,
3319         * attribute.cs,
3320         * class.cs,
3321         * codegen.cs,
3322         * convert.cs,
3323         * cs-parser.jay,
3324         * cs-tokenizer.cs,
3325         * decl.cs,
3326         * delegate.cs,
3327         * doc.cs,
3328         * driver.cs,
3329         * ecore.cs,
3330         * enum.cs,
3331         * expression.cs,
3332         * flowanalysis.cs,
3333         * iterators.cs,
3334         * literal.cs,
3335         * location.cs,
3336         * modifiers.cs,
3337         * namespace.cs,
3338         * parameter.cs,
3339         * pending.cs,
3340         * report.cs,
3341         * rootcontext.cs,
3342         * statement.cs,
3343         * support.cs,
3344         * tree.cs,
3345         * typemanager.cs: Updated.
3346         
3347         * class.cs: (MethodCore.SetYields): Moved here to share.
3348         (PropertyMethod.Define): Moved iterator setup here.
3349         
3350         * iterators.cs: Add orig_method to have full access to parent
3351         container.
3352
3353 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3354
3355         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3356         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3357         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3358         variable of struct type.
3359         * expression.cs (Unary.ResolveOperator): Update to change.
3360         (Indirection.VerifyFixed): Likewise.
3361         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3362         (ParameterReference.VerifyFixed): Value parameters are fixed.
3363         (This.VerifyFixed): Treat 'this' as a value parameter.
3364         * statement.cs (LocalInfo.IsFixed): Remove.
3365
3366 2005-07-01  Martin Baulig  <martin@ximian.com>
3367
3368         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3369         `ec.EmitThis ()' to get the correct scope.
3370
3371 2005-07-01  Martin Baulig  <martin@ximian.com>
3372
3373         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3374         instance is a ParameterReference; fixes #75299.
3375
3376 2005-07-01  Martin Baulig  <martin@ximian.com>
3377
3378         Reverted Marek's latest patch (r46725):
3379         - it contains structural changes which are neither mentioned in
3380           the ChangeLog nor explained anywhere; for example the additional
3381           argument of EmitContext's and Iterator's .ctor's and the
3382           TypeContainer.DefineMembers() change.
3383         - structural changes like this should go in in seperate patches
3384           and not be hidden in a huge patch which just seems to affect
3385           warnings and errors.
3386           a big and hard to understand patch.
3387         - it breaks iterators and causes regressions, for instance in
3388           test-iter-03.cs.      
3389
3390 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3391
3392         Fix #75412.
3393         * expression.cs (Indexers.map): Remove.
3394         (Indexers.Append): Filter out inaccessible setters and getters.
3395         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3396
3397         Fix #75283.
3398         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3399         Refactored from ...
3400         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3401         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3402         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3403         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3404
3405 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3406
3407         Fix #75322
3408         * class.cs (FieldBase.GetInitializerExpression): One more field
3409         for backup.
3410
3411 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3412
3413         * pending.cs: Do not define a proxy if the base method is virtual,
3414         it will be picked up by the runtime (bug 75270).
3415
3416 2005-06-08  Martin Baulig  <martin@ximian.com>
3417
3418         The big Iterators rewrite :-)
3419
3420         * iterators.cs: Rewrite this to use the anonymous methods framework.
3421
3422         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3423         before the TypeContainers; see 2test-21.cs.
3424
3425         * class.cs
3426         (TypeContainer.DefineType): Don't create a new EmitContext if we
3427         already have one (this only happens if we're an Iterator).
3428         (TypeContainer.Define): Also call Define() on all our iterators.
3429         (Method.CreateEmitContext): Added support for iterators.
3430
3431         * anonymous.cs
3432         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3433         (AnonymousContainer.CreateMethodHost): Moved here from
3434         AnonymousMethod and made abstract.
3435         (AnonymousContainer.CreateScopeType): New abstract method.
3436         (AnonymousContainer.IsIterator): New public property.
3437         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3438         get the ScopeTypeBuilder rather than manually defining it here. 
3439         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3440         iterators here.
3441
3442         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3443         before RootContext.DefineTypes().
3444
3445         * codegen.cs (EmitContext.RemapToProxy): Removed.
3446         (EmitContext.CurrentAnonymousMethod): Changed type from
3447         AnonymousMethod -> AnonymousContainer.
3448         (EmitContext.ResolveTopBlock): Protect from being called twice.
3449         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3450         (EmitContext.EmitThis): Removed the iterators hacks; use the
3451         anonymous methods framework for that.
3452
3453         * statement.cs
3454         (ToplevelBlock.Container): Make this a property, not a field.
3455         (ToplevelBlock.ReParent): New public method; move the
3456         ToplevelBlock into a new container.
3457         (Foreach.TemporaryVariable): Simplify.
3458
3459 2005-06-05  Martin Baulig  <martin@ximian.com>
3460
3461         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3462         (Block.AddTemporaryVariable): New public method; creates a new
3463         `LocalInfo' for a temporary variable.
3464         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3465         variables here.
3466         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3467         non-iterator variables.
3468
3469 2005-06-05  Martin Baulig  <martin@ximian.com>
3470
3471         * statement.cs (Foreach.TemporaryVariable): Create the
3472         LocalBuilder in the Emit phase and not in Resolve since in some
3473         situations, we don't have an ILGenerator during Resolve; see
3474         2test-19.cs for an example.
3475
3476 2005-06-04  Martin Baulig  <martin@ximian.com>
3477
3478         **** Merged r45395 from GCS ****
3479
3480         The big Foreach rewrite - Part II.
3481
3482         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3483         with `PropertyInfo ienumerator_getcurrent'.
3484
3485         * codegen.cs (VariableStorage): Removed.
3486
3487         * statement.cs
3488         (Foreach): Derive from Statement, not ExceptionStatement.
3489         (Foreach.CollectionForeach): New nested class.  Moved all the code
3490         dealing with collection foreach here.
3491         (Foreach.ForeachHelperMethods): Removed.
3492         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3493
3494 2005-05-23  Martin Baulig  <martin@ximian.com>
3495
3496         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3497         don't need to.  Fix #75014.
3498
3499 2005-05-20  Martin Baulig  <martin@ximian.com>
3500
3501         Merged r44808 from GMCS.
3502
3503         * class.cs (TypeContainer.CircularDepException): Removed.
3504         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3505         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3506         (CS0146) and interface (CS0529) dependencies here.
3507
3508 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3509
3510         * expression.cs (Invocation.EmitCall): Fix initialization
3511         'this_call' to reflect current behaviour.  Fix indentation.
3512
3513         * convert.cs (FindMostEncompassedType): Add two trivial special
3514         cases (number_of_types == 0 || number_of_types == 1).
3515         (FindMostEncompasingType): Likewise.
3516
3517 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3518
3519         Some cleanups preparing for the fix of #75283.
3520         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3521         error testing.
3522         (EventExpr.InstanceResolve): Likewise.
3523         (EventExpr.DoResolve): Remove redundant checks.
3524
3525 2005-06-10  Duncan Mak  <duncan@novell.com>
3526
3527         * cs-tokenizer.cs (process_directives): New flag for controlling
3528         the processing of preprocessor directives.
3529         (x_token): After seeing a '#', return Token.NONE instead of going
3530         to handle_preprocessing_directive() when not processing
3531         directives. This avoids unnecessary processing during the token peek in
3532         is_punct().
3533
3534         This fixes #74939.
3535
3536         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3537         the existing error reporting methods instead of Report.Error.
3538
3539         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3540         after Raja's rewrite.
3541
3542 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3543
3544         * class.cs: Small fix.
3545
3546 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3547
3548         Fix #75160.
3549         * class.cs (GetPartialBases): Fix return value check of
3550         part.GetClassBases.
3551
3552 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3553
3554         Ensure that partial classes are registered in their enclosing
3555         namespace.  Initial part of fix of #75160.
3556         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3557         Register declspace with namespace here, not in
3558         DeclSpace.RecordDecl.
3559         * cs-parser.jay: Pass namespace to RecordDecl.
3560         * class.cs (PartialContainer.Create): Likewise.
3561         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3562         called.
3563         * decl.cs (Declspace.RecordDecl): Remove.
3564         * namespace.cs (NamespaceEntry.DefineName): Remove.
3565
3566 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3567
3568         * rootcontext.cs: Reset TargetExt as well.
3569
3570 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3571
3572         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3573         -langversion:ISO-1.
3574
3575 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3576
3577         Fix #75080, cs0119.cs.
3578         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3579         of ...
3580         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3581         allowing ExprClass.Type and ExprClass.Namespace for
3582         ResolveFlags.VariableOrValue.
3583         (Expression.Resolve) [1-argument variant]: Change default resolve
3584         flags based on language version.
3585         (Expression.Error_UnexpectedKind): Use a simple string array
3586         rather than an ArrayList.
3587         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3588         not ExprClass.Type.
3589         (TypeOfVoid.DoResolve): Likewise.
3590         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3591         flags argument -- it always has the same value.
3592
3593 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3594
3595         Fix #75081.
3596         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3597         Use it in the error message.
3598         * assign.cs, expression.cs, statement.cs: Update.
3599
3600 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3601
3602         Fix #75088.
3603         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3604         the "almostMatchedMember" case too.
3605         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3606         that failed the accessibility checks to 'almost_match'.
3607
3608 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3609
3610         * attribute.cs: Use internal MethodBuilder methods to set
3611         ExactSpelling and SetLastError on PInvoke methods, instead
3612         of passing them via charset.  Fixes #75060.
3613
3614 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3615
3616         * parameter.cs (Parameter): Remove TODO comment.
3617         (Parameter.DefineParameter): Remove Location parameter.
3618         (Parameters.LabelParameters): Likewise.
3619         * class.cs (Constructor.Emit): Update to change.
3620         (MethodData.Emit): Likewise.
3621         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3622         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3623
3624 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3625
3626         * parameter.cs,
3627           Removed Parameters.Location and added Parameter.Location instead.
3628           Removed Location parameter from Emit() and GetSignature().
3629         * anonymous.cs,
3630           class.cs,
3631           cs-parser.jay,
3632           delegate.cs,
3633           iterators.cs,
3634           statement.cs :
3635           Modified all related calls.
3636
3637 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3638
3639         Improve user-defined conversion handling.
3640         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3641         applicable operators.
3642         (AddConversionOperators): New.  Helper for GetConversionOperators.
3643         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3644         there is only one most encompassed/encompassing type.
3645         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3646         "applicable operator" handling.
3647         (UserConversion): Move cache here from GetConversionOperators.
3648         Directly cache the chosen operator, rather than the whole
3649         MethodGroup.
3650         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3651         case.  Allow conversion of decimal to sbyte and byte too.
3652         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3653         New static methods.  Used to avoid allocating EmptyExpressions in
3654         convert.cs.
3655
3656 2005-05-24  Duncan Mak  <duncan@novell.com>
3657
3658         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3659         another class, used in Convert.ExplicitNumericConversion.
3660         (CastToDecimal): New class, similar to above, but casts to
3661         System.Decimal, used in Convert.ImplicitNumericConversion and also
3662         in explicit convesion from double/float to decimal.
3663
3664         * convert.cs (ImplicitNumericConversion): Handle implicit
3665         conversions to System.Decimal.
3666         (ExplicitNumericConversion): handle explicit conversions to
3667         System.Decimal.
3668
3669         This fixes #68711.
3670         
3671 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3672
3673         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3674         know the type at this stage, just break through.   Fixes #75008 
3675
3676 2005-05-19  Martin Baulig  <martin@ximian.com>
3677
3678         * delegate.cs
3679         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3680         to disable error reporting.
3681
3682         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3683         here since we don't want to report an error; see the new test-336.cs.
3684
3685 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3686
3687         * statement.cs (ToplevelBlock.GetParameterReference)
3688         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3689         Move here from class Block.
3690         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3691         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3692
3693 2005-05-18  Martin Baulig  <martin@ximian.com>
3694
3695         Fix #74978.
3696
3697         * flowanalysis.cs
3698         (FlowBranching.Reachability): Add non-static public And() and Or()
3699         methods.
3700         (FlowBranchingSwitch): New class; do the `break_origins' thing
3701         like in FlowBranchingLoop.
3702         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3703         reachability, not just locals and parameters.
3704         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3705         switch; MergeBreakOrigins() now takes care of that.
3706
3707 2005-05-18  Martin Baulig  <martin@ximian.com>
3708
3709         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3710         a loop and may leave it, reset the barrier; fixes #74974.
3711
3712 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3713         
3714         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3715         is back.
3716         
3717         * cs-parser.jay: Catch more lexical errors.
3718         
3719         * report.cs: Add one more Error method.
3720         
3721         * rootcontext.cs,
3722         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3723
3724 2005-05-17  Martin Baulig  <martin@ximian.com>
3725
3726         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3727         #70970. 
3728
3729 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3730
3731         Fix test-382.cs.  Emit values of decimal constants.
3732         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3733         Carved out of ...
3734         (TypeContainer.AddField): ... this.
3735         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3736         with initializers to include 'Const's.
3737         (ClassPart.RegisterFieldForInitialization): Forward to
3738         PartialContainer.
3739         * const.cs (Const.Const): Pass initializer to base class.
3740         (Const.Define): In case of decimal constants, register them for
3741         initialization in a static constructor.
3742
3743 2005-05-14  Martin Baulig  <martin@ximian.com>
3744
3745         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3746         do not call ResolveUnreachable() on unreachable statements in
3747         here, see the comment in the source code.
3748
3749 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3750
3751         Fix #74934.
3752         * expression.cs (BinaryResolveOperator): If one of the operands of
3753         an equality comparison is 'null' and the other is a pointer type,
3754         convert the null to a NullPointer.
3755         * convert.cs (ImplicitReferenceConversion): If the expression is a
3756         NullLiteral and the target type is a pointer type, return a
3757         NullPointer instead.
3758         (ImplicitConversionStandard): Likewise.
3759
3760 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3761         
3762         * cs-parser.jay: Set readonly context based on special constructs.
3763         
3764         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3765         readonly variable error handling.
3766         
3767         * rootcontext.cs (EmitCode): Don't verify members when error
3768         occurred.
3769         
3770         * statement.cs (LocalInfo): Add reaodnly context information.
3771         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3772
3773 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3774
3775         * statement.cs (Block.Resolve): Revert change below.  Modify fix
3776         for #74041 to initialize 'resolved' to false only for explicit
3777         blocks.  Fixes #74873.
3778
3779 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3780
3781         Fix #74920.
3782         * typemanager.cs (unmanaged_enclosing_types): New.
3783         (IsUnmanagedType): Avoid infloops by using
3784         'unmanaged_enclosing_types' to talk with recursive invocations.
3785
3786 2005-05-13  Martin Baulig  <martin@ximian.com>
3787
3788         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3789         instance variable, not a local.  Fix #74873.
3790         (Block.ResolveUnreachable): Set it to true here.
3791
3792 2005-05-11  Duncan Mak  <duncan@novell.com>
3793
3794         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3795         continuing to process for 'arg'.
3796         (handle_preprocessing_directive): Check the argument of the #endif
3797         directive and report error CS1025 if there are any trailing
3798         characters.
3799
3800         According to the C# spec, having even whitespace after the #endif
3801         directive is illegal; however, because we call arg.TrimEnd ()
3802         beforehand, we have the same behavior as csc, allowing whitespace
3803         after the directive.
3804
3805         Fixes #74892.
3806
3807 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3808
3809         Fix #74863.
3810         
3811         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3812         (Constructor.GetObsoleteAttribute): Implemented correctly.
3813
3814 2005-05-10  Martin Baulig  <martin@ximian.com>
3815
3816         * support.cs (ReflectionParameters.ParameterModifier): Use
3817         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3818         and `ParameterAttributes.In'.  Fixes #74884.
3819
3820 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3821
3822         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3823         
3824         * expression.cs (Argument.GetParameterModifier): Turned to property.
3825         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3826         
3827         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3828         its C# equivalent.
3829         
3830 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3831
3832         Fix #74852.
3833         * decl.cs (MemberCache.AddMethods): Register override methods,
3834         rather than non-override methods.
3835         * typemanager.cs (RegisterOverride): New.
3836         (IsOverride): Update.
3837
3838 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3839
3840         Fix #73105.
3841         
3842         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3843         recursive declaration.
3844         
3845         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3846         
3847 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3848
3849         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3850         
3851         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3852
3853 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3854
3855         Fix #74797.
3856         * decl.cs (DeclSpace.FamilyAccessible): 
3857         Use TypeManager.IsNestedFamilyAccessible.
3858
3859         Fix reopened #64812.
3860         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3861         internal'.
3862
3863 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3864             Abin Thomas  <projectmonokochi@rediffmail.com>
3865             Anoob V E  <projectmonokochi@rediffmail.com>
3866             Harilal P R  <projectmonokochi@rediffmail.com>
3867
3868         Fix #64812.
3869         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3870         allow access to all static members.
3871
3872 2005-05-04  Martin Baulig  <martin@ximian.com>
3873
3874         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3875
3876 2005-05-04  Martin Baulig  <martin@ximian.com>
3877
3878         Fix #74655.
3879
3880         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3881         section at the end; make things work if `default' is not the last
3882         section.        
3883
3884 2005-05-04  Martin Baulig  <martin@ximian.com>
3885
3886         Fix #70400.
3887
3888         * statement.cs (Switch): Replaced the `got_default' field with a
3889         `default_section' one.
3890         (Switch.CheckSwitch): Set `default_section' here.
3891         (Switch.Resolve): If we're a constant switch and the constant is
3892         not found, use the default section.
3893
3894 2005-05-03  Martin Baulig  <martin@ximian.com>
3895
3896         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3897
3898         * statement.cs (Foreach.ArrayForeach): New nested class.
3899         (Foreach.TemporaryVariable): New nested class.
3900         (Foreach.EmitArrayForeach): Removed; this is now in the new
3901         ArrayForeach class.
3902
3903 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3904
3905         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3906         more conservative.
3907         (VerifyPendingMethods): Revert change below.
3908
3909         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3910         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3911         that used to trigger warning -28.  Remove warning -28.
3912         * expression.cs (Invocation.OverloadResolve): Use
3913         TypeManager.IsOverride to distinguish override methods.
3914
3915         Fix #74773.
3916         * pending.cs (VerifyPendingMethods): If a base type implements the
3917         requested interface, don't bother checking individual methods of
3918         the base type.  As a side-effect, this prevents the creation of
3919         unnecessary proxies.
3920
3921 2005-05-02  Martin Baulig  <martin@ximian.com>
3922
3923         Fix #70182.
3924
3925         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3926         Also `And' the locals if the old vector is null.
3927         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3928         null; in this case we basically reset all the variables.        
3929
3930 2005-05-02  Martin Baulig  <martin@ximian.com>
3931
3932         Fix #74529.
3933
3934         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3935         Added `FlowBranching branching' argument; always `and' the
3936         variables instead of `or'ing them unless we're an infinite loop.
3937
3938         * statement.cs (While.Resolve): Create a new sibling unless we're
3939         infinite.       
3940
3941 2005-05-02  Martin Baulig  <martin@ximian.com>
3942
3943         Fix #70140.
3944
3945         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3946         arguments; use it instead of creating a new TopLevelBlock.
3947         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3948         our ConstructorInitializer.
3949
3950         * statement.cs
3951         (TopLevelBlock.TopLevelBranching): New public property.
3952         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3953         and create our `TopLevelBranching'.
3954
3955         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3956         anonymous method host, use `block.TopLevelBranching' rather than
3957         creating a new branching.
3958
3959 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3960
3961         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3962         a ScopeInfo, if any of the current children is a child of the new
3963         entry, move those children there.
3964
3965 2005-04-30  Martin Baulig  <martin@ximian.com>
3966
3967         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3968         at the beginning of a SwitchSection.  Fix #73335.
3969
3970 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3971
3972         Fix #74378
3973         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3974         
3975         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3976         (FieldExpr.DoResolve): Obsolete members are ignored for field
3977         initializers.
3978         
3979 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3980
3981         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3982         of arrays detection.
3983
3984         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3985         verification.
3986         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3987
3988         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3989         arrays report.
3990
3991 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3992
3993         * cs-parser.jay: Use the prefered version of -unsafe in error
3994         message.
3995
3996 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3997
3998         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3999         circumstances.
4000
4001 2005-04-20  John Luke  <john.luke@gmail.com>
4002
4003         * driver.cs: fix typo in error message, --outout to --output
4004
4005 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4006
4007         * codegen.cs (InRefOutArgumentResolving): New field.
4008         
4009         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4010         fields outside contructor.
4011         
4012         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4013         
4014 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4015
4016         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4017         parameter code was not completed ever, so it was not as up-to-date
4018         as local variables.  Must finish it.
4019
4020         The bug fix was to compare the Toplevel of the block, not the
4021         current block.  Thanks for Ben for pointing this out. 
4022
4023 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4024
4025         * decl.cs (AddMethods): Use the declaring type of the problem
4026         method to determine if we want to squash a warning.
4027
4028 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4029
4030         * attribute.cs: Removed debug output.
4031
4032         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4033         
4034         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4035         Report.Stderr.
4036         
4037 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4038
4039         Fix #74481.
4040         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4041         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4042         all null comparisons against reference types.
4043
4044 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4045
4046         Fix# 74565
4047         * class.cs (TypeContainer.CircularDepException) New nested
4048         exception class.
4049         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4050         (TypeContainer.DefineType): Removed error, reset InTransit before
4051         exit.
4052         (Class.DefineType): Throw exception when is in Transit.
4053         Catch exception and report error.
4054         (Struct.DefineType): Throw exception when is in Transit.
4055         Catch exception and report error.
4056         (Interface.DefineType): Throw exception when is in Transit.
4057         Catch exception and report error.
4058
4059         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4060         handle nested exception handlers.
4061
4062         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4063         a catch.
4064
4065         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4066         InFinally and InCatch storage.
4067
4068         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4069         (Catch.Resolve): Set and Restore ec.InCatch.
4070         (Try.Resolve): Set and Restore ec.InFinally.
4071         (Try.HasCatch): True when try has catch.
4072
4073 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4074
4075         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4076           for the same event member, so exclude such cases from warning 419.
4077           Fixed bug #74633.
4078
4079 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4080
4081         * expression.cs (Binary.ResolveOperator): Apply patch from John
4082         Luke to fix bug 59864: operators &, | and ^ on enumerations
4083         require that the same enum type on both sides.
4084
4085         * driver.cs: Add warnings to old flag usage, this is to assist
4086         people who produce Makefiles and hope that the Makefiles will be
4087         used on Windows.
4088
4089         * class.cs (TypeContainer.EmitType): Moved the definition of the
4090         special $PRIVATE$ field from the resolve phase to the Emit phase.
4091         During resolve we do not know if we are a struct with
4092         HasExplicitLayout, we know this only after the attributes for the
4093         type are emitted.
4094
4095         Set the FieldOffset to zero on the dummy field that we create for
4096         the class.   Fixes 74590.
4097
4098 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4099
4100         Fix #73834.
4101         * ecore.cs (PropertyExpr.resolved): New.
4102         (DoResolve): Use it to handle a case of double resolution here.
4103         Handle a case of identical-name-and-type-name.
4104         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4105         resolution by storing the results of expression resolution back
4106         into the "probes" array.
4107
4108 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4109
4110         Fix cs0208-7.cs and cs0208-8.cs.
4111         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4112         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4113         error reporting to point out the reason a struct is not unmanaged.
4114
4115 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4116
4117         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4118           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4119
4120 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4121
4122         Fix #74528.
4123         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4124         IdenticalNameAndTypeName here.
4125         (EventExpr.InstanceResolve): Likewise.
4126
4127 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4128
4129         C# 2.0 DefaultCharSetAttribute implementation
4130         
4131         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4132         which allows us to set GlobalNamespace for every resolve.
4133         (Attribute.ResolveArguments): Cut from Resolve.
4134         (Attribute.GetCharSetValue): Returns CharSet named argument.
4135         (Attribute.DefinePInvokeMethod): Gets default charset from
4136         module settings.
4137         (GlobalAttribute.ResolveAsTypeStep): Override.
4138         (GlobalAttribute.ResolveArguments): Override.
4139         
4140         * class.cs (TypeAttr): Is protected.
4141         
4142         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4143         (ModuleClass.DefaultCharSetType): New memeber.
4144         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4145         
4146         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4147         charset from module.
4148         
4149         * delegate.cs (TypeAttr): Override.
4150         (Delegate.DefineType): Use this TypeAttr.
4151         
4152         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4153         at very early stage (before types are defined) to resolve model
4154         module attributes. It will probably not work with corlib but it
4155         should be ok.
4156         
4157         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4158         charset from module.
4159         
4160         * typemanager.cs (default_charset_type): New type.
4161
4162 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4163
4164         * decl.cs (MemberCache.AddMethods): Don't warn if
4165         System.Object.Finalize has buggy MethodAttributes.
4166
4167         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4168         removed below.
4169
4170 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4171
4172         * doc.cs : detect ambiguous reference to overloaded members.
4173           Fixed bug #71603. MS 1.1 csc does not detect it.
4174
4175 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4176
4177         * doc.cs : delegates must not be referenced with parameters.
4178           Fixed bug #71605.
4179
4180 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4181
4182         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4183
4184 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4185
4186         * driver.cs (MainDriver): Stop processing if the CLS stage found
4187         errors. 
4188
4189         (CompilerCallableEntryPoint.InvokeCompiler): Always
4190         reset after execution;   Take a TextWriter argument for the
4191         output.
4192
4193         * report.cs: Use the error stream instead of hardcoding stderr. 
4194
4195 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4196
4197         * class.cs: Reduce code paths to test, too small of an
4198         optimization to make it worth the extra testing.  Always perform
4199         it. 
4200
4201 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4202
4203         Fix #74510.
4204         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4205         operators that had errors reported on them.
4206
4207 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4208
4209         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4210         argument types.
4211         (Attribute.Resolve): Add named argument type checking.
4212         
4213         * class.cs (FixedField.Define): Use IsPrimitiveType
4214         
4215         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4216         
4217         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4218         unsafe parameter types.
4219         
4220         * statement.cs (Using.ResolveExpression): Add better error description.
4221         
4222         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4223         
4224 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4225
4226         Fix #74484.
4227         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4228         AttributeUsageAttribute in the emitcontext of the attribute class,
4229         not in the emitcontext of the attributable entity it was attached to.
4230         * cs-parser.jay: Use 'current_class', not 'current_container',
4231         when creating a GlobalAttribute.
4232
4233 2005-04-08  Alp Toker  <alp@atoker.com>
4234
4235         * pending.cs: The fix to #58413 failed to compile methods implementing
4236         interfaces with/without params modifiers and vice versa, even though
4237         params modifiers aren't part of the signature. Make the modifier check
4238         less strict as in csc.
4239
4240 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4241             Anoob V E  <projectmonokochi@rediffmail.com>
4242             Harilal P R  <projectmonokochi@rediffmail.com>
4243
4244         Fix #58413.
4245         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4246         modifiers of pending methods.
4247         (PendingImplementation.PendingImplementation): Initialize it.
4248         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4249         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4250         with ParameterData.  Add check for modifiers.
4251         * class.cs (MethodData.Define): Update to changes.
4252
4253 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4254
4255         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4256
4257 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4258
4259         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4260         property.
4261         
4262         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4263         
4264         * rootcontext.cs,
4265         * typemanager.cs: Registered RequiredAttributeAttribute.
4266         
4267 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4268
4269         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4270         Warning CS0169 is back at level 3.
4271         (IMethodData.SetMemberIsUsed): New method.
4272         
4273         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4274         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4275         
4276         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4277
4278         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4279         contants.
4280         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4281         is used.
4282         
4283         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4284         is used.
4285         
4286         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4287         to avoid the problems with nested types.
4288
4289 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4290             Anoob V.E  <projectmonokochi@rediffmail.com>
4291             Harilal P.R  <projectmonokochi@rediffmail.com>
4292             Raja R Harinath  <rharinath@novell.com>
4293
4294         Fix #73820.
4295         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4296         attribute.
4297         * typemanager (GetConstructor): Make public.
4298
4299 2005-04-05  John Luke  <john.luke@gmail.com>
4300             Raja R Harinath  <rharinath@novell.com>
4301
4302         Fix #62232.
4303         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4304         struct too.  Return false quicker in a few cases.
4305         (VerifyUnManaged): Use it.
4306
4307 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4308
4309         Fix #74041.
4310         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4311         not 'unreachable_seen'.
4312
4313 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4314
4315         * attribute.cs (Attribute.GetValue): Removed unused.
4316         
4317         * codegen.cs (CodeGen.TrimExt): Removed unused.
4318         
4319         * cs-parser.jay (output): Removed unused.
4320         
4321         * cs-tokenizer.cs (hex_digits): Removed unused.
4322         
4323         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4324         
4325         * expression.cs (Indirection.LoadExprValue): Removed unused.
4326         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4327         
4328         * iterators.cs (Iterator.param_types): Removed unused.
4329         
4330         * statement.cs (Goto.block): Removed unused.
4331         (ToplevelBlock.did): Removed unused.
4332         (Switch.ResolveConstantSwitch): Removed unused.
4333
4334 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4335
4336         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4337         resetting thingy.
4338
4339 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4340
4341         Fix #74232 and cs0208-3.cs.
4342         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4343         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4344         unmanaged type.  Don't use FieldBuilders when 't' is a
4345         TypeBuilder.  Use ModFlags and MemberType fields.
4346         * class.cs (MemberBase.member_type): Rename from MemberType.
4347         (MemberBase.MemberType): New property.  Determines member_type on
4348         demand.
4349         (MemberBase.DoDefine): Don't initialize MemberType here.
4350         (FieldMember.Define): Likewise.
4351
4352 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4353
4354         Fix #74241
4355         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4356         Attributes are emitted there.
4357         
4358 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4359
4360         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4361         keyword in 'partial enum' too.
4362         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4363         is not allowed).
4364         Report from Kamil Skalski <nazgul@omega.pl>.
4365
4366         Fix #74309.
4367         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4368         have partial containers too.
4369
4370         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4371         in block' checks to Block.CheckInvariantMeaningInBlock.
4372         * statement.cs (Block.GetKnownVariableInfo): Make private.
4373         (Block.IsVariableUsedInChildBlock): Remove.
4374         (Block.IsVariableUsedInBlock): Likewise.
4375         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4376         conflicting declaration.
4377         (Block.AddVariable): Make error messages less long-winded and more
4378         specific.  Show location of conflicting declaration.
4379         * parameter.cs (Parameters.Location): New readonly property.
4380
4381 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4382
4383         Clean up semantics of invoking ResolveMemberAccess.
4384         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4385         can have an instance, ensure that we pass in a non-TypeExpression
4386         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4387         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4388         argument.  Update to changes and simplify.
4389         (FieldExpr.Emitinstance): Remove CS0120 check.
4390         (PropertyExpr.EmitInstance): Likewise.
4391         * expression.cs (Argument.Resolve): Likewise.
4392         (Invocation.DoResolve): Update to changes in semantics of
4393         InstanceExpression.
4394
4395 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4396
4397         Fix #74241
4398         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4399         customization.
4400         
4401         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4402
4403 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4404
4405         Fix difference in behaviour with commandline invocation.
4406         * driver.cs (Driver.Reset): New.
4407         (CompilerCallableEntryPoint): Call it.
4408
4409         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4410         variable" warnings if the boolean expression failed to resolve.
4411
4412 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4413
4414         * attribute.cs: Fix the union of several permissions when some of them
4415         are unrestricted (so the result isn't an unrestricted permission set).
4416         Fix #74036.
4417
4418 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4419
4420         * ecore.cs (MemberExpr): New class.  Convert from interface
4421         IMemberExpr.
4422         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4423         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4424         error checks.
4425         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4426         (MethodGroupExpr.IsExplicitImpl): Remove.
4427         (Expression.GetFieldFromEvent): Remove.
4428         (SimpleName.MemberStaticCheck): Remove.
4429         (SimpleName.DoSimpleNameResolve): Update to changes.
4430         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4431         (MemberAccess.IdenticalNameAndTypeName): Remove.
4432         (MemberAccess.error176): Move to MemberExpr.
4433         (MemberAccess.DoResolve): Update to changes.
4434         (BaseAccess.DoResolve): Likewise.
4435
4436 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4437
4438         C# 2.0 Conditional attribute class implementation
4439         
4440         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4441         Analyzes class whether it has attribute which has ConditionalAttribute
4442         and its condition is not defined.
4443         
4444         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4445         (Class.IsExcluded): New method. Search for at least one defined
4446         condition in ConditionalAttribute of attribute class.
4447
4448 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4449
4450         * ecore.cs (PropertyExpr): Derive from Expression, not
4451         ExpressionStatement.
4452         (PropertyExpr.EmitStatement): Remove.
4453
4454 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4455
4456         Fix #74060.
4457         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4458         internal field "value__" of an enum be private.  The examples for
4459         "value__" that I found on MSDN all used FieldAttributes.Private.
4460
4461         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4462         Don't mention IL method attribute names.
4463
4464         Fix #47991.  Remove a TODO.
4465         * statement.cs (Block.Toplevel): Make into a field.
4466         (Block.Parameters): Move into ToplevelBlock.
4467         (Block.known_variables): Rename from child_variable_names.
4468         (Block.Block): Remove variants that take Parameters.  Initialize
4469         'Toplevel' with the immediately surrounding toplevel block.
4470         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4471         LocalInfo parameter.
4472         (Block.GetKnownVariableInfo): New.
4473         (Block.IsVariableNameUsedInChildBlock): Update.
4474         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4475         the block, even though it may not be in scope.
4476         (Block.AddVariable): Remove Parameters parameter.  Use
4477         Toplevel.Parameters instead.
4478         (Block.AddConstant): Remove Parameters parameter.
4479         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4480         (Block.IsParamaterReference): Likewise.
4481         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4482         (ToplevelBlock.Parameters): New.  Moved from Block.
4483         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4484         initialize Parameters to a non-null value.
4485         * cs-parser.jay: Update to changes.
4486         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4487         simple names that mean different things in the same block.  Use
4488         Block.IsVariableNameUsedInBlock.
4489
4490 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4491
4492         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4493         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4494         GetTypeHandle.  It is possible for a reflected type to derive from
4495         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4496         System.Array during mscorlib compilation).
4497         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4498         contain a method_hash, don't create one either.  Don't create a
4499         deep copy of the base cache's method_hash.
4500         (MemberCache.SetupCache): Rename back from DeepCopy.
4501         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4502         already initialized.  If we see an override function, add its
4503         underlying base virtual function to the member_hash too.
4504
4505         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4506
4507 2005-03-26  Raja R Harinath  <harinath@acm.org>
4508
4509         Fix #73038.
4510         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4511         fails to resolve, ensure that the LHS is still resolved as an
4512         lvalue.
4513
4514 2005-03-25  Raja R Harinath  <harinath@acm.org>
4515
4516         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4517         ec.ContainerType.
4518         (Enum.current_ec): Remove.
4519         (Enum.LookupEnumValue): Remove EmitContext argument.
4520         Just uses the one created during DefineType.
4521         (Enum.FindMembers): Update.
4522         * expression.cs (MemberAccess.DoResolve): Update.
4523
4524 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4525
4526         * assign.cs (Assign.DoResolve): Check for CS1717 when
4527         source and target are same (uses Equals).
4528
4529         * expression.cs (LocalVariableReference, ParameterReference,
4530         This): Implemented Equals, GetHashCode.
4531
4532         * statement.cs (Block.GetParameterReference): Removed useless
4533         local variable.
4534
4535 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4536
4537         Fix cs0128.cs
4538         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4539         blocks before deciding whether the error is cs0136 or cs0128.
4540
4541         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4542         (using_alias_directive, using_namespace_directive): Pass
4543         MemberName, not an expression to Namespace.UsingAlias and
4544         Namespace.Using.
4545         (MakeName): Use the MemberName of the namespace.
4546         * namespace.cs (Namespace.MemberName): New.
4547         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4548         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4549         Likewise.
4550         * decl.cs (MemberName.Name): Make readonly.
4551         (MemberName.FromDotted): New "constructor".
4552         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4553         (MemberCore.Name): Compute from MemberName on demand.
4554         (MemberCore.SetMemberName): Provide a way to change the
4555         MemberName.
4556         (MemberCore.AddToContainer): Don't take a fullname parameter.
4557         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4558         fully qualified name of the container to the member name.
4559         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4560         only if the type is a member of the root container.
4561         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4562         MemberName.Left rather than searching for an embedded ".".
4563         (PartialContainer.CreatePart): Update to changes in RootContext.
4564         (MemberBase.ShortName): Turn into a property.  Use
4565         MemberCore.SetMemberName.
4566         (MemberBase.ExplicitInterfaceName): Remove.
4567         (MemberBase.UpdateMemberName): Remove.
4568         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4569         (PropertyBase.SetMemberName): New override.
4570         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4571         (Tree.GetDecl): New.
4572         (Tree.AllDecls): Rename from Decls.
4573         * attribute.cs, enum.cs, report.cs: Update to changes.
4574         * driver.cs (MainDriver): Use MemberName.FromDotted on
4575         RootContext.MainClass.
4576
4577 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4578
4579         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4580         checks.
4581
4582         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4583
4584 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4585
4586         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4587         property accessor modifiers.
4588
4589         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4590         fixed buffer attribute (CS1716).
4591         (PropertyMethod.HasCustomAccessModifier): When property accessor
4592         has custom modifier.
4593
4594         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4595         modifiers.
4596         (PropertyExpr.DoResolveLValue): Add CS0272.
4597
4598 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4599
4600         * convert.cs: When converting to a pointer, use the proper Conv.U
4601         or Conv.I depending on the source data type.
4602
4603         * cs-tokenizer.cs: Make the size for large decimal constants,
4604         fixes #72957.
4605
4606 2005-03-17  Martin Baulig  <martin@ximian.com>
4607
4608         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4609         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4610
4611 2005-03-17  Martin Baulig  <martin@ximian.com>
4612
4613         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4614         to bool so we can return an error condition.
4615         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4616         returned an error.
4617
4618 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4619
4620         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4621         attributes.
4622
4623 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4624
4625         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4626         Refactor to avoid traversing the list of assemblies, and to avoid
4627         string concatenation.
4628         * typemanager.cs (guid_attr_type): Remove.
4629         (negative_hits, pointers, references): Remove hashes.
4630         (type_hash): New.
4631         (GetConstructedType): New.  Uses type_hash to handle constructed
4632         types (arrays, references, pointers).
4633         (GetReferenceType, GetPointerType): Use it.
4634         (GetNestedType): New.  Uses type_hash to handle nested types of
4635         reflected types.
4636         (LookupType, LookupTypeDirect): Remove.
4637         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4638         'types' hash and LookupTypeReflection directly.
4639         (params_string, params_object): Use GetConstructedType.
4640         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4641         top-level types.
4642         (Namespace.Lookup): Use cached_types.
4643         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4644         provided by old TypeManager.LookupType.
4645         * rootcontext.cs (MakeFQN): Remove.
4646         * decl.cs (DeclSpace.MakeFQN): Likewise.
4647         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4648         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4649         TypeManager.GetConstructedType.
4650         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4651
4652 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4653
4654         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4655         indexers.
4656
4657         * cs-parser.jay: Reports CS1527 for any namespace element.
4658
4659         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4660         Added CS0407.
4661
4662         * expression.cs (ParameterReference.IsAssigned): Changed error to
4663         CS0269.
4664         (Error_WrongNumArguments): Moved CS0245 detection here.
4665
4666         * statement.cs (Return.Resolve): Add CS1622 report.
4667
4668 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4669
4670         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4671
4672 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4673
4674         * attribute.cs expression.cs: Get rid of some allocations.
4675
4676 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4677
4678         * doc.cs : just eliminate the latest change.
4679
4680 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4681
4682         * doc.cs : commented out the latest change. It breaks xml-030.cs
4683
4684 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4685
4686         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4687           fail. So invoke CreateType() in FindDocumentedType().
4688
4689 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4690
4691         * cs-tokenizer.cs : added IsKeyword().
4692         * doc.cs : Detect keyword incorrectly used as identifier.
4693           Allow identifiers prefixed by @.
4694
4695 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4696
4697         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4698         It caused exception in namespace resolving (again!).
4699         
4700         * class.cs (Class.ctor): Removed exit.
4701         (PropertyMethod.ctor): ditto.
4702         
4703         * codegen.cs (Codegen.Reset): Reset static data.
4704         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4705         
4706         * cs-tokenizer.cs (Cleanup): Removed.
4707         
4708         * driver.cs (GetSystemDir): Rewrote to one line command.
4709         It caused problem with unloaded dynamic modules.
4710         (UnixParseOption): Removed Exit.
4711         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4712         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4713         Now can be mcs used as library.
4714         
4715         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4716         empty location.
4717         
4718         * location.cs (Reset): Reset static data.
4719         
4720         * namespace.cs (Reset): Reset static data.
4721         
4722         * report.cs (Report.Reset): Reset static data.
4723         
4724         * rootcontext.cs (RootContext.Reset): Reset static data.
4725         
4726         * tree.cs (RootTypes.ctor): Use Location.Null
4727         
4728         * typemanager.cs (TypeManager.Reset): Reset static data.
4729         (CoreLookupType): Removed Exit.
4730         (TypeHandle.Reset): Reset static data.
4731         
4732 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4733
4734         Fix #73516.
4735         * typemanager.cs (ComputeNamespaces): Import namespaces from
4736         referenced modules too.
4737
4738 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4739
4740         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4741         than '.'.
4742
4743 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4744
4745         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4746         enclosing DeclSpace.  This ensures that a name-lookup populates
4747         more caches and there are fewer 'TypeExpression's.  Carve out
4748         nested type lookup into ...
4749         (LookupNestedTypeInHierarchy): ... this.
4750
4751 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4752
4753         Clean up a few partial-class semantics.  
4754         Fixes test-357.cs and cs1618-2.cs.
4755         * cs-parser.jay (struct_declaration): Use 'current_class' as
4756         parent of newly-created struct.  Remove call to Register ().
4757         Use 'pop_current_class' to complete handing the current struct.
4758         (interface_declaration): Likewise.
4759         (class_declaration): Likewise.
4760         (enum_declaration): Use 'current_class' as parent of newly created
4761         enum.
4762         (delegate_declaration): Likewise.
4763         (pop_current_class): New function.  This is used to handle closing
4764         up the 'current_class' and 'current_container', and pointing them
4765         to the enclosing class/container.
4766         (CSharpParser): Initialize 'current_class' too.
4767         * decl.cs (MemberCore): Add check for invariant: a partial
4768         container is not a parsed entity, and thus does not enclose any
4769         parsed members.
4770         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4771         (DeclSpace.BaseTypeExpr): Use it.
4772         (DeclSpace.LookupType): Add check for invariant.
4773         * class.cs (TypeContainer): Add check for invariant: a nested
4774         class should have the same NamespaceEntry as its enclosing class.
4775         (TypeContainer.EmitFieldInitializers): Make virtual.
4776         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4777         MemberCore.
4778         (TypeContainer.Register): Remove.
4779         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4780         null.  Use TypeResolveEmitContext for resolving base types and
4781         interfaces.  Move initialization of Parts.TypeBuilder here from
4782         ...
4783         (TypeContainer.DefineNestedTypes): ... here.
4784         (PartialContainer): Take a Namespace not a NamespaceEntry.
4785         (PartialContainer.Create): Don't use Register.  Call the
4786         appropriate Add... function directly.
4787         (ClassPart): Take both the PartialContainer and the enclosing
4788         class as constructor arguments.
4789         (ClassPart.EmitFieldInitializers): Override.
4790         (ClassPart.PartFindNestedTypes): Remove.
4791         (FieldBase.GetInitializerExpression): Resolve the initializer
4792         expression in the emit context of the enclosing class.
4793         * tree.cs (RootTypes): Remove Register ().
4794         
4795 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4796
4797         * cs-parser.jay: Removed CS0134.
4798         
4799         * driver.cs: Removed CS1901.
4800         
4801         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4802         for predefined types.
4803
4804 2005-03-07  Duncan Mak  <duncan@novell.com>
4805
4806         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4807         well. Fixes bug #73454.
4808
4809 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4810
4811         * cs-tokenizer.cs (xtoken): Add CS1035.
4812         
4813         * class.cs (MethodData.Define): Add CS0683.
4814         (FieldMember.ctor): Add CS0681.
4815
4816 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4817
4818         * ecore.cs (SimpleName.DoResolve): Rename from
4819         SimpleName.DoResolveAllowStatic.
4820         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4821         Pass 'intermediate' flag to MemberStaticCheck.
4822         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4823         of "intermediate" lookups via MemberAccess.
4824         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4825         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4826
4827 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4828
4829         Fix #73394.
4830         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4831         slipped in because of variable names that are identical to a
4832         builtin type's BCL equivalent ('string String;', 'int Int32;').
4833         (PropertyExpr.EmitInstance): Likewise.
4834
4835 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4836
4837         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4838         
4839         * report.cs (warning_ignore_table): Made public.
4840
4841 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4842
4843         Fix #73282.
4844         * class.cs (MethodData.Emit): Pass 'container' to
4845         container.GetObsoleteAttribute instead of 'container.Parent'.
4846
4847 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4848
4849         * cs-parser.jay: Add 1534 error test.
4850
4851         * iterators.cs (Yield.CheckContext): Add error 1629.
4852         (Iterator.ctor): Save unsafe modifier.
4853         (MoveNextMethod.DoEmit): Restore unsafe context.
4854
4855         * namespace.cs (UsingAlias): Better error message.
4856
4857 2005-03-03  Dan Winship  <danw@novell.com>
4858
4859         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4860         the warning message [#73219]
4861
4862 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4863
4864         Fix compile with MCS 1.0.0.0.
4865         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4866         w_restore to not depend on string constant folding.
4867
4868 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4869
4870         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4871         CS0246 check to users who passed 'silent = false'.
4872         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4873         check.
4874         (SimpleName.SimpleNameResolve): Update.
4875         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4876         (MemberAccess.IdenticalNameAndTypeName): Update.
4877         * doc.cs (FindDocumentedTypeNonArray): Update.
4878
4879 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4880
4881         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4882         * parameters.cs (ComputeAndDefineParameters): Remove.
4883         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4884         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4885         Use GetParameterInfo.
4886
4887 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4888
4889         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4890
4891 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4892
4893         Unify DeclSpace.LookupType and DeclSpace.FindType.
4894         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4895         is in charge of defining nested types on demand.
4896         (DeclSpace.LookupType): Use it when the current_type is a
4897         TypeBuilder.  Use LookupTypeDirect for reflected types.
4898         (DeclSpace.FindType): Remove.
4899         (DeclSpace.LookupInterfaceOrClass): Likewise.
4900         (DeclSpace.DefineTypeAndParents): Likewise.
4901         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4902         DeclSpace.LookupType.
4903         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4904         * typemanager.cs (LookupType): Simplify.
4905         (AddUserType): Remove type from negative_hits.
4906         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4907         * class.cs (TypeContainer.FindMembers): Move handling of nested
4908         types ...
4909         (TypeContainer.FindMembers_NestedTypes): ... here.
4910         (TypeContainer.FindNestedType): Implement override.
4911         (ClassPart.FindNestedType): Delegate to PartialContainer.
4912         (ClassPart.PartFindNestedType): Looks up the nested types of the
4913         part alone.
4914
4915 2005-03-02  Martin Baulig  <martin@ximian.com>
4916
4917         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4918         static constructor in static classes.
4919
4920 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4921
4922         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4923         sizeParamIndex is not specified.
4924
4925 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4926
4927         Fix #73117
4928         * report.cs (WarningMessage.IsEnabled): Missing null check.
4929
4930 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4931
4932         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4933         in the fields and not in the properties.
4934
4935 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4936
4937         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4938         fields as well.
4939
4940 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4941
4942         * attribute.cs: Small refactoring (improved robustness).
4943         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4944         (ValidateGuid): Removed.
4945         (Resolve): Removed referenced to above mentioned.
4946         (GetAttributeUsage): Made private and changed to work without
4947         class assistance.
4948         (GetIndexerAttributeValue): Don't crash.
4949         (GetConditionalAttributeValue): Ditto.
4950         (GetClsCompliantAttributeValue): Ditto.
4951         (ExtractSecurityPermissionSet): All attributes exceptions are
4952         error 648.
4953         (GetPropertyValue): New helper.
4954         (GetMethodImplOptions): New method.
4955         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4956         some missing properties.
4957         
4958         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4959         (Method.ApplyAttributeBuilder): Updated.
4960         
4961         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4962         exception.
4963
4964 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4965
4966         Fix #73052.
4967         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4968         non-simple types (array, pointer, reference).
4969
4970 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4971
4972         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4973
4974         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4975         for operators.
4976         (Method.CheckBase): Catch wrong destructor here.
4977         (MethodData.Define): Add errors 550, 668.
4978
4979         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4980
4981         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4982
4983         * pending.cs (VerifyPendingMethods): Add error 551.
4984
4985         * typemanager.cs (CSharpName): Next error report helper.
4986
4987 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4988
4989         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4990         attributes. Removed useless attribute double check.
4991         It saves almost 2MBs for corlib.
4992
4993 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4994
4995         Fix #72924.
4996         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4997         called twice in case of error.
4998
4999 2005-02-23  Chris Toshok  <toshok@ximian.com>
5000
5001         Fix compiler portions of #72827.
5002         * statement.cs (Block.Emit): call Begin/EndScope on the
5003         EmitContext instead of the ILGenerator.
5004
5005         * codegen.cs (EmitContext.BeginScope): new method, call
5006         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5007         we have one.)
5008         (EmitContext.BeginScope): same, but EndScope and CloseScope
5009
5010         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5011         offset and call the superclass's OpenScope(int) with it.
5012         (SymbolWriter.CloseScope): get the current il
5013         offset and call superclass's CloseScope(int) with it.
5014
5015 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5016
5017         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5018         CS1677 for out and ref as well.
5019
5020         * class.cs (Method.Define): Add error CS1599 detection.
5021         
5022         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5023         
5024         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5025         
5026         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5027         
5028         * support.cs.cs (ModifierDesc): New helper method.
5029
5030 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5031             Abin Thomas  <projectmonokochi@rediffmail.com>
5032             Anoob V E  <projectmonokochi@rediffmail.com>
5033             Harilal P R  <projectmonokochi@rediffmail.com>
5034
5035         Fix #57851, #72718.
5036         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5037         MemberLookup (used for error reporting) actually returns a result.
5038         Fix error report number (122, not 112).
5039
5040 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5041             Anoob V E  <projectmonokochi@rediffmail.com>
5042             Harilal P R  <projectmonokochi@rediffmail.com>
5043
5044         Fix #71134.
5045         * pending.cs (PendingImplementation.GetAbstractMethods):
5046         Find NonPublic members too.
5047
5048 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5049
5050         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5051         Fixed error 217.
5052         
5053         * class.cs (MethodCore.CheckMethodAgainstBase):
5054         Add error 239 report.
5055
5056 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5057
5058         Fix #68955.
5059         * expression.cs (Invocation.IsApplicable): Make public.
5060         (Invocation.IsParamsMethodApplicable): Likewise.
5061         * delegate.cs (Delegate.VerifyApplicability): Don't use
5062         Invocation.VerifyArgumentCompat for parameter applicability
5063         testing.  Use Invocation.IsApplicable and
5064         Invocation.IsParamsMethodApplicable.
5065
5066 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5067
5068         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5069         
5070         * class.cs (Operator.Define): Add error 217 report.
5071         
5072 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5073
5074         * namespace.cs (UsingEntry.Resolve): Undo change below.
5075
5076 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5077
5078         Fix #72756.
5079         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5080         disable the error message when the extended MemberLookup also
5081         fails.
5082         (Expression.MemberLookupFinal): Update.
5083         (SimpleName.DoSimpleNameResolve): Update.
5084         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5085         Don't use MemberLookupFinal.
5086         (New.DoResolve): Update.
5087         (BaseAccess.CommonResolve): Update.
5088
5089 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5090
5091         Fix #72732.
5092         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5093         occured previously, don't resolve again.
5094
5095 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5096
5097         Fix #69949
5098         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5099         argument. Call ResolveAttributeUsage for unresolved.
5100         when types doesn't match ctor arguments.
5101         
5102         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5103         for nested attribute classes.
5104         (Class.attribute_usage): Removed.
5105         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5106         for attribute class.
5107         
5108         * ecore.cs (IsAttribute): Removed.
5109         
5110         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5111         
5112         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5113         now normal types.
5114         (attribute_types): Removed.
5115         (EmitCode): Global attributes are emited as the latest.
5116
5117 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5118
5119         * class.cs (EmitFieldInitializers): Don't emit field initializer
5120         for default values when optimilization is on.
5121         
5122         * constant.cs (Constant.IsDefaultValue): New property.
5123         
5124         * driver.cs: Add /optimize handling.
5125         
5126         * constant.cs,
5127         * ecore.cs,
5128         * literal.cs: Implement new IsDefaultValue property.
5129         
5130         * rootcontext.cs (Optimize): New field, holds /optimize option.
5131
5132 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5133
5134         Fix crasher in re-opened #72347.
5135         * namespace.cs (Namespace.Lookup): Return null if
5136         DeclSpace.DefineType returns null.
5137
5138         Fix #72678.
5139         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5140
5141 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5142
5143         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5144         now returns null if it cannot resolve to an lvalue.
5145         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5146         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5147         returned null.  Remove check for SimpleName.
5148         (EventExpr.DoResolveLValue): New.
5149         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5150         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5151         error from ...
5152         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5153         avoid CS0131 error.
5154         (Unary.ResolveOperator): Move CS0211 check ...
5155         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5156         CS0131 error.
5157         (Unary.DoResolveLValue): Simplify.
5158         (AddressOf.DoResolveLValue): New.
5159         (ArrayAccess.DoResolveLValue): New.
5160
5161 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5162
5163         * attribute.cs (Attribute.Resolve): Add arguments casting for
5164         when types doesn't match ctor arguments.
5165
5166 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5167
5168         Fix parts of #63202.
5169         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5170         lookup of operator in base type.  Ensure that all checks happen
5171         when the operator resolves to an "op_..." method.
5172
5173 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5174
5175         Fix #71992.
5176         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5177         'ignore_cs0104' parameter.  Pass it to ...
5178         (NamespaceEntry.Lookup): ... this.
5179         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5180         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5181         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5182         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5183         Update.  Request that cs0104 errors be ignored.
5184         (ComposedCast.ResolveAsTypeStep): Update.
5185
5186 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5187
5188         Fix #59209.
5189         * expression.cs (Invocation.BetterFunction): Remove support for
5190         comparing virtual functions and their overrides.
5191         (Invocation.IsOverride): New.
5192         (Invocation.OverloadResolve): Don't consider 'override' functions
5193         during candidate selection.  Store them in a lookaside list.
5194         If the selected method is a 'virtual' function, use the list to
5195         find any overrides that are closer to the LHS type.
5196
5197 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5198
5199         * expression.cs (New.DoResolve): Add complex core type reduction.
5200         (New.Constantify): Converts complex core type syntax like 'new int ()'
5201         to simple constant.
5202         
5203 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5204
5205         * decl.cs (EntryType.EntryType): New constructor to create an
5206         updated copy of a cache entry.
5207         (MemberCache.AddMethods): Use it.
5208         (MemberCache.ClearDeclaredOnly): Remove.
5209         (MemberCache.MemberCache): Update.
5210
5211 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5212
5213         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5214         variable.  This one is represents the actual low-level declaration
5215         of the method, as opposed to the semantic level `IsStatic'.   
5216
5217         An anonymous method which is hosted into a static method might be
5218         actually an instance method.  IsStatic would reflect the
5219         container, while MethodIsStatic represents the actual code
5220         generated.
5221
5222         * expression.cs (ParameterReference): Use the new MethodIsStatic
5223         instead of IsStatic.
5224
5225         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5226         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5227         set on the current EmitContext. 
5228
5229         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5230         resolve our casted expression as an LValue.  This triggers the
5231         proper LValue processing that is later required by Assign.
5232
5233         This fixes 72347.
5234
5235         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5236
5237 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5238
5239         C# 2.0 Fixed buffer implementation
5240
5241         * anonymous.cs: Update after RegisterHelperClass renaming.
5242
5243         * attribute.cs (AttributeTester.fixed_buffer_cache):
5244         Cache of external fixed buffers.
5245         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5246         implementation if field is fixed buffer else null.
5247
5248         * class.cs
5249         (TypeContainer.AddField): Accept FieldMember instead of Field.
5250         (FieldBase.IsFieldClsCompliant): Extracted code from
5251         VerifyClsCompliance descendant customization.
5252         (FixedField): New class handles fixed buffer fields.
5253         (FixedFieldExternal): Keeps information about imported fixed
5254         buffer.
5255         (IFixedField): Make access to internal or external fixed buffer
5256         same.
5257
5258         * cs-parser.jay: Add fixed buffer parsing.
5259
5260         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5261         buffer.
5262
5263         * expression.cs (Indirection): Extended implementation to accept
5264         fixed buffer field.
5265         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5266         (ElementAccess.MakePointerAccess): Get type as parameter.
5267         (DoResolve): Add fixed buffer field expression conversion.
5268         (DoResolveLValue): Ditto.
5269         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5270         (ArrayPtr): Derives from FixedBufferPtr.
5271         (ArrayPtr.Emit): Add extra emit for array elements.
5272
5273         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5274
5275         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5276         for compiler generated types.
5277         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5278
5279         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5280         and consume less memory.
5281         (Fixed.Resolve): Add fixed buffer case.
5282
5283         * typemanager.cs (compiler_generated_attr_ctor,
5284         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5285         (HasElementType): Add our own implementation to work on every
5286         runtime.
5287
5288 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5289
5290         * anonymous.cs (CaptureContext): Track whether `this' has been
5291         referenced.   
5292
5293         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5294         only captured `this' if it was implicitly done (instance
5295         methods/variables were used). 
5296
5297         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5298         `this' must be captured.
5299
5300 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5301  
5302         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5303         is null it means that there has been no need to capture anything,
5304         so we just create a sibling.
5305
5306         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5307
5308         Just a partial fix.  The other half is fairly elusive.
5309         
5310 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5311
5312         Fix #52586, cs0121-4.cs.
5313         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5314         and return a hashtable.
5315         (MemberCache.ClearDeclaredOnly): New.
5316         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5317         the method_hash of a base type too.
5318         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5319         type methods.  Overwrite entries with the same MethodHandle so
5320         that the ReflectedType is correct.  The process leaves in base
5321         virtual functions and their overrides as distinct entries.
5322         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5323         matters since it was boxed in a ArrayList before.
5324         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5325         modifier.
5326         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5327         case of a virtual function and its override (choose the overload
5328         as better).
5329         (Invocation.OverloadResolve): Avoid 'override' members during
5330         'applicable_type' calculation.
5331
5332 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5333
5334         Combine two near-redundant caches.
5335         * typemanager.cs (method_params): Rename from method_internal_params.
5336         (TypeManager.GetParameterData): New.  Replace
5337         Invocation.GetParameterData.
5338         (TypeManager.LookupParametersByBuilder): Remove.
5339         * expression.cs (Invocation.method_parameter_cache): Remove.
5340         (Invocation.GetParameterData): Remove.
5341         Update to changes.
5342         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5343         Update to changes.
5344
5345 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5346
5347         Fix #72015.
5348         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5349         TypeManager.multicast_delegate_type is null, resolve it by looking
5350         up "System.MulticastDelegate".
5351         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5352
5353 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5354             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5355             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5356
5357         Fix cs0164.cs.
5358         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5359         (LabeledStatement.AddReference): New.  Set 'referenced'.
5360         (Goto.Resolve): Use it.
5361
5362 2005-02-05  John Luke  <john.luke@gmail.com>
5363
5364         * driver.cs: remove duplicate -doc line in Usage ()
5365
5366 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5367
5368         * location.cs (Location.AddFile): Fix CS2002 error report.
5369
5370 2005-02-02  Martin Baulig  <martin@ximian.com>
5371
5372         * delegate.cs (Delegate.DefineType): Report an internal error if
5373         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5374         details.        
5375
5376 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5377
5378         Fix a crasher in a variant of #31984.
5379         * const.cs (Constant.CheckBase): New override that defers the
5380         new-or-override check in case the base type hasn't been populated
5381         yet.
5382         (Constant.Define): Ensure the new-or-override check is performed.
5383
5384 2005-02-01  Duncan Mak  <duncan@ximian.com>
5385
5386         * const.cs (LookupConstantValue): Check that `ce' is not null
5387         before calling GetValue ().
5388
5389 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5390
5391         Fix test-334.cs (#69519).
5392         * cs-parser.jay (using_alias_directive): Pass in an expression to
5393         NamespaceEntry.UsingAlias.
5394         (using_namespace_directive): Pass in an expression to
5395         NamespaceEntry.Using.
5396         (namespace_name): Don't flatten to a string.
5397         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5398         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5399         ResolveAsTypeStep.
5400         (NamespaceEntry.UsingEntry): Likewise.
5401         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5402         changes.
5403         (NamespaceEntry.LookupForUsing): Remove.
5404         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5405         names.
5406         (NamespaceEntry.Lookup): Remove support for dotted names.
5407
5408 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5409
5410         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5411         split into two.
5412         (NamespaceEntry.ImplicitParent): Compute on demand.
5413         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5414         parallels the current.
5415         (NamespaceEntry.LookupForUsing): Use it.
5416         (NamespaceEntry.Lookup): If the current namespace-entry is
5417         implicit, don't search aliases and using tables.
5418
5419 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5420
5421         Fix #31984.
5422         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5423         BaseCache here.
5424         (TypeContainer.BaseCache): Compute on demand.
5425         (TypeContainer.FindMembers): Define constants and types if they're
5426         not already created.
5427         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5428         check.
5429         * const.cs (Constant.Define): Make idempotent.
5430
5431 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5432
5433         * pending.cs: Produce better code (no nops produced by using Ldarg
5434         + value).
5435         
5436         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5437         i - 1' it should be arg + 1.
5438
5439         Fixes bug #71819.
5440
5441 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5442
5443         * attribute.cs (Attribute.CheckAttributeType): Make private
5444         non-virtual.
5445         (Attribute.ResolveType): Make virtual.
5446         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5447         handling of RootContext.Tree.Types.
5448
5449 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5450
5451         Update attribute-handling to use the SimpleName/MemberAccess
5452         mechanisms.
5453         * cs-parser.jay (attribute): Pass in an expression to the
5454         constructors of Attribute and GlobalAttribute.
5455         * attribute.cs (Attribute): Take an expression for the name.
5456         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5457         passed in attribute name expression.
5458         (Attribute.CheckAttributeType): Use it.
5459         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5460         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5461         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5462         argument to prevent error messages if the lookup fails.
5463
5464 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5465
5466         * expression.cs (Indirection): Implemented IVariable interface
5467         to support indirection in AddressOf operator.
5468         (PointerArithmetic.Emit): Add optimalization for case where
5469         result can be precomputed.
5470
5471 2005-01-26  Martin Baulig  <martin@ximian.com>
5472
5473         * class.cs (TypeContainer.AttributeTargets): Return the correct
5474         AttributeTargets depending on our `Kind' instead of throwing an
5475         exception; fixes #71632.
5476
5477 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5478
5479         Fix #71257
5480         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5481         constant members.
5482
5483 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5484
5485         Fix #71602.
5486         * expression.cs (MemberAccess.DoResolve): Don't complain with
5487         cs0572 when the LHS of a member access has identical name and type
5488         name.
5489
5490 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5491
5492         Fix #71651, #71675
5493         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5494         CreatePermission.
5495         Create custom PermissionSet only for PermissionSetAttribute.
5496
5497 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5498
5499         Fix #71649
5500         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5501         delegates in static class.
5502
5503 2005-01-24  Martin Baulig  <martin@ximian.com>
5504
5505         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5506         merging an implicit block, just use its reachability.
5507
5508         * statement.cs (Block.Resolve): Make the unreachable code check
5509         work wrt. implicit blocks; see test-337 from #63842.
5510
5511 2005-01-21  Alp Toker  <alp@atoker.com>
5512  
5513         * cs-parser.jay: destructor_declaration's container is PartialContainer
5514         not Class when partial types are used, so use Kind prop instead of
5515         'is'.
5516         
5517 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5518
5519         * cs-parser.jay: Improve error reporting when an interface
5520         declares new types.
5521
5522 2005-01-20  Dick Porter  <dick@ximian.com>
5523
5524         * support.cs: SeekableStreamReader fix from Sandor Dobos
5525         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5526         chars are read.  Fixes bug 70369.
5527
5528 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5529
5530         * cs-parser.jay (catch_clause): Simplify current_block handling
5531         somewhat.
5532
5533 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5534
5535         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5536         code with ImplicitStandardConversion to handle the implicit
5537         conversion of method groups into valid delegate invocations. 
5538
5539         The problem is that in parameter handling we were using this code
5540         path.  Fixes bug #64698
5541
5542 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5543
5544         * cs-parser.jay: Fix several infelicities.
5545         - Avoid assigning to the parser value stack.  Code like 
5546           '$3 = null' is unclean.  Synthesize a value for the code block
5547           instead. 
5548         - Avoid using oob_stack for storing location information.  Use ...
5549         (_mark_): ... this.  New (empty) rule.  Saves the current location
5550         in $$.
5551         (foreach_statement): Avoid using oob_stack for current_block
5552         handling.  Use technique used in for_statement and
5553         using_statement.  Synthesize a value for the code block to store
5554         additional intermediate information.
5555
5556 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5557
5558         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5559         of a different type is only allowed to private fields of a
5560         containing type, not on fields of a base class.
5561
5562         See test-174.cs and error cs0122-9.cs
5563
5564 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5565
5566         Fix test-335.cs (bug #58126).
5567         * cs-parser.jay (argument): Split out non-expression parts of the
5568         rule into 'non_simple_argument'.
5569         (invocation_expression): Support parenthesized invocations with
5570         multiple arguments, and with single non-simple arguments.
5571
5572 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5573
5574         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5575         places.
5576
5577 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5578
5579         Fix cs0038-1.cs, cs1640-6.cs.
5580         * ecore.cs (Expression.Resolve): Remove special-case for
5581         SimpleName in error-handling.
5582         (Expression.almostMatchedMembers): Relax access permission to
5583         protected.
5584         (Expression.MemberLookupFailed): Handle duplicates in
5585         almostMatchedMembers list.
5586         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5587         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5588         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5589         overload if the passed in MemberInfo is a MethodBase.
5590
5591 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5592
5593         Fix #70749
5594         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5595         for non-CAS & merge permission sets properly.
5596
5597 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5598
5599         Improve standard-compliance of simple name and member access 
5600         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5601         * ecore.cs (FullNamedExpression): New abstract base class 
5602         for Namespaces and TypeExpressions.
5603         (ResolveFlags.SimpleName): Remove.
5604         (SimpleName): Remove support for dotted names.
5605         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5606         DeclSpace.FindType and DeclSpace.LookupType.
5607         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5608         (Expression.ExprClassName): Make member function.
5609         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5610         a namespace.  Remove creation of dotted "SimpleName"s.
5611         (MemberAccess.DoResolve): Likewise.
5612         * decl.cs (DeclSpace.Cache): Make private.
5613         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5614         (DeclSpace.FindType): Update.
5615         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5616         FullNamedExpression.
5617         * namespace.cs (Namespace): Derive from FullNamedExpression
5618         so that it can be part of expression resolution.
5619         (Namespace.Lookup): Return an FullNamedExpression.
5620         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5621         namespace.
5622         * rootcontext.cs (NamespaceLookup): Remove.
5623         (LookupType): Move to DeclSpace.
5624         * attribute.cs (CheckAttributeType): Update.
5625         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5626         (FindDocumentedTypeNonArray): Likewise.
5627
5628 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5629
5630         Fix cs0509.cs, cs1632.cs.
5631         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5632         is the same as IsInterface.
5633         (TypeContainer.GetClassBases): Likewise.
5634         * statement.cs (LabeledStatement.ig): New field.
5635         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5636         label.
5637         (LabeledStatement.DoEmit): Check that the label was created with
5638         the same ILGenerator.
5639
5640 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5641
5642         Fix #71058
5643         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5644         accessors to its properties.
5645
5646         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5647         from accessors to property.
5648         
5649 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5650
5651         Fix #70722
5652         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5653         only for overrides.
5654         
5655 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5656
5657         * attribute.cs: Check for null and empty strings.  
5658
5659         I have lost another battle to Paolo.
5660
5661 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5662
5663         Fix #70942
5664         * class.cs (PropertyMethod): Set Parent field in ctors.
5665         (SetMethod.InternalParameters): Add unsafe switch hack.
5666         Override MarkForDuplicationCheck where it is appropriate.
5667
5668         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5669         It says whether container allows members with the same name.
5670         Base default is no.
5671         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5672         Removed is_method parameter.
5673
5674 2005-01-06  Duncan Mak  <duncan@ximian.com>
5675
5676         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5677         because the previous change led to incorrect reporting of CS1032
5678         ("Cannot define/undefine preprocessor symbols after first token in
5679         file"). Instead of using `tokens_seen' as the only flag that
5680         triggers CS1040, introduce `comments_seen'. This new flag is used
5681         to signify having seen comments on the current line, so it is
5682         unset after a newline.
5683
5684 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5685
5686         * doc.cs : When searching for a type, find nested type too.
5687           This fixes bug #71040.
5688
5689 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5690
5691         * doc.cs :
5692           - Warn missing member comment on those classes which also does not
5693             have doc comments. Fixed bug #71041.
5694           - Don't warn missing doc comment on default constructor.
5695             Fixed bug #71042.
5696
5697 2005-01-06  Duncan Mak  <duncan@ximian.com>
5698
5699         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5700         comments, set `tokens_seen' to true. This allows us to detect
5701         misplaced preprocessor directives (i.e. not at the beginning of
5702         the a line, nor after whitespaces). In that case, report error
5703         CS1040. This fixes bug #56460.
5704
5705         * cs-parser.jay (interface_member_declaration): Add checks for
5706         IsExplicitImpl, and report CS0541 error if an interface member is
5707         defined as an explicit interface declaration.
5708
5709 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5710
5711         Fix #70817
5712         * class.cs (PropertyMethod): Set Parent field in ctors.
5713         (SetMethod.InternalParameters): Add unsafe switch hack.
5714         
5715         * decl.cs (MemberCore.Parent): Cannot be readonly.
5716
5717 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5718
5719         * decl.cs (DeclSpace.ResolveType): Remove.
5720         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5721         Merge in code from ...
5722         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5723         * class.cs, enum.cs: Update to changes.
5724
5725 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5726
5727         * anonymous.cs: Ensure that we init the scope of our parent if it
5728         has not been initialized yet.
5729
5730 2004-12-30  Duncan Mak  <duncan@ximian.com>
5731
5732         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5733         if field.FieldBuilder is null. Fixes #70758.
5734
5735         * convert.cs: Fixed some typos and updated some of the comments.
5736         (ImplicitStandardConversionExists):
5737         (TryImplicitIntConversion): If `target_type' is an interface and
5738         the type of `ic' implements this interface, return true or a new
5739         BoxedCast instead of null. This fixes #70468.
5740
5741 2004-12-29  Duncan Mak  <duncan@ximian.com>
5742
5743         * expression.cs (Argument.Emit): Check that Expr is
5744         IMemoryLocation before casting to it, and report CS1510 otherwise.
5745
5746         This fixes #70402.
5747
5748 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5749
5750         * statement.cs (Block.ThisVariable): remove the recursion here, to
5751         make the --profile more sane.
5752
5753 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5754
5755         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5756         assembly, by JB Evain.
5757
5758 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5759
5760         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5761           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5762         "parent" refers to enclosing type/class.  "base" refers to superclass.
5763
5764 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5765
5766         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5767         Ensure that we only have GlobalAttributes.
5768         * attribute.cs (Attribute.Emit): Make non-virtual.
5769         (GlobalAttribute.Emit): Remove.
5770         (Attribute.Resolve): Make virtual.
5771         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5772         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5773         the argument. Don't create one.
5774         (Attribute.GetObsoleteAttribute): Likewise.
5775         (Attribute.GetClsCompliantAttributeValue): Likewise.
5776         * class.cs, decl.cs: Update to changes.
5777
5778 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5779
5780         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5781         
5782         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5783         
5784         * statement.cs (Foreach.Resolve): Add error 186 report.
5785
5786 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5787
5788         * expression.cs (Conditional.DoResolve): Add warning 429.
5789         
5790         * statement.cs (If.Resolve): Add warning 665.
5791
5792 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5793
5794         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5795         except when in the parser, and in GlobalAttribute.
5796         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5797         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5798         RootContext.Tree.Types.NamespaceEntry once work is done.
5799         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5800         and resets RootContext.Tree.Types.NamespaceEntry.
5801
5802 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5803
5804         * cs-parser.jay: Don't create a block for every variable.
5805
5806 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5807
5808         * location.cs: Provide extra information.
5809
5810         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5811         variables from the captured environment, it is the ldarg_0.
5812
5813 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5814
5815         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5816         find a conclusion.
5817         
5818         * class.cs: Changed warning level for 169 to avoid developer
5819         displeasure from warning flooding. It will be changed back when they
5820         fix most of current BCL warnings.
5821         
5822         * RootContext.cs: Pushed default WarningLevel to 3.
5823         
5824         * statement.cs: Removed unused variable.
5825
5826 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5827
5828         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5829         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5830         Add error 502 report.
5831         (StaticClass.DefineType): Add error 441 report.
5832         (Class.AllowedModifiersProp): New virtual property as temporary
5833         extension to AllowedModifiers.
5834         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5835         to share implementation with StaticClass and don't call virtual
5836         methods from ctor.
5837         
5838         * driver.cs (MainDriver): Add error 1558 test.
5839
5840         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5841         report. Moved error 36 test here.
5842
5843         * statement.cs (Throw.Resolve): Add error 724 report.
5844
5845         * typemanager.cs: Add out_attribute_type core type.
5846         
5847 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5848
5849         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5850         3018 report.
5851         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5852
5853         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5854         3017 report.
5855         
5856         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5857
5858         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5859         Add error 3023 report.
5860         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5861
5862         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5863         implementation.
5864
5865 2004-12-12  John Luke  <john.luke@gmail.com>
5866
5867         * driver.cs (AddArgs): take -- into account when
5868         adding arguments, fixes bug 65710 
5869
5870 2004-12-12  Martin Baulig  <martin@ximian.com>
5871
5872         * expression.cs (Unary.TryReduceNegative): Added support for
5873         SByteConstant and ByteConstant.
5874         (Unary.Reduce): Check error values from TryReduceNegative().
5875
5876 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5877
5878         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5879         and report exception as error 182.
5880
5881 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5882
5883         * driver.cs (Main): Fix message when there are warnings.
5884
5885 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5886
5887         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5888
5889 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5890
5891         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5892         Reduced number of warnings.
5893         
5894         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5895
5896 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5897
5898         * driver.cs: Removed message.
5899
5900         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5901
5902 2004-12-08    <vargaz@freemail.hu>
5903
5904         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5905
5906 2004-12-08  Martin Baulig  <martin@ximian.com>
5907
5908         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5909         instead of a CS3002 for properties and indexer.
5910
5911 2004-12-08  Martin Baulig  <martin@ximian.com>
5912
5913         * decl.cs (MemberName.ToString): Make this work again.
5914
5915 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5916
5917         * attribute.cs (Resolve): Add error 591 detection.
5918
5919         * class.cs (FieldMember.Define): Add error 1547 detection.
5920         (Indexer.Define): Add error 620 detection.
5921         (Operator.Define): Add error 590 detection.
5922
5923         * ecore.cs: Missing argument for error 79.
5924
5925         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5926         detection.
5927
5928 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5929
5930         Fix #70106
5931         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5932         only.
5933
5934 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5935
5936         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5937           Some operator comments were suppressed.
5938         * doc.cs : Implicit/explicit operator name in doc comments are like
5939           "op_Explicit(type)~returnType", so added suffix handling.
5940
5941 2004-12-07  Martin Baulig  <martin@ximian.com>
5942
5943         * decl.cs
5944         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5945         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5946         (DeclSpace.ec): New protected field; store the EmitContext here.
5947         (DeclSpace.EmitContext): New public property; moved here from
5948         `TypeContainer'.
5949         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5950         EmitContext.
5951
5952         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5953         (Enum.Emit): Don't create a new EmitContext.
5954
5955         * delegate.cs (Delegate.DefineType): Always create the
5956         EmitContext.
5957
5958         * iterators.cs (Iterators.DefineIterator): Create a new
5959         EmitContext and store it in `ec'.
5960
5961 2004-08-24  Martin Baulig  <martin@ximian.com>
5962
5963         * typemanager.cs
5964         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5965         this for accessibility checks.
5966         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5967         IsNestedFamilyAccessible.
5968         (TypeManager.IsSubclassOf): New method, do what the name actually
5969         says.   
5970
5971 2004-12-06  Raja R Harinath  <rharinath@novell.com>
5972
5973         Fix crash on cs0657-17.cs.
5974         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5975         Use RootContext.Tree.Types, not 'new RootTypes ()'.
5976         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5977         the case where the NamespaceEntry gets overwritten.
5978
5979 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
5980
5981         Fixed #69195, #56821
5982         * ecore.cs (ResolveBoolean): Tiny refactoring.
5983
5984         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5985         of right expression resolving when left is false constant and
5986         operator is LogicalAnd OR true constant and operator is LogicalOr.
5987
5988         * statement.cs (ResolveUnreachable): Always reports warning.
5989
5990 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
5991
5992         * class.cs: Distinguish between 1721 and 1722 (just a little help
5993         for the programmer).
5994
5995 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
5996
5997         * delegate.cs: Only allow this on new versions of the language. 
5998
5999 2004-12-02  Duncan Mak  <duncan@ximian.com>
6000
6001         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6002         Expression class.
6003         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6004         here as a static method. Take an additional bool out parameter
6005         `must_do_cs1540_check' for signaling to InstanceResolve.
6006         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6007         member field from PropertyExpr class and made it an argument of
6008         the method instead.
6009         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6010         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6011         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6012         and `remove_accessor' as well as InstanceResolve: report CS0122
6013         where applicable.
6014
6015         Fixes #70129.
6016
6017 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6018
6019         Fix test-327.cs, test-328.cs, and put in early infrastructure
6020         for eventually fixing #52697.
6021         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6022         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6023         from other methods.
6024         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6025         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6026         (VerifyUsing, error246): Update.
6027         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6028         'NamespaceEntry.LookupNamespaceOrType'.
6029
6030 2004-12-03  Martin Baulig  <martin@ximian.com>
6031
6032         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6033         method as our child, call AnonymousMethod.Compatible() on it.
6034
6035 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6036
6037         Disable XML documentation support in 'basic' profile.
6038         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6039         Redirect XmlElement to System.Object.
6040         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6041         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6042         * mcs.exe.sources: Add doc-bootstrap.cs.
6043         * doc-bootstrap.cs: New file.  Contains empty stub implementation
6044         of doc.cs.
6045
6046 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6047
6048         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6049           comments are allowed.
6050
6051 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6052
6053         * delegate.cs: Add checks for subtypes in paramaters and return values
6054         in VerifyMethod () to add support for Covariance/Contravariance
6055         in delegates.
6056         
6057 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6058
6059         * report.cs: Remove extra closing parenthesis.
6060
6061         * convert.cs (Error_CannotImplicitConversion): If the name of the
6062         types are the same, provide some extra information.
6063
6064         * class.cs (FieldBase): Use an unused bit field from the field to
6065         encode the `has_offset' property from the FieldMember.  This saves
6066         a couple of Ks on bootstrap compilation.
6067
6068         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6069         method as our child, return the AnonymousMethod resolved
6070         expression.
6071
6072         * expression.cs (New.DoResolve): Allow return values from
6073         NewDelegate to also include AnonymousMethods.
6074
6075         Fixes #70150.
6076
6077 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6078
6079         Fix bug #70102
6080         * attribute.cs (Resolve): Improved implementation of params
6081         attribute arguments.
6082
6083         * support.cs (ParameterData): Add HasParams to be faster.
6084
6085 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6086
6087         all things are for /doc support:
6088
6089         * doc.cs: new file that supports XML documentation generation.
6090         * mcs.exe.sources: added doc.cs.
6091         * driver.cs:
6092           Handle /doc command line option.
6093           Report error 2006 instead of 5 for missing file name for /doc.
6094           Generate XML documentation when required, after type resolution.
6095         * cs-tokenizer.cs:
6096           Added support for picking up documentation (/// and /** ... */),
6097           including a new XmlCommentState enumeration.
6098         * cs-parser.jay:
6099           Added lines to fill Documentation element for field, constant,
6100           property, indexer, method, constructor, destructor, operator, event
6101           and class, struct, interface, delegate, enum.
6102           Added lines to warn incorrect comment.
6103         * rootcontext.cs :
6104           Added Documentation field (passed only when /doc was specified).
6105         * decl.cs:
6106           Added DocComment, DocCommentHeader, GenerateDocComment() and
6107           OnGenerateDocComment() and some supporting private members for
6108           /doc feature to MemberCore.
6109         * class.cs:
6110           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6111         * delegate.cs:
6112           Added overriden DocCommentHeader.
6113         * enum.cs:
6114           Added overriden DocCommentHeader and GenerateDocComment().
6115
6116 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6117
6118         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6119         unwrapping the enumeration values, chain to
6120         DoConstantNumericPromotions again, so we can promote things to the
6121         fundamental types (takes care of enums that are bytes, sbytes).
6122
6123         Fixes bug #62054.
6124
6125 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6126
6127         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6128         Fix long-standing bug in type-lookup.  Use FindType instead of
6129         LookupType when ec.ResolvingTypeTree.
6130         (Attribute.ResolveType, Attribute.Resolve)
6131         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6132         Update to changes.
6133         (Attributes.Search): Remove internal version.  Update.
6134         (Attributes.SearchMulti): Update.
6135         (Attributes.GetClsCompliantAttribute): Remove.
6136         (Attributes.GetIndexerNameAttribute): Remove.
6137         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6138         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6139         * class.cs (Indexer.Define): Likewise.
6140
6141 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6142
6143         Fix bug #68790
6144         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6145         MarshallByReference members access.
6146
6147         * expression.cs: Use CheckMarshallByRefAccess;
6148         Better error CS0197 message.
6149
6150         * report.cs: Print whole related error message.
6151
6152 2004-11-30  Raja R Harinath  <rharinath@novell.com>
6153
6154         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6155         the current directory to help debugging.
6156
6157 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6158
6159         * class (GetClassBases): Better error 60 report.
6160         (EventProperty): Disabled warning 67 detection.
6161
6162 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6163
6164         Fix bug #60324
6165         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6166
6167         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6168         precise values.
6169
6170 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6171
6172         Fix bug #49488
6173         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6174
6175         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6176
6177 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6178
6179         * attribute.cs (Attribute.Resolve): Refine error reporting and
6180         report a cs0117 if the identifier does not exist, to distinguish
6181         from 0617 which is a miss-use of the actual identifier.
6182
6183         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6184         between cs0070 and cs0079.
6185
6186         * class.cs (MemberBase.DoDefine): When reporting a wrong
6187         accessibility level, we use MethodCore to compare instead of
6188         Method (this was a regression in some refactoring effort).
6189
6190         So now we correctly report cs0056 again.
6191
6192         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6193         testing the target_type (which was known to be object_type) and
6194         not the source type (which is anonymous_method).
6195
6196         Fixed reporting of error cs1660.
6197
6198         * expression.cs (UserCast.Source): Expose the underlying cast.
6199
6200         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6201         allowed types to find a match to int32 first (most common).
6202
6203         In addition, it ignores any ImplicitUserConversions that did an
6204         internal implicit conversion (as the switch statement allows only
6205         one integral conversion to exist).
6206
6207         * class.cs (PartialContainer.Create): rename `name' to
6208         `member_name' for clarity.  Then replace the string calls with a
6209         call to MemberName.GetPartialName, as now using
6210         MemberName.ToString is an error (this is due to the side effects
6211         it had, that were fixed in the past).
6212
6213         This will restore the error reporting on a number of partial class
6214         errors that were missusing this (and getting an exception as a
6215         results, which is now just a plain textual warning, because
6216         yyparse debug output would crash otherwise).
6217
6218 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6219
6220         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6221
6222 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6223
6224         * rootcontext.cs (LookupType): Make sure to cache lookups that
6225         don't give us a negative result. This saves about 5% of corlib
6226         compilation time.
6227
6228 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6229
6230         * report.cs (AbstractMessage.Print): messages are sent to stderr
6231
6232         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6233         non-interface in the list of interfaces (at this point, either
6234         parent was properly set, or a base class is being listed in the
6235         interfaces section).
6236
6237         This flags error 1722, and resolves the crash from bug 69259.
6238
6239 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6240
6241         * statement.cs (Using.EmitExpressionFinally): make this work right
6242         for valuetypes. Fixes 69926.
6243
6244 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6245
6246         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6247         converted to an enum" here, before we try to change the underlying
6248         type.  This code exists, but it is a different code path than the
6249         one used while encoding constants.
6250
6251         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6252         old bug: when converting from the null literal to a pointer,
6253         return an EmptyCast, not the NullLiteral.
6254
6255         This fixes #69921, the recent null_type changes probably made this
6256         bug more prominent.
6257
6258         (ImplicitReferenceConversionExists): In addition, resynchronized
6259         the code here, so it matches the same code in
6260         ImplicitReferenceConversionExists for the `from any class-type S
6261         to any interface-type T'.
6262         
6263
6264 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6265
6266         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6267
6268 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6269
6270         * cs-parser.jay: Use verbosity accordingly. 
6271
6272 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6273
6274         * expression.cs (Unary.ResolveOperator): Do not report warning;
6275         AddressOf reads from variable.
6276         
6277         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6278
6279 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6280
6281         Fix bug #69462
6282
6283         * attribute.cs (Attributable): Removed CheckTargets.
6284         (Attributes.Emit): Explicit attribute targets are tested here.
6285
6286         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6287         not enabled for interfaces.
6288
6289         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6290         (GetAssemblyName): Ouch next bug there.
6291
6292 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6293
6294         * expression.cs: Error 275 added.
6295         
6296 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6297
6298         Fix bug #69177 (Implemented decimal constant support)
6299
6300         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6301         (BinaryFold): Add DecimalConstant.
6302
6303         * const.cs (Define): Decimal constant 
6304         (is not constant.
6305         (ChangeType): Add decimal type handling.
6306         (LookupConstantValue): Don't set value for decimal type but
6307         emit DecimalConstantAttribute. Needed for constant optimization.
6308
6309         * constant.cs (ToDecimal): New method.
6310         (ConvertToDecimal): New method.
6311         (IntConstant): Implemented ConvertToDecimal.
6312         (DecimalConstant.Emit): Emit optimized version for decimals in
6313         int range.
6314
6315         * expression.cs (ResolveOperator): Changed order of constant
6316         reduction to work correctly with native types which have
6317         overloaded operators.
6318         (ResolveMemberAccess): Extract constant value from attribute
6319         for decimal type.
6320
6321         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6322
6323         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6324         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6325         (ChangeType): Decimal is special.
6326         (TypeToCoreType): Add decimal type.
6327
6328 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6329
6330         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6331         decimal types.
6332
6333 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6334
6335         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6336         test cs1667-5.cs.
6337
6338 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6339
6340         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6341
6342         * pending.cs (PendingImplementation): Grab only interfaces.
6343
6344 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6345
6346         * statement.cs (ForeachHelperMethods): Add location member and
6347         error 202 detection.
6348
6349 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6350
6351         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
6352         automatically handled by executable.make.
6353         (PROGRAM): Make profile-specific.
6354
6355 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6356
6357         * expression.cs (DoResolveBase): Fixed wrong warning for out
6358         variables.
6359
6360 2004-11-18  Martin Baulig  <martin@ximian.com>
6361
6362         Merged latest changes into gmcs.  Please keep this comment in
6363         here, it makes it easier for me to see what changed in MCS since
6364         the last time I merged.
6365
6366 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6367
6368         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6369         (TypeHandle.GetMemberCache): New.
6370         (TypeHandle.TypeHandle): Update.
6371         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6372         (TypeManager.LookupParentInterfacesCache):
6373         Rename from LookupInterfaceCache.  Optimize slightly.
6374         (TypeManager.MemberLookup_FindMembers): Update.
6375         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6376         multi-type variant.
6377         (AddCacheContents): Rename from AddHashtable.
6378         * class.cs (TypeContainer.parent_container): Remove.
6379         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6380         (TypeContainer.DoDefineMembers): Don't initialize it.
6381         Update to name changes.
6382         
6383 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6384
6385         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6386         that factors the code to check access modifiers on override.  
6387
6388         (PropertyBase): Use the code here.
6389
6390         Patch from Lluis S'anchez, fixes bug #69361.
6391
6392 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6393
6394         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6395         routine that is used to report the use of a captured variable
6396         whose address has been taken.
6397
6398         There are two checks: one when variables are being captured and
6399         the other check is when the address of a variable is taken. 
6400         
6401         (because an anonymous methods might be resolved before *or* after
6402         the address has been taken) and 
6403
6404         * expression.cs (Conditional.DoResolve): Remove the special
6405         casing that Martin added to trueExpr and falseExpr being both
6406         NullLiteral.  We get the right behavior now just by introducing
6407         the null_type into the compiler. 
6408
6409         * convert.cs (ExplicitConversion): Change the code to use
6410         null_type instead of testing `expr is NullLiteral'.
6411         (ImplicitConversionStandard): use null_type too.
6412         (ImplicitReferenceConversionExists): use null_type too.
6413         (ImplicitReferenceConversion): use null_type too.
6414
6415         * literal.cs: The type of `NullLiteral' is now null_type instead
6416         of object_type. 
6417         (Resolve): Set the type here.
6418
6419         * typemanager.cs: Introduce null_type.
6420
6421 2004-11-17  Martin Baulig  <martin@ximian.com>
6422
6423         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6424         direction, like FindMembers() does.  Fixes #69546, testcase is in
6425         test-315.cs.    
6426
6427 2004-11-16  Martin Baulig  <martin@ximian.com>
6428
6429         This is based on a patch from Marek Safar, see bug #69082.
6430         Fixes bugs #63705 and #67130.
6431
6432         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6433         method; create a MemberCache for an interface type and cache the
6434         result.
6435
6436         * decl.cs (IMemberContainer.ParentContainer): Removed.
6437         (IMemberContainer.ParentCache): New property.
6438         (MemberCache.SetupCacheForInterface): Removed.
6439         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6440         to create a cache for an interface's "parent".
6441
6442         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6443         interfaces too.
6444
6445 2004-11-16  Martin Baulig  <martin@ximian.com>
6446
6447         Merged back from gmcs; these changes already went into gmcs a
6448         couple of weeks ago.
6449
6450         * typemanager.cs
6451         (TypeManager.AddUserType): Removed the `ifaces' argument.
6452         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6453         `TypeExpr []'.
6454         (TypeManager.AddUserInterface): Removed.
6455         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6456         `TypeExpr []'.
6457         (TypeManager.GetInterfaces): Likewise.
6458         (TypeManager.GetExplicitInterfaces): Likewise.
6459
6460         * ecore.cs (TypeExpr.GetInterfaces): Removed.
6461
6462         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6463         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6464
6465 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6466
6467         * statement.cs: Avoid adding bools to a hashtable.
6468
6469 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6470
6471         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6472         calling an unsafe method from a safe location.
6473
6474 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6475
6476         Fix #69167
6477         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6478
6479 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6480
6481         * namespace.cs (VerifyUsing): use GetPartialName instead of
6482         ToString. 
6483
6484 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6485
6486         * statement.cs (Return.Resolve): Fix regression in typo: if
6487         `in_exc', we have to request a NeedReturnLabel, this was a typo
6488         introduced in the anonymous method check-in.  Fixes #69131.
6489
6490         * Indexers were using the ShortName when defining themselves,
6491         causing a regression in the compiler bootstrap when applying the
6492         patch from 2004-11-02 (first part), now they use their full name
6493         and the bug is gone.
6494
6495 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6496
6497         * driver.cs: Strip the path from the names of embedded resources. Fixes
6498         #68519.
6499
6500 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6501
6502         Fix error message regression: cs0104-2.cs.
6503         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6504         (AliasEntry.Resolve): Update.
6505         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6506         'silent' flag.
6507         (RootContext.LookupType): Update.
6508
6509 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6510
6511         * cs-parser.jay: Add support for handling accessor modifiers
6512         * class: Add support port accessor modifiers and error checking,
6513         define PropertyMethod.Define as virtual (not abstract anymore)
6514         * ecore.cs: Add checking for proeprties access with access modifiers
6515         * iterators.cs: Modify Accessor constructor call based in the modified
6516         constructor
6517 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6518
6519         * expression.cs (StringConcat): Handle being called twice,
6520         as when we have a concat in a field init with more than two
6521         ctors in the class
6522
6523 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6524
6525         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6526         special case explicit implementations, we should always produce
6527         the .property or .event declaration.
6528         
6529         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6530         since it will not return correct data if people use this
6531         unresolved in the presence of using statements (see test-313).
6532
6533         * class.cs (MethodData.Define): If we are an explicit interface
6534         implementation, set the method name to the full name of the
6535         interface plus the name of the method.  
6536
6537         Notice that using the method.MethodName.GetFullName() does not
6538         work, as it will only contain the name as declared on the source
6539         file (it can be a shorthand in the presence of using statements)
6540         and not the fully qualifed type name, for example:
6541
6542         using System;
6543
6544         class D : ICloneable {
6545                 object ICloneable.Clone ()  {
6546                 }
6547         }
6548
6549         Would produce a method called `ICloneable.Clone' instead of
6550         `System.ICloneable.Clone'.
6551
6552         * namespace.cs (Alias.Resolve): Use GetPartialName.
6553         
6554 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6555
6556         * cs-parser.jay: Add error 1055 report.
6557
6558 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6559
6560         * assign.cs (Assign.DoResolve): Only do the transform of
6561         assignment into a New if the types are compatible, if not, fall
6562         through and let the implicit code deal with the errors and with
6563         the necessary conversions. 
6564
6565 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6566
6567         * cs-parser.jay: Add error 1031 report.
6568
6569         * cs-tokenizer.cs: Add location for error 1038.
6570
6571 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6572
6573         * cs-parser.jay: Add error 1016 report.
6574
6575 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6576
6577         * cs-parser.jay: Add errors 1575,1611 report.
6578
6579 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6580
6581         * cs-parser.jay: Add error 1001 report.
6582
6583 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6584
6585         Fix #68850
6586         * attribute.cs (GetMarshal): Add method argument for
6587         caller identification.
6588
6589         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6590         agument for GetMarshal and RuntimeMissingSupport.
6591
6592 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6593
6594         * attribute.cs (ExtractSecurityPermissionSet): Removed
6595         TypeManager.code_access_permission_type.
6596
6597         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6598
6599 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6600
6601         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6602         for obsolete use of a variable here.   Fixes regression on errors
6603         cs0619-25 and cs0619-26.
6604
6605 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6606
6607         Fix #62358, implemented security attribute encoding.
6608
6609         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6610         Tests permitted SecurityAction for assembly or other types.
6611         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6612         data from SecurityPermissionAttribute to PermisionSet class.
6613
6614         * class.cs (ApplyAttributeBuilder): Added special handling
6615         for System.Security.Permissions.SecurityAttribute based types.
6616
6617         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6618         special handling for System.Security.Permissions.SecurityAttribute
6619         based types.
6620
6621         * enum.cs (ApplyAttributeBuilder): Added special handling
6622         for System.Security.Permissions.SecurityAttribute based types.
6623
6624         * parameter.cs (ApplyAttributeBuilder): Added special handling
6625         for System.Security.Permissions.SecurityAttribute based types.
6626
6627         * rootcontext.cs: Next 2 core types.
6628
6629         * typemanager.cs (TypeManager.security_permission_attr_type):
6630         Built in type for the SecurityPermission Attribute.
6631         (code_access_permission_type): Build in type.
6632
6633 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6634
6635         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6636         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6637         all of this information into
6638         EmitContext.EmitCapturedVariableInstance.
6639         
6640         * codegen.cs (EmitCapturedVariableInstance): move here the
6641         funcionality of emitting an ldarg.0 in the presence of a
6642         remapping.   This centralizes the instance emit code.
6643
6644         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6645         then emit a load of this: it means that we have reached the
6646         topmost ScopeInfo: the one that contains the pointer to the
6647         instance of the class hosting the anonymous method.
6648
6649         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6650         captures to the topmost CaptureContext.
6651
6652 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6653
6654         * expression.cs (LocalVariableReference): Move the knowledge about
6655         the iterators into codegen's EmitCapturedVariableInstance.
6656
6657 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6658
6659         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6660         all code paths return a value from an anonymous method (it is the
6661         same as the 161 error, but for anonymous methods).
6662
6663 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6664
6665         The introduction of anonymous methods in the compiler changed
6666         various ways of doing things in the compiler.  The most
6667         significant one is the hard split between the resolution phase
6668         and the emission phases of the compiler.
6669
6670         For instance, routines that referenced local variables no
6671         longer can safely create temporary variables during the
6672         resolution phase: they must do so from the emission phase,
6673         since the variable might have been "captured", hence access to
6674         it can not be done with the local-variable operations from the runtime.
6675         
6676         * statement.cs 
6677
6678         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6679         is a toplevel block.
6680
6681         (ToplevelBlock): A new kind of Block, these are the blocks that
6682         are created by the parser for all toplevel method bodies.  These
6683         include methods, accessors and anonymous methods.
6684
6685         These contain some extra information not found in regular blocks:
6686         A pointer to an optional CaptureContext (for tracking captured
6687         local variables and parameters).  A pointer to the parent
6688         ToplevelBlock.
6689         
6690         (Return.Resolve): Catch missmatches when returning a value from an
6691         anonymous method (error 1662).
6692         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6693         phase.
6694
6695         (Break.Resolve): ditto.
6696
6697         (SwitchLabel): instead of defining the labels during the
6698         resolution phase, we now turned the public ILLabel and ILLabelCode
6699         labels into methods called GetILLabelCode() and GetILLabel() that
6700         only define the label during the Emit phase.
6701
6702         (GotoCase): Track the SwitchLabel instead of the computed label
6703         (its contained therein).  Emit the code by using
6704         SwitchLabel.GetILLabelCode ().
6705
6706         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6707         whether the Local has been captured or not.
6708
6709         (LocalInfo.IsCaptured): New property, used to tell whether the
6710         local has been captured.
6711         
6712         * anonymous.cs: Vastly updated to contain the anonymous method
6713         support.
6714
6715         The main classes here are: CaptureContext which tracks any
6716         captured information for a toplevel block and ScopeInfo used to
6717         track the activation frames for various local variables.   
6718
6719         Each toplevel block has an optional capture context associated
6720         with it.  When a method contains an anonymous method both the
6721         toplevel method and the anonymous method will create a capture
6722         context.   When variables or parameters are captured, they are
6723         recorded on the CaptureContext that owns them, for example:
6724
6725         void Demo () {
6726              int a;
6727              MyDelegate d = delegate {
6728                  a = 1;
6729              }
6730         }
6731
6732         Here `a' will be recorded as captured on the toplevel
6733         CapturedContext, the inner captured context will not have anything
6734         (it will only have data if local variables or parameters from it
6735         are captured in a nested anonymous method.
6736
6737         The ScopeInfo is used to track the activation frames for local
6738         variables, for example:
6739
6740         for (int i = 0; i < 10; i++)
6741                 for (int j = 0; j < 10; j++){
6742                    MyDelegate d = delegate {
6743                         call (i, j);
6744                    }
6745                 }
6746
6747         At runtime this captures a single captured variable `i', but it
6748         captures 10 different versions of the variable `j'.  The variable
6749         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6750         recorded on a child.  
6751
6752         The toplevel ScopeInfo will also track information like the `this'
6753         pointer if instance variables were referenced (this is necessary
6754         as the anonymous method lives inside a nested class in the host
6755         type of the method). 
6756
6757         (AnonymousMethod): Expanded to track the Toplevel, implement
6758         `AnonymousMethod.Compatible' to tell whether an anonymous method
6759         can be converted to a target delegate type. 
6760
6761         The routine now also produces the anonymous method content
6762
6763         (AnonymousDelegate): A helper class that derives from
6764         DelegateCreation, this is used to generate the code necessary to
6765         produce the delegate for the anonymous method that was created. 
6766
6767         * assign.cs: API adjustments for new changes in
6768         Convert.ImplicitStandardConversionExists.
6769
6770         * class.cs: Adjustments to cope with the fact that now toplevel
6771         blocks are of type `ToplevelBlock'. 
6772
6773         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6774         insteda of standard blocks.
6775
6776         Flag errors if params arguments are passed to anonymous methods.
6777
6778         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6779         `CurrentAnonymousMethod' which points to the current Anonymous
6780         Method.  The variable points to the AnonymousMethod class that
6781         holds the code being compiled.  It is set in the new EmitContext
6782         created for the anonymous method.
6783
6784         (EmitContext.Phase): Introduce a variable and an enumeration to
6785         assist in enforcing some rules about when and where we are allowed
6786         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6787         only one that enfonces this right now).
6788
6789         (EmitContext.HaveCaptureInfo): new helper method that returns
6790         whether we have a CapturedContext initialized.
6791
6792         (EmitContext.CaptureVariable): New method used to register that a
6793         LocalInfo must be flagged for capturing. 
6794
6795         (EmitContext.CapturedParameter): New method used to register that a
6796         parameters must be flagged for capturing. 
6797         
6798         (EmitContext.CapturedField): New method used to register that a
6799         field must be flagged for capturing. 
6800
6801         (EmitContext.HaveCapturedVariables,
6802         EmitContext.HaveCapturedFields): Return whether there are captured
6803         variables or fields. 
6804
6805         (EmitContext.EmitMethodHostInstance): This is used to emit the
6806         instance for the anonymous method.  The instance might be null
6807         (static methods), this (for anonymous methods that capture nothing
6808         and happen to live side-by-side with the current method body) or a
6809         more complicated expression if the method has a CaptureContext.
6810
6811         (EmitContext.EmitTopBlock): Routine that drives the emission of
6812         code: it will first resolve the top block, then emit any metadata
6813         and then emit the code.  The split is done so that we can extract
6814         any anonymous methods and flag any captured variables/parameters.
6815         
6816         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6817         during this phase, the ILGenerator should not be used as labels
6818         and local variables declared here might not be accessible to any
6819         code that is part of an anonymous method.  
6820
6821         Exceptions to this include the temporary variables that are
6822         created by some statements internally for holding temporary
6823         variables. 
6824         
6825         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6826         metadata for a cb
6827
6828         (EmitContext.TemporaryReturn): This method is typically called
6829         from the Emit phase, and its the only place where we allow the
6830         ReturnLabel to be defined other than the EmitMeta.  The reason is
6831         that otherwise we would have to duplicate a lot of logic in the
6832         Resolve phases of various methods that today is on the Emit
6833         phase. 
6834
6835         (EmitContext.NeedReturnLabel): This no longer creates the label,
6836         as the ILGenerator is not valid during the resolve phase.
6837
6838         (EmitContext.EmitThis): Extended the knowledge in this class to
6839         work in anonymous methods in addition to iterators. 
6840
6841         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6842         code is necessary on the stack to access the instance to a local
6843         variable (the variable will be accessed as a field).
6844
6845         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6846         EmitContext.EmitAddressOfParameter): Routines to support
6847         parameters (not completed at this point). 
6848         
6849         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6850         will also remove the parameters.
6851
6852         * convert.cs (Convert): Define a `ConstantEC' which points to a
6853         null.  This is just to prefity some code that uses
6854         ImplicitStandardConversion code and do not have an EmitContext
6855         handy.
6856
6857         The idea is to flag explicitly that at that point in time, it is
6858         known that the conversion will not trigger the delegate checking
6859         code in implicit conversions (which requires a valid
6860         EmitContext). 
6861
6862         Everywhere: pass new EmitContext parameter since
6863         ImplicitStandardConversionExists now requires it to check for
6864         anonymous method conversions. 
6865
6866         (Convert.ImplicitStandardConversionExists): If the type of an
6867         expression is the anonymous_method_type, and the type is a
6868         delegate, we invoke the AnonymousMethod.Compatible method to check
6869         whether an implicit conversion is possible. 
6870
6871         (Convert.ImplicitConversionStandard): Only do implicit method
6872         group conversions if the language level is not ISO_1.
6873
6874         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6875         MethodInfo for the Invoke method.  used by Delegate and
6876         AnonymousDelegate.
6877
6878         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6879         method conversions if the target type is a delegate.
6880
6881         Removed extra debugging nops.
6882
6883         (LocalVariableReference): Turn the `local_info' into a public
6884         field. 
6885
6886         Add `prepared' field, the same hack used for FieldExprs to cope
6887         with composed assignments, as Local variables do not necessarily
6888         operate purely on the stack as they used to: they can be captured
6889         fields. 
6890
6891         Add `temp' for a temporary result, like fields.
6892
6893         Refactor DoResolve and DoResolveLValue into DoResolveBase.
6894
6895         It now copes with Local variables that are captured and emits the
6896         proper instance variable to load it from a field in the captured
6897         case. 
6898
6899         (ParameterReference.DoResolveBase): During the resolve phase,
6900         capture parameters if we are in an anonymous method.
6901
6902         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6903         anonymous method, use the EmitContext helper routines to emit the
6904         parameter reference.
6905
6906         * iterators.cs: Set RemapToProxy to true/false during the
6907         EmitDispose class.
6908
6909         * parameters.cs (GetParameterByName): New helper method. 
6910
6911         * typemanager.cs (anonymous_method_type) a new type that
6912         represents an anonyous method.  This is always an internal type,
6913         used as a fencepost to test against the anonymous-methodness of an
6914         expression. 
6915         
6916 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
6917
6918         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6919         561 report.
6920         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6921
6922 2004-10-18  Martin Baulig  <martin@ximian.com>
6923
6924         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6925         `Type' directly, but call ResolveType() on it.
6926         (Catch.Resolve): Likewise.
6927         (Foreach.Resolve): Likewise.
6928
6929 2004-10-18  Martin Baulig  <martin@ximian.com>
6930
6931         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6932         `Type' directly, but call ResolveType() on it.
6933         (Probe.DoResolve): Likewise.
6934         (ArrayCreation.LookupType): Likewise.
6935         (TypeOf.DoResolve): Likewise.
6936         (SizeOf.DoResolve): Likewise.
6937
6938 2004-10-18  Martin Baulig  <martin@ximian.com>
6939
6940         * expression.cs (Invocation.BetterFunction): Put back
6941         TypeManager.TypeToCoreType().
6942
6943 2004-10-18  Raja R Harinath  <rharinath@novell.com>
6944
6945         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6946         the ResolveType.
6947
6948 2004-10-18  Martin Baulig  <martin@ximian.com>
6949
6950         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
6951         `Type' directly, but call ResolveType() on it.
6952
6953 2004-10-18  Martin Baulig  <martin@ximian.com>
6954
6955         * class.cs (FieldMember.Define): Don't access the TypeExpr's
6956         `Type' directly, but call ResolveType() on it.
6957         (MemberBase.DoDefine): Likewise.
6958
6959         * expression.cs (New.DoResolve): Don't access the TypeExpr's
6960         `Type' directly, but call ResolveType() on it.
6961         (ComposedCast.DoResolveAsTypeStep): Likewise.
6962
6963         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6964         `Type' directly, but call ResolveType() on it.
6965
6966 2004-10-17  John Luke  <john.luke@gmail.com>
6967
6968         * class.cs (Operator.GetSignatureForError): use CSharpName
6969
6970         * parameter.cs (Parameter.GetSignatureForError): Returns
6971         correct name even if was not defined.
6972
6973 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6974
6975         Fix #65816.
6976         * class.cs (TypeContainer.EmitContext): New property.
6977         (DefineNestedTypes): Create an emitcontext for each part.
6978         (MethodCore.DoDefineParameters): Use container's emitcontext.
6979         Pass type array to InternalParameters.
6980         (MemberBase.DoDefine): Use container's emitcontext.
6981         (FieldMember.Define): Likewise.
6982         (Event.Define): Likewise.
6983         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6984         Pass type array to InternalParameters.
6985         (SetIndexerMethod.GetParameterInfo): Likewise.
6986         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6987         * delegate.cs (Define): Pass emitcontext to
6988         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6989         array to InternalParameters.
6990         * expression.cs (ParameterReference.DoResolveBase): Pass
6991         emitcontext to GetParameterInfo.
6992         (ComposedCast.DoResolveAsTypeStep): Remove check on
6993         ec.ResolvingTypeTree.
6994         * parameter.cs (Parameter.Resolve): Change argument to
6995         EmitContext.  Use ResolveAsTypeTerminal.
6996         (Parameter.GetSignature): Change argument to EmitContext.
6997         (Parameters.ComputeSignature): Likewise.
6998         (Parameters.ComputeParameterTypes): Likewise.
6999         (Parameters.GetParameterInfo): Likewise.
7000         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7001         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7002         * support.cs (InternalParameters..ctor): Remove variant that takes
7003         a DeclSpace.
7004         * typemanager.cs (system_intptr_expr): New.
7005         (InitExpressionTypes): Initialize it.
7006
7007 2004-10-12  Chris Toshok  <toshok@ximian.com>
7008
7009         * cs-parser.jay: fix location for try_statement and catch_clause.
7010
7011 2004-10-11  Martin Baulig  <martin@ximian.com>
7012
7013         * report.cs: Don't make --fatal abort on warnings, we have
7014         -warnaserror for that.
7015
7016 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7017
7018         More DeclSpace.ResolveType avoidance.
7019         * decl.cs (MemberCore.InUnsafe): New property.
7020         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7021         with newly created EmitContext.
7022         (FieldMember.Define): Likewise.
7023         * delegate.cs (Delegate.Define): Likewise.
7024         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7025         only if normal name-lookup fails.
7026         (TypeExpr.DoResolve): Enable error-checking.
7027         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7028         (SizeOf.DoResolve): Likewise.
7029         (ComposedCast.DoResolveAsTypeStep): Likewise.
7030         (StackAlloc.DoResolve): Likewise.
7031         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7032         (Block.Unsafe): New property.
7033         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7034         (Unsafe): Set 'unsafe' flag of contained block.
7035         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7036         (Fixed.Resolve): Likewise.
7037         (Catch.Resolve): Likewise.
7038         (Using.ResolveLocalVariableDecls): Likewise.
7039         (Foreach.Resolve): Likewise.
7040
7041 2004-10-05  John Luke <john.luke@gmail.com>
7042
7043         * cs-parser.jay: add location to error CS0175
7044
7045 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7046
7047         * ecore.cs (Expression.Constantity): Add support for turning null
7048         into a constant.
7049
7050         * const.cs (Const.Define): Allow constants to be reference types
7051         as long as the value is Null.
7052
7053 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7054
7055         * namespace.cs (NamespaceEntry.Using): No matter which warning
7056         level is set, check if this namespace name has already been added.
7057
7058 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7059
7060         * expression.cs: reftype [!=]= null should always use br[true,false].
7061         # 67410
7062
7063 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7064
7065         Fix #67108
7066         * attribute.cs: Enum conversion moved to 
7067         GetAttributeArgumentExpression to be applied to the all
7068         expressions.
7069
7070 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7071
7072         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7073         * class.c (TypeContainer.DefineType): Flag error if
7074         base types aren't accessible due to access permissions.
7075         * decl.cs (DeclSpace.ResolveType): Move logic to
7076         Expression.ResolveAsTypeTerminal.
7077         (DeclSpace.ResolveTypeExpr): Thin layer over
7078         Expression.ResolveAsTypeTerminal.
7079         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7080         Refactor code into NestedAccess.  Use it.
7081         (DeclSpace.NestedAccess): New.
7082         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7083         argument to silence errors.  Check access permissions.
7084         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7085         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7086         (Cast.DoResolve): Likewise.
7087         (New.DoResolve): Likewise.
7088         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7089         (TypeOf.DoResolve): Likewise.
7090
7091         * expression.cs (Invocation.BetterConversion): Return the Type of
7092         the better conversion.  Implement section 14.4.2.3 more faithfully.
7093         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7094         section 14.4.2.2 explicit.
7095         (Invocation.OverloadResolve): Update.
7096         (Invocation): Remove is_base field.
7097         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7098         (Invocation.Emit): Likewise.
7099
7100 2004-09-27  Raja R Harinath  <rharinath@novell.com>
7101
7102         * README: Update to changes.
7103
7104 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7105
7106         * cs-parser.jay: Reverted 642 warning fix.
7107
7108 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7109
7110         Fix bug #66615
7111         * decl.cs (FindMemberWithSameName): Indexer can have more than
7112         1 argument.
7113
7114 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7115
7116         * expression.cs (LocalVariableReference.DoResolveLValue):
7117         Do not report warning 219 for out values.
7118         (EmptyExpression.Null): New member to avoid extra allocations.
7119
7120 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7121
7122         * cs-parser.jay: Fix wrong warning 642 report.
7123
7124         * cs-tokenizer.cs (CheckNextToken): New helper;
7125         Inspect next character if is same as expected.
7126
7127 2004-09-23  Martin Baulig  <martin@ximian.com>
7128
7129         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7130         (Convert.ImplicitReferenceConversionExists): Likewise.
7131
7132 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7133
7134         * class.cs (Operator.Define): Add error 448 and 559 report.
7135
7136 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7137
7138         * class.cs (MemberBase.IsTypePermitted): New protected
7139         method for checking error CS0610.
7140
7141 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7142
7143         * class.cs (TypeContainer.HasExplicitLayout): New property
7144         Returns whether container has StructLayout attribute set Explicit.
7145         (FieldMember): New abstract class for consts and fields.
7146         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7147         (Field): Reuse FieldMember.
7148
7149         * const.cs (Const): Reuse FieldMember.
7150
7151         * rootcontext.cs: EmitConstants call moved to class.
7152
7153 2004-09-22  Martin Baulig  <martin@ximian.com>
7154
7155         Thanks to Peter Sestoft for this bug report.
7156
7157         * expression.cs (Conditional): If both the `trueExpr' and the
7158         `falseExpr' is a NullLiteral, return a NullLiteral.
7159
7160 2004-09-22  Martin Baulig  <martin@ximian.com>
7161
7162         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7163         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7164         for the "get_Current" call.
7165
7166 2004-09-22  Martin Baulig  <martin@ximian.com>
7167
7168         Marek and me just fixed one of our oldest bugs: #28562 :-)
7169
7170         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7171
7172         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7173         we're an EnumConstant, just return that.
7174         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7175         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7176         to get the value which'll actually be written into the attribute.
7177         However, we have to use GetValue() to access the attribute's value
7178         in the compiler.        
7179
7180 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7181
7182         * constant.cs (Constant.IsNegative): New abstract property
7183         IsNegative.
7184
7185         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7186         (StackAlloc.DoResolve): Reused IsNegative.
7187
7188 2004-09-21  Martin Baulig  <martin@ximian.com>
7189
7190         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7191         if we're used in an iterator, we may be called from different
7192         methods.
7193
7194         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7195         we actually have an exception block.
7196
7197 2004-09-20  John Luke <jluke@cfl.rr.com>
7198
7199         * class.cs, cs-parser.jay: Improve the error report for 1520:
7200         report the actual line where the error happens, not where the
7201         class was declared.
7202
7203         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7204         Pass location information that was available elsewhere.
7205
7206 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
7207
7208         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7209         runtime to delay sign assemblies.
7210
7211 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7212
7213         * cs-parser.jay: Do not report the stack trace, this is barely
7214         used nowadays.
7215
7216 2004-08-22  John Luke  <john.luke@gmail.com>
7217  
7218         * driver.cs : check that a resource id is not already used
7219         before adding it, report CS1508 if it is, bug #63637
7220
7221 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7222
7223         * ecore.cs: Removed dead code.
7224
7225 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
7226
7227         * class.cs: Do not report warning CS0067 on the interfaces.
7228
7229 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7230
7231         * cs-parser.jay: Add error 504 report.
7232
7233 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7234
7235         * rootcontext.cs: WarningLevel is 4 by default now.
7236
7237         * statement.cs (Fixed.Resolve): Do not null
7238         VariableInfo.
7239
7240 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7241
7242         Fixed bug #55780
7243         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7244         deep search when property is not virtual.
7245         (PropertyExpr.ResolveAccessors): Make one call for both
7246         accessors.
7247
7248 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7249
7250         Fixed bug #65766
7251         * statement.cs: Error 152 report constains also location.
7252
7253 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7254
7255         Fixed bug #65766
7256         * const.cs: Explicitly set constant as static.
7257
7258 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7259
7260         Fixed bug #64226
7261         * cs-parser.jay: Add error 1017 report.
7262
7263 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7264
7265         Fixed bug #59980, #64224
7266         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7267
7268         * typemanager.cs (IsSpecialMethod): Simplified
7269
7270 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7271
7272         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7273         condition with better params.
7274
7275 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7276
7277         Fixed bug #65238
7278         * attribute.cs (Resolve): Property has to have both
7279         accessors.
7280
7281 2004-09-14  Martin Baulig  <martin@ximian.com>
7282
7283         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7284
7285 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7286
7287         Fixed bug #61902
7288         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7289         called and is obsolete then this member suppress message
7290         when call is inside next [Obsolete] method or type.
7291
7292         * expression.cs: Use TestObsoleteMethodUsage member.
7293
7294 2004-09-14  Martin Baulig  <martin@ximian.com>
7295
7296         * cs-parser.jay: Sync a bit with the GMCS version.
7297
7298 2004-09-14  Martin Baulig  <martin@ximian.com>
7299
7300         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7301         (CSharpParser.yacc_verbose_flag): New public field.
7302
7303         * genericparser.cs: Removed.
7304
7305 2004-09-14  Raja R Harinath  <rharinath@novell.com>
7306
7307         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7308
7309 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7310
7311         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7312
7313 2004-09-10  Martin Baulig  <martin@ximian.com>
7314
7315         Backported my MemberName changes from GMCS into MCS.
7316
7317         - we are now using a special `MemberName' class instead of using
7318         strings; in GMCS, the `MemberName' also contains the type
7319         arguments.
7320
7321         - changed the grammar rules a bit:
7322           * the old `member_name' is now a `namespace_or_type_name':
7323             The rule is that we use `namespace_or_type_name' everywhere
7324             where we expect either a "member name" (GetEnumerator) or a
7325             "member name" with an explicit interface name
7326             (IEnumerable.GetEnumerator).
7327             In GMCS, the explicit interface name may include type arguments
7328             (IEnumerable<T>.GetEnumerator).
7329           * we use `member_name' instead of just `IDENTIFIER' for
7330             "member names":
7331             The rule is that we use `member_name' wherever a member may
7332             have type parameters in GMCS.       
7333
7334         * decl.cs (MemberName): New public class.
7335         (MemberCore.MemberName): New public readonly field.
7336         (MemberCore.ctor): Take a `MemberName' argument, not a string.
7337         (DeclSpace): Likewise.
7338
7339         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7340         * enum.cs (Enum.ctor): Likewise.
7341
7342         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7343         MemberName.     
7344         (AliasEntry.ctor): Take a MemberName, not an Expression.
7345         (AliasEntry.UsingAlias): Likewise.
7346
7347         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7348         (IMethodData.MemberName): Changed type from string to MemberName.
7349         (MemberBase.ExplicitInterfaceName): Likewise.
7350         (AbstractPropertyEventMethod.SetupName): Make this private.
7351         (AbstractPropertyEventMethod.ctor): Added `string prefix'
7352         argument; compute the member name here.
7353         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7354         on the `member.MemberName' and the `prefix'.
7355
7356         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7357         not `type_name'.
7358         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7359         thus, we get a `MemberName' instead of a `string'.  These
7360         declarations may have type parameters in GMCS.
7361         (interface_method_declaration, delegate_declaration): Likewise.
7362         (class_declaration, interface_declaration): Likewise.
7363         (method_header): Use `namespace_or_type_name' instead of
7364         `member_name'.  We may be an explicit interface implementation.
7365         (property_declaration, event_declaration): Likewise.
7366         (member_name): This is now just an `IDENTIFIER', not a
7367         `namespace_or_type_name'.
7368         (type_name, interface_type): Removed.
7369         (namespace_or_type_name): Return a MemberName, not an Expression.
7370         (primary_expression): Use `member_name' instead of `IDENTIFIER';
7371         call GetTypeExpression() on the MemberName to get an expression.
7372         (IndexerDeclaration.interface_type): Changed type from string to
7373         MemberName.
7374         (MakeName): Operate on MemberName's instead of string's.
7375
7376 2004-09-13  Raja R Harinath  <rharinath@novell.com>
7377
7378         Fix bug #55770.
7379         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7380         (NamespaceEntry.Lookup): Add new argument to flag if we want the
7381         lookup to avoid symbols introduced by 'using'.
7382         * rootcontext.cs (NamespaceLookup): Update.
7383
7384 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7385
7386         * class.cs (TypeContainer.DoDefineMembers): Do not call
7387         DefineDefaultConstructor for static classes.
7388
7389 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7390
7391         * attribute.cs (Attribute.Resolve): Add error 653 report.
7392
7393         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7394         report.
7395         (Method.ApplyAttributeBuilder): Add error 685 report.
7396         (Operator.Define): Add error 564 report.
7397
7398         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7399
7400         * expression.cs (Invocation.DoResolve): Add error
7401         245 and 250 report.
7402
7403         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7404         error 674 report.
7405
7406 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7407
7408         * class.cs (ConstructorInitializer.Resolve):
7409         Wrong error number (515->516).
7410
7411 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7412
7413         * class.cs (Indexer.Define): Add error 631 report.
7414
7415 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7416
7417         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7418
7419 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7420
7421         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7422
7423 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7424
7425         * cs-parser.jay: Added error CS0241 report.
7426
7427 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7428
7429         * cs-parser.jay (fixed_statement): Introduce a scope for the
7430         declaration in the 'fixed' statement.
7431
7432 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7433
7434         * cs-parser.jay: Added CS0230 error report.
7435
7436 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7437
7438         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7439
7440 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7441
7442         * expression.cs (Argument.Resolve): Added error CS0192 and
7443         CS0199 report.
7444
7445 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7446
7447         C# 2.0 #pragma warning feature
7448
7449         * cs-tokenizer.cs (PreProcessPragma): New method; 
7450         Handles #pragma directive.
7451
7452         * report.cs (WarningRegions): New class; Support
7453         class for #pragma warning directive. It tests whether
7454         warning is enabled for a given line.
7455
7456 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7457
7458         * const.cs: Add more descriptive error report, tahnks to
7459         Sebastien. 
7460
7461 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7462
7463         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7464
7465 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7466
7467         * expression.cs: Apply patch from Ben: Remove dead code from
7468         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7469         as that code just threw an exception anwyays.
7470
7471         * const.cs: Remove the call to the turnintoconstant, for details
7472         see bug: #63144
7473         
7474         * literal.cs: The type of the null-literal is the null type;  So
7475         we use a placeholder type (literal.cs:System.Null, defined here)
7476         for it.
7477
7478         * expression.cs (Conditional.DoResolve): Remove some old code that
7479         is no longer needed, conversions have been fixed.
7480
7481         (ArrayCreationExpression.DoResolve): Return false if we fail to
7482         resolve the inner expression.
7483
7484 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7485
7486         Fix test-290.cs.
7487         * cs-parser.jay (delegate_declaration): Record a delegate
7488         declaration as a type declaration.
7489         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7490
7491 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7492
7493         * parameter.cs: Do not crash if the type can not be resolved. 
7494
7495         * expression.cs: Report errors with unsafe pointers, fixes #64896
7496
7497 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7498
7499         * expression.cs: Pointer arith always needs to do a conv.i
7500         if the operand is a long. fix 65320
7501
7502 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7503
7504         Fixed cs0619-37.cs, cs0619-38.cs
7505
7506         * enum.cs (GetObsoleteAttribute): Removed.
7507
7508         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7509         on Enum member is double staged. The first is tested member
7510         and then enum.
7511
7512 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7513
7514         Fixed #56986, #63631, #65231
7515
7516         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7517         adds member to name container.
7518         (TypeContainer.AddToTypeContainer): New method, adds type to
7519         name container.
7520         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7521         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7522         AddOperator): Simplified by reusing AddToMemberContainer.
7523         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7524         instead of field.
7525         (Method.CheckForDuplications): Fixed implementation to test all
7526         possibilities.
7527         (MemberBase): Detection whether member is explicit interface
7528         implementation is now in constructor.
7529         (MemberBase.UpdateMemberName): Handles IndexerName.
7530         (Accessor): Changed to keep also location information.
7531         (AbstractPropertyEventMethod): Is derived from MemberCore.
7532         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7533         will be emited or not.
7534         (PropertyBase.AreAccessorsDuplicateImplementation):
7535         Tests whether accessors are not in collision with some method.
7536         (Operator): Is derived from MethodCore to simplify common
7537         operations.
7538
7539         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7540         must be performed.
7541         (DeclSpace.AddToContainer): Adds the member to defined_names
7542         table. It tests for duplications and enclosing name conflicts.
7543
7544         * enum.cs (EnumMember): Clean up to reuse the base structures
7545
7546 2004-09-03  Martin Baulig  <martin@ximian.com>
7547
7548         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7549         into TypeContainer, to make partial classes work again.
7550
7551 2004-09-03  Martin Baulig  <martin@ximian.com>
7552
7553         * rootcontext.cs (RootContext.V2): Removed.
7554
7555 2004-03-23  Martin Baulig  <martin@ximian.com>
7556
7557         * expression.cs (Invocation.OverloadResolve): Added `bool
7558         may_fail' argument and use it instead of the Location.IsNull() hack.
7559
7560 2004-09-03  Martin Baulig  <martin@ximian.com>
7561
7562         Merged latest changes into gmcs.  Please keep this comment in
7563         here, it makes it easier for me to see what changed in MCS since
7564         the last time I merged.
7565
7566 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7567
7568         Fix #61128.
7569         * expression.cs (BetterConversion): Don't allow either conversion 
7570         to be null.  Remove redundant implicit conversion test when 'q ==
7571         null' -- when this function is invoked, we already know that the
7572         implicit conversion exists.
7573         (BetterFunction): Assume that 'best' is non-null.  Remove
7574         redundant reimplementation of IsApplicable when 'best' is null.
7575         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7576         number of arguments.
7577         (IsAncestralType): Extract from OverloadResolve.
7578         (OverloadResolve): Make robust to the MethodGroupExpr being
7579         unsorted.  Implement all the logic of Section 14.5.5.1, and
7580         support overloading of methods from multiple applicable types.
7581         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7582
7583         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7584         (RealError, Warning): Append type of report to related symbol.
7585
7586 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7587
7588         * enum.cs: Fixed CLS-Compliance checks for enum members.
7589         Error tests cs3008-8.cs, cs3014-8.cs
7590
7591 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7592
7593         Fixed bug #62342, #63102
7594         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7595         like ImplementMethod.
7596
7597 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7598
7599         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7600         Fixed bug #65170.
7601
7602 2004-09-02  Martin Baulig  <martin@ximian.com>
7603
7604         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7605         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7606         on the MethodBase.
7607
7608 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7609
7610         C# 2.0 Static classes implemented
7611
7612         * class.cs (TypeContainer): instance_constructors,
7613         initialized_fields, initialized_static_fields,
7614         default_constructor, base_inteface_types are protected to be
7615         accessible from StaticClass.
7616         (TypeContainer.DefineDefaultConstructor): New virtual method
7617         for custom default constructor generating
7618         (StaticClass): New class to handle "Static classes" feature.
7619
7620         * cs-parser.jay: Handle static keyword on class like instance
7621         of StaticClass.
7622
7623         * driver.cs: Added "/langversion" command line switch with two
7624         options (iso-1, default).
7625
7626 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7627
7628         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7629
7630 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7631
7632         * delegate.cs: Style.
7633
7634 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7635
7636         * delegate.cs: Add seperate instance expr field for miguel.
7637
7638 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7639
7640         * PointerArithmetic (Resolve): make sure we are not doing
7641         pointer arith on void*. Also, make sure we are resolved
7642         by not setting eclass until resolve.
7643
7644         All callers: Make sure that PointerArithmetic gets resolved.
7645
7646 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7647
7648         * ArrayCreation (LookupType): If the type does not resolve 
7649         to an array, give an error.
7650
7651 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7652
7653         * statement.cs (Try.Resolve): Fixed bug #64222
7654
7655 2004-08-27  Martin Baulig  <martin@ximian.com>
7656
7657         * class.cs
7658         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7659         crash here.     
7660
7661 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7662
7663         * ecore.cs (Constantify): Get underlying type via
7664         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7665         Windows in special cases.
7666
7667 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7668
7669         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7670         for obtaining also private methods.
7671         (GetRemoveMethod): Used GetRemoveMethod (true)
7672         for obtaining also private methods.
7673
7674 2004-08-24  Martin Baulig  <martin@ximian.com>
7675
7676         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7677         MethodAttributes.HideBySig for operators.
7678
7679 2004-08-23  Martin Baulig  <martin@ximian.com>
7680
7681         Back to the old error reporting system :-)
7682
7683         * report.cs (Message): Removed.
7684         (Report.MessageData, ErrorData, WarningData): Removed.
7685         (Report.Error, Warning): Back to the old system.
7686
7687 2004-08-23  Martin Baulig  <martin@ximian.com>
7688
7689         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7690
7691         * class.cs (TypeContainer.ParentContainer): New public virtual
7692         method; replaces the explicit interface implementation.
7693         (ClassPart.ParentContainer): Override.
7694
7695 2004-08-23  Martin Baulig  <martin@ximian.com>
7696
7697         * statement.cs (Switch): Added support for constant switches; see
7698         #59428 or test-285.cs.
7699
7700 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7701
7702         Fixed bug #62740.
7703         * statement.cs (GetEnumeratorFilter): Removed useless
7704         logic because C# specs is strict. GetEnumerator must be
7705         public.
7706
7707 2004-08-22  Martin Baulig  <martin@ximian.com>
7708
7709         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7710         a switch and may break, reset the barrier.  Fixes #59867.
7711
7712 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7713
7714         CLS-Compliance speed up (~5% for corlib)
7715
7716         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7717         New method. Tests container for CLS-Compliant names
7718
7719         * class.cs (TypeContainer.VerifyClsName): New method.
7720         Checks whether container name is CLS Compliant.
7721         (Constructor): Implements IMethodData.
7722
7723         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7724         low-case table for CLS Compliance test.
7725         (MemberCache.VerifyClsParameterConflict): New method.
7726         Checks method parameters for CS3006 error.
7727
7728         * enum.cs (EnumMember): Is derived from MemberCore.
7729         (Enum.VerifyClsName): Optimized for better performance.
7730
7731 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7732
7733         * report.cs: Renamed Error_T to Error and changed all
7734         references.
7735
7736 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7737
7738         * class.cs (TypeContainer.IndexerArrayList): New inner class
7739         container for indexers.
7740         (TypeContainer.DefaultIndexerName): New constant for default
7741         indexer name. Replaced all "Item" with this constant.
7742         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7743
7744         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7745         DefaultMemberAttribute constructor.
7746
7747 2004-08-05  Martin Baulig  <martin@ximian.com>
7748
7749         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7750         Fix bug #59429.
7751
7752 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7753
7754         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7755         multi platforms problem.
7756
7757         * compiler.csproj: Included shared files.
7758
7759 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7760
7761         Fix bug 60333, 55971 in the more general way
7762         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7763         Added arg_type argument for constant conversion.
7764         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7765
7766 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7767
7768         Fix bug #59760
7769         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7770         OperatorArrayList, MethodCoreArrayList for typecontainer
7771         containers. Changed class member types to these new types.
7772         (MethodArrayList.DefineMembers): Added test for CS0659.
7773
7774 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7775
7776         * cfold.cs: Synchronize the folding with the code in expression.cs
7777         Binary.DoNumericPromotions for uint operands.
7778
7779         * attribute.cs: Revert patch from Raja, it introduced a regression
7780         while building Blam-1.2.1 (hard to isolate a test case).
7781
7782 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7783
7784         Fix for #55382
7785         * class.cs:
7786         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7787         name collision.
7788         (MethodCore.parent_method): New member. The method we're overriding
7789         if this is an override method.
7790         (MethodCore.CheckBase): Moved from Method class and made common.
7791         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7792         private.
7793         (MethodCore.CheckForDuplications): New abstract method. For custom
7794         member duplication search in a container
7795         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7796         method and its return type.
7797         (Event.conflict_symbol): New member. Symbol with same name in the
7798         parent class.
7799
7800         * decl.cs:
7801         (MemberCache.FindMemberWithSameName): New method. The method
7802         is looking for conflict with inherited symbols.
7803
7804 2004-08-04  Martin Baulig  <martin@ximian.com>
7805
7806         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7807
7808         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7809
7810 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7811
7812         * report.cs (Message): New enum for better error, warning reference in
7813         the code.
7814         (MessageData): New inner abstract class. It generally handles printing of
7815         error and warning messages.
7816         Removed unused Error, Warning, Message methods.
7817
7818 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7819
7820         Fix for cs0592-8.cs test
7821         * attribute.cs
7822         (Attributable.ValidAttributeTargets): Made public.
7823         (Attribute.ExplicitTarget): New member for explicit target value.
7824         (Attribute.CheckTargets): Now we translate explicit attribute
7825         target to Target here.
7826
7827 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7828
7829         * ecore.cs (MethodGroupExpr): new IsBase property.
7830
7831         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7832
7833         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7834         rather than an instance expr.
7835
7836         (DelegateCreation.Emit): Use the method group rather than
7837         the instance expression. Also, if you have base.Foo as the
7838         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7839
7840         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7841
7842         (NewDelegate.DoResolve): Only check for the existance of Invoke
7843         if the method is going to be needed. Use MethodGroupExpr.
7844
7845         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
7846
7847         * expression.cs: For pointer arith., make sure to use
7848         the size of the type, not the size of the pointer to
7849         the type.
7850
7851 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7852
7853         Fix for #60722
7854         * class.cs (Class): Added error CS0502 test.
7855
7856 2004-08-03  John Luke  <jluke@cfl.rr.com>
7857             Raja R Harinath  <rharinath@novell.com>
7858
7859         Fix for #60997.
7860         * attribute.cs (Attribute.complained_before): New flag.
7861         (Attribute.ResolveType, Attribute.Resolve),
7862         (Attribute.DefinePInvokeMethod): Set it.
7863         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7864         
7865 2004-08-03  Martin Baulig  <martin@ximian.com>
7866
7867         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7868         use a user-defined operator; we still need to do numeric
7869         promotions in case one argument is a builtin type and the other
7870         one has an implicit conversion to that type.  Fixes #62322.
7871
7872 2004-08-02  Martin Baulig  <martin@ximian.com>
7873
7874         * statement.cs (LocalInfo.Flags): Added `IsThis'.
7875         (LocalInfo.IsThis): New public property.
7876         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7877
7878 2004-08-01  Martin Baulig  <martin@ximian.com>
7879
7880         * class.cs (TypeContainer.GetClassBases): Don't set the default
7881         here since we may get called from GetPartialBases().
7882         (TypeContainer.DefineType): If GetClassBases() didn't return a
7883         parent, use the default one.
7884
7885 2004-07-30  Duncan Mak  <duncan@ximian.com>
7886
7887         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
7888
7889 2004-07-30  Martin Baulig  <martin@ximian.com>
7890
7891         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7892
7893         * class.cs (SourceMethod): New public class, derive from the
7894         symbol writer's ISourceMethod.
7895         (Method): Use the new symbol writer API.
7896
7897         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7898         as argument and use the new symbol writer.
7899
7900         * location.cs
7901         (SourceFile): Implement the symbol writer's ISourceFile.
7902         (Location.SymbolDocument): Removed.
7903         (Location.SourceFile): New public property.
7904
7905         * symbolwriter.cs: Use the new symbol writer API.
7906
7907 2004-07-30  Raja R Harinath  <rharinath@novell.com>
7908
7909         * Makefile (install-local): Remove.  Functionality moved to
7910         executable.make.
7911
7912 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
7913
7914         * Makefile: Install mcs.exe.config file together with mcs.exe.
7915         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7916         correct runtime version.
7917         
7918 2004-07-25  Martin Baulig  <martin@ximian.com>
7919
7920         * class.cs
7921         (TypeContainer.RegisterOrder): Removed, this was unused.
7922         (TypeContainer, interface_order): Removed.
7923         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7924         TypeContainer as argument since we can also be called with a
7925         `PartialContainer' for a partial class/struct/interface.
7926         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7927         of checking whether we're an `Interface' - we could be a
7928         `PartialContainer'.
7929         (PartialContainer.Register): Override; call
7930         AddClass()/AddStruct()/AddInterface() on our parent.
7931
7932         * cs-parser.jay (interface_member_declaration): Add things to the
7933         `current_container', not the `current_class'.
7934
7935         * rootcontext.cs (RegisterOrder): The overloaded version which
7936         takes an `Interface' was unused, removed.
7937
7938         * typemanager.cs (TypeManager.LookupInterface): Return a
7939         `TypeContainer', not an `Interface'.
7940         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7941         contain a `PartialContainer' for an interface, so check it's
7942         `Kind' to figure out what it is.
7943
7944 2004-07-25  Martin Baulig  <martin@ximian.com>
7945
7946         * class.cs (Class.DefaultTypeAttributes): New public constant.
7947         (Struct.DefaultTypeAttributes): Likewise.
7948         (Interface.DefaultTypeAttributes): Likewise.
7949         (PartialContainer.TypeAttr): Override this and add the
7950         DefaultTypeAttributes.
7951
7952 2004-07-25  Martin Baulig  <martin@ximian.com>
7953
7954         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7955         we can just use the `Parent' field instead.
7956
7957 2004-07-25  Martin Baulig  <martin@ximian.com>
7958
7959         * class.cs (TypeContainer.Emit): Renamed to EmitType().
7960
7961 2004-07-25  Martin Baulig  <martin@ximian.com>
7962
7963         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7964         our parts before defining any methods.
7965         (TypeContainer.VerifyImplements): Make this virtual.
7966         (ClassPart.VerifyImplements): Override and call VerifyImplements()
7967         on our PartialContainer.
7968
7969 2004-07-25  Martin Baulig  <martin@ximian.com>
7970
7971         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7972
7973         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7974         argument, we can just use the `Parent' field instead.
7975
7976         * class.cs
7977         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
7978         (MemberBase.DoDefine): Likewise.
7979
7980 2004-07-24  Martin Baulig  <martin@ximian.com>
7981
7982         * decl.cs (MemberCore.Parent): New public field.
7983         (DeclSpace.Parent): Moved to MemberCore.
7984
7985         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7986         (MemberBase.ctor): Added TypeContainer argument, pass it to our
7987         parent's .ctor.
7988         (FieldBase, Field, Operator): Likewise.
7989         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7990         (EventField, Event): Likewise.
7991
7992 2004-07-23  Martin Baulig  <martin@ximian.com>
7993
7994         * class.cs (PartialContainer): New public class.
7995         (ClassPart): New public class.
7996         (TypeContainer): Added support for partial classes.
7997         (TypeContainer.GetClassBases): Splitted some of the functionality
7998         out into GetNormalBases() and GetPartialBases().
7999
8000         * cs-tokenizer.cs (Token.PARTIAL): New token.
8001         (Tokenizer.consume_identifier): Added some hacks to recognize
8002         `partial', but only if it's immediately followed by `class',
8003         `struct' or `interface'.
8004
8005         * cs-parser.jay: Added support for partial clases.
8006
8007 2004-07-23  Martin Baulig  <martin@ximian.com>
8008
8009         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8010         a `DeclSpace' and also made it readonly.
8011         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8012         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8013         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8014
8015         * cs-parser.jay: Pass the `current_class', not the
8016         `current_container' (at the moment, this is still the same thing)
8017         to a new Method, Property, Event, Indexer or Constructor.
8018
8019 2004-07-23  Martin Baulig  <martin@ximian.com>
8020
8021         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8022         and removed the `current_interface' one.
8023         (struct_declaration, class_declaration, interface_declaration):
8024         Set `current_class' to the newly created class/struct/interface;
8025         set their `Bases' and call Register() before parsing their body.
8026
8027 2004-07-23  Martin Baulig  <martin@ximian.com>
8028
8029         * class.cs (Kind): New public enum.
8030         (TypeContainer): Made this class abstract.
8031         (TypeContainer.Kind): New public readonly field.
8032         (TypeContainer.CheckDef): New public method; moved here from
8033         cs-parser.jay.
8034         (TypeContainer.Register): New public abstract method.
8035         (TypeContainer.GetPendingImplementations): New public abstract
8036         method.
8037         (TypeContainer.GetClassBases): Removed the `is_class' and
8038         `is_iface' parameters.
8039         (TypeContainer.DefineNestedTypes): Formerly known as
8040         DoDefineType().
8041         (ClassOrStruct): Made this class abstract.
8042
8043         * tree.cs (RootTypes): New public type. 
8044
8045 2004-07-20  Martin Baulig  <martin@ximian.com>
8046
8047         * tree.cs (Tree.RecordNamespace): Removed.
8048         (Tree.Namespaces): Removed.
8049
8050         * rootcontext.cs (RootContext.IsNamespace): Removed.
8051
8052         * cs-parser.jay (namespace_declaration): Just create a new
8053         NamespaceEntry here.
8054
8055 2004-07-20  Martin Baulig  <martin@ximian.com>
8056
8057         * statement.cs (ExceptionStatement): New abstract class.  This is
8058         now used as a base class for everyone who's using `finally'.
8059         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8060         our local variables before using them.
8061
8062         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8063         virtual method.  This is used by Yield.Resolve() to "steal" an
8064         outer block's `finally' clauses.
8065         (FlowBranchingException): The .ctor now takes an ExceptionStatement
8066         argument.
8067
8068         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8069         version which takes an ExceptionStatement.  This version must be
8070         used to create exception branchings.
8071
8072         * iterator.cs
8073         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8074         (Iterator.EmitMoveNext): Added exception support; protect the
8075         block with a `fault' clause, properly handle 'finally' clauses.
8076         (Iterator.EmitDispose): Run all the `finally' clauses here.
8077
8078 2004-07-20  Martin Baulig  <martin@ximian.com>
8079
8080         * iterator.cs: This is the first of a set of changes in the
8081         iterator code.  Match the spec more closely: if we're an
8082         IEnumerable, then GetEnumerator() must be called.  The first time
8083         GetEnumerator() is called, it returns the current instance; all
8084         subsequent invocations (if any) must create a copy.
8085
8086 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
8087
8088         * expression.cs: Resolve the constant expression before returning
8089         it. 
8090
8091 2004-07-19  Martin Baulig  <martin@ximian.com>
8092
8093         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8094         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8095         the return type of the new EmitContext.
8096
8097 2004-07-18  Martin Baulig  <martin@ximian.com>
8098
8099         * class.cs (Property.Define): Fix iterators.
8100
8101         * iterators.cs (Iterator.Define): Moved the
8102         `container.AddInterator (this)' call here from the .ctor; only do
8103         it if we resolved successfully.
8104
8105 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
8106
8107         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8108         `true' for preprocessing directives that we parse.  The return
8109         value indicates whether we should return to regular tokenizing or
8110         not, not whether it was parsed successfully.
8111
8112         In the past if we were in: #if false ... #line #endif, we would
8113         resume parsing after `#line'.  See bug 61604.
8114
8115         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8116         building: IsEnumType should return true only for enums, not for
8117         enums or System.Enum itself.  This fixes #61593.
8118
8119         Likely what happened is that corlib was wrong: mcs depended on
8120         this bug in some places.  The bug got fixed, we had to add the
8121         hack, which caused bug 61593.
8122
8123         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8124         that was a workaround for the older conditions.
8125
8126 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
8127
8128         * assign.cs: IAssignMethod has a new interface, as documented
8129         inline. All assignment code now uses this new api.
8130
8131         * ecore.cs, expression.cs: All classes which implement
8132         IAssignMethod now use the new interface.
8133
8134         * expression.cs (Invocation): add a hack to EmitCall so that
8135         IndexerAccess can be the target of a compound assignment without
8136         evaluating its arguments twice.
8137
8138         * statement.cs: Handle changes in Invocation api.
8139
8140 2004-07-16  Martin Baulig  <martin@ximian.com>
8141
8142         * iterators.cs: Rewrote this.  We're now using one single Proxy
8143         class for both the IEnumerable and the IEnumerator interface and
8144         `Iterator' derives from Class so we can use the high-level API.
8145
8146         * class.cs (TypeContainer.AddIterator): New method.
8147         (TypeContainer.DoDefineType): New protected virtual method, which
8148         is called from DefineType().
8149         (TypeContainer.DoDefineMembers): Call DefineType() and
8150         DefineMembers() on all our iterators.
8151         (TypeContainer.Emit): Call Emit() on all our iterators.
8152         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8153
8154         * codegen.cs (EmitContext.CurrentIterator): New public field.
8155
8156 2004-07-15  Martin Baulig  <martin@ximian.com>
8157
8158         * typemanager.cs
8159         (TypeManager.not_supported_exception_type): New type.   
8160
8161 2004-07-14  Martin Baulig  <martin@ximian.com>
8162
8163         * iterators.cs: Use real error numbers.
8164
8165 2004-07-14  Martin Baulig  <martin@ximian.com>
8166
8167         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8168         requires this to be a System.Collection.IEnumerable and not a
8169         class implementing that interface.
8170         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8171
8172 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8173
8174         * class.cs: Fixed previous fix, it broke some error tests.
8175
8176 2004-07-12  Martin Baulig  <martin@ximian.com>
8177
8178         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8179         Fixes #61293.
8180
8181 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8182
8183         * assign.cs (LocalTemporary): Add new argument: is_address,If
8184         `is_address' is true, then the value that we store is the address
8185         to the real value, and not the value itself.
8186         
8187         * ecore.cs (PropertyExpr): use the new local temporary
8188         stuff to allow us to handle X.Y += z (where X is a struct)
8189
8190 2004-07-08  Martin Baulig  <martin@ximian.com>
8191
8192         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8193         not always return, just like we're doing in Using.Resolve().
8194
8195 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8196
8197         * cs-parser.jay (fixed_statement): flag this as Pinned.
8198
8199 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8200
8201         * typemanager.cs (TypeManager): Removed MakePinned method, this
8202         mechanism is replaced with the .NET 2.x compatible mechanism of
8203         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8204
8205         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8206         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8207         `IsFixed' property which has a different meaning.
8208
8209 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8210
8211         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8212         visible from inside a nested class, not just the names of the
8213         immediately enclosing class.
8214         Fix for bug #60730.
8215
8216 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8217
8218         * expression.cs (BetterConversion): Remove buggy special-case
8219         handling of "implicit constant expression conversions".  At this
8220         point, we already know that the conversion is possible -- we're
8221         only checking to see which is better.
8222
8223 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8224
8225         * cs-parser.jay: Added error CS0210 test.
8226
8227 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8228
8229         * cs-parser.jay: Added error CS0134 test.
8230
8231 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8232
8233         Fix bug #52507
8234         * cs-parser.jay: Added error CS0145 test.
8235
8236 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8237
8238         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8239
8240 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8241         
8242         * expression.cs (StackAlloc.Resolve): The argument may not
8243         be a constant; deal with this case.
8244         
8245 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8246
8247         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8248         GetIndexerAttributeValue.
8249         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8250
8251         * class.cs (Indexer.Define): Added error tests for CS0415,
8252         CS0609.
8253
8254 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8255
8256         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8257         property code.
8258
8259 2004-06-23  Martin Baulig  <martin@ximian.com>
8260
8261         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8262         neither return nor throw, reset the barrier as well.  Fixes #60457.
8263
8264 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8265
8266         * class.cs : EventAttributes is now set to None by default.
8267           This fixes bug #60459.
8268
8269 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8270
8271         Fix bug #60219
8272         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8273         Don't throw exception but return null (it's sufficient now).
8274
8275 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8276
8277         * typemanager.cs (GetArgumentTypes): Faster implementation.
8278
8279 2004-06-18  Martin Baulig  <martin@ximian.com>
8280
8281         * attribute.cs (Attribute.Resolve): Check whether we're an
8282         EmptyCast which a Constant child.  Fixes #60333.
8283
8284 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8285
8286         * statement.cs (EmitCollectionForeach): Account for the fact that
8287         not all valuetypes are in areas which we can take the address of.
8288         For these variables, we store to a temporary variable. Also, make
8289         sure that we dont emit a `callvirt' on a valuetype method.
8290
8291 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8292
8293         * expression.cs (StackAlloc.DoReSolve): Added test for
8294         negative parameter (CS0247).
8295
8296 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8297
8298         Fix bug #59792
8299         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8300
8301 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8302
8303         Fix bug #59781
8304         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8305         ulong.
8306
8307 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8308
8309         Fix bug #58254 & cs1555.cs, cs1556.cs
8310         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8311
8312 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8313
8314         * cs-parser.jay: Added error CS1669 test for indexers.
8315
8316 2004-06-11  Martin Baulig  <martin@ximian.com>
8317
8318         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8319         call this twice: for params and varargs methods.
8320
8321 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8322
8323         * class.cs:
8324         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8325
8326 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8327
8328         * attribute.cs (Attribute.GetValidTargets): Made public.
8329
8330         * class.cs: 
8331         (AbstractPropertyEventMethod): New class for better code sharing.
8332         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8333         CS1667 report.
8334         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8335
8336 2004-06-11  Raja R Harinath  <rharinath@novell.com>
8337
8338         Fix bug #59477.
8339         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8340         that the call to Resolve is part of a MemberAccess.
8341         (Expression.Resolve): Use it for SimpleName resolution.
8342         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8343         Add 'intermediate' boolean argument.
8344         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
8345         error message when the SimpleName can be resolved ambiguously
8346         between an expression and a type.
8347         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8348         public.
8349         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8350         call on the left-side.
8351
8352 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8353
8354         * class.cs:
8355         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8356
8357 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8358
8359         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8360
8361 2004-06-11  Martin Baulig  <martin@ximian.com>
8362
8363         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8364         varargs methods if applicable.
8365
8366 2004-06-11  Martin Baulig  <martin@ximian.com>
8367
8368         * expression.cs (Invocation.EmitCall): Don't use
8369         `method.CallingConvention == CallingConventions.VarArgs' since the
8370         method could also have `CallingConventions.HasThis'.
8371
8372 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8373
8374         * class.cs (Event.GetSignatureForError): Implemented.
8375         Fixed crash in error test cs3010.cs
8376
8377 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
8378
8379         * cs-tokenizer.cs: Change the way we track __arglist to be
8380         consistent with the other keywords.
8381
8382 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
8383
8384         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8385         tomorrow.
8386
8387 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
8388
8389         * codegen.cs: Check that all referenced assemblies have a strongname
8390         before strongnaming the compiled assembly. If not report error CS1577.
8391         Fix bug #56563. Patch by Jackson Harper.
8392         * typemanager.cs: Added a method to return all referenced assemblies.
8393         Fix bug #56563. Patch by Jackson Harper.
8394
8395 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8396
8397         * class.cs:
8398         (Method.ApplyAttributeBuilder): Moved and added conditional
8399         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8400
8401         * delegate.cs:
8402         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8403
8404 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8405
8406         Fixed #59640
8407         * class.cs: (EventField.attribute_targets): Changed default target.
8408
8409 2004-06-08  Martin Baulig  <martin@ximian.com>
8410
8411         * expression.cs (Invocation.EmitCall): Enable varargs methods.
8412
8413 2004-06-08  Martin Baulig  <martin@ximian.com>
8414
8415         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8416
8417 2004-06-07  Martin Baulig  <martin@ximian.com>
8418
8419         Added support for varargs methods.
8420
8421         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8422         keyword.
8423
8424         * cs-parser.jay: Added support for `__arglist'.
8425
8426         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8427
8428         * expression.cs (Argument.AType): Added `ArgList'.
8429         (Invocation): Added support for varargs methods.
8430         (ArglistAccess): New public class.
8431         (Arglist): New public class.
8432
8433         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8434
8435         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
8436         a method's top-level block if the method has varargs.
8437
8438         * support.cs (ReflectionParameters, InternalParameters): Added
8439         support for varargs methods.    
8440
8441 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
8442
8443         * class.cs: Provide location in indexer error report.
8444
8445         * driver.cs: Use standard names.
8446
8447         * namespace.cs: Catch the use of using after a namespace has been
8448         declared also on using aliases.
8449
8450 2004-06-03  Raja R Harinath  <rharinath@novell.com>
8451
8452         Bug #50820.
8453         * typemanager.cs (closure_private_ok, closure_invocation_type)
8454         (closure_qualifier_type, closure_invocation_assembly)
8455         (FilterWithClosure): Move to ...
8456         (Closure): New internal nested class.
8457         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8458         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8459         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8460         (MemberLookup, MemberLookupFailed): Use it.
8461         * expression.cs (New.DoResolve): Treat the lookup for the
8462         constructor as being qualified by the 'new'ed type.
8463         (Indexers.GetIndexersForTypeOrInterface): Update.
8464
8465 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
8466
8467         * attribute.cs
8468         (GetConditionalAttributeValue): New method. Returns
8469         condition of ConditionalAttribute.
8470         (SearchMulti): New method.  Returns all attributes of type 't'.
8471         Use it when attribute is AllowMultiple = true.
8472         (IsConditionalMethodExcluded): New method.
8473
8474         * class.cs
8475         (Method.IsExcluded): Implemented. Returns true if method has conditional
8476         attribute and the conditions is not defined (method is excluded).
8477         (IMethodData): Extended interface for ConditionalAttribute support.
8478         (PropertyMethod.IsExcluded): Implemented.
8479
8480         * decl.cs
8481         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8482
8483         * expression.cs
8484         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8485         on the method.
8486
8487 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8488
8489         * expression.cs (ArrayCreationExpression): Make this just an
8490         `expression'. It can't be a statement, so the code here was
8491         dead.
8492
8493 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8494
8495         Fixed #59072
8496         * typemanager.cs (GetFullNameSignature): New method for
8497         MethodBase types.
8498
8499 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8500
8501         Fixed #56452
8502         * class.cs (MemberBase.GetSignatureForError): New virtual method.
8503         Use this method when MethodBuilder is null.
8504         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8505         Added test for error CS0626 (MONO reports error for this situation).
8506         (IMethodData.GetSignatureForError): Extended interface.
8507
8508 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8509
8510         * attribute.cs
8511         (AttributeTester.GetObsoleteAttribute): Returns instance of
8512         ObsoleteAttribute when type is obsolete.
8513
8514         * class.cs
8515         (TypeContainer.VerifyObsoleteAttribute): Override.
8516         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8517         (MethodCode.VerifyObsoleteAttribute): Override.
8518         (MemberBase.VerifyObsoleteAttribute): Override.
8519
8520         * decl.cs
8521         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8522         and report proper error.
8523
8524         *delegate.cs
8525         Delegate.VerifyObsoleteAttribute): Override.
8526
8527         * ecore.cs
8528         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8529         and report proper error.
8530         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8531
8532         * enum.cs
8533         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8534         and enum member.
8535
8536         * expression.cs
8537         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8538         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8539         Added test for ObsoleteAttribute.
8540
8541         * statement.cs
8542         (Catch): Derived from Statement.
8543
8544 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8545  
8546         Fixed bug #59071 & cs0160.cs
8547  
8548         * statement.cs (Try.Resolve): Check here whether order of catch
8549         clauses matches their dependencies.
8550
8551 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
8552
8553         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
8554         caused a regression: #59343.  Referencing nested classes from an
8555         assembly stopped working.
8556
8557 2004-05-31  Martin Baulig  <martin@ximian.com>
8558
8559         MCS is now frozen for beta 2.
8560
8561 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8562
8563         * convert.cs: add a trivial cache for overload operator resolution.
8564
8565 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8566
8567         * decl.cs: If possible, use lookuptypedirect here. We can only do
8568         this if there is no `.' after the namespace. Avoids using
8569         LookupType, which does lots of slow processing.
8570         (FindNestedType) New method, does what it says :-).
8571         * namespace.cs: use LookupTypeDirect.
8572         * rootcontext.cs: use membercache, if possible.
8573         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8574
8575 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8576
8577         * expression.cs:
8578         According to the spec, 
8579
8580         In a member access of the form E.I, if E is a single identifier,
8581         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8582         field, property, localvariable, or parameter with the same type as
8583         the meaning of E as a type-name (§3.8), then both possible
8584         meanings of E are permitted.
8585
8586         We did not check that E as a simple-name had the same type as E as
8587         a type name.
8588
8589         This trivial check gives us 5-7% on bootstrap time.
8590
8591 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8592
8593         * expression.cs (Invocation.OverloadResolve): Avoid the
8594         use of hashtables and boxing here by allocating on demand.
8595
8596 2004-05-30  Martin Baulig  <martin@ximian.com>
8597
8598         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8599         we're doing a silent lookup.  Don't try to lookup nested types in
8600         TypeManager.object_type (thanks to Ben Maurer).
8601
8602 2004-05-30  Martin Baulig  <martin@ximian.com>
8603
8604         Committing a patch from Ben Maurer.
8605
8606         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8607
8608 2004-05-29  Martin Baulig  <martin@ximian.com>
8609
8610         * class.cs (IMethodData.ShouldIgnore): New method.
8611
8612         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8613         `Location' argument, we don't need it anywhere.  Use
8614         `IMethodData.ShouldIgnore ()' instead of
8615         `MethodData.GetMethodFlags ()'.
8616         (TypeManager.AddMethod): Removed.
8617         (TypeManager.AddMethod2): Renamed to AddMethod.
8618
8619 2004-05-29  Martin Baulig  <martin@ximian.com>
8620
8621         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8622
8623         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8624         converting from a class type S to an interface type and we already
8625         have an object on the stack, don't box it again.  Fixes #52578.
8626
8627 2004-05-29  Martin Baulig  <martin@ximian.com>
8628
8629         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8630         Added support for `params' parameters.  Fixes #59267.
8631
8632 2004-05-29  Martin Baulig  <martin@ximian.com>
8633
8634         * literal.cs (NullPointer): Provide a private .ctor which sets
8635         `type' to TypeManager.object_type.  Fixes #59048.
8636
8637 2004-05-29  Martin Baulig  <martin@ximian.com>
8638
8639         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8640         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8641
8642         * ecore.cs (EventExpr.instance_expr): Make the field private.
8643
8644 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8645
8646         Fixed bug #50080 & cs0214-2.cs
8647         * expression.cs (Cast.DoResolve): Check unsafe context here.
8648         
8649         * statement.cs (Resolve.DoResolve): Likewise.
8650
8651 2004-05-26  Martin Baulig  <martin@ximian.com>
8652
8653         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8654
8655         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8656         (RootContext.LookupType): Pass down the `silent' flag.
8657
8658 2004-05-25  Martin Baulig  <martin@ximian.com>
8659
8660         * expression.cs
8661         (MethodGroupExpr.IdenticalTypeName): New public property.
8662         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8663         expression actually refers to a type.
8664
8665 2004-05-25  Martin Baulig  <martin@ximian.com>
8666
8667         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8668         for #56176 and made it actually work.
8669
8670 2004-05-25  Martin Baulig  <martin@ximian.com>
8671
8672         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8673         (FieldExpr, PropertyExpr): Override and implement
8674         CacheTemporaries.  Fixes #52279.
8675
8676 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8677
8678         * location.cs: In the new compiler listing a file twice is a
8679         warning, not an error.
8680
8681 2004-05-24  Martin Baulig  <martin@ximian.com>
8682
8683         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8684         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8685
8686 2004-05-24  Martin Baulig  <martin@ximian.com>
8687
8688         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8689         walking the `using' list.  Fixes #53921.
8690
8691 2004-05-24  Martin Baulig  <martin@ximian.com>
8692
8693         * const.cs (Const.LookupConstantValue): Added support for
8694         EmptyCast's; fixes #55251.
8695
8696 2004-05-24  Martin Baulig  <martin@ximian.com>
8697
8698         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8699         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8700         which does the CS0135 check.  The reason is that we first need to
8701         check whether the variable actually exists.
8702
8703 2004-05-24  Martin Baulig  <martin@ximian.com>
8704
8705         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8706         than RootContext.LookupType() to find the explicit interface
8707         type.  Fixes #58584.
8708
8709 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8710
8711         * Makefile: Simplify.  Use executable.make.
8712         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8713
8714 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8715
8716         * decl.cs:
8717         * enum.cs:
8718         Use the invariant culture when doing String.Compare for CLS case
8719         sensitivity.
8720         
8721 2004-05-23  Martin Baulig  <martin@ximian.com>
8722
8723         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8724         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8725
8726         * namespace.cs (NamespaceEntry.Lookup): Likewise.
8727         
8728 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8729
8730         * class.cs (MemberBase.Define): Reuse MemberType member for 
8731         resolved type. Other methods can use it too.
8732
8733 2004-05-23  Martin Baulig  <martin@ximian.com>
8734
8735         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8736         the variable also exists in the current block (otherwise, we need
8737         to report a CS0103).  Fixes #58670.
8738
8739 2004-05-23  Martin Baulig  <martin@ximian.com>
8740
8741         * flowanalysis.cs (Reachability.Reachable): Compute this
8742         on-the-fly rather than storing it as a field.
8743
8744 2004-05-23  Martin Baulig  <martin@ximian.com>
8745
8746         * flowanalysis.cs (Reachability.And): Manually compute the
8747         resulting `barrier' from the reachability.      
8748        
8749 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8750
8751         Fix bug #57835
8752         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8753         instance of ObsoleteAttribute when symbol is obsolete.
8754
8755         * class.cs
8756         (IMethodData): Extended interface for ObsoleteAttribute support.
8757
8758 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8759
8760         * attribute.cs: Fix bug #55970
8761
8762 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8763
8764         Fix bug #52705
8765         * attribute.cs
8766         (GetObsoleteAttribute): New method. Creates the instance of
8767         ObsoleteAttribute.
8768         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8769         ObsoleteAttribute when member is obsolete.
8770         (AttributeTester.Report_ObsoleteMessage): Common method for
8771         Obsolete error/warning reporting.
8772
8773         * class.cs
8774         (TypeContainer.base_classs_type): New member for storing parent type.
8775
8776         * decl.cs
8777         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8778         for this MemberCore.
8779
8780 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8781
8782         * attribute.cs, const.cs: Fix bug #58590
8783
8784 2004-05-21  Martin Baulig  <martin@ximian.com>
8785
8786         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8787         out parameters if the end of the method is unreachable.  Fixes
8788         #58098. 
8789
8790 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8791
8792         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8793         Hari was right, why extra method.
8794
8795 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8796
8797         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8798
8799 2004-05-20  Martin Baulig  <martin@ximian.com>
8800
8801         Merged this back from gmcs to keep the differences to a minumum.
8802
8803         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8804         instead of a Declspace.
8805         (Attribute.ResolveType): Likewise.
8806         (Attributes.Search): Likewise.
8807         (Attributes.Contains): Likewise.
8808         (Attributes.GetClsCompliantAttribute): Likewise.
8809
8810         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8811         argument.
8812         (MethodData.ApplyAttributes): Take an EmitContext instead of a
8813         DeclSpace.
8814
8815 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8816
8817         Fix bug #58688 (MCS does not report error when the same attribute
8818         is assigned twice)
8819
8820         * attribute.cs (Attribute.Emit): Distinction between null and default.
8821
8822 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8823
8824         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8825         of a top-level attribute without an attribute target.
8826         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8827         Make non-static.
8828         (Attribute.Conditional_GetConditionName), 
8829         (Attribute.Obsolete_GetObsoleteMessage): Update.
8830         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8831         part of ScanForIndexerName.
8832         (Attribute.CanIgnoreInvalidAttribute): New function.
8833         (Attribute.ScanForIndexerName): Move to ...
8834         (Attributes.ScanForIndexerName): ... here.
8835         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8836         (Attributes.Search): New internal variant that can choose not to
8837         complain if types aren't resolved.  The original signature now
8838         complains.
8839         (Attributes.GetClsCompliantAttribute): Use internal variant, with
8840         complaints suppressed.
8841         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8842         only if it not useful.
8843         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8844         top-level for attributes that are shared between the assembly
8845         and a top-level class.
8846         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8847         * class.cs: Update to reflect changes.
8848         (DefineIndexers): Fuse loops.
8849         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
8850         a couple more variants of attribute names.
8851
8852 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
8853
8854         Fix bug #52585 (Implemented explicit attribute declaration)
8855
8856         * attribute.cs:
8857         (Attributable.ValidAttributeTargets): New abstract method. It gets
8858         list of valid attribute targets for explicit target declaration.
8859         (Attribute.Target): It holds target itself.
8860         (AttributeSection): Removed.
8861         (Attribute.CheckTargets): New method. It checks whether attribute
8862         target is valid for the current element.
8863
8864         * class.cs:
8865         (EventProperty): New class. For events that are declared like
8866         property (with add and remove accessors).
8867         (EventField): New class. For events that are declared like field.
8868         class.cs
8869
8870         * cs-parser.jay: Implemented explicit attribute target declaration.
8871
8872         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
8873         Override ValidAttributeTargets.
8874
8875         * parameter.cs:
8876         (ReturnParameter): Class for applying custom attributes on 
8877         the return type.
8878         (ParameterAtribute): New class. Class for applying custom
8879         attributes on the parameter type.
8880
8881 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
8882
8883         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8884         definitions. 
8885
8886         (Method): Allow UNSAFE here.
8887
8888         * modifiers.cs: Support unsafe reporting.
8889
8890 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
8891
8892         * decl.cs: Fix bug #58478.
8893
8894 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8895
8896         * statement.cs: When checking for unreachable code on an EmptyStatement,
8897         set the location. Fixes bug #58488.
8898
8899 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
8900
8901         * driver.cs: Add -pkg handling.
8902
8903         From Gonzalo: UseShelLExecute=false
8904
8905 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
8906
8907         * attribute.cs:
8908         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8909         for attribute.
8910         (Attribute.IsClsCompliaceRequired): Moved to base for better
8911         accesibility.
8912         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8913         when attribute is AttributeUsageAttribute.
8914         (Attribute.GetValidTargets): Simplified.
8915         (Attribute.GetAttributeUsage): New method returns AttributeUsage
8916         attribute for this type.
8917         (Attribute.ApplyAttributes): Method renamed to Emit and make
8918         non-static.
8919         (GlobalAttributeSection): New class for special handling of global
8920         attributes (assembly, module).
8921         (AttributeSection.Emit): New method.
8922
8923         * class.cs: Implemented Attributable abstract methods.
8924         (MethodCore.LabelParameters): Moved to Parameter class.
8925         (Accessor): Is back simple class.
8926         (PropertyMethod): Implemented Attributable abstract class.
8927         (DelegateMethod): Implemented Attributable abstract class.
8928         (Event): New constructor for disctintion between normal Event
8929         and Event with accessors.
8930
8931         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8932
8933         * codegen.cs, const.cs, decl.cs, delegate.cs:
8934         (CommonAssemblyModulClass): Implemented Attributable abstract class
8935         and simplified.
8936
8937         * enum.cs: Implement IAttributeSupport interface.
8938         (EnumMember): New class for emum members. Implemented Attributable
8939         abstract class
8940
8941         * parameter.cs:
8942         (ParameterBase): Is abstract.
8943         (ReturnParameter): New class for easier [return:] attribute handling.
8944
8945         * typemanager.cs: Removed builder_to_attr.
8946
8947 2004-05-11  Raja R Harinath  <rharinath@novell.com>
8948
8949         Fix bug #57151.
8950         * attribute.cs (Attribute.GetPositionalValue): New function.
8951         * class.cs (TypeContainer.VerifyMembers): New function.
8952         (TypeContainer.Emit): Use it.
8953         (ClassOrStruct): New base class for Class and Struct.
8954         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
8955         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8956         class.
8957         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8958         then each non-static field should have a FieldOffset attribute.
8959         Otherwise, none of the fields should have a FieldOffset attribute.
8960         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
8961         and FieldOffset attributes.
8962         * typemanager.cs (TypeManager.struct_layout_attribute_type)
8963         (TypeManager.field_offset_attribute_type): New core types.
8964         (TypeManager.InitCoreTypes): Initialize them.
8965
8966 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
8967
8968         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8969         Return correct type.
8970         From bug #58270.
8971
8972 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
8973
8974         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8975         be implicitly converted to ulong.
8976         
8977         * expression.cs: The logic for allowing operator &, | and ^ worked
8978         was wrong, it worked before because we did not report an error in
8979         an else branch.  Fixes 57895.
8980
8981         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8982         allow volatile fields to be reference types.
8983
8984 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
8985
8986         * driver.cs: Add support for /debug-
8987
8988 2004-05-07  Raja R Harinath  <rharinath@novell.com>
8989
8990         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
8991         Add a 'complain' parameter to silence errors.
8992         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
8993         silently overlooked type-resolutions.
8994         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8995         to reflect changes.
8996         (Attributes.Search): New function.
8997         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8998         (Attributes.GetAttributeFullName): Remove hack.
8999         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9000         Update to reflect changes.
9001         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9002         Use Attributes.Search instead of nested loops.
9003
9004 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9005
9006         * decl.cs:
9007         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9008         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9009         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9010
9011         * report.cs: (Report.Warning): Renamed to Warning_T because of
9012         parameter collision.
9013
9014 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9015
9016         * expression.cs (MemberAccess.ResolveMemberAccess):
9017         Exit with non-zero status after Report.Error.
9018         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9019         Likewise.
9020         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9021
9022 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9023
9024         * support.cs: Don't hang when the file is empty.
9025
9026 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9027
9028         * support.cs: In SeekableStreamReader, compute the preamble size of the
9029           underlying stream. Position changes should take into account that initial
9030           count of bytes.
9031
9032 2004-05-03  Todd Berman  <tberman@sevenl.net>
9033
9034         * driver.cs: remove unused GetSysVersion function.
9035
9036 2004-05-03  Todd Berman  <tberman@sevenl.net>
9037
9038         * driver.cs: Remove the hack from saturday, as well as the hack
9039         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9040         link_paths to get that bit proper.
9041
9042 2004-05-01  Todd Berman  <tberman@sevenl.net>
9043
9044         * driver.cs: Try a LoadFrom before a Load, this checks the current
9045         path. This is currently a bug in mono that is be fixed, however, this
9046         provides a workaround for now. This will be removed when the bug
9047         is fixed.
9048
9049 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9050
9051         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9052         incomplete key pairs (#57941).
9053
9054 2004-05-01  Todd Berman  <tberman@sevenl.net>
9055
9056         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9057         from the GAC
9058
9059 2004-04-30  Jackson Harper  <jackson@ximian.com>
9060
9061         * codegen.cs: Open keys readonly.
9062         
9063 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9064
9065         * typemanager.cs: don't report cyclic struct layout when a struct
9066         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9067         which has 2 Pango.Rectangle fields.
9068
9069 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9070
9071         * expression.cs: Handle IntPtr comparisons with IL code
9072         rather than a method call.
9073
9074 2004-04-29  Martin Baulig  <martin@ximian.com>
9075
9076         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9077         the list of PropertyInfo's in class hierarchy and find the
9078         accessor.  Fixes #56013.
9079
9080 2004-04-29  Martin Baulig  <martin@ximian.com>
9081
9082         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9083
9084 2004-04-29  Martin Baulig  <martin@ximian.com>
9085
9086         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9087
9088         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9089
9090 2004-04-29  Martin Baulig  <martin@ximian.com>
9091
9092         * class.cs (ConstructorInitializer.Resolve): Check whether the
9093         parent .ctor is accessible.  Fixes #52146.
9094
9095 2004-04-29  Martin Baulig  <martin@ximian.com>
9096
9097         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9098
9099         * statement.cs (Using.EmitLocalVariableDecls): Use
9100         TypeManager.idisposable_type, not typeof (IDisposable).
9101         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9102
9103 2004-04-29  Martin Baulig  <martin@ximian.com>
9104
9105         * class.cs (Event.Define): Don't emit the field and don't set
9106         RTSpecialName and SpecialName for events on interfaces.  Fixes
9107         #57703. 
9108
9109 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9110
9111         Refactor Attribute.ApplyAttributes.
9112         * attribute.cs (Attributable): New base class for objects that can
9113         have Attributes applied on them.
9114         (Attribute): Make AttributeUsage fields public.
9115         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9116         (Attribute.IsInternalCall): New property.
9117         (Attribute.UsageAttr): Convert to a public read-only property.
9118         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9119         (Attribute.ResolveType, Attribute.Resolve)
9120         (Attribute.ScanForIndexerName): Update to reflect changes.
9121         (Attribute.CheckAttributeTarget): Re-format.
9122         (Attribute.ApplyAttributes): Refactor, to various
9123         Attributable.ApplyAttributeBuilder methods.
9124         * decl.cs (MemberCore): Make Attributable.
9125         * class.cs (Accessor): Make Attributable.
9126         (MethodData.ApplyAttributes): Use proper attribute types, not
9127         attribute names.
9128         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9129         (TypeContainer.ApplyAttributeBuilder)
9130         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9131         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9132         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9133         (Operator.ApplyAttributeBuilder): New factored-out methods.
9134         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9135         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9136         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9137         * parameter.cs (ParameterBase): New Attributable base class
9138         that can also represent Return types.
9139         (Parameter): Update to the changes.
9140
9141 2004-04-29  Jackson Harper  <jackson@ximian.com>
9142
9143         * driver.cs: Prefer the corlib system version when looking for
9144         assemblies in the GAC. This is still a hack, but its a better hack
9145         now.
9146         
9147 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9148
9149         * decl.cs, enum.cs: Improved error 3005 reporting.
9150   
9151         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9152         (related_symbols): New private member for list of symbols
9153         related to reported error/warning.
9154         
9155         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9156
9157 2004-04-29  Martin Baulig  <martin@ximian.com>
9158
9159         * ecore.cs (Expression.Constantify): If we're an enum and
9160         TypeManager.TypeToCoreType() doesn't give us another type, use
9161         t.UnderlyingSystemType.  Fixes #56178.  
9162
9163 2004-04-29  Martin Baulig  <martin@ximian.com>
9164
9165         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9166         interfaces and for each interface, only add members directly
9167         declared in that interface.  Fixes #53255.
9168
9169 2004-04-28  Martin Baulig  <martin@ximian.com>
9170
9171         * expression.cs (ConditionalLogicalOperator): Use a temporary
9172         variable for `left' to avoid that we evaluate it more than once;
9173         bug #52588.
9174
9175 2004-04-28  Martin Baulig  <martin@ximian.com>
9176
9177         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9178         `void[]' (CS1547).
9179
9180 2004-04-28  Martin Baulig  <martin@ximian.com>
9181
9182         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9183         void (CS1547).
9184
9185         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9186         whether the type is not void (CS1547).
9187
9188 2004-04-28  Martin Baulig  <martin@ximian.com>
9189
9190         * expression.cs (Unary.DoResolveLValue): Override this and report
9191         CS0131 for anything but Operator.Indirection.
9192
9193 2004-04-28  Martin Baulig  <martin@ximian.com>
9194
9195         Committing a patch from Ben Maurer; see bug #50820.
9196
9197         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9198         check for classes.
9199
9200         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9201         classes.        
9202
9203 2004-04-28  Martin Baulig  <martin@ximian.com>
9204
9205         Committing a patch from Ben Maurer; see bug #50820.
9206
9207         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9208         check for classes.
9209
9210         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9211         classes.        
9212
9213 2004-04-28  Martin Baulig  <martin@ximian.com>
9214
9215         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9216         (Block.AddLabel): Call DoLookupLabel() to only search in the
9217         current block.
9218
9219 2004-04-28  Martin Baulig  <martin@ximian.com>
9220
9221         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9222         comparing StringConstants and NullLiterals in Equality and Inequality.
9223
9224 2004-04-28  Jackson Harper  <jackson@ximian.com>
9225
9226         * driver.cs: Attempt to load referenced assemblies from the
9227         GAC. This is the quick and dirty version of this method that
9228         doesnt take into account versions and just takes the first
9229         canidate found. Will be good enough for now as we will not have more
9230         then one version installed into the GAC until I update this method.
9231
9232 2004-04-28  Martin Baulig  <martin@ximian.com>
9233
9234         * typemanager.cs (TypeManager.CheckStructCycles): New public
9235         static method to check for cycles in the struct layout.
9236
9237         * rootcontext.cs (RootContext.PopulateTypes): Call
9238         TypeManager.CheckStructCycles() for each TypeContainer.
9239         [Note: We only need to visit each type once.]
9240
9241 2004-04-28  Martin Baulig  <martin@ximian.com>
9242
9243         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9244
9245         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9246         success and added `out object value'.  Use a `bool resolved' field
9247         to check whether we've already been called rather than
9248         `ConstantValue != null' since this breaks for NullLiterals.
9249
9250 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9251
9252         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9253         setting of this flag, since the 'set' method may be non-public.
9254
9255 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9256
9257         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9258         check on current_vector.Block.
9259
9260 2004-04-27  Martin Baulig  <martin@ximian.com>
9261
9262         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9263         a field initializer.  Fixes #56459.
9264
9265 2004-04-27  Martin Baulig  <martin@ximian.com>
9266
9267         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9268         we're not attempting to use an indexer.  Fixes #52154.
9269
9270 2004-04-27  Martin Baulig  <martin@ximian.com>
9271
9272         * statement.cs (Return): Don't create a return label if we don't
9273         need it; reverts my change from January 20th.  Thanks to Ben
9274         Maurer for this.
9275
9276 2004-04-27  Martin Baulig  <martin@ximian.com>
9277
9278         According to the spec, `goto' can only leave a nested scope, but
9279         never enter it.
9280
9281         * statement.cs (Block.LookupLabel): Only lookup in the current
9282         block, don't recurse into parent or child blocks.
9283         (Block.AddLabel): Check in parent and child blocks, report
9284         CS0140/CS0158 if we find a duplicate.
9285         (Block): Removed this indexer for label lookups.
9286         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9287         this already does the error reporting for us.
9288
9289         * flowanalysis.cs
9290         (FlowBranching.UsageVector.Block): New public variable; may be null.
9291         (FlowBranching.CreateSibling): Added `Block' argument.
9292         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9293         label for the target of a `goto' and check whether we're not
9294         leaving a `finally'.
9295
9296 2004-04-27  Martin Baulig  <martin@ximian.com>
9297
9298         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9299         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9300         just for returns).
9301
9302 2004-04-27  Martin Baulig  <martin@ximian.com>
9303
9304         * statement.cs (Block.AddLabel): Also check for implicit blocks
9305         and added a CS0158 check.
9306
9307 2004-04-27  Martin Baulig  <martin@ximian.com>
9308
9309         * flowanalysis.cs (FlowBranchingLoop): New class.
9310         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9311         UsageVector's instead of an ArrayList.
9312         (FlowBranching.Label): Likewise.
9313         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9314         (FlowBranching.AddBreakVector): New method.
9315
9316 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9317
9318         * attribute.cs: Small regression fix: only convert the type if we
9319         the type is different, fixes System.Drawing build.
9320
9321 2004-04-27  Martin Baulig  <martin@ximian.com>
9322
9323         * attribute.cs (Attribute.Resolve): If we have a constant value
9324         for a named field or property, implicity convert it to the correct
9325         type.
9326
9327 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9328
9329         * statement.cs (Block.Block): Implicit blocks share
9330         'child_variable_names' fields with parent blocks.
9331         (Block.AddChildVariableNames): Remove.
9332         (Block.AddVariable): Mark variable as "used by a child block" in
9333         every surrounding block.
9334         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9335         been used in a child block, complain about violation of "Invariant
9336         meaning in blocks" rule.
9337         * cs-parser.jay (declare_local_variables): Don't use
9338         AddChildVariableNames.
9339         (foreach_statement): Don't create an implicit block: 'foreach'
9340         introduces a scope.
9341
9342 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9343
9344         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9345         converting from 0L to ulong.  Fixes 57522.
9346
9347 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9348
9349         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9350         derived class hides via 'new' keyword field from base class (test-242.cs).
9351         TODO: Handle this in the more general way.
9352         
9353         * class.cs (CheckBase): Ditto.
9354
9355 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9356
9357         * decl.cs (caching_flags): New member for storing cached values
9358         as bit flags.
9359         (MemberCore.Flags): New enum where bit flags for caching_flags
9360         are defined.
9361         (MemberCore.cls_compliance): Moved to caching_flags.
9362         (DeclSpace.Created): Moved to caching_flags.
9363
9364         * class.cs: Use caching_flags instead of DeclSpace.Created
9365         
9366 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9367
9368         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9369         if we are only a derived class, not a nested class.
9370
9371         * typemanager.cs: Same as above, but do this at the MemberLookup
9372         level (used by field and methods, properties are handled in
9373         PropertyExpr).   Allow for the qualified access if we are a nested
9374         method. 
9375
9376 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9377
9378         * class.cs: Refactoring.
9379         (IMethodData): New inteface; Holds links to parent members
9380         to avoid member duplication (reduced memory allocation).
9381         (Method): Implemented IMethodData interface.
9382         (PropertyBase): New inner classes for get/set methods.
9383         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9384         (Event): New inner classes for add/remove methods.
9385         (Event.DelegateMethod): Implemented IMethodData interface.
9386
9387         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9388         EmitContext (related to class.cs refactoring).
9389
9390 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9391
9392         * delegate.cs (Delegate.VerifyApplicability): If the number of
9393         arguments are the same as the number of parameters, first try to
9394         verify applicability ignoring  any 'params' modifier on the last
9395         parameter.
9396         Fixes #56442.
9397
9398 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9399
9400         * class.cs (TypeContainer.AddIndexer): Use
9401         'ExplicitInterfaceName' to determine if interface name was
9402         explicitly specified.  'InterfaceType' is not initialized at this time.
9403         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9404         Indexers array is already in the required order.  Initialize
9405         'IndexerName' only if there are normal indexers.
9406         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9407         (TypeContainer.Emit): Emit DefaultMember attribute only if
9408         IndexerName is initialized.
9409         Fixes #56300.
9410
9411 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9412
9413         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9414         Fixes #57007
9415
9416 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9417
9418         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9419         attributes.
9420         Fix for #56456.
9421
9422         * attribute.cs (Attribute.Resolve): Check for duplicate named
9423         attributes.
9424         Fix for #56463.
9425
9426 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9427
9428         * iterators.cs (MarkYield): track whether we are in an exception,
9429         and generate code accordingly.  Use a temporary value to store the
9430         result for our state.
9431
9432         I had ignored a bit the interaction of try/catch with iterators
9433         since their behavior was not entirely obvious, but now it is
9434         possible to verify that our behavior is the same as MS .NET 2.0
9435
9436         Fixes 54814
9437
9438 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9439
9440         * iterators.cs: Avoid creating temporaries if there is no work to
9441         do. 
9442
9443         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9444         Enumerations, use TypeManager.EnumToUnderlying and call
9445         recursively. 
9446
9447         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9448         bug #57013
9449
9450         (This.Emit): Use EmitContext.EmitThis to emit our
9451         instance variable.
9452
9453         (This.EmitAssign): Ditto.
9454
9455         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9456         codepaths, we will move all the functionality into
9457         Mono.CSharp.This 
9458
9459         (FieldExpr.EmitAssign): Ditto.
9460
9461         This fixes several hidden bugs that I uncovered while doing a code
9462         review of this today.
9463
9464         * codegen.cs (EmitThis): reworked so the semantics are more clear
9465         and also support value types "this" instances.
9466
9467         * iterators.cs: Changed so that for iterators in value types, we
9468         do not pass the value type as a parameter.  
9469
9470         Initialization of the enumerator helpers is now done in the caller
9471         instead of passing the parameters to the constructors and having
9472         the constructor set the fields.
9473
9474         The fields have now `assembly' visibility instead of private.
9475
9476 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9477
9478         * expression.cs (Argument.Resolve): Check if fields passed as ref
9479         or out are contained in a MarshalByRefObject.
9480
9481         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9482         another compiler type.
9483
9484 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9485
9486         * class.cs (Indexer.Define): use the new name checking method.
9487         Also, return false on an error.
9488         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9489         (is_identifier_[start/part]_character): make static.
9490
9491 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9492
9493         * expression.cs (Binary.ResolveOperator): Do no append strings
9494         twice: since we can be invoked more than once (array evaluation)
9495         on the same concatenation, take care of this here.  Based on a fix
9496         from Ben (bug #56454)
9497
9498 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9499
9500         * codegen.cs: Fix another case where CS1548 must be reported (when 
9501         delay-sign isn't specified and no private is available #56564). Fix
9502         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9503         error when MCS is used on the MS runtime and we need to delay-sign 
9504         (which seems unsupported by AssemblyBuilder - see #56621).
9505
9506 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9507
9508         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9509         (TypeManager.ComputeNamespaces): Faster implementation for
9510         Microsoft runtime.
9511
9512         * compiler.csproj: Updated AssemblyName to mcs.
9513
9514 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9515
9516         * rootcontext.cs: Add new types to the boot resolution.
9517
9518         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9519         MulticastDelegate is not allowed.
9520
9521         * typemanager.cs: Add new types to lookup: System.TypedReference
9522         and ArgIterator.
9523
9524         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9525         check for TypedReference or ArgIterator, they are not allowed. 
9526
9527         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9528         makes us properly catch 1510 in some conditions (see bug 56016 for
9529         details). 
9530
9531 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9532
9533         * CryptoConvert.cs: update from corlib version
9534         with endian fixes.
9535
9536 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9537
9538         * class.cs (Indexer.Define): Check indexername declaration
9539
9540 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9541
9542         * attribute.cs (IsClsCompliant): Fixed problem with handling
9543         all three states (compliant, not-compliant, undetected).
9544
9545 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9546
9547         * attribute.cs (Attribute): Location is now public.
9548         (Resolve): Store resolved arguments (pos_values) in attribute class.
9549         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9550         (GetClsCompliantAttributeValue): New method that gets
9551         CLSCompliantAttribute value.
9552         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9553         if exists else null.
9554         (AttributeTester): New class for CLS-Compliant verification routines.
9555
9556         * class.cs (Emit): Add CLS-Compliant verification.
9557         (Method.GetSignatureForError): Implemented.
9558         (Constructor.GetSignatureForError): Implemented
9559         (Constructor.HasCompliantArgs): Returns if constructor has
9560         CLS-Compliant arguments.
9561         (Constructor.Emit): Override.
9562         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9563         is needed to test only parameters.
9564         (FieldBase.GetSignatureForError): Implemented.
9565         (TypeContainer): New member for storing base interfaces.
9566         (TypeContainer.FindMembers): Search in base interfaces too.
9567
9568         * codegen.cs (GetClsComplianceAttribute): New method that gets
9569         assembly or module CLSCompliantAttribute value.
9570         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9571         for assembly.
9572         (ModuleClass.Emit): Add error 3012 test.
9573
9574         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9575
9576         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9577         state for all decl types.
9578         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9579         if CLS-Compliant tests are required.
9580         (IsClsCompliaceRequired): New method. Analyze whether code
9581         must be CLS-Compliant.
9582         (IsExposedFromAssembly): New method. Returns true when MemberCore
9583         is exposed from assembly.
9584         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9585         value or gets cached value.
9586         (HasClsCompliantAttribute): New method. Returns true if MemberCore
9587         is explicitly marked with CLSCompliantAttribute.
9588         (IsIdentifierClsCompliant): New abstract method. This method is
9589         used to testing error 3005.
9590         (IsIdentifierAndParamClsCompliant): New method. Common helper method
9591         for identifier and parameters CLS-Compliant testing.
9592         (VerifyClsCompliance): New method. The main virtual method for
9593         CLS-Compliant verifications.
9594         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9595         null. I don't know why is null (too many public members !).
9596         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9597         and get value of first CLSCompliantAttribute that found.
9598
9599         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9600         (VerifyClsCompliance): Override and add extra tests.
9601
9602         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9603         clscheck- disable CLS-Compliant verification event if assembly is has
9604         CLSCompliantAttribute(true).
9605
9606         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9607         ApllyAttribute is now called in emit section as in the other cases.
9608         Possible future Emit integration.
9609         (IsIdentifierClsCompliant): New override.
9610         (VerifyClsCompliance): New override.
9611         (GetEnumeratorName): Returns full enum name.
9612
9613         * parameter.cs (GetSignatureForError): Implemented.
9614
9615         * report.cs (WarningData): New struct for Warning message information.
9616         (LocationOfPreviousError): New method.
9617         (Warning): New method. Reports warning based on the warning table.
9618         (Error_T): New method. Reports error based on the error table.
9619
9620         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9621         verifications are done here.
9622
9623         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9624
9625         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9626         CLSCompliantAttribute.
9627         (all_imported_types): New member holds all imported types from other
9628         assemblies.
9629         (LoadAllImportedTypes): New method fills static table with exported types
9630         from all referenced assemblies.
9631         (Modules): New property returns all assembly modules.
9632
9633 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
9634
9635         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9636         throwing a parser error.
9637
9638         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9639         which removes the hardcoded get_/set_ prefixes for properties, as
9640         IL allows for the properties to be named something else.  
9641
9642         Bug #56013
9643
9644         * expression.cs: Do not override operand before we know if it is
9645         non-null.  Fix 56207
9646
9647 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9648
9649         * typemanager.cs: support for pinned variables.
9650
9651 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9652
9653         * decl.cs, typemanager.cs: Avoid using an arraylist
9654         as a buffer if there is only one result set.
9655
9656 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9657
9658         * expression.cs: Make sure you cant call a static method
9659         with an instance expression, bug #56174.
9660
9661 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
9662
9663         * class.cs (IsDuplicateImplementation): Improve error reporting to
9664         flag 663 (method only differs in parameter modifier).
9665
9666         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9667         in preprocessor directives.
9668
9669         * location.cs (LookupFile): Allow for the empty path.
9670
9671         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
9672         better approach for some of that patch, but its failing with the
9673         CharSet enumeration.  For now try/catch will do.
9674
9675         * typemanager.cs: Do not crash if a struct does not have fields.
9676         Fixes 56150.
9677
9678 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9679
9680         * expression.cs: cs0213, cant fix a fixed expression.
9681         fixes 50231.
9682
9683 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9684
9685         * cs-parser.jay: detect invalid embeded statements gracefully.
9686         bug #51113.
9687
9688 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9689
9690         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9691         As a regex:
9692         s/
9693         the invocation type may not be a subclass of the tye of the item/
9694         The type of the item must be a subclass of the invocation item.
9695         /g
9696
9697         Fixes bug #50820.
9698
9699 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
9700
9701         * attribute.cs: Added methods to get a string and a bool from an
9702         attribute. Required to information from AssemblyKeyFileAttribute,
9703         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9704         * codegen.cs: Modified AssemblyName creation to include support for
9705         strongnames. Catch additional exceptions to report them as CS1548.
9706         * compiler.csproj: Updated include CryptoConvert.cs.
9707         * compiler.csproj.user: Removed file - user specific configuration.
9708         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
9709         Mono.Security assembly. The original class is maintained and tested in
9710         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9711         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9712         like CSC 8.0 (C# v2) supports.
9713         * Makefile: Added CryptoConvert.cs to mcs sources.
9714         * rootcontext.cs: Added new options for strongnames.
9715
9716 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
9717
9718         * driver.cs: For --expect-error, report error code `2'
9719         if the program compiled with no errors, error code `1' if
9720         it compiled with an error other than the one expected.
9721
9722 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
9723
9724         * compiler.csproj: Updated for Visual Studio .NET 2003.
9725         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9726         * compiler.sln: Updated for Visual Studio .NET 2003.
9727
9728 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
9729
9730         * expression.cs: Fix bug #47234. We basically need to apply the
9731         rule that we prefer the conversion of null to a reference type
9732         when faced with a conversion to 'object' (csc behaviour).
9733
9734 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9735
9736         * statement.cs: Shorter form for foreach, eliminates
9737         a local variable. r=Martin.
9738
9739 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9740
9741         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9742         checks if we can use brtrue/brfalse to test for 0.
9743         * expression.cs: use the above in the test for using brtrue/brfalse.
9744         cleanup code a bit.
9745
9746 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9747
9748         * expression.cs: Rewrite string concat stuff. Benefits:
9749
9750         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9751         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9752         rather than a concat chain.
9753
9754         * typemanager.cs: Add lookups for more concat overloads.
9755
9756 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9757
9758         * expression.cs: Emit shorter il code for array init.
9759
9760         newarr
9761         dup
9762         // set 1
9763
9764         // set 2
9765
9766         newarr
9767         stloc.x
9768
9769         ldloc.x
9770         // set 1
9771
9772         ldloc.x
9773         // set 2
9774
9775 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
9776
9777         * statement.cs: Before, two switch blocks would be merged if the
9778         total size of the blocks (end_item - begin_item + 1) was less than
9779         two times the combined sizes of the blocks.
9780
9781         Now, it will only merge if after the merge at least half of the
9782         slots are filled.
9783
9784         fixes 55885.
9785
9786 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
9787
9788         * class.cs : csc build fix for GetMethods(). See bug #52503.
9789
9790 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
9791
9792         * expression.cs: Make sure fp comparisons work with NaN.
9793         This fixes bug #54303. Mig approved this patch a long
9794         time ago, but we were not able to test b/c the runtime
9795         had a related bug.
9796
9797 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
9798
9799         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
9800
9801 2004-03-19  Martin Baulig  <martin@ximian.com>
9802
9803         * class.cs (MemberCore.IsDuplicateImplementation): Report the
9804         error here and not in our caller.
9805
9806 2004-03-19  Martin Baulig  <martin@ximian.com>
9807
9808         * interface.cs: Completely killed this file.
9809         (Interface): We're now a TypeContainer and live in class.cs.
9810
9811         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9812         argument; we're now also called for interfaces.
9813         (TypeContainer.DefineMembers): Allow this method being called
9814         multiple times.
9815         (TypeContainer.GetMethods): New public method; formerly known as
9816         Interface.GetMethod().  This is used by PendingImplementation.
9817         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9818         it's now private and non-static.
9819         (Interface): Moved this here; it's now implemented similar to
9820         Class and Struct.
9821         (Method, Property, Event, Indexer): Added `bool is_interface'
9822         argument to their .ctor's.
9823         (MemberBase.IsInterface): New public field.
9824
9825         * cs-parser.jay: Create normal Method, Property, Event, Indexer
9826         instances instead of InterfaceMethod, InterfaceProperty, etc.
9827         (opt_interface_base): Removed; we now use `opt_class_base' instead.
9828         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9829
9830 2004-03-19  Martin Baulig  <martin@ximian.com>
9831
9832         * class.cs (MethodCore.IsDuplicateImplementation): New private
9833         method which does the CS0111 checking.
9834         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9835         Use IsDuplicateImplementation().
9836
9837 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9838
9839         * decl.cs (FindMemberToOverride): New method to find the correct
9840         method or property to override in the base class.
9841         * class.cs
9842             - Make Method/Property use the above method to find the
9843               version in the base class.
9844             - Remove the InheritableMemberSignatureCompare as it is now
9845               dead code.
9846
9847         This patch makes large code bases much faster to compile, as it is
9848         O(n) rather than O(n^2) to do this validation.
9849
9850         Also, it fixes bug 52458 which is that nested classes are not
9851         taken into account when finding the base class member.
9852
9853         Reviewed/Approved by Martin.
9854
9855 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
9856
9857         * interface.cs: In all interface classes removed redundant
9858         member initialization.
9859
9860 2004-03-16  Martin Baulig  <martin@ximian.com>
9861
9862         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9863
9864 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9865
9866         * decl.cs (DefineTypeAndParents): New helper method to define a
9867         type's containers before the type itself is defined;  This is a
9868         bug exposed by the recent changes to Windows.Forms when an
9869         implemented interface was defined inside a class that had not been
9870         built yet.   
9871
9872         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9873
9874         (Check): Loop correctly to report errors modifiers
9875         (UNSAFE was not in the loop, since it was the same as TOP).
9876
9877         * interface.cs: Every interface member now takes a ModFlags,
9878         instead of a "is_new" bool, which we set on the base MemberCore. 
9879
9880         Every place where we called "UnsafeOk" in the interface, now we
9881         call the proper member (InterfaceMethod.UnsafeOK) instead to get
9882         the unsafe settings from the member declaration instead of the
9883         container interface. 
9884
9885         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
9886
9887         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9888         `set_indexer_name' to the pending bits (one per type).
9889
9890         We fixed a bug today that was picking the wrong method to
9891         override, since for properties the existing InterfaceMethod code
9892         basically ignored the method name.  Now we make sure that the
9893         method name is one of the valid indexer names.
9894
9895 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
9896  
9897         * support.cs (SeekableStreamReader): Keep track of stream byte
9898         positions and don't mix them with character offsets to the buffer.
9899
9900         Patch from Gustavo Giráldez
9901
9902 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
9903
9904         * interface.cs (InterfaceSetGetBase): Removed double member
9905         initialization, base class does it as well.
9906
9907 2004-03-13  Martin Baulig  <martin@ximian.com>
9908
9909         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9910         when compiling corlib.
9911
9912 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
9913
9914         * convert.cs (ExplicitConversion): We were reporting an error on
9915         certain conversions (object_type source to a value type, when the
9916         expression was `null') before we had a chance to pass it through
9917         the user defined conversions.
9918
9919         * driver.cs: Replace / and \ in resource specifications to dots.
9920         Fixes 50752
9921
9922         * class.cs: Add check for duplicate operators.  Fixes 52477
9923
9924 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
9925
9926         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9927         that are in the middle of the statements, not only at the end.
9928         Fixes #54987
9929
9930         * class.cs (TypeContainer.AddField): No longer set the
9931         `HaveStaticConstructor' flag, now we call it
9932         `UserDefineStaticConstructor' to diferentiate the slightly
9933         semantic difference.
9934
9935         The situation is that we were not adding BeforeFieldInit (from
9936         Modifiers.TypeAttr) to classes that could have it.
9937         BeforeFieldInit should be set to classes that have no static
9938         constructor. 
9939
9940         See:
9941
9942         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9943
9944         And most importantly Zoltan's comment:
9945
9946         http://bugzilla.ximian.com/show_bug.cgi?id=44229
9947
9948         "I think beforefieldinit means 'it's ok to initialize the type sometime 
9949          before its static fields are used', i.e. initialization does not need
9950          to be triggered by the first access to the type. Setting this flag
9951          helps the JIT to compile better code, since it can run the static
9952          constructor at JIT time, and does not need to generate code to call it
9953          (possibly lots of times) at runtime. Unfortunately, mcs does not set
9954          this flag for lots of classes like String. 
9955          
9956          csc sets this flag if the type does not have an explicit static 
9957          constructor. The reasoning seems to be that if there are only static
9958          initalizers for a type, and no static constructor, then the programmer
9959          does not care when this initialization happens, so beforefieldinit
9960          can be used.
9961          
9962          This bug prevents the AOT compiler from being usable, since it 
9963          generates so many calls to mono_runtime_class_init that the AOT code
9964          is much slower than the JITted code. The JITted code is faster, 
9965          because it does not generate these calls if the vtable is type is
9966          already initialized, which is true in the majority of cases. But the
9967          AOT compiler can't do this."
9968
9969 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
9970
9971         * class.cs (MethodData.Emit): Refactor the code so symbolic
9972         information is generated for destructors;  For some reasons we
9973         were taking a code path that did not generate symbolic information
9974         before. 
9975
9976 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9977
9978         * class.cs: Create a Constructor.CheckBase method that
9979         takes care of all validation type code. The method
9980         contains some code that was moved from Define.
9981
9982         It also includes new code that checks for duplicate ctors.
9983         This fixes bug #55148.
9984
9985 2004-03-09  Joshua Tauberer <tauberer@for.net>
9986
9987         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9988         a { ... }-style array creation invokes EmitStaticInitializers
9989         which is not good for reference-type arrays.  String, decimal
9990         and now null constants (NullCast) are not counted toward
9991         static initializers.
9992
9993 2004-03-05  Martin Baulig  <martin@ximian.com>
9994
9995         * location.cs (SourceFile.HasLineDirective): New public field;
9996         specifies whether the file contains or is referenced by a "#line"
9997         directive.
9998         (Location.DefineSymbolDocuments): Ignore source files which
9999         either contain or are referenced by a "#line" directive.        
10000
10001 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10002
10003         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10004         direct access to our parent, so check the method inline there.
10005
10006 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10007
10008         * expression.cs (Invocation.EmitCall): Miguel's last commit
10009         caused a regression. If you had:
10010
10011             T t = null;
10012             t.Foo ();
10013
10014         In Foo the implict this would be null.
10015
10016 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10017
10018         * expression.cs (Invocation.EmitCall): If the method is not
10019         virtual, do not emit a CallVirt to it, use Call.
10020
10021         * typemanager.cs (GetFullNameSignature): Improve the method to
10022         cope with ".ctor" and replace it with the type name.
10023
10024         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10025         as an argument the ConstructorBuilder where it is being defined,
10026         to catch the recursive constructor invocations.
10027
10028 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10029
10030         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10031         routines to check if a type is an enumerable/enumerator allow
10032         classes that implement the IEnumerable or IEnumerator interfaces.
10033
10034         * class.cs (Property, Operator): Implement IIteratorContainer, and
10035         implement SetYields.
10036
10037         (Property.Define): Do the block swapping for get_methods in the
10038         context of iterators.   We need to check if Properties also
10039         include indexers or not.
10040
10041         (Operator): Assign the Block before invoking the
10042         OperatorMethod.Define, so we can trigger the Iterator code
10043         replacement. 
10044
10045         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10046         Property and Operator classes are not created when we parse the
10047         declarator but until we have the block completed, so we use a
10048         singleton SimpleIteratorContainer.Simple to flag whether the
10049         SetYields has been invoked.
10050
10051         We propagate this setting then to the Property or the Operator to
10052         allow the `yield' to function.
10053
10054 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10055
10056         * codegen.cs: Implemented attribute support for modules.
10057         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10058         Assembly/Module functionality.
10059
10060         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10061         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10062         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10063
10064 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10065
10066         * interface.cs (FindMembers): The operation is performed on all base
10067         interfaces and not only on the first. It is required for future CLS Compliance patch.
10068
10069 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10070
10071         * statement.cs, codegen.cs:
10072         This patch deals with patterns such as:
10073
10074         public class List : IEnumerable {
10075
10076                 public MyEnumerator GetEnumerator () {
10077                         return new MyEnumerator(this);
10078                 }
10079
10080                 IEnumerator IEnumerable.GetEnumerator () {
10081                         ...
10082                 }
10083                 
10084                 public struct MyEnumerator : IEnumerator {
10085                         ...
10086                 }
10087         }
10088
10089         Before, there were a few things we did wrong:
10090         1) we would emit callvirt on a struct, which is illegal
10091         2) we emited ldarg when we needed to emit ldarga
10092         3) we would mistakenly call the interface methods on an enumerator
10093         type that derived from IEnumerator and was in another assembly. For example:
10094
10095         public class MyEnumerator : IEnumerator
10096
10097         Would have the interface methods called, even if there were public impls of the
10098         method. In a struct, this lead to invalid IL code.
10099
10100 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10101
10102         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10103           renamed to Emit.
10104
10105         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10106
10107 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10108
10109         * cs-parser.jay: Fix small regression: we were not testing V2
10110         compiler features correctly.
10111
10112         * interface.cs: If the emit context is null, then create one
10113
10114 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10115
10116         * decl.cs (GetSignatureForError): New virtual method to get full name
10117           for error messages.
10118
10119         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10120           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10121
10122         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10123           Duplicated members and code in these classes has been removed.
10124           Better encapsulation in these classes.
10125
10126 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10127
10128         * assign.cs (Assign.DoResolve): When dealing with compound
10129         assignments, there is a new rule in ECMA C# 2.4 (might have been
10130         there before, but it is documented here) that states that in:
10131
10132         a op= b;
10133
10134         If b is of type int, and the `op' is a shift-operator, then the
10135         above is evaluated as:
10136
10137         a = (int) a op b 
10138
10139         * expression.cs (Binary.ResolveOperator): Instead of testing for
10140         int/uint/long/ulong, try to implicitly convert to any of those
10141         types and use that in pointer arithmetic.
10142
10143         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10144         method to print information for from the type, not from the
10145         null-method we were given.
10146
10147 2004-02-01  Duncan Mak  <duncan@ximian.com>
10148
10149         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10150         parsing for cmd, fixes bug #53694.
10151
10152 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10153
10154         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10155         in the member name duplication tests. Property and operator name duplication
10156         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10157
10158 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10159
10160         * interface.cs (PopulateMethod): Fixed crash when interface method
10161         returns not existing type (error test cs0246-3.cs).
10162
10163 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10164
10165         * cs-parser.jay (interface_accessors): Re-write actions to also
10166         store attributes attached to get and set methods. Fix spelling
10167         while at it.
10168
10169         (inteface_property_declaration): Modify accordingly.
10170
10171         (InterfaceAccessorInfo): New helper class to store information to pass
10172         around between rules that use interface_accessors.
10173
10174         * interface.cs (Emit): Apply attributes on the get and set
10175         accessors of properties and indexers too.
10176
10177         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10178         right MethodBuilder when applying attributes to the get and set accessors.
10179
10180 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10181
10182         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10183
10184 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10185
10186         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10187
10188 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10189
10190         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10191         changes that treat `yield' specially when present before `break'
10192         or `return' tokens.
10193
10194         * cs-tokenizer.cs: yield is no longer a keyword.
10195
10196 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10197
10198         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10199         setting for default constructors.
10200         For default constructors are almost every time set wrong Modifier. The
10201         generated IL code has been alright. But inside mcs this values was
10202         wrong and this was reason why several of my CLS Compliance tests
10203         failed.
10204
10205 2004-01-22  Martin Baulig  <martin@ximian.com>
10206
10207         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10208         not a QualifiedIdentifier.  This is what `type_name_expression'
10209         was previously doing.
10210         (type_name_expression): Removed; the code is now in
10211         `namespace_or_type_name'.
10212         (qualified_identifier): Removed, use `namespace_or_type_name'
10213         instead.
10214         (QualifiedIdentifier): Removed this class.      
10215
10216 2004-01-22  Martin Baulig  <martin@ximian.com>
10217
10218         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10219         not a string as alias name.
10220
10221 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10222
10223         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10224         #52730 bug, and instead compute correctly the need to use a
10225         temporary variable when requesting an address based on the
10226         static/instace modified of the field and the constructor.
10227  
10228 2004-01-21  Martin Baulig  <martin@ximian.com>
10229
10230         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10231         class and namespace before looking up aliases.  Fixes #52517.
10232
10233 2004-01-21  Martin Baulig  <martin@ximian.com>
10234
10235         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10236         assinged in a 'try'; fixes exception4.cs.
10237
10238 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10239         * class.cs : Implemented parameter-less constructor for TypeContainer
10240
10241         * decl.cs: Attributes are now stored here. New property OptAttributes
10242
10243         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10244
10245         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10246
10247 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10248
10249         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10250           (CSharpSignature): New method for indexer and property signature.
10251
10252 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10253
10254         * pending.cs (IsVirtualFilter): Faster implementation.
10255
10256 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10257
10258         * typemanager.cs: Avoid inclusion of same assembly more than once.
10259
10260 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10261
10262         * cs-parser.jay: Fixed problem where the last assembly attribute
10263           has been applied also to following declaration (class, struct, etc.)
10264           
10265 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10266
10267         * class.cs: Added error CS0538, CS0539 reporting.
10268         Fixed crash on Microsoft runtime when field type is void.
10269
10270         * cs-parser.jay: Added error CS0537 reporting.
10271
10272         * pending.cs: Added error CS0535 reporting.
10273         Improved error report for errors CS0536, CS0534.
10274
10275 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10276
10277         Merge a few bits from the Anonymous Method MCS tree.
10278
10279         * statement.cs (ToplevelBlock): New class for toplevel methods,
10280         will hold anonymous methods, lifted variables.
10281
10282         * cs-parser.jay: Create toplevel blocks for delegates and for
10283         regular blocks of code. 
10284
10285 2004-01-20  Martin Baulig  <martin@ximian.com>
10286
10287         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10288         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10289         and `NeedExplicitReturn'; added `IsLastStatement'.
10290         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10291         have a `ReturnLabel' or we're not unreachable.
10292
10293         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10294         child's reachability; don't just override ours with it.  Fixes
10295         #58058 (lluis's example).
10296         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10297         InFinally(), InLoop(), InSwitch() and
10298         BreakCrossesTryCatchBoundary() methods.
10299
10300         * statement.cs (Return): Do all error checking in Resolve().
10301         Unless we are the last statement in a top-level block, always
10302         create a return label and jump to it.
10303         (Break, Continue): Do all error checking in Resolve(); also make
10304         sure we aren't leaving a `finally'.
10305         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10306         statement in a top-level block.
10307         (Block.Flags): Added `IsDestructor'.
10308         (Block.IsDestructor): New public property.
10309
10310 2004-01-20  Martin Baulig  <martin@ximian.com>
10311
10312         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10313
10314 2004-01-20  Martin Baulig  <martin@ximian.com>
10315
10316         * statement.cs (Statement.ResolveUnreachable): New public method.
10317         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10318         (Block.Resolve): Resolve unreachable statements.
10319
10320 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10321
10322         * expression.cs: We need to fix the case where we do
10323         not have a temp variable here.
10324
10325         * assign.cs: Only expression compound assignments need
10326         temporary variables.
10327
10328 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10329
10330         * flowanalysis.cs: Reduce memory allocation in a few ways:
10331           - A block with no variables should not allocate a bit
10332             vector for itself.
10333           - A method with no out parameters does not need any tracking
10334             for assignment of the parameters, so we need not allocate
10335             any data for it.
10336           - The arrays:
10337                 public readonly Type[] VariableTypes;
10338                 public readonly string[] VariableNames;
10339             Are redundant. The data is already stored in the variable
10340             map, so we need not allocate another array for it.
10341           - We need to add alot of checks for if (params | locals) == null
10342             due to the first two changes.
10343
10344 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10345
10346         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10347         implement IMemoryLocation, we store a copy on a local variable and
10348         take the address of it.  Patch from Benjamin Jemlich
10349
10350         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10351         to use a special "type_name_expression" rule which reduces the
10352         number of "QualifiedIdentifier" classes created, and instead
10353         directly creates MemberAccess expressions.
10354
10355 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
10356
10357         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10358         that fixes #52853.  Null literal assignment to ValueType
10359
10360         * class.cs (MethodData.Emit): Instead of checking the name of the
10361         method to determine if its a destructor, create a new derived
10362         class from Method called Destructor, and test for that.  
10363
10364         * cs-parser.jay: Create a Destructor object instead of a Method.  
10365
10366         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10367
10368         Fixes: 52933
10369
10370 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
10371
10372         * expression.cs (Binary.ResolveOperator): Perform an implicit
10373         conversion from MethodGroups to their delegate types on the
10374         Addition operation.
10375
10376         * delegate.cs: Introduce a new class DelegateCreation that is the
10377         base class for `NewDelegate' and `ImplicitDelegateCreation',
10378         factor some code in here.
10379
10380         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10381         conversion from MethodGroups to compatible delegate types. 
10382
10383         * ecore.cs (Expression.Resolve): Do not flag error 654
10384         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10385         we allow conversions from MethodGroups to delegate types now.
10386
10387         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10388         assignments in v2 either.
10389
10390 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
10391
10392         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10393         static read-only fields in ctors.
10394
10395         Applied patch from Benjamin Jemlich 
10396
10397         * expression.cs (UnaryMutator): Avoid leaking local variables. 
10398
10399 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
10400
10401         * cs-tokenizer.cs (IsCastToken): Allow the various native types
10402         here to return true, as they can be used like this:
10403
10404                 (XXX) int.MEMBER ()
10405
10406         Fixed 49836 and all the other dups
10407
10408 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
10409
10410         * driver.cs: Implement /win32res and /win32icon.
10411
10412 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
10413
10414         * cs-parser.jay: Add a rule to improve error handling for the
10415         common mistake of placing modifiers after the type.
10416
10417 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
10418
10419         * cs-parser.jay (interface_event_declaration): Catch
10420         initialization of events on interfaces, and report cs0068
10421
10422         * cs-parser.jay (interface_event_declaration): Catch
10423         initialization of events. 
10424
10425         * ecore.cs: Better report missing constructors.
10426
10427         * expression.cs (Binary.ResolveOperator): My previous bug fix had
10428         the error reporting done in the wrong place.  Fix.
10429
10430         * expression.cs (Binary.ResolveOperator): Catch the 
10431         operator + (E x, E y) error earlier, and later allow for implicit
10432         conversions in operator +/- (E e, U x) from U to the underlying
10433         type of E.
10434
10435         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10436         52596, if the container class is abstract, the default constructor
10437         is protected otherwise its public (before, we were always public).
10438
10439         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10440         fixed statement.
10441
10442         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10443         Jemlich that fixes bug #52597, MCS was generating invalid code for
10444         idisposable structs.   Thanks to Ben for following up with this
10445         bug as well.
10446
10447 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
10448
10449         * driver.cs: Allow assemblies without code to be generated, fixes
10450         52230.
10451
10452 2004-01-07  Nick Drochak <ndrochak@gol.com>
10453
10454         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10455
10456 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
10457
10458         * cs-parser.jay: Add rules to improve error reporting if fields or
10459         methods are declared at the namespace level (error 116)
10460
10461         * Add rules to catch event add/remove
10462
10463 2004-01-04  David Sheldon <dave-mono@earth.li>
10464
10465   * expression.cs: Added matching ")" to error message for 
10466   CS0077
10467
10468 2004-01-03 Todd Berman <tberman@gentoo.org>
10469
10470         * ecore.cs, attribute.cs:
10471         Applying fix from #52429.
10472
10473 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10474
10475         * ecore.cs, expression.cs, statement.cs:
10476         Total rewrite of how we handle branching. We
10477         now handle complex boolean expressions with fewer
10478         jumps. As well if (x == 0) no longer emits a ceq.
10479
10480         if (x is Foo) is much faster now, because we generate
10481         better code.
10482
10483         Overall, we get a pretty big improvement on our benchmark
10484         tests. The code we generate is smaller and more readable.
10485
10486         I did a full two-stage bootstrap. The patch was reviewed
10487         by Martin and Miguel.
10488
10489 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10490
10491         * cs-parser.jay: Make primary_expression not take a QI.
10492         we dont need this because the member_access rule covers
10493         us here. So we replace the rule with just IDENTIFIER.
10494
10495         This has two good effects. First, we remove a s/r conflict.
10496         Second, we allocate many fewer QualifiedIdentifier objects.
10497
10498 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10499
10500         * attribute.cs: Handle MarshalAs attributes as pseudo, and
10501         set the correct information via SRE. This prevents
10502         hanging on the MS runtime. Fixes #29374.
10503
10504 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10505
10506         * convert.cs: correctly handle conversions to value types
10507         from Enum and ValueType as unboxing conversions.
10508
10509         Fixes bug #52569. Patch by Benjamin Jemlich.
10510
10511 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10512
10513         * expression.cs (BetterConversion): Prefer int -> uint
10514         over int -> ulong (csc's behaviour). This fixed bug #52046.
10515
10516 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10517
10518         * decl.cs (MemberCache.FindMembers): now returns a
10519         MemberInfo [].
10520
10521         * typemanager.cs: In general, go with with ^^.
10522         (CopyNewMethods): take an IList.
10523         (RealMemberLookup): Only allocate an arraylist
10524         if we copy from two sets of methods.
10525
10526         This change basically does two things:
10527         1) Fewer array lists allocated due to CopyNewMethods.
10528         2) the explicit cast in MemberList costed ALOT.
10529
10530 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10531
10532         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10533         a hashtable to avoid needless string allocations when an identifier is
10534         used more than once (the common case).
10535
10536 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10537
10538         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10539         is broken, it will not return anything. So, we
10540         have to use the information we have in mcs to
10541         do the task.
10542
10543         * typemanager.cs: Add a cache for GetInterfaces,
10544         since this will now be used more often (due to ^^)
10545
10546         (GetExplicitInterfaces) New method that gets the
10547         declared, not effective, interfaces on a type
10548         builder (eg, if you have interface IFoo, interface
10549         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10550         { IBar }.
10551
10552         This patch makes MCS able to bootstrap itself on
10553         Windows again.
10554
10555 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10556
10557         * expression.cs: Remove the Nop's that Miguel put
10558         in by mistake.
10559
10560 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10561
10562         * report.cs, codegen.cs: Give the real stack trace to
10563         the error when an exception is thrown.
10564
10565 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10566
10567         * decl.cs: only allocate hashtables for ifaces if 
10568         it is an iface!
10569
10570 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10571
10572         * expression.cs: fix the error from cs0121-2.cs
10573         (a parent interface has two child interfaces that
10574         have a function with the same name and 0 params
10575         and the function is called through the parent).
10576
10577 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10578
10579         * class.cs, rootcontext.cs, typmanager.cs: do not
10580         leak pointers.
10581
10582 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10583
10584         * codegen.cs: remove stack for the ec flow branching.
10585         It is already a linked list, so no need.
10586
10587 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10588
10589         * Makefile: Allow custom profiler here.
10590
10591 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10592
10593         * typemanager.cs (LookupType):
10594           - Use a static char [], because split takes
10595             a param array for args, so it was allocating
10596             every time.
10597           - Do not store true in a hashtable, it boxes.
10598
10599 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10600
10601         * flowanalysis.cs: bytify common enums.
10602
10603 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10604
10605         * modifiers.cs: Add a new set of flags for the
10606         flags allowed on explicit interface impls.
10607         * cs-parser.jay: catch the use of modifiers in
10608         interfaces correctly.
10609         * class.cs: catch private void IFoo.Blah ().
10610
10611         All related to bug #50572.
10612
10613 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10614
10615         * decl.cs: Rewrite the consistant accessability checking.
10616         Accessability is not linear, it must be implemented in
10617         a tableish way. Fixes #49704.
10618
10619 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10620
10621         * expression.cs: Handle negation in a checked context.
10622         We must use subtraction from zero. Fixes #38674.
10623
10624 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10625
10626         * class.cs: Ignore static void main in DLLs.
10627         * rootcontext.cs: Handle the target type here,
10628         since we are have to access it from class.cs
10629         * driver.cs: account for the above.
10630
10631 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10632
10633         * report.cs: Give line numbers and files if available.
10634
10635 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10636
10637         * driver.cs: Implement /addmodule.
10638
10639         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10640         ModuleBuilders.
10641
10642 2003-12-20  Martin Baulig  <martin@ximian.com>
10643
10644         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10645         (FieldBase.IsAssigned): Removed this field.
10646         (FieldBase.SetAssigned): New public method.
10647         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10648
10649 2003-12-20  Martin Baulig  <martin@ximian.com>
10650
10651         * expression.cs (LocalVariableReference.DoResolve): Don't set
10652         `vi.Used' if we're called from DoResolveLValue().
10653
10654         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10655         returns the usage vector it just merged into the current one -
10656         pass this one to UsageWarning().
10657         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10658         of the `EmitContext', don't call this recursively on our children.
10659
10660 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
10661
10662         * driver.cs: Implement /target:module.
10663
10664 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10665
10666         * support.cs (CharArrayHashtable): New helper class.
10667
10668         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
10669         char arrays, not strings, so we can avoid creating a string in
10670         consume_identifier if the identifier is a keyword.
10671
10672 2003-12-16  Martin Baulig  <martin@ximian.com>
10673
10674         * statement.cs (LocalInfo.Assigned): Removed this property.
10675         (LocalInfo.Flags): Removed `Assigned'.
10676         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10677         and uses flow analysis.
10678         (Block.UsageWarning): Made this method private.
10679         (Block.Resolve): Call UsageWarning() if appropriate.
10680
10681         * expression.cs (LocalVariableReference.DoResolve): Always set
10682         LocalInfo.Used here.
10683
10684 2003-12-13  Martin Baulig  <martin@ximian.com>
10685
10686         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10687         any value here; we're now using flow analysis to figure out
10688         whether a statement/block returns a value.
10689
10690 2003-12-13  Martin Baulig  <martin@ximian.com>
10691
10692         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10693         working again.
10694         (FlowBranching.MergeFinally): Don't call
10695         `branching.CheckOutParameters()' here, this is called in
10696         MergeTopBlock().
10697         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10698         when adding the `finally' vector.       
10699
10700 2003-12-13  Martin Baulig  <martin@ximian.com>
10701
10702         * flowanalysis.cs
10703         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10704         actually work and also fix #48962.
10705
10706 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10707
10708         * decl.cs: Do not check System.Object for nested types,
10709         since we know it does not have any. Big bang for buck:
10710
10711         BEFORE:
10712            Run 1:   8.35 seconds
10713            Run 2:   8.32 seconds
10714            corlib:  17.99 seconds
10715         AFTER:
10716            Run 1:   8.17 seconds
10717            Run 2:   8.17 seconds
10718            corlib:  17.39 seconds
10719
10720 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10721
10722         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10723         time we are returning 0 members, so we save alot here.
10724
10725 2003-12-11  Martin Baulig  <martin@ximian.com>
10726
10727         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10728         `MergeChild()', also just take the `FlowBranching' as argument;
10729         call Merge() on it and return the result.
10730         (FlowBranching.Merge): We don't need to do anything if we just
10731         have one sibling.
10732
10733 2003-12-11  Martin Baulig  <martin@ximian.com>
10734
10735         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10736         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10737         Maurer for this idea.
10738
10739 2003-12-11  Martin Baulig  <martin@ximian.com>
10740
10741         * flowanalysis.cs (MergeResult): This class is now gone; we now
10742         use the `UsageVector' for this.  The reason for this is that if a
10743         branching just has one sibling, we don't need to "merge" them at
10744         all - that's the next step to do.
10745         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10746         `MergeResult'.
10747
10748 2003-12-11  Martin Baulig  <martin@ximian.com>
10749
10750         Reworked flow analyis and made it more precise and bug-free.  The
10751         most important change is that we're now using a special `Reachability'
10752         class instead of having "magic" meanings of `FlowReturns'.  I'll
10753         do some more cleanups and optimizations and also add some more
10754         documentation this week.
10755
10756         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10757         largely reworked this class.
10758         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10759         the new `Reachability' class instead of having "magic" values here.
10760         (FlowBranching): We're now using an instance of `Reachability'
10761         instead of having separate `Returns', `Breaks' etc. fields.
10762
10763         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10764         based on flow analysis; ignore the return value of block.Emit ().
10765
10766 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10767
10768         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10769         if they are private.
10770
10771 2003-12-09  Martin Baulig  <martin@ximian.com>
10772
10773         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10774         call them directly on the UsageVector.
10775
10776 2003-12-09  Martin Baulig  <martin@ximian.com>
10777
10778         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10779         Changed return type from `FlowReturns' to `Reachability'.
10780
10781 2003-12-09  Martin Baulig  <martin@ximian.com>
10782
10783         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10784         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10785         `Reachable' fields with a single `Reachability' one.
10786
10787 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10788
10789         * class.cs (FindMembers): Remove foreach's.
10790
10791         Bootstrap times:
10792
10793         BEFORE
10794                 Run 1:   8.74 seconds
10795                 Run 2:   8.71 seconds
10796
10797         AFTER
10798                 Run 1:   8.64 seconds
10799                 Run 2:   8.58 seconds
10800
10801
10802 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10803
10804         * cs-parser.jay:
10805         * gen-treedump.cs:
10806         * statement.cs:
10807         This patch does a few things:
10808                 1. EmptyStatement is now a singleton, so it is never reallocated.
10809                 2. All blah is EmptyStatement constructs have been changed to
10810                    blah == EmptyStatement.Value, which is much faster and valid
10811                    now that EmptyStatement is a singleton.
10812                 3. When resolving a block, rather than allocating a new array for
10813                    the non-empty statements, empty statements are replaced with
10814                    EmptyStatement.Value
10815                 4. Some recursive functions have been made non-recursive.
10816         Mainly the performance impact is from (3), however (1) and (2) are needed for
10817         this to work. (4) does not make a big difference in normal situations, however
10818         it makes the profile look saner.
10819
10820         Bootstrap times:
10821
10822         BEFORE
10823         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10824         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10825         Total memory allocated: 56397 KB
10826
10827         AFTER
10828         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10829         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10830         Total memory allocated: 55666 KB
10831
10832 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10833
10834         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10835         than the hashtable in a hashtable version
10836
10837         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10838         we always end up concating a string. This results in a huge perf
10839         loss, because many strings have to be tracked by the GC. In this
10840         patch, we first use a hashtable that works with two keys, so that
10841         the strings do not need to be concat'ed.
10842
10843         Bootstrap times:
10844         BEFORE
10845                 Run 1:   8.74 seconds
10846                 Run 2:   8.71 seconds
10847
10848         AFTER
10849                 Run 1:   8.65 seconds
10850                 Run 2:   8.56 seconds
10851
10852 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10853
10854         * Makefile: Add a new target `do-time' that does a quick and simple
10855         profile, leaving easy to parse output.
10856
10857 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10858
10859         * codegen.cs (Init): Create the dynamic assembly with 
10860         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10861
10862 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10863
10864         * support.cs: Make the PtrHashtable use only one
10865         instance of its comparer.
10866
10867 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10868
10869         * typemanager.cs: Fix lookup of GetNamespaces.
10870
10871 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10872
10873         * expression.cs: Removed redundant line.
10874
10875         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10876         ArrayLists, use for loops with bounds.  
10877
10878         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10879         arraylist.
10880
10881         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10882         arraylists, use for loop with bounds.
10883
10884         The above three changes give us a 0.071 second performance
10885         improvement out of 3.294 seconds down to 3.223.  On my machine
10886         the above changes reduced the memory usage by 1,387 KB during
10887         compiler bootstrap.
10888
10889         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10890         QualifiedIdentifiers.  Before we created a new string through
10891         concatenation, and mostly later on, the result would be
10892         manipulated by DecomposeQI through string manipulation.
10893
10894         This reduced the compiler memory usage for bootstrapping from
10895         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10896         compile times in 0.05 seconds.
10897
10898 2003-11-28  Dick Porter  <dick@ximian.com>
10899
10900         * support.cs: Do string compares with the Invariant culture.
10901
10902         * rootcontext.cs: 
10903         * gen-treedump.cs: 
10904         * expression.cs: 
10905         * driver.cs: 
10906         * decl.cs: 
10907         * codegen.cs: 
10908         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10909         the comparison is done with the Invariant culture.
10910
10911 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10912
10913         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10914         GetEnumerator method.
10915
10916         (ProbeCollectionType): Iterate starting at the most specific type
10917         upwards looking for a GetEnumerator
10918
10919         * expression.cs: Shift count can be up to 31 for int/uint and 63
10920         for long/ulong.
10921
10922 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10923
10924         * statement.cs (Block.LookupLabel): Also look for the label on the
10925         children blocks.  Use a hash table to keep track of visited
10926         nodes. 
10927
10928         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10929         we actually did transform the other operand, otherwise fall back
10930         to the common codepath that casts to long.
10931
10932         * cs-tokenizer.cs: Use the same code pattern as the int case.
10933         Maybe I should do the parsing myself, and avoid depending on the
10934         Parse routines to get this done.
10935
10936 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10937
10938         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10939         which fixes bug 51347.  This time test it.
10940
10941         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10942         attributes for example can not tell the difference between these.
10943         The difference was only a syntax feature of the language. 
10944
10945         * attribute.cs: Apply attributes to delegates.
10946
10947         * delegate.cs: Call the apply attributes method.
10948
10949 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10950
10951         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10952         comparing 0 vs Byte.MinValue, not the value
10953
10954         (ImplicitConversionRequired): When reporting a conversion error,
10955         use error 31 to print out the constant error instead of the
10956         simpler 29.
10957
10958         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10959         which fixes bug 51347.
10960
10961 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10962
10963         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10964         which fixes the -warnaserror command line option.
10965
10966 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10967
10968         * cfold.cs (DoNumericPromotions): During constant folding of
10969         additions on UIntConstant, special case intconstants with
10970         IntConstants like we do on the expression binary operator. 
10971
10972 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10973
10974         * convert.cs (ImplicitReferenceConversion): We were missing a case
10975         (System.Enum are not value types or class types, so we need to
10976         classify them separatedly).
10977
10978         * driver.cs: We do not support error 2007.
10979
10980 2003-11-12 Jackson Harper <jackson@ximian.com>
10981
10982         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10983         system directory. Also use the full file name so users can
10984         libraries names mscorlib-o-tron.dll in a non system dir.
10985
10986 2003-11-10  Martin Baulig  <martin@ximian.com>
10987
10988         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10989         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10990         calling `ResolveType()' on them, directly assign their `Type'.
10991
10992 2003-11-08  Martin Baulig  <martin@ximian.com>
10993
10994         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10995         return value and the `out parent' parameter.
10996         (TypeContainer.DefineType): Moved the CS0644 check into
10997         GetClassBases().  Don't pass the interface types to the
10998         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10999         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11000
11001         * ecore.cs (TypeExpr.IsAttribute): New property.
11002         (TypeExpr.GetInterfaces): New method.
11003
11004         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11005         TypeExpr instead of a Type.
11006         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11007         (Interface.DefineType): Don't pass the interface types to the
11008         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11009         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11010
11011         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11012         instead of a `Type[]'.
11013         (TypeManager.RegisterBuilder): Likewise.
11014         (TypeManager.AddUserInterface): Likewise.
11015         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11016         `Type[]' and also return a `TypeExpr[]'.
11017         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11018
11019 2003-11-08  Martin Baulig  <martin@ximian.com>
11020
11021         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11022         Expression.     
11023
11024 2003-11-08  Martin Baulig  <martin@ximian.com>
11025
11026         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11027         TypeManager.ResolveExpressionTypes().
11028
11029         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11030         instead of an Expression.
11031         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11032         (TypeExpression): New public class; formerly known as `TypeExpr'.
11033
11034         * expression.cs (ComposedCast): Derive from TypeExpr.
11035
11036         * typemanager.cs (TypeManager.system_*_expr): These are now
11037         TypExpr's instead of Expression's.
11038         (TypeManager.ResolveExpressionTypes): New public static function;
11039         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11040         of them.        
11041
11042 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11043
11044         * expression.cs (New.DoResolve): Do not dereference value that
11045         might be a null return.
11046
11047         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11048         sure that the constant value has the right type.  Fixes an
11049         unreported bug, similar to 50425.
11050
11051         * const.cs (Const.LookupConstantValue): Call
11052         ImplicitStandardConversionExists before doing a conversion to
11053         avoid havng the TypeManager.ChangeType do conversions.
11054
11055         Reduced the number of casts used
11056
11057         (Const.ChangeType): New routine to enable reuse of the constant
11058         type changing code from statement.
11059
11060         * typemanager.cs (ChangeType): Move common initialization to
11061         static global variables.
11062
11063         Fixes #50425.
11064
11065         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11066         every value type to go through, even if it was void.  Fix that. 
11067
11068         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11069         character of the define, and the is_identifier_part_character for
11070         the rest of the string.
11071
11072 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11073
11074         * expression.cs (UnaryMutator.EmitCode): When I updated
11075         LocalVariableReference.DoResolve, I overdid it, and dropped an
11076         optimization done on local variable references.
11077
11078 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11079
11080         * ecore.cs: Convert the return from Ldlen into an int.
11081
11082 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11083
11084         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11085         the accessibility, this is a special case for toplevel non-public
11086         classes (internal for instance).
11087
11088 2003-10-20  Nick Drochak <ndrochak@gol.com>
11089
11090         * ecore.cs: Fix typo and build.  Needed another right paren.
11091
11092 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11093
11094         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11095         `internal' case regular and protected, but not allowing protected
11096         to be evaluated later.  Bug 49840
11097
11098 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11099
11100         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11101         to kb.Nlast, and not the kb.nFirst to isolate the switch
11102         statement.
11103
11104         Extract the underlying type, so enumerations of long/ulong are
11105         treated like long/ulong.
11106
11107 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11108
11109         * expression.cs (New): Overload the meaning of RequestedType to
11110         track the possible creation of the NewDelegate type, since
11111         DoResolve is invoked more than once for new constructors on field
11112         initialization.
11113
11114         See bugs: #48800 and #37014
11115
11116         * cs-parser.jay (declare_local_constants): Take an arraylist
11117         instead of a single constant.
11118
11119         (local_constant_declaration): It should take a
11120         constant_declarators, not a constant_declarator.  Fixes 49487
11121
11122         * convert.cs: Fix error report.
11123
11124 2003-10-13 Jackson Harper <jackson@ximian.com>
11125
11126         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11127         bug #49611
11128
11129 2003-10-09  Martin Baulig  <martin@ximian.com>
11130
11131         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11132         to the .ctor.
11133         (MethodCore.DoDefineParameters): Removed the TypeContainer
11134         argument; use the DeclSpace which was passed to the .ctor instead.
11135         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11136         TypeContainer; we only need a DeclSpace here.
11137
11138 2003-10-09  Martin Baulig  <martin@ximian.com>
11139
11140         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11141         to the .ctor.
11142         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11143         EmitContext's .ctor.    
11144
11145 2003-10-09  Martin Baulig  <martin@ximian.com>
11146
11147         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11148         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11149         AsAccessible(), moved them as well.
11150
11151         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11152
11153 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11154
11155         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11156
11157 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11158
11159         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11160         generation for >=, as spotted by Paolo, bug 48679.  
11161         Patch from David Waite.
11162
11163         * cs-tokenizer.cs: Add handling for #pragma.
11164
11165         * cs-parser.jay: Allow for both yield and yield return in the
11166         syntax.  The anti-cobolization of C# fight will go on!
11167
11168         * class.cs (TypeBuilder.DefineType): Catch error condition here
11169         (Parent.DefineType erroring out and returning null).
11170
11171         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11172         coping with enumerations variables, we were mistakenly processing
11173         them as a regular value type instead of built-in types.  Fixes the
11174         bug #48063
11175
11176         * typemanager.cs (IsBuiltinOrEnum): New method.
11177
11178 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
11179
11180         * cs-parser.jay: Upgrade: yield now needs the return clause.
11181
11182 2003-09-19  Martin Baulig  <martin@ximian.com>
11183
11184         * decl.cs (MemberCache.SetupCacheForInterface): Take a
11185         `MemberCache parent' argument.  Normally, an interface doesn't
11186         have a parent type except System.Object, but we use this in gmcs
11187         for generic type parameters.
11188
11189 2003-09-18  Martin Baulig  <martin@ximian.com>
11190
11191         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11192         on `type.IsInterface'; don't check whether the type has a parent
11193         to determine whether it's an interface.
11194
11195 2003-09-15  Martin Baulig  <martin@ximian.com>
11196
11197         * class.cs (TypeContainer.DefineType): Added an error flag to
11198         avoid reporting duplicate CS0146's ("class definition is
11199         circular.").
11200
11201         * driver.cs (Driver.MainDriver): Abort if
11202         RootContext.ResolveTree() reported any errors.
11203
11204 2003-09-07  Martin Baulig  <martin@ximian.com>
11205
11206         * report.cs (Error, Warning): Added overloaded versions which take
11207         a `params object[] args' and call String.Format().
11208
11209 2003-09-07  Martin Baulig  <martin@ximian.com>
11210
11211         * decl.cs (DeclSpace..ctor): Don't call
11212         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11213         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11214         (DeclSpace.RecordDecl): New method.
11215
11216         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11217
11218 2003-09-02  Ravi Pratap  <ravi@ximian.com>
11219
11220         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11221         value attributes to be applied to ParameterBuilders.
11222
11223         * class.cs (MethodCore.LabelParameters): Make static and more
11224         generic so that it can be used from other places - like interface
11225         methods, for instance.
11226
11227         * interface.cs (Interface.Emit): Call LabelParameters before
11228         emitting attributes on the InterfaceMethod.
11229
11230 2003-08-26  Martin Baulig  <martin@ximian.com>
11231
11232         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11233         resolving aliases; fixes #47927.
11234
11235 2003-08-26  Martin Baulig  <martin@ximian.com>
11236
11237         * statement.cs (Using.DoResolve): This is internally emitting a
11238         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11239         do not always return.  Fixes #47681.
11240
11241 2003-08-26  Martin Baulig  <martin@ximian.com>
11242
11243         * decl.cs (MemberCore): Moved WarningNotHiding(),
11244         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11245         into MemberBase.
11246         (AdditionResult): Make this nested in DeclSpace.
11247         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11248         argument; call NamespaceEntry.Define() unless we're nested in a
11249         class or struct.
11250
11251         * namespace.cs (Namespace.DefineName): New public function.  This
11252         is called from DeclSpace's .ctor to add 
11253         (Namespace.Lookup): Include DeclSpaces in the lookup.
11254
11255         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11256
11257         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11258
11259 2003-08-25  Martin Baulig  <martin@ximian.com>
11260
11261         * convert.cs (Convert.ExplicitReferenceConversion): When
11262         converting from an interface type to a class, unbox if the target
11263         type is a struct type.  Fixes #47822.
11264
11265 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11266
11267         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11268         #47854.
11269
11270 2003-08-22  Martin Baulig  <martin@ximian.com>
11271
11272         * class.cs (TypeManager.DefineType): When defining a nested type,
11273         call DefineType() on our parent; fixes #47801.
11274
11275 2003-08-22  Martin Baulig  <martin@ximian.com>
11276
11277         * class.cs (MethodData.Define): While checking if a method is an
11278         interface implementation, improve the test a bit more to fix #47654.
11279
11280 2003-08-22  Martin Baulig  <martin@ximian.com>
11281
11282         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11283         correctly; fixes #47722.
11284
11285 2003-08-22  Martin Baulig  <martin@ximian.com>
11286
11287         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11288         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11289
11290         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11291
11292 2003-08-22  Martin Baulig  <martin@ximian.com>
11293
11294         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11295         can only be assigned in static constructors.  Fixes #47161.
11296
11297 2003-08-22  Martin Baulig  <martin@ximian.com>
11298
11299         Rewrote and improved the flow analysis code.
11300
11301         * flowbranching.cs (FlowBranching): Make this class abstract.
11302         (FlowBranching.CreateBranching): New static function to create a
11303         new flow branching.
11304         (FlowBranchingBlock, FlowBranchingException): New classes.
11305         (FlowBranching.UsageVector.Type): New public readonly field.
11306         (FlowBranching.UsageVector.Breaks): Removed the setter.
11307         (FlowBranching.UsageVector.Returns): Removed the setter.
11308         (FlowBranching.UsageVector): Added Break(), Return(),
11309         NeverReachable() and Throw() methods to modify the reachability.
11310         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11311         done by FlowBranching.Merge().
11312         (FlowBranching.UsageVector.MergeChild): New method; merges the
11313         merge result into the current vector.
11314         (FlowBranching.Merge): New abstract method to merge a branching.
11315
11316 2003-08-12  Martin Baulig  <martin@ximian.com>
11317
11318         * expression.cs (Indirection.CacheTemporaries): Create the
11319         LocalTemporary with the pointer type, not its element type.
11320
11321 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11322
11323         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11324         token was a keyword or not.
11325
11326         Add `error' options where an IDENTIFIER was expected;  Provide
11327         CheckToken and CheckIdentifierToken convenience error reporting
11328         functions. 
11329
11330         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11331
11332         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11333         NameSpaceEntry NameSpaceEntry.
11334
11335         (LookupInterfaceOrClass): Avoid creating a full qualified name
11336         from namespace and name: avoid doing lookups when we know the
11337         namespace is non-existant.   Use new Tree.LookupByNamespace which
11338         looks up DeclSpaces based on their namespace, name pair.
11339
11340         * driver.cs: Provide a new `parser verbose' to display the
11341         exception thrown during parsing.  This is turned off by default
11342         now, so the output of a failure from mcs is more graceful.
11343
11344         * namespace.cs: Track all the namespaces defined in a hashtable
11345         for quick lookup.
11346
11347         (IsNamespace): New method
11348
11349 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11350
11351         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11352         we know that we need to concatenate (full typename can never be
11353         null). 
11354
11355         * class.cs: ditto.
11356
11357         * statement.cs: Use a bitfield;  Do not initialize to null things
11358         which are done by the constructor by default.
11359
11360         * cs-parser.jay: bug fix, parameter was 4, not 3.
11361
11362         * expression.cs: Just use the property;
11363
11364         * statement.cs: No need for GetVariableInfo method.
11365
11366 2003-08-08  Martin Baulig  <martin@ximian.com>
11367
11368         * flowanalysis.cs (FlowReturns): This is now nested in the
11369         `FlowBranching' class.
11370         (MyBitVector): Moved this here from statement.cs.
11371         (FlowBranching.SiblingType): New enum type.
11372         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11373
11374 2003-08-07  Martin Baulig  <martin@ximian.com>
11375
11376         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11377         `FlowBranching' class and called `BranchingType'.
11378
11379 2003-08-07  Martin Baulig  <martin@ximian.com>
11380
11381         * flowanalysis.cs: Moved all the control flow analysis code into
11382         its own file.
11383
11384 2003-08-07  Martin Baulig  <martin@ximian.com>
11385
11386         * assign.cs (Assign.DoResolve): `target' must either be an
11387         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11388         #37319.
11389
11390 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11391
11392         * expression.cs (BinaryMethod): This kind of expression is created by the
11393         Binary class if it determines that the operator has to be handled
11394         by a method.
11395
11396         (BinaryDelegate): This kind of expression is created if we are
11397         dealing with a + or - operator on delegates.
11398
11399         (Binary): remove method, argumetns, and DelegateOperator: when
11400         dealing with methods, 
11401
11402         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11403
11404         * statement.cs (Block): use bitfields for the three extra booleans
11405         we had in use.   Remove unused topblock parameter.
11406
11407         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11408
11409         * assign.cs: Drop extra unneeded tests.
11410
11411 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11412
11413         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11414
11415         * statement.cs (Foreach): Use VariableStorage instead of
11416         LocalBuilders.   
11417
11418         * codegen.cs (VariableStorage): New class used by clients that
11419         require a variable stored: locals or fields for variables that
11420         need to live across yield.
11421
11422         Maybe provide a convenience api for EmitThis+EmitLoad?
11423
11424         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11425         these bad boys.
11426
11427 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11428
11429         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11430         RemapParameterLValue): New methods that are used to turn a
11431         precomputed FieldInfo into an expression like this:
11432
11433                 instance.FieldInfo
11434
11435         The idea is to use this instead of making LocalVariableReference
11436         have more than one meaning.
11437
11438         * cs-parser.jay: Add error production to BASE.
11439
11440         * ecore.cs: Deal with TypeManager.GetField returning null, which
11441         is now a valid return value.
11442
11443         (FieldExprNoAddress): New expression for Fields whose address can
11444         not be taken.
11445
11446         * expression.cs (LocalVariableReference): During the resolve
11447         phases, create new expressions if we are in a remapping context.
11448         Remove code that dealt with remapping here.
11449
11450         (ParameterReference): same.
11451
11452         (ProxyInstance): New expression, like the `This' expression, but
11453         it is born fully resolved.  We know what we are doing, so remove
11454         the errors that are targeted to user-provided uses of `this'.
11455
11456         * statement.cs (Foreach): our variable is now stored as an
11457         Expression;  During resolution, follow the protocol, dont just
11458         assume it will return this.
11459
11460 2003-08-06  Martin Baulig  <martin@ximian.com>
11461
11462         * support.cs (SeekableStreamReader.cs): New public class.
11463
11464         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11465         SeekableStreamReader instead of the normal StreamReader.
11466
11467 2003-08-04  Martin Baulig  <martin@ximian.com>
11468
11469         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11470         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11471         deambiguate casts and delegate invocations.
11472         (parenthesized_expression): Use the new tokens to ensure this is
11473         not a cast of method invocation.
11474
11475         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11476         when reading a `)' and Deambiguate_CloseParens () was previously
11477         called.
11478
11479         * expression.cs (ParenthesizedExpression): New class.  This is
11480         just used for the CS0075 test.
11481         (Binary.DoResolve): Check for CS0075.   
11482
11483 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11484
11485         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11486         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11487         reference comparison.
11488
11489         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11490         examine the ReturnType for equality - this is necessary in the
11491         cases of implicit and explicit operators whose signature also
11492         includes the return type.
11493
11494 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11495
11496         * namespace.cs: Cache the result of the namespace computation,
11497         instead of computing it every time.
11498
11499 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11500
11501         * decl.cs: Use a global arraylist that we reuse over invocations
11502         to avoid excesive memory consumption.  Reduces memory usage on an
11503         mcs compile by one meg (45 average).
11504
11505         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11506         private, work around that.
11507
11508 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11509
11510         * literal.cs (IntLiteral): Define Zero and One static literals. 
11511
11512         * cs-parser.jay (integer_literal): use static literals to reduce
11513         memory usage for the most used literals (0, 1 and -1).  211kb
11514         reduced in memory usage.
11515
11516         Replace all calls to `new ArrayList' with `new
11517         ArrayList(4)' which is a good average number for most allocations,
11518         and also requires only 16 bytes of memory for its buffer by
11519         default. 
11520
11521         This reduced MCS memory usage in seven megabytes for the RSS after
11522         bootstrapping.
11523
11524 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11525
11526         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11527         handle params methods the correct way by forming only one
11528         applicable set with params and normal methods in them. Earlier we
11529         were looking at params methods only if we found no normal methods
11530         which was not the correct thing to do.
11531
11532         (Invocation.BetterFunction): Take separate arguments indicating
11533         when candidate and the best method are params methods in their
11534         expanded form.
11535
11536         This fixes bugs #43367 and #46199.
11537
11538         * attribute.cs: Documentation updates.
11539
11540         (CheckAttribute): Rename to CheckAttributeTarget.
11541         (GetValidPlaces): Rename to GetValidTargets.
11542
11543         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11544         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11545
11546         Fixes bug #44468.
11547
11548 2003-07-28  Martin Baulig  <martin@ximian.com>
11549
11550         * class.cs (TypeContainer.DefineMembers): Use the base type's full
11551         name when looking up the base class of a nested class.  Fixes #46977.
11552
11553 2003-07-26  Martin Baulig  <martin@ximian.com>
11554
11555         * expression.cs (Indexers.Indexer): New nested struct; contains
11556         getter, setter and the indexer's type.
11557         (Indexers.Properties): This is now an ArrayList of
11558         Indexers.Indexer's.
11559         (IndexerAccess.DoResolveLValue): Correctly set the type if the
11560         indexer doesn't have any getters.
11561
11562         * assign.cs (Assign.DoResolve): Also do the implicit conversions
11563         for embedded property and indexer assignments.
11564
11565 2003-07-26  Martin Baulig  <martin@ximian.com>
11566
11567         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11568         preprocessor directive is not the first non-whitespace character
11569         on a line.
11570
11571 2003-07-26  Martin Baulig  <martin@ximian.com>
11572
11573         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11574         namespace parsing, follow the spec more closely.
11575
11576         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11577         NamespaceEntry.Lookup().
11578
11579 2003-07-25  Martin Baulig  <martin@ximian.com>
11580
11581         * MethodCore.cs (OverridesSomething): New public field; it's set
11582         from TypeContainer.DefineMembers if this method overrides
11583         something (which doesn't need to be a method).  Fix #39462.
11584
11585 2003-07-25  Ravi Pratap  <ravi@ximian.com>
11586
11587         * typemanager.cs (GetMembers): Ensure that the list of members is
11588         reversed. This keeps things in sync.
11589
11590         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11591         find an AttributeUsage attribute.
11592
11593         * expression.cs (Invocation.OverloadResolve): Perform the check
11594         which disallows Invoke to be directly called on a Delegate.
11595
11596         (Error_InvokeOnDelegate): Report error cs1533.
11597
11598 2003-07-25  Martin Baulig  <martin@ximian.com>
11599
11600         * expression.cs (Indexers.GetIndexersForType): Only look in the
11601         interface hierarchy if the requested type is already an
11602         interface.  Fixes #46788 while keeping #46502 fixed.
11603
11604 2003-07-25  Martin Baulig  <martin@ximian.com>
11605
11606         * class.cs (TypeContainer.DefineMembers): Check whether all
11607         readonly fields have been assigned and report warning CS0649 if
11608         not.
11609
11610         * statement.cs (LocalInfo.IsFixed): Always return true if this is
11611         a valuetype.
11612
11613 2003-07-24  Ravi Pratap  <ravi@ximian.com>
11614
11615         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11616         returned from GetMethods to make things consistent with the
11617         assumptions MCS makes about ordering of methods.
11618
11619         This should comprehensively fix bug #45127 and it does :-)
11620
11621         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11622         ordering is actually reverse.
11623
11624         * Clean up some debug messages I left lying around.
11625
11626         * interface.cs (Populate*): Get rid of code which emits attributes
11627         since the stage in which we emit attributes is the 'Emit' stage,
11628         not the define stage.
11629
11630         (Emit): Move attribute emission for interface members here.
11631
11632 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11633
11634         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11635         closely: we eliminate methods in base types when we have an
11636         applicable method in a top-level type.
11637
11638         Please see section 14.5.5.1 for an exact description of what goes
11639         on. 
11640
11641         This fixes bug #45127 and a host of other related to corlib compilation.
11642
11643         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11644         array is the method corresponding to the top-level type (this is
11645         because of the changes made to icall.c) so we change this
11646         accordingly.
11647
11648         (MethodGroupExpr.Name): This too.
11649
11650         * typemanager.cs (GetElementType): New method which does the right
11651         thing when compiling corlib. 
11652
11653         * everywhere: Make use of the above in the relevant places.
11654
11655 2003-07-22  Martin Baulig  <martin@ximian.com>
11656
11657         * cs-parser.jay (invocation_expression): Moved
11658         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11659         `cast_expression', but create a InvocationOrCast which later
11660         resolves to either an Invocation or a Cast.
11661
11662         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11663         method; call this before EmitStatement() to make sure that this
11664         expression can be used as a statement.
11665
11666         * expression.cs (InvocationOrCast): New class; resolves to either
11667         an Invocation or a Cast.
11668
11669         * statement.cs (StatementExpression): Call ResolveStatement() on
11670         the ExpressionStatement before emitting it.
11671
11672 2003-07-21  Martin Baulig  <martin@ximian.com>
11673
11674         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11675         `ref' and `out' attributes match; fixes #46220.
11676         (MemberAccess.ResolveMemberAccess): You can't reference a type
11677         through an expression; fixes #33180.
11678         (Indexers.GetIndexersForType): Don't return the indexers from
11679         interfaces the class implements; fixes #46502.
11680
11681 2003-07-21  Martin Baulig  <martin@ximian.com>
11682
11683         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11684         CS0661 checks; fixes bug #30442.
11685
11686 2003-07-21  Martin Baulig  <martin@ximian.com>
11687
11688         * decl.cs (AdditionResult): Added `Error'.
11689
11690         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11691
11692         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11693         makes cs0031.cs actually work.
11694
11695 2003-07-20  Martin Baulig  <martin@ximian.com>
11696
11697         * namespace.cs: Fixed that bug which caused a crash when compiling
11698         the debugger's GUI.
11699
11700 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11701
11702         * typemanager.cs (LookupTypeReflection): Never expose types which
11703         are NotPublic, NestedPrivate, NestedAssembly, or
11704         NestedFamANDAssem.  We used to return these, and later do a check
11705         that would report a meaningful error, but the problem is that we
11706         would not get the real match, if there was a name override.
11707
11708 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11709
11710         * namespace.cs (Namespace, Name): Do not compute the namespace
11711         name dynamically, compute it in the constructor.  This reduced
11712         memory usage by 1697 KB.
11713
11714         * driver.cs: Use --pause to pause at the end.
11715
11716 2003-07-17  Peter Williams  <peter@newton.cx>
11717
11718         * Makefile: Change the name of the test target so that it doesn't
11719         conflict with the recursive test target.
11720
11721 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11722
11723         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11724         AddressOf): Do not use EmitThis, that was wrong, use the actual
11725         this pointer.
11726
11727 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11728
11729         * class.cs (MethodData.Define): While checking if a method is an
11730         interface implementation, improve the test: If we are not public
11731         (use new test here: use the computed MethodAttributes directly,
11732         instead of the parsed modifier flags) check if the `implementing'
11733         method comes from an interface or not.
11734
11735         * pending.cs (VerifyPendingMethods): Slightly better error
11736         message.
11737
11738         * makefile: add test target that does the mcs bootstrap.
11739
11740 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11741
11742         * interface.cs (Define): Do nothing here since there are no
11743         members to populate etc. Move the attribute emission out of here
11744         since this was just totally the wrong place to put it. Attribute
11745         application happens during the 'Emit' phase, not in the 'Define'
11746         phase.
11747
11748         (Emit): Add this method and move the attribute emission here
11749
11750         * rootcontext.cs (EmitCode): Call the Emit method on interface
11751         types too.
11752
11753 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11754
11755         * expression.cs (OverloadResolve): Report error only if Location
11756         is not 'Null' which means that there was a probe going on.
11757
11758 2003-07-14  Martin Baulig  <martin@ximian.com>
11759
11760         * expression.cs (ConditionalLogicalOperator): New public class to
11761         implement user defined conditional logical operators.
11762         This is section 14.11.2 in the spec and bug #40505.
11763
11764 2003-07-14  Martin Baulig  <martin@ximian.com>
11765
11766         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11767
11768 2003-07-14  Martin Baulig  <martin@ximian.com>
11769
11770         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11771
11772         * ecore.cs (IVariable.VerifyFixed): New interface method.
11773
11774         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11775         operator, check whether the variable is actually fixed.  Fixes bug
11776         #36055.  Set a variable definitely assigned when taking its
11777         address as required by the spec.
11778
11779         * statement.cs (LocalInfo.IsFixed): New field.
11780         (LocalInfo.MakePinned): Set `IsFixed' to true.
11781
11782 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11783
11784         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11785         for .ctors, ensure that we only ask for members declared in the
11786         attribute type (BindingFlags.DeclaredOnly).
11787
11788         Fixes bug #43632.
11789
11790         * expression.cs (Error_WrongNumArguments): Report error 1501
11791         correctly the way CSC does.
11792
11793 2003-07-13  Martin Baulig  <martin@ximian.com>
11794
11795         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11796         lookup on the fully qualified name, to make things like "X.X" work
11797         where "X.X" is a fully qualified type name, but we also have a
11798         namespace "X" in the using list.  Fixes #41975.
11799
11800 2003-07-13  Martin Baulig  <martin@ximian.com>
11801
11802         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11803         function. If we're a CompoundAssign, we need to create an embedded
11804         CompoundAssign, not an embedded Assign.
11805         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11806         Fixes #45854.
11807
11808 2003-07-13  Martin Baulig  <martin@ximian.com>
11809
11810         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11811         work to fix bug #46088.
11812
11813 2003-07-13  Ravi Pratap <ravi@ximian.com>
11814
11815         * class.cs (Operator.Emit): Do not emit attributes here - it is
11816         taken care of by the Method class that we delegate too. This takes
11817         care of bug #45876.
11818
11819 2003-07-10  Martin Baulig  <martin@ximian.com>
11820
11821         * expression.cs (TypeOfVoid): New class.
11822         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11823
11824 2003-07-10  Martin Baulig  <martin@ximian.com>
11825
11826         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11827         bug #35957.
11828
11829 2003-07-10  Martin Baulig  <martin@ximian.com>
11830
11831         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11832         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11833
11834         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11835
11836         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11837
11838 2003-07-10  Martin Baulig  <martin@ximian.com>
11839
11840         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11841         of decimal.  Fixes #42850.
11842
11843         NOTE: I also fixed the created byte blob, but this doesn't work on
11844         the MS runtime and csc never produces any byte blobs for decimal
11845         arrays.
11846
11847 2003-07-10  Martin Baulig  <martin@ximian.com>
11848
11849         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11850         structs; fixes #32068.
11851         (Block.AddChildVariableNames): Fixed #44302.
11852
11853 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11854
11855         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11856
11857 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11858
11859         * attribute.cs: And this test is onger needed.
11860
11861 2003-07-08  Martin Baulig  <martin@ximian.com>
11862
11863         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11864         inaccessible types.  Fixes #36313.
11865
11866         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11867
11868         * namespace.cs (NamespaceEntry): Create implicit entries for all
11869         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11870         implicit entries for N1.N2 and N1.
11871
11872 2003-07-08  Martin Baulig  <martin@ximian.com>
11873
11874         Rewrote the handling of namespaces to fix a lot of the issues
11875         wrt. `using' aliases etc.
11876
11877         * namespace.cs (Namespace): Splitted this class into a
11878         per-assembly `Namespace' and a per-file `NamespaceEntry'.
11879
11880         * typemanager.cs (TypeManager.IsNamespace): Removed.
11881         (TypeManager.ComputeNamespaces): Only compute namespaces from
11882         loaded assemblies here, not the namespaces from the assembly we're
11883         currently compiling.
11884
11885 2003-07-08  Martin Baulig  <martin@ximian.com>
11886
11887         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11888
11889 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11892         already fixed it.  
11893
11894         I thought about the memory savings here, but LookupTypeReflection
11895         is used under already very constrained scenarios.  Compiling
11896         corlib or mcs only exposes one hit, so it would not really reduce
11897         any memory consumption.
11898
11899 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11900
11901         * typemanager.cs: fixes bug #45889 by only adding public types from
11902         other assemblies to the list of known types.
11903
11904 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11905
11906         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11907         on the type we resolved.
11908
11909 2003-07-05  Martin Baulig  <martin@ximian.com>
11910
11911         * pending.cs (PendingImplementation.ParentImplements): Don't
11912         create the proxy if the parent is abstract.
11913
11914         * class.cs (TypeContainer.DefineIndexers): Process explicit
11915         interface implementations first.  Fixes #37714.
11916
11917 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
11918
11919         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11920         defined recursively;  but since we modify the input parameters
11921         (left is set to `this' temporarily), we reset this value if the
11922         left_is_explicit is false, which gives the original semantics to
11923         the code.  
11924
11925         * literal.cs (NullPointer): new class used to represent a null
11926         literal in a pointer context.
11927
11928         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11929         type is a pointer, use a NullPointer object instead of a
11930         NullLiteral.   Closes 43687
11931
11932         (ExplicitConversion): Convert pointer values using
11933         the conv opcode to the proper type.
11934
11935         * ecore.cs (New): change ValueTypeVariable property into a method,
11936         that returns whether the valuetype is suitable for being used.
11937
11938         * expression.cs (Binary.DoNumericPromotions): Only return if we
11939         the int constant was a valid uint, and we can return both left and
11940         right as uints.  If not, we continue processing, to trigger the
11941         type conversion.  This fixes 39018.
11942
11943         * statement.cs (Block.EmitMeta): During constant resolution, set
11944         the CurrentBlock property on the emitcontext, so that we resolve
11945         constants propertly.
11946
11947 2003-07-02  Martin Baulig  <martin@ximian.com>
11948
11949         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11950         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11951
11952         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11953         than emitting it here.
11954
11955         * statement.cs: Fixed some more flow analysis bugs.
11956
11957 2003-07-02  Martin Baulig  <martin@ximian.com>
11958
11959         * class.cs (MethodData.Define): When implementing interface
11960         methods, set Final unless we're Virtual.
11961
11962         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11963         check work for interface methods.
11964
11965 2003-07-01  Martin Baulig  <martin@ximian.com>
11966
11967         * ecore.cs (EmitContext.This): Replaced this property with a
11968         GetThis() method which takes a Location argument.  This ensures
11969         that we get the correct error location for a CS0188.
11970
11971 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
11972
11973         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11974         ImplicitStandardConversion.
11975
11976         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11977
11978 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
11979
11980         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11981         optimization.
11982
11983 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
11984
11985         * class.cs (Constructor.Define): Turn off initlocals for unsafe
11986         constructors.
11987
11988         (MethodData.Define): Turn off initlocals for unsafe methods.
11989
11990 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
11991
11992         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11993         complete;  Fixes #37521.
11994
11995         * delegate.cs: Use Modifiers.TypeAttr to compute the
11996         TypeAttributes, instead of rolling our own.  This makes the flags
11997         correct for the delegates.
11998
11999 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12000
12001         * class.cs (Constructor.Define): Set the private flag for static
12002         constructors as well.
12003
12004         * cs-parser.jay (statement_expression): Set the return value to
12005         null, to avoid a crash when we catch an error.
12006
12007 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12008
12009         * cs-parser.jay: Applied patch from Jackson that adds support for
12010         extern and unsafe modifiers to destructor declarations.
12011
12012         * expression.cs: Report error 21 if the user is trying to index a
12013         System.Array.
12014
12015         * driver.cs: Add an error message, suggested by the bug report.
12016
12017         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12018         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12019
12020 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12021
12022         * namespace.cs: Add some information to reduce FAQs.
12023
12024 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12025
12026         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12027         underlying enumeration types.  Fixes #43915.
12028
12029         * expression.cs: Treat ushort/short as legal values to be used in
12030         bitwise operations.
12031
12032 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12033
12034         * delegate.cs: transfer custom attributes for paramenters from
12035         the delegate declaration to Invoke and BeginInvoke.
12036
12037 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12038
12039         * attribute.cs: handle custom marshalers and emit marshal info
12040         for fields, too.
12041
12042 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12043
12044         * makefile.gnu: Added anonymous.cs to the compiler sources.
12045
12046 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12047
12048         * iterators.cs: Change the name of the proxy class to include two
12049         underscores.
12050
12051         * cs-parser.jay: Update grammar to include anonymous methods.
12052
12053         * anonymous.cs: new file.
12054
12055 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12056
12057         * class.cs (Field.Define): Add missing test for pointers and
12058         safety. 
12059
12060 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12061
12062         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12063         we use the stobj opcode.
12064
12065         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12066         since it wasn't the correct fix. 
12067
12068         It still is puzzling that we are required to use stobj for IntPtr
12069         which seems to be a ValueType.
12070
12071 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12072
12073         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12074         during regular simple name resolution.   Now, the trick is that
12075         instead of returning for processing the simplename, we do a
12076         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12077         contextual lookup type).   If a match is found, return that, if
12078         not, return for further composition.
12079
12080         This fixes long-standing 30485.
12081
12082         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12083         using the address to initialize an object, do an Stobj instead of
12084         using the regular Stelem.
12085
12086         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12087         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12088         Because if we are a BaseIndexerAccess that value will be true.
12089         Fixes 43643.
12090
12091         * statement.cs (GotoCase.Resolve): Return after reporting an
12092         error, do not attempt to continue. 
12093
12094         * expression.cs (PointerArithmetic.Emit): If our operand is a
12095         long, convert our constants to match the operand before
12096         multiplying.  Convert to I type before adding.   Fixes 43670.
12097
12098 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12099
12100         * enum.cs (ImplicitConversionExists) : Rename to
12101         ImplicitEnumConversionExists to remove ambiguity. 
12102
12103         * ecore.cs (NullCast): New type of cast expression class which
12104         basically is very similar to EmptyCast with the difference being
12105         it still is a constant since it is used only to cast a null to
12106         something else
12107         (eg. (string) null)
12108
12109         * convert.cs (ImplicitReferenceConversion): When casting a null
12110         literal, we return a NullCast.
12111
12112         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12113         should be around anymore.
12114
12115         The renaming (reported was slightly wrong). Corrections:
12116
12117         ConvertImplicitStandard -> ImplicitConversionStandard
12118         ConvertExplicitStandard -> ExplicitConversionStandard
12119
12120         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12121         before passing them in !
12122
12123         * convert.cs (ImplicitConversionStandard): When comparing for
12124         equal expr and target types, ensure that expr is not a
12125         NullLiteral.
12126
12127         In general, we must not be checking (expr_type ==
12128         target_type) in the top level conversion methods
12129         (ImplicitConversion, ExplicitConversion etc). This checking is
12130         done in the methods that they delegate to.
12131
12132 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12133
12134         * convert.cs: Move Error_CannotConvertType,
12135         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12136         ImplicitNumericConversion, ImplicitConversionExists,
12137         ImplicitUserConversionExists, StandardConversionExists,
12138         FindMostEncompassedType, FindMostSpecificSource,
12139         FindMostSpecificTarget, ImplicitUserConversion,
12140         ExplicitUserConversion, GetConversionOperators,
12141         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12142         TryImplicitIntConversion, Error_CannotConvertImplicit,
12143         ConvertImplicitRequired, ConvertNumericExplicit,
12144         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12145         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12146         its own file.
12147
12148         Perform the following renames:
12149
12150         StandardConversionExists -> ImplicitStandardConversionExists
12151         ConvertImplicit -> ImplicitConversion
12152         ConvertImplicitStandard -> ImplicitStandardConversion
12153         TryImplicitIntConversion -> ImplicitIntConversion
12154         ConvertImplicitRequired -> ImplicitConversionRequired
12155         ConvertNumericExplicit -> ExplicitNumericConversion
12156         ConvertReferenceExplicit -> ExplicitReferenceConversion
12157         ConvertExplicit -> ExplicitConversion
12158         ConvertExplicitStandard -> ExplicitStandardConversion
12159
12160 2003-05-19  Martin Baulig  <martin@ximian.com>
12161
12162         * statement.cs (TypeInfo.StructInfo): Made this type protected.
12163         (TypeInfo): Added support for structs having structs as fields.
12164
12165         * ecore.cs (FieldExpr): Implement IVariable.
12166         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12167         VariableInfo for the field.
12168
12169 2003-05-18  Martin Baulig  <martin@ximian.com>
12170
12171         * expression.cs (This.DoResolve): Report a CS0027 if we're
12172         emitting a field initializer.
12173
12174 2003-05-18  Martin Baulig  <martin@ximian.com>
12175
12176         * expression.cs (This.ResolveBase): New public function.
12177         (This.DoResolve): Check for CS0188.
12178
12179         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12180         This.Resolve().
12181
12182         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12183         `instance_expression' to null if we don't have any non-static
12184         methods.
12185
12186 2003-05-18  Martin Baulig  <martin@ximian.com>
12187
12188         Reworked the way how local variables and parameters are handled by
12189         the flow analysis code.
12190
12191         * statement.cs (TypeInfo, VariableMap): New public classes.
12192         (VariableInfo): New public class.  This is now responsible for
12193         checking whether a variable has been assigned.  It is used for
12194         parameters and local variables.
12195         (Block.EmitMeta): Take the InternalParameters as argument; compute
12196         the layout of the flow vectors here.
12197         (Block.LocalMap, Block.ParameterMap): New public properties.
12198         (FlowBranching): The .ctor doesn't get the InternalParameters
12199         anymore since Block.EmitMeta() now computes the layout of the flow
12200         vector.
12201         (MyStructInfo): This class is now known as `StructInfo' and nested
12202         in `TypeInfo'; we don't access this directly anymore.
12203
12204         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12205         property and removed IsAssigned(), IsFieldAssigned(),
12206         SetAssigned() and SetFieldAssigned(); we now call them on the
12207         VariableInfo so we don't need to duplicate this code everywhere.
12208
12209         * expression.cs (ParameterReference): Added `Block block' argument
12210         to the .ctor.
12211         (LocalVariableReference, ParameterReference, This): The new
12212         VariableInfo class is now responsible for all the definite
12213         assignment stuff.
12214
12215         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12216         IsParameterAssigned, SetParameterAssigned): Removed.
12217
12218 2003-05-18  Martin Baulig  <martin@ximian.com>
12219
12220         * typemanager.cs (InitCoreTypes): Try calling
12221         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12222         the 3-args-version.  Corlib now also needs our `void_type'.
12223         (GetMethod): Added overloaded version which takes an optional
12224         `bool report_errors' to allow lookups of optional methods.
12225
12226 2003-05-12  Martin Baulig  <martin@ximian.com>
12227
12228         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12229         only used for locals and not for parameters.
12230
12231 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12232
12233         * support.cs (InternalParameters.ParameterType): Return the
12234         ExternalType of the parameter.
12235
12236         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12237         they were unused.
12238
12239 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12240
12241         * class.cs (MethodData.Define): Do not set the `newslot' on
12242         interface members, if they are also flagged as "override".
12243
12244         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12245         better code for ++i and i++.  This only works for static fields
12246         and local variables.
12247
12248         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12249         want to pull the DeclSpace out of the builder_to_declspace instead
12250         of the TypeBuilder (like in TypeContainer.FindMembers).
12251
12252         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12253         instead of LookupTypeContainer.  Fixes the crash on .NET for
12254         looking up interface members.
12255
12256         * const.cs: Create our own emit context during the Definition
12257         stage, so that constants are evaluated in the proper context, when
12258         a recursive definition happens.
12259
12260 2003-05-11  Martin Baulig  <martin@ximian.com>
12261
12262         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12263         new block for a switch section.
12264         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12265         the adding/lookup in the switch block.  Fixes #39828.
12266
12267 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12268
12269         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12270         functionality: I needed to convert the data after I had performed
12271         the add/sub operation into the operands type size.
12272
12273         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12274         pass the type for the box operation, otherwise the resulting
12275         object would have been of type object.
12276
12277         (BoxedCast): Add constructor to specify the type to box as.
12278
12279 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12280
12281         * iterators.cs: I was reusing the `count' variable inadvertently,
12282         take steps to not allow this to happen.
12283
12284 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12285
12286         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12287         by creating an array at the point where the params starts and
12288         putting all those arguments there, then adjusting the size of the
12289         array.
12290
12291 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12292
12293         * expression.cs (New.AddressOf): Implement interface
12294         IMemoryLocation.  This is used when the `new' operator is used in
12295         the context of an invocation to a method on a value type.
12296
12297         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12298         example. 
12299
12300         * namespace.cs: Also check the using aliases here.
12301
12302         * driver.cs: Move the test for using validity after the types have
12303         been entered, so we do a single pass that also includes the using
12304         aliases. 
12305
12306         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12307         in the regular case.   CreateSiblingForFinally is doing extra
12308         error checking.
12309
12310         * attribute.cs (GetAttributeArgumentExpression): Store the result
12311         on an out value, and use the return value to indicate failure
12312         instead of using null (which is a valid return for Constant.GetValue).
12313
12314         * statement.cs: Perform the analysis flow for the increment
12315         portion after the statement, because this will be the real flow of
12316         execution.  Fixes #42385
12317
12318         * codegen.cs (EmitContext.EmitArgument,
12319         EmitContext.EmitStoreArgument): New helper functions when the
12320         RemapToProxy flag is set.
12321
12322         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12323         function.
12324
12325         Add support for remapping parameters. 
12326
12327         * iterators.cs: Propagate parameter values;  Store parameter
12328         values in the proxy classes.
12329
12330 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12331
12332         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12333         need a proxy reference;  I do not know what I was thinking
12334
12335         * cs-parser.jay (constructor_initializer): catch another error,
12336         and display nice message.
12337
12338         (field_declaration): catch void field declaration
12339         to flag a better error. 
12340
12341         * class.cs (MemberBase.CheckBase): Report an error instead of a
12342         warning if a new protected member is declared in a struct. 
12343         (Field.Define): catch the error of readonly/volatile.
12344
12345         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12346
12347         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12348         volatile variable is taken
12349
12350 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12351
12352         * statement.cs (Fixed.Resolve): Report an error if we are not in
12353         an unsafe context.
12354
12355 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12356
12357         * typemanager.cs: reuse the code that handles type clashes for
12358         delegates and enumerations.
12359
12360         * class.cs (Report28): Always report.
12361
12362         * expression.cs (EncodeAsAttribute): Allow nulls here.
12363
12364 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12365
12366         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12367         the functionality for testing whether an expression is valid for
12368         an attribute here.  Also handle the case of arrays of elements
12369         being stored. 
12370
12371         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12372         encoding a linear array into an array of objects that are suitable
12373         to be passed to an CustomAttributeBuilder.
12374
12375         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12376
12377         * ecore.cs: (FieldExpr): Handle field remapping here.
12378
12379         * iteratators.cs: Pass the instance variable (if the method is an
12380         instance method) to the constructors, so we can access the field
12381         variables on the class.
12382
12383         TODO: Test this with structs.  I think the THIS variable on
12384         structs might have to be a pointer, and not a refenrece
12385
12386 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12387
12388         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12389         local variables to fields in a proxy class.
12390
12391         * iterators.cs (PopulateProxy): Rename our internal fields to
12392         <XXX>.  
12393         Create a <THIS> field if we are an instance method, so we can
12394         reference our parent container variables.
12395         (MapVariable): Called back from the EmitContext code to enter a
12396         new variable to field mapping into the proxy class (we just create
12397         a FieldBuilder).
12398
12399         * expression.cs
12400         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12401         for using the remapped locals to fields.
12402
12403         I placed the code here, because that gives the same semantics to
12404         local variables, and only changes the Emit code.
12405
12406         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12407         statements inside iterators.
12408         (VariableInfo): Add a FieldBuilder for the cases when we are
12409         remapping local variables to fields in a proxy class
12410
12411         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12412         current_block != null.
12413
12414         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12415         not cope with strings, as it has been moved to the
12416         TableSwitchEmit.  Fixed bug in switch generation.
12417
12418         * expression.cs (New.DoResolve): Provide more context for the user
12419         when reporting an error.
12420
12421         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12422         pointers. 
12423
12424         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12425         check the permissions for it.  Note than in a type-resolution
12426         context the check was already present in DeclSpace.ResolveType,
12427         but was missing from the MemberAccess.
12428
12429         (ArrayCreation.CheckIndices): warn if the user has
12430         more nested levels of expressions, but there are no more
12431         dimensions specified.  Avoids crash on bug 41906.
12432
12433 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12434
12435         * statement.cs (Block): replace Implicit bool, for a generic
12436         flags.   
12437         New flag: `Unchecked'.  This is used during the EmitMeta phase
12438         (which is out-of-line with the regular Resolve/Emit process for a
12439         statement, as this is done ahead of time, but still gets a chance
12440         to call constant resolve).
12441
12442         (Block.Flags): new enum for adding a new flag.
12443
12444         (Block.EmitMeta): track the state of unchecked.
12445
12446         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12447         to enable constant resolution to work there as well.
12448
12449 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12450
12451         * typemanager.cs (ienumerable_type): Also look up
12452         System.Collections.IEnumerable. 
12453
12454 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12455
12456         TODO: Test more than one conditional per method.
12457
12458         * class.cs (Indexer.Define): Report the location where the user is
12459         referencing the unsupported feature.
12460
12461         (MethodData): Overload the use of `conditionals' to
12462         minimize the creation of needless ArrayLists.   This saves roughly
12463         212kb on my machine.
12464
12465         (Method): Implement the new IIteratorContainer interface.
12466         (Method.SetYields): Implement the method by setting the ModFlags
12467         to contain METHOD_YIELDS.
12468
12469         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12470         which just got set to null.
12471
12472         * iterators.cs: New file.
12473
12474         (Yield, YieldBreak): New statements.
12475
12476         * statement.cs (Return.Resolve): Flag an error if we are used in
12477         an iterator method.
12478
12479         * codegen.cs (InIterator): New flag set if the code is being
12480         compiled in an iterator method.
12481
12482         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12483         internal modifier, and we just use it to avoid adding extra
12484         fields, as this is seldom used.  
12485
12486         * cs-parser.jay: Add yield_statement (yield and yield break).
12487
12488         * driver.cs: New flag -v2 to turn on version 2 features. 
12489
12490         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12491         hashtable when v2 is enabled.
12492
12493 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12494
12495         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12496         there is already a namespace defined with this name.
12497
12498         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12499         people upgraded their corlibs.
12500
12501         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12502         always use fully qualified types, no need to use the compiler
12503         front end.
12504
12505         (TypeManager.IsNamespace): Use binarysearch.
12506
12507         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12508         AddDelegate): I did not quite use the new IsValid API properly: I
12509         have to pass the short-name and the fullname.  I was passing only
12510         the basename instead of the fullname sometimes. 
12511
12512         (TypeContainer.DefineType): call NamespaceClash.
12513
12514         * interface.cs (Interface.DefineType): use NamespaceClash before
12515         defining the type.
12516
12517         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12518         defining the type.
12519
12520         * enum.cs: (Enum.DefineType): use NamespaceClash before
12521         defining the type.
12522
12523         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12524         speed increase.  First, use the negative_hits cache when we get a
12525         negative.  Second, add the type with its full original name
12526         instead of the new . and + encoded name (reflection uses + to
12527         separate type from a nested type).  Use LookupTypeReflection
12528         directly which bypasses the type->name hashtable (that we already
12529         know does not contain the type.
12530
12531         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12532         location/container type. 
12533
12534         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12535
12536 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12537
12538         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12539
12540         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12541         method is being referenced in the method group from a static
12542         context, and report error 120 if so.
12543
12544         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12545         Error118. 
12546
12547         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12548         is created, we create the A namespace).
12549
12550         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12551         Fixes #41591
12552
12553 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12554
12555         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12556         invocation to ModuleBuilder.GetType with the same values will
12557         return a new type instance, so we need to cache its return
12558         values. 
12559
12560         * expression.cs (Binary.ResolveOperator): Only allow the compare
12561         operators on enums if they are of the same type.
12562
12563         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12564         types of ValueType on their own case.  Before we were giving them
12565         the same treatment as objects.
12566
12567         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12568         fullname.  Short name is used to compare against container name.
12569         Fullname is used to check against defined namespace names.
12570
12571         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12572         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12573
12574         (Method.CheckBase): Call parent.
12575         (MemberBase.CheckBase): Check for protected members on sealed
12576         classes.
12577         (PropertyBase.CheckBase): Call parent.
12578         (Field.Define): Call parent.
12579
12580         * report.cs: Negative error codes are now mapped to 8000 - code,
12581         so that the display is render more nicely.
12582
12583         * typemanager.cs: Do not use try/catch, instead report a regular
12584         error. 
12585
12586         (GetPointerType, GetReferenceType): These methods provide
12587         mechanisms to obtain the T* and T& from a T.  We had the code
12588         previously scattered around the code base, and it also used
12589         TypeManager.LookupType that would go through plenty of caches.
12590         This one goes directly to the type source.
12591
12592         In some places we did the Type.GetType followed by
12593         ModuleBuilder.GetType, but not in others, so this unifies the
12594         processing as well.
12595
12596         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12597         statements now that we have namespace information.
12598
12599         * typemanager.cs (IsNamespace): New method, returns whether the
12600         string presented is a namespace or not.
12601
12602         (ComputeNamespaces): New public entry point, computes the list of
12603         available namespaces, using the GetNamespaces API call in Mono, or
12604         the slower version in MS.NET.   
12605
12606         Now before we start the semantic analysis phase, we have a
12607         complete list of namespaces including everything that the user has
12608         provided.
12609
12610         Deleted old code to cache namespaces in .nsc files.
12611
12612 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12613
12614         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12615         class/struct location definition Location for the implicit
12616         constructor location.
12617
12618         (Operator.Define): Use the location of the operator for the
12619         implicit Method definition.
12620
12621         (Constructor.Emit): use the constructor location for the implicit
12622         base initializer constructor.
12623
12624         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12625         and the Expression class now contains two new methods:
12626
12627         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12628         isolate type lookup from the rest of the resolution process.
12629
12630         Since we use Expressions to hold type definitions due to the way
12631         we parse the input we have historically overloaded Resolve to
12632         perform the Type lookups if a special flag is passed.  Now this is
12633         eliminated and two methods take their place. 
12634
12635         The differences in the two methods between xStep and xTerminal is
12636         that xStep is involved in our current lookup system that uses
12637         SimpleNames to compose a name, while xTerminal is used just to
12638         catch the case where the simplename lookup failed.
12639
12640 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12641
12642         * expression.cs (ResolveMemberAccess): Remove redundant code.
12643         TypeExpr expressions are always born fully resolved.
12644
12645         * interface.cs (PopulateMethod): Do not lookup the types twice.
12646         We were doing it once during SemanticAnalysis and once during
12647         PopulateMethod.
12648
12649         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12650         in local variable type definitions, were being returned as a
12651         SimpleName (we decomposed everything into a string), that is
12652         because primary_expression was being used instead of a type in the
12653         grammar (reduce/reduce conflicts).
12654
12655         The part that was wrong is that we converted the expression into a
12656         string (an oversimplification in one hand, compounded with primary
12657         expressions doing string concatenation).
12658
12659         So things like:
12660
12661         A.B.C [] x;
12662
12663         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12664         using clauses from working on this particular context.  And a type
12665         was being matched directly against "A.B.C[]".
12666
12667         We now use the correct approach, and allow for ComposedCast to be
12668         part of the unary expression.  So the "A.B.C []" become a composed
12669         cast of "A.B.C" (as a nested group of MemberAccess with a
12670         SimpleName at the end) plus the rank composition "[]". 
12671
12672         Also fixes 35567
12673
12674 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12675
12676         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12677         for the access level checking.
12678
12679         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12680         `TypeContainer container', because I kept getting confused when I
12681         was debugging this code.
12682
12683         * expression.cs (Indexers): Instead of tracking getters/setters,
12684         we now track them in parallel.  We create one arraylist less, but
12685         most importantly it is possible now for the LValue code to find a
12686         matching get for a set.
12687
12688         (IndexerAccess.DoResolveLValue): Update the code.
12689         GetIndexersForType has been modified already to extract all the
12690         indexers from a type.  The code assumed it did not.
12691
12692         Also make the code set the correct return type for the indexer.
12693         This was fixed a long time ago for properties, but was missing for
12694         indexers.  It used to be void_type.
12695
12696         (Binary.Emit): Test first for doubles instead of
12697         floats, as they are more common.
12698
12699         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12700         when dealing with floats and the <=, >= operators.  This fixes bug
12701         #39314 
12702
12703         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12704         to load the array value by emitting a load on the foreach variable
12705         type.  This was incorrect.  
12706
12707         We now emit the code to load an element using the the array
12708         variable type, and then we emit the conversion operator.
12709
12710         Fixed #40176
12711
12712 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12713
12714         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12715
12716 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12717
12718         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12719         test for protection before we test for signatures. 
12720
12721         (MethodSignature.ToString): implement.
12722
12723         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12724         to the case where we reduced into a LongConstant.
12725
12726         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12727         depend on whether the information is acurrate, because the
12728         Microsoft runtime will always claim that the array type is public,
12729         regardless of the real state.
12730
12731         If the type is a pointer, another problem happens: the type is
12732         reported as non-public in Microsoft.  
12733
12734         In both cases we have to call CheckAccessLevel recursively with
12735         the underlying type as the argument to be tested.
12736
12737 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12738
12739         * assign.cs (Assign.Emit): If we are dealing with a compound
12740         assignment expression, we should use the code path that stores the
12741         intermediate result in a temporary value.  This fixes #40903.
12742
12743         *expression.cs (Indirection.ToString): Provide ToString method for
12744         debugging. 
12745
12746 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12747
12748         * class.cs: Null out fields holding references to Block objects so
12749         they can be garbage collected.
12750
12751         * expression.cs (OverloadResolve): Remove unused local.
12752
12753 2003-04-07  Martin Baulig  <martin@ximian.com>
12754
12755         * codegen.cs (EmitContext.CurrentFile): New public field.
12756         (EmitContext.Mark): Use the CurrentFile to check whether the
12757         location is in the correct file.
12758         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12759
12760 2003-04-07  Martin Baulig  <martin@ximian.com>
12761
12762         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12763
12764         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12765         location.  [FIXME: The location argument which gets passed to this
12766         method is sometimes wrong!]
12767
12768 2003-04-07  Nick Drochak <ndrochak@gol.com>
12769
12770         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12771
12772 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12773
12774         * expression.cs (Indirection.EmitAssign): We were using the
12775         temporary, but returning immediately instead of continuing the
12776         EmitAssing flow.
12777
12778 2003-04-06  Martin Baulig  <martin@ximian.com>
12779
12780         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12781         if it's a nested child, but also deriving from the outer class.
12782         See test 190.cs.
12783
12784         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12785         nested child, but also deriving from the outer class.  See
12786         test-190.cs.
12787         (FilterWithClosure): We may access private members of the outer
12788         class if we're a nested child and deriving from the outer class.
12789         (RealMemberLookup): Only set `closure_private_ok' if the
12790         `original_bf' contained BindingFlags.NonPublic.
12791
12792 2003-04-05  Martin Baulig  <martin@ximian.com>
12793
12794         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12795
12796 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12797
12798         * class.cs (Event.Define): Do not allow abstract events to have
12799         initializers. 
12800
12801 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12802
12803         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12804         block in event declarations.
12805
12806         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12807         value type, get its address.
12808
12809         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12810         leaving a class on the stack instead of a boolean value (int
12811         0/1).  Change the code so we compare against null, and then the
12812         result against zero.
12813
12814         * class.cs (TypeContainer.GetClassBases): We were checking for the
12815         parent class being sealed too late.
12816
12817         * expression.cs (Binary.Emit): For <= and >= when dealing with
12818         floating point values, use cgt.un and clt.un instead of cgt and
12819         clt alone.
12820
12821 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12822
12823         * statement.cs: Apply the same optimization as MS: skip the 
12824         GetEnumerator returning an IEnumerator, and use the one returning a 
12825         CharEnumerator instead. This allows us to avoid the try-finally block 
12826         and the boxing.
12827
12828 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12829
12830         * cs-parser.jay: Attributes cannot be applied to
12831                          namespaces. Fixes #40473
12832
12833 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12834
12835         * class.cs:
12836         (Add*): check if the name is valid using the full name for constants,
12837         fields, properties and events.
12838
12839 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12840
12841         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12842         char constants to be part of the enumeration.
12843
12844         * expression.cs (Conditional.DoResolve): Add support for operator
12845         true. Implements the missing functionality from 14.12
12846
12847         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12848         operator true/false as required by the spec.
12849
12850         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12851         implicit conversion to boolean.
12852
12853         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12854         also one where the type implements `operator true'. 
12855
12856         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12857         get an expression that will invoke operator true based on an
12858         expression.  
12859
12860         (GetConversionOperators): Removed the hack that called op_True
12861         here.  
12862
12863         (Expression.ResolveBoolean): Move this from Statement.
12864
12865 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12866
12867         * ecore.cs (FieldExpr): do not allow initialization of initonly
12868         fields on derived classes
12869
12870 2003-03-13  Martin Baulig  <martin@ximian.com>
12871
12872         * statement.cs (Block.Emit): Call ig.BeginScope() and
12873         ig.EndScope() when compiling with debugging info; call
12874         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12875
12876 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
12877
12878         * expression.cs (Indexers): Do not construct immediately, allow
12879         for new members to be appended as we go.  Fixes 38143
12880
12881 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12882
12883         * expression.cs: save/restore context when resolving an unchecked
12884         expression.
12885
12886 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
12887
12888         * cfold.cs: Catch division by zero in modulus operator during
12889         constant folding.
12890
12891 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
12892
12893         * interface.cs (Interface.DefineMembers): Avoid defining members
12894         twice. 
12895
12896 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
12897
12898         * driver.cs: handle the +/- options for -noconfig
12899
12900         * statement.cs (Unckeched.Resolve): Also track the state of
12901         unchecked in the Resolve phase.
12902
12903 2003-02-27  Martin Baulig  <martin@ximian.com>
12904
12905         * ecore.cs (Expression.MemberLookup): Don't create a
12906         MethodGroupExpr for something which is not a method.  Fixes #38291.
12907
12908 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
12909
12910         * class.cs (MemberBase.CheckParameters): Also check that the type
12911         is unmanaged if it is a pointer.
12912
12913         * expression.cs (SizeOf.Resolve): Add location information.
12914
12915         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12916         a managed type is declared.
12917
12918         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12919         parameter modifiers as well.  Fixes bug 38606
12920
12921         * class.cs: Very sad.  Am backing out the speed up changes
12922         introduced by the ArrayList -> Array in the TypeContainer, as they
12923         were not actually that much faster, and introduced a bug (no error
12924         reports on duplicated methods).
12925
12926         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12927         source first, this will guarantee that we have a valid expression
12928         before calling in lower levels functions that will require a
12929         resolved object.  Then use this original_source in the
12930         target.ResolveLValue instead of the original source that was
12931         passed to us.
12932
12933         Another change.  Use target.Resolve instead of LValueResolve.
12934         Although we are resolving for LValues, we will let the Assign code
12935         take care of that (it will be called again from Resolve).  This
12936         basically allows code like this:
12937
12938         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12939         class Y { void A (X x) { x [0] += o; }
12940
12941         The problem was that the indexer was trying to resolve for
12942         set_Item (idx, object o) and never finding one.  The real set_Item
12943         was set_Item (idx, X).  By delaying the process we get the right
12944         semantics. 
12945
12946         Fixes bug 36505
12947
12948 2003-02-23  Martin Baulig  <martin@ximian.com>
12949
12950         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12951         while calling DoEmit ().
12952
12953         * codegen.cs (EmitContext.Mark): Don't mark locations in other
12954         source files; if you use the #line directive inside a method, the
12955         compiler stops emitting line numbers for the debugger until it
12956         reaches the end of the method or another #line directive which
12957         restores the original file.
12958
12959 2003-02-23  Martin Baulig  <martin@ximian.com>
12960
12961         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12962
12963 2003-02-23  Martin Baulig  <martin@ximian.com>
12964
12965         * statement.cs (Block.AddChildVariableNames): We need to call this
12966         recursively, not just for our immediate children.
12967
12968 2003-02-23  Martin Baulig  <martin@ximian.com>
12969
12970         * class.cs (Event.Define): Always make the field private, like csc does.
12971
12972         * typemanager.cs (TypeManager.RealMemberLookup): Make events
12973         actually work, fixes bug #37521.
12974
12975 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12976
12977         * delegate.cs: When creating the various temporary "Parameters"
12978         classes, make sure that we call the ComputeAndDefineParameterTypes
12979         on those new parameters (just like we do with the formal ones), to
12980         allow them to be resolved in the context of the DeclSpace.
12981
12982         This fixes the bug that Dick observed in Bugzilla #38530.
12983
12984 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12985
12986         * expression.cs (ResolveMemberAccess): When resolving a constant,
12987         do not attempt to pull a constant if the value was not able to
12988         generate a valid constant.
12989
12990         * const.cs (LookupConstantValue): Do not report more errors than required.
12991
12992 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12993
12994         * expression.cs: fixes bug #38328.
12995
12996 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12997
12998         * class.cs: Changed all the various members that can be part of a
12999         class from being an ArrayList to be an Array of the right type.
13000         During the DefineType type_list, interface_list, delegate_list and
13001         enum_list are turned into types, interfaces, delegates and enums
13002         arrays.  
13003
13004         And during the member population, indexer_list, event_list,
13005         constant_list, field_list, instance_constructor_list, method_list,
13006         operator_list and property_list are turned into their real arrays.
13007
13008         Although we could probably perform this operation earlier, for
13009         good error reporting we need to keep the lists and remove the
13010         lists for longer than required.
13011
13012         This optimization was triggered by Paolo profiling the compiler
13013         speed on the output of `gen-sample-program.pl' perl script. 
13014
13015         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13016         not crash in methods like MemberLookupFailed that use this field.  
13017
13018         This problem arises when the compiler fails to resolve a type
13019         during interface type definition for example.
13020
13021 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13022
13023         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13024         inherit from System.Object, so we have to stop at null, not only
13025         when reaching System.Object.
13026
13027 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13028
13029         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13030         DeclaredOnly because the parent indexer might have had a different
13031         name, but did not loop until the top of the hierarchy was reached.
13032
13033         The problem this one fixes is 35492: when a class implemented an
13034         indexer from an interface, we were getting the interface method
13035         (which was abstract) and we were flagging an error (can not invoke
13036         abstract method).
13037
13038         This also keeps bug 33089 functioning, and test-148 functioning.
13039
13040         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13041         out if a method is special is to see if it is declared in a
13042         property or event, or whether it is one of the predefined operator
13043         names.   This should fix correctly #36804.
13044
13045 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13046
13047         The goal here is to remove the dependency on EmptyCast.Peel ().
13048         Killing it completely.
13049
13050         The problem is that currently in a number of places where
13051         constants are expected, we have to "probe" for an EmptyCast, and
13052         Peel, which is not the correct thing to do, as this will be
13053         repetitive and will likely lead to errors. 
13054
13055         The idea is to remove any EmptyCasts that are used in casts that
13056         can be reduced to constants, so we only have to cope with
13057         constants. 
13058
13059         This bug hunt was triggered by Bug 37363 and the desire to remove
13060         the duplicate pattern where we were "peeling" emptycasts to check
13061         whether they were constants.  Now constants will always be
13062         constants.
13063
13064         * ecore.cs: Use an enumconstant here instead of wrapping with
13065         EmptyCast.  
13066
13067         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13068         throwing me off.  By handling this we can get rid of a few hacks.
13069
13070         * statement.cs (Switch): Removed Peel() code.
13071
13072 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13073
13074         * class.cs: Location information for error 508
13075
13076         * expression.cs (New.DoResolve): Add a guard against double
13077         resolution of an expression.  
13078
13079         The New DoResolve might be called twice when initializing field
13080         expressions (see EmitFieldInitializers, the call to
13081         GetInitializerExpression will perform a resolve on the expression,
13082         and later the assign will trigger another resolution
13083
13084         This leads to bugs (#37014)
13085
13086         * delegate.cs: The signature for EndInvoke should contain any ref
13087         or out parameters as well.  We were not doing this in the past. 
13088
13089         * class.cs (Field.Define): Do not overwrite the type definition
13090         inside the `volatile' group.  Turns out that volatile enumerations
13091         were changing the type here to perform a validity test, which
13092         broke conversions. 
13093
13094 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13095
13096         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13097         and structs, we do not want to load the instance variable
13098
13099         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13100         enum_type has to be handled like an object reference (implicit
13101         conversions exists from this to object), but the regular IsClass
13102         and IsValueType tests will never return true for this one.
13103
13104         Also we use TypeManager.IsValueType instead of type.IsValueType,
13105         just for consistency with the rest of the code (this is only
13106         needed if we ever use the construct exposed by test-180.cs inside
13107         corlib, which we dont today).
13108
13109 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13110
13111         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13112         just InternalCall.
13113
13114 2003-02-09  Martin Baulig  <martin@ximian.com>
13115
13116         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13117         (Namespace.DefineNamespaces): New static public method; this is
13118         called when we're compiling with debugging to add all namespaces
13119         to the symbol file.
13120
13121         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13122         pass it to the Namespace's .ctor.
13123
13124         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13125         and MethodBase arguments; pass the namespace ID to the symwriter;
13126         pass the MethodBase instead of the token to the symwriter.
13127         (SymbolWriter.DefineNamespace): New method to add a namespace to
13128         the symbol file.
13129
13130 2003-02-09  Martin Baulig  <martin@ximian.com>
13131
13132         * symbolwriter.cs: New file.  This is a wrapper around
13133         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13134         methods here in near future.
13135
13136 2003-02-09  Martin Baulig  <martin@ximian.com>
13137
13138         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13139         ILGenerator.MarkSequencePoint() which are actually used by the
13140         symbol writer.
13141
13142 2003-02-09  Martin Baulig  <martin@ximian.com>
13143
13144         * location.cs (SourceFile): New public sealed class.  This
13145         contains the name and an index which is used in the location's token.
13146         (Location): Reserve an appropriate number of bits in the token for
13147         the source file instead of walking over that list, this gives us a
13148         really huge performance improvement when compiling with debugging.
13149
13150         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13151         `SourceFile' argument instead of a string.
13152         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13153         but don't parse/tokenize here, we need to generate the list of all
13154         source files before we do that.
13155         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13156         the files.
13157
13158         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13159         instead of a string.
13160
13161         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13162         of a string.
13163
13164 2003-02-09  Martin Baulig  <martin@ximian.com>
13165
13166         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13167         filename on `#line default'.
13168
13169 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13170
13171         * statement.cs: don't clear the pinned var when the fixed statement
13172         returns from the method (fixes bug#37752).
13173
13174 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13175
13176         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13177         to IsValueType.
13178
13179 2003-02-07  Martin Baulig  <martin@ximian.com>
13180
13181         * driver.cs: Removed the `--debug-args' command line argument.
13182
13183         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13184         automatically by the AsssemblyBuilder.
13185         (CodeGen.InitializeSymbolWriter): We don't need to call any
13186         initialization function on the symbol writer anymore.  This method
13187         doesn't take any arguments.
13188
13189 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13190
13191         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13192         from referenced assemblies as well.
13193
13194 2003-02-02  Martin Baulig  <martin@ximian.com>
13195
13196         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13197
13198 2003-02-02  Martin Baulig  <martin@ximian.com>
13199
13200         * class.cs (Constructor.Emit): Open the symbol writer before
13201         emitting the constructor initializer.
13202         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13203         single-stepping through constructor initializers.
13204
13205 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13206
13207         * class.cs: Handle error 549: do not allow virtual methods in
13208         sealed classes. 
13209
13210 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13211
13212         * decl.cs: Check access levels when resolving types
13213
13214 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13215
13216         * statement.cs: Add parameters and locals set in catch blocks that might 
13217         return to set vector
13218
13219 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13220
13221         * class.cs (Operator): Set the SpecialName flags for operators.
13222
13223         * expression.cs (Invocation.DoResolve): Only block calls to
13224         accessors and operators on SpecialName methods.
13225
13226         (Cast.TryReduce): Handle conversions from char constants.
13227
13228
13229 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13230
13231         * statement.cs: small memory and time optimization in FlowBranching.
13232
13233 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13234
13235         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13236         problem that the last fix but in the other sid (Set).
13237
13238         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13239         access when there is no indexer in the hierarchy.
13240
13241 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13242
13243         * class.cs: Combine some if statements.
13244
13245 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13246
13247         * driver.cs: fixed bug #37187.
13248
13249 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13250
13251         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13252         any indexer, it's needed to build a list with all the indexers in the
13253         hierarchy (AllGetters), else we have problems. Fixes #35653.
13254
13255 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13256
13257         * class.cs (MethodData.Define): It is wrong for an interface
13258         implementation to be static in both cases: explicit and implicit.
13259         We were only handling this in one case.
13260
13261         Improve the if situation there to not have negations.
13262
13263         * class.cs (Field.Define): Turns out that we do not need to check
13264         the unsafe bit on field definition, only on usage.  Remove the test.
13265
13266 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13267
13268         * driver.cs: use assembly.Location instead of Codebase (the latest
13269         patch made mcs fail when using MS assemblies).
13270
13271 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13272
13273         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13274         get the path to *corlib.dll.
13275
13276 2003-01-21  Nick Drochak <ndrochak@gol.com>
13277
13278         * cs-tokenizer.cs:
13279         * pending.cs:
13280         * typemanager.cs: Remove compiler warnings
13281
13282 2003-01-20  Duncan Mak  <duncan@ximian.com>
13283
13284         * AssemblyInfo.cs: Bump the version number to 0.19.
13285
13286 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13287
13288         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13289
13290 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13291
13292         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13293
13294 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13295
13296         * cs-parser.jay: Small fix: we were not comparing the constructor
13297         name correctly.   Thanks to Zoltan for the initial pointer.
13298
13299 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13300
13301         * cs-tokenizer.cs: Set file name when specified with #line
13302
13303 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13304
13305         * cs-parser.jay: Only perform the constructor checks here if we
13306         are named like the class;  This will help provider a better
13307         error.  The constructor path is taken when a type definition is
13308         not found, but most likely the user forgot to add the type, so
13309         report that rather than the constructor error.
13310
13311 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13312
13313         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13314         allocations.
13315
13316 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13317
13318         * cs-parser.jay: Add cleanup call.
13319
13320 2003-01-13  Duncan Mak  <duncan@ximian.com>
13321
13322         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13323         consistent with other methods.
13324
13325 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13326
13327         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13328
13329 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13330
13331         * attribute.cs: only set GuidAttr to true when we have a
13332         GuidAttribute.
13333
13334 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13335
13336         * ecore.cs:
13337         * expression.cs:
13338         * typemanager.cs: fixes to allow mcs compile corlib with the new
13339         Type.IsSubclassOf fix.
13340
13341 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13342
13343         * expression.cs (LocalVariableReference.DoResolve): Classify a
13344         constant as a value, not as a variable.   Also, set the type for
13345         the variable.
13346
13347         * cs-parser.jay (fixed_statement): take a type instead of a
13348         pointer_type, so we can produce a better error message later.
13349
13350         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13351         as an error.  
13352
13353         (For.DoEmit): Make inifinite loops have a
13354         non-conditional branch back.
13355
13356         (Fixed.DoEmit): First populate the pinned variables, then emit the
13357         statement, then clear the variables.  Before I was emitting the
13358         code once for each fixed piece.
13359
13360
13361 2003-01-08  Martin Baulig  <martin@ximian.com>
13362
13363         * statement.cs (FlowBranching.MergeChild): A break in a
13364         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13365
13366 2003-01-08  Martin Baulig  <martin@ximian.com>
13367
13368         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13369         lives in the same number space than `param_map'.  Fixes #36154.
13370
13371 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13372
13373         * cs-parser.jay (constructor_declaration): Set the
13374         Constructor.ModFlags before probing for it.  This makes the
13375         compiler report 514, 515 and 132 (the code was there, but got
13376         broken). 
13377
13378         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13379         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13380         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13381
13382 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13383
13384         * enum.cs: create the enum static fields using the enum type.
13385
13386 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13387
13388         * class.cs: don't try to create the ParamBuilder for the return
13389         type if it's not needed (and handle it breaking for the ms runtime
13390         anyway).
13391
13392 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13393
13394         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13395
13396 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13397
13398         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13399         the command.   This showed up while compiling the JANET source
13400         code, which used \r as its only newline separator.
13401
13402 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13403
13404         * class.cs (Method.Define): If we are an operator (because it
13405         reuses our code), then set the SpecialName and HideBySig.  #36128
13406
13407 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13408
13409         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13410         exception, report error 120 `object reference required'.
13411
13412         * driver.cs: Add --pause option, used during to measure the size
13413         of the process as it goes with --timestamp.
13414
13415         * expression.cs (Invocation.DoResolve): Do not allow methods with
13416         SpecialName to be invoked.
13417
13418 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13419
13420         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13421         number before adding it.
13422
13423 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13424
13425         * ecore.cs (StandardImplicitConversion): When in an unsafe
13426         context, we allow conversion between void * to any other pointer
13427         type. This fixes bug #35973.
13428
13429 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13430
13431         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13432         is not thrown when extensionless outputs are used 
13433
13434 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13435
13436         * rootcontext.cs: fixed compilation of corlib.
13437
13438 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13439
13440         * attribute.cs (Attributes.Contains): Add new method.
13441
13442         * class.cs (MethodCore.LabelParameters): if the parameter is an
13443         `out' parameter, check that no attribute `[In]' has been passed.
13444
13445         * enum.cs: Handle the `value__' name in an enumeration.
13446
13447 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13448
13449         * decl.cs: Added special case to allow overrides on "protected
13450         internal" methods
13451
13452 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13453
13454         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13455         since it makes much more sense.
13456
13457         (Attributes.ctor): Don't require a Location parameter.
13458
13459         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13460
13461         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13462         since we already have that information per attribute.
13463
13464         * everywhere : make appropriate changes.
13465
13466         * class.cs (LabelParameters): Write the code which actually
13467         applies attributes to the return type. We can't do this on the MS
13468         .NET runtime so we flag a warning in the case an exception is
13469         thrown.
13470
13471 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13472
13473         * const.cs: Handle implicit null conversions here too.
13474
13475 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13476
13477         * class.cs (MethodCore.LabelParameters): Remove the extra
13478         Type [] parameter since it is completely unnecessary. Instead
13479         pass in the method's attributes so that we can extract
13480         the "return" attribute.
13481
13482 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13483
13484         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13485         of ignoring it and letting the compile continue.
13486
13487         * typemanager.cs (ChangeType): use an extra argument to return an
13488         error condition instead of throwing an exception.
13489
13490 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13491
13492         * expression.cs (Unary.TryReduce): mimic the code for the regular
13493         code path.  Perform an implicit cast in the cases where we can
13494         implicitly convert to one of the integral types, and then reduce
13495         based on that constant.   This fixes bug #35483.
13496
13497 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13498
13499         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13500
13501 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13502
13503         * namespace.cs: fixed bug #35489.
13504
13505 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13506
13507         * class.cs: Remove some dead code.
13508
13509         * cs-parser.jay: Estimate the number of methods needed
13510         (RootContext.MethodCount);
13511
13512         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13513         numbers instead of StringBuilders.
13514
13515         * support.cs (PtrHashtable): Add constructor with initial size;
13516         We can now reduce reallocations of the method table.
13517
13518 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13519
13520         * attribute.cs (ApplyAttributes): Keep track of the emitted
13521         attributes on a per-target basis. This fixes bug #35413.
13522
13523 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13524
13525         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13526         default to the Windows 1252 encoding.
13527
13528         (UnixParseOption): Support version, thanks to Alp for the missing
13529         pointer. 
13530
13531         * AssemblyInfo.cs: Add nice assembly information.
13532
13533         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13534         (bug 35169).
13535
13536         * cs-parser.jay: Allow a trailing comma before the close bracked
13537         in the attribute_section production.
13538
13539         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13540         address of the instance was being taken, I will take this out,
13541         because we take the address of the object immediately here.
13542
13543 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13544
13545         * typemanager.cs (AreMultipleAllowed): Take care of the most
13546         obvious case where attribute type is not in the current assembly -
13547         stupid me ;-)
13548
13549 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13550
13551         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13552         definitions, instead of doing that afterwards.  
13553
13554         Also we use a nice little hack, depending on the constructor, we
13555         know if we are a "composed" name or a simple name.  Hence, we
13556         avoid the IndexOf test, and we avoid 
13557
13558         * codegen.cs: Add code to assist in a bug reporter to track down
13559         the source of a compiler crash. 
13560
13561 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13562
13563         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13564         types have been emitted for a given element and flag an error
13565         if something which does not have AllowMultiple set is used more
13566         than once.
13567
13568         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13569         attribute types and their corresponding AllowMultiple properties
13570
13571         (AreMultipleAllowed): Check the property for a given type.
13572
13573         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13574         property in the case we have a TypeContainer.
13575
13576         (Attributes.AddAttribute): Detect duplicates and just skip on
13577         adding them. This trivial fix catches a pretty gross error in our
13578         attribute emission - global attributes were being emitted twice!
13579
13580         Bugzilla bug #33187 is now fixed.
13581
13582 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13583
13584         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13585         instead of pp_and).
13586
13587         * expression.cs (Binary.ResolveOperator): I can only use the
13588         Concat (string, string, string) and Concat (string, string,
13589         string, string) if the child is actually a concatenation of
13590         strings. 
13591
13592 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13593
13594         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13595         context where we need a 2-character lookahead.
13596
13597         * pending.cs (PendingImplementation): Rework so we can keep track
13598         of interface types all the time, and flag those which were
13599         implemented by parents as optional.
13600
13601 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13602
13603         * expression.cs (Binary.ResolveOperator): Use
13604         String.Concat(string,string,string) or
13605         String.Concat(string,string,string,string) when possible. 
13606
13607         * typemanager: More helper methods.
13608
13609
13610 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13611
13612         * pending.cs: remove the bogus return from GetMissingInterfaces()
13613         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13614
13615 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13616
13617         * namespace.cs: avoid duplicated 'using xxx' being added to
13618         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13619         when we get more than one 'using' statement for the same namespace.
13620         Report a CS0105 warning for it.
13621
13622 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13623
13624         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13625         of calling getChar/putback, uses internal knowledge of it.    
13626
13627         (xtoken): Reorder tokenizer so most common patterns are checked
13628         first.  This reduces the compilation time in another 5% (from 8.11s
13629         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13630
13631         The parsing time is 22% of the compilation in mcs, and from that
13632         64% is spent on the tokenization process.  
13633
13634         I tried using a binary search for keywords, but this is slower
13635         than the hashtable.  Another option would be to do a couple of
13636         things:
13637
13638                 * Not use a StringBuilder, instead use an array of chars,
13639                   with a set value.  Notice that this way we could catch
13640                   the 645 error without having to do it *afterwards*.
13641
13642                 * We could write a hand-parser to avoid the hashtable
13643                   compares altogether.
13644
13645         The identifier consumption process takes 37% of the tokenization
13646         time.  Another 15% is spent on is_number.  56% of the time spent
13647         on is_number is spent on Int64.Parse:
13648
13649                 * We could probably choose based on the string length to
13650                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13651                   computations. 
13652
13653         Another 3% is spend on wrapping `xtoken' in the `token' function.
13654
13655         Handle 0xa0 as whitespace (#34752)
13656
13657 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13658
13659         * typemanager.cs (IsCLRType): New routine to tell whether a type
13660         is one of the builtin types.  
13661
13662         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13663         typecode in more places instead of doing pointer comparissions.
13664         We could leverage some knowledge about the way the typecodes are
13665         laid out.
13666
13667         New code to cache namespaces in assemblies, it is currently not
13668         invoked, to be used soon.
13669
13670         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13671
13672         * expression.cs (Binary.ResolveOperator): specially handle
13673         strings, and do not perform user-defined operator overloading for
13674         built-in types.
13675
13676 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13677
13678         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13679         internalcall as it is a pretty simple operation;  Avoid whenever
13680         possible to call Char.IsLetter.
13681
13682         (consume_identifier): Cut by half the number of
13683         hashtable calls by merging the is_keyword and GetKeyword behavior.
13684
13685         Do not short-circuit, because if we do, we
13686         report errors (ie, #if false && true would produce an invalid
13687         directive error);
13688
13689
13690 2002-11-24  Martin Baulig  <martin@ximian.com>
13691
13692         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13693         check constant ranges and report a CS0221.  Fixes #33186.
13694
13695 2002-11-24  Martin Baulig  <martin@ximian.com>
13696
13697         * cs-parser.jay: Make this work for uninitialized variable
13698         declarations in the `for' initializer.  Fixes #32416.
13699
13700 2002-11-24  Martin Baulig  <martin@ximian.com>
13701
13702         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13703         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13704
13705 2002-11-24  Martin Baulig  <martin@ximian.com>
13706
13707         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13708         argument; if true, we also check for user-defined conversions.
13709         This is only needed if both arguments are of a user-defined type.
13710         Fixes #30443, added test-175.cs.
13711         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13712
13713         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13714
13715 2002-11-24  Martin Baulig  <martin@ximian.com>
13716
13717         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13718         function to get the store opcode.
13719         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13720         only emit the Ldelema if the store opcode is Stobj.  You must run
13721         both test-34 and test-167 to test this.  Fixes #34529.
13722
13723 2002-11-23  Martin Baulig  <martin@ximian.com>
13724
13725         * ecore.cs (Expression.MemberLookup): Added additional
13726         `qualifier_type' argument which is used when we're being called
13727         from MemberAccess.DoResolve() and null if we're called from a
13728         SimpleName lookup.
13729         (Expression.MemberLookupFailed): New method to report errors; this
13730         does the CS1540 check and reports the correct error message.
13731
13732         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13733         argument for the CS1540 check and redone the way how we're dealing
13734         with private members.  See the comment in the source code for details.
13735         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13736         `closure_start_type' to `closure_qualifier_type' and check whether
13737         it's not null.  It was not this filter being broken, it was just
13738         being called with the wrong arguments.
13739
13740         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13741         and pass it the correct `qualifier_type'; this also does the error
13742         handling for us.
13743
13744 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13745
13746         * expression.cs (Invocation.EmitParams): If the we are dealing
13747         with a non-built-in value type, load its address as well.
13748
13749         (ArrayCreation): Use a a pretty constant instead
13750         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13751         static initializers.  
13752
13753         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13754         because they are not really value types, just glorified integers. 
13755
13756         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13757
13758         * ecore.cs: Remove redundant code for enumerations, make them use
13759         the same code path as everything else, fixes the casting issue
13760         with enumerations in Windows.Forms.
13761
13762         * attribute.cs: Do only cast to string if it is a string, the
13763         validation happens later.
13764
13765         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13766         people upgrade their corlibs.
13767
13768         * ecore.cs: Oops, enumerations were not following the entire code path
13769
13770 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13771
13772         * typemanager.cs (FilterWithClosure): Commented out the test for
13773         1540 in typemanager.cs, as it has problems when accessing
13774         protected methods from a parent class (see test-174.cs). 
13775
13776         * attribute.cs (Attribute.ValidateGuid): new method.
13777         (Attribute.Resolve): Use above.
13778
13779 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13780
13781         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13782
13783         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13784         handling for enumerations, as we only needed the TypeContainer
13785         functionality to begin with (this is required for the fix below to
13786         work for enums that reference constants in a container class for
13787         example). 
13788
13789         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13790
13791         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13792         a valid TypeBuilder to perform lookups on.o
13793
13794         * class.cs (InheritableMemberSignatureCompare): Use true in the
13795         call to GetGetMethod and GetSetMethod, because we are comparing
13796         the signature, and we need to get the methods *even* if they are
13797         private. 
13798
13799         (PropertyBase.CheckBase): ditto.
13800
13801         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13802         GotoCase.Resolve): Use Peel on EmpytCasts.
13803
13804         * ecore.cs (EmptyCast): drop child, add Peel method.
13805
13806 2002-11-17  Martin Baulig  <martin@ximian.com>
13807
13808         * ecore.cs (EmptyCast.Child): New public property.
13809
13810         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13811         label resolved to an EmptyCast.  Fixes #34162.
13812         (GotoCase.Resolve): Likewise.
13813         (Block.EmitMeta): Likewise.
13814
13815 2002-11-17  Martin Baulig  <martin@ximian.com>
13816
13817         * expression.cs (Invocation.BetterConversion): Prefer int over
13818         uint; short over ushort; long over ulong for integer literals.
13819         Use ImplicitConversionExists instead of StandardConversionExists
13820         since we also need to check for user-defined implicit conversions.
13821         Fixes #34165.  Added test-173.cs.
13822
13823 2002-11-16  Martin Baulig  <martin@ximian.com>
13824
13825         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13826         with the `true' and `false' literals.  Fixes #33151.
13827
13828 2002-11-16  Martin Baulig  <martin@ximian.com>
13829
13830         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13831         October 22nd; don't do the cs1540 check for static members.
13832
13833         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13834         now using our own filter here and doing the cs1540 check again.
13835
13836 2002-11-16  Martin Baulig  <martin@ximian.com>
13837
13838         * support.cs (InternalParameters): Don't crash if we don't have
13839         any fixed parameters.  Fixes #33532.
13840
13841 2002-11-16  Martin Baulig  <martin@ximian.com>
13842
13843         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13844         when looking up static methods to make this work on Windows.
13845         Fixes #33773.
13846
13847 2002-11-16  Martin Baulig  <martin@ximian.com>
13848
13849         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13850         a setter rather than using PropertyInfo.CanWrite.
13851
13852 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13853
13854         * class.cs: Allow acces to block member by subclasses. Fixes build
13855         breaker.
13856
13857 2002-11-14  Martin Baulig  <martin@ximian.com>
13858
13859         * class.cs (Constructor.Emit): Added the extern/block check.
13860         Fixes bug #33678.
13861
13862 2002-11-14  Martin Baulig  <martin@ximian.com>
13863
13864         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13865         iteration while looking for indexers, this is needed because the
13866         indexer may have a different name in our base classes.  Fixed the
13867         error reporting (no indexers at all, not get accessor, no
13868         overloaded match).  Fixes bug #33089.
13869         (IndexerAccess.DoResolveLValue): Likewise.
13870
13871 2002-11-14  Martin Baulig  <martin@ximian.com>
13872
13873         * class.cs (PropertyBase.CheckBase): Make this work for multiple
13874         indexers.  Fixes the first part of bug #33089.
13875         (MethodSignature.InheritableMemberSignatureCompare): Added support
13876         for properties.
13877
13878 2002-11-13  Ravi Pratap  <ravi@ximian.com>
13879
13880         * attribute.cs (Attribute.Resolve): Catch the
13881         NullReferenceException and report it since it isn't supposed to
13882         happen. 
13883
13884 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
13885
13886         * expression.cs (Binary.EmitBranchable): Also handle the cases for
13887         LogicalOr and LogicalAnd that can benefit from recursively
13888         handling EmitBranchable.  The code now should be nice for Paolo.
13889
13890 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
13891
13892         * typemanager.cs (LookupType): Added a negative-hit hashtable for
13893         the Type lookups, as we perform quite a number of lookups on
13894         non-Types.  This can be removed once we can deterministically tell
13895         whether we have a type or a namespace in advance.
13896
13897         But this might require special hacks from our corlib.
13898
13899         * TODO: updated.
13900
13901         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13902         and double which avoids a conversion from an integer to a double.
13903
13904         * expression.cs: tiny optimization, avoid calling IsConstant,
13905         because it effectively performs the lookup twice.
13906
13907 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
13908
13909         But a bogus return here to keep the semantics of the old code
13910         until the Mono runtime is fixed.
13911
13912         * pending.cs (GetMissingInterfaces): New method used to remove all
13913         the interfaces that are already implemented by our parent
13914         classes from the list of pending methods. 
13915
13916         * interface.cs: Add checks for calls after ResolveTypeExpr.
13917
13918 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
13919
13920         * class.cs (Class.Emit): Report warning 67: event not used if the
13921         warning level is beyond 3.
13922
13923         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13924         being a NullLiteral.
13925
13926         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13927         specifiers. 
13928
13929         * class.cs (TypeContainer.GetClassBases): Cover a missing code
13930         path that might fail if a type can not be resolved.
13931
13932         * expression.cs (Binary.Emit): Emit unsigned versions of the
13933         operators. 
13934
13935         * driver.cs: use error 5.
13936
13937 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13938
13939         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13940
13941 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
13942
13943         * cs-parser.jay (switch_section): A beautiful patch from Martin
13944         Baulig that fixed 33094.
13945
13946 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
13947
13948         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13949         Check whether the base is abstract and report an error if so.
13950
13951         * expression.cs (IndexerAccess.DoResolveLValue,
13952         IndexerAccess.DoResolve): ditto. 
13953
13954         (Invocation.DoResolve): ditto.
13955
13956         (Invocation.FullMethodDesc): Improve the report string.
13957
13958         * statement.cs (Block): Eliminate IsVariableDefined as it is
13959         basically just a wrapper for GetVariableInfo.
13960
13961         * ecore.cs (SimpleName): Use new 
13962
13963         * support.cs (ReflectionParamter.ParameterType): We unwrap the
13964         type, as we return the actual parameter ref/unref state on a
13965         different call.
13966
13967 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
13968
13969         * support.cs: Return proper flags REF/OUT fixing the previous
13970         commit.  
13971
13972         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
13973         not used to mean `ref' but `ref or out' in ParameterReference
13974
13975         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13976         full type signature instead of calling TypeManger.CSharpName
13977         ourselves. 
13978
13979         * support.cs (InternalParameters.ParameterDesc): Do not compare
13980         directly to the modflags, because REF/OUT will actually be bitsets
13981         if set. 
13982
13983         * delegate.cs (VerifyMethod): Check also the modifiers.
13984
13985         * cs-tokenizer.cs: Fix bug where floating point values with an
13986         exponent where a sign was missing was ignored.
13987
13988         * driver.cs: Allow multiple assemblies to be specified in a single
13989         /r: argument
13990
13991 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13992
13993         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13994         because identifiers after a parenthesis would end up in this kind
13995         of production, and we needed to desamiguate it for having casts
13996         like:
13997
13998                 (UserDefinedType *) xxx
13999
14000 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14001
14002         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14003         we should set on the Bindingflags.NonPublic, but not turn on
14004         private_ok.  private_ok controls whether a Private member is
14005         returned (this is chekced on the filter routine), while the
14006         BindingFlags.NonPublic just controls whether private/protected
14007         will be allowed.   This fixes the problem part of the problem of
14008         private properties being allowed to be used in derived classes.
14009
14010         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14011         so we can call the children DoResolveLValue method (this will
14012         properly signal errors on lvalue assignments to base properties)
14013
14014         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14015         getter are null, and we have a property info, we know that this
14016         happened because the lookup failed, so we report an error 122 for
14017         protection level violation.
14018
14019         We also silently return if setter and getter are null in the
14020         resolve functions, this condition only happens if we have flagged
14021         the error before.  This is the other half of the problem. 
14022
14023         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14024         not have accessibility information, that is why we were returning
14025         true in the filter function in typemanager.cs.
14026
14027         To properly report 122 (property is inaccessible because of its
14028         protection level) correctly, we report this error in ResolveAccess
14029         by failing if both the setter and the getter are lacking (ie, the
14030         lookup failed). 
14031
14032         DoResolve and DoLResolve have been modified to check for both
14033         setter/getter being null and returning silently, the reason being
14034         that I did not want to put the knowledge about this error in upper
14035         layers, like:
14036
14037         int old = Report.Errors;
14038         x = new PropertyExpr (...);
14039         if (old != Report.Errors)
14040                 return null;
14041         else
14042                 return x;
14043
14044         So the property expr is returned, but it is invalid, so the error
14045         will be flagged during the resolve process. 
14046
14047         * class.cs: Remove InheritablePropertySignatureCompare from the
14048         class, as we no longer depend on the property signature to compute
14049         whether it is possible to implement a method or not.
14050
14051         The reason is that calling PropertyInfo.GetGetMethod will return
14052         null (in .NET, in Mono it works, and we should change this), in
14053         cases where the Get Method does not exist in that particular
14054         class.
14055
14056         So this code:
14057
14058         class X { public virtual int A { get { return 1; } } }
14059         class Y : X { }
14060         class Z : Y { public override int A { get { return 2; } } }
14061
14062         Would fail in Z because the parent (Y) would not have the property
14063         defined.  So we avoid this completely now (because the alternative
14064         fix was ugly and slow), and we now depend exclusively on the
14065         method names.
14066
14067         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14068         reference method, instead of using the property.
14069
14070         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14071         routines are gone now.
14072
14073         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14074         names, they were incorrectly named.
14075
14076         * cs-tokenizer.cs: Return are more gentle token on failure. 
14077
14078         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14079         had an out-of-sync index variable, which caused it to remove from
14080         the list of pending methods the wrong method sometimes.
14081
14082 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14083
14084         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14085         CanWrite, because those refer to this particular instance of the
14086         property, and do not take into account the fact that we can
14087         override single members of a property.
14088
14089         Constructor requires an EmitContext.  The resolution process does
14090         not happen here, but we need to compute the accessors before,
14091         because the resolution does not always happen for properties.
14092
14093         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14094         subclass, before we did not update this flag, but we did update
14095         bindingflags. 
14096
14097         (GetAccessors): Drop this routine, as it did not work in the
14098         presence of partially overwritten set/get methods. 
14099
14100         Notice that this broke the cs1540 detection, but that will require
14101         more thinking. 
14102
14103 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14104
14105         * class.cs:
14106         * codegen.cs:
14107         * driver.cs: issue a warning instead of an error if we don't support
14108         debugging for the platform. Also ignore a couple of errors that may
14109         arise when trying to write the symbols. Undo my previous patch.
14110
14111 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14112
14113         * driver.cs: ignore /debug switch except for Unix platforms.
14114
14115 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14116
14117         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14118
14119 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14120
14121         * driver.cs: Do not make mcs-debug conditional, so we do not break
14122         builds that use it.
14123
14124         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14125         review this patch.  But basically after all the children variables
14126         have been merged, the value of "Breaks" was not being set to
14127         new_breaks for Switch blocks.  I think that it should be set after
14128         it has executed.  Currently I set this to the value of new_breaks,
14129         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14130         conservative, but I do not understand this code very well.
14131
14132         I did not break anything in the build, so that is good ;-)
14133
14134         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14135
14136 2002-10-20  Mark Crichton  <crichton@gimp.org>
14137
14138         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14139
14140 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14141
14142         * cfold.cs: Fixed compile blocker.
14143
14144 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14145
14146         * driver.cs: I was chekcing the key, not the file.
14147
14148 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14149
14150         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14151         message that we were generating - we just need to silently return
14152         a null.
14153
14154 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14155
14156         * class.cs (Event.Define): Change my previous commit, as this
14157         breaks the debugger.  This is a temporary hack, as it seems like
14158         the compiler is generating events incorrectly to begin with.
14159
14160         * expression.cs (Binary.ResolveOperator): Added support for 
14161         "U operator - (E x, E y)"
14162
14163         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14164         y)".
14165
14166         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14167         init-only variables, but this path did not take into account that
14168         there might be also instance readonly variables.  Correct this
14169         problem. 
14170
14171         This fixes bug 32253
14172
14173         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14174         delegates as well.
14175
14176         * driver.cs: Change the extension for modules to `netmodule'
14177
14178         * cs-parser.jay: Improved slightly the location tracking for
14179         the debugger symbols.
14180
14181         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14182         modifiers that were specified instead of the hardcoded value
14183         (FamAndAssem).  This was basically ignoring the static modifier,
14184         and others.  Fixes 32429.
14185
14186         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14187         fixed a bug in the process (32476)
14188
14189         * expression.cs (ArrayAccess.EmitAssign): Patch from
14190         hwang_rob@yahoo.ca that fixes bug 31834.3
14191
14192 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14193
14194         * driver.cs: Make the module extension .netmodule.
14195
14196 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14197
14198         * driver.cs: Report an error if the resource file is not found
14199         instead of crashing.
14200
14201         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14202         false, like Emit does.
14203
14204 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14205
14206         * typemanager.cs: Remove unused private member.  Also reported mcs
14207         bug to report this as a warning like csc.
14208
14209 2002-10-15  Martin Baulig  <martin@gnome.org>
14210
14211         * statement.cs (Statement.Emit): Made this a virtual method; emits
14212         the line number info and calls DoEmit().
14213         (Statement.DoEmit): New protected abstract method, formerly knows
14214         as Statement.Emit().
14215
14216         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14217
14218 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14219
14220         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14221         have fixed a remaining problem: not every AddXXXX was adding a
14222         fully qualified name.  
14223
14224         Now everyone registers a fully qualified name in the DeclSpace as
14225         being defined instead of the partial name.  
14226
14227         Downsides: we are slower than we need to be due to the excess
14228         copies and the names being registered this way.  
14229
14230         The reason for this is that we currently depend (on the corlib
14231         bootstrap for instance) that types are fully qualified, because
14232         we dump all the types in the namespace, and we should really have
14233         types inserted into the proper namespace, so we can only store the
14234         basenames in the defined_names array.
14235
14236 2002-10-10  Martin Baulig  <martin@gnome.org>
14237
14238         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14239         from bug #31834, see the bug report for a testcase which is
14240         miscompiled.
14241
14242 2002-10-10  Martin Baulig  <martin@gnome.org>
14243
14244         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14245         flow analysis code for this.
14246
14247         * statement.cs (Do, While, For): Tell the flow analysis code about
14248         infinite loops.
14249         (FlowBranching.UsageVector): Added support for infinite loops.
14250         (Block.Resolve): Moved the dead code elimination here and use flow
14251         analysis to do it.
14252
14253 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14254
14255         * class.cs (Field.Define): Catch cycles on struct type
14256         definitions. 
14257
14258         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14259         fields if the fields are static.  We only need to check instance
14260         fields. 
14261
14262         * expression.cs (As.DoResolve): Test for reference type.
14263
14264         * statement.cs (Using.ResolveExpression): Use
14265         ConvertImplicitRequired, not ConvertImplicit which reports an
14266         error on failture
14267         (Using.ResolveLocalVariableDecls): ditto.
14268
14269         * expression.cs (Binary.ResolveOperator): Report errors in a few
14270         places where we had to.
14271
14272         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14273
14274 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14275
14276         * expression.cs: Use StoreFromPtr instead of extracting the type
14277         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14278
14279         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14280         an enumeration value to a System.Enum, but System.Enum is not a
14281         value type, but an class type, so we need to box.
14282
14283         (Expression.ConvertExplicit): One codepath could return
14284         errors but not flag them.  Fix this.  Fixes #31853
14285
14286         * parameter.cs (Resolve): Do not allow void as a parameter type.
14287
14288 2002-10-06  Martin Baulig  <martin@gnome.org>
14289
14290         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14291         if it's a class type and not a struct.  Fixes #31815.
14292
14293 2002-10-06  Martin Baulig  <martin@gnome.org>
14294
14295         * statement.cs: Reworked the flow analysis code a bit to make it
14296         usable for dead code elimination.
14297
14298 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14299
14300         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14301
14302 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14303
14304         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14305         to fix the test 165, will investigate deeper.
14306
14307 2002-10-04  Martin Baulig  <martin@gnome.org>
14308
14309         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14310         finally blocks actually work.
14311         (Try.Resolve): We don't need to create a sibling for `finally' if
14312         there is no finally block.
14313
14314 2002-10-04  Martin Baulig  <martin@gnome.org>
14315
14316         * class.cs (Constructor.Define): The default accessibility for a
14317         non-default constructor is private, not public.
14318
14319 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14320
14321         * class.cs (Constructor): Make AllowedModifiers public, add
14322         EXTERN.
14323
14324         * cs-parser.jay: Perform the modifiers test here, as the
14325         constructor for the Constructor class usually receives a zero
14326         because of the way we create it (first we create, later we
14327         customize, and we were never checking the modifiers).
14328
14329         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14330         is a version of LookupTypeReflection that includes the type-name
14331         cache.  This can be used as a fast path for functions that know
14332         the fully qualified name and are only calling into *.GetType() to
14333         obtain a composed type.
14334
14335         This is also used by TypeManager.LookupType during its type
14336         composition.
14337
14338         (LookupType): We now also track the real type name, as sometimes
14339         we can get a quey for the real type name from things like
14340         ComposedCast.  This fixes bug 31422.
14341
14342         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14343         complete type fullname, it does not have to go through the type
14344         resolution system to obtain the composed version of the type (for
14345         obtaining arrays or pointers).
14346
14347         (Conditional.Emit): Use the EmitBoolExpression to
14348         generate nicer code, as requested by Paolo.
14349
14350         (ArrayCreation.CheckIndices): Use the patch from
14351         hwang_rob@yahoo.ca to validate the array initializers. 
14352
14353 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14354
14355         * class.cs (ConstructorInitializer.Emit): simplify code by using
14356         Invocation.EmitCall, and at the same time, fix the bugs in calling
14357         parent constructors that took variable arguments. 
14358
14359         * ecore.cs (Expression.ConvertNumericExplicit,
14360         Expression.ImplicitNumericConversion): Remove the code that
14361         manually wrapped decimal (InternalTypeConstructor call is now gone
14362         as well).
14363
14364         * expression.cs (Cast.TryReduce): Also handle decimal types when
14365         trying to perform a constant fold on the type.
14366
14367         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14368
14369         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14370         that only turned off an error report, and did nothing else. 
14371
14372 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14373
14374         * driver.cs: Handle and ignore /fullpaths
14375
14376 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14377
14378         * expression.cs (Binary.ResolveOperator): Catch the case where
14379         DoNumericPromotions returns true, 
14380
14381         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14382
14383 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14384
14385         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14386         report error 70.
14387
14388 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14389
14390         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14391         conversion exists, but it is also required that the conversion be
14392         performed.  This manifested in "(Type64Enum) 2".  
14393
14394         * class.cs (TypeManager.AddMethod): The fix is not to change
14395         AddEnum, because that one was using a fully qualified name (every
14396         DeclSpace derivative does), but to change the AddMethod routine
14397         that was using an un-namespaced name.  This now correctly reports
14398         the duplicated name.
14399
14400         Revert patch until I can properly fix it.  The issue
14401         is that we have a shared Type space across all namespaces
14402         currently, which is wrong.
14403
14404         Options include making the Namespace a DeclSpace, and merge
14405         current_namespace/current_container in the parser.
14406
14407 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14408
14409         * cs-parser.jay: Improve error reporting when we get a different
14410         kind of expression in local_variable_type and
14411         local_variable_pointer_type. 
14412
14413         Propagate this to avoid missleading errors being reported.
14414
14415         * ecore.cs (ImplicitReferenceConversion): treat
14416         TypeManager.value_type as a target just like object_type.   As
14417         code like this:
14418
14419         ValueType v = 1;
14420
14421         Is valid, and needs to result in the int 1 being boxed before it
14422         is assigned to the value type v.
14423
14424         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14425         to validate the enumeration name.
14426
14427         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14428         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14429         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14430
14431         * ecore.cs (TryImplicitIntConversion): When doing an
14432         implicit-enumeration-conversion, check if the type is 64-bits and
14433         perform a conversion before passing to EnumConstant.
14434
14435 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14436
14437         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14438         report ambiguous type references.  Unlike the MS version, we
14439         report what the ambiguity is.   Innovation at work ;-)
14440
14441         (DeclSpace.FindType): Require a location argument to
14442         display when we display an ambiguous error.
14443
14444         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14445
14446         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14447
14448         * expression.cs (EmitDynamicInitializers): Apply patch from
14449         hwang_rob@yahoo.ca that fixes the order in which we emit our
14450         initializers. 
14451
14452 2002-09-21  Martin Baulig  <martin@gnome.org>
14453
14454         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14455         delegate takes no arguments.
14456
14457 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14458
14459         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14460         from integers.
14461
14462         * expression.cs: Extract the underlying type.
14463
14464         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14465
14466         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14467
14468 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14469
14470         * class.cs (TypeContainer.DefineType): We can not use the nice
14471         PackingSize with the size set to 1 DefineType method, because it
14472         will not allow us to define the interfaces that the struct
14473         implements.
14474
14475         This completes the fixing of bug 27287
14476
14477         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14478         means also structs.  This fixes part of the problem. 
14479         (Expresion.ImplicitReferenceConversionExists): ditto.
14480
14481         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14482         error if there were no errors reported during the type lookup
14483         process, to avoid duplicates or redundant errors.  Without this
14484         you would get an ambiguous errors plus a type not found.  We have
14485         beaten the user enough with the first error.  
14486
14487         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14488         reference. 
14489
14490         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14491         during the resolution process, stop the lookup, this avoids
14492         repeated error reports (same error twice).
14493
14494         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14495
14496         * typemanager.cs (LookupType): Redo the type lookup code to match
14497         the needs of System.Reflection.  
14498
14499         The issue is that System.Reflection requires references to nested
14500         types to begin with a "+" sign instead of a dot.  So toplevel
14501         types look like: "NameSpace.TopLevelClass", and nested ones look
14502         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14503         levels. 
14504
14505 2002-09-19  Martin Baulig  <martin@gnome.org>
14506
14507         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14508         says that a method always returns or always throws an exception,
14509         don't report the CS0161.
14510
14511         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14512         set `Returns = new_returns'.
14513
14514 2002-09-19  Martin Baulig  <martin@gnome.org>
14515
14516         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14517         to an enum constant, check for a CS0176.
14518
14519 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14520
14521         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14522         for operators that must be in pairs and report errors.
14523
14524         * ecore.cs (SimpleName.DoResolveType): During the initial type
14525         resolution process, when we define types recursively, we must
14526         check first for types in our current scope before we perform
14527         lookups in the enclosing scopes.
14528
14529         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14530
14531         (Invocation.VerifyArgumentsCompat): Call
14532         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14533         I thought we were supposed to always call this, but there are a
14534         few places in the code where we dont do it.
14535
14536 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14537
14538         * driver.cs: Add support in -linkres and -resource to specify the
14539         name of the identifier.
14540
14541 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14542
14543         * ecore.cs (StandardConversionExists): Sync with the conversion
14544         code: allow anything-* to void* conversions.
14545
14546         (FindMostSpecificSource): Use an Expression argument
14547         instead of a Type, because we might be handed over a Literal which
14548         gets a few more implicit conversions that plain types do not.  So
14549         this information was being lost.
14550
14551         Also, we drop the temporary type-holder expression when not
14552         required.
14553
14554 2002-09-17  Martin Baulig  <martin@gnome.org>
14555
14556         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14557         this is an explicit interface implementation.
14558
14559 2002-09-17  Martin Baulig  <martin@gnome.org>
14560
14561         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14562         different `IndexerName' attributes.
14563
14564         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14565         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14566         virtual CommonResolve().
14567
14568 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14569
14570         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14571         and convert that to the UnderlyingType.
14572
14573         * statement.cs (Foreach.Resolve): Indexers are just like variables
14574         or PropertyAccesses.
14575
14576         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14577         inside quoted strings, we were not doing this before.
14578
14579 2002-09-16  Martin Baulig  <martin@gnome.org>
14580
14581         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14582         resolve it.  This is needed for the definite assignment check of the
14583         instance expression, fixes bug #29846.
14584         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14585
14586 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14587
14588         * parameter.cs: Fix compile error.  Cannot reference static member
14589         from an instance object.  Is this an mcs bug?
14590
14591 2002-09-14  Martin Baulig  <martin@gnome.org>
14592
14593         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14594         multiple times.  Fixes bug #30295, added test-166.cs.
14595
14596 2002-09-14  Martin Baulig  <martin@gnome.org>
14597
14598         * statement.cs (Block.Emit): Don't emit unreachable code.
14599         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14600         `break' statements.
14601         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14602
14603 2002-09-14  Martin Baulig  <martin@gnome.org>
14604
14605         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14606         is set.
14607
14608 2002-09-14  Martin Baulig  <martin@gnome.org>
14609
14610         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14611         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14612         be false on the ms runtime.
14613
14614 2002-09-13  Martin Baulig  <martin@gnome.org>
14615
14616         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14617         the CS0038 error message.
14618
14619 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14620
14621         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14622         constant inside, return it.
14623
14624 2002-09-12  Martin Baulig  <martin@gnome.org>
14625
14626         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14627         implicit conversion can be done between enum types.
14628
14629         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14630         check whether an implicit conversion to the current enum's UnderlyingType
14631         exists and report an error if not.
14632
14633         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14634         without debugging support.
14635
14636         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14637         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14638
14639 2002-09-12  Martin Baulig  <martin@gnome.org>
14640
14641         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14642
14643         * ecore.cs (IMemberExpr.DeclaringType): New property.
14644         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14645         nonstatic member of an outer type (CS0038).
14646
14647 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14648
14649         * driver.cs: Activate the using-error detector at warning level
14650         4 (at least for MS-compatible APIs).
14651
14652         * namespace.cs (VerifyUsing): Small buglett fix.
14653
14654         * pending.cs (PendingImplementation): pass the container pointer. 
14655
14656         * interface.cs (GetMethods): Allow for recursive definition.  Long
14657         term, I would like to move every type to support recursive
14658         definitions, not the current ordering mechanism that we have right
14659         now.
14660
14661         The situation is this: Attributes are handled before interfaces,
14662         so we can apply attributes to interfaces.  But some attributes
14663         implement interfaces, we will now handle the simple cases
14664         (recursive definitions will just get an error).  
14665
14666         * parameter.cs: Only invalidate types at the end if we fail to
14667         lookup all types.  
14668
14669 2002-09-09  Martin Baulig  <martin@gnome.org>
14670
14671         * ecore.cs (PropertyExpr.Emit): Also check for
14672         TypeManager.system_int_array_get_length so this'll also work when
14673         compiling corlib.  Fixes #30003.
14674
14675 2002-09-09  Martin Baulig  <martin@gnome.org>
14676
14677         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14678         and throw an exception if we can't get the type's size.  Fixed #30040,
14679         added test-165.cs.
14680
14681 2002-09-09  Martin Baulig  <martin@gnome.org>
14682
14683         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14684
14685         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14686         context.  Fixes bug #30027.
14687
14688         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14689         virtual functions.  Fixes bug #30043, added test-164.cs.
14690
14691 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14692
14693         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14694
14695 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14696
14697         * driver.cs: Use an object to get the windows codepage since it's not a
14698         static property.
14699
14700 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14701
14702         * statement.cs (For.Emit): for infinite loops (test == null)
14703         return whether there is a break inside, not always "true".
14704
14705         * namespace.cs (UsingEntry): New struct to hold the name of the
14706         using definition, the location where it is defined, and whether it
14707         has been used in a successful type lookup.
14708
14709         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14710         strings.
14711
14712         * decl.cs: ditto.
14713
14714 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14715
14716         * attribute.cs : Fix incorrect code which relied on catching
14717         a NullReferenceException to detect a null being passed in
14718         where an object was expected.
14719
14720 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14721
14722         * statement.cs (Try): flag the catch variable as assigned
14723
14724         * expression.cs (Cast): Simplified by using ResolveType instead of
14725         manually resolving.
14726
14727         * statement.cs (Catch): Fix bug by using ResolveType.
14728
14729 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14730
14731         * expression.cs (BetterConversion): Special case for when we have
14732         a NullLiteral as the argument and we have to choose between string
14733         and object types - we choose string the way csc does.
14734
14735         * attribute.cs (Attribute.Resolve): Catch the
14736         NullReferenceException and report error #182 since the Mono
14737         runtime no more has the bug and having this exception raised means
14738         we tried to select a constructor which takes an object and is
14739         passed a null.
14740
14741 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14742
14743         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14744         message (1502, 1503) when we can't locate a method after overload
14745         resolution. This is much more informative and closes the bug
14746         Miguel reported.
14747
14748         * interface.cs (PopulateMethod): Return if there are no argument
14749         types. Fixes a NullReferenceException bug.
14750
14751         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14752         expressions too. Previously we were checking only in one place for
14753         positional arguments leaving out named arguments.
14754
14755         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14756         type to the enum type is not allowed. Remove code corresponding to
14757         that.
14758
14759         (ConvertNumericExplicit): Allow explicit conversions from
14760         the underlying type to enum type. This precisely follows the spec
14761         and closes a bug filed by Gonzalo.
14762
14763 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14764
14765         * compiler.csproj:
14766         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14767
14768 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14769
14770         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14771         it was important that we stored the right value after the
14772         reduction in `converted'.
14773
14774 2002-09-04  Martin Baulig  <martin@gnome.org>
14775
14776         * location.cs (Location.SymbolDocument): Use full pathnames for the
14777         source files.
14778
14779 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14780
14781         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14782         of the expression resolve mechanism, because that will catch the
14783         SimpleName error failures.
14784
14785         (Conditional): If we can not resolve the
14786         expression, return, do not crash.
14787
14788 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14789
14790         * cs-tokenizer.cs:
14791         (location): display token name instead of its number.
14792
14793 2002-08-28  Martin Baulig  <martin@gnome.org>
14794
14795         * expression.cs (Binary.ResolveOperator): Don't silently return
14796         but return an error if an operator cannot be applied between two
14797         enum types.
14798
14799 2002-08-28  Martin Baulig  <martin@gnome.org>
14800
14801         * class.cs (Constructor.Define): Set the permission attributes
14802         correctly instead of making all constructors public.
14803
14804 2002-08-28  Martin Baulig  <martin@gnome.org>
14805
14806         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14807         for private members before reporting a CS0103; if we find anything,
14808         it's a CS0122.
14809
14810 2002-08-28  Martin Baulig  <martin@gnome.org>
14811
14812         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14813         to check whether `closure_start_type == closure_invocation_type',
14814         we also need to check whether `m.DeclaringType == closure_invocation_type'
14815         before bypassing the permission checks.  We might be accessing
14816         protected/private members from the base class.
14817         (TypeManager.RealMemberLookup): Only set private_ok if private
14818         members were requested via BindingFlags.NonPublic.
14819
14820         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14821
14822         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14823         MethodGroupExpr.IsExplicitImpl if appropriate.
14824         (Invocation.DoResolve): Don't report the CS0120 for explicit
14825         interface implementations.
14826
14827 2002-08-27  Martin Baulig  <martin@gnome.org>
14828
14829         * expression.cs (Invocation.DoResolve): If this is a static
14830         method and we don't have an InstanceExpression, we must report
14831         a CS0120.
14832
14833 2002-08-25  Martin Baulig  <martin@gnome.org>
14834
14835         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14836         `==' between a valuetype and an object.
14837
14838 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14839
14840         * ecore.cs (TypeExpr): Provide a ToString method.
14841
14842 2002-08-24  Martin Baulig  <martin@gnome.org>
14843
14844         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14845         now called proggie.dbg and it's a binary file.
14846
14847 2002-08-23  Martin Baulig  <martin@gnome.org>
14848
14849         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14850
14851 2002-08-23  Martin Baulig  <martin@gnome.org>
14852
14853         * struct.cs (MyStructInfo.ctor): Make this work with empty
14854         structs; it's not allowed to use foreach() on null.
14855
14856 2002-08-23  Martin Baulig  <martin@gnome.org>
14857
14858         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14859         writer the full pathname of the generated assembly.
14860
14861 2002-08-23  Martin Baulig  <martin@gnome.org>
14862
14863         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14864         A `finally' block never returns or breaks; improved handling of
14865         unreachable code.
14866
14867 2002-08-23  Martin Baulig  <martin@gnome.org>
14868
14869         * statement.cs (Throw.Resolve): Allow `throw null'.
14870
14871 2002-08-23  Martin Baulig  <martin@gnome.org>
14872
14873         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14874         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14875         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
14876         MemberLookup would return a wrong event if this is an explicit
14877         interface implementation and the class has an event with the same
14878         name.
14879
14880 2002-08-23  Martin Baulig  <martin@gnome.org>
14881
14882         * statement.cs (Block.AddChildVariableNames): New public method.
14883         (Block.AddChildVariableName): Likewise.
14884         (Block.IsVariableNameUsedInChildBlock): Likewise.
14885         (Block.AddVariable): Check whether a variable name has already
14886         been used in a child block.
14887
14888         * cs-parser.jay (declare_local_variables): Mark all variable names
14889         from the current block as being used in a child block in the
14890         implicit block.
14891
14892 2002-08-23  Martin Baulig  <martin@gnome.org>
14893
14894         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14895         find the symbol writer.
14896
14897         * driver.cs: csc also allows the arguments to /define being
14898         separated by commas, not only by semicolons.
14899
14900 2002-08-23  Martin Baulig  <martin@gnome.org>
14901
14902         * interface.cs (Interface.GetMembers): Added static check for events.
14903
14904 2002-08-15  Martin Baulig  <martin@gnome.org>
14905
14906         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14907         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14908
14909         * ecore.cs (Expression.MemberLookup): Added documentation and explained
14910         why the MethodData.EmitDestructor() change was necessary.
14911
14912 2002-08-20  Martin Baulig  <martin@gnome.org>
14913
14914         * class.cs (TypeContainer.FindMembers): Added static check for events.
14915
14916         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14917
14918         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14919         use Type.GetEvents(), not Type.FindMembers().
14920
14921 2002-08-20  Martin Baulig  <martin@gnome.org>
14922
14923         * decl.cs (MemberCache): Added a special method cache which will
14924         be used for method-only searched.  This ensures that a method
14925         search will return a MethodInfo with the correct ReflectedType for
14926         inherited methods.      
14927
14928 2002-08-20  Martin Baulig  <martin@gnome.org>
14929
14930         * decl.cs (DeclSpace.FindMembers): Made this public.
14931
14932 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14933
14934         * delegate.cs: fixed build on windows.
14935         [FIXME:  Filed as bug #29150: MCS must report these errors.]
14936
14937 2002-08-19  Ravi Pratap  <ravi@ximian.com>
14938
14939         * ecore.cs (StandardConversionExists): Return a false
14940         if we are trying to convert the void type to anything else
14941         since that is not allowed.
14942
14943         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14944         we flag error 70 in the event an event is trying to be accessed
14945         directly from outside the declaring type.
14946
14947 2002-08-20  Martin Baulig  <martin@gnome.org>
14948
14949         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14950         MemberCache from typemanager.cs to decl.cs.
14951
14952 2002-08-19  Martin Baulig  <martin@gnome.org>
14953
14954         * class.cs (TypeContainer): Implement IMemberContainer.
14955         (TypeContainer.DefineMembers): Create the MemberCache.
14956         (TypeContainer.FindMembers): Do better BindingFlags checking; only
14957         return public members if BindingFlags.Public was given, check
14958         whether members are static.
14959
14960 2002-08-16  Martin Baulig  <martin@gnome.org>
14961
14962         * decl.cs (DeclSpace.Define): Splitted this in Define and
14963         DefineMembers.  DefineMembers is called first and initializes the
14964         MemberCache.
14965
14966         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
14967         DefineMembers() on all our DeclSpaces.
14968
14969         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14970         but call DefineMembers() on all nested interfaces.  We call their
14971         Define() in our new Define() function.
14972
14973         * interface.cs (Interface): Implement IMemberContainer.
14974         (Interface.Define): Moved all code except the attribute stuf to
14975         DefineMembers().
14976         (Interface.DefineMembers): Initialize the member cache.
14977
14978         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14979         need this anymore since we can use MemberCache.FindMembers directly.
14980
14981 2002-08-19  Martin Baulig  <martin@gnome.org>
14982
14983         * typemanager.cs (MemberCache): When creating the cache for an
14984         interface type, add all inherited members.
14985         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14986         to `out bool used_cache' and documented it.
14987         (TypeManager.MemberLookup): If we already used the cache in the first
14988         iteration, we don't need to do the interfaces check.
14989
14990 2002-08-19  Martin Baulig  <martin@gnome.org>
14991
14992         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14993         here from IMemberFinder and don't implement this interface anymore.
14994         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14995
14996         * typemanager.cs (IMemberFinder): This interface is now only used by
14997         classes which actually support the member cache.
14998         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14999         since we only put DeclSpaces into this Hashtable.
15000         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15001         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15002
15003 2002-08-16  Martin Baulig  <martin@gnome.org>
15004
15005         * typemanager.cs (ICachingMemberFinder): Removed.
15006         (IMemberFinder.MemberCache): New property.
15007         (TypeManager.FindMembers): Merged this with RealFindMembers().
15008         This function will never be called from TypeManager.MemberLookup()
15009         so we can't use the cache here, just the IMemberFinder.
15010         (TypeManager.MemberLookup_FindMembers): Check whether the
15011         IMemberFinder has a MemberCache and call the cache's FindMembers
15012         function.
15013         (MemberCache): Rewrote larger parts of this yet another time and
15014         cleaned it up a bit.
15015
15016 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15017
15018         * driver.cs (LoadArgs): Support quoting.
15019
15020         (Usage): Show the CSC-like command line arguments.
15021
15022         Improved a few error messages.
15023
15024 2002-08-15  Martin Baulig  <martin@gnome.org>
15025
15026         * typemanager.cs (IMemberContainer.Type): New property.
15027         (IMemberContainer.IsInterface): New property.
15028
15029         The following changes are conditional to BROKEN_RUNTIME, which is
15030         defined at the top of the file.
15031
15032         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15033         class'es members, but add all members from TypeHandle.ObjectType
15034         if we're an interface.
15035         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15036         is the current type.
15037         (MemberCache.CacheEntry.Container): Removed this field.
15038         (TypeHandle.GetMembers): Include inherited members.
15039
15040 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15041
15042         * typemanager.cs: fixed compilation and added a comment on a field that
15043         is never used.
15044
15045 2002-08-15  Martin Baulig  <martin@gnome.org>
15046
15047         * class.cs (ConstructorInitializer.Resolve): In the
15048         Expression.MemberLookup call, use the queried_type as
15049         invocation_type.
15050
15051         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15052         declared' attribute, it's always true.
15053         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15054         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15055         temporary wrapper for FindMembers which tells MemberLookup whether
15056         members from the base classes are included in the return value.
15057         This will go away soon.
15058         (TypeManager.MemberLookup): Use this temporary hack here; once the
15059         new MemberCache is completed, we don't need to do the DeclaredOnly
15060         looping here anymore since the MemberCache will take care of this.
15061         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15062         (MemberCache): When creating the MemberCache for a class, get
15063         members from the current class and all its base classes.
15064         (MemberCache.CacheEntry.Container): New field.  This is a
15065         temporary hack until the Mono runtime is fixed to distinguish
15066         between ReflectedType and DeclaringType.  It allows us to use MCS
15067         with both the MS runtime and the unfixed Mono runtime without
15068         problems and without accecting performance.
15069         (MemberCache.SearchMembers): The DeclaredOnly looping from
15070         TypeManager.MemberLookup is now done here.      
15071
15072 2002-08-14  Martin Baulig  <martin@gnome.org>
15073
15074         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15075         Type.GetFields on dynamic types but get the fields from the
15076         corresponding TypeContainer.
15077         (MyStructInfo.GetStructInfo): Added check for enum types.
15078
15079         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15080         (MemberList.SyncRoot): Implemented.
15081         (TypeManager.FilterWithClosure): No need to check permissions if
15082         closure_start_type == closure_invocation_type, don't crash if
15083         closure_invocation_type is null.
15084
15085 2002-08-13  Martin Baulig  <martin@gnome.org>
15086
15087         Rewrote TypeContainer.FindMembers to use a member cache.  This
15088         gives us a speed increase of about 35% for the self-hosting MCS
15089         build and of about 15-20% for the class libs (both on GNU/Linux).
15090
15091         * report.cs (Timer): New class to get enhanced profiling.  This
15092         whole class is "TIMER" conditional since it remarkably slows down
15093         compilation speed.
15094
15095         * class.cs (MemberList): New class.  This is an IList wrapper
15096         which we're now using instead of passing MemberInfo[]'s around to
15097         avoid copying this array unnecessarily.
15098         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15099         (ICachingMemberFinder, IMemberContainer): New interface.
15100         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15101         has already been checked, otherwise use it for the name comparision.
15102         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15103         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15104         if possible.  Returns a MemberList, not a MemberInfo [].
15105         (TypeHandle): New class, implements IMemberContainer.  We create
15106         one instance of this class per type, it contains a MemberCache
15107         which is used to do the member lookups.
15108         (MemberCache): New class.  Each instance of this class contains
15109         all members of a type and a name-based hash table.
15110         (MemberCache.FindMembers): This is our new member lookup
15111         function.  First, it looks up all members of the requested name in
15112         the hash table.  Then, it walks this list and sorts out all
15113         applicable members and returns them.
15114
15115 2002-08-13  Martin Baulig  <martin@gnome.org>
15116
15117         In addition to a nice code cleanup, this gives us a performance
15118         increase of about 1.4% on GNU/Linux - not much, but it's already
15119         half a second for the self-hosting MCS compilation.
15120
15121         * typemanager.cs (IMemberFinder): New interface.  It is used by
15122         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15123         Enum, Delegate or Interface.
15124         (TypeManager.finder_to_member_finder): New PtrHashtable.
15125         (TypeManager.finder_to_container): Removed.
15126         (TypeManager.finder_to_delegate): Removed.
15127         (TypeManager.finder_to_interface): Removed.
15128         (TypeManager.finder_to_enum): Removed.
15129
15130         * interface.cs (Interface): Implement IMemberFinder.
15131
15132         * delegate.cs (Delegate): Implement IMemberFinder.
15133
15134         * enum.cs (Enum): Implement IMemberFinder.
15135
15136         * class.cs (TypeContainer): Implement IMemberFinder.
15137
15138 2002-08-12  Martin Baulig  <martin@gnome.org>
15139
15140         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15141
15142 2002-08-12  Martin Baulig  <martin@gnome.org>
15143
15144         * ecore.cs (ITypeExpression): New interface for expressions which
15145         resolve to a type.
15146         (TypeExpression): Renamed to TypeLookupExpression.
15147         (Expression.DoResolve): If we're doing a types-only lookup, the
15148         expression must implement the ITypeExpression interface and we
15149         call DoResolveType() on it.
15150         (SimpleName): Implement the new ITypeExpression interface.
15151         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15152         hack, the situation that we're only looking up types can't happen
15153         anymore when this method is called.  Moved the type lookup code to
15154         DoResolveType() and call it.
15155         (SimpleName.DoResolveType): This ITypeExpression interface method
15156         is now doing the types-only lookup.
15157         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15158         (ResolveFlags): Added MaskExprClass.
15159
15160         * expression.cs (MemberAccess): Implement the ITypeExpression
15161         interface.
15162         (MemberAccess.DoResolve): Added support for a types-only lookup
15163         when we're called via ITypeExpression.DoResolveType().
15164         (ComposedCast): Implement the ITypeExpression interface.
15165
15166         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15167         Expression.Resolve() with ResolveFlags.Type instead.
15168
15169 2002-08-12  Martin Baulig  <martin@gnome.org>
15170
15171         * interface.cs (Interface.Define): Apply attributes.
15172
15173         * attribute.cs (Attribute.ApplyAttributes): Added support for
15174         interface attributes.
15175
15176 2002-08-11  Martin Baulig  <martin@gnome.org>
15177
15178         * statement.cs (Block.Emit): Only check the "this" variable if we
15179         do not always throw an exception.
15180
15181         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15182         whether the property has a set accessor.
15183
15184 2002-08-11  Martin Baulig  <martin@gnome.org>
15185
15186         Added control flow analysis support for structs.
15187
15188         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15189         with control flow analysis turned off.
15190         (IVariable): New interface.
15191         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15192         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15193         (FieldExpr.DoResolve): Resolve the instance expression with flow
15194         analysis turned off and do the definite assignment check after the
15195         resolving when we know what the expression will resolve to.
15196
15197         * expression.cs (LocalVariableReference, ParameterReference):
15198         Implement the new IVariable interface, only call the flow analysis
15199         code if ec.DoFlowAnalysis is true.
15200         (This): Added constructor which takes a Block argument.  Implement
15201         the new IVariable interface.
15202         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15203         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15204         This does the definite assignment checks for struct members.
15205
15206         * class.cs (Constructor.Emit): If this is a non-static `struct'
15207         constructor which doesn't have any initializer, call
15208         Block.AddThisVariable() to tell the flow analysis code that all
15209         struct elements must be initialized before control returns from
15210         the constructor.
15211
15212         * statement.cs (MyStructInfo): New public class.
15213         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15214         argument to this indexer.  If non-zero, check an individual struct
15215         member, not the whole struct.
15216         (FlowBranching.CheckOutParameters): Check struct members.
15217         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15218         overloaded versions of these methods which take an additional
15219         `int field_idx' argument to check struct members.
15220         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15221         overloaded versions of these methods which take an additional
15222         `string field_name' argument to check struct member.s
15223         (VariableInfo): Implement the IVariable interface.
15224         (VariableInfo.StructInfo): New public property.  Returns the
15225         MyStructInfo instance of the variable if it's a struct or null.
15226         (Block.AddThisVariable): New public method.  This is called from
15227         Constructor.Emit() for non-static `struct' constructor which do
15228         not have any initializer.  It creates a special variable for the
15229         "this" instance variable which will be checked by the flow
15230         analysis code to ensure that all of the struct's fields are
15231         initialized before control returns from the constructor.
15232         (UsageVector): Added support for struct members.  If a
15233         variable/parameter is a struct with N members, we reserve a slot
15234         in the usage vector for each member.  A struct is considered fully
15235         initialized if either the struct itself (slot 0) or all its
15236         members are initialized.
15237
15238 2002-08-08  Martin Baulig  <martin@gnome.org>
15239
15240         * driver.cs (Driver.MainDriver): Only report an error CS5001
15241         if there were no compilation errors.
15242
15243         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15244         `UnsafeContext' property to determine whether the parent is in
15245         unsafe context rather than checking the parent's ModFlags:
15246         classes nested in an unsafe class are unsafe as well.
15247
15248 2002-08-08  Martin Baulig  <martin@gnome.org>
15249
15250         * statement.cs (UsageVector.MergeChildren): Distinguish between
15251         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15252         we return.  Added test17() and test18() to test-154.cs.
15253
15254 2002-08-08  Martin Baulig  <martin@gnome.org>
15255
15256         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15257         Family access, make sure the invoking type isn't a subclass of the
15258         queried type (that'd be a CS1540).
15259
15260         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15261         this method which takes an additional `Type invocation_type'.
15262
15263         * expression.cs (BaseAccess.DoResolve): Use the base type as
15264         invocation and query type.
15265         (MemberAccess.DoResolve): If the lookup failed and we're about to
15266         report a CS0122, try a lookup with the ec.ContainerType - if this
15267         succeeds, we must report a CS1540.
15268
15269 2002-08-08  Martin Baulig  <martin@gnome.org>
15270
15271         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15272         (MethodGroupExpr): Implement the IMemberExpr interface.
15273
15274         * expression (MemberAccess.ResolveMemberAccess): No need to have
15275         any special code for MethodGroupExprs anymore, they're now
15276         IMemberExprs.   
15277
15278 2002-08-08  Martin Baulig  <martin@gnome.org>
15279
15280         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15281         Family, FamANDAssem and FamORAssem permissions.
15282         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15283
15284 2002-08-08  Martin Baulig  <martin@gnome.org>
15285
15286         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15287         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15288         or loop block.
15289
15290 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15291
15292         * driver.cs: implemented /resource option to embed managed resources.
15293
15294 2002-08-07  Martin Baulig  <martin@gnome.org>
15295
15296         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15297         (FieldBase.HasFieldInitializer): New public property.
15298         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15299         returns the field initializer and makes sure it is only resolved once.
15300         (TypeContainer.EmitFieldInitializers): Call
15301         FieldBase.GetInitializerExpression to get the initializer, this ensures
15302         that it isn't resolved multiple times.
15303
15304         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15305         the resolving process (SimpleName/MemberLookup) that we're currently
15306         emitting a field initializer (which must not access any instance members,
15307         this is an error CS0236).
15308
15309         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15310         argument, if the `IsFieldInitializer' flag is set, we must report and
15311         error CS0236 and not an error CS0120.   
15312
15313 2002-08-07  Martin Baulig  <martin@gnome.org>
15314
15315         * ecore.cs (IMemberExpr): New public interface.
15316         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15317         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15318         if the expression is an IMemberExpr.
15319
15320         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15321         to be null, implicitly default to `this' if we're non-static in
15322         this case.  Simplified the code a lot by using the new IMemberExpr
15323         interface.  Also fixed bug #28176 here.
15324
15325 2002-08-06  Martin Baulig  <martin@gnome.org>
15326
15327         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15328         ParameterReferences during semantic analysis so that we can do a
15329         type-only search when resolving Cast, TypeOf and SizeOf.
15330         (block): Pass the `current_local_parameters' to the Block's
15331         constructor.
15332
15333         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15334         argument to the constructor.
15335         (ConstructorInitializer.Resolve): Create a temporary implicit
15336         block with the parameters.
15337
15338         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15339         references here if we aren't doing a type-only search.
15340
15341         * statement.cs (Block): Added constructor which takes a
15342         `Parameters parameters' argument.
15343         (Block.Parameters): New public property.
15344
15345         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15346         to `Parameters' and made it public readonly.
15347
15348 2002-08-06  Martin Baulig  <martin@gnome.org>
15349
15350         * ecore.cs (Expression.Warning): Made this public as well.
15351
15352         * report.cs (Report.Debug): Print the contents of collections.
15353
15354 2002-08-06  Martin Baulig  <martin@gnome.org>
15355
15356         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15357         used to tell Resolve() which kinds of expressions it may return.
15358         (Expression.Resolve): Added overloaded version of this method which
15359         takes a `ResolveFlags flags' argument.  This can be used to tell
15360         Resolve() which kinds of expressions it may return.  Reports a
15361         CS0118 on error.
15362         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15363         ResolveFlags.SimpleName.
15364         (Expression.Error118): Added overloaded version of this method which
15365         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15366         which kinds of expressions are allowed.
15367
15368         * expression.cs (Argument.ResolveMethodGroup): New public method.
15369         Resolves an argument, but allows a MethodGroup to be returned.
15370         This is used when invoking a delegate.
15371
15372         * TODO: Updated a bit.
15373
15374 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15375
15376         Fixed compilation with csc.
15377
15378         * ecore.cs: Expression.Error made public. Is this correct? Should
15379         Warning be made public too?
15380
15381         * expression.cs: use ea.Location instead of ea.loc.
15382         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15383
15384 2002-08-06  Martin Baulig  <martin@gnome.org>
15385
15386         * ecore.cs (Expression.loc): Moved the location here instead of
15387         duplicating it in all derived classes.
15388         (Expression.Location): New public property.
15389         (Expression.Error, Expression.Warning): Made them non-static and
15390         removed the location argument.
15391         (Expression.Warning): Added overloaded version which takes an
15392         `int level' argument.
15393         (Expression.Error118): Make this non-static and removed the
15394         expression and location arguments.
15395         (TypeExpr): Added location argument to the constructor.
15396
15397         * expression.cs (StaticCallExpr): Added location argument to
15398         the constructor.
15399         (Indirection, PointerArithmetic): Likewise.
15400         (CheckedExpr, UnCheckedExpr): Likewise.
15401         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15402         (StringPtr): Likewise.
15403
15404
15405 2002-08-05  Martin Baulig  <martin@gnome.org>
15406
15407         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15408
15409         * assign.cs (Assign.DoResolve): Check whether the source
15410         expression is a value or variable.
15411
15412         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15413         while resolving the corresponding blocks.
15414
15415         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15416         an error, don't silently return null.
15417
15418         * statement.cs (Block.AddVariable): Do the error reporting here
15419         and distinguish between CS0128 and CS0136.
15420         (Block.DoResolve): Report all unused labels (warning CS0164).
15421         (LabeledStatement): Pass the location to the constructor.
15422         (LabeledStatement.HasBeenReferenced): New property.
15423         (LabeledStatement.Resolve): Set it to true here.
15424
15425         * statement.cs (Return.Emit): Return success even after reporting
15426         a type mismatch error (CS0126 or CS0127), this is what csc does and
15427         it avoids confusing the users with any consecutive errors.
15428
15429 2002-08-05  Martin Baulig  <martin@gnome.org>
15430
15431         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15432
15433         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15434
15435         * expression.cs (MemberAccess.DoResolve): Silently return if an
15436         error has already been reported.
15437
15438         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15439         error has already been reported.
15440
15441 2002-08-05  Martin Baulig  <martin@gnome.org>
15442
15443         * statement.cs (UsageVector): Only initialize the `parameters'
15444         vector if we actually have any "out" parameters.
15445
15446 2002-08-05  Martin Baulig  <martin@gnome.org>
15447
15448         * expression.cs (Binary.ResolveOperator): When combining delegates,
15449         they must have the same type.
15450
15451 2002-08-05  Martin Baulig  <martin@gnome.org>
15452
15453         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15454         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15455         work with the ms runtime and we also don't need it: if we're a
15456         PropertyBuilder and not in the `indexer_arguments' hash, then we
15457         are a property and not an indexer.
15458
15459         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15460         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15461         since the latter one doesn't work with the ms runtime.
15462
15463 2002-08-03  Martin Baulig  <martin@gnome.org>
15464
15465         Fixed bugs #27998 and #22735.
15466
15467         * class.cs (Method.IsOperator): New public field.
15468         (Method.CheckBase): Report CS0111 if there's already a method
15469         with the same parameters in the current class.  Report CS0508 when
15470         attempting to change the return type of an inherited method.
15471         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15472         and it's not marked abstract or extern.
15473         (PropertyBase): New abstract base class for Property and Indexer.
15474         (PropertyBase.CheckBase): Moved here from Property and made it work
15475         for indexers.
15476         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15477         the same so we can reuse it there.
15478         (Property, Indexer): Derive from PropertyBase.
15479         (MethodSignature.inheritable_property_signature_filter): New delegate
15480         to find properties and indexers.
15481
15482         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15483         argument and improved error reporting.
15484
15485         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15486         EmptyReadOnlyParameters and made it a property.
15487
15488         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15489         version of this method which takes a `PropertyInfo indexer'.
15490         (TypeManager.RegisterIndexer): New method.
15491
15492         * class.cs: Added myself as author of this file :-)
15493
15494 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15495
15496         * class.cs: fixed compilation on windoze.
15497
15498 2002-08-03  Martin Baulig  <martin@gnome.org>
15499
15500         * interface.cs (Interface.GetInterfaceBases): Check whether all
15501         base interfaces are at least as accessible than the current one.
15502
15503         * class.cs (TypeContainer.GetClassBases): Check whether base types
15504         are at least as accessible than the current type.
15505         (TypeContainer.AsAccessible): Implemented and made non-static.
15506         (MemberBase.CheckParameters): Report errors if the accessibility
15507         checks fail.
15508
15509         * delegate.cs (Delegate.Delegate): The default visibility is
15510         internal for top-level types and private for nested types.
15511         (Delegate.Define): Report errors if the accessibility checks fail.
15512
15513         * enum.cs (Enum.Enum): The default visibility is internal for
15514         top-level types and private for nested types.
15515         (Enum.DefineType): Compute the correct visibility.
15516
15517         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15518         function which takes a `bool is_toplevel' instead of a TypeContainer.
15519
15520         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15521         builtin type.
15522
15523 2002-08-02  Martin Baulig  <martin@gnome.org>
15524
15525         * expression.cs (LocalVariableReferenc): Added constructor which
15526         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15527         (LocalVariableReference.IsReadOnly): New property.
15528         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15529         variable is readonly, use our own readonly flag to do this; you can
15530         use the new constructor to get a writable reference to a read-only
15531         variable.
15532
15533         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15534         reference to the local variable.
15535
15536 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15537
15538         * rootcontext.cs (ResolveCore): Also include System.Exception
15539
15540         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15541         we reach an EmptyStatement.
15542
15543         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15544         is also fine.
15545
15546         * expression.cs (Binary.ResolveOperator): Check error result in
15547         two places.
15548
15549         use brtrue/brfalse directly and avoid compares to null.
15550
15551 2002-08-02  Martin Baulig  <martin@gnome.org>
15552
15553         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15554         Fixes bug #28407, added test-155.cs.
15555
15556 2002-08-01  Martin Baulig  <martin@gnome.org>
15557
15558         * class.cs (Event.EmitDefaultMethod): Make this work with static
15559         events.  Fixes #28311, added verify-3.cs.
15560
15561 2002-08-01  Martin Baulig  <martin@gnome.org>
15562
15563         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15564         `is_disposable' fields.
15565         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15566         `hm.is_disposable' if we're using the collection pattern.
15567         (Foreach.EmitCollectionForeach): Use the correct type for the
15568         enumerator's local variable, only emit the try/finally block if
15569         necessary (fixes #27713).
15570
15571 2002-08-01  Martin Baulig  <martin@gnome.org>
15572
15573         * ecore.cs (Expression.report118): Renamed to Error118 and made
15574         it public static.
15575
15576         * statement.cs (Throw.Resolve): Check whether the expression is of
15577         the correct type (CS0118) and whether the type derives from
15578         System.Exception (CS0155).
15579         (Catch.Resolve): New method.  Do the type lookup here and check
15580         whether it derives from System.Exception (CS0155).
15581         (Catch.CatchType, Catch.IsGeneral): New public properties.
15582
15583         * typemanager.cs (TypeManager.exception_type): Added.
15584
15585 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15586
15587         * driver.cs: Updated About function.
15588
15589 2002-07-31  Martin Baulig  <martin@gnome.org>
15590
15591         Implemented Control Flow Analysis.
15592
15593         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15594         (EmitContext.CurrentBranching): Added.
15595         (EmitContext.StartFlowBranching): Added.
15596         (EmitContext.EndFlowBranching): Added.
15597         (EmitContext.KillFlowBranching): Added.
15598         (EmitContext.IsVariableAssigned): Added.
15599         (EmitContext.SetVariableAssigned): Added.
15600         (EmitContext.IsParameterAssigned): Added.
15601         (EmitContext.SetParameterAssigned): Added.
15602         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15603         Added control flow analysis stuff here.
15604
15605         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15606         resolve the expression as lvalue.
15607         (LocalVariableReference.DoResolve): Check whether the variable has
15608         already been assigned.
15609         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15610         the parameter as assigned here.
15611         (ParameterReference.DoResolve): Check whether the parameter has already
15612         been assigned.
15613         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15614         expression as lvalue.
15615
15616         * statement.cs (FlowBranching): New class for the flow analysis code.
15617         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15618         (LabeledStatement.IsDefined): New public property.
15619         (LabeledStatement.AddUsageVector): New public method to tell flow
15620         analyis that the label may be reached via a forward jump.
15621         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15622         flow analysis.
15623         (VariableInfo.Number): New public field.  This is used by flow analysis
15624         to number all locals of a block.
15625         (Block.CountVariables): New public property.  This is the number of
15626         local variables in this block (including the locals from all parent
15627         blocks).
15628         (Block.EmitMeta): Number all the variables.
15629
15630         * statement.cs: Added flow analysis support to all classes.
15631
15632 2002-07-31  Martin Baulig  <martin@gnome.org>
15633
15634         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15635         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15636         then use this argument.
15637
15638         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15639
15640         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15641         use this to specify /define options.
15642
15643 2002-07-29  Martin Baulig  <martin@gnome.org>
15644
15645         * statement.cs (Fixed): Moved all code that does variable lookups
15646         and resolvings from Emit to Resolve.
15647
15648         * statement.cs (For): Moved all code that does variable lookups
15649         and resolvings from Emit to Resolve.
15650
15651         * statement.cs (Using): Moved all code that does variable lookups
15652         and resolvings from Emit to Resolve.
15653
15654 2002-07-29  Martin Baulig  <martin@gnome.org>
15655
15656         * attribute.cs (Attribute.Resolve): Explicitly catch a
15657         System.NullReferenceException when creating the
15658         CustromAttributeBuilder and report a different warning message.
15659
15660 2002-07-29  Martin Baulig  <martin@gnome.org>
15661
15662         * support.cs (ParameterData.ParameterName): Added method to
15663         get the name of a parameter.
15664
15665         * typemanager.cs (TypeManager.IsValueType): New public method.
15666
15667 2002-07-29  Martin Baulig  <martin@gnome.org>
15668
15669         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15670         is a flag which specifies that it's either ref or out.
15671         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15672         the out parameter to `out Parameter.Modifier mod', also set the
15673         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15674
15675         * support.cs (InternalParameters.ParameterModifier): Distinguish
15676         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15677         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15678
15679         * expression.cs (Argument.GetParameterModifier): 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 2002-07-29  Martin Baulig  <martin@gnome.org>
15684
15685         * expression.cs (ParameterReference.ParameterReference): Added
15686         `Location loc' argument to the constructor.
15687
15688         * cs-parser.jay: Pass location to ParameterReference.
15689
15690 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15691
15692         * statement.cs (Try): Initialize the location.
15693
15694         * cs-parser.jay: pass location to Try.
15695
15696         * expression.cs (Unary.Reduce): Change the prototype to return
15697         whether a constant fold could be performed or not.  The result is
15698         returned in an out parameters.  In the case of Indirection and
15699         AddressOf, we want to perform the full tests.
15700
15701 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15702
15703         * statement.cs (Statement.Emit): Flag dead code.
15704
15705 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15706
15707         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15708
15709 2002-07-27  Martin Baulig  <martin@gnome.org>
15710
15711         * class.cs (MethodData.Define): Put back call to
15712         TypeManager.AddMethod(), accidentally commented this out.
15713
15714         * report.cs (Debug): New public method to print debugging information,
15715         this is `[Conditional ("DEBUG")]'.
15716
15717 2002-07-26  Martin Baulig  <martin@gnome.org>
15718
15719         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15720         (switch_statement): Push the current_block to the switch_stack and
15721         pop it again when we're done with the switch.
15722         (switch_section): The new block is a child of the current_block.
15723         Fixes bug #24007, added test-152.cs.
15724
15725 2002-07-27  Martin Baulig  <martin@gnome.org>
15726
15727         * expression.cs (Invocation.EmitArguments): When calling a varargs
15728         function with only its fixed arguments, we need to pass an empty
15729         array.
15730
15731 2002-07-27  Martin Baulig  <martin@gnome.org>
15732
15733         Mono 0.13 has been released.
15734
15735 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15736
15737         * driver.cs: Rename --resource to --linkres, because that is what
15738         we do currently, we dont support --resource yet.
15739
15740         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15741
15742 2002-07-25  Martin Baulig  <martin@gnome.org>
15743
15744         * class.cs (MethodData): New public class.  This is a `method builder'
15745         class for a method or one accessor of a Property/Indexer/Event.
15746         (MethodData.GetMethodFlags): Moved here from MemberBase.
15747         (MethodData.ApplyAttributes): Likewise.
15748         (MethodData.ApplyObsoleteAttribute): Likewise.
15749         (MethodData.ApplyConditionalAttribute): Likewise.
15750         (MethodData.ApplyDllImportAttribute): Likewise.
15751         (MethodData.CheckAbstractAndExternal): Likewise.
15752         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15753         (MethodData.Emit): Formerly known as Method.Emit().
15754         (MemberBase): Moved everything which was specific to a single
15755         accessor/method to MethodData.
15756         (Method): Create a new MethodData and call Define() and Emit() on it.
15757         (Property, Indexer, Event): Create a new MethodData objects for each
15758         accessor and call Define() and Emit() on them.
15759
15760 2002-07-25  Martin Baulig  <martin@gnome.org>
15761
15762         Made MethodCore derive from MemberBase to reuse the code from there.
15763         MemberBase now also checks for attributes.
15764
15765         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15766         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15767         as virtual.
15768         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15769         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15770         (MemberBase.ApplyAttributes): New virtual method; applies the
15771         attributes to a method or accessor.
15772         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15773         (MemberBase.ApplyConditionalAttribute): Likewise.
15774         (MemberBase.ApplyDllImportAttribute): Likewise.
15775         (MemberBase.CheckAbstractAndExternal): Likewise.
15776         (MethodCore.ParameterTypes): This is now a property instead of a
15777         method, it's initialized from DoDefineParameters().
15778         (MethodCore.ParameterInfo): Removed the set accessor.
15779         (MethodCore.DoDefineParameters): New protected virtual method to
15780         initialize ParameterTypes and ParameterInfo.
15781         (Method.GetReturnType): We can now simply return the MemberType.
15782         (Method.GetMethodFlags): Override the MemberBase version and add
15783         the conditional flags.
15784         (Method.CheckBase): Moved some code from Define() here, call
15785         DoDefineParameters() here.
15786         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15787         here to avoid some larger code duplication.
15788         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15789         ensure that abstract and external accessors don't declare a body.
15790
15791         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15792         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15793         lookup in the attribute's parent classes, so we need to abort as soon
15794         as we found the first match.
15795         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15796         the attribute has no arguments.
15797
15798         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15799         of a Method.
15800
15801 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15802
15803         * cs-parser.jay: reverted previous patch.
15804
15805 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15806
15807         * cs-parser.jay: fixed bug #22119.
15808
15809 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15810
15811         * attribute.cs: fixed compilation. The error was:
15812         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15813         be assigned to before control leaves the current method."
15814         [FIXME:  Filed as bug #28186: MCS must report this error.]
15815
15816 2002-07-25  Martin Baulig  <martin@gnome.org>
15817
15818         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15819         method to pull the condition name ouf of a Conditional attribute.
15820         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15821         the obsolete message and error flag out of an Obsolete attribute.
15822
15823         * class.cs (Method.GetMethodFlags): New public method to get the
15824         TypeManager.MethodFlags for this method.
15825         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15826         private methods.
15827         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15828         if we're overriding a virtual function, set the new private variable
15829         `parent_method'; call the new TypeManager.AddMethod().
15830
15831         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15832         the MethodBuilder and the Method in a PtrHashtable.
15833         (TypeManager.builder_to_method): Added for this purpose.
15834         (TypeManager.MethodFlags): Added IsObsoleteError.
15835         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15836         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15837         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15838         the message from the attribute.
15839
15840 2002-07-24  Martin Baulig  <martin@gnome.org>
15841
15842         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15843         preprocessor directives, ensure that the argument to #define/#undef is
15844         exactly one identifier and that it's actually an identifier.
15845
15846         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15847         did not work ....
15848
15849 2002-07-24  Martin Baulig  <martin@gnome.org>
15850
15851         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15852         initialize it to TypeManager.object_type in the constructor.
15853         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15854         of the `hm.get_current' method if we're using the collection pattern.
15855         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15856         for the explicit conversion to make it work when we're using the collection
15857         pattern and the `Current' property has a different return type than `object'.
15858         Fixes #27713.
15859
15860 2002-07-24  Martin Baulig  <martin@gnome.org>
15861
15862         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15863         does not match, but don't report any errors.  This method is called in
15864         order for all methods in a MethodGroupExpr until a matching method is
15865         found, so we don't want to bail out if the first method doesn't match.
15866         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15867         matches, report the 123.  Fixes #28070.
15868
15869 2002-07-24  Martin Baulig  <martin@gnome.org>
15870
15871         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15872         TypeManager.TypeToCoreType() to the top of the method so the
15873         following equality checks will work.  Fixes #28107.
15874
15875 2002-07-24  Martin Baulig  <martin@gnome.org>
15876
15877         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15878         operand is of type uint, and the other operand is of type sbyte,
15879         short or int, the operands are converted to type long." -
15880         Actually do what this comment already told us.  Fixes bug #28106,
15881         added test-150.cs.
15882
15883 2002-07-24  Martin Baulig  <martin@gnome.org>
15884
15885         * class.cs (MethodBase): New abstract class.  This is now a base
15886         class for Property, Indexer and Event to avoid some code duplication
15887         in their Define() and DefineMethods() methods.
15888         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15889         generic methods for Define() and DefineMethods().
15890         (FieldBase): Derive from MemberBase, not MemberCore.
15891         (Property): Derive from MemberBase, not MemberCore.
15892         (Property.DefineMethod): Moved all the code from this method to the
15893         new MethodBase.DefineAccessor(), just call it with appropriate
15894         argumetnts.
15895         (Property.Define): Call the new Property.DoDefine(), this does some
15896         sanity checks and we don't need to duplicate the code everywhere.
15897         (Event): Derive from MemberBase, not MemberCore.
15898         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15899         accessors, this will also make them work with interface events.
15900         (Indexer): Derive from MemberBase, not MemberCore.
15901         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15902         (Indexer.Define): Use the new MethodBase functions.
15903
15904         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15905         argument to the constructor.
15906         (Interface.FindMembers): Added support for interface events.
15907         (Interface.PopluateEvent): Implemented.
15908
15909         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
15910
15911 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
15912
15913         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15914         but this is required to check for a method name being the same as
15915         the containing class.  
15916
15917         Handle this now.
15918
15919 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15920
15921         * interface.cs: initialize variable.
15922
15923 2002-07-23  Martin Baulig  <martin@gnome.org>
15924
15925         Implemented the IndexerName attribute in interfaces.
15926
15927         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15928         name if this is an explicit interface implementation.
15929         (Indexer.InterfaceIndexerName): New public variable.  If we're
15930         implementing an interface indexer, this is the IndexerName in that
15931         interface.  Otherwise, it's the IndexerName.
15932         (Indexer.DefineMethod): If we're implementing interface indexer,
15933         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
15934         and Pending.ImplementIndexer methods.
15935         (Indexer.Define): Also define the PropertyBuilder if we're
15936         implementing an interface indexer and this is neither an explicit
15937         interface implementation nor do the IndexerName match the one in
15938         the interface.
15939
15940         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15941         If a method is defined here, then we always need to create a proxy
15942         for it.  This is used when implementing interface indexers.
15943         (Pending.IsInterfaceIndexer): New public method.
15944         (Pending.ImplementIndexer): New public method.
15945         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15946         This is used when implementing interface indexers to define a proxy
15947         if necessary.
15948         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15949         define a proxy if necessary.
15950
15951         * interface.cs (Interface.IndexerName): New public variable.
15952         (Interface.PopulateIndexer): Set the IndexerName.
15953         (Interface.DefineIndexers): New private method.  Populate all the
15954         indexers and make sure their IndexerNames match.
15955
15956         * typemanager.cs (IndexerPropertyName): Added support for interface
15957         indexers.
15958
15959 2002-07-22  Martin Baulig  <martin@gnome.org>
15960
15961         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15962         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15963         ret if HasReturnLabel.
15964         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15965         variables.
15966
15967         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15968         and set the ec.LoopBeginTryCatchLevel.
15969         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15970         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15971         the current ec.TryCatchLevel, the branch goes out of an exception
15972         block.  In this case, we need to use Leave and not Br.
15973
15974 2002-07-22  Martin Baulig  <martin@gnome.org>
15975
15976         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15977         block unless the block does not always return or it is contained in
15978         another try { ... } catch { ... } block.  Fixes bug #26506.
15979         Added verify-1.cs to the test suite.
15980
15981 2002-07-22  Martin Baulig  <martin@gnome.org>
15982
15983         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15984         then we do not always return.  Fixes bug #24985.
15985
15986 2002-07-22  Martin Baulig  <martin@gnome.org>
15987
15988         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15989         lookup on a per-class level; ie. walk up the class hierarchy until we
15990         found at least one applicable method, then choose the best among them.
15991         Fixes bug #24463 and test-29.cs.
15992
15993 2002-07-22  Martin Baulig  <martin@gnome.org>
15994
15995         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15996         return types of the methods.  The return type is not part of the
15997         signature and we must not check it to make the `new' modifier work.
15998         Fixes bug #27999, also added test-147.cs.
15999         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16000
16001         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16002         on the method's return type.
16003
16004 2002-07-21  Martin Baulig  <martin@gnome.org>
16005
16006         * assign.cs: Make this work if the rightmost source is a constant and
16007         we need to do an implicit type conversion.  Also adding a few more tests
16008         to test-38.cs which should have caught this.
16009
16010         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16011         target in the makefile for this.  The makefile.gnu is primarily intended
16012         for end-users who don't want to debug the compiler.
16013
16014 2002-07-21  Martin Baulig  <martin@gnome.org>
16015
16016         * assign.cs: Improved the Assign class so it can now handle embedded
16017         assignments (X = Y = Z = something).  As a side-effect this'll now also
16018         consume less local variables.  test-38.cs now passes with MCS, added
16019         a few new test cases to that test.
16020
16021 2002-07-20  Martin Baulig  <martin@gnome.org>
16022
16023         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16024         instructions.  Fixes bug #27977, also added test-146.cs.
16025
16026 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16027
16028         * cs-tokenizer.cs: fixed getHex ().
16029
16030 2002-07-19  Martin Baulig  <martin@gnome.org>
16031
16032         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16033         not Type.GetType() to lookup the array type.  This is needed when
16034         we're constructing an array of a user-defined type.
16035         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16036         single-dimensional arrays, but also for single-dimensial arrays of
16037         type decimal.
16038
16039 2002-07-19  Martin Baulig  <martin@gnome.org>
16040
16041         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16042         this function is called, it's not allowed to share LocalBuilders
16043         among ILGenerators.
16044
16045 2002-07-19  Martin Baulig  <martin@gnome.org>
16046
16047         * expression.cs (Argument.Resolve): Report an error 118 when trying
16048         to pass a type as argument.
16049
16050 2002-07-18  Martin Baulig  <martin@gnome.org>
16051
16052         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16053         Conv_R_Un for the signed `long' type.
16054
16055 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16056
16057         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16058         `expr' for the temporary result, as that will fail if we do
16059         multiple resolves on the same expression.
16060
16061 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16062
16063         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16064         ec.TypeContainer for looking up aliases. 
16065
16066         * class.cs (TypeContainer): Remove LookupAlias from here.
16067
16068         * decl.cs (DeclSpace); Move here.
16069
16070 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16071
16072         * class.cs (FindMembers): Only call filter if the constructor
16073         bulider is not null.
16074
16075         Also handle delegates in `NestedTypes' now.  Now we will perform
16076         type lookups using the standard resolution process.  This also
16077         fixes a bug.
16078
16079         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16080         This uses Expressions (the limited kind that can be parsed by the
16081         tree) instead of strings.
16082
16083         * expression.cs (ComposedCast.ToString): Implement, used to flag
16084         errors since now we have to render expressions.
16085
16086         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16087         FormArrayType. 
16088
16089         * ecore.cs (SimpleName.ToString): ditto.
16090
16091         * cs-parser.jay: Instead of using strings to assemble types, use
16092         Expressions to assemble the type (using SimpleName, ComposedCast,
16093         MemberAccess).  This should fix the type lookups in declarations,
16094         because we were using a different code path for this.
16095
16096         * statement.cs (Block.Resolve): Continue processing statements
16097         even when there is an error.
16098
16099 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16100
16101         * class.cs (Event.Define): Also remove the `remove' method from
16102         the list of pending items.
16103
16104         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16105         generate more compact code. 
16106
16107 2002-07-17  Martin Baulig  <martin@gnome.org>
16108
16109         * const.cs (Const.LookupConstantValue): Add support for constant
16110         `unchecked' and `checked' expressions.
16111         Also adding test case test-140.cs for this.
16112
16113 2002-07-17  Martin Baulig  <martin@gnome.org>
16114
16115         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16116         check whether mi.ReturnType implements the IEnumerator interface; the
16117         `==' and the IsAssignableFrom() will fail in this situation.
16118
16119 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16120
16121         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16122         here too.
16123
16124 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16125
16126         * expression.cs: fixed bug #27811.
16127
16128 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16129
16130         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16131         Molaro: when we are a ref, the value already contains a pointer
16132         value, do not take the address of it.
16133
16134 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16135         * removed mb-parser.jay and mb-tokenizer.cs
16136
16137 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16138
16139         * expression.cs: check against the building corlib void type.
16140
16141 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16142
16143         * ecore.cs: fix for valuetype static readonly fields: when 
16144         initializing them, we need their address, not the address of a copy.
16145
16146 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16147
16148         * typemanager.cs: register also enum_type in corlib.
16149
16150 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16151
16152         * class.cs: allow calling this (but not base) initializers in structs.
16153
16154 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16155
16156         * ecore.cs: make sure we compare against the building base types
16157         in GetTypeSize ().
16158
16159 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16160
16161         * typemanager.cs: fix TypeToCoreType() to handle void and object
16162         (corlib gets no more typerefs after this change).
16163
16164 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16165
16166         * expression.cs (ArrayCreation.EmitArrayArguments): use
16167         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16168
16169         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16170         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16171         array indexes, the runtime actually forbids them.
16172
16173         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16174         for array arguments here.
16175
16176         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16177         instead of the default for ValueTypes.
16178
16179         (New.DoEmit): Use IsValueType instead of
16180         IsSubclassOf (value_type)
16181         (New.DoResolve): ditto.
16182         (Invocation.EmitCall): ditto.
16183
16184         * assign.cs (Assign): ditto.
16185
16186         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16187         Statements *are* currently doing part of their resolution during
16188         Emit.  
16189
16190         Expressions do always resolve during resolve, but statements are
16191         only required to propagate resolution to their children.
16192
16193 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16194
16195         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16196
16197         (LoadAssembly): Do not add the dll if it is already specified
16198
16199         (MainDriver): Add the System directory to the link path at the end,
16200         after all the other -L arguments. 
16201
16202         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16203         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16204         ldelem.u1) and using the opposite for sbytes.
16205
16206         This fixes Digger, and we can finally run it.
16207
16208         * driver.cs (UnixParseOption): Move the option parsing here.  
16209         (CSCParseOption): Implement CSC-like parsing of options.
16210
16211         We now support both modes of operation, the old Unix way, and the
16212         new CSC-like way.  This should help those who wanted to make cross
16213         platform makefiles.
16214
16215         The only thing broken is that /r:, /reference: and /lib: are not
16216         implemented, because I want to make those have the same semantics
16217         as the CSC compiler has, and kill once and for all the confussion
16218         around this.   Will be doing this tomorrow.
16219
16220         * statement.cs (Unsafe.Resolve): The state is checked during
16221         resolve, not emit, so we have to set the flags for IsUnsfe here.
16222
16223 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16224
16225         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16226         not catch the Error_ObjectRefRequired in SimpleName (as it is
16227         possible to have a class/instance variable name that later gets
16228         deambiguated), we have to check this here.      
16229
16230 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16231
16232         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16233         make static and put into Expression.
16234
16235         (Event.Define): Register the private field of the event with the 
16236         TypeManager so that GetFieldFromEvent can get at it.
16237
16238         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16239         keep track of the private field associated with an event which
16240         has no accessors.
16241
16242         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16243         private field.
16244
16245         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16246
16247 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16248
16249         * expression.cs (Binary.EmitBranchable): this routine emits the
16250         Binary expression in a branchable context.  This basically means:
16251         we need to branch somewhere, not just get the value on the stack.
16252
16253         This works together with Statement.EmitBoolExpression.
16254
16255         * statement.cs (Statement.EmitBoolExpression): Use
16256         EmitBranchable. 
16257
16258 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16259
16260         * statement.cs (For): Reduce the number of jumps in loops.
16261
16262         (For): Implement loop inversion for the For statement.
16263
16264         (Break): We can be breaking out of a Try/Catch controlled section
16265         (foreach might have an implicit try/catch clause), so we need to
16266         use Leave instead of Br.
16267
16268         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16269         now).  If the instace expression supports IMemoryLocation, we use
16270         the AddressOf method from the IMemoryLocation to extract the
16271         address instead of emitting the instance.
16272
16273         This showed up with `This', as we were emitting the instance
16274         always (Emit) instead of the Address of This.  Particularly
16275         interesting when This is a value type, as we dont want the Emit
16276         effect (which was to load the object).
16277
16278 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16279
16280         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16281
16282         * statement.cs (Checked): Set the CheckedState during the resolve
16283         process too, as the ConvCast operations track the checked state on
16284         the resolve process, and not emit.
16285
16286         * cs-parser.jay (namespace_member_declaration): Flag that we have
16287         found a declaration when we do.  This is used to flag error 1529
16288
16289         * driver.cs: Report ok when we display the help only.
16290
16291 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16292
16293         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16294
16295 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16296
16297         * cs-tokenizer.cs (define): We also have to track locally the
16298         defines.  AllDefines is just used for the Conditional Attribute,
16299         but we also need the local defines for the current source code. 
16300
16301 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16302
16303         * statement.cs (While, For, Do): These loops can exit through a
16304         Break statement, use this information to tell whether the
16305         statement is the last piece of code.
16306
16307         (Break): Flag that we break.
16308
16309         * codegen.cs (EmitContexts): New `Breaks' state variable.
16310
16311 2002-07-03  Martin Baulig  <martin@gnome.org>
16312
16313         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16314         modifiers in method declarations in structs.  Otherwise, you won't
16315         be able to override things like Object.Equals().
16316
16317 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16318
16319         * class.cs (Method, Property, Indexer): Do not allow the public
16320         modifier to be used in explicit interface implementations.
16321
16322         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16323         override modifiers in method declarations in structs
16324
16325 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16326
16327         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16328         integer or real overflow, report an error
16329
16330 2002-07-02  Martin Baulig  <martin@gnome.org>
16331
16332         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16333         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16334         to tell the runtime about our newly created System.Object and
16335         System.ValueType types.
16336
16337 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16338
16339         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16340         struct instead of Ldarg/Starg.
16341
16342 2002-07-02  Martin Baulig  <martin@gnome.org>
16343
16344         * expression.cs (Indirection.Indirection): Call
16345         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16346
16347 2002-07-02  Martin Baulig  <martin@gnome.org>
16348
16349         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16350         ValueType, call TypeManager.TypeToCoreType() on it.
16351         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16352         the OpCodes.Newarr argument.
16353
16354 2002-07-02  Martin Baulig  <martin@gnome.org>
16355
16356         * expression.cs (Invocation.EmitCall): When compiling corlib,
16357         replace all calls to the system's System.Array type to calls to
16358         the newly created one.
16359
16360         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16361         System.Array methods.
16362         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16363         from the system's System.Array type which must be replaced.
16364
16365 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16366
16367         * typemanager.cs: load unverifiable_code_ctor so we can build
16368         corlib using the correct type. Avoid using GetTypeCode() with
16369         TypeBuilders.
16370         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16371         TypeManager.object_type to allow building corlib.
16372
16373 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16374
16375         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16376
16377 2002-07-01  Martin Baulig  <martin@gnome.org>
16378
16379         * class.cs: Make the last change actually work, we need to check
16380         whether `ifaces != null' to avoid a crash.
16381
16382 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16383
16384         * class.cs: when we build structs without fields that implement
16385         interfaces, we need to add the interfaces separately, since there is
16386         no API to both set the size and add the interfaces at type creation
16387         time.
16388
16389 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16390
16391         * expression.cs: the dimension arguments to the array constructors
16392         need to be converted if they are a long.
16393
16394 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16395
16396         * class.cs: don't emit ldarg.0 if there is no parent constructor
16397         (fixes showstopper for corlib).
16398
16399 2002-06-29  Martin Baulig  <martin@gnome.org>
16400
16401         MCS now compiles corlib on GNU/Linux :-)
16402
16403         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16404         ie. check for MethodImplOptions.InternalCall.
16405
16406         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16407         and TypeManager.attribute_type are null, so we must explicitly check
16408         whether parent is not null to find out whether it's an attribute type.
16409         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16410         and SetBuilder, not only if the property is neither abstract nor external.
16411         This is necessary to set the MethodImplOptions on the accessor methods.
16412         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16413         SetBuilder, see Property.Emit().
16414
16415         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16416         populate "System.Object", "System.ValueType" and "System.Attribute" since
16417         they've already been populated from BootCorlib_PopulateCoreTypes().
16418
16419 2002-06-29  Martin Baulig  <martin@gnome.org>
16420
16421         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16422         is the NullLiteral, we also need to make sure that target_type is not
16423         an enum type.   
16424
16425 2002-06-29  Martin Baulig  <martin@gnome.org>
16426
16427         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16428         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16429         before calling BootstrapCorlib_ResolveDelegate ().
16430
16431 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16432
16433         * statement.cs: fixed build-breaker. All tests passed ok.
16434
16435 2002-06-27  Martin Baulig  <martin@gnome.org>
16436
16437         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16438         for System.Decimal when compiling corlib.
16439
16440 2002-06-27  Martin Baulig  <martin@gnome.org>
16441
16442         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16443         switch blocks which contain nothing but a default clause.
16444
16445 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16446
16447        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16448
16449 2002-06-27  Martin Baulig  <martin@gnome.org>
16450
16451         * ecore.cs (PropertyExpr.PropertyExpr): Call
16452         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16453
16454         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16455         is already a TypeBuilder.
16456
16457 2002-06-27  Martin Baulig  <martin@gnome.org>
16458
16459         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16460         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16461         the "from an array-type to System.Array" case.  This makes it work
16462         when compiling corlib.
16463
16464 2002-06-27  Martin Baulig  <martin@gnome.org>
16465
16466         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16467         non-static PropertyExpr, set its InstanceExpression.  This makes
16468         the `ICollection.Count' property work in System/Array.cs.
16469
16470 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16471
16472         * driver.cs: Made error handling more consistent.  Errors now
16473         tracked by Report class, so many methods which used to return int
16474         now return void.  Main() now prints success/failure and 
16475         errors/warnings message.
16476
16477         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16478         the magic number return values (123 and 124).  Now, if the
16479         expected error occurs, the compiler exits with success (exit value
16480         0).  If the compilation completes without seeing that particular
16481         error, the compiler exits with failure (exit value 1).  The
16482         makefile in mcs/errors has been changed to handle the new behaviour.
16483
16484         * report.cs: Made 'expected error' number a property and renamed
16485         it from 'Probe' to 'ExpectedError'.
16486
16487         * genericparser.cs: Removed error handling support, since it is
16488         now all done by Report class.
16489
16490         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16491         class, so parse() no longer returns an int.
16492
16493         * namespace.cs: Use Report.Error instead of GenericParser.error
16494
16495 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16496
16497         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16498         TypeContainer.AddOperator): At the front of the list put the
16499         explicit implementations, so they get resolved/defined first. 
16500
16501 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16502
16503         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16504         interface type is implemented by this TypeContainer.  Used during
16505         explicit interface implementation.
16506
16507         (Property.Define, Indexer.Define, Method.Define): Validate that
16508         the given interface in the explicit implementation is one of the
16509         base classes for the containing type.
16510
16511         Also if we are explicitly implementing an interface, but there is
16512         no match in the pending implementation table, report an error.
16513
16514         (Property.Define): Only define the property if we are
16515         not explicitly implementing a property from an interface.  Use the
16516         correct name also for those properties (the same CSC uses,
16517         although that is really not needed).
16518
16519         (Property.Emit): Do not emit attributes for explicitly implemented
16520         properties, as there is no TypeBuilder.
16521
16522         (Indexer.Emit): ditto.
16523
16524         Hiding then means that we do not really *implement* a pending
16525         implementation, which makes code fail.
16526
16527 2002-06-22  Martin Baulig  <martin@gnome.org>
16528
16529         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16530         the return value of Object.GetType().  [FIXME: we need to do this whenever
16531         we get a type back from the reflection library].
16532
16533 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16534
16535         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16536
16537 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16538
16539         * attribute.cs: Return null if we can not look up the type.
16540
16541         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16542         the interface types found.
16543
16544         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16545         interface types found.
16546
16547         * typemanager.cs (GetInterfaces): Make this routine returns alll
16548         the interfaces and work around the lame differences between
16549         System.Type and System.Reflection.Emit.TypeBuilder in the results
16550         result for GetInterfaces.
16551
16552         (ExpandInterfaces): Given an array of interface types, expand and
16553         eliminate repeated ocurrences of an interface.  This expands in
16554         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16555         be IA, IB, IC.
16556
16557 2002-06-21  Martin Baulig  <martin@gnome.org>
16558
16559         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16560         on System.Enum.
16561
16562 2002-06-21  Martin Baulig  <martin@gnome.org>
16563
16564         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16565         and called with one of the core types, return the corresponding typebuilder for
16566         that type.
16567
16568         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16569         element type.
16570
16571 2002-06-21  Martin Baulig  <martin@gnome.org>
16572
16573         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16574         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16575         (Expression.ConvertReferenceExplicit): Likewise.
16576
16577         * expression.cs (ElementAccess.DoResolve): Likewise.
16578         (ElementAccess.DoResolveLValue): Likewise.
16579
16580 2002-06-10  Martin Baulig  <martin@gnome.org>
16581
16582         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16583         add the "value" parameter to the parameter list.
16584
16585         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16586         to our caller.
16587
16588 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16589
16590         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16591         the argument to an int, uint, long or ulong, per the spec.  Also
16592         catch negative constants in array creation.
16593
16594 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16595
16596         * class.cs: do not allow the same interface to appear twice in
16597         the definition list.
16598
16599 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16600
16601         * ecore.cs: don't use ldlen with System.Array.
16602
16603 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16604
16605         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16606
16607 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16608
16609         * modifiers.cs: produce correct field attributes for protected
16610         internal. Easy fix so miguel can work on ther harder stuff:-)
16611
16612 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16613
16614         * pending.cs: New file.  Move the code from class.cs here.
16615         Support clearning the pending flag for all methods (when not doing
16616         explicit interface implementation).
16617
16618 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16619
16620         * rootcontext.cs: added a couple more types needed to bootstrap.
16621
16622 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16623
16624         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16625         constructor in the type, instead of any constructor in the type
16626         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16627         a bug in the Mono runtime when applying the params attribute). 
16628
16629 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16630         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16631
16632 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16633
16634         * expression.cs (Unary.ResolveOperator): Use TypeManager
16635         to resolve the type.
16636
16637 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16638
16639         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16640         attached.
16641
16642         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16643         with each member too.
16644
16645         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16646         field builders too - this takes care of the enum member case.
16647
16648 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16649
16650         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16651         address-of operator on both value types and pointers.
16652
16653 2002-06-10  Martin Baulig  <martin@gnome.org>
16654
16655         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16656         PropertyBuilder to the `property_builders' list.
16657
16658         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16659         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16660         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16661         find any indexers which are inherited from an interface.
16662
16663 2002-06-09  Martin Baulig  <martin@gnome.org>
16664
16665         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16666         the same type as the constant if necessary.  There's also a test-130.cs
16667         for this.
16668
16669         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16670
16671         * typemanager.cs (TypeManager.ChangeType): Previously known as
16672         Enum.ChangeEnumType().
16673
16674 2002-06-09  Martin Baulig  <martin@gnome.org>
16675
16676         * expression.cs (Cast.TryReduce): Added support for consts.
16677
16678 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16679
16680         * class.cs (Accessor): Hold attributes information so we can pass
16681         it along.
16682
16683         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16684         Modify to pass in attributes attached to the methods.
16685
16686         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16687
16688         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16689         to handle the Accessor kind :-)
16690
16691         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16692
16693 2002-06-08  Martin Baulig  <martin@gnome.org>
16694
16695         * expression.cs (Unary.TryReduceNegative): Added support for
16696         ULongConstants.
16697
16698 2002-06-08  Martin Baulig  <martin@gnome.org>
16699
16700         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16701         name can't be found in the `defined_names' - the caller will do a
16702         MemberLookup in this case and thus find methods in System.Enum
16703         such as Enum.IsDefined().
16704
16705 2002-06-08  Martin Baulig  <martin@gnome.org>
16706
16707         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16708         Convert.ChangeType() which works with TypeBuilder created types.
16709         (Enum.LookupEnumValue, Enum.Define): Use it here.
16710
16711         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16712         `TypeBuilder.BaseType != null' check.
16713         (TypeContainer.FindMembers): Only lookup parent members if we
16714         actually have a parent.
16715         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16716         (ConstructorInitializer.Resolve): Likewise.
16717
16718         * interface.cs (Interface.FindMembers): Added
16719         `TypeBuilder.BaseType != null' check.
16720
16721         * rootcontext.cs (RootContext.ResolveCore): Added
16722         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16723         classes_second_stage.
16724
16725         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16726         debug_type and trace_type when compiling with --nostdlib.       
16727
16728 2002-06-07  Martin Baulig  <martin@gnome.org>
16729
16730         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16731         (AddField): Set it to true when adding a non-static field.
16732         (DefineType): Use `have_nonstatic_fields' to find out whether we
16733         have non-static fields, not `Fields != null'.
16734
16735 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16736
16737         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16738         dereferencing a null on the static-field code path)
16739
16740 2002-05-30  Martin Baulig  <martin@gnome.org>
16741
16742         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16743         to take command line arguments.  Use reflection to call the new
16744         custom `Initialize' function on the symbol writer and pass it the
16745         command line arguments.
16746
16747         * driver.cs (--debug-args): New command line argument to pass command
16748         line arguments to the symbol writer.
16749
16750 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16751
16752         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16753         the target type for indexers and properties.  Thanks to Joe for
16754         catching this.
16755
16756 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16757
16758         * typemanager.cs (MethodFlags): returns the method flags
16759         (Obsolete/ShouldIgnore) that control warning emission and whether
16760         the invocation should be made, or ignored. 
16761
16762         * expression.cs (Invocation.Emit): Remove previous hack, we should
16763         not do this on matching a base type, we should do this based on an attribute
16764
16765         Only emit calls to System.Diagnostics.Debug and
16766         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16767         on the command line.
16768
16769         * rootcontext.cs: Global settings for tracing and debugging.
16770
16771         * cs-tokenizer.cs (define): New utility function to track
16772         defines.   Set the global settings for TRACE and DEBUG if found.
16773
16774 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16775
16776         * interface.cs (Populate*): Pass in the TypeContainer as well as
16777         the DeclSpace as parameters so that we can create EmitContexts and
16778         then use that to apply attributes etc.
16779
16780         (PopulateMethod, PopulateEvent, PopulateProperty)
16781         (PopulateIndexer): Apply attributes everywhere.
16782
16783         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16784         etc.
16785
16786         (ApplyAttributes): Update accordingly.
16787
16788         We now apply interface attributes for all members too.
16789
16790 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16791
16792         * class.cs (Indexer.Define); Correctly check if we are explicit
16793         implementation (instead of checking the Name for a ".", we
16794         directly look up if the InterfaceType was specified).
16795
16796         Delay the creation of the PropertyBuilder.
16797
16798         Only create the PropertyBuilder if we are not an explicit
16799         interface implementation.   This means that explicit interface
16800         implementation members do not participate in regular function
16801         lookups, and hence fixes another major ambiguity problem in
16802         overload resolution (that was the visible effect).
16803
16804         (DefineMethod): Return whether we are doing an interface
16805         implementation. 
16806
16807         * typemanager.cs: Temporary hack until we get attributes in
16808         interfaces (Ravi is working on that) and we get IndexerName
16809         support in interfaces.
16810
16811         * interface.cs: Register the indexers as properties.
16812
16813         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16814         warning, I have verified that this is a bug in the .NET runtime
16815         (JavaScript suffers of the same problem).
16816
16817         * typemanager.cs (MemberLookup): When looking up members for
16818         interfaces, the parent of an interface is the implicit
16819         System.Object (so we succeed in searches of Object methods in an
16820         interface method invocation.  Example:  IEnumerable x;  x.ToString
16821         ()) 
16822
16823 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16824
16825         * class.cs (Event): Events should also register if they do
16826         implement the methods that an interface requires.
16827
16828         * typemanager.cs (MemberLookup); use the new GetInterfaces
16829         method. 
16830
16831         (GetInterfaces): The code used to lookup interfaces for a type is
16832         used in more than one place, factor it here. 
16833
16834         * driver.cs: Track the errors at the bottom of the file, we kept
16835         on going.
16836
16837         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16838         instance if the method we are calling is static!
16839
16840 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16841
16842         * attribute.cs (ApplyAttributes): Make this function filter out
16843         the IndexerName attribute (as that attribute in reality is never
16844         applied) and return the string constant for the IndexerName
16845         attribute. 
16846
16847         * class.cs (TypeContainer.Emit): Validate that all the indexers
16848         have the same IndexerName attribute, and if so, set the
16849         DefaultName attribute on the class. 
16850
16851         * typemanager.cs: The return value might contain other stuff (not
16852         only methods).  For instance, consider a method with an "Item"
16853         property and an Item method.
16854
16855         * class.cs: If there is a problem with the parameter types,
16856         return. 
16857
16858 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16859
16860         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16861         looks at user defined conversion after making a call to 
16862         StandardConversionExists - we need this for overload resolution.
16863
16864         * expression.cs : Update accordingly the various method calls.
16865
16866         This fixes 2 bugs filed against implicit user defined conversions 
16867
16868 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
16869
16870         * statement.cs: Track the result of the assignment.
16871
16872 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
16873
16874         * expression.cs (MemberAccess): Improved error reporting for
16875         inaccessible members.
16876
16877 2002-05-22  Martin Baulig  <martin@gnome.org>
16878
16879         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
16880         itself with debugging support.
16881
16882 2002-05-22  Martin Baulig  <martin@gnome.org>
16883
16884         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16885         Removed, this isn't needed anymore.
16886
16887 2002-05-20  Martin Baulig  <martin@gnome.org>
16888
16889         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16890         be underlying type for an enum.
16891
16892 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
16893
16894         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16895         that splits out the loading of just the core types.
16896
16897         * rootcontext.cs (ResolveCore): Split the struct resolution in
16898         two, so we can load the enumeration underlying types before any
16899         enums are used.
16900
16901         * expression.cs (Is): Bandaid until we fix properly Switch (see
16902         bug #24985 for details).
16903
16904         * typemanager.cs (ImplementsInterface): The hashtable will contain
16905         a null if there are no interfaces implemented.
16906
16907 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
16908
16909         * cs-parser.jay (indexer_declarator): It is fine to have array
16910         parameters
16911
16912 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16913
16914         * typemanager.cs: (RegisterBuilder): New function used to register
16915         TypeBuilders that implement interfaces.  Since
16916         TypeBuilder.GetInterfaces (as usual) does not work with lame
16917         Reflection.Emit. 
16918         (AddUserType): register interfaces.
16919
16920         (ImplementsInterface): Use the builder_to_ifaces hash if we are
16921         dealing with TypeBuilder.  Also, arrays are showing up as
16922         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16923         methods can not be invoked on them!
16924
16925         * ecore.cs (ExplicitReferenceConversionExists): Made public.
16926         (ImplicitReferenceConversionExists): Split out from
16927         StandardConversionExists. 
16928
16929         * expression.cs (As): We were only implementing one of the three
16930         cases for the as operator.  We now implement them all.
16931         (Is): Implement the various other cases for Is as well.
16932
16933         * typemanager.cs (CACHE): New define used to control if we want or
16934         not the FindMembers cache.  Seems to have a negative impact on
16935         performance currently
16936
16937         (MemberLookup): Nested types have full acess to
16938         enclosing type members
16939
16940         Remove code that coped with instance/static returns for events, we
16941         now catch this in RealFindMembers.
16942
16943         (RealFindMembers): only perform static lookup if the instance
16944         lookup did not return a type or an event.  
16945
16946 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16947
16948         * assign.cs (CompoundAssign): We pass more semantic information
16949         now to Compound Assignments than we did before: now we have all
16950         the information at hand, and now we resolve the target *before* we
16951         do the expression expansion, which allows the "CacheValue" method
16952         to have the effect we intended (before, a [x] += 1 would generate
16953         two differen ArrayAccess expressions from the ElementAccess,
16954         during the resolution process).
16955
16956         (CompoundAssign.DoResolve): Resolve target and original_source here.
16957
16958 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
16959
16960         * expression.cs (ArrayAccess): dropped debugging information. 
16961
16962         * typemanager.cs: Small bug fix: I was always returning i_members,
16963         instead of one of i_members or s_members (depending on which had
16964         the content).
16965
16966         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
16967         method is invoked before any code generation takes place, and it
16968         is a mechanism to inform that the expression will be invoked more
16969         than once, and that the method should use temporary values to
16970         avoid having side effects
16971
16972         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16973
16974         * ecore.cs (Expression.CacheTemporaries): Provide empty default
16975         implementation.
16976
16977         * expression.cs (Indirection, ArrayAccess): Add support for
16978         CacheTemporaries in these two bad boys. 
16979
16980         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16981         ldobj or ldind_ref.  
16982         (StoreFromPtr): Handle stobj as well.
16983
16984         * expression.cs (UnaryMutator): Share more code.
16985
16986         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16987         down: I was not tracking the Filter function as well, which
16988         was affecting the results of the cache.
16989
16990 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16991
16992         * attribute.cs: Remove the hack to handle the CharSet property on
16993         StructLayouts. 
16994
16995 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16996
16997         * attribute.cs (DoResolve): More uglyness, we now only try to
16998         resolve the attribute partially, to extract the CharSet
16999         information (only if we are a StructLayout attribute).  Otherwise 
17000
17001         (GetExtraTypeInfo): Add some code to conditionally kill in the
17002         future this.   I am more and more convinced that the .NET
17003         framework has special code to handle the attribute setting on
17004         certain elements.
17005
17006         * expression.cs (IsParamsMethodApplicable): Revert my previous
17007         foreach change here, it was wrong.
17008
17009 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17010
17011         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17012         (pp_expr): do not abort on unknown input, just return.
17013         (eval): abort if there are pending chars.
17014
17015         * attribute.cs (Attribute.Resolve): Positional parameters are
17016         optional.  Deal with that case.
17017
17018         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17019         the Ansi/Unicode/Auto information for the type.
17020
17021         (TypeContainer.DefineType): instantiate the EmitContext here, as
17022         we will be using it during the type definition (to resolve
17023         attributes) and during the emit phase.
17024
17025         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17026         to pull type information out of the attributes
17027
17028         (Attribute.Resolve): track the constructor builder, and allow for
17029         multiple invocations (structs and classes will use this).
17030
17031         * ecore.cs (MemberLookupFinal): new version with all the
17032         parameters customizable.
17033
17034         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17035         constructors.  Return if the result value is null (as the error
17036         would have been flagged already by MemberLookupFinal)
17037
17038         Do not allow instances of abstract classes or interfaces to be
17039         created.
17040
17041         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17042         We have to compare the assembly property here when dealing with
17043         FamANDAssem and Assembly access modifiers, because we might be
17044         creating an assembly from *modules* (that means that we are not
17045         getting TypeBuilders for types defined in other modules that are
17046         part of this assembly).
17047
17048         (Method.Emit): If the method is marked abstract and has a body,
17049         emit an error. 
17050
17051         (TypeContainer.DefineMembers): If both the defined member and the
17052         parent name match are methods, then do not emit any warnings: let
17053         the Method.Define routine take care of flagging warnings.  But if
17054         there is a mismatch (method overrides something else, or method is
17055         overriwritten by something, then emit warning).
17056
17057         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17058         set to null, this means `do not check for the return type on the
17059         signature'. 
17060
17061         (Method.Define): set the return type for the method signature to
17062         null, so that we get methods with the same name and parameters and
17063         different return types.  This is used to flag warning 114 (you are
17064         hiding a method, and you probably want to use the new/override
17065         keywords instead).
17066
17067         * typemanager.cs (MemberLookup): Implemented proper access
17068         control, closing a long standing set of bug reports.  The problem
17069         was that the Framework only has two bits: Public and NonPublic,
17070         and NonPublic includes private and protected methods, but we need
17071         to enforce the FamANDAssem, FamOrAssem and Family. 
17072
17073 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17074
17075         * statement.cs (GotoCase): Return true: Ammounts to giving up
17076         knowledge on whether we return or not, and letting the other case
17077         be responsible for it.
17078
17079 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17080
17081         * driver.cs: Do not load directories for each file processed, only
17082         do it if there is a pattern.
17083
17084         * ecore.cs: Report readonly assigns here as well, as we might have
17085         been resolved only by MemberAccess.
17086
17087         (SimpleName.SimpleNameResolve): Also be useful for LValue
17088         resolution.   We need this to propagate assign to local readonly variables
17089
17090         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17091         do not want to reuse potential criteria memory.
17092
17093         * class.cs (MyEventBuilder): Set reflected_type;
17094
17095         * ecore.cs (Constantify): Added support for constifying bools.
17096
17097         (RootContext.LookupType): Added a cache for values looked up in
17098         the declaration space.
17099
17100         * typemanager.cs (FindMembers): Now is a front-end to
17101         RealFindMembers, and provides a two-level hashtable-based cache to
17102         the request.  
17103
17104         15% performance improvement: from 22.5 to 19.2 seconds.
17105
17106         * expression.cs (IsParamsMethodApplicable): use foreach.
17107         (Invocation.DoResolve): ditto.
17108         (New.DoResolve): ditto.
17109         (ArrayCreation.DoResolve): ditto.
17110
17111         * ecore.cs (FindMostEncompassingType): use foreach.
17112
17113         * delegate.cs (NewDelegate.DoResolve): Use foreach
17114
17115         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17116         (RemoveMethods): use foreach.
17117
17118         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17119         nested foreach statements instead of for, and also break out of
17120         the inner loop once a match is found.
17121
17122         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17123
17124 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17125
17126         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17127         we actually unwrap the expression to allow for extra information
17128         to be extracted. 
17129
17130         * expression.cs: Use Shr_Un on unsigned operations. 
17131
17132 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17133
17134         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17135         applicable operators was not being considered correctly. This closes
17136         the bug Miguel reported.
17137
17138 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17139
17140         * attribute.cs: check that the type derives from System.Attribute
17141         and report the correct error in that case (moved the duplicate code to
17142         its own method, too).
17143
17144 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17145
17146         * attribute.cs: lookup attribute type name as the spec says: first the
17147         bare attribute name and then name + "Attribute" (nant compiles with
17148         mcs after this fix).
17149
17150 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17151
17152         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17153         Because of the way we parse things, we should try to see if a
17154         UIntConstant can fit in an integer.
17155
17156 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17157
17158         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17159         when we are in an explicit context.
17160
17161         (ConvertReferenceExplicit): When converting from Iface type S to Class
17162         T make sure the rules are implemented as an OR.
17163
17164         * parameter.cs (ParameterType): Make it a property for now although the
17165         purpose really isn't anything immediate.
17166
17167         * expression.cs (Is*Applicable): Do better checking on the parameter type
17168         of a ref/out parameter. The ones from the system assemblies are already 
17169         marked with the correct type so we don't need to do any correction.
17170
17171         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17172         the object type is standard too so include that.
17173
17174 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17175
17176         * ecore.cs (StandardConversionExists): Augment with missing code:
17177         deal with IntConstant, LongConstants and Enumerations.
17178
17179         * assign.cs: Report the error, instead of failing silently
17180
17181         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17182         typecontainer that they are declared, because the
17183         typecontainer/namespace will have the list of using clauses that
17184         need to be applied.
17185
17186         Assembly Attributes were escaping the normal registration
17187         mechanism. 
17188
17189         (EmitCode): Apply attributes within an EmitContext that represents
17190         the container they were declared on.
17191
17192         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17193
17194 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17195
17196         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17197         Revamp completely - make much cleaner as we now operate only
17198         on a set of Types.
17199
17200         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17201         to implement the logic detailed in the spec more correctly.
17202
17203         (UserDefinedConversion): Update accordingly.
17204
17205 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17206
17207         * statement.cs: Return flow analysis information up.
17208
17209         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17210         and the default.
17211
17212         (token): Do not consume an extra character before calling
17213         decimal_digits.
17214
17215 2002-05-06  Piers Haken <piersh@friskit.com>
17216
17217         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17218
17219 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17220
17221         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17222         EmitContext during the instance constructor initializer
17223         resolution, to stop access to instance variables.
17224
17225         This is mandated by the spec, last paragraph of the `constructor
17226         initializers' section. 
17227
17228 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17229
17230         * cs-parser.jay, class.cs (Accessor): new class used to represent
17231         an accessor (get or set).  In the past we used `null' to represent
17232         a missing accessor.  But this is ambiguous because there was no
17233         way to tell in abstract indexers/properties if one of them was
17234         specified.
17235
17236         Now there is a way of addressing that.
17237
17238         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17239         instead of FindMembers.
17240
17241         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17242         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17243
17244         * attribute.cs: Treat indexers and properties as the same in terms
17245         of applying attributes
17246
17247         * ecore.cs (FindMostEncompassedType): Use statically initialized
17248         EmptyExpressions()s like we do elsewhere to avoid creating useless
17249         objects (and we take this out of the tight loop).
17250
17251         (GetConversionOperators): Move the code to extract the actual
17252         operators to a separate routine to clean things up.
17253
17254 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17255
17256         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17257         events are always registered FieldBuilders.
17258
17259         * class.cs (FieldBase): New class shared by Fields 
17260
17261         * delegate.cs: If we are a toplevel delegate, use our full name.
17262         If we are a nested delegate, then only use our tail name.
17263
17264 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17265
17266         * expression.cs (IsApplicable): Ensure that we add the "&" to
17267         ref/out types before comparing it with the type of the argument.
17268
17269         (IsParamsMethodApplicable): Ditto.
17270
17271         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17272         silly me ;-)
17273
17274         * delegate.cs : Handle the case when we have more than one applicable
17275         method. Flag an error only when we finish checking all.
17276
17277 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17278
17279         * expression.cs: Add support for boolean static initializers.
17280
17281 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17282
17283         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17284
17285         * parameter.cs (ComputeParameterTypes,
17286         ComputeAndDefineParameterTypes): Better error handling: now we
17287         clear the `types' cache if we fail during any of the type lookups.
17288         We also return the status code correctly to our caller
17289
17290         * delegate.cs: If we fail to define a delegate, abort the extra
17291         steps. 
17292
17293         * expression.cs (Binary.ResolveOperator): for
17294         operator==(object,object) and operator !=(object, object) we also
17295         have to verify that there is an implicit conversion from one to
17296         the other.
17297
17298         (ArrayAccess.DoResolve): Array Access can operate on
17299         non-variables. 
17300
17301 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17302
17303         * assign.cs (CompoundAssign): A new class used as a "flag" that
17304         the assignment actually is happening as part of a compound
17305         assignment operator.
17306
17307         During compound assignment, a few new rules exist to enable things
17308         like:
17309
17310         byte b |= 1 + 2
17311
17312         From the spec:
17313
17314         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17315         to the type of x) if y is implicitly convertible to the type of x,
17316         and the operator is a builtin operator and the return type of the
17317         operator is explicitly convertible to the type of x. 
17318
17319         * rootcontext.cs: Reset warning level to 2.  4 catches various
17320         "interesting" features in mcs, we must clean this up at some
17321         point, but currently am trying to kill other bugs ;-)
17322
17323         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17324         in container classes as well.  
17325
17326         * expression.cs (Binary.ResolveOperator): Handle string case
17327         before anything else (as operator overloading does emit an error
17328         before doing anything else).
17329
17330         This code could go away when we move to a table driven model, but
17331         i could not come up with a good plan last night.
17332
17333 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17334
17335         * typemanager.cs (CSharpName): reimplementation using regex.
17336         * class.cs: added null check for fields in Emit
17337         * rootcontext.cs: set warninglevel to 4
17338
17339 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17340
17341         * typemanager.cs (CSharpName): reimplemented with Lupus
17342         suggestion.
17343
17344 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17345
17346         * statement.cs (If): correclty implement Resolve, because we were
17347         not catching sem errors in there.  The same process is needed
17348         everywhere else. 
17349         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17350
17351
17352         (Statement.Warning_DeadCodeFound): Factorize code.
17353         (While): Report dead code here too.
17354
17355         (Statement): Added Resolve virtual method to allow
17356         for resolution split from the emit code.
17357
17358 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17359
17360         * statement.cs (EmitBoolExpression): No longer try to resolve the
17361         expression here.    
17362         (MakeBoolean): New utility function that resolve, implicitly
17363         converts to boolean and tags the expression. 
17364
17365
17366         (If, Do): Implement dead code elimination.
17367         (While): Implement loop inversion
17368
17369         (Do, While, For, If): Resolve the expression prior to calling our
17370         code generation.
17371
17372 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17373
17374         * class.cs:
17375           - added method Report28 (warning: program has more than one entry point)
17376           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17377           - modified method Method.Define, the part at the end of the method
17378
17379         * rootcontext.cs: added static public Location EntryPointLocation;
17380           
17381         * ../errors/cs0028.cs : Add test case for the above warning.              
17382
17383         * typemanager.cs:
17384           - modified method CSharpName to allow arrays of primitive type to
17385             be printed nicely (e.g. instead of System.Int32[][] it now prints
17386             int[][])
17387           - added method CSharpSignature: returns the signature of a method
17388             in string format to be used in reporting errors, warnings, etc.
17389
17390         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17391         with String.Empty.
17392
17393 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17394
17395         * delegate.cs (Define): Fix extremely silly bug where I was
17396         setting the type of the 'object' parameter of the BeginInvoke
17397         method to System.IAsyncResult instead of System.Object ;-)
17398
17399 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17400
17401         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17402         here. 
17403
17404         (Constructor.Emit): return if we fail to initialize the
17405         constructor.  Another door closed!  
17406
17407         * expression.cs (New.DoResolve): Improve error message (from -6 to
17408         1501).  Use DeclaredOnly lookup to find the exact constructor.
17409
17410         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17411         loop.  This is useful.
17412
17413         * cs-parser.jay: Adjust the default parameters so that destructors
17414         have the proper signature.
17415
17416 2002-04-26  Martin Baulig  <martin@gnome.org>
17417
17418         * driver.cs (LoadAssembly): If `assembly' contains any characters
17419         which are only valid in path names and not in assembly names
17420         (currently slash, backslash and point), use Assembly.LoadFrom ()
17421         instead of Assembly.Load () on the `assembly' (before iteration
17422         over the link_paths).
17423
17424 2002-04-26  Martin Baulig  <martin@gnome.org>
17425
17426         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17427
17428 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17429
17430         * class.cs (Property): use the new typemanager.MemberLookup
17431
17432         (TypeContainer.MemberLookup): Implement using the
17433         TypeManager.MemberLookup now. 
17434
17435         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17436         and return MemberInfos, so that these can be used without an
17437         EmitContext (what we had before).
17438
17439 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17440
17441         * expression.cs: Fix the case where the argument to params if the
17442         type of the params.  I omitted handling this before.   Fixed
17443
17444 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17445
17446         * driver.cs: Call BootCorlib_PopulateCoreType
17447
17448         * class.cs (Property.CheckBase): Check for properties only, not
17449         for all members. 
17450
17451         * interface.cs: Temporary hack: try/catch around the
17452         CustomAttributeBuilder, because I am getting an exception that I
17453         do not understand.
17454
17455         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17456         types whose definitions are required to be there (attributes are
17457         defined before standard types).
17458
17459         Compute definitions as we boot the various types, as they are used
17460         immediately (value_type class will need object_type, but if we do
17461         not initialize object_type, we will pass a null, which will let
17462         the runtime pick the System.Object from the existing corlib, which
17463         is not what we want).
17464
17465 2002-04-22  Patrik Torstensson <totte@labs2.com>
17466
17467         * cs-tokenizer.cs: fixed a number of trim() issues.
17468
17469 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17470
17471         * expression.cs (Argument.Type): Ensure that we return the correct
17472         type when we have out or ref parameters [in which case we 
17473         append a "&"].
17474
17475 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17476
17477         * class.cs (Property, Indexer): Allow extern modifier in there. 
17478
17479         * typemanager.cs (InitBaseTypes): Initializes object_type and
17480         value_type, since those will be used early on during the bootstrap
17481         process to compile corlib.
17482
17483         (InitCoreTypes): Move code from here to InitBaseTypes.
17484
17485 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17486
17487         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17488         single-dimension arrays as using the ldlen opcode.  
17489
17490         Daniel Lewis discovered this optimization.  
17491
17492         * typemanager.cs: Add signature for System.Array::get_Length
17493
17494 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17495
17496         * statement.cs: report the error when the foreach does not apply to an
17497         array nor a collection.
17498
17499 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17500
17501         * expression.cs: Add implicit conversions to the operator ~.
17502
17503         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17504
17505         * typemanager.cs: Locate the decimal constructor.
17506
17507 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17508
17509         * attribute.cs: use the new property of TypeOf.
17510         * expression.cs: added 'get' property around typearg.
17511
17512         These changes fix a build breaker reported by NickD. Is this the
17513         correct way to fix?  If not, please, revert my changes and make it
17514         work :-).
17515
17516 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17517
17518         * attribute.cs: Add support for typeof in attribute invocations.
17519         I am not sure that this is right though.
17520
17521 2002-04-14  Duncan Mak  <duncan@ximian.com>
17522
17523         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17524         Binary.Operator.Division case.
17525
17526 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17527
17528         * class.cs (DefineType): Ensure that we do a proper check on
17529         attribute types and also register it with the TypeManager.
17530
17531         (TypeContainer.Targets): The default for attribute types is
17532         AttributeTargets.All.
17533
17534         * attribute.cs (ApplyAttributes): Registering the attribute type
17535         is done elsewhere, not when we discover we have a Usage attribute.
17536
17537 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17538
17539         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17540         and get rid of is_delegate parameter.
17541
17542         * everywhere : update.
17543
17544 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17545
17546         * cs-parser.jay (compilation_unit): Revamp completely to use
17547         some new ideas that I got from Rhys' grammar to solve the problems
17548         with assembly level attributes.
17549
17550         (outer_declaration): New grammar production.
17551
17552         (attribute_sections): Add.
17553
17554         (opt_attributes): Base on attribute_sections
17555
17556         (namespace_declaration): Allow opt_attributes to tackle the case
17557         when we have assembly level attributes - we are clever in this
17558         regard now ;-)
17559
17560         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17561         attributes in the non-global context.
17562
17563         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17564         instead of SetGlobalAttributes.
17565
17566         * class.cs, rootcontext.cs : Ensure we define and generate 
17567         attribute types before anything else.
17568
17569         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17570         and flag the new error -20 for the case when the attribute type
17571         does not have valid targets specified. csc does not catch this.
17572
17573         * ../errors/errors.txt : update for error # -20
17574
17575 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17576
17577         * support.cs (InternalParameters.ParameterModifier): Do some null
17578         checking and return sane values.
17579
17580         * class.cs (Method.Define): If we are a PInvoke method, ensure
17581         that we are static and extern. Report error # 601
17582
17583         * ../errors/cs0601.cs : Add test case for the above error.
17584
17585 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17586
17587         * rootcontext.cs (attribute_types): We need to keep type of
17588         all attribute types separately and emit code for them first.
17589
17590         (RegisterAttribute) : Implement.
17591
17592         * class.cs (DefineType): Check if the current Type is a custom
17593         attribute type and register it accordingly.
17594
17595         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17596         adding the first attribute twice and rename to
17597
17598         (SetGlobalAttributes): this.
17599
17600         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17601         lookups.
17602
17603         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17604         if we are processing global arguments. Hmm, I am unsure of this.
17605
17606 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17607
17608         * expression.cs: added static array of strings to avoid calling
17609         Enum.ToString () for Operator in Binary. Significant recover of
17610         performance.
17611
17612 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17613
17614         * class.cs (FindMembers): Allow the Builders of the various
17615         members to be null.  If they are skip them.  This only happens
17616         during the PInvoke declaration.
17617
17618 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17619
17620         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17621         failure, so we do not keep going afterwards.
17622
17623         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17624         wanted to pass `false' as the `is_delegate' argument.  If this is
17625         the case, why not use delegate_type == null to mean `is_delegate =
17626         false' and anything else as is_delegate = true.
17627
17628 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17629
17630         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17631         code for the section, not the beginning of the tests.
17632
17633 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17634
17635         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17636
17637         * expression.cs (Binary): same.  Warn about errors where we have
17638         Enum/Enum in operator + as well.
17639
17640 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17641
17642         * statement.cs:
17643                 - added support for switch(bool)
17644                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17645                 - add TableSwitchEmit() to handle table-based switch statements
17646
17647 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17648
17649         * expression.cs (Invocation.OverloadResolve): Factor out code which
17650         does parameter compatibility checking with arguments so that we can 
17651         re-use the code even from Delegate.VerifyApplicability
17652
17653         (VerifyArgumentsCompat): Move above code here.
17654
17655         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17656         and instead make a call to the above method.
17657
17658 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17659
17660         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17661         We use it to keep track of classes which are attribute types.
17662
17663 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17664
17665         * delegate.cs (Delegate.Define): Correctly define the types in the
17666         presence of fixed and array parameters.
17667
17668         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17669         doing FindMembers.
17670
17671         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17672         include NonPublic after the first iteration.
17673
17674         * class.cs (Indexer.CheckBase): Only check if both parents are
17675         non-null. 
17676
17677         * cs-parser.jay (accessor_body): If empty, set to null.
17678
17679         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17680         same code path here to resolve constants names that we did have in
17681         MemberAccess.DoResolve.  There is too much code duplicated here.
17682
17683 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17684
17685         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17686
17687         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17688         to MakeUnionSet.
17689
17690         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17691         tokens, numbers and strings.
17692
17693         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17694         parenthesis.
17695
17696         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17697         asyncronous parameters and the regular parameters.  
17698
17699         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17700         specify the target directory.
17701
17702         * expression.cs: (This.DoResolve): Simplify
17703         (As.Emit): Optimize, do not generate IsInst if the expression is
17704         always of the given type.
17705
17706         (Is.DoResolve): Bug fix, we were reporting both always/never for
17707         the is expression.
17708
17709         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17710         creating too many unnecessary arrays.
17711
17712 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17713
17714         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17715         fields instead of rolling our own initializer.   Takes care of all
17716         implicit conversions, and drops unnecessary static checks/argument.
17717
17718 2002-03-31  Dick Porter  <dick@ximian.com>
17719
17720         * driver.cs: use the GetDirectories() return values properly, and
17721         use "/" as path separator.
17722
17723 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17724
17725         * expression.cs (Unary): Optimize - - expr into expr.
17726         (Binary): Optimize a + (-b) into a -b.
17727
17728         * codegen.cs (CodeGen): Made all methods static.
17729
17730 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17731
17732         * rootcontext.cs: 
17733
17734         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17735         TypeBuilder property.
17736
17737         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17738         instead. 
17739
17740         * tree.cs: Removed the various RecordXXXX, and replaced with a
17741         single RecordDecl.  Removed all the accessor methods, and just
17742         left a single access point Type 
17743
17744         * enum.cs: Rename DefineEnum to DefineType.
17745
17746         * decl.cs: New abstract method `DefineType' used to unify the
17747         Defines for Enumerations, Interfaces, TypeContainers and
17748         Delegates.
17749
17750         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17751         LookupBaseClasses method that used to live in class.cs and
17752         interface.cs here, and renamed to FindType.
17753
17754         * delegate.cs: Implement DefineType.  Take advantage of the
17755         refactored pattern for locating the parent builder without taking
17756         the parent_builder argument (which we know does not work if we are
17757         nested, and triggering a toplevel definition).
17758
17759 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17760
17761         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17762         accessibility of a member has changed during override and report
17763         an error if so.
17764
17765         * class.cs (Method.Define, Property.Define): Only complain on
17766         overrides if the method is private, any other accessibility is
17767         fine (and since we just checked the permission is the same, we are
17768         good to go).
17769
17770         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17771         and elif are processed always.  The other pre-processing
17772         directives are only processed if we are "taking" the path
17773
17774 2002-03-29  Martin Baulig  <martin@gnome.org>
17775
17776         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17777         current location is not Null.
17778
17779         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17780         a separate method so we can profile it.
17781
17782         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17783         `span.Seconds' are just seconds, but no minutes or hours.
17784         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17785
17786 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17787
17788         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17789         Remove the gratuitous set of Final:
17790
17791                                 // If an interface implementation, then we can set Final.
17792                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17793                                     implementing.DeclaringType.IsInterface)
17794                                         flags |= MethodAttributes.Final;
17795
17796         I do not know what I was smoking when I used that.
17797
17798
17799         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17800         step into fixing the name resolution issues for delegates and
17801         unifying the toplevel name resolution.
17802
17803 2002-03-28  Martin Baulig  <martin@gnome.org>
17804
17805         * class.cs (Method.Emit): If we have a symbol writer, call its
17806         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17807         tell it about the current method.
17808
17809         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17810         writer that we're going to emit the first byte of IL code for a new
17811         statement (a new source line).
17812         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17813         EmitContext.Mark() before emitting any code.
17814
17815         * location.cs (SymbolDocument): Return null when we're Null.
17816
17817         * statement.cs (Statement): Moved the `Location loc' variable here.
17818         (Statement.EmitBoolExpression): If we have a symbol writer, call
17819         ec.Mark() before emitting any code to tell it that we're at the
17820         beginning of a new statement.
17821         (StatementExpression): Added `Location' argument to the constructor.
17822         (Block): Added public readonly variable `StartLocation' and public
17823         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17824         (Block): Added constructor which takes a start and end location.
17825         (Block.SetEndLocation): New method. This sets the end location.
17826         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17827         local variables we create.
17828         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17829         each statement and do also mark the begin and end of the block.
17830
17831         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17832         tell it the current lexer.Location, use Location.Null for the end of the
17833         block.
17834         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17835         current block, set its end location using SetEndLocation().
17836         (statement_expression): StatementExpression constructor now takes the
17837         lexer.Location as additional argument.
17838         (for_statement, declare_local_variables): Likewise.
17839         (declare_local_variables): When creating a new implicit block, use the
17840         new Block constructor and pass it the lexer.Location.
17841
17842 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17843
17844         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17845         members also on the parent interfaces recursively.
17846
17847 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17848
17849         * report.cs: Use new formats, since Gonzalo finished the missing
17850         bits. 
17851
17852         * expression.cs (Binary.ResolveOperator): added missing operator|
17853         operator& and operator^ for bool/bool.
17854
17855         * cs-parser.jay: CheckDef now takes a Location argument that is
17856         used to report errors more precisly (instead of reporting the end
17857         of a definition, we try to track something which is a lot closer
17858         to the source of the problem).
17859
17860         * cs-tokenizer.cs: Track global token use, so we can properly flag
17861         the use of #define/#undef after the first token has been seen.
17862
17863         Also, rename the reportXXXX to Error_DescriptiveName
17864
17865         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17866         TypeContainer, so that Enum and Interface can use this too.
17867
17868         * class.cs (TypeContainer.LookupInterfaceOrClass,
17869         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17870         `builder' argument.  Typically this was used to pass the parent
17871         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17872         the definition).  
17873
17874         The problem is that a nested class could trigger the definition of
17875         a toplevel class, and the builder would be obviously wrong in that
17876         case. 
17877
17878         So we drop this argument, and we compute dynamically the
17879         TypeBuilder/ModuleBuilder (the correct information was available
17880         to us anyways from DeclSpace.Parent)
17881
17882         * interface.cs (Interface.DefineInterface): Drop builder
17883         parameter cleanup like class.cs
17884
17885         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
17886         like class.cs
17887
17888         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17889         values. 
17890
17891         (Try.Emit): Propagate the returns value from the statement.
17892
17893         (Return.Emit): Even if we are leavning 
17894
17895         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17896
17897         * modifiers.cs: Fix the computation of MethodAttributes flags.
17898
17899 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17900
17901         * driver.cs: allow compilation of files that start with '/'.
17902         Add a default case when checking the argument of --target.
17903
17904 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
17905
17906         * interface.cs: Implement the same search algorithm for types in
17907         the interface code.
17908
17909         * delegate.cs: Do not allow multiple definition.
17910
17911         * Recovered ChangeLog that got accidentally amputated
17912
17913         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17914
17915         * rootcontext.cs: Load manually enum to allow core classes to
17916         contain enumerations.
17917
17918         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17919         Update to new static methods in TypeManager.
17920
17921         * typemanager.cs (GetMethod, GetConstructor): Use our
17922         implementation of FindMembers to find the members, since during
17923         corlib compilation, the types are TypeBuilders and GetMethod and
17924         GetConstructor do not work.
17925
17926         Make all methods in TypeManager static.
17927
17928         (InitCodeHelpers): Split the functionality from
17929         the InitCodeTypes function.
17930
17931         * driver.cs: Call InitCodeHelpers after we have populated the
17932         types. 
17933
17934         * cs-parser.jay (delegate_declaration): we did not used to compute
17935         the delegate name correctly for void delegates.
17936
17937 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
17938
17939         * rootcontext.cs (RootContext): Init the interface_resolve_order
17940         and type_container_resolve_order always.
17941
17942         (ResolveCore, BootstrapCorlib_ResolveClass,
17943         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17944         compiler when compiling with --nostdlib
17945
17946         * class.cs (TypeContainer.DefineType): Check that our parent is
17947         not null.  This test is most important when we are bootstraping
17948         the core types.
17949
17950         * codegen.cs: Split out the symbol writing code.
17951
17952 2002-03-25  Martin Baulig  <martin@gnome.org>
17953
17954         * driver.cs (-g): Made -g an alias for --debug.
17955
17956 2002-03-24  Martin Baulig  <martin@gnome.org>
17957
17958         * codegen.cs (SymbolWriter): New public variable. Returns the
17959         current symbol writer.
17960         (CodeGen): Added `bool want_debugging_support' argument to the
17961          constructor. If true, tell the ModuleBuild that we want debugging
17962         support and ask it for the ISymbolWriter.
17963         (Save): If we have a symbol writer, call it's Close() method after
17964         saving the assembly.
17965
17966         * driver.c (--debug): New command line argument to create a
17967         debugger information file.
17968
17969         * location.cs (SymbolDocument): New public property. Returns an
17970         ISymbolDocumentWriter object for the current source file or null
17971         if we don't have a symbol writer.
17972
17973 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
17974
17975         * driver.cs (LoadAssembly): Correctly return when all the paths
17976         have been tried and not before.
17977
17978         * statement.cs (Switch.Emit): return the actual coverage for this
17979         statement (returns/not-returns)
17980
17981         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17982         switch of the statement if we are the last switch section.  That
17983         kills two problems: try/catch problems (we used to emit an empty
17984         nop at the end) and switch statements where all branches would
17985         return. 
17986
17987 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17988
17989         * driver.cs: Add default assemblies (the equivalent to the
17990         Microsoft CSC.RSP file)
17991
17992         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17993         also update tokens_seen and set it to false.
17994
17995         * driver.cs: Implement --recurse for Mike.
17996
17997         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17998         correctly splitting out the paths.
17999
18000 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18001
18002         * interface.cs (Interface.PopulateProperty): Instead of using
18003         `parent' as the declaration space for the set parameters, use
18004         `this' 
18005
18006         * support.cs (InternalParameters): InternalParameters constructor
18007         takes a DeclSpace instead of a TypeContainer.
18008
18009         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18010         types are being initialized, load the address of it before calling
18011         the function.  
18012
18013         (New): Provide a mechanism to disable the generation of local
18014         value type temporaries when the caller will be providing us with
18015         an address to store it.
18016
18017         (ArrayCreation.EmitDynamicInitializers): Use it.
18018
18019 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18020
18021         * expression.cs (Invocation.EmitArguments): Only probe for array
18022         property if there is more than one argument.  Sorry about that.
18023
18024         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18025         empty param arrays.
18026
18027         * class.cs (Method.LabelParameters): Fix incorrect code path that
18028         prevented the `ParamArrayAttribute' from being applied to the
18029         params attribute.
18030
18031 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18032
18033         * support.cs (ReflectionParameters): Correctly compute whether the
18034         last argument is a params array.  Fixes the problem with
18035         string.Split ('a')
18036
18037         * typemanager.cs: Make the assemblies array always be non-null
18038         (empty, but non-null)
18039
18040         * tree.cs (RecordDecl): New function that abstracts the recording
18041         of names.  This reports error 101, and provides a pointer to the
18042         previous declaration.  Fixes a crash in the compiler.
18043
18044         * cs-parser.jay (constructor_declaration): Update to new grammar,
18045         and provide a constructor_body that can be empty.
18046
18047 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18048
18049         * driver.cs: Add support for --resources.
18050
18051         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18052         Make all types for the various array helper methods be integer.
18053
18054         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18055         CheckState to ConvCast.
18056
18057         (ConvCast): Now it takes a `checked' state argument, to avoid
18058         depending on the emit context for the conversion, and just using
18059         the resolve time setting.
18060
18061         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18062         instead of Invocation.EmitArguments.  We do not emit the original
18063         arguments, instead we emit those which have been converted to
18064         unsigned int expressions.
18065
18066         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18067
18068         * codegen.cs: ditto.
18069
18070         * expression.cs (LocalVariableReference): Drop the use of the
18071         Store function that depended on the variable index.
18072
18073         * statement.cs (VariableInfo): Drop the `Idx' property from this
18074         class, as this is not taking into account the indexes for
18075         temporaries tat we generate during the execution, getting the
18076         indexes wrong.
18077
18078         * class.cs: First emit class initializers, then call the parent
18079         constructor. 
18080
18081         * expression.cs (Binary): Fix opcode emision.
18082         (UnaryMutator.EmitCode): Support checked code generation
18083
18084         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18085         matches for events for both the Static and Instance scans,
18086         pointing to the same element.   Fix that.
18087
18088 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18089
18090         * rootcontext.cs (ResolveTree): Always set the
18091         interface_resolve_order, because nested interfaces will be calling
18092         into us.
18093
18094         * class.cs (GetInterfaceOrClass): Track the same resolution
18095         process used by TypeManager.LookupType.  This fixes the nested
18096         type lookups in class declarations (separate path from
18097         LookupType). 
18098
18099         (TypeContainer.DefineType): Also define nested interfaces.
18100         (TypeContainer.RegisterOrder): New public function used to
18101         register the order in which child interfaces need to be closed.
18102
18103         Nested interfaces need to be closed after their parents have been
18104         created. 
18105
18106         * interface.cs (InterfaceAttr): Put all the logic for computing
18107         the interface attribute here. 
18108
18109         (DefineInterface): Register our interface order with the
18110         RootContext or with the TypeContainer depending on the case.
18111
18112 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18113
18114         * cs-parser.jay: rework foreach statement to work with the new
18115         changes to the policy on SimpleNames.
18116
18117         * report.cs: support Stacktrace on warnings as well.
18118
18119         * makefile: drop --unsafe and /unsafe from the compile.
18120
18121 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18122
18123         * ecore.cs (StandardConversionExists): Modify to take an Expression
18124         as the first parameter. Ensure we do null -> reference type conversion
18125         checking.
18126
18127         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18128         temporary Expression objects.
18129
18130 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18131
18132         * interface.cs: workaround bug in method overloading resolution
18133         (there is already a bugzilla bug for it).
18134
18135 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18136
18137         We could also solve this problem by having a separate path for
18138         performing type lookups, instead of DoResolve, we could have a
18139         ResolveType entry point, and only participating pieces of the
18140         production (simplename, deref, array) would implement this. 
18141
18142         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18143         signal SimpleName to only resolve type names and not attempt to
18144         resolve anything else.
18145
18146         * expression.cs (Cast): Set the flag.
18147
18148         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18149
18150         * class.cs: Only report 108 if there is no `new' modifier.
18151
18152         * cs-parser.jay: rework foreach statement to work with the new
18153         changes to the policy on SimpleNames.
18154
18155         * report.cs: support Stacktrace on warnings as well.
18156
18157         * makefile: drop --unsafe and /unsafe from the compile.
18158
18159 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18160
18161         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18162         lookups here, instead of doing that at parse time.  This means
18163         that our grammar will not introduce `LocalVariableReferences' as
18164         expressions at this point.  That solves the problem of code like
18165         this:
18166
18167         class X {
18168            static void Main ()
18169            { int X = 1;
18170             { X x = null }}}
18171
18172         This is only half the fix.  The full fix requires parameters to
18173         also be handled in this way.
18174
18175         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18176         makes the use more obvious of the DeclSpace.  The
18177         ec.TypeContainer.TypeBuilder is now only used to pull the
18178         TypeBuilder for it.
18179
18180         My theory is that I can get rid of the TypeBuilder completely from
18181         the EmitContext, and have typecasts where it is used (from
18182         DeclSpace to where it matters).  
18183
18184         The only pending problem is that the code that implements Aliases
18185         is on TypeContainer, and probably should go in DeclSpace.
18186
18187         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18188         lookups here, instead of doing that at parse time.  This means
18189         that our grammar will not introduce `LocalVariableReferences' as
18190         expressions at this point.  That solves the problem of code like
18191         this:
18192
18193         class X {
18194            static void Main ()
18195            { int X = 1;
18196             { X x = null }}}
18197
18198         This is only half the fix.  The full fix requires parameters to
18199         also be handled in this way.
18200
18201         * class.cs (Property.DefineMethod): When implementing an interface
18202         method, set newslot, when implementing an abstract method, do not
18203         set the flag (before we tried never setting it, or always setting
18204         it, which is the difference).
18205         (Indexer.DefineMethod): same.
18206         (Method.DefineMethod): same.
18207
18208         * ecore.cs: Only set the status used flag if we get back a Field.
18209
18210         * attribute.cs: Temporary hack, so Paolo can keep working.
18211
18212 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18213
18214         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18215         the unmanaged type in the case we have a MarshalAs attribute.
18216
18217         (Resolve): Handle the case when we are parsing the special MarshalAs
18218         attribute [we need to store the unmanaged type to use later]
18219
18220         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18221         MarshalAs Attribute.
18222
18223         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18224         on parameters and accordingly set the marshalling info.
18225
18226 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18227
18228         * class.cs: Optimizing slightly by removing redundant code after
18229         we switched to the `NoTypes' return value.
18230         (Property.DefineMethod): use NoTypes here too.
18231
18232         This fixes the bug I introduced in my last batch of changes.
18233
18234 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18235
18236         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18237
18238         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18239         Enums since those are types too. 
18240
18241         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18242
18243         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18244         thanks to a call during the lookup process.
18245
18246 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18247
18248         * statement.cs (Foreach): Lots of work to accomodate a particular
18249         kind of foreach statement that I had not kept in mind.  It is
18250         possible to have foreachs on classes that provide a GetEnumerator
18251         method that return objects that implement the "pattern" for using
18252         a foreach, there is no need to support GetEnumerator
18253         specifically. 
18254
18255         This is needed to compile nant.
18256
18257         * decl.cs: Only report 114 if the member is not `Finalize' and if
18258         the warning level is at least 2.
18259
18260         * class.cs: Moved the compare function from Method to
18261         MethodSignature. 
18262
18263         (MethodSignature.InheritableMemberSignatureCompare): Add new
18264         filter function that is used to extract inheritable methods from a
18265         class. 
18266
18267         (Method.Define): Use the new `inheritable_method_signature_filter'
18268         delegate
18269
18270         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18271         command. 
18272
18273 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18274
18275         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18276
18277         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18278
18279         * expression.cs: Pass location information to
18280         ConvertImplicitStandard. 
18281
18282         * class.cs: Added debugging code to track return values from
18283         interfaces. 
18284
18285 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18286
18287         * expression.cs (Is.DoResolve): If either side of the `is' is an
18288         interface, do not flag the warning.
18289
18290         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18291         for interfaces
18292
18293         * report.cs: Allow for --fatal to be used with --probe.
18294
18295         * typemanager.cs (NoTypes): Move the definition for the empty Type
18296         array here. 
18297
18298         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18299         properties. 
18300         (TypeContainer.DefineProxy): New function used to proxy to parent
18301         implementations when implementing interfaces.
18302         (TypeContainer.ParentImplements): used to lookup if our parent
18303         implements a public function that is required by an interface.
18304         (TypeContainer.VerifyPendingMethods): Hook this up.
18305
18306         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18307         `modules' and `assemblies' arraylists into arrays.  We only grow
18308         these are the very early start up of the program, so this improves
18309         the speedof LookupType (nicely measured).
18310
18311         * expression.cs (MakeByteBlob): Replaced unsafe code with
18312         BitConverter, as suggested by Paolo.
18313
18314         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18315         folding of string concatenation, but if either side is a string,
18316         and the other is not, then return null, and let the runtime use
18317         the concatenation on the string plus the object (using
18318         `Object.ToString'). 
18319
18320 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18321
18322         Constant Folding has been implemented now.
18323
18324         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18325         the error instead on types that are not supported in one's
18326         complement. 
18327
18328         * constant.cs (Constant and all children): New set of functions to
18329         perform implict and explicit conversions.
18330
18331         * ecore.cs (EnumConstant): Implement the new functions to perform
18332         conversion by proxying to the child expression.
18333
18334         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18335         own separate setting that can not be turned off from the command
18336         line using --unchecked or --checked and is only controlled using
18337         the checked/unchecked statements and expressions.  This setting is
18338         used by the constant folder to flag errors.
18339
18340         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18341         ConstantCheckState as well.   
18342
18343         During Resolve, they also have to flag the state, because the
18344         constant folder runs completely in the Resolve phase.
18345
18346         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18347         well.
18348
18349 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18350
18351         * cfold.cs: New file, this file contains the constant folder.
18352
18353         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18354         argument to track whether we are using the resulting address to
18355         load or store a value and provide better error messages. 
18356
18357         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18358         new AddressOf arguments.
18359
18360         * statement.cs (Foreach.EmitCollectionForeach): Update
18361
18362         * expression.cs (Argument.Emit): Call AddressOf with proper
18363         arguments to track usage.
18364
18365         (New.DoEmit): Call AddressOf with new arguments.
18366
18367         (Unary.Emit): Adjust AddressOf call.
18368
18369 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18370
18371         * cs-parser.jay (member_access): Change the case for pre-defined types
18372         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18373         this suggestion.
18374
18375         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18376         a method body.
18377
18378         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18379         essentially like methods and apply attributes like MethodImplOptions to them too.
18380
18381         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18382         not being null.
18383
18384         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18385         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18386         is the DeclSpace.
18387
18388         * Update code everywhere accordingly.
18389
18390         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18391
18392         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18393
18394 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18395
18396         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18397         try performing lookups against those instead of jumping straight into using
18398         the 'using' clauses.
18399
18400         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18401
18402         (LookupType): Perform lookups in implicit parents too.
18403
18404         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18405         sequence as RootContext.LookupType. 
18406
18407         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18408         the various cases of namespace lookups into this method.
18409
18410 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18411
18412         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18413         in positional arguments)
18414
18415         * class.cs (Operator): Update the AllowedModifiers to contain
18416         extern. 
18417
18418         * cs-parser.jay: Update operator declaration to allow for the
18419         operator body to be empty.
18420
18421         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18422         values. 
18423
18424 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18425
18426         * class.cs (Method.Emit): Label parameters.
18427
18428         * driver.cs: Return 1 or 0 as the program exit code.
18429
18430 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18431
18432         * expression.cs: Special case the `null' object when trying to
18433         auto-compute the type, as anything can be explicitly converted to
18434         that. 
18435
18436         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18437         spotting this Paolo.
18438
18439         (Expression.ImplicitNumericConversion): Perform comparissions of
18440         the type using the underlying type in the case of an enumeration
18441         rather than using the enumeration type for the compare.
18442
18443         Cope with the underlying == type case, which is not possible to
18444         catch before. 
18445
18446         (Expression.ConvertNumericExplicit): Perform comparissions of
18447         the type using the underlying type in the case of an enumeration
18448         rather than using the enumeration type for the compare.
18449
18450         * driver.cs: If the user does not supply an extension, assume .exe
18451
18452         * cs-parser.jay (if_statement): Rewrote so that we can track the
18453         location for the if statement.
18454
18455         * expression.cs (Binary.ConstantFold): Only concat strings when
18456         the operation is "+", not everything ;-)
18457
18458         * statement.cs (Statement.EmitBoolExpression): Take a location
18459         argument. 
18460         (If, While, Do): Track location.
18461
18462         * expression.cs (Binary.ResolveOperator): In the object + string
18463         case, I was missing a call to ConvertImplicit
18464
18465 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18466
18467         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18468         Location arguments. Ensure we use RootContext.LookupType to do our work
18469         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18470
18471         * interface.cs (PopulateMethod): Handle the type of the parameter being
18472         null gracefully.
18473
18474         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18475         have a params method with no fixed arguments and a call is made with no
18476         arguments.
18477
18478 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18479
18480         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18481         the verbatim-string-literal
18482
18483         * support.cs (InternalParameters.ParameterModifier): handle null
18484         fixed parameters.
18485         (InternalParameters.ParameterType): ditto.
18486
18487         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18488         duplicating the name of the variable parameter.
18489         (GetParameterByName): Fix bug where we were not looking up array
18490         paramters if they were the only present (thanks Paolo!).
18491         (GetParameterInfo): We only have an empty set of types if both
18492         fixed and array are set to null.
18493         (GetParameterInfo-idx): Handle FixedParameter == null
18494
18495         * cs-parser.jay: Handle the case where there is no catch
18496         statements (missing null test).
18497
18498 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18499
18500         * driver.cs (MainDriver): Be conservative on our command line
18501         handling.
18502
18503         Catch DirectoryNotFoundException when calling GetFiles.
18504
18505         (SplitPathAndPattern): Used to split the input specification into
18506         a path and a pattern that we can feed to Directory.GetFiles.
18507
18508 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18509
18510         * statement.cs (Fixed): Implement the last case of the Fixed
18511         statement (string handling).
18512
18513         * expression.cs (StringPtr): New class used to return a char * to
18514         a string;  Used by the Fixed statement.
18515
18516         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18517
18518         * expression.cs (Binary.ResolveOperator): Remove redundant
18519         MemberLookup pn parent type.
18520         Optimize union call, we do not need a union if the types are the same.
18521         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18522         type.
18523
18524         Specialize the use of MemberLookup everywhere, instead of using
18525         the default settings. 
18526
18527         (StackAlloc): Implement stackalloc keyword.
18528
18529         * cs-parser.jay: Add rule to parse stackalloc.
18530
18531         * driver.cs: Handle /h, /help, /?
18532
18533         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18534         before we supported unsafe code.
18535
18536         * makefile: add --unsafe to the self compilation of mcs.
18537
18538 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18539
18540         * expression.cs (PointerArithmetic): New class that is used to
18541         perform pointer arithmetic.
18542         (Binary.Resolve): Handle pointer arithmetic
18543         Handle pointer comparission.
18544         (ArrayPtr): Utility expression class that is used to take the
18545         address of an array.
18546
18547         (ElementAccess): Implement array access for pointers
18548
18549         * statement.cs (Fixed): Implement fixed statement for arrays, we
18550         are missing one more case before we are done.
18551
18552         * expression.cs (Indirection): Implement EmitAssign and set the
18553         ExprClass to Variable.  This allows pointer dereferences to be
18554         treated as variables, and to have values assigned to them.
18555
18556         * ecore.cs (Expression.StoreFromPtr): New utility function to
18557         store values dereferencing.
18558
18559 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18560
18561         * expression.cs (Binary.ResolveOperator): Ensure that we are
18562         not trying to operate on a void type - this fixes the reported
18563         bug.
18564
18565         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18566         the parent implementation is sealed.
18567
18568         * ../errors/cs0239.cs : Add.
18569
18570         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18571
18572         * typemanager.cs (unverifiable_code_type): Corresponds to 
18573         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18574         which have unsafe code in them.
18575
18576         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18577         unsafe context.
18578
18579 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18580
18581         * cs-tokenizer.cs: Add support for @"litreal strings"
18582
18583         Make tokenizer accept pre-processor directives
18584         on any column (remove the old C-like limitation). 
18585
18586         * rootcontext.cs (EmitCode): Emit any global attributes.
18587         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18588
18589         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18590
18591         * cs-parser.jay: Add support for global attributes.  
18592
18593 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18594
18595         * expression.cs (Indirection): New helper class.  Unary will
18596         create Indirection classes to be able to implement the
18597         IMemoryLocation interface on it.
18598
18599 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18600
18601         * cs-parser.jay (fixed_statement): reference the right statement.
18602
18603         * statement.cs (Fixed.Emit): Finish implementing the fixed
18604         statement for the &x case.
18605
18606 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18607
18608         * class.cs (Property.Define, Method.Define): Remove newslot when
18609         `implementing'.  
18610
18611         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18612         wrong.  NewSlot should only be used if the `new' keyword is present.
18613
18614         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18615         locating our system dir.  Sorry about this.
18616
18617 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18618
18619         * driver.cs (GetSystemDir): Compute correctly the location of our
18620         system assemblies.  I was using the compiler directory instead of
18621         the library directory.
18622
18623 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18624
18625         * expression.cs (BetterFunction): Put back in what Miguel commented out
18626         since it is the correct fix. The problem is elsewhere ;-)
18627
18628         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18629         parameters of the parms method are themselves compatible or not !
18630
18631         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18632         to check that a class implements an interface before saying that an implicit
18633         conversion was allowed. Use ImplementsInterface to do the checking.
18634
18635 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18636
18637         * class.cs (Method.Define): Track whether we are an explicit
18638         implementation or not.  And only call DefineMethodOverride if we
18639         are an explicit implementation.
18640
18641         (Property.DefineMethod): Ditto.
18642
18643 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18644
18645         * expression.cs (BetterFunction): Catch hideous bug which was
18646          preventing us from detecting ambiguous calls due to implicit casts i.e
18647         cs0121.
18648
18649 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18650
18651         * support.cs (Pair): Remove un-needed method.  I figured why I was
18652         getting the error in cs-parser.jay, the variable in a foreach loop
18653         is readonly, and the compiler does not really treat this as a variable.
18654
18655         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18656         instead of EQUALS in grammar.  
18657
18658         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18659
18660         * expression.cs (Unary.DoResolve): Check whether the argument is
18661         managed or not.
18662
18663 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18664
18665         * support.cs: Api for Pair to set a value.  Despite the fact that
18666         the variables are public the MS C# compiler refuses to compile
18667         code that accesses the field if the variable is part of a foreach
18668         statement. 
18669
18670         * statement.cs (Fixed): Begin implementation of the fixed
18671         statement.
18672
18673         (Block.AddVariable): Return the VariableInfo on success and null
18674         on failure instead of true/false. 
18675
18676         * cs-parser.jay (foreach): Catch errors on variables already
18677         defined (we were ignoring this value before) and properly unwind
18678         the block hierarchy
18679
18680         (fixed_statement): grammar for the fixed statement.
18681
18682 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18683
18684         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18685         pointer types to be incretemented.
18686
18687         (SizeOf): Implement.
18688
18689         * cs-parser.jay (pointer_member_access): Implement
18690         expr->IDENTIFIER production.
18691
18692         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18693         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18694         on safe contexts.
18695
18696         (Unary): Implement indirection.
18697
18698         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18699         use in non-unsafe context).
18700
18701         (SimpleName.DoResolve): Check for pointers in field access on safe
18702         contexts. 
18703
18704         (Expression.LoadFromPtr): Factor the load-indirect code in this
18705         function.  This was duplicated in UnboxCast and ParameterReference
18706
18707 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18708
18709         * expression.cs (ComposedCast): report an error if a pointer cast
18710         is used in a safe region.
18711
18712         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18713         pointer type casts in unsafe context.
18714
18715         * codegen.cs (EmitContext): Set up IsUnsafe.
18716
18717         * cs-parser.jay (non_expression_type): Add productions for pointer
18718         casts. 
18719
18720         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18721         code.  We should not use force into static mode if the method is
18722         not virtual.  Fixes bug in MIS
18723
18724         * statement.cs (Do.Emit, While.Emit, For.Emit,
18725         Statement.EmitBoolExpression): Add support to Do and While to
18726         propagate infinite loop as `I do return' semantics.
18727
18728         Improve the For case to also test for boolean constants.
18729
18730         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18731         to the list of attributes we can add.
18732
18733         Remove `EmitContext' argument.
18734
18735         * class.cs (Method.Define): Apply parameter attributes.
18736         (Constructor.Define): Apply parameter attributes.
18737         (MethodCore.LabelParameters): Move here the core of labeling
18738         parameters. 
18739
18740         * support.cs (ReflectionParameters.ParameterModifier,
18741         InternalParameters.ParameterModifier): Use IsByRef on the type and
18742         only return the OUT bit for these parameters instead of in/out/ref
18743         flags.
18744
18745         This is because I miss-understood things.  The ParameterInfo.IsIn
18746         and IsOut represent whether the parameter has the [In] and [Out]
18747         attributes set.  
18748
18749 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18750
18751         * ecore.cs (FieldExpr.Emit): Release temporaries.
18752
18753         * assign.cs (LocalTemporary.Release): new function.
18754
18755         * codegen.cs (EmitContext.GetTemporaryStorage,
18756         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18757         temporary storage.  Now we can "put back" localbuilders when we
18758         are done with them
18759
18760 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18761
18762         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18763         need to make a copy of the variable to generate verifiable code.
18764
18765 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18766
18767         * driver.cs: Compute dynamically the system directory.
18768
18769         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18770         Slower, but more generally useful.  Used by the abstract
18771         registering implementation. 
18772
18773         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18774         the rules for the special rule on Type/instances.  First check if
18775         we have the same name, and if so, try that special static path
18776         rather than the instance path.
18777
18778 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18779
18780         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18781         for, while and if.
18782
18783         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18784         Enum, ValueType, Delegate or Array for non-corlib compiles.
18785
18786         * cs-tokenizer.cs: Catch long identifiers (645)
18787
18788         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18789         piece of code.
18790
18791         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18792         fix, we were returning too early, so we were not registering
18793         pending methods from abstract classes.
18794
18795         Do not register pending methods if the class is abstract.
18796
18797         * expression.cs (Conditional.DoResolve): Report circular implicit
18798         conversions when we neecd to compute it for conditional
18799         expressions. 
18800
18801         (Is.DoResolve): If the expression is always of the provided type,
18802         flag warning 183.  If the expression can not ever be of the
18803         provided type flag warning 184.
18804
18805         * class.cs: Catch 169 as well.
18806
18807         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18808         read. 
18809
18810 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18811
18812         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18813
18814 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18815
18816         * interface.cs: (PopulateMethod): Check for pointers being defined
18817         only if the unsafe context is active.
18818         (PopulateProperty): ditto.
18819         (PopulateIndexer): ditto.
18820
18821         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18822         specified.  If pointers are present, make sure that they are
18823         present in an unsafe context.
18824         (Constructor, Constructor.Define): ditto.
18825         (Field, Field.Define): ditto.
18826         (Property, Property.Define): ditto.
18827         (Event, Event.Define): ditto.
18828
18829         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18830         hashtable if there are classes or structs defined.
18831
18832         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18833         code, as the constant resolution moved.
18834
18835         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18836         the metadata, so we can flag error 133. 
18837
18838         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18839         pointer is being declared in an unsafe context.
18840
18841 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18842
18843         * modifiers.cs (Modifiers.Check): Require a Location argument.
18844         Report error 227 for Unsafe use.
18845
18846         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18847
18848         * statement.cs (For.Emit): If the test is null, then report that
18849         we do `return', as we wont reach anything afterwards.
18850
18851         (Switch.SwitchGoverningType): Track the expression that matched
18852         the conversion.
18853
18854         * driver.cs: Allow negative numbers as an error code to flag.
18855
18856         * cs-parser.jay: Handle 1551.
18857
18858         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18859
18860 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18861
18862         * cs-parser.jay: Report 1518 (type declaration can only contain
18863         class, struct, interface, enum or delegate)
18864
18865         (switch_label): Report 1523 (keywords `case' or `default' must
18866         preced code)
18867
18868         (opt_switch_sections): Report 1522 (empty switch)
18869
18870         * driver.cs: Report 1515 (response file specified multiple times)
18871         Report 1516 (Source file specified multiple times).
18872
18873         * expression.cs (Argument.Resolve): Signal 1510
18874
18875         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18876         access not allowed in static code)
18877
18878 2002-01-11  Ravi Pratap  <ravi@ximian.com>
18879
18880         * typemanager.cs (IsPointerType): Utility method which we are going
18881         to need a lot.
18882
18883         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18884         the object type, so we take care of that.
18885
18886         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18887
18888         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18889         added to non-params parameters :-)
18890
18891         * typemanager.cs (CSharpName): Include 'void' type too. 
18892
18893         (void_ptr_type): Include in the set of core types.
18894
18895         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
18896         duplicating code.
18897
18898         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
18899         an unsafe context.
18900
18901         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
18902         completely forgotten about it.
18903
18904 2002-01-10  Ravi Pratap  <ravi@ximian.com>
18905
18906         * cs-parser.jay (pointer_type): Add. This begins our implementation
18907         of parsing rules for unsafe code.
18908
18909         (unsafe_statement): Implement.
18910
18911         (embedded_statement): Modify to include the above.
18912
18913         * statement.cs (Unsafe): Implement new class for unsafe blocks.
18914
18915         * codegen.cs (EmitContext.InUnsafe): Add. This determines
18916         if the current context is an unsafe one.
18917
18918         * cs-parser.jay (local_variable_pointer_type): Since local variable types
18919         are handled differently, we need separate rules for them.
18920
18921         (local_variable_declaration): Update to use local_variable_pointer_type
18922         to allow variable declarations of unmanaged pointer types.
18923
18924         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18925         in unsafe contexts.
18926
18927         * ../errors/cs0214.cs : Add.
18928
18929 2002-01-16  Nick Drochak  <ndrochak@gol.com>
18930
18931         * makefile: remove 'response' file when cleaning.
18932
18933 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18934
18935         * cs-parser.jay: Report 1524.
18936
18937 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * typemanager.cs (RegisterMethod): drop checking if we have
18940         registered this from here
18941
18942 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
18943
18944         * class.cs (Method.EmitDestructor): Implement calling our base
18945         destructor. 
18946
18947         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18948         value of InFinally.
18949
18950         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18951         this routine and will wrap the call in a try/catch block.  Deal
18952         with the case.
18953
18954 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
18955
18956         * ecore.cs (Expression.MemberLookup): instead of taking a
18957         parameter `same_type' that was used to tell whether we could
18958         access private members we compute our containing type from the
18959         EmitContext.
18960
18961         (FieldExpr): Added partial support for volatile fields.  This does
18962         not work for volatile fields exposed from assemblies, as I can not
18963         figure out how to extract the modreq from it.
18964
18965         Updated all the source files to use this.
18966
18967         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18968         because it is referenced by MemberLookup very often. 
18969
18970 2002-01-09  Ravi Pratap  <ravi@ximian.com>
18971
18972         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18973         TypeBuilder.GetCustomAttributes to retrieve what we need.
18974
18975         Get rid of redundant default_member_attr_type as this is the same as
18976         default_member_type which already exists.
18977
18978         * interface.cs, attribute.cs : Update accordingly.
18979
18980 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18981
18982         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18983         work for TYpeBuilders though.  Ravi, can you please fix this?
18984
18985         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18986
18987         * expression.cs (Argument.Emit): Handle the case of ref objects
18988         being passed to ref functions;  
18989
18990         (ParameterReference.EmitLoad): Loads the content of the pointer
18991         without dereferencing.
18992
18993 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18994
18995         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18996
18997 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18998
18999         * class.cs (Indexer.DefineMethod): Incorporate the interface
19000         type in the name of the method if we are doing explicit interface
19001         implementation.
19002
19003         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19004
19005         (BetterConversion): Fix extremely trivial bug where we were referring to
19006         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19007         again !
19008
19009         * ../errors/bug16.cs : Add although we have fixed it.
19010
19011 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19012
19013         * expression.cs (BaseIndexer): Begin implementation.
19014
19015         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19016
19017         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19018         production directly to remove a shift/reduce, and implement
19019         explicit interface implementation.
19020
19021         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19022         after a floating point suffix.
19023
19024         * expression.cs (DoNumericPromotions): Improved the conversion for
19025         uint/uint.  If we have a constant, we avoid doing a typecast to a
19026         larger type.
19027
19028         * class.cs (Indexer): Implement explicit interface implementation
19029         for indexers.
19030
19031 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19032
19033         * class.cs: make the default instance constructor public and hidebysig.
19034
19035 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19036
19037         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19038         so we can call it from elsewhere.
19039
19040         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19041         we emit it internally if the class has a defined indexer; otherwise the user
19042         emits it by decorating the class definition with the DefaultMemberAttribute.
19043
19044         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19045         attribute is not used on a type which defines an indexer.
19046
19047         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19048         character when we skip whitespace.
19049
19050         * ../errors/cs0646.cs : Add.
19051
19052 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19053
19054         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19055         again. 
19056
19057         * makefile: Add practical target `mcs3.exe' which builds the third
19058         generation compiler. 
19059
19060         * expression.cs (New): Fix structures constructor calling.
19061
19062         * class.cs (Property, Method, Indexer): Emit Final flag on the
19063         method if we are an interface implementation and we are not
19064         abstract. 
19065
19066         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19067         whether this property is referencing a `base' method.
19068
19069         * expression.cs (Invocation.EmitCall): take an extra argument:
19070         is_base, this is used to determine whether the `call' or
19071         `callvirt' opcode should be used.
19072
19073
19074         * delegate.cs: update EmitCall.
19075
19076         * class.cs (Method.Define): Set NewSlot for the cases where we are
19077         not implementing an interface method.
19078
19079         (Property.Define): ditto.
19080
19081 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19082
19083         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19084         'r'.  Allows mcs to parse itself fully.
19085
19086 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19087
19088         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19089         of the number of initializers that require the InitializeArray method.
19090
19091         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19092         update the above field where necessary.
19093
19094         (MakeByteBlob): Update accordingly.
19095
19096         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19097         greater than 2.
19098
19099         (EmitDynamicInitializers): Update in accordance with the new optimization.
19100
19101         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19102         same OpCode applies.
19103
19104         * cs-parser.jay : Fix some glaring errors I introduced.
19105
19106 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19107
19108         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19109         so that we can check for name clashes there too.
19110
19111         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19112         for interface indexers.
19113
19114         * interfaces.cs (Define): Emit the default member attribute.
19115
19116         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19117         variable was being referred to while setting the value ;-)
19118
19119 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19120
19121         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19122         byte-by-byte information when we know the data is zero.
19123
19124         Make the block always a multiple of 4, because
19125         DefineInitializedData has a bug.
19126
19127         * assign.cs: Fix, we should assign from the temporary, not from
19128         the source. 
19129
19130         * expression.cs (MakeByteBlob): Fix my incorrect code.
19131
19132 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19133
19134         * typemanager.cs (EnumToUnderlying): This function is used to get
19135         the underlying type from an enumeration, because it does not
19136         always work. 
19137
19138         * constant.cs: Use the I4_S form for values between -128 and 127.
19139
19140         * statement.cs (Block.LookupLabel): Looks up a label.
19141         (Block): Drop support for labeled blocks.
19142
19143         (LabeledStatement): New kind of statement that represents a label
19144         only.
19145
19146         (Goto): Finally implement this bad boy.
19147
19148         * cs-parser.jay: Update to reflect new mechanism to implement
19149         labels.
19150
19151 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19152
19153         * codegen.cs (EmitContext.This): a codegen property that keeps the
19154         a single instance of this instead of creating many different this
19155         instances. 
19156
19157         * delegate.cs (Delegate.DoResolve): Update to use the property;
19158
19159         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19160
19161         * expression.cs (BaseAccess.DoResolve): Ditto.
19162
19163 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19164
19165         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19166         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19167
19168         (InitCoreTypes): Update accordingly.
19169
19170         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19171         so we can quickly store the state.
19172
19173         (ApplyAttributes): Set the correct implementation flags
19174         for InternalCall methods.
19175
19176 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19177
19178         * expression.cs (EmitCall): if a method is not virtual, then do
19179         not use callvirt on it.
19180
19181         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19182         user defined stuff) requires the use of stobj, which takes an
19183         address on the stack instead of an array and an index.  So emit
19184         the Ldelema operation for it.
19185
19186         (EmitStoreOpcode): Use stobj for valuetypes.
19187
19188         (UnaryMutator.EmitCode): Use the right 1 value depending on
19189         whether we are dealing with int64/uint64, float or doubles.
19190
19191         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19192         constructors that I implemented last night.
19193
19194         (Constructor.IsDefault): Fix to work properly for static
19195         constructors.
19196
19197         * cs-parser.jay (CheckDef): report method signature errors.
19198         Update error number 103 to be 132.
19199
19200         * decl.cs: New AdditionResult enumeration value: MethodExists.
19201         Although we do this check for methods later on in the semantic
19202         analysis, catching repeated default constructors is so easy that
19203         we catch these here. 
19204
19205         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19206         promotions code.
19207
19208         (ParameterReference.EmitAssign, Emit): handle
19209         bools as bytes.
19210
19211         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19212         (ArrayAccess.EmitStoreOpcode): ditto.
19213
19214         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19215
19216         * expression.cs (MakeByteBlob): Complete all the missing types
19217         (uint, short, ushort, byte, sbyte)
19218
19219         * class.cs: Only init instance field initializers on instance
19220         constructors. 
19221
19222         Rename `constructors' to instance_constructors. 
19223
19224         (TypeContainer.AddConstructor): Only add constructors to the list
19225         if it is not static.
19226
19227         Make sure that we handle default_static_constructor independently
19228         everywhere where we handle instance_constructors
19229
19230 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19231
19232         * class.cs: Do not lookup or create a base initializer for a
19233         static constructor.
19234
19235         (ConstructorInitializer.Resolve): use the proper type to lookup
19236         for constructors.
19237
19238         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19239
19240         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19241         in DeclSpace. 
19242
19243         * decl.cs: CloseType is now an virtual method, the default
19244         implementation just closes this type.
19245
19246 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19247
19248         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19249         to PreserveSig by default. Also emit HideBySig on such methods.
19250
19251         Basically, set the defaults to standard values.
19252
19253         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19254         argument, if candidate is better, it can't be worse than the best !
19255
19256         (Invocation): Re-write bits to differentiate between methods being
19257         applicable in their expanded form and their normal form - for params
19258         methods of course.
19259
19260         Get rid of use_standard everywhere as only standard conversions are allowed
19261         in overload resolution. 
19262
19263         More spec conformance.
19264
19265 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19266
19267         * driver.cs: Add --timestamp, to see where the compiler spends
19268         most of its time.
19269
19270         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19271         `this' in static code.
19272
19273         (SimpleName.DoResolve): Implement in terms of a helper function
19274         that allows static-references to be passed upstream to
19275         MemberAccess.
19276
19277         (Expression.ResolveWithSimpleName): Resolve specially simple
19278         names when called by MemberAccess to implement the special
19279         semantics. 
19280
19281         (Expression.ImplicitReferenceConversion): Handle conversions from
19282         Null to reference types before others, as Null's type is
19283         System.Object. 
19284
19285         * expression.cs (Invocation.EmitCall): Handle the special case of
19286         calling methods declared on a reference type from a ValueType
19287         (Base classes System.Object and System.Enum)
19288
19289         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19290         the left hand side is a TypeExpr, not on every enumeration. 
19291
19292         (Binary.Resolve): If types are reference types, then do a cast to
19293         object on operators != and == of both arguments.
19294
19295         * typemanager.cs (FindMembers): Extract instance and static
19296         members if requested.
19297
19298         * interface.cs (PopulateProperty): Use void_type instead of null
19299         as the return type for the setter method.
19300
19301         (PopulateIndexer): ditto.
19302
19303 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19304
19305         * support.cs (ReflectionParameters): Fix minor bug where we
19306         were examining the wrong parameter for the ParamArray attribute.
19307
19308         Cope with requests for the type of the parameter at position
19309         greater than the params parameter's. We now return the element
19310         type of the params array as that makes more sense.
19311
19312         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19313         accordingly as we no longer have to extract the element type
19314         ourselves.
19315
19316         (Invocation.OverloadResolve): Update.
19317
19318 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19319
19320         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19321         against IEnumerator, test whether the return value is a descendant
19322         of the IEnumerator interface.
19323
19324         * class.cs (Indexer.Define): Use an auxiliary method to implement
19325         the other bits of the method definition.  Begin support for
19326         explicit interface implementation.
19327
19328         (Property.DefineMethod): Use TypeManager.void_type instead of null
19329         for an empty return value.
19330
19331 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19332
19333         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19334         dealing with a FieldExpr which is composed of a FieldBuilder, in
19335         the code path we did extract the constant, but we should have
19336         obtained the underlying value to be able to cast it (otherwise we
19337         end up in an infinite loop, this is what Ravi was running into).
19338
19339         (ArrayCreation.UpdateIndices): Arrays might be empty.
19340
19341         (MemberAccess.ResolveMemberAccess): Add support for section
19342         14.5.4.1 that deals with the special case of E.I when E is a type
19343         and something else, that I can be a reference to a static member.
19344
19345         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19346         handle a particular array type to create byte blobs, it is just
19347         something we dont generate byteblobs for.
19348
19349         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19350         arguments. 
19351
19352         * location.cs (Push): remove the key from the hashtable that we
19353         are about to add.   This happens for empty files.
19354
19355         * driver.cs: Dispose files after we have parsed them.
19356
19357         (tokenize): new function that only runs the tokenizer on its
19358         input, for speed testing.
19359
19360 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19361
19362         * class.cs (Event.Define): Define the private field only if there
19363         are no accessors defined.
19364
19365         * expression.cs (ResolveMemberAccess): If there is no associated
19366         field with the event, that means we have an event defined with its
19367         own accessors and we should flag error cs0070 since transforming
19368         ourselves into a field is not valid in that case.
19369
19370         * ecore.cs (SimpleName.DoResolve): Same as above.
19371
19372         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19373         and charset to sane values.
19374
19375 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19376
19377         * assign.cs (DoResolve): Perform check on events only if they 
19378         are being accessed outside the declaring type.
19379
19380         * cs-parser.jay (event_declarations): Update rules to correctly
19381         set the type of the implicit parameter etc.
19382
19383         (add_accessor, remove_accessor): Set current local parameters.
19384
19385         * expression.cs (Binary): For delegate addition and subtraction,
19386         cast the return value from the method into the appropriate delegate
19387         type.
19388
19389 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19390
19391         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19392         of these as the workaround is unnecessary.
19393
19394         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19395         delegate data - none of that is needed at all.
19396
19397         Re-write bits to extract the instance expression and the delegate method
19398         correctly.
19399
19400         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19401         on delegates too.
19402
19403         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19404         of attaching attributes instead of duplicating code everywhere.
19405
19406         * everywhere : Update code to do attribute emission using the above method.
19407
19408 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19409
19410         * expression.cs (IsParamsMethodApplicable): if there are not
19411         parameters, return immediately.
19412
19413         * ecore.cs: The 0 literal can be implicity converted to an enum
19414         type. 
19415
19416         (SimpleName.DoResolve): First lookup the type, then lookup the
19417         members. 
19418
19419         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19420         want to get its address.  If the InstanceExpression is not
19421         addressable, store the result in a temporary variable, then get
19422         the address of it.
19423
19424         * codegen.cs: Only display 219 errors on warning level or above. 
19425
19426         * expression.cs (ArrayAccess): Make it implement the
19427         IMemoryLocation interface.
19428
19429         (Binary.DoResolve): handle the operator == (object a, object b)
19430         and operator != (object a, object b) without incurring into a
19431         BoxedCast (because 5 != o should never be performed).
19432
19433         Handle binary enumerator operators.
19434
19435         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19436         value type, otherwise use Ldelem_ref.
19437
19438         Use precomputed names;
19439
19440         (AddressOf): Implement address of
19441
19442         * cs-parser.jay (labeled_statement): Fix recursive block
19443         addition by reworking the production.
19444
19445         * expression.cs (New.DoEmit): New has a special case:
19446                 
19447                  If we are dealing with a ValueType, we have a few
19448                  situations to deal with:
19449                 
19450                     * The target of New is a ValueType variable, that is
19451                       easy, we just pass this as the variable reference
19452                 
19453                     * The target of New is being passed as an argument,
19454                       to a boxing operation or a function that takes a
19455                       ValueType.
19456                 
19457                       In this case, we need to create a temporary variable
19458                       that is the argument of New.
19459
19460
19461 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19462
19463         * rootcontext.cs (LookupType): Check that current_type is not null before
19464         going about looking at nested types.
19465
19466         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19467         not implement the IAssignMethod interface any more.
19468
19469         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19470         where we tranform them into FieldExprs if they are being resolved from within
19471         the declaring type.
19472
19473         * ecore.cs (SimpleName.DoResolve): Do the same here.
19474
19475         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19476
19477         * ../errors/bug10.cs : Add.
19478
19479         * ../errors/cs0070.cs : Add.
19480
19481         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19482
19483         * assign.cs : Get rid of EventIsLocal everywhere.
19484
19485 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19486
19487         * ecore.cs (ConvertIntLiteral): finished the implementation.
19488
19489         * statement.cs (SwitchLabel): Convert the value we are using as a
19490         key before looking up the table.
19491
19492 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19493
19494         * codegen.cs (EmitTopBlock): Require a Location argument now.
19495
19496         * cs-parser.jay (constructor_declarator): We need to setup
19497         current_local_parameters before we parse the
19498         opt_constructor_initializer, to allow the variables to be bound
19499         to the constructor arguments.
19500
19501         * rootcontext.cs (LookupType): First lookup nested classes in our
19502         class and our parents before we go looking outside our class.
19503
19504         * expression.cs (ConstantFold): Extract/debox the values at the
19505         beginnning. 
19506
19507         * rootcontext.cs (EmitCode): Resolve the constants first before we
19508         resolve the types.  This is not really needed, but it helps debugging.
19509
19510         * statement.cs: report location.
19511
19512         * cs-parser.jay: pass location to throw statement.
19513
19514         * driver.cs: Small bug fix.
19515
19516         * report.cs: Updated format to be 4-zero filled digits.
19517
19518 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19519
19520         * expression.cs (CheckIndices): Fix minor bug where the wrong
19521         variable was being referred to ;-)
19522
19523         (DoEmit): Do not call EmitStaticInitializers when the 
19524         underlying type is System.Object.
19525
19526 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19527
19528         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19529         and do the usual workaround for SRE.
19530
19531         * class.cs (MyEventBuilder.EventType): New member to get at the type
19532         of the event, quickly.
19533
19534         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19535
19536         * assign.cs (Assign.DoResolve): Handle the case when the target
19537         is an EventExpr and perform the necessary checks.
19538
19539         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19540         interface.
19541
19542         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19543
19544         (EventExpr): Set the type in the constructor itself since we 
19545         are meant to be born fully resolved.
19546
19547         (EventExpr.Define): Revert code I wrote earlier.
19548                 
19549         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19550         instance expression is null. The instance expression is a This in that case
19551         or a null, depending on whether it is a static method or not.
19552
19553         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19554         refers to more than one method.
19555
19556         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19557         and accordingly flag errors.
19558
19559 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19560
19561         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19562
19563 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19564
19565         * location.cs (ToString): Provide useful rutine.
19566
19567 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19568
19569         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19570         objects, return the actual integral boxed.
19571
19572         * statement.cs (SwitchLabel): define an ILLabel for each
19573         SwitchLabel. 
19574
19575         (Switch.CheckSwitch): If the value is a Literal, extract
19576         the underlying literal.
19577
19578         Also in the unused hashtable we had, add the SwitchLabel so we can
19579         quickly look this value up.
19580
19581         * constant.cs: Implement a bunch of new constants.  Rewrite
19582         Literal based on this.  Made changes everywhere to adapt to this.
19583
19584         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19585         dereferencing array only once, and also copes with enumrations.
19586
19587         bytes are two bytes wide, not one.
19588
19589         (Cast): Perform constant conversions.
19590
19591         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19592         wrappers to the literals here.
19593
19594         * expression.cs (DoNumericPromotions): long literals can converted
19595         to ulong implicity (this is taken care of elsewhere, but I was
19596         missing this spot).
19597
19598         * ecore.cs (Expression.Literalize): Make the return type Literal,
19599         to improve type checking.
19600
19601         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19602
19603 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19604
19605         * literal.cs: Revert code from ravi that checked the bounds.  The
19606         bounds are sane by the definition of the type itself. 
19607
19608         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19609         need to actually look up in our parent hierarchy for interfaces
19610         implemented. 
19611
19612         * const.cs: Use the underlying type for enumerations
19613
19614         * delegate.cs: Compute the basename for the delegate creation,
19615         that should fix the delegate test case, and restore the correct
19616         Type Lookup semantics in rootcontext
19617
19618         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19619         referencing a nested type with the Reflection API is using the "+"
19620         sign. 
19621
19622         * cs-parser.jay: Do not require EOF token at the end.
19623
19624 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19625
19626         * rootcontext.cs (LookupType): Concatenate type names with
19627         a '.' instead of a '+' The test suite passes again.
19628
19629         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19630         field of the enumeration.
19631
19632         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19633         the case when the member is an EventExpr.
19634
19635         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19636         static has an associated instance expression.
19637
19638         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19639
19640         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19641
19642         * class.cs (Event.Define): Register event and perform appropriate checks
19643         for error #111.
19644
19645         We define the Add and Remove methods even if the use provides none because
19646         in that case, we provide default implementations ourselves.
19647
19648         Define a private field of the type of the event. This is done by the CSC compiler
19649         and we should be doing it too ;-)
19650
19651         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19652         More methods we use in code we generate.
19653
19654         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19655         is important.
19656
19657         (InitCoreTypes): Update accordingly for the above.
19658
19659         * class.cs (Event.Emit): Generate code for default accessors that we provide
19660
19661         (EmitDefaultMethod): Do the job in the above.
19662
19663         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19664         appropriate place.
19665
19666 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19667
19668         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19669         builders even if we were missing one.
19670
19671         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19672         pass the Basename as our class name instead of the Name.  The
19673         basename will be correctly composed for us.
19674
19675         * parameter.cs (Paramters): Now takes a Location argument.
19676
19677         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19678         make all the code call directly LookupType in RootContext and take
19679         this chance to pass the Location information everywhere.
19680
19681         * Everywhere: pass Location information.
19682
19683 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19684
19685         * class.cs (Constructor.Define): Updated way of detecting the
19686         length of the parameters.
19687
19688         (TypeContainer.DefineType): Use basename as the type name for
19689         nested types.
19690
19691         (TypeContainer.Define): Do not recursively define types here, as
19692         definition is taken care in order by the RootContext.
19693
19694         * tree.cs: Keep track of namespaces in a per-file basis.
19695
19696         * parameter.cs (Parameter.ComputeSignature): Update to use
19697         DeclSpace. 
19698
19699         (Parameters.GetSignature): ditto.
19700
19701         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19702         instead of a TypeContainer.
19703
19704         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19705         resolve names.  Because we need to be resolve in our context, not
19706         our parents.
19707
19708         * driver.cs: Implement response files.
19709
19710         * class.cs (TypeContainer.DefineType): If we are defined, do not
19711         redefine ourselves.
19712
19713         (Event.Emit): Emit the code for add/remove handlers.
19714         (Event.Define): Save the MethodBuilders for add/remove.
19715
19716         * typemanager.cs: Use pair here too.
19717
19718         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19719         DictionaryEntry requires the first argument to be non-null.  
19720
19721         (enum_declaration): Compute full name for registering the
19722         enumeration.
19723
19724         (delegate_declaration): Instead of using
19725         formal_parameter_list, use opt_formal_parameter_list as the list
19726         can be empty.
19727
19728         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19729         (EventParsing): New property that controls whether `add' and
19730         `remove' are returned as tokens or identifiers (for events);
19731
19732 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19733
19734         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19735         use MyEventBuilder only and let it wrap the real builder for us.
19736
19737         (MyEventBuilder): Revamp constructor etc.
19738
19739         Implement all operations that we perform on EventBuilder in precisely the same
19740         way here too.
19741
19742         (FindMembers): Update to use the EventBuilder member.
19743
19744         (Event.Emit): Update accordingly.
19745
19746 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19747
19748         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19749         by calling the appropriate methods.
19750
19751         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19752         useful.
19753
19754         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19755
19756 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19757
19758         * delegate.cs (Delegate.Populate): Check that the return type
19759         and various parameters types are indeed accessible.
19760
19761         * class.cs (Constructor.Define): Same here.
19762
19763         (Field.Define): Ditto.
19764
19765         (Event.Define): Ditto.
19766
19767         (Operator.Define): Check that the underlying Method defined itself
19768         correctly - so it's MethodBuilder should not be null.
19769
19770         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19771         expression happens to be null.
19772
19773         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19774         members but as of now we don't seem to be able to do anything really useful with it.
19775
19776         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19777         not the EventBuilder.
19778
19779 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19780
19781         * cs-tokenizer.cs: Add support for defines.
19782         Add support for #if, #elif, #else, #endif
19783
19784         (eval_var): evaluates a variable.
19785         (eval): stubbed for evaluating functions.
19786
19787         * cs-parser.jay: Pass the defines information
19788
19789         * driver.cs: Add --define command line option.
19790
19791         * decl.cs: Move MemberCore here.
19792
19793         Make it the base class for DeclSpace.  This allows us to catch and
19794         report 108 and 109 for everything now.
19795
19796         * class.cs (TypeContainer.Define): Extract all the members
19797         before populating and emit the warning 108 (new keyword required
19798         to override) instead of having each member implement this.
19799
19800         (MemberCore.Define): New abstract method, we will be using this in
19801         the warning reporting engine in Populate.
19802
19803         (Operator.Define): Adjust to new MemberCore protocol. 
19804
19805         * const.cs (Const): This does not derive from Expression, it is a
19806         temporary object we use to create fields, it is a MemberCore. 
19807
19808         * class.cs (Method.Define): Allow the entry point to be in a
19809         specific class.
19810
19811         * driver.cs: Rewrite the argument handler to clean it up a bit.
19812
19813         * rootcontext.cs: Made it just an auxiliary namespace feature by
19814         making everything static.
19815
19816         * driver.cs: Adapt code to use RootContext type name instead of
19817         instance variable.
19818
19819         * delegate.cs: Remove RootContext argument.
19820
19821         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19822         argument. 
19823
19824         * class.cs (Event.Define): The lookup can fail.
19825
19826         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19827
19828         * expression.cs: Resolve the this instance before invoking the code.
19829
19830 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19831
19832         * cs-parser.jay: Add a production in element_access that allows
19833         the thing to become a "type" reference.  This way we can parse
19834         things like "(string [])" as a type.
19835
19836         Note that this still does not handle the more complex rules of
19837         casts. 
19838
19839
19840         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19841
19842         * ecore.cs: (CopyNewMethods): new utility function used to
19843         assemble the list of methods from running FindMembers.
19844
19845         (MemberLookup): Rework FindMembers so that 
19846
19847 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19848
19849         * class.cs (TypeContainer): Remove Delegates who fail to be
19850         defined.
19851
19852         * delegate.cs (Populate): Verify that we dont get null return
19853         values.   TODO: Check for AsAccessible.
19854
19855         * cs-parser.jay: Use basename to emit error 574 (destructor should
19856         have the same name as container class), not the full name.
19857
19858         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19859         possible representation.  
19860
19861         Also implements integer type suffixes U and L.
19862
19863 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19864
19865         * expression.cs (ArrayCreation.DoResolve): We need to do the
19866         argument resolution *always*.
19867
19868         * decl.cs: Make this hold the namespace.  Hold the root context as
19869         well.
19870         (LookupType): Move here.
19871
19872         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19873
19874         * location.cs (Row, Name): Fixed the code, it was always returning
19875         references to the first file.
19876
19877         * interface.cs: Register properties defined through interfaces.
19878
19879         * driver.cs: Add support for globbing on the command line
19880
19881         * class.cs (Field): Make it derive from MemberCore as well.
19882         (Event): ditto.
19883
19884 2001-12-15  Ravi Pratap  <ravi@ximian.com>
19885
19886         * class.cs (Event::Define): Check that the type of the event is a delegate
19887         type else flag error #66.
19888
19889         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19890         same.
19891
19892         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19893         values of EntryPoint, CharSet etc etc.
19894
19895         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19896
19897         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19898         be null and we should ignore this. I am not sure if this is really clean. Apparently,
19899         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19900         which needs this to do its work.
19901
19902         * ../errors/cs0066.cs : Add.
19903
19904 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
19905
19906         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19907         helper functions.
19908
19909         * class.cs: (MethodSignature.MethodSignature): Removed hack that
19910         clears out the parameters field.
19911         (MemberSignatureCompare): Cleanup
19912
19913         (MemberCore): New base class used to share code between MethodCore
19914         and Property.
19915
19916         (RegisterRequiredImplementations) BindingFlags.Public requires
19917         either BindingFlags.Instace or Static.  Use instance here.
19918
19919         (Property): Refactored code to cope better with the full spec.
19920
19921         * parameter.cs (GetParameterInfo): Return an empty array instead
19922         of null on error.
19923
19924         * class.cs (Property): Abstract or extern properties have no bodies.
19925
19926         * parameter.cs (GetParameterInfo): return a zero-sized array.
19927
19928         * class.cs (TypeContainer.MethodModifiersValid): Move all the
19929         method modifier validation to the typecontainer so we can reuse
19930         this on properties.
19931
19932         (MethodCore.ParameterTypes): return an empty sized array of types.
19933
19934         (Property.Define): Test property modifier validity.
19935
19936         Add tests for sealed/override too.
19937
19938         (Method.Emit): abstract or extern methods have no bodies.
19939
19940 2001-12-14  Ravi Pratap  <ravi@ximian.com>
19941
19942         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19943         thing.
19944
19945         (Method::Define, ::Emit): Modify accordingly.
19946
19947         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19948
19949         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19950
19951         * makefile: Pass in /unsafe.
19952
19953 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
19954
19955         * class.cs (MakeKey): Kill routine.
19956
19957         * class.cs (TypeContainer.Define): Correctly define explicit
19958         method implementations (they require the full interface name plus
19959         the method name).
19960
19961         * typemanager.cs: Deply the PtrHashtable here and stop using the
19962         lame keys.  Things work so much better.
19963
19964         This of course broke everyone who depended on `RegisterMethod' to
19965         do the `test for existance' test.  This has to be done elsewhere.
19966
19967         * support.cs (PtrHashtable): A hashtable that avoid comparing with
19968         the object stupid Equals method (because, that like fails all over
19969         the place).  We still do not use it.
19970
19971         * class.cs (TypeContainer.SetRequiredInterface,
19972         TypeContainer.RequireMethods): Killed these two routines and moved
19973         all the functionality to RegisterRequiredImplementations.
19974
19975         (TypeContainer.RegisterRequiredImplementations): This routine now
19976         registers all the implementations required in an array for the
19977         interfaces and abstract methods.  We use an array of structures
19978         which can be computed ahead of time to reduce memory usage and we
19979         also assume that lookups are cheap as most classes will not
19980         implement too many interfaces.
19981
19982         We also avoid creating too many MethodSignatures.
19983
19984         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19985         clear the "pending" bit if we find that there are problems with
19986         the declaration.
19987
19988         (TypeContainer.VerifyPendingMethods): Update to report errors of
19989         methods that look like implementations but are not.
19990
19991         (TypeContainer.Define): Add support for explicit interface method
19992         implementation. 
19993
19994 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19995
19996         * typemanager.cs: Keep track of the parameters here instead of
19997         being a feature of the TypeContainer.
19998
19999         * class.cs: Drop the registration of parameters here, as
20000         InterfaceMethods are also interface declarations.
20001
20002         * delegate.cs: Register methods with the TypeManager not only with
20003         the TypeContainer.  This code was buggy.
20004
20005         * interface.cs: Full registation here.
20006
20007 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20008
20009         * expression.cs: Remove reducer for binary expressions, it can not
20010         be done this way.
20011
20012         * const.cs: Put here the code that used to go into constant.cs
20013
20014         * constant.cs: Put here the code for constants, this is a new base
20015         class for Literals.
20016
20017         * literal.cs: Make Literal derive from Constant.
20018
20019 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20020
20021         * statement.cs (Return.Emit): Report error 157 if the user
20022         attempts to return from a finally block.
20023
20024         (Return.Emit): Instead of emitting a return, jump to the end of
20025         the function.
20026
20027         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20028         LocalBuilder to store the result of the function.  ReturnLabel is
20029         the target where we jump.
20030
20031
20032 2001-12-09  Radek Doulik  <rodo@ximian.com>
20033
20034         * cs-parser.jay: remember alias in current namespace
20035
20036         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20037         namespaces
20038
20039         * class.cs (LookupAlias): lookup alias in my_namespace
20040
20041         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20042         aliases hashtable
20043         (LookupAlias): lookup alias in this and if needed in parent
20044         namespaces
20045
20046 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20047
20048         * support.cs: 
20049
20050         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20051         making things static.  I need this to avoid passing the
20052         TypeContainer when calling ParameterType.
20053
20054         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20055         that did string manipulation to compute the type and then call
20056         GetType.  Use Parameter.ParameterType instead.
20057
20058         * cs-tokenizer.cs: Consume the suffix for floating values.
20059
20060         * expression.cs (ParameterReference): figure out whether this is a
20061         reference parameter or not.  Kill an extra variable by computing
20062         the arg_idx during emission.
20063
20064         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20065         function that returns whether a parameter is an out/ref value or not.
20066
20067         (Parameter.ParameterType): The type of the parameter (base,
20068         without ref/out applied).
20069
20070         (Parameter.Resolve): Perform resolution here.
20071         (Parameter.ExternalType): The full type (with ref/out applied).
20072
20073         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20074         support for expressions on the using statement.
20075
20076 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20077
20078         * statement.cs (Using.EmitLocalVariableDecls): Split the
20079         localvariable handling of the using statement.
20080
20081         (Block.EmitMeta): Keep track of variable count across blocks.  We
20082         were reusing slots on separate branches of blocks.
20083
20084         (Try.Emit): Emit the general code block, we were not emitting it. 
20085
20086         Check the type of the declaration to be an IDisposable or
20087         something that can be implicity converted to it. 
20088
20089         Emit conversions if required.
20090
20091         * ecore.cs (EmptyExpression): New utility class.
20092         (Expression.ImplicitConversionExists): New utility function.
20093
20094 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20095
20096         * statement.cs (Using): Implement.
20097
20098         * expression.cs (LocalVariableReference): Support read only variables.
20099
20100         * statement.cs: Remove the explicit emit for the Leave opcode.
20101         (VariableInfo): Add a readonly field.
20102
20103 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20104
20105         * ecore.cs (ConvCast): new class used to encapsulate the various
20106         explicit integer conversions that works in both checked and
20107         unchecked contexts.
20108
20109         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20110         properly generate the overflow opcodes.
20111
20112 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20113
20114         * statement.cs: The correct type for the EmptyExpression is the
20115         element_type, not the variable type.  Ravi pointed this out.
20116
20117 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20118
20119         * class.cs (Method::Define): Handle PInvoke methods specially
20120         by using DefinePInvokeMethod instead of the usual one.
20121
20122         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20123         above to do the task of extracting information and defining the method.
20124
20125 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20126
20127         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20128         of the condition for string type.
20129
20130         (Emit): Move that here. 
20131
20132         (ArrayCreation::CheckIndices): Keep string literals in their expression
20133         form.
20134
20135         (EmitDynamicInitializers): Handle strings appropriately.
20136
20137 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20138
20139         * codegen.cs (EmitContext): Replace multiple variables with a
20140         single pointer to the current Switch statement.
20141
20142         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20143         EmitContext.
20144
20145 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20146
20147         * statement.cs 
20148
20149         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20150         default'.
20151
20152         (Foreach.Emit): Foreach on arrays was not setting
20153         up the loop variables (for break/continue).
20154
20155         (GotoCase): Semi-implented.
20156
20157 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20158
20159         * attribute.cs (CheckAttribute): Handle system attributes by using
20160         Attribute.GetAttributes to examine information we need.
20161
20162         (GetValidPlaces): Same here.
20163
20164         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20165
20166         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20167
20168         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20169
20170         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20171
20172         (Method::Emit): Handle the case when we are a PInvoke method.
20173
20174 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20175
20176         * expression.cs: Use ResolveWithSimpleName on compound names.
20177
20178 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20179
20180         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20181         before trying to reduce it.
20182
20183         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20184
20185         * constant.cs (LookupConstantValue): Implement.
20186
20187         (EmitConstant): Use the above in emitting the constant.
20188
20189         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20190         that are user-defined by doing a LookupConstantValue on them.
20191
20192         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20193         too, like above.
20194
20195 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20196
20197         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20198
20199         (BaseAccess.DoResolve): Implement.
20200
20201         (MemberAccess.DoResolve): Split this routine into a
20202         ResolveMemberAccess routine that can be used independently
20203
20204 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20205
20206         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20207         As that share bits of the implementation.  Is returns a boolean,
20208         while As returns the Type that is being probed.
20209
20210 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20211
20212         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20213         instead of a Literal - much easier.
20214
20215         (EnumInTransit): Remove - utterly useless :-)
20216
20217         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20218
20219         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20220
20221         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20222         chain when we have no associated expression.
20223
20224 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20225
20226         * constant.cs (Define): Use Location while reporting the errror.
20227
20228         Also emit a warning when 'new' is used and there is no inherited
20229         member to hide.
20230
20231         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20232         populated.
20233
20234         (LookupEnumValue): Implement to lookup an enum member's value and define it
20235         if necessary.
20236
20237         (Populate): Re-write accordingly to use the above routine.
20238
20239 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20240
20241         * expression.cs (This): Fix prototype for DoResolveLValue to
20242         override the base class DoResolveLValue.
20243
20244         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20245         declarations) 
20246
20247         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20248         (we need to load the address of the field here).  This fixes
20249         test-22. 
20250
20251         (FieldExpr.DoResolveLValue): Call the DoResolve
20252         function to initialize the Instance expression.
20253
20254         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20255         correctly the GetEnumerator operation on a value type.
20256
20257         * cs-parser.jay: Add more simple parsing error catches.
20258
20259         * statement.cs (Switch): Add support for string switches.
20260         Handle null specially.
20261
20262         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20263
20264 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20265
20266         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20267
20268         (declare_local_constant): New helper function.
20269
20270         * statement.cs (AddConstant): Keep a separate record of constants
20271
20272         (IsConstant): Implement to determine if a variable is a constant.
20273
20274         (GetConstantExpression): Implement.
20275
20276         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20277
20278         * statement.cs (IsVariableDefined): Re-write.
20279
20280 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20281
20282         * class.cs (TypeContainer::FindMembers): Look for constants
20283         in the case when we are looking for MemberTypes.Field
20284
20285         * expression.cs (MemberAccess::DoResolve): Check that in the
20286         case we are a FieldExpr and a Literal, we are not being accessed
20287         by an instance reference.
20288
20289         * cs-parser.jay (local_constant_declaration): Implement.
20290
20291         (declaration_statement): Implement for constant declarations.
20292
20293 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20294
20295         * statement.cs (Switch): Catch double defaults.
20296
20297         (Switch): More work on the switch() statement
20298         implementation.  It works for integral values now, need to finish
20299         string support.
20300
20301
20302 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20303
20304         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20305         integer literals into other integer literals.  To be used by
20306         switch. 
20307
20308 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20309
20310         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20311         some memory.
20312
20313         (EmitDynamicInitializers): Cope with the above since we extract data
20314         directly from ArrayData now.
20315
20316         (ExpectInitializers): Keep track of whether initializers are mandatory
20317         or not.
20318
20319         (Bounds): Make it a hashtable to prevent the same dimension being 
20320         recorded for every element in that dimension.
20321
20322         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20323         from being found.
20324
20325         Also fix bug which was causing the indices to be emitted in the reverse
20326         order.
20327
20328 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20329
20330         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20331         unfinished.  They do not work, because the underlying code is
20332         sloppy.
20333
20334 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20335
20336         * cs-parser.jay: Remove bogus fixme.
20337
20338         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20339         on Switch statement.
20340
20341 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20342
20343         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20344         the same. 
20345
20346         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20347         parameter. Apparently, any expression is allowed. 
20348
20349         (ValidateInitializers): Update accordingly.
20350
20351         (CheckIndices): Fix some tricky bugs thanks to recursion.
20352
20353         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20354         I was being completely brain-dead.
20355
20356         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20357         and re-write acordingly.
20358
20359         (DelegateInvocation): Re-write accordingly.
20360
20361         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20362
20363         (MakeByteBlob): Handle types more correctly.
20364
20365         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20366         initialization from expressions but it is incomplete because I am a complete
20367         Dodo :-|
20368
20369 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20370
20371         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20372         on If.  Basically, we have to return `true' (ie, we do return to
20373         our caller) only if both branches of the if return.
20374
20375         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20376         short-circuit operators, handle them as short circuit operators. 
20377
20378         (Cast.DoResolve): Resolve type.
20379         (Cast.Cast): Take an expression as the target type.
20380
20381         * cs-parser.jay (cast_expression): Remove old hack that only
20382         allowed a limited set of types to be handled.  Now we take a
20383         unary_expression and we resolve to a type during semantic
20384         analysis.
20385
20386         Use the grammar productions from Rhys to handle casts (this is
20387         not complete like Rhys syntax yet, we fail to handle that corner
20388         case that C# has regarding (-x), but we will get there.
20389
20390 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20391
20392         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20393         field which is an array type.
20394
20395         * cs-parser.jay (declare_local_variables): Support array initialization too.
20396
20397         * typemanager.cs (MakeKey): Implement.
20398
20399         (everywhere): Use the above appropriately.
20400
20401         * cs-parser.jay (for_statement): Update for array initialization while
20402         declaring variables.
20403
20404         * ecore.cs : The error message was correct, it's the variable's names that
20405         were misleading ;-) Make the code more readable.
20406
20407         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20408         the correct type etc.
20409
20410         (ConvertExplicit): Handle Enum types by examining the underlying type.
20411
20412 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20413
20414         * parameter.cs (GetCallingConvention): Always return
20415         CallingConventions.Standard for now.
20416
20417 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20418
20419         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20420         and `r' after calling DoNumericPromotions.
20421
20422         * ecore.cs: Fix error message (the types were in the wrong order).
20423
20424         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20425         BindingFlags.Instance as well 
20426
20427         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20428         implicit int literal conversion in an empty cast so that we
20429         propagate the right type upstream.
20430
20431         (UnboxCast): new class used to unbox value types.
20432         (Expression.ConvertExplicit): Add explicit type conversions done
20433         by unboxing.
20434
20435         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20436         the target type before applying the implicit LongLiterals to ULong
20437         literal cast.
20438
20439 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20440
20441         * cs-parser.jay (for_statement): Reworked the way For works: now
20442         we declare manually any variables that are introduced in
20443         for_initializer to solve the problem of having out-of-band code
20444         emition (that is what got for broken).
20445
20446         (declaration_statement): Perform the actual variable declaration
20447         that used to be done in local_variable_declaration here.
20448
20449         (local_variable_declaration): Do not declare anything, just pass
20450         the information on a DictionaryEntry
20451
20452 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20453
20454         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20455         re-write of the logic to now make it recursive.
20456
20457         (UpdateIndices): Re-write accordingly.
20458
20459         Store element data in a separate ArrayData list in the above methods.
20460
20461         (MakeByteBlob): Implement to dump the array data into a byte array.
20462
20463 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20464
20465         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20466         into CheckIndices.
20467
20468         * constant.cs (Define): Implement.
20469
20470         (EmitConstant): Re-write fully.
20471
20472         Pass in location info.
20473
20474         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20475         respectively.
20476
20477         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20478         DictionaryEntry since we need location info too.
20479
20480         (constant_declaration): Update accordingly.
20481
20482         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20483         code into another method : UpdateIndices.
20484
20485 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20486
20487         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20488         some type checking etc.
20489
20490 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20491
20492         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20493         bits to provide dimension info if the user skips doing that.
20494
20495         Update second constructor to store the rank correctly.
20496
20497 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20498
20499         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20500         and try to implement.
20501
20502         * ../errors/cs0150.cs : Add.
20503
20504         * ../errors/cs0178.cs : Add.
20505
20506 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20507
20508         * statement.cs: Implement foreach on multi-dimensional arrays. 
20509
20510         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20511         name of the params argument.
20512
20513         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20514         initializing the array.
20515
20516         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20517         we can use this elsewhere.
20518
20519         * statement.cs: Finish implementation of foreach for single
20520         dimension arrays.
20521
20522         * cs-parser.jay: Use an out-of-band stack to pass information
20523         around, I wonder why I need this.
20524
20525         foreach_block: Make the new foreach_block the current_block.
20526
20527         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20528         function used to return a static Parameters structure.  Used for
20529         empty parameters, as those are created very frequently.
20530
20531         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20532
20533 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20534
20535         * interface.cs : Default modifier is private, not public. The
20536         make verify test passes again.
20537
20538 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20539
20540         * support.cs (ReflectionParameters): Fix logic to determine
20541         whether the last parameter is a params one. Test 9 passes again.
20542
20543         * delegate.cs (Populate): Register the builders we define with
20544         RegisterParameterForBuilder. Test 19 passes again.
20545
20546         * cs-parser.jay (property_declaration): Reference $6 instead
20547         of $$ to get at the location.
20548
20549         (indexer_declaration): Similar stuff.
20550
20551         (attribute): Ditto.
20552
20553         * class.cs (Property): Register parameters for the Get and Set methods
20554         if they exist. Test 23 passes again.
20555
20556         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20557         call to EmitArguments as we are sure there aren't any params arguments. 
20558         Test 32 passes again.
20559
20560         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20561         IndexOutOfRangeException. 
20562
20563         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20564         Test 33 now passes again.
20565
20566 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20567
20568         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20569         broke a bunch of things.  Will have to come up with a better way
20570         of tracking locations.
20571
20572         * statement.cs: Implemented foreach for single dimension arrays.
20573
20574 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20575
20576         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20577         an error.  This removes the lookup from the critical path.
20578
20579         * cs-parser.jay: Removed use of temporary_loc, which is completely
20580         broken. 
20581
20582 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20583
20584         * support.cs (ReflectionParameters.ParameterModifier): Report
20585         whether the argument is a PARAMS argument or not.
20586
20587         * class.cs: Set the attribute `ParamArrayAttribute' on the
20588         parameter argument.
20589
20590         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20591         and cons_param_array_attribute (ConstructorInfo for
20592         ParamArrayAttribute)., 
20593
20594         * codegen.cs: Emit the return using the `Return' statement, that
20595         way we can report the error correctly for missing return values. 
20596
20597         * class.cs (Method.Emit): Clean up.
20598
20599         * expression.cs (Argument.Resolve): Take another argument: the
20600         location where this argument is used.  Notice that this is not
20601         part of the "Argument" class as to reduce the size of the
20602         structure (we know the approximate location anyways).
20603
20604         Test if the argument is a variable-reference, if not, then
20605         complain with a 206.
20606
20607         (Argument.Emit): Emit addresses of variables.
20608
20609         (Argument.FullDesc): Simplify.
20610
20611         (Invocation.DoResolve): Update for Argument.Resolve.
20612
20613         (ElementAccess.DoResolve): ditto.
20614
20615         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20616         method should be virtual, as this method is always virtual.
20617
20618         (NewDelegate.DoResolve): Update for Argument.Resolve.
20619
20620         * class.cs (ConstructorInitializer.DoResolve): ditto.
20621
20622         * attribute.cs (Attribute.Resolve): ditto.
20623
20624 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20625
20626         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20627
20628         * expression.cs (ParameterReference): Drop IStackStorage and implement
20629         IAssignMethod instead. 
20630
20631         (LocalVariableReference): ditto.
20632
20633         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20634         IAssignMethod instead. 
20635
20636 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20637
20638         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20639         enumerations that are used in heavily used structures derive from
20640         byte in a laughable and pathetic attempt to reduce memory usage.
20641         This is the kind of pre-optimzations that you should not do at
20642         home without adult supervision.
20643
20644         * expression.cs (UnaryMutator): New class, used to handle ++ and
20645         -- separatedly from the other unary operators.  Cleans up the
20646         code, and kills the ExpressionStatement dependency in Unary.
20647
20648         (Unary): Removed `method' and `Arguments' from this class, making
20649         it smaller, and moving it all to SimpleCall, so I can reuse this
20650         code in other locations and avoid creating a lot of transient data
20651         strucutres when not required.
20652
20653         * cs-parser.jay: Adjust for new changes.
20654
20655 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20656
20657         * enum.cs (Enum.Populate): If there is a failure during
20658         definition, return
20659
20660         * cs-parser.jay (opt_enum_base): we used to catch type errors
20661         here, but this is really incorrect.  The type error should be
20662         catched during semantic analysis.
20663
20664 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20665
20666         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20667         current_local_parameters as expected since I, in my stupidity, had forgotten
20668         to do this :-)
20669
20670         * attribute.cs (GetValidPlaces): Fix stupid bug.
20671
20672         * class.cs (Method::Emit): Perform check on applicability of attributes.
20673
20674         (Constructor::Emit): Ditto.
20675
20676         (Field::Emit): Ditto.
20677
20678         (Field.Location): Store location information.
20679
20680         (Property, Event, Indexer, Operator): Ditto.
20681
20682         * cs-parser.jay (field_declaration): Pass in location for each field.
20683
20684         * ../errors/cs0592.cs : Add.
20685
20686 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20687
20688         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20689
20690         (InitCoreTypes): Update accordingly.
20691
20692         (RegisterAttrType, LookupAttr): Implement.
20693
20694         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20695         info about the same.
20696
20697         (Resolve): Update to populate the above as necessary.
20698
20699         (Error592): Helper.
20700
20701         (GetValidPlaces): Helper to the above.
20702
20703         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20704
20705         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20706
20707 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20708
20709         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20710
20711         * ../errors/cs0617.cs : Add.
20712
20713 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20714
20715         * enum.cs (Emit): Rename to Populate to be more consistent with what
20716         we expect it to do and when exactly it is called.
20717
20718         * class.cs, rootcontext.cs : Update accordingly.
20719
20720         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20721         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20722
20723         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20724
20725         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20726         of a fieldinfo using the above, when dealing with a FieldBuilder.
20727
20728 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20729
20730         * ../errors/cs0031.cs : Add.
20731
20732         * ../errors/cs1008.cs : Add.
20733
20734         * ../errrors/cs0543.cs : Add.
20735
20736         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20737         enum type.
20738
20739         (FindMembers): Implement.
20740
20741         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20742         enums and delegates too.
20743
20744         (enum_types): Rename to builder_to_enum.
20745
20746         (delegate_types): Rename to builder_to_delegate.
20747
20748         * delegate.cs (FindMembers): Implement.
20749
20750 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20751
20752         * typemanager.cs (IsEnumType): Implement.
20753
20754         * enum.cs (Emit): Re-write parts to account for the underlying type
20755         better and perform checking etc.
20756
20757         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20758         of the underlying type.
20759
20760         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20761         value
20762
20763         * enum.cs (error31): Helper to report error #31.
20764
20765         * cs-parser.jay (enum_declaration): Store location of each member too.
20766
20767         * enum.cs (member_to_location): New hashtable. 
20768
20769         (AddEnumMember): Update location hashtable.
20770
20771         (Emit): Use the location of each member while reporting errors.
20772
20773 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20774
20775         * cs-parser.jay: A for_initializer if is a
20776         local_variable_declaration really ammount to have an implicit
20777         block with the variable declaration and no initializer for for.
20778
20779         * statement.cs (For.Emit): Cope with null initializers.
20780
20781         This fixes the infinite loop on for initializers.
20782
20783 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20784
20785         * enum.cs: More cleanup.
20786
20787         * ecore.cs: Remove dead code.
20788
20789         * class.cs (Property.Emit): More simplification.
20790         (Event.Emit): ditto.
20791
20792         Reworked to have less levels of indentation.
20793
20794 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20795
20796         * class.cs (Property): Emit attributes.
20797
20798         (Field): Ditto.
20799
20800         (Event): Ditto.
20801
20802         (Indexer): Ditto.
20803
20804         (Operator): Ditto.
20805
20806         * enum.cs (Emit): Ditto.
20807
20808         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20809         Enums too.
20810
20811         * class.cs (Field, Event, etc.): Move attribute generation into the
20812         Emit method everywhere.
20813
20814         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20815         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20816         as we had no way of defining nested enums !
20817
20818         * rootcontext.cs : Adjust code accordingly.
20819
20820         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20821
20822 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20823
20824         * expression.cs (EvalConstantExpression): Move into ecore.cs
20825
20826         * enum.cs (Enum): Rename some members and make them public and readonly
20827         according to our convention.
20828
20829         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20830         nothing else.
20831
20832         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20833
20834         (Enum::Emit): Write a simple version for now which doesn't try to compute
20835         expressions. I shall modify this to be more robust in just a while.
20836
20837         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20838
20839         (TypeContainer::CloseType): Create the Enum types too.
20840
20841         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20842
20843         * expression.cs (EvalConstantExpression): Get rid of completely.
20844
20845         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20846         user-defined values and other cases.
20847
20848         (IsValidEnumLiteral): Helper function.
20849
20850         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20851         out there in the case we had a literal FieldExpr.
20852
20853         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20854
20855         (Literalize): Revamp a bit to take two arguments.
20856
20857         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20858
20859 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20860
20861         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20862
20863         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20864
20865         (Resolve): Use the above to ensure we have proper initializers.
20866
20867 2001-11-05  Ravi Pratap  <ravi@ximian.com>
20868
20869         * expression.cs (Expression::EvalConstantExpression): New method to 
20870         evaluate constant expressions.
20871
20872         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20873
20874 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
20875
20876         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20877         in an array.
20878
20879         (Binary.ResolveOperator): Handle operator != (object a, object b)
20880         and operator == (object a, object b);
20881
20882         (Binary.DoNumericPromotions): Indicate whether the numeric
20883         promotion was possible.
20884
20885         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20886         Implement.  
20887
20888         Made the ArrayAccess implement interface IAssignMethod instead of
20889         IStackStore as the order in which arguments are passed reflects
20890         this.
20891
20892         * assign.cs: Instead of using expr.ExprClass to select the way of
20893         assinging, probe for the IStackStore/IAssignMethod interfaces.
20894
20895         * typemanager.cs: Load InitializeArray definition.
20896
20897         * rootcontext.cs (RootContext.MakeStaticData): Used to define
20898         static data that can be used to initialize arrays. 
20899
20900 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
20901
20902         * expression.cs: Handle operator== and operator!= for booleans.
20903
20904         (Conditioal.Reduce): Implement reducer for the ?: operator.
20905
20906         (Conditional.Resolve): Implement dead code elimination.
20907
20908         (Binary.Resolve): Catch string literals and return a new
20909         concatenated string.
20910
20911         (Unary.Reduce): Implement reduction of unary expressions.
20912
20913         * ecore.cs: Split out the expression core handling here.
20914
20915         (Expression.Reduce): New method used to perform constant folding
20916         and CSE.  This is needed to support constant-expressions. 
20917
20918         * statement.cs (Statement.EmitBoolExpression): Pass true and false
20919         targets, and optimize for !x.
20920
20921 2001-11-04  Ravi Pratap  <ravi@ximian.com>
20922
20923         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20924         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20925         set custom atttributes.
20926
20927         * literal.cs (Literal::GetValue): New abstract method to return the actual
20928         value of the literal, cast as an object.
20929
20930         (*Literal): Implement GetValue method.
20931
20932         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20933         expressions to the arraylist but objects of type Argument.
20934
20935         * class.cs (TypeContainer::Emit): Emit our attributes too.
20936
20937         (Method::Emit, Constructor::Emit): Ditto.
20938
20939         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20940         to be ignoring earlier.
20941
20942 2001-11-03  Ravi Pratap  <ravi@ximian.com>
20943
20944         * attribute.cs (AttributeSection::Define): Implement to do the business
20945         of constructing a CustomAttributeBuilder.
20946
20947         (Attribute): New trivial class. Increases readability of code.  
20948
20949         * cs-parser.jay : Update accordingly.
20950
20951         (positional_argument_list, named_argument_list, named_argument): New rules
20952
20953         (attribute_arguments): Use the above so that we are more correct.
20954
20955 2001-11-02  Ravi Pratap  <ravi@ximian.com>
20956
20957         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20958         to perform all checks for a method with a params parameter.
20959
20960         (Invocation::OverloadResolve): Update to use the above method and therefore
20961         cope correctly with params method invocations.
20962
20963         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
20964         params too.
20965
20966         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20967         constructors in our parent too because we can't afford to miss out on 
20968         protected ones ;-)
20969
20970         * attribute.cs (AttributeSection): New name for the class Attribute
20971
20972         Other trivial changes to improve readability.
20973
20974         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20975         use the new class names.
20976
20977 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20978
20979         * class.cs (Method::Define): Complete definition for params types too
20980
20981         (Indexer::Define): Ditto.
20982
20983         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20984         Cope everywhere with a request for info about the array parameter.
20985
20986 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20987
20988         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20989
20990         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20991         local_variable_type to extract the string corresponding to the type.
20992
20993         (local_variable_type): Fixup the action to use the new helper method.
20994
20995         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20996         go.
20997
20998         * expression.cs : Clean out code which uses the above.
20999
21000 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21001
21002         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21003         and bale out if necessary by returning a false.
21004
21005         (RegisterProperty): Ditto.
21006
21007         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21008         and print out appropriate error messages.
21009
21010         * interface.cs (everywhere): Ditto.
21011
21012         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21013         location to constructor.
21014
21015         * class.cs (Property, Event, Indexer): Update accordingly.
21016
21017         * ../errors/cs111.cs : Added.
21018
21019         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21020         of a method, as laid down by the spec.
21021
21022         (Invocation::OverloadResolve): Use the above method.
21023
21024 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21025
21026         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21027         now take a TypeContainer and a Parameters object.
21028
21029         (ParameterData): Modify return type of ParameterModifier method to be 
21030         Parameter.Modifier and not a string.
21031
21032         (ReflectionParameters, InternalParameters): Update accordingly.
21033
21034         * expression.cs (Argument::GetParameterModifier): Same here.
21035
21036         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21037         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21038         symbol in it at all so maybe this is only for now.
21039
21040 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21041
21042         * support.cs (InternalParameters): Constructor now takes an extra argument 
21043         which is the actual Parameters class.
21044
21045         (ParameterDesc): Update to provide info on ref/out modifiers.
21046
21047         * class.cs (everywhere): Update call to InternalParameters to pass in
21048         the second argument too.
21049
21050         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21051         to return the modifier info [ref/out etc]
21052
21053         (InternalParameters, ReflectionParameters): Implement the above.
21054
21055         * expression.cs (Argument::ParameterModifier): Similar function to return
21056         info about the argument's modifiers.
21057
21058         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21059         too.
21060
21061         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21062         a new SetFormalParameters object which we pass to InternalParameters.
21063
21064 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21065
21066         * expression.cs (NewArray): Merge into the ArrayCreation class.
21067
21068 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21069
21070         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21071         NewUserdefinedArray into one as there wasn't much of a use in having
21072         two separate ones.
21073
21074         * expression.cs (Argument): Change field's name to ArgType from Type.
21075
21076         (Type): New readonly property which returns the proper type, taking into 
21077         account ref/out modifiers.
21078
21079         (everywhere): Adjust code accordingly for the above.
21080
21081         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21082         whether we are emitting for a ref or out parameter.
21083
21084         * expression.cs (Argument::Emit): Use the above field to set the state.
21085
21086         (LocalVariableReference::Emit): Update to honour the flag and emit the
21087         right stuff.
21088
21089         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21090
21091         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21092
21093         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21094
21095         (ReflectionParameters, InternalParameters): Implement the above method.
21096
21097         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21098         reporting errors.
21099
21100         (Invocation::FullMethodDesc): Ditto. 
21101
21102 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21103
21104         * cs-parser.jay: Add extra production for the second form of array
21105         creation. 
21106
21107         * expression.cs (ArrayCreation): Update to reflect the above
21108         change. 
21109
21110         * Small changes to prepare for Array initialization.
21111
21112 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21113
21114         * typemanager.cs (ImplementsInterface): interface might be null;
21115         Deal with this problem;
21116
21117         Also, we do store negative hits on the cache (null values), so use
21118         this instead of calling t.GetInterfaces on the type everytime.
21119
21120 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21121
21122         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21123
21124         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21125         split functionality out into different classes.
21126
21127         (New::FormArrayType): Move into NewBuiltinArray.
21128
21129         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21130         quite useless.
21131
21132         (NewBuiltinArray): New class to handle creation of built-in arrays.
21133
21134         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21135         account creation of one-dimensional arrays.
21136
21137         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21138
21139         (NewUserdefinedArray::DoResolve): Implement.
21140
21141         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21142
21143         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21144         we maintain inside the TypeManager. This is necessary to perform lookups on the
21145         module builder.
21146
21147         (LookupType): Update to perform GetType on the module builders too.     
21148
21149         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21150
21151         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21152
21153 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21154
21155         * expression.cs (New::DoResolve): Implement guts of array creation.
21156
21157         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21158
21159 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21160
21161         * expression.cs: Fix bug I introduced lsat night that broke
21162         Delegates. 
21163
21164         (Expression.Resolve): Report a 246 error (can not resolve name)
21165         if we find a SimpleName in the stream.
21166
21167         (Expression.ResolveLValue): Ditto.
21168
21169         (Expression.ResolveWithSimpleName): This function is a variant of
21170         ResolveName, this one allows SimpleNames to be returned without a
21171         warning.  The only consumer of SimpleNames is MemberAccess
21172
21173 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21174
21175         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21176         might arrive here.  I have my doubts that this is correct.
21177
21178         * statement.cs (Lock): Implement lock statement.
21179
21180         * cs-parser.jay: Small fixes to support `lock' and `using'
21181
21182         * cs-tokenizer.cs: Remove extra space
21183
21184         * driver.cs: New flag --checked, allows to turn on integer math
21185         checking. 
21186
21187         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21188         Threading.Monitor.Exit 
21189
21190 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21191
21192         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21193         Expression Class to be IndexerAccess.
21194
21195         Notice that Indexer::DoResolve sets the eclass to Value.
21196
21197 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21198
21199         * class.cs (TypeContainer::Emit): Emit code for indexers.
21200
21201         * assign.cs (IAssignMethod): New interface implemented by Indexers
21202         and Properties for handling assignment.
21203
21204         (Assign::Emit): Simplify and reuse code. 
21205
21206         * expression.cs (IndexerAccess, PropertyExpr): Implement
21207         IAssignMethod, clean up old code. 
21208
21209 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21210
21211         * typemanager.cs (ImplementsInterface): New method to determine if a type
21212         implements a given interface. Provides a nice cache too.
21213
21214         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21215         method.
21216
21217         (ConvertReferenceExplicit): Ditto.
21218
21219         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21220         various methods, with correct names etc.
21221
21222         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21223         Operator.UnaryNegation.
21224
21225         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21226         we have a unary plus or minus operator.
21227
21228         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21229         UnaryMinus.
21230
21231         * everywhere : update accordingly.
21232
21233         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21234         respectively.
21235
21236         * class.cs (Method::Define): For the case where we are implementing a method
21237         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21238         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21239
21240 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21241
21242         * interface.cs (FindMembers): Implement to work around S.R.E
21243         lameness.
21244
21245         * typemanager.cs (IsInterfaceType): Implement.
21246
21247         (FindMembers): Update to handle interface types too.
21248
21249         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21250         use IsAssignableFrom as that is not correct - it doesn't work.
21251
21252         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21253         and accordingly override EmitStatement.
21254
21255         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21256         using the correct logic :-)
21257
21258 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21259
21260         * ../errors/cs-11.cs : Add to demonstrate error -11 
21261
21262 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21263
21264         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21265         then pass this as a hint to ResolveLValue.
21266
21267         * expression.cs (FieldExpr): Add Location information
21268
21269         (FieldExpr::LValueResolve): Report assignment to readonly
21270         variable. 
21271
21272         (Expression::ExprClassFromMemberInfo): Pass location information.
21273
21274         (Expression::ResolveLValue): Add new method that resolves an
21275         LValue. 
21276
21277         (Expression::DoResolveLValue): Default invocation calls
21278         DoResolve. 
21279
21280         (Indexers): New class used to keep track of indexers in a given
21281         Type. 
21282
21283         (IStackStore): Renamed from LValue, as it did not really describe
21284         what this did.  Also ResolveLValue is gone from this interface and
21285         now is part of Expression.
21286
21287         (ElementAccess): Depending on the element access type
21288
21289         * typemanager.cs: Add `indexer_name_type' as a Core type
21290         (System.Runtime.CompilerServices.IndexerNameAttribute)
21291
21292         * statement.cs (Goto): Take a location.
21293
21294 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21295
21296         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21297         if two delegates are compatible.
21298
21299         (NewDelegate::DoResolve): Update to take care of the case when
21300         we instantiate a delegate from another delegate.
21301
21302         * typemanager.cs (FindMembers): Don't even try to look up members
21303         of Delegate types for now.
21304
21305 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21306
21307         * delegate.cs (NewDelegate): New class to take care of delegate
21308         instantiation.
21309
21310         * expression.cs (New): Split the delegate related code out into 
21311         the NewDelegate class.
21312
21313         * delegate.cs (DelegateInvocation): New class to handle delegate 
21314         invocation.
21315
21316         * expression.cs (Invocation): Split out delegate related code into
21317         the DelegateInvocation class.
21318
21319 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21320
21321         * expression.cs (New::DoResolve): Implement delegate creation fully
21322         and according to the spec.
21323
21324         (New::DoEmit): Update to handle delegates differently.
21325
21326         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21327         because of which we were printing out arguments in reverse order !
21328
21329         * delegate.cs (VerifyMethod): Implement to check if the given method
21330         matches the delegate.
21331
21332         (FullDelegateDesc): Implement.
21333
21334         (VerifyApplicability): Implement.
21335
21336         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21337         delegate invocations too.
21338
21339         (Invocation::Emit): Ditto.
21340
21341         * ../errors/cs1593.cs : Added.
21342
21343         * ../errors/cs1594.cs : Added.
21344
21345         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21346
21347 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21348
21349         * typemanager.cs (intptr_type): Core type for System.IntPtr
21350
21351         (InitCoreTypes): Update for the same.
21352
21353         (iasyncresult_type, asynccallback_type): Ditto.
21354
21355         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21356         correct.
21357
21358         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21359         too.
21360
21361         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21362         the builders for the 4 members of a delegate type :-)
21363
21364         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21365         type.
21366
21367         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21368
21369         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21370
21371 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21372
21373         * statement.cs (Break::Emit): Implement.   
21374         (Continue::Emit): Implement.
21375
21376         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21377         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21378         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21379         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21380         end loop
21381
21382         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21383         properties that track the label for the current loop (begin of the
21384         loop and end of the loop).
21385
21386 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21387
21388         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21389         use of emitting anything at all.
21390
21391         * class.cs, rootcontext.cs : Get rid of calls to the same.
21392
21393         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21394
21395         (Populate): Define the constructor correctly and set the implementation
21396         attributes.
21397
21398         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21399         have been defined.
21400
21401         (AddDelegateType): Implement.
21402
21403         (IsDelegateType): Implement helper method.
21404
21405         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21406
21407         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21408         and accordingly handle it.
21409
21410         * delegate.cs (Populate): Take TypeContainer argument.
21411         Implement bits to define the Invoke method. However, I still haven't figured out
21412         how to take care of the native int bit :-(
21413
21414         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21415         Qualify the name of the delegate, not its return type !
21416
21417         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21418         conversion.
21419
21420         (StandardConversionExists): Checking for array types turns out to be recursive.
21421
21422         (ConvertReferenceExplicit): Implement array conversion.
21423
21424         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21425
21426 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21427
21428         * cs-parser.jay (delegate_declaration): Store the fully qualified
21429         name as it is a type declaration.
21430
21431         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21432         readonly.
21433
21434         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21435         as TypeContainer::DefineType.
21436
21437         (Populate): Method in which all the definition of the various methods (Invoke)
21438         etc is done.
21439
21440         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21441         see.
21442
21443         (CloseDelegate): Finally creates the delegate.
21444
21445         * class.cs (TypeContainer::DefineType): Update to define delegates.
21446         (Populate, Emit and CloseType): Do the same thing here too.
21447
21448         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21449         delegates in all these operations.
21450
21451 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21452
21453         * expression.cs: LocalTemporary: a new expression used to
21454         reference a temporary that has been created.
21455
21456         * assign.cs: Handle PropertyAccess back here, so that we can
21457         provide the proper semantic access to properties.
21458
21459         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21460         a few more explicit conversions. 
21461
21462         * modifiers.cs: `NEW' modifier maps to HideBySig.
21463
21464         * expression.cs (PropertyExpr): Make this into an
21465         ExpressionStatement, and support the EmitStatement code path. 
21466
21467         Perform get/set error checking, clean up the interface.
21468
21469         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21470         them into toplevel access objects.
21471
21472 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21473
21474         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21475         SRE.
21476
21477         * typemanager.cs: Keep track here of our PropertyBuilders again to
21478         work around lameness in SRE.
21479
21480 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21481
21482         * expression.cs (LValue::LValueResolve): New method in the
21483         interface, used to perform a second resolution pass for LValues. 
21484
21485         (This::DoResolve): Catch the use of this in static methods.
21486
21487         (This::LValueResolve): Implement.
21488
21489         (This::Store): Remove warning, assigning to `this' in structures
21490         is 
21491
21492         (Invocation::Emit): Deal with invocation of
21493         methods on value types.  We need to pass the address to structure
21494         methods rather than the object itself.  (The equivalent code to
21495         emit "this" for structures leaves the entire structure on the
21496         stack instead of a pointer to it). 
21497
21498         (ParameterReference::DoResolve): Compute the real index for the
21499         argument based on whether the method takes or not a `this' pointer
21500         (ie, the method is static).
21501
21502         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21503         value types returned from functions when we need to invoke a
21504         method on the sturcture.
21505
21506
21507 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21508
21509         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21510         defining the type in the Modulebuilder or Typebuilder. This is to take
21511         care of nested types which need to be defined on the TypeBuilder using
21512         DefineNestedMethod.
21513
21514         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21515         methods in RootContext, only ported to be part of TypeContainer.
21516
21517         (TypeContainer::GetInterfaceOrClass): Ditto.
21518
21519         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21520
21521         * interface.cs (Interface::DefineInterface): New method. Does exactly
21522         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21523         too.
21524
21525         (Interface::GetInterfaces): Move from RootContext here and port.
21526
21527         (Interface::GetInterfaceByName): Same here.
21528
21529         * rootcontext.cs (ResolveTree): Re-write.
21530
21531         (PopulateTypes): Re-write.
21532
21533         * class.cs (TypeContainer::Populate): Populate nested types too.
21534         (TypeContainer::Emit): Emit nested members too.
21535
21536         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21537         instead just use the name argument passed in as it is already fully
21538         qualified.
21539
21540         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21541         to TypeContainer mapping to see if a type is user-defined.
21542
21543         * class.cs (TypeContainer::CloseType): Implement. 
21544
21545         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21546         the default constructor.
21547
21548         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21549         twice.
21550
21551         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21552
21553         * interface.cs (CloseType): Create the type here.
21554
21555         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21556         the hierarchy.
21557
21558         Remove all the methods which are now in TypeContainer.
21559
21560 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21561
21562         * delegate.cs (Define): Re-write bits to define the delegate
21563         correctly.
21564
21565 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21566
21567         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21568
21569         * expression.cs (ImplicitReferenceConversion): handle null as well
21570         as a source to convert to any reference type.
21571
21572         * statement.cs (Return): Perform any implicit conversions to
21573         expected return type.  
21574
21575         Validate use of return statement.  
21576
21577         * codegen.cs (EmitContext): Pass the expected return type here.
21578
21579         * class.cs (Method, Constructor, Property): Pass expected return
21580         type to EmitContext.
21581
21582 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21583
21584         * expression.cs: Make DoResolve take an EmitContext instead of a
21585         TypeContainer.
21586
21587         Replaced `l' and `location' for `loc', for consistency.
21588
21589         (Error, Warning): Remove unneeded Tc argument.
21590
21591         * assign.cs, literal.cs, constant.cs: Update to new calling
21592         convention. 
21593
21594         * codegen.cs: EmitContext now contains a flag indicating whether
21595         code is being generated in a static method or not.
21596
21597         * cs-parser.jay: DecomposeQI, new function that replaces the old
21598         QualifiedIdentifier.  Now we always decompose the assembled
21599         strings from qualified_identifier productions into a group of
21600         memberaccesses.
21601
21602 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21603
21604         * rootcontext.cs: Deal with field-less struct types correctly now
21605         by passing the size option to Define Type.
21606
21607         * class.cs: Removed hack that created one static field. 
21608
21609 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21610
21611         * statement.cs: Moved most of the code generation here. 
21612
21613 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21614
21615         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21616         seem very right.
21617
21618         (ElementAccess): Remove useless bits for now - keep checks as the spec
21619         says.
21620
21621 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21622
21623         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21624         and start performing checks according to the spec.
21625
21626 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21627
21628         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21629         rank_specifiers instead.
21630
21631         (rank_specifiers): Change the order in which the rank specifiers are stored
21632
21633         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21634
21635         * expression.cs (ElementAccess): Implement the LValue interface too.
21636
21637 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21638
21639         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21640         except that user defined conversions are not included.
21641
21642         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21643         perform the conversion of the return type, if necessary.
21644
21645         (New::DoResolve): Check whether we are creating an array or an object
21646         and accordingly do the needful.
21647
21648         (New::Emit): Same here.
21649
21650         (New::DoResolve): Implement guts of array creation.
21651
21652         (New::FormLookupType): Helper function.
21653
21654 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21655
21656         * codegen.cs: Removed most of the code generation here, and move the
21657         corresponding code generation bits to the statement classes. 
21658
21659         Added support for try/catch/finalize and throw.
21660
21661         * cs-parser.jay: Added support for try/catch/finalize.
21662
21663         * class.cs: Catch static methods having the flags override,
21664         virtual or abstract.
21665
21666         * expression.cs (UserCast): This user cast was not really doing
21667         what it was supposed to do.  Which is to be born in fully resolved
21668         state.  Parts of the resolution were being performed at Emit time! 
21669
21670         Fixed this code.
21671
21672 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21673
21674         * expression.cs: Implicity convert the result from UserCast.
21675
21676 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21677
21678         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21679         prevented it from working correctly. 
21680
21681         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21682         merely ConvertImplicit.
21683
21684 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21685
21686         * typemanager.cs: Make the LookupTypeContainer function static,
21687         and not per-instance.  
21688
21689         * class.cs: Make static FindMembers (the one that takes a Type
21690         argument). 
21691
21692         * codegen.cs: Add EmitForeach here.
21693
21694         * cs-parser.jay: Make foreach a toplevel object instead of the
21695         inline expansion, as we need to perform semantic analysis on it. 
21696
21697 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21698
21699         * expression.cs (Expression::ImplicitUserConversion): Rename to
21700         UserDefinedConversion.
21701
21702         (Expression::UserDefinedConversion): Take an extra argument specifying 
21703         whether we look for explicit user conversions too.
21704
21705         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21706
21707         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21708
21709         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21710         with the appropriate arguments.
21711
21712         * cs-parser.jay (cast_expression): Record location too.
21713
21714         * expression.cs (Cast): Record location info.
21715
21716         (Expression::ConvertExplicit): Take location argument.
21717
21718         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21719         to determine if we are doing explicit conversions.
21720
21721         (UserCast::Emit): Update accordingly.
21722
21723         (Expression::ConvertExplicit): Report an error if everything fails.
21724
21725         * ../errors/cs0030.cs : Add.
21726
21727 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21728
21729         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21730         virtual and newslot bits. 
21731
21732         * class.cs (TypeContainer::RegisterRequiredImplementations):
21733         Record methods we need.
21734
21735         (TypeContainer::MakeKey): Helper function to make keys for
21736         MethodBases, since the Methodbase key is useless.
21737
21738         (TypeContainer::Populate): Call RegisterRequiredImplementations
21739         before defining the methods.   
21740
21741         Create a mapping for method_builders_to_methods ahead of time
21742         instead of inside a tight loop.
21743
21744         (::RequireMethods):  Accept an object as the data to set into the
21745         hashtable so we can report interface vs abstract method mismatch.
21746
21747 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21748
21749         * report.cs: Make all of it static.
21750
21751         * rootcontext.cs: Drop object_type and value_type computations, as
21752         we have those in the TypeManager anyways.
21753
21754         Drop report instance variable too, now it is a global.
21755
21756         * driver.cs: Use try/catch on command line handling.
21757
21758         Add --probe option to debug the error reporting system with a test
21759         suite. 
21760
21761         * report.cs: Add support for exiting program when a probe
21762         condition is reached.
21763
21764 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21765
21766         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21767         we do a forcible conversion regardless of type, to check if 
21768         ForceConversion returns a null.
21769
21770         (Binary::error19): Use location to report error.
21771
21772         (Unary::error23): Use location here too.
21773
21774         * ../errors/cs0019.cs : Check in.
21775
21776         * ../errors/cs0023.cs : Check in.
21777
21778         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21779         case of a non-null MethodInfo object with a length of 0 !
21780
21781         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21782         an applicable member - according to the spec :-)
21783         Also fix logic to find members in base types.
21784
21785         (Unary::ResolveOperator): Same here.
21786
21787         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21788         as I was getting thoroughly confused between this and error19 :-)
21789
21790         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21791         (::FindMostEncompassedType): Implement.
21792         (::FindMostEncompassingType): Implement.
21793         (::StandardConversionExists): Implement.
21794
21795         (UserImplicitCast): Re-vamp. We now need info about most specific
21796         source and target types so that we can do the necessary conversions.
21797
21798         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21799         mathematical union with no duplicates.
21800
21801 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21802
21803         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21804         in order from base classes to child classes, so that we can in
21805         child classes look up in our parent for method names and
21806         attributes (required for handling abstract, virtual, new, override
21807         constructs: we need to instrospect our base class, and if we dont
21808         populate the classes in order, the introspection might be
21809         incorrect.  For example, a method could query its parent before
21810         the parent has any methods and would determine that the parent has
21811         no abstract methods (while it could have had them)).
21812
21813         (RootContext::CreateType): Record the order in which we define the
21814         classes.
21815
21816 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21817
21818         * class.cs (TypeContainer::Populate): Also method definitions can
21819         fail now, keep track of this.
21820
21821         (TypeContainer::FindMembers): Implement support for
21822         DeclaredOnly/noDeclaredOnly flag.
21823
21824         (Constructor::Emit) Return the ConstructorBuilder.
21825
21826         (Method::Emit) Return the MethodBuilder. 
21827         Check for abstract or virtual methods to be public.
21828
21829         * rootcontext.cs (RootContext::CreateType): Register all the
21830         abstract methods required for the class to be complete and the
21831         interface methods that must be implemented. 
21832
21833         * cs-parser.jay: Report error 501 (method requires body if it is
21834         not marked abstract or extern).
21835
21836         * expression.cs (TypeOf::Emit): Implement.
21837
21838         * typemanager.cs: runtime_handle_type, new global type.
21839
21840         * class.cs (Property::Emit): Generate code for properties.
21841
21842 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21843
21844         * expression.cs (Unary::ResolveOperator): Find operators on base type
21845         too - we now conform exactly to the spec.
21846
21847         (Binary::ResolveOperator): Same here.
21848
21849         * class.cs (Operator::Define): Fix minor quirk in the tests.
21850
21851         * ../errors/cs0215.cs : Added.
21852
21853         * ../errors/cs0556.cs : Added.
21854
21855         * ../errors/cs0555.cs : Added.
21856
21857 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21858
21859         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21860         single integer which is really efficient
21861
21862 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21863
21864         *  expression.cs (Expression::ImplicitUserConversion): Use location
21865         even in the case when we are examining True operators.
21866  
21867         * class.cs (Operator::Define): Perform extensive checks to conform
21868         with the rules for operator overloading in the spec.
21869
21870         * expression.cs (Expression::ImplicitReferenceConversion): Implement
21871         some of the other conversions mentioned in the spec.
21872
21873         * typemanager.cs (array_type): New static member for the System.Array built-in
21874         type.
21875
21876         (cloneable_interface): For System.ICloneable interface.
21877
21878         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21879         we start resolving the tree and populating types.
21880
21881         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21882  
21883 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21884
21885         * expression.cs (Expression::ExprClassFromMemberInfo,
21886         Expression::Literalize): Create literal expressions from
21887         FieldInfos which are literals.
21888
21889         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21890         type casts, because they were wrong.  The test suite in tests
21891         caught these ones.
21892
21893         (ImplicitNumericConversion): ushort to ulong requires a widening
21894         cast. 
21895
21896         Int32 constant to long requires widening cast as well.
21897
21898         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21899         for integers because the type on the stack is not i4.
21900
21901 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
21902
21903         * expression.cs (report118): require location argument. 
21904
21905         * parameter.cs: Do not dereference potential null value.
21906
21907         * class.cs: Catch methods that lack the `new' keyword when
21908         overriding a name.  Report warnings when `new' is used without
21909         anything being there to override.
21910
21911         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21912
21913         * class.cs: Only add constructor to hashtable if it is non-null
21914         (as now constructors can fail on define).
21915
21916         (TypeManager, Class, Struct): Take location arguments.
21917
21918         Catch field instance initialization in structs as errors.
21919
21920         accepting_filter: a new filter for FindMembers that is static so
21921         that we dont create an instance per invocation.
21922
21923         (Constructor::Define): Catch errors where a struct constructor is
21924         parameterless 
21925
21926         * cs-parser.jay: Pass location information for various new
21927         constructs. 
21928
21929         * delegate.cs (Delegate): take a location argument.
21930
21931         * driver.cs: Do not call EmitCode if there were problesm in the
21932         Definition of the types, as many Builders wont be there. 
21933
21934         * decl.cs (Decl::Decl): Require a location argument.
21935
21936         * cs-tokenizer.cs: Handle properly hex constants that can not fit
21937         into integers, and find the most appropiate integer for it.
21938
21939         * literal.cs: Implement ULongLiteral.
21940
21941         * rootcontext.cs: Provide better information about the location of
21942         failure when CreateType fails.
21943
21944 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
21945
21946         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21947         as well.
21948
21949         * expression.cs (Binary::CheckShiftArguments): Add missing type
21950         computation.
21951         (Binary::ResolveOperator): Add type to the logical and and logical
21952         or, Bitwise And/Or and Exclusive Or code paths, it was missing
21953         before.
21954
21955         (Binary::DoNumericPromotions): In the case where either argument
21956         is ulong (and most signed types combined with ulong cause an
21957         error) perform implicit integer constant conversions as well.
21958
21959 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21960
21961         * expression.cs (UserImplicitCast): Method should always be
21962         non-null. 
21963         (Invocation::BetterConversion): Simplified test for IntLiteral.
21964
21965         (Expression::ImplicitNumericConversion): Split this routine out.
21966         Put the code that performs implicit constant integer conversions
21967         here. 
21968
21969         (Expression::Resolve): Become a wrapper around DoResolve so we can
21970         check eclass and type being set after resolve.
21971
21972         (Invocation::Badness): Remove this dead function
21973
21974         (Binary::ResolveOperator): Do not compute the expensive argumnets
21975         unless we have a union for it.
21976
21977         (Probe::Emit): Is needs to do an isinst and then
21978         compare against null.
21979
21980         (::CanConvert): Added Location argument.  If the Location argument
21981         is null (Location.Null), then we do not report errors.  This is
21982         used by the `probe' mechanism of the Explicit conversion.  We do
21983         not want to generate an error for something that the user
21984         explicitly requested to be casted.  But the pipeline for an
21985         explicit cast first tests for potential implicit casts.
21986
21987         So for now, if the Location is null, it means `Probe only' to
21988         avoid adding another argument.   Might have to revise this
21989         strategy later.
21990
21991         (ClassCast): New class used to type cast objects into arbitrary
21992         classes (used in Explicit Reference Conversions).
21993
21994         Implement `as' as well.
21995
21996         Reverted all the patches from Ravi below: they were broken:
21997
21998                 * The use of `level' as a mechanism to stop recursive
21999                   invocations is wrong.  That was there just to catch the
22000                   bug with a strack trace but not as a way of addressing
22001                   the problem.
22002
22003                   To fix the problem we have to *understand* what is going
22004                   on and the interactions and come up with a plan, not
22005                   just get things going.
22006
22007                 * The use of the type conversion cache that I proposed
22008                   last night had an open topic: How does this work across
22009                   protection domains.  A user defined conversion might not
22010                   be public in the location where we are applying the
22011                   conversion, a different conversion might be selected
22012                   (ie, private A->B (better) but public B->A (worse),
22013                   inside A, A->B applies, but outside it, B->A will
22014                   apply).
22015
22016                 * On top of that (ie, even if the above is solved),
22017                   conversions in a cache need to be abstract.  Ie, `To
22018                   convert from an Int to a Short use an OpcodeCast', not
22019                   `To convert from an Int to a Short use the OpcodeCast on
22020                   the variable 5' (which is what this patch was doing).
22021
22022 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22023
22024         * expression.cs (Invocation::ConversionExists): Re-write to use
22025         the conversion cache
22026
22027         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22028         cache all conversions done, not just user-defined ones.
22029
22030         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22031         to determine if a conversion exists instead of acutually trying to 
22032         perform the conversion. It's faster too.
22033
22034         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22035         and only then attempt the implicit conversion.
22036
22037 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22038
22039         * expression.cs (ConvertImplicit): Use a cache for conversions
22040         already found. Check level of recursion and bail out if necessary.
22041
22042 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22043
22044         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22045         Export standard methods that we expect for string operations.
22046
22047         * statement.cs (Block::UsageWarning): Track usage of variables and
22048         report the errors for not used variables.
22049
22050         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22051         operator. 
22052
22053 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22054
22055         * codegen.cs: remove unnneded code 
22056
22057         * expression.cs: Removed BuiltinTypeAccess class
22058
22059         Fix the order in which implicit conversions are
22060         done.  
22061
22062         The previous fixed dropped support for boxed conversions (adding a
22063         test to the test suite now)
22064
22065         (UserImplicitCast::CanConvert): Remove test for source being null,
22066         that code is broken.  We should not feed a null to begin with, if
22067         we do, then we should track the bug where the problem originates
22068         and not try to cover it up here.
22069
22070         Return a resolved expression of type UserImplicitCast on success
22071         rather than true/false.  Ravi: this is what I was talking about,
22072         the pattern is to use a static method as a "constructor" for
22073         objects. 
22074
22075         Also, do not create arguments until the very last minute,
22076         otherwise we always create the arguments even for lookups that
22077         will never be performed. 
22078
22079         (UserImplicitCast::Resolve): Eliminate, objects of type
22080         UserImplicitCast are born in a fully resolved state. 
22081
22082         * typemanager.cs (InitCoreTypes): Init also value_type
22083         (System.ValueType). 
22084
22085         * expression.cs (Cast::Resolve): First resolve the child expression.
22086
22087         (LValue): Add new method AddressOf to be used by
22088         the `&' operator.  
22089
22090         Change the argument of Store to take an EmitContext instead of an
22091         ILGenerator, because things like FieldExpr need to be able to call
22092         their children expression to generate the instance code. 
22093
22094         (Expression::Error, Expression::Warning): Sugar functions for
22095         reporting errors.
22096
22097         (Expression::MemberLookup): Accept a TypeContainer instead of a
22098         Report as the first argument.
22099
22100         (Expression::ResolvePrimary): Killed.  I still want to improve
22101         this as currently the code is just not right.
22102
22103         (Expression::ResolveMemberAccess): Simplify, but it is still
22104         wrong. 
22105
22106         (Unary::Resolve): Catch errors in AddressOf operators.
22107
22108         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22109         index to a byte for the short-version, or the compiler will choose
22110         the wrong Emit call, which generates the wrong data.
22111
22112         (ParameterReference::Emit, ::Store): same.
22113
22114         (FieldExpr::AddressOf): Implement.
22115
22116         * typemanager.cs: TypeManager: made public variable instead of
22117         property.
22118
22119         * driver.cs: document --fatal.
22120
22121         * report.cs (ErrorMessage, WarningMessage): new names for the old
22122         Error and Warning classes.
22123
22124         * cs-parser.jay (member_access): Turn built-in access to types
22125         into a normal simplename
22126
22127 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22128
22129         * expression.cs (Invocation::BetterConversion): Fix to cope
22130         with q being null, since this was introducing a bug.
22131
22132         * expression.cs (ConvertImplicit): Do built-in conversions first.
22133
22134 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22135
22136         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22137
22138 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22139
22140         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22141         I had introduced long ago (what's new ?).
22142
22143         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22144         the work of all the checking. 
22145         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22146         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22147
22148         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22149         that is the right way. 
22150
22151         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22152         overloading resolution. Use everywhere instead of cutting and pasting code.
22153
22154         (Binary::ResolveOperator): Use MakeUnionSet.
22155
22156         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22157         we have to convert to bool types. Not complete yet.
22158
22159 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22160
22161         * typemanager.cs (TypeManager::CSharpName): support ushort.
22162
22163         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22164         to provide an expression that performsn an implicit constant int
22165         conversion (section 6.1.6).
22166         (Expression::ConvertImplicitRequired): Reworked to include
22167         implicit constant expression conversions.
22168
22169         (Expression::ConvertNumericExplicit): Finished.
22170
22171         (Invocation::Emit): If InstanceExpression is null, then it means
22172         that we perform a call on this.
22173
22174 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22175
22176         * expression.cs (Unary::Emit): Remove some dead code.
22177         (Probe): Implement Resolve and Emit for `is'.
22178         (Expression::ConvertImplicitRequired): Attempt to do constant
22179         expression conversions here.  Maybe should be moved to
22180         ConvertImplicit, but I am not sure.
22181         (Expression::ImplicitLongConstantConversionPossible,
22182         Expression::ImplicitIntConstantConversionPossible): New functions
22183         that tell whether is it possible to apply an implicit constant
22184         expression conversion.
22185
22186         (ConvertNumericExplicit): Started work on explicit numeric
22187         conversions.
22188
22189         * cs-parser.jay: Update operator constants.
22190
22191         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22192         (Parameters::GetSignature): Hook up VerifyArgs here.
22193         (Parameters::VerifyArgs): Verifies that no two arguments have the
22194         same name. 
22195
22196         * class.cs (Operator): Update the operator names to reflect the
22197         ones that the spec expects (as we are just stringizing the
22198         operator names).
22199
22200         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22201         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22202         previous usage did only work for our methods.
22203         (Expression::ConvertImplicit): Handle decimal implicit numeric
22204         conversions as well.
22205         (Expression::InternalTypeConstructor): Used to invoke constructors
22206         on internal types for default promotions.
22207
22208         (Unary::Emit): Implement special handling for the pre/post
22209         increment/decrement for overloaded operators, as they need to have
22210         the same semantics as the other operators.
22211
22212         (Binary::ResolveOperator): ditto.
22213         (Invocation::ConversionExists): ditto.
22214         (UserImplicitCast::Resolve): ditto.
22215
22216 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22217
22218         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22219         operator, return after emitting body. Regression tests pass again !
22220
22221         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22222         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22223         (Invocation::OverloadResolve): Ditto.
22224         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22225
22226         * everywhere : update calls to the above methods accordingly.
22227
22228 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22229
22230         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22231
22232         * expression.cs (ExpressionStatement): New base class used for
22233         expressions that can appear in statements, so that we can provide
22234         an alternate path to generate expression that do not leave a value
22235         on the stack.
22236
22237         (Expression::Emit, and all the derivatives): We no longer return
22238         whether a value is left on the stack or not.  Every expression
22239         after being emitted leaves a single value on the stack.
22240
22241         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22242         facilties of ExpressionStatement if possible.
22243
22244         * cs-parser.jay: Update statement_expression.
22245
22246 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22247
22248         * driver.cs: Change the wording of message
22249
22250 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22251
22252         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22253         the type of the expression to the return type of the method if
22254         we have an overloaded operator match ! The regression tests pass again !
22255         (Unary::ResolveOperator): Ditto.
22256
22257         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22258         to find "op_Implicit", not "implicit" ;-)
22259         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22260         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22261
22262         * everywhere : Correct calls to the above accordingly.
22263
22264         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22265         (ConvertImplicit): Do user-defined conversion if it exists.
22266
22267 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22268
22269         * assign.cs: track location.
22270         (Resolve): Use implicit conversions on assignment.
22271
22272         * literal.cs: Oops.  Not good, Emit of short access values should
22273         pass (Bytes) or the wrong argument will be selected.
22274
22275         * expression.cs (Unary::Emit): Emit code for -expr.
22276
22277         (Unary::ResolveOperator): Handle `Substract' for non-constants
22278         (substract from zero from the non-constants).
22279         Deal with Doubles as well. 
22280
22281         (Expression::ConvertImplicitRequired): New routine that reports an
22282         error if no implicit conversion exists. 
22283
22284         (Invocation::OverloadResolve): Store the converted implicit
22285         expressions if we make them
22286
22287 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22288
22289         * class.cs (ConstructorInitializer): Take a Location argument.
22290         (ConstructorBaseInitializer): Same here.
22291         (ConstructorThisInitializer): Same here.
22292
22293         * cs-parser.jay : Update all calls accordingly.
22294
22295         * expression.cs (Unary, Binary, New): Take location argument.
22296         Update accordingly everywhere.
22297
22298         * cs-parser.jay : Update all calls to the above to take a location
22299         argument.
22300
22301         * class.cs : Ditto.
22302
22303 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22304
22305         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22306         (Invocation::BetterConversion): Same here
22307         (Invocation::ConversionExists): Ditto.
22308
22309         (Invocation::ConversionExists): Implement.
22310
22311 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22312
22313         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22314         Also take an additional TypeContainer argument.
22315
22316         * All over : Pass in TypeContainer as argument to OverloadResolve.
22317
22318         * typemanager.cs (CSharpName): Update to check for the string type and return
22319         that too.
22320
22321         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22322         a given method.
22323
22324 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22325
22326         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22327         (Invocation::BetterFunction): Implement.
22328         (Invocation::BetterConversion): Implement.
22329         (Invocation::ConversionExists): Skeleton, no implementation yet.
22330
22331         Okay, things work fine !
22332
22333 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22334
22335         * typemanager.cs: declare and load enum_type, delegate_type and
22336         void_type. 
22337
22338         * expression.cs (Expression::Emit): Now emit returns a value that
22339         tells whether a value is left on the stack or not.  This strategy
22340         might be reveted tomorrow with a mechanism that would address
22341         multiple assignments.
22342         (Expression::report118): Utility routine to report mismatches on
22343         the ExprClass.
22344
22345         (Unary::Report23): Report impossible type/operator combination
22346         utility function.
22347
22348         (Unary::IsIncrementableNumber): Whether the type can be
22349         incremented or decremented with add.
22350         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22351         complemented. 
22352         (Unary::ResolveOperator): Implement ++, !, ~,
22353
22354         (Invocation::Emit): Deal with new Emit convetion.
22355
22356         * All Expression derivatives: Updated their Emit method to return
22357         whether they leave values on the stack or not.
22358
22359         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22360         stack for expressions that are statements. 
22361
22362 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22363
22364         * expression.cs (LValue): New interface.  Must be implemented by
22365         LValue objects.
22366         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22367         LValue interface.
22368
22369         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22370         interface for generating code, simplifies the code.
22371
22372 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22373
22374         * expression.cs (everywhere): Comment out return statements in ::Resolve
22375         methods to avoid the warnings.
22376
22377 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22378
22379         * driver.cs (parse): Report error 2001 if we can not open the
22380         source file.
22381
22382         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22383         not resolve it.
22384
22385         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22386         object. 
22387
22388         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22389         otherwise nested blocks end up with the same index.
22390
22391         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22392
22393         * expression.cs:  Instead of having FIXMEs in the Resolve
22394         functions, throw exceptions so it is obvious that we are facing a
22395         bug. 
22396
22397         * cs-parser.jay (invocation_expression): Pass Location information.
22398
22399         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22400         Use a basename for those routines because .NET does not like paths
22401         on them. 
22402
22403         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22404         already defined.
22405
22406 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22407
22408         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22409         are loading the correct data types (throws an exception if not).
22410         (TypeManager::InitCoreTypes): Use CoreLookupType
22411
22412         * expression.cs (Unary::ResolveOperator): return the child
22413         expression for expressions which are just +expr.
22414         (Unary::ResolveOperator): Return negative literals for -LITERAL
22415         expressions (otherwise they are Unary {Literal}).
22416         (Invocation::Badness): Take into account `Implicit constant
22417         expression conversions'.
22418
22419         * literal.cs (LongLiteral): Implement long literal class.
22420         (IntLiteral): export the `Value' of the intliteral. 
22421
22422 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22423
22424         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22425
22426         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22427         instead of 'Operator'
22428
22429         * expression.cs (Binary::ResolveOperator): Update accordingly.
22430         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22431         and 'Minus'
22432
22433         * cs-parser.jay (unary_expression): Update to use the new names.
22434
22435         * gen-treedump.cs (GetUnary): Same here.
22436
22437         * expression.cs (Unary::Resolve): Implement.
22438         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22439         operators are found instead of making noise ;-)
22440         (Unary::ResolveOperator): New method to do precisely the same thing which
22441         Binary::ResolveOperator does for Binary expressions.
22442         (Unary.method, .Arguments): Add.
22443         (Unary::OperName): Implement.   
22444         (Unary::ForceConversion): Copy and Paste !
22445
22446         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22447         a unary operator.
22448
22449         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22450         for the inbuilt operators. Only overloading works for now ;-)
22451
22452 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22453
22454         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22455         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22456
22457         * expression.cs (This::Emit): Implement. 
22458         (This::Resolve): Implement.
22459         (TypeOf:Resolve): Implement.
22460         (Expression::ResolveSimpleName): Add an implicit this to instance
22461         field references. 
22462         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22463         Bind instance variable to Field expressions.
22464         (FieldExpr::Instance): New field used to track the expression that
22465         represents the object instance.
22466         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22467         binding 
22468         (FieldExpr::Emit): Implement.
22469
22470         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22471         the last instruction contains a return opcode to avoid generating
22472         the last `ret' instruction (this generates correct code, and it is
22473         nice to pass the peverify output).
22474
22475         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22476         initializer for static and instance variables.
22477         (Constructor::Emit): Allow initializer to be null in the case of
22478         static constructors.  Only emit initializer for instance
22479         constructors. 
22480
22481         (TypeContainer::FindMembers): Return a null array if there are no
22482         matches.
22483
22484         Also fix the code for the MemberTypes.Method branch, as it was not
22485         scanning that for operators (or tried to access null variables before).
22486
22487         * assign.cs (Assign::Emit): Handle instance and static fields. 
22488
22489         * TODO: Updated.
22490
22491         * driver.cs: Stop compilation if there are parse errors.
22492
22493         * cs-parser.jay (constructor_declaration): Provide default base
22494         initializer for non-static constructors.
22495         (constructor_declarator): Do not provide a default base
22496         initializers if none was specified.
22497         Catch the fact that constructors should not have parameters.
22498
22499         * class.cs: Do not emit parent class initializers for static
22500         constructors, that should be flagged as an error.
22501
22502 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22503
22504         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22505         Move back code into TypeContainer::Populate.
22506
22507 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22508
22509         * class.cs (TypeContainer::AddConstructor): Fix the check to
22510         compare against Name, not Basename. 
22511         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22512
22513         * cs-parser.jay : Update accordingly.
22514
22515         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22516         for methods, don't forget to look into the operators too.
22517         (RegisterMethodBuilder): Helper method to take care of this for
22518         methods, constructors and operators.
22519         (Operator::Define): Completely revamp.
22520         (Operator.OperatorMethod, MethodName): New fields.
22521         (TypeContainer::Populate): Move the registering of builders into
22522         RegisterMethodBuilder.
22523         (Operator::Emit): Re-write.
22524
22525         * expression.cs (Binary::Emit): Comment out code path to emit method
22526         invocation stuff for the case when we have a user defined operator. I am
22527         just not able to get it right !
22528
22529 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22530
22531         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22532         argument. 
22533
22534         (Expression::MemberLookup): Provide a version that allows to
22535         specify the MemberTypes and BindingFlags. 
22536
22537         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22538         so it was not fetching variable information from outer blocks.
22539
22540         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22541         Beforefieldinit as it was buggy.
22542
22543         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22544         that Ravi put here.  
22545
22546         * class.cs (Constructor::Emit): Only emit if block is not null.
22547         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22548         deal with this by semantically definining it as if the user had
22549         done it.
22550
22551         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22552         constructors as we now "emit" them at a higher level.
22553
22554         (TypeContainer::DefineDefaultConstructor): Used to define the
22555         default constructors if none was provided.
22556
22557         (ConstructorInitializer): Add methods Resolve and Emit. 
22558
22559         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22560
22561 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22562
22563         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22564         the default constructor builder with our hashtable for methodbuilders
22565         to methodcores.
22566
22567         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22568         and argument_count is 0 in which case we have a match.
22569         (Binary::ResolveOperator): More null checking and miscellaneous coding
22570         style cleanup.
22571
22572 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22573
22574         * rootcontext.cs (IsNameSpace): Compare against null.
22575
22576         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22577
22578         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22579         and Unary::Operator.
22580
22581         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22582         accordingly.
22583
22584         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22585         we have overloaded operators.
22586         (Binary::ResolveOperator): Implement the part which does the operator overload
22587         resolution.
22588
22589         * class.cs (Operator::Emit): Implement.
22590         (TypeContainer::Emit): Emit the operators we have too.
22591
22592         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22593         the case when we have a user-defined operator.
22594
22595 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22596
22597         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22598
22599 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22600
22601         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22602         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22603         (Constructor::Emit): Implement.
22604         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22605         if we have no work to do. 
22606         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22607         Emit method.
22608
22609         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22610         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22611
22612         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22613         of parent.parent.
22614
22615 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22616
22617         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22618         in the source.
22619         (Tree::RecordNamespace): Method to do what the name says ;-)
22620         (Tree::Namespaces): Property to get at the namespaces hashtable.
22621
22622         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22623         keep track.
22624
22625         * rootcontext.cs (IsNamespace): Fixed it :-)
22626
22627 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22628
22629         * class.cs (TypeContainer::FindMembers): Add support for
22630         constructors. 
22631         (MethodCore): New class that encapsulates both the shared aspects
22632         of a Constructor and a Method.  
22633         (Method, Constructor): Factored pieces into MethodCore.
22634
22635         * driver.cs: Added --fatal which makes errors throw exceptions.
22636         Load System assembly as well as part of the standard library.
22637
22638         * report.cs: Allow throwing exceptions on errors for debugging.
22639
22640         * modifiers.cs: Do not use `parent', instead use the real type
22641         container to evaluate permission settings.
22642
22643         * class.cs: Put Ravi's patch back in.  He is right, and we will
22644         have to cope with the
22645
22646 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22647
22648         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22649         FamORAssem, not FamANDAssem.
22650
22651 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22652
22653         * driver.cs: Added --parse option that only parses its input files
22654         and terminates.
22655
22656         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22657         incorrect.  IsTopLevel is not used to tell whether an object is
22658         root_types or not (that can be achieved by testing this ==
22659         root_types).  But to see if this is a top-level *class* (not
22660         necessarly our "toplevel" container). 
22661
22662 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22663
22664         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22665         parent instead of a direct call to GetType.
22666
22667 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22668
22669         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22670         Modifiers.TypeAttr. This should just be a call to that method.
22671
22672         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22673         object so that we can determine if we are top-level or not.
22674
22675         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22676         TypeContainer too.
22677
22678         * enum.cs (Enum::Define): Ditto.
22679
22680         * modifiers.cs (FieldAttr): Re-write.
22681
22682         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22683         (TypeContainer::HaveStaticConstructor): New property to provide access
22684         to precisely that info.
22685
22686         * modifiers.cs (MethodAttr): Re-write.
22687         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22688
22689         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22690         of top-level types as claimed.
22691
22692 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22693
22694         * expression.cs (MemberLookup): Fruitless attempt to lookup
22695         constructors.  Maybe I need to emit default constructors?  That
22696         might be it (currently .NET emits this for me automatically).
22697         (Invocation::OverloadResolve): Cope with Arguments == null.
22698         (Invocation::EmitArguments): new function, shared by the new
22699         constructor and us.
22700         (Invocation::Emit): Handle static and instance methods.  Emit
22701         proper call instruction for virtual or non-virtual invocations.
22702         (New::Emit): Implement.
22703         (New::Resolve): Implement.
22704         (MemberAccess:Resolve): Implement.
22705         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22706         to track instances.
22707         (FieldExpr::Resolve): Set type.
22708
22709         * support.cs: Handle empty arguments.
22710                 
22711         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22712         SimpleLookup): Auxiliary routines to help parse a qualifier
22713         identifier.  
22714
22715         Update qualifier_identifier rule.
22716
22717         * codegen.cs: Removed debugging messages.
22718
22719         * class.cs: Make this a global thing, this acts just as a "key" to
22720         objects that we might have around.
22721
22722         (Populate): Only initialize method_builders_to_methods once.
22723
22724         * expression.cs (PropertyExpr): Initialize type from the
22725         PropertyType. 
22726
22727         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22728         Resolve pattern.  Attempt to implicitly convert value to boolean.
22729         Emit code.
22730
22731         * expression.cs: Set the type for the int32/int32 argument case.
22732         (Binary::ResolveOperator): Set the return type to boolean for
22733         comparission operators
22734
22735         * typemanager.cs: Remove debugging print code.
22736
22737         (Invocation::Resolve): resolve type.
22738
22739         * class.cs: Allocate a MemberInfo of the correct size, as the code
22740         elsewhere depends on the test to reflect the correct contents.
22741
22742         (Method::) Keep track of parameters, due to System.Reflection holes
22743
22744         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22745         mapping here.
22746
22747         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22748         of the exact size and return that.
22749
22750         (Class::LookupMethodByBuilder): New function that maps
22751         MethodBuilders to its methods.  Required to locate the information
22752         on methods because System.Reflection bit us again.
22753
22754         * support.cs: New file, contains an interface ParameterData and
22755         two implementations: ReflectionParameters and InternalParameters
22756         used to access Parameter information.  We will need to grow this
22757         as required.
22758
22759         * expression.cs (Invocation::GetParameterData): implement a cache
22760         and a wrapper around the ParameterData creation for methods. 
22761         (Invocation::OverloadResolve): Use new code.
22762
22763 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22764
22765         * class.cs (TypeContainer::EmitField): Remove and move into 
22766         (Field::Define): here and modify accordingly.
22767         (Field.FieldBuilder): New member.
22768         (TypeContainer::Populate): Update accordingly.
22769         (TypeContainer::FindMembers): Implement.
22770
22771 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22772
22773         * statement.cs: (VariableInfo::VariableType): New field to be
22774         initialized with the full type once it is resolved. 
22775
22776 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22777
22778         * parameter.cs (GetParameterInfo): Use a type cache to compute
22779         things only once, and to reuse this information
22780
22781         * expression.cs (LocalVariableReference::Emit): Implement.
22782         (OpcodeCast::Emit): fix.
22783
22784         (ParameterReference::Resolve): Implement.
22785         (ParameterReference::Emit): Implement.
22786
22787         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22788         that are expressions need to stay as Expressions.
22789
22790         * typemanager.cs (CSharpName): Returns the C# name of a type if
22791         possible. 
22792
22793         * expression.cs (Expression::ConvertImplicit): New function that
22794         implements implicit type conversions.
22795
22796         (Expression::ImplicitReferenceConversion): Implements implicit
22797         reference conversions.
22798
22799         (EmptyCast): New type for transparent casts.
22800
22801         (OpcodeCast): New type for casts of types that are performed with
22802         a sequence of bytecodes.
22803
22804         (BoxedCast): New type used for casting value types into reference
22805         types.  Emits a box opcode.
22806
22807         (Binary::DoNumericPromotions): Implements numeric promotions of
22808         and computation of the Binary::Type.
22809
22810         (Binary::EmitBranchable): Optimization.
22811
22812         (Binary::Emit): Implement code emission for expressions.
22813
22814         * typemanager.cs (TypeManager): Added two new core types: sbyte
22815         and byte.
22816
22817 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22818
22819         * class.cs (TypeContainer::FindMembers): Method which does exactly
22820         what Type.FindMembers does, only we don't have to use reflection. No
22821         implementation yet.
22822
22823         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22824         typecontainer objects as we need to get at them.
22825         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22826
22827         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22828         typecontainer object.
22829
22830         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22831         of just a Report object.
22832
22833 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22834
22835         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22836         "remove_"
22837         (TypeContainer::Populate): Now define the delegates of the type too.
22838         (TypeContainer.Delegates): Property to access the list of delegates defined
22839         in the type.
22840
22841         * delegates.cs (Delegate::Define): Implement partially.
22842
22843         * modifiers.cs (TypeAttr): Handle more flags.
22844
22845 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22846
22847         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22848         and not <=
22849         (Operator::Define): Re-write logic to get types by using the LookupType method
22850         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22851         (Indexer::Define): Ditto.
22852         (Event::Define): Ditto.
22853         (Property::Define): Ditto.
22854
22855 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22856
22857         * class.cs (TypeContainer::Populate): Now define operators too. 
22858         (TypeContainer.Operators): New property to access the list of operators
22859         in a type.
22860         (Operator.OperatorMethodBuilder): New member to hold the method builder
22861         for the operator we are defining.
22862         (Operator::Define): Implement.
22863
22864 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22865
22866         * class.cs (Event::Define): Make the prefixes of the accessor methods
22867         addOn_ and removeOn_ 
22868
22869         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22870         of the location being passed in too. Ideally, this should go later since all
22871         error reporting should be done through the Report object.
22872
22873         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22874         (Populate): Iterate thru the indexers we have and define them too.
22875         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22876         for the get and set accessors.
22877         (Indexer::Define): Implement.
22878
22879 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
22880
22881         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
22882         my previous implementation, did not work.
22883
22884         * typemanager.cs: Add a couple of missing types (the longs).
22885
22886         * literal.cs: Use TypeManager.bool_type instead of getting it.
22887
22888         * expression.cs (EventExpr): New kind of expressions.
22889         (Expressio::ExprClassFromMemberInfo): finish
22890
22891 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
22892
22893         * assign.cs: Emit stores to static fields differently.
22894
22895 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22896
22897         * Merge in changes and adjust code to tackle conflicts. Backed out my
22898         code in Assign::Resolve ;-) 
22899
22900 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22901
22902         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22903         instead Report.Error and also pass in the location.
22904         (CSharpParser::Lexer): New readonly property to return the reference
22905         to the Tokenizer object.
22906         (declare_local_variables): Use Report.Error with location instead of plain 
22907         old error.
22908         (CheckDef): Ditto.
22909
22910         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22911         (Operator.CheckBinaryOperator): Ditto.
22912
22913         * cs-parser.jay (operator_declarator): Update accordingly.
22914
22915         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22916         (CheckBinaryOperator): Same here.
22917
22918         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22919         on the name without any prefixes of namespace names etc. This is because we
22920         already might have something already fully qualified like 
22921         'System.Console.WriteLine'
22922
22923         * assign.cs (Resolve): Begin implementation. Stuck ;-)
22924
22925 2001-09-07  Ravi Pratap  <ravi@ximian.com>
22926
22927         * cs-tokenizer.cs (location): Return a string which also contains
22928         the file name.
22929
22930         * expression.cs (ElementAccess): New class for expressions of the
22931         type 'element access.'
22932         (BaseAccess): New class for expressions of the type 'base access.'
22933         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22934         respectively.
22935
22936         * cs-parser.jay (element_access): Implement action.
22937         (base_access): Implement actions.
22938         (checked_expression, unchecked_expression): Implement.
22939
22940         * cs-parser.jay (local_variable_type): Correct and implement.
22941         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22942
22943         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22944
22945         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22946         name and the specifiers.
22947
22948         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22949
22950         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
22951         making them all public ;-)
22952
22953         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22954         class anyways.
22955
22956 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
22957
22958         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22959         PropertyExprs.
22960         (FieldExpr, PropertyExprs): New resolved expressions.
22961         (SimpleName::MemberStaticCheck): Perform static checks for access
22962         to non-static fields on static methods. Maybe this should be
22963         generalized for MemberAccesses. 
22964         (SimpleName::ResolveSimpleName): More work on simple name
22965         resolution. 
22966
22967         * cs-parser.jay (primary_expression/qualified_identifier): track
22968         the parameter index.
22969
22970         * codegen.cs (CodeGen::Save): Catch save exception, report error.
22971         (EmitContext::EmitBoolExpression): Chain to expression generation
22972         instead of temporary hack.
22973         (::EmitStatementExpression): Put generic expression code generation.
22974
22975         * assign.cs (Assign::Emit): Implement variable assignments to
22976         local variables, parameters and fields.
22977
22978 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22979
22980         * statement.cs (Block::GetVariableInfo): New method, returns the
22981         VariableInfo for a variable name in a block.
22982         (Block::GetVariableType): Implement in terms of GetVariableInfo
22983
22984         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22985         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22986
22987 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22988
22989         * cs-parser.jay (operator_declaration): Continue on my quest : update
22990         to take attributes argument.
22991         (event_declaration): Ditto.
22992         (enum_declaration): Ditto.
22993         (indexer_declaration): Ditto.
22994
22995         * class.cs (Operator::Operator): Update constructor accordingly.
22996         (Event::Event): Ditto.
22997
22998         * delegate.cs (Delegate::Delegate): Same here.
22999
23000         * enum.cs (Enum::Enum): Same here.
23001
23002 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23003
23004         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23005
23006         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23007
23008         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23009         being passed around as an arraylist.
23010         (Attributes::AddAttribute): Method to add attribute sections.
23011
23012         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23013         (struct_declaration): Update accordingly.
23014         (constant_declaration): Update.
23015         (field_declaration): Update.
23016         (method_header): Update.
23017         (fixed_parameter): Update.
23018         (parameter_array): Ditto.
23019         (property_declaration): Ditto.
23020         (destructor_declaration): Ditto.
23021
23022         * class.cs (Struct::Struct): Update constructors accordingly.
23023         (Class::Class): Ditto.
23024         (Field::Field): Ditto.
23025         (Method::Method): Ditto.
23026         (Property::Property): Ditto.
23027         (TypeContainer::OptAttribute): update property's return type.
23028
23029         * interface.cs (Interface.opt_attributes): New member.
23030         (Interface::Interface): Update to take the extra Attributes argument.
23031
23032         * parameter.cs (Parameter::Parameter): Ditto.
23033
23034         * constant.cs (Constant::Constant): Ditto.
23035
23036         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23037         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23038         the attributes as a parameter.
23039         (InterfaceProperty): Update constructor call.
23040         (InterfaceEvent): Ditto.
23041         (InterfaceMethod): Ditto.
23042         (InterfaceIndexer): Ditto.
23043
23044         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23045         pass the attributes too.
23046         (interface_event_declaration): Ditto.
23047         (interface_property_declaration): Ditto.
23048         (interface_method_declaration): Ditto.
23049         (interface_declaration): Ditto.
23050
23051 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23052
23053         * class.cs (Method::Define): Track the "static Main" definition to
23054         create an entry point. 
23055
23056         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23057         EntryPoint if we find it. 
23058
23059         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23060         (EmitContext::ig): Make this variable public.
23061
23062         * driver.cs: Make the default output file be the first file name
23063         with the .exe extension.  
23064
23065         Detect empty compilations
23066
23067         Handle various kinds of output targets.  Handle --target and
23068         rename -t to --dumper.
23069
23070         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23071         methods inherited from Expression return now an Expression.  This
23072         will is used during the tree rewriting as we resolve them during
23073         semantic analysis.
23074
23075         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23076         the spec.  Missing entirely is the information about
23077         accessability of elements of it.
23078
23079         (Expression::ExprClassFromMemberInfo): New constructor for
23080         Expressions that creates a fully initialized Expression based on
23081         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23082         a Type.
23083
23084         (Invocation::Resolve): Begin implementing resolution of invocations.
23085
23086         * literal.cs (StringLiteral):  Implement Emit.
23087
23088 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23089
23090         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23091         member.
23092
23093 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23094
23095         * cs-parser.jay (attribute_arguments): Implement actions.
23096         (attribute): Fix bug in production. Implement action.
23097         (attribute_list): Implement.
23098         (attribute_target): Implement.
23099         (attribute_target_specifier, opt_target_specifier): Implement
23100         (CheckAttributeTarget): New method to check if the attribute target
23101         is valid.
23102         (attribute_section): Implement.
23103         (opt_attributes): Implement.
23104
23105         * attribute.cs : New file to handle attributes.
23106         (Attribute): Class to hold attribute info.
23107
23108         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23109         (attribute_section): Modify production to use 2 different rules to 
23110         achieve the same thing. 1 s/r conflict down !
23111         Clean out commented, useless, non-reducing dimension_separator rules.
23112
23113         * class.cs (TypeContainer.attributes): New member to hold list
23114         of attributes for a type.
23115         (Struct::Struct): Modify to take one more argument, the attribute list.
23116         (Class::Class): Ditto.
23117         (Field::Field): Ditto.
23118         (Method::Method): Ditto.
23119         (Property::Property): Ditto.
23120
23121         * cs-parser.jay (struct_declaration): Update constructor call to
23122         pass in the attributes too.
23123         (class_declaration): Ditto.
23124         (constant_declaration): Ditto.
23125         (field_declaration): Ditto.
23126         (method_header): Ditto.
23127         (fixed_parameter): Ditto.
23128         (parameter_array): Ditto.
23129         (property_declaration): Ditto.
23130
23131         * constant.cs (Constant::Constant): Update constructor similarly.
23132         Use System.Collections.
23133
23134         * parameter.cs (Parameter::Parameter): Update as above.
23135
23136 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23137
23138         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23139         (TypeContainer.delegates): New member to hold list of delegates.
23140
23141         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23142         this time as I seem to be on crack ;-)
23143
23144 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23145
23146         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23147         tell whether an identifier represents a namespace.
23148
23149         * expression.cs (NamespaceExpr): A namespace expression, used only
23150         temporarly during expression resolution.
23151         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23152         utility functions to resolve names on expressions.
23153
23154 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23155
23156         * codegen.cs: Add hook for StatementExpressions. 
23157
23158         * class.cs: Fix inverted test for static flag in methods.
23159
23160 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23161
23162         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23163         to make it coincide with MS' number.
23164         (Operator::CheckBinaryOperator): Ditto.
23165
23166         * ../errors/errors.txt : Remove error numbers added earlier.
23167
23168         * ../errors/cs1019.cs : Test case for error # 1019
23169
23170         * ../errros/cs1020.cs : Test case for error # 1020
23171
23172         * cs-parser.jay : Clean out commented cruft.
23173         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23174         used anywhere - non-reducing rule.
23175         (namespace_declarations): Non-reducing rule - comment out.
23176
23177         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23178         with TypeContainer::AddEnum.
23179
23180         * delegate.cs : New file for delegate handling classes.
23181         (Delegate): Class for declaring delegates.
23182
23183         * makefile : Update.
23184
23185         * cs-parser.jay (delegate_declaration): Implement.
23186
23187 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23188
23189         * class.cs (Event::Define): Implement.
23190         (Event.EventBuilder): New member.
23191
23192         * class.cs (TypeContainer::Populate): Update to define all enums and events
23193         we have.
23194         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23195         readonly fields for all these cases ?
23196
23197 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23198
23199         * class.cs (Property): Revamp to use the convention of making fields readonly.
23200         Accordingly modify code elsewhere.
23201
23202         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23203         the Define method of the Property class.
23204
23205         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23206         trivial bug.
23207         (TypeContainer::Populate): Update to define all the properties we have. Also
23208         define all enumerations.
23209
23210         * enum.cs (Define): Implement.
23211
23212 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23213
23214         * cs-parser.jay (overloadable_operator): The semantic value is an
23215         enum of the Operator class.
23216         (operator_declarator): Implement actions.
23217         (operator_declaration): Implement.
23218
23219         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23220         validity of definitions.
23221         (Operator::CheckBinaryOperator): Static method to check for binary operators
23222         (TypeContainer::AddOperator): New method to add an operator to a type.
23223
23224         * cs-parser.jay (indexer_declaration): Added line to actually call the
23225         AddIndexer method so it gets added ;-)
23226
23227         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23228         already taken care of by the MS compiler ?  
23229
23230 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23231
23232         * class.cs (Operator): New class for operator declarations.
23233         (Operator::OpType): Enum for the various operators.
23234
23235 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23236
23237         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23238         ostensibly handle this in semantic analysis.
23239
23240         * cs-parser.jay (general_catch_clause): Comment out
23241         (specific_catch_clauses, specific_catch_clause): Ditto.
23242         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23243         (catch_args, opt_catch_args): New productions.
23244         (catch_clause): Rewrite to use the new productions above
23245         (catch_clauses): Modify accordingly.
23246         (opt_catch_clauses): New production to use in try_statement
23247         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23248         and re-write the code in the actions to extract the specific and
23249         general catch clauses by being a little smart ;-)
23250
23251         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23252         Hooray, try and catch statements parse fine !
23253
23254 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23255
23256         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23257         string from the hashtable of variables.
23258
23259         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23260         I end up making that mistake ;-)
23261         (catch_clauses): Fixed gross error which made Key and Value of the 
23262         DictionaryEntry the same : $1 !!
23263
23264 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23265
23266         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23267
23268         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23269         when the add and remove accessors are specified. 
23270
23271 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23272
23273         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23274         information about indexer_declarator.
23275         (indexer_declarator): Implement actions.
23276         (parsing_indexer): New local boolean used to keep track of whether
23277         we are parsing indexers or properties. This is necessary because 
23278         implicit_parameters come into picture even for the get accessor in the 
23279         case of an indexer.
23280         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23281
23282         * class.cs (Indexer): New class for indexer declarations.
23283         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23284         (TypeContainer::indexers): New member to hold list of indexers for the
23285         type.
23286
23287 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23288
23289         * cs-parser.jay (add_accessor_declaration): Implement action.
23290         (remove_accessor_declaration): Implement action.
23291         (event_accessors_declaration): Implement
23292         (variable_declarators): swap statements for first rule - trivial.
23293
23294         * class.cs (Event): New class to hold information about event
23295         declarations.
23296         (TypeContainer::AddEvent): New method to add an event to a type
23297         (TypeContainer::events): New member to hold list of events.
23298
23299         * cs-parser.jay (event_declaration): Implement actions.
23300
23301 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23302
23303         * cs-parser.jay (dim_separators): Implement. Make it a string
23304         concatenating all the commas together, just as they appear.
23305         (opt_dim_separators): Modify accordingly
23306         (rank_specifiers): Update accordingly. Basically do the same
23307         thing - instead, collect the brackets here.
23308         (opt_rank_sepcifiers): Modify accordingly.
23309         (array_type): Modify to actually return the complete type string
23310         instead of ignoring the rank_specifiers.
23311         (expression_list): Implement to collect the expressions
23312         (variable_initializer): Implement. We make it a list of expressions
23313         essentially so that we can handle the array_initializer case neatly too.
23314         (variable_initializer_list): Implement.
23315         (array_initializer): Make it a list of variable_initializers
23316         (opt_array_initializer): Modify accordingly.
23317
23318         * expression.cs (New::NType): Add enumeration to help us
23319         keep track of whether we have an object/delegate creation
23320         or an array creation.
23321         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23322         members to hold data about array creation.
23323         (New:New): Modify to update NewType
23324         (New:New): New Overloaded contructor for the array creation
23325         case.
23326
23327         * cs-parser.jay (array_creation_expression): Implement to call
23328         the overloaded New constructor.
23329
23330 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23331
23332         * class.cs (TypeContainer::Constructors): Return member
23333         constructors instead of returning null.
23334
23335 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23336
23337         * typemanager.cs (InitCoreTypes): Initialize the various core
23338         types after we have populated the type manager with the user
23339         defined types (this distinction will be important later while
23340         compiling corlib.dll)
23341
23342         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23343         on Expression Classification.  Now all expressions have a method
23344         `Resolve' and a method `Emit'.
23345
23346         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23347         generation from working.     Also add some temporary debugging
23348         code. 
23349
23350 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23351
23352         * codegen.cs: Lots of code generation pieces.  This is only the
23353         beginning, will continue tomorrow with more touches of polish.  We
23354         handle the fundamentals of if, while, do, for, return.  Others are
23355         trickier and I need to start working on invocations soon.
23356
23357         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23358         s.InitStatement. 
23359
23360         * codegen.cs (EmitContext): New struct, used during code
23361         emission to keep a context.   Most of the code generation will be
23362         here. 
23363
23364         * cs-parser.jay: Add embedded blocks to the list of statements of
23365         this block.  So code generation proceeds in a top down fashion.
23366
23367 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23368
23369         * statement.cs: Add support for multiple child blocks.
23370
23371 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23372
23373         * codegen.cs (EmitCode): New function, will emit the code for a
23374         Block of code given a TypeContainer and its ILGenerator. 
23375
23376         * statement.cs (Block): Standard public readonly optimization.
23377         (Block::Block constructors): Link children. 
23378         (Block::Child): Child Linker.
23379         (Block::EmitVariables): Emits IL variable declarations.
23380
23381         * class.cs: Drop support for MethodGroups here, delay until
23382         Semantic Analysis.
23383         (Method::): Applied the same simplification that I did before, and
23384         move from Properties to public readonly fields.
23385         (Method::ParameterTypes): Returns the parameter types for the
23386         function, and implements a cache that will be useful later when I
23387         do error checking and the semantic analysis on the methods is
23388         performed.
23389         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23390         and made a method, optional argument tells whether this is a class
23391         or a structure to apply the `has-this' bit.
23392         (Method::GetCallingConvention): Implement, returns the calling
23393         convention. 
23394         (Method::Define): Defines the type, a second pass is performed
23395         later to populate the methods.
23396
23397         (Constructor::ParameterTypes): implement a cache similar to the
23398         one on Method::ParameterTypes, useful later when we do semantic
23399         analysis. 
23400
23401         (TypeContainer::EmitMethod):  New method.  Emits methods.
23402
23403         * expression.cs: Removed MethodGroup class from here.
23404
23405         * parameter.cs (Parameters::GetCallingConvention): new method.
23406
23407 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23408
23409         * class.cs (TypeContainer::Populate): Drop RootContext from the
23410         argument. 
23411
23412         (Constructor::CallingConvention): Returns the calling convention.
23413         (Constructor::ParameterTypes): Returns the constructor parameter
23414         types. 
23415
23416         (TypeContainer::AddConstructor): Keep track of default constructor
23417         and the default static constructor.
23418
23419         (Constructor::) Another class that starts using `public readonly'
23420         instead of properties. 
23421
23422         (Constructor::IsDefault): Whether this is a default constructor. 
23423
23424         (Field::) use readonly public fields instead of properties also.
23425
23426         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23427         track of static constructors;  If none is used, turn on
23428         BeforeFieldInit in the TypeAttributes. 
23429
23430         * cs-parser.jay (opt_argument_list): now the return can be null
23431         for the cases where there are no arguments. 
23432
23433         (constructor_declarator): If there is no implicit `base' or
23434         `this', then invoke the default parent constructor. 
23435
23436         * modifiers.cs (MethodAttr): New static function maps a set of
23437         modifiers flags into a MethodAttributes enum
23438         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23439         MethodAttr, TypeAttr to represent the various mappings where the
23440         modifiers are used.
23441         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23442
23443 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23444
23445         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23446         method arguments.
23447
23448         * interface.cs (PopulateIndexer): Implemented the code generator
23449         for interface indexers.
23450
23451 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23452
23453         * interface.cs (InterfaceMemberBase): Now we track the new status
23454         here.  
23455
23456         (PopulateProperty): Implement property population.  Woohoo!  Got
23457         Methods and Properties going today. 
23458
23459         Removed all the properties for interfaces, and replaced them with
23460         `public readonly' fields. 
23461
23462 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23463
23464         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23465         initialize their hashtables/arraylists only when they are needed
23466         instead of doing this always.
23467
23468         * parameter.cs: Handle refs and out parameters.
23469
23470         * cs-parser.jay: Use an ArrayList to construct the arguments
23471         instead of the ParameterCollection, and then cast that to a
23472         Parameter[] array.
23473
23474         * parameter.cs: Drop the use of ParameterCollection and use
23475         instead arrays of Parameters.
23476
23477         (GetParameterInfo): Use the Type, not the Name when resolving
23478         types. 
23479
23480 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23481
23482         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23483         and instead use public readonly fields.
23484
23485         * class.cs: Put back walking code for type containers.
23486
23487 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23488
23489         * class.cs (MakeConstant): Code to define constants.
23490
23491         * rootcontext.cs (LookupType): New function.  Used to locate types 
23492
23493
23494 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23495
23496         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23497         this System.Reflection code is.  Kudos to Microsoft
23498
23499         * typemanager.cs: Implement a type cache and avoid loading all
23500         types at boot time.  Wrap in LookupType the internals.  This made
23501         the compiler so much faster.  Wow.  I rule!
23502
23503         * driver.cs: Make sure we always load mscorlib first (for
23504         debugging purposes, nothing really important).
23505
23506         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23507         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23508
23509         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23510         on namespaces that have been imported using the `using' keyword.
23511
23512         * class.cs (TypeContainer::TypeAttr): Virtualize.
23513         (Class::TypeAttr): Return attributes suitable for this bad boy.
23514         (Struct::TypeAttr): ditto.
23515         Handle nested classes.
23516         (TypeContainer::) Remove all the type visiting code, it is now
23517         replaced with the rootcontext.cs code
23518
23519         * rootcontext.cs (GetClassBases): Added support for structs. 
23520
23521 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23522
23523         * interface.cs, statement.cs, class.cs, parameter.cs,
23524         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23525         Drop use of TypeRefs, and use strings instead.
23526
23527 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23528
23529         * rootcontext.cs: 
23530
23531         * class.cs (Struct::Struct): set the SEALED flags after
23532         checking the modifiers.
23533         (TypeContainer::TypeAttr): new property, returns the
23534         TypeAttributes for a class.  
23535
23536         * cs-parser.jay (type_list): Oops, list production was creating a
23537         new list of base types.
23538
23539         * rootcontext.cs (StdLib): New property.
23540         (GetInterfaceTypeByName): returns an interface by type name, and
23541         encapsulates error handling here.
23542         (GetInterfaces): simplified.
23543         (ResolveTree): Encapsulated all the tree resolution here.
23544         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23545         types. 
23546
23547         * driver.cs: Add support for --nostdlib, to avoid loading the
23548         default assemblies.
23549         (Main): Do not put tree resolution here. 
23550
23551         * rootcontext.cs: Beginning of the class resolution.
23552
23553 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23554
23555         * rootcontext.cs: Provide better error reporting. 
23556
23557         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23558
23559         * rootcontext.cs (CreateInterface): Handle the case where there
23560         are no parent interfaces.
23561
23562         (CloseTypes): Routine to flush types at the end.
23563         (CreateInterface): Track types.
23564         (GetInterfaces): Returns an array of Types from the list of
23565         defined interfaces.
23566
23567         * typemanager.c (AddUserType): Mechanism to track user types (puts
23568         the type on the global type hash, and allows us to close it at the
23569         end). 
23570
23571 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23572
23573         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23574         RecordInterface instead.
23575
23576         * cs-parser.jay: Updated to reflect changes above.
23577
23578         * decl.cs (Definition): Keep track of the TypeBuilder type that
23579         represents this type here.  Not sure we will use it in the long
23580         run, but wont hurt for now.
23581
23582         * driver.cs: Smaller changes to accomodate the new code.
23583
23584         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23585         when done. 
23586
23587         * rootcontext.cs (CreateInterface):  New method, used to create
23588         the System.TypeBuilder type for interfaces.
23589         (ResolveInterfaces): new entry point to resolve the interface
23590         hierarchy. 
23591         (CodeGen): Property, used to keep track of the code generator.
23592
23593 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23594
23595         * cs-parser.jay: Add a second production for delegate_declaration
23596         with `VOID'.
23597
23598         (enum_body): Put an opt_comma here instead of putting it on
23599         enum_body or enum_member_declarations so we can handle trailing
23600         commas on enumeration members.  Gets rid of a shift/reduce.
23601
23602         (type_list): Need a COMMA in the middle.
23603
23604         (indexer_declaration): Tell tokenizer to recognize get/set
23605
23606         * Remove old targets.
23607
23608         * Re-add the parser target.
23609
23610 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23611
23612         * cs-parser.jay: Add precendence rules for a number of operators
23613         ot reduce the number of shift/reduce conflicts in the grammar.
23614
23615 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23616
23617         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23618         and put it here.
23619
23620         Get rid of old crufty code.
23621
23622         * rootcontext.cs: Use this to keep track of the parsed
23623         representation and the defined types available to the program. 
23624
23625         * gen-treedump.cs: adjust for new convention.
23626
23627         * type.cs: Split out the type manager, and the assembly builder
23628         from here. 
23629
23630         * typemanager.cs: the type manager will live here now.
23631
23632         * cil-codegen.cs: And the code generator here. 
23633
23634 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23635
23636         * makefile: Fixed up for easy making.
23637
23638 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23639
23640         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23641         the 
23642
23643         (unary_expression): Expand pre_increment_expression and
23644         post_decrement_expression to reduce a shift/reduce.
23645
23646 2001-07-11  Simon Cozens
23647
23648         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23649
23650         Improve allow_keyword_as_indent name.
23651
23652 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23653
23654         * Adjustments for Beta2. 
23655
23656 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23657
23658         * decl.cs: Added `Define' abstract method.
23659         (InTransit): new property, used to catch recursive definitions. 
23660
23661         * interface.cs: Implement `Define'. 
23662
23663         * modifiers.cs: Map Modifiers.constants to
23664         System.Reflection.TypeAttribute flags.
23665
23666         * class.cs: Keep track of types and user-defined types.
23667         (BuilderInit): New method for creating an assembly
23668         (ResolveType): New function to launch the resolution process, only
23669         used by interfaces for now.
23670
23671         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23672         that are inserted into the name space. 
23673
23674 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23675
23676         * ARGH.  I have screwed up my tree so many times due to the use of
23677         rsync rather than using CVS.  Going to fix this at once. 
23678
23679         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23680         load types.
23681
23682 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23683
23684         * Experiment successful: Use System.Type rather that our own
23685         version of Type.  
23686
23687 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23688
23689         * cs-parser.jay: Removed nsAliases from here.
23690
23691         Use new namespaces, handle `using XXX;' 
23692
23693         * namespace.cs: Reimplemented namespace handling, use a recursive
23694         definition of the class.  Now we can keep track of using clauses
23695         and catch invalid using clauses.
23696
23697 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23698
23699         * gen-treedump.cs: Adapted for all the renaming.
23700
23701         * expression.cs (Expression): this class now has a Type property
23702         which returns an expression Type.
23703
23704         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23705         `Type', as this has a different meaning now in the base
23706
23707 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23708
23709         * interface.cs, class.cs: Removed from all the sources the
23710         references to signature computation, as we can not do method
23711         signature computation during the parsing time, as we are not
23712         trying to solve at that point distinguishing:
23713
23714         class X {
23715                 void a (Blah x) {}
23716                 void a (NS.Blah x) {}
23717         }
23718
23719         Which depending on the context might be valid or not, as we do not
23720         know if Blah is the same thing as NS.Blah at that point.
23721
23722         * Redid everything so the code uses TypeRefs now instead of
23723         Types.  TypeRefs are just temporary type placeholders, that need
23724         to be resolved.  They initially have a pointer to a string and the
23725         current scope in which they are used.  This is used later by the
23726         compiler to resolve the reference to an actual Type. 
23727
23728         * DeclSpace is no longer a CIR.Type, and neither are
23729         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23730         are all DeclSpaces, but no Types. 
23731
23732         * type.cs (TypeRefManager): This implements the TypeRef manager,
23733         which keeps track of all the types that need to be resolved after
23734         the parsing has finished. 
23735
23736 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23737
23738         * ARGH.  We are going to have to store `foreach' as a class rather
23739         than resolving it, as we need to verify error 1579 after name
23740         resolution.   *OR* we could keep a flag that says `This request to
23741         IEnumerator comes from a foreach statement' which we can then use
23742         to generate the error.
23743
23744 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23745
23746         * class.cs (TypeContainer.AddMethod): we now add methods to the
23747         MethodGroup instead of the method hashtable.  
23748
23749         * expression.cs: Add MethodGroup abstraction, which gets us one
23750         step closer to the specification in the way we handle method
23751         declarations.  
23752
23753         * cs-parser.jay (primary_expression): qualified_identifier now
23754         tried to match up an identifier to a local variable reference or
23755         to a parameter reference.
23756
23757         current_local_parameters is now a parser global variable that
23758         points to the current parameters for the block, used during name
23759         lookup.
23760
23761         (property_declaration): Now creates an implicit `value' argument to
23762         the set accessor.
23763
23764 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23765
23766         * parameter.cs: Do not use `param' arguments as part of the
23767         signature, per the spec.
23768
23769 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23770
23771         * decl.cs: Base class for classes, structs and interfaces.  This
23772         is the "Declaration Space" 
23773
23774         * cs-parser.jay: Use CheckDef for checking declaration errors
23775         instead of having one on each function.
23776
23777         * class.cs: Factor out some code for handling error handling in
23778         accordance to the "Declarations" section in the "Basic Concepts"
23779         chapter in the ECMA C# spec.
23780
23781         * interface.cs: Make all interface member classes derive from
23782         InterfaceMemberBase.
23783
23784 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23785
23786         * Many things: all interfaces are parsed and generated in
23787         gen-treedump.  Support for member variables, constructors,
23788         destructors, properties, constants is there.
23789
23790         Beginning of the IL backend, but very little done, just there for
23791         testing purposes. 
23792
23793 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23794
23795         * cs-parser.jay: Fix labeled statement.
23796
23797         * cs-tokenizer.cs (escape): Escape " and ' always.
23798         ref_line, ref_name: keep track of the line/filename as instructed
23799         by #line by the compiler.
23800         Parse #line.
23801
23802 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23803
23804         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23805         to match the values in System.CodeDOM.
23806
23807         Divid renamed to Divide.
23808
23809         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23810         statements. 
23811         (Statements.set): remove.
23812
23813         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23814         statements. 
23815
23816         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23817         falseStatements always have valid values. 
23818
23819         * cs-parser.jay: Use System.CodeDOM now.
23820