2006-08-15 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / ChangeLog
1 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
2
3         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4         support.
5         * class.cs, ecore.cs, statement.cs: Merged to one error message.
6
7 2006-08-13  Miguel de Icaza  <miguel@novell.com>
8
9         * assign.cs: Catch attempts to assign to a method groups in += and
10         report as 1656
11
12 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
13
14         A fix for #79056
15         * cs-parser.jay: Don't destroy current array type by typeof of array's.
16
17 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
18
19         * class.cs (Method.Define): Issue a warning when generic method looks like
20         an entry point.
21         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
22         as well.
23
24 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
25  
26         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
27         looking for ctor.
28         * decl.cs (MemberCache.FindMembers): When container is interface we need to
29         search all base interfaces as a member can be ambiguous.
30         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
31         Constructor member type filter. 
32         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
33         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
34         reporting for returned memberinfos.
35         * report.cs: Updated.
36         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
37         version to work on all runtimes.
38         (TypeManager.RealMemberLookup): Removed members filtering.
39
40 2006-08-08  Raja R Harinath  <rharinath@novell.com>
41
42         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
43         (PropertyExpr.EmitAssign): Likewise.
44         * expression.cs (Indirection.EmitAssign): Likewise.
45         (LocalVariableReference.EmitAssign): Likewise.
46         (ParameterReference.EmitAssign): Likewise.
47         (Invocation.EmitArguments): Likewise.
48         (ArrayAccess.EmitAssign): Likewise.
49         (IndexerAccess.EmitAssign): Likewise.
50         (This.EmitAssign): Likewise.
51         (ConditionalLogicalOperator.Emit): Likewise.
52
53         Fix #79026
54         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
55         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
56         leave it in after returning it.
57         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
58
59 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
60
61         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
62         message.
63
64 2006-08-03  Raja R Harinath  <rharinath@novell.com>
65
66         Fix cs0146-3.cs and cs0146-4.cs.
67         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
68         enclosing types don't depend on the current type.
69
70 2006-08-02  Raja R Harinath  <rharinath@novell.com>
71
72         Fix #77963
73         * class.cs (TypeContainer.DoDefineMembers): Use
74         FindBaseMemberWithSameName on Parent, since we're interested in
75         whether we hide inherited members or not.
76         (FindBaseMemberWithSameName): Make slightly more robust.
77
78         Fix the non-generic testcase from #77396
79         * decl.cs (DeclSpace.DeclContainer): Remove override.
80
81         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
82         declspaces for doppelgangers too.
83         (UsingEntry): Implement IResolveContext.
84         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
85         'this' as the resolve context.
86         (LocalAliasEntry): Likewise.
87
88         Implement parts of #77403
89         * roottypes.cs (RootDeclSpace): New.  Used to represent the
90         toplevel declaration space.  Each namespace declaration introduces
91         a "partial" root declaretion space.
92         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
93         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
94         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
95         from 'current_namespace.SlaveDeclSpace'.
96         (namespace_declaration): Likewise.
97         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
98         check.  It can't happen now.
99         * decl.cs (DeclSpace.LookupType): Likewise.
100         * driver.cs (MainDriver): Sanity check.
101
102 2006-08-01  Raja R Harinath  <rharinath@novell.com>
103
104         * decl.cs (DeclSpace.FindNestedType): Remove.
105         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
106         LookupTypeContainer to get the container of the nested type.
107         * class.cs (TypeContainer.FindNestedType): Make non-override.
108
109 2006-07-31  Raja R Harinath  <rharinath@novell.com>
110
111         * decl.cs (DeclSpace.PartialContainer): Move field from ...
112         * class.cs (TypeContainer.PartialContainer): ... here.
113         (TypeContainer.AddBasesForPart): New helper.
114         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
115         instead.
116         * cs-parser.jay (current_class): Convert to DeclSpace.
117         (struct_declaration, interface_declaration, class_declaration):
118         Use AddBasesForPart instead of .Bases directly.
119         * const.cs, iterators.cs: Update to changes.
120
121 2006-07-28  Raja R Harinath  <rharinath@novell.com>
122
123         * class.cs (TypeContainer.AddMemberType): Rename from
124         AddToTypeContainer.
125         (TypeContainer.AddMember): Rename from AddToMemberContainer.
126         (AddTypeContainer): New.  Combine AddClassOrStruct and
127         AddInterface.
128         (AddPartial): Update.  Add 'is_partial' argument.
129         * roottypes.cs: Update to changes.
130         * cs-parser.jay (push_current_class): New helper for handling
131         current_container and current_class.
132         (struct_declaration, interface_declaration, class_declaration):
133         Use it.
134
135 2006-07-26  Raja R Harinath  <rharinath@novell.com>
136
137         * roottypes.cs: Rename from tree.cs.
138
139         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
140         * tree.cs (Tree, ITreeDump): Remove types.
141         * rootcontext.cs (tree, Tree): Remove fields.
142         (root, ToplevelTypes): New.
143         * *.cs: Update to rename.
144
145         * tree.cs (Tree.RecordDecl): Remove.
146         (RootTypes.AddToTypeContainer): Record the toplevel type in its
147         namespace here.
148         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
149
150 2006-07-23  Raja R Harinath  <harinath@gmail.com>
151
152         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
153         DoFlowAnalysis and OmitStructFlowAnalysis here.
154         (ec.With): Rename from WithUnsafe and generalize.
155         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
156         (ec.WithFlowAnalyis): New.
157         * ecore.cs, expression.cs, statement.cs: Update.
158
159 2006-07-22  Raja R Harinath  <harinath@gmail.com>
160
161         * statement.cs (Block.ResolveMeta): Simplify slightly.
162
163         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
164         multiple boolean fields.  Convert InUnsafe, constant_check_state,
165         check_state to flags.
166         (CheckState, ConstantCheckState): Update.
167         (InUnsafe): New read-only property.
168         (FlagsHandle): Rename from CheckStateHandle and convert to handle
169         arbitrary flags.
170         (WithUnsafe): New helper similar to WithCheckState.
171         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
172         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
173
174 2006-07-21  Raja R Harinath  <rharinath@novell.com>
175
176         Make comparisons use the same IL irrespective of whether they're
177         in a 'checked' or 'unchecked' context: one of the issues in #78899
178         * codegen.cs (EmitContext.CheckState): Make read-only property.
179         (EmitContext.ConstantCheckState): Likewise.
180         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
181         helper that implement a save/restore stack for CheckState
182         values.  This is the only way to change check-state.
183         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
184         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
185         (CheckedExpr.EmitBranchable): New forwarding method.
186         (UnCheckedExpr): Likewise.
187         * statement.cs (Block.ResolveMeta): Use WithCheckState.
188         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
189         (Checked.Resolve, checked.DoEmit): Likewise.
190
191 2006-07-20  Miguel de Icaza  <miguel@novell.com>
192
193         * anonymous.cs: Cache the resolved anonymous delegate, and return
194         this so that the ResolveTopBlock is only triggered once, not
195         twice.
196
197         Currently we trigger ResolvetopBlock twice due to a first pass of
198         argument check compatibility, and a second pass that does the
199         actual resolution.   
200         
201 2006-07-16  Marek Safar  <marek.safar@seznam.cz>
202
203         A fix for #70506
204         * driver.cs (MainDriver): When a file extension is missing,
205         use a default one.
206
207 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
208
209         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
210         modifiers.
211         * rootcontext.cs (Reset): Add helper_classes.
212
213 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
214
215         A fix for #78860
216         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
217         correctly.
218
219 2006-07-13  Miguel de Icaza  <miguel@novell.com>
220
221         * statement.cs (Lock): Handle expressions of type
222         TypeManager.null_type specially.  Fixes #78770
223
224 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
225
226         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
227         to an event.
228
229 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
230
231         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
232         for accessors as well.
233         * ecore.cs (EventExpr): Add AccessorTable.
234
235 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
236
237         A fix for #78738
238         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
239         for CS0122 where appropriate.
240         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
241         level attributes.
242         (Filter): Assembly can be null in the case of top level attributes.
243
244 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
245
246         A fix for #78690
247
248         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
249         is done at global level.
250
251 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
252
253         A fix for #77002, Implemented TypeForwarder support.
254
255         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
256         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
257         * typemanager.cs (): Add type_forwarder_attr_type.
258
259 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
260
261         * report.cs: Add CS0469 warning.
262
263 2006-06-21  Martin Baulig  <martin@ximian.com>
264
265         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
266         the `try'-block, so we also report CS0016 etc. there.
267
268 2006-06-21  Martin Baulig  <martin@ximian.com>
269
270         * delegate.cs
271         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
272
273 2006-06-21  Martin Baulig  <martin@ximian.com>
274
275         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
276         also report CS1686 for parameters.
277
278 2006-06-21  Martin Baulig  <martin@ximian.com>
279
280         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
281         instead of an error if the value is not implicitly convertible to
282         the switch types; fixes #77964.
283
284 2006-06-21  Raja R Harinath  <rharinath@novell.com>
285
286         Fix #78673
287         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
288         FieldBuilder is null.
289
290         Fix #78662
291         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
292         'left' and 'right' before error-checking.
293
294 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
295
296         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
297         Fixed bug #78601.
298         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
299         (FieldExpr.DoResolve): likewise.
300         (PropertyExpr.InstanceResolve): likewise.
301         (EventExpr.InstanceResolve): likewise. 
302
303 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
304
305         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
306         attribute applicable tests for attribute argument.
307
308 2006-06-02  Raja R Harinath  <rharinath@novell.com>
309
310         Fix #78079
311         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
312         (Binary.OverloadResolve_PredefinedIntegral): New.
313         (Binary.OverloadResolve_PredefinedFloating): New.
314         (Binary.OverloadResolve_PredefinedString): New.
315         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
316         Follow the standard more closely, and treat numeric promotions in
317         terms of overload resolution.
318         (Binary.CheckShiftArguments): Simplify.
319
320 2006-06-01  Raja R Harinath  <rharinath@novell.com>
321
322         * flowanalysis.cs (MyBitVector): Simplify representation.
323         (MyBitVector.Clone): Avoid allocating BitArray.
324         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
325         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
326         (*): Update.  Change all references to MyBitVector.And and
327         MyBitVector.Or to &= and |=.
328
329 2006-05-29  Raja R Harinath  <rharinath@novell.com>
330
331         Fix cs0231-[34].cs.
332         * cs-parser.jay (formal_parameter_list): Extend the pattern below
333         to param arguments too.
334
335 2006-05-26  Miguel de Icaza  <miguel@novell.com>
336
337         * cs-parser.jay: Catch another parsing form for arglist being
338         followed by other arguments.  Fixes #78313.
339
340 2006-05-24  Raja R Harinath  <rharinath@novell.com>
341
342         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
343         checking of out parameters to ...
344         (FlowBranchingToplevel.Merge): ... here.
345         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
346         set, propagate the origin upward, and only complain if there was
347         no other error.
348         (FlowBranchingException.AddContinueOrigin): Likewise.
349         (FlowBranchingException.AddReturnOrigin): Likewise.
350         (FlowBranchingException.AddGotoOrigin): Likewise.       
351
352 2006-05-23  Raja R Harinath  <rharinath@novell.com>
353
354         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
355         unreachable, skip it.
356         (FlowBranchingException.Merge): Always propagate jumps, even if
357         the finally block renders subsequent code unreachable.
358
359 2006-05-18  Raja R Harinath  <rharinath@novell.com>
360
361         Fix #77601
362         * statement.cs (Goto.Resolve): Move responsibility for resolving
363         'goto' to FlowBranching.AddGotoOrigin.
364         (Goto.SetResolvedTarget): New.  Callback to set the
365         LabeledStatement that's the target of the goto.
366         (Goto.DoEmit): Use Leave instead of Br when crossing an
367         unwind-protect boundary.
368         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
369         LookupLabel and adjust to new semantics.
370         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
371         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
372         Goto.SetResolvedTarget to update target.
373         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
374         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
375         AddBreakOrigin & co.  Delay propagation until ...
376         (FlowBranchingException.Merge): ... this.
377
378         * statement.cs (Block.Resolve): Always depend on flow-branching to
379         determine unreachability.  Kill workaround that originally emitted
380         only one statement after an "unreachable" label (see infloop in
381         test-515.cs).
382
383         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
384         This is still "wrong", but anything better would probably need a
385         multi-pass algorithm.
386         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
387         usage vector.  Force current usage vector to be reachable, to
388         optimistically signify backward jumps.
389         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
390         detected.
391         (FlowBranchingLabeled.Merge): New.  If no backward jump was
392         detected, return the original salted-away usage vector instead,
393         updated with appropriate changes.  Print unreachable warning if
394         necessary.
395         * statement.cs (Block.Resolve): Don't print unreachable warning on
396         a labeled statement.
397
398 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
399
400         * driver.cs: Pass filename without path to AssemblyBuilder's 
401         AddResourceFile. Fixes bug #78407.
402
403 2006-05-17  Raja R Harinath  <rharinath@novell.com>
404
405         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
406         * flowanalysis.cs (FlowBranchingLabeled): ... here.
407         (FlowBranching.MergeChild): Overwrite
408         reachability information from Labeled branchings too.
409
410 2006-05-16  Raja R Harinath  <rharinath@novell.com>
411
412         * statement.cs (Goto.Resolve): Merge jump origins here ...
413         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
414
415         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
416         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
417         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
418         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
419         here, ...
420         * statement.cs (Goto.Resolve): ... not here.
421         (Goto.Emit): Remove CS1632 check.
422
423 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
424
425         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
426         error message.
427
428 2006-05-11  Raja R Harinath  <rharinath@novell.com>
429
430         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
431         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
432         (FlowBranchingException.Label): Likewise.
433
434         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
435         given value.
436         (MyBitVector.Or): Use it to avoid losing information (Count).
437         (FlowBranching.MergeOrigins): Likewise.
438
439         * flowanalysis.cs (UsageVector.IsDirty): Remove.
440         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
441         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
442         (UsageVector.ToString): Simplify.
443         (UsageVector.MergeSiblings): Move here from ...
444         (FlowBranching.Merge): ... here.
445         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
446         not a MyBitVector.
447
448 2006-05-10  Raja R Harinath  <rharinath@novell.com>
449
450         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
451         null bitvector is treated as all-true.
452
453         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
454         (MyBitVector): Rationalize invariants.  'vector != null' implies
455         that we have our own copy of the bitvector.  Otherwise,
456         'InheritsFrom == null' implies all inherited bits are true.
457
458 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
459
460         * statement.cs (LocalInfo): Add IsConstant.
461         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
462         local variable for constants.
463
464 2006-05-09  Raja R Harinath  <rharinath@novell.com>
465
466         * flowanalysis.cs (MyBitVector.Empty): New.
467         (MyBitVector): Don't allow InheritedFrom to be null.
468         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
469         (UsageVector, FlowBranching): Update to changes.
470
471         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
472         recursion.  The 'Parent == null' condition isn't sufficient for
473         anonymous methods.
474         (FlowBranching.AddBreakOrigin): Likewise.
475         (FlowBranching.AddContinueOrigin): Likewise.
476         (FlowBranching.AddReturnOrigin): Likewise.
477         (FlowBranching.StealFinallyClauses): Likewise.
478         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
479         (FlowBranching.CheckOutParameters): Likewise.
480         (FlowBranchingToplevel): Terminate all the above recursions here.
481         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
482         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
483
484         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
485         toplevel block.
486         (FlowBranchingToplevel): New.  Empty for now.
487         (FlowBranching.MergeTopBlock): Update.
488         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
489         branching for the anonymous delegate.
490         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
491
492         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
493         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
494         information at the start of the merge.  Reorganize.
495
496 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
497
498         * class.cs (MethodData.Define): Method cannot implement interface accessor.
499
500 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
501
502         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
503         to newly introduced ctor.
504
505         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
506         message to one place.
507         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
508         global namespace.
509
510 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
511
512         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
513
514         * ecore.cs (Expression.ResolveAsConstant): Updated.
515
516         * statement.cs (ResolveMeta): Updated.
517
518 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
519
520         * cs-parser.jay: __arglist cannot be used in initializer.
521
522 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
523
524         A fix for #77879
525         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
526         private types.
527
528 2006-05-05  Raja R Harinath  <rharinath@novell.com>
529
530         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
531         (LabeledStatement): Add 'name' parameter.
532         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
533         (Block.AddLabel): Update to changes.
534         * cs-parser.jay (labeled_statement): Likewise.
535
536         * flowanalysis.cs (BranchingType.Labeled): New.
537         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
538         (FlowBranchingLabeled): New.  Does nothing for now, but will
539         eventually handle 'goto' flows.
540         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
541         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
542         that's terminated ...
543         (Block.Resolve): ... here.
544
545         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
546         (UsageVector.MergeFinallyOrigins): Likewise.
547         (FlowBranching.InTryOrCatch): Likewise.
548         (FlowBranching.AddFinallyVector): Likewise.
549         (FlowBranchingException): Update to changes.
550
551         Fix #78290
552         * statement.cs (Return.Resolve): Move error checking to ...
553         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
554         (FlowBranchingException): Handle return origins like break and
555         continue origins.
556         (FlowBranching.UsageVector.CheckOutParameters): Remove.
557
558 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
559
560         A fix for #76122
561         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
562         filter.
563
564 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
565
566         A fix for #77543
567         * class.cs (MethodData.Define): Do public accessor check only when method
568         implements an interface.
569
570 2006-05-04  Raja R Harinath  <rharinath@novell.com>
571
572         Remove special handling of 'break'
573         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
574         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
575         (UsageVector.Break): Remove.
576         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
577         reachability.
578         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
579
580         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
581         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
582
583 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
584
585         A fix for #75726
586         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
587         be the interface member.
588
589 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
590
591         A fix for #60069
592         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
593         for emitting small (int) values.
594
595 2006-05-03  Raja R Harinath  <rharinath@novell.com>
596
597         Fix #59427
598         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
599         control-flow passes through the 'finally' after merging-in all the
600         control-flows from 'try' and the 'catch' clauses.
601
602         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
603         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
604         always true at the only non-recursive entry point.
605         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
606         FlowBranchingBreakable.
607         (FlowBranchingLoop): Remove.
608         * statement.cs (Return.DoResolve): Update to changes.
609
610         Fix #76471, #76665
611         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
612         (FlowBranching.CreateBranching): Handle it: create a
613         FlowBranchingContinuable.
614         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
615         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
616         except that it handles the 'continue' command.
617         (FlowBranching.UsageVector.MergeOrigins): Rename from
618         MergeBreakOrigins.
619         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
620         except that it overrides AddContinueOrigin.
621         (FlowBranchingException): Override AddContinueOrigin, similar to
622         AddBreakOrigin.
623         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
624         Create a new branching around the embedded statement.
625         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
626         control flow after the embedded statement.
627         (Continue.Resolve): Move all error checking to AddContinueOrigin.
628
629         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
630         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
631         FlowBranchingBreakable.
632         (FlowBranchingSwitch): Remove.
633
634         Fix test-503.cs
635         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
636         error reporting to ...
637         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
638         Rename from 'AddBreakVector'.  Add new location argument.  Return
639         a bool indicating whether the 'break' crosses an unwind-protect.
640         (FlowBranchingException.AddBreakOrigin): Add.
641         (FlowBranchingException.Merge): Propagate 'break's to surrounding
642         flowbranching after updating with the effects of the 'finally'
643         clause.
644         (FlowBranchingBreakable): New common base class for
645         FlowBranchingLoop and FlowBranchingSwitch.
646
647         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
648         embedded statement.
649         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
650
651 2006-05-02  Raja R Harinath  <rharinath@novell.com>
652
653         * statement.cs (Do.Resolve): If the loop is infinite, set the
654         barrier.
655         (While.Resolve, For.Resolve): Set a barrier after the embedded
656         statement.  There's no direct control flow that goes from the end
657         of the embedded statement to the end of the loop.
658         * flowanalysis.cs (FlowBranching.Infinite): Remove.
659         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
660         above ensure that the reachability is correctly computed.
661
662         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
663         (UsageVector.MergeBreakOrigins): If the current path is
664         unreachable, treat it as if all parameters/locals are initialized.
665         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
666         infinite loops before merging-in break origins.
667
668         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
669         (Reachability.Reachable): Split part into ...
670         (Reachability.Unreachable): ... this.  Simplify.
671         (Reachability.IsUnreachable): Use 'Unreachable' instead.
672
673         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
674         (Reachability.SetThrowsSometimes): Likewise.
675         (FlowBranchingBlock.MergeTopBlock): Don't compare against
676         TriState.Always, use corresponding property.
677         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
678         (Block.Resolve): Likewise.  Remove some redundant checks.
679
680 2006-05-02  Raja R Harinath  <harinath@gmail.com>
681
682         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
683         (Reachability.Meet): Don't bother checking AlwaysThrows --
684         barrier is always set.
685         (FlowBranchingBlock.Merge): Likewise.
686
687 2006-05-01  Raja R Harinath  <harinath@gmail.com>
688
689         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
690         checks for unreachable.
691
692 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
693
694         A fix for #77980
695         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
696
697         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
698         whether field is really assigned.
699
700 2006-04-30  Raja R Harinath  <harinath@gmail.com>
701
702         * flowanalysis.cs (Reachability): Make 4-argument constructor
703         private.
704         (Reachability.Meet): Rename from 'And'.  Remove static variant.
705         (Reachability.Always): Rename from the highly misleading
706         'Reachability.Never'.
707         (FlowBranching.Merge): Update to changes.  Mark an impossible
708         situation with a 'throw'.
709         (*): Update to changes.
710
711 2006-04-29  Raja R Harinath  <harinath@gmail.com>
712
713         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
714         Remove 'Undefined'.
715         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
716         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
717         (*): Update to changes.
718         * statement.cs: Update to changes.
719
720 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
721
722         A fix for #78049
723         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
724
725 2006-04-28  Raja R Harinath  <harinath@gmail.com>
726
727         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
728         dummy UsageVector.
729
730         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
731         argument to two arguments: an usage-vector and a bool.  Move call
732         to FlowBranching.Merge () ...
733         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
734
735         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
736         handling of loop and switch reachability to ...
737         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
738
739 2006-04-27  Raja R Harinath  <harinath@gmail.com>
740
741         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
742         handling to FlowBranchingLoop.InLoop.
743         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
744
745 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
746
747         A fix for #78115
748         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
749         anonymous method is allowed from AnonymousContainer here.
750
751         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
752
753 2006-04-24  Raja R Harinath  <rharinath@novell.com>
754
755         Fix #78156
756         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
757
758 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
759
760         A fix for #49011.
761         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
762         (DoubleConstant.Reduce): Ditto.
763
764 2006-04-23  Raja R Harinath  <rharinath@novell.com>
765
766         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
767         Remove 'lvalue_right_side' argument.  Move parts to ...
768         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
769         (LocalVariable.DoResolveLValue): ... these.
770
771 2006-04-21  Raja R Harinath  <rharinath@novell.com>
772
773         Fix cs1655.cs
774         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
775         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
776         (LocalVariableReference.DoResolveBase): Use it to implement new
777         CS1655 check.
778         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
779         (Argument.Resolve): Simplify.  Move CS1510 check ...
780         * ecore.cs (Expression.ResolveLValue): ... here.
781         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
782         (PropertyExpr.DoResolveLValue): Likewise.
783         (FieldExpr.Report_AssignToReadonly): Likewise.
784         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
785         LValueMemberAccess or LValueMemberOutAccess on instance depending
786         on it.
787         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
788         DoResolve as appropriate.
789
790 2006-04-20  Raja R Harinath  <rharinath@novell.com>
791
792         Fix #75800
793         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
794         implicit conversions on 'out' and 'ref' arguments.
795
796         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
797         improve clarity.  Remove dead code.
798
799         Fix #66031
800         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
801         (Catch.Resolve): Resolve VarBlock if it exists.
802
803 2006-04-19  Miguel de Icaza  <miguel@novell.com>
804
805         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
806         twice, this was some residual code, the enumerator was emitted
807         properly in the two branche of if later.
808
809 2006-04-19  Raja R Harinath  <rharinath@novell.com>
810
811         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
812         cast is never an lvalue.
813         (Cast.DoResolve, Cast.ResolveRest): Combine.
814         (Argument.Emit): Simplify slightly.  Move 'Expr is
815         IMemoryLocation' check ...
816         (Argument.Resolve): ... here.
817         (Argument.Error_LValueRequired): Remove.  Inline into only user.
818
819         Simplifications.  Fix cs0191-2.cs
820         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
821         CS1649 and CS1651 to ...
822         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
823         the actual selection of the error code and message to a lookup
824         table.  Add a dummy return value to simplify callsites.
825         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
826         readonly fields of other instances of the same type.  Move CS0197
827         warning from ...
828         * expression.cs (Argument.Resolve): ... here.  Simplify code.
829         Ensure that ec.InRefOutArgumentResolving is only set during LValue
830         resolution of an out or ref argument.  The code simplification
831         above uses this invariant.
832
833 2006-04-18  Raja R Harinath  <rharinath@novell.com>
834
835         Possibly fix #77752.  Fix cs1690-[4-7].cs.
836         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
837         CheckMarshallByRefAccess.  Drop parameter.
838         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
839         warning.
840         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
841         InstanceExpression.
842         * report.cs (AllWarnings): Add CS1690.
843         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
844         for ref access too.
845         (LocalVariableReference.DoResolveBase): Update.
846
847 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
848
849         * class.cs (MethodOrOperator): Moved common parts from method class.
850         detect obsolete attributes.
851         (Method.Define): Simplified as it reuses code from base.
852         (Constructor.ValidAttributeTargets): Fixed issue found during
853         refactoring.
854         (Destructor.ValidAttributeTargets): Fixed issue found during
855         refactoring.
856         (Operator): Finished refactoring set off by #78020. Operator class is now
857         ordinary method class.
858
859         * anonymous.cs: Updated.
860
861         * decl.cs (DeclSpace): Add IsGeneric
862
863 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
864
865         * class.cs (Constructor.Emit): Don't emit the attributes twice.
866
867 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
868
869         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
870         detect obsolete attributes.
871         (Method.CreateEmitContext): Moved to MethodOrOperator.
872
873 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
874
875         A fix for #78048.
876         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
877         customized exception to make crash detection easier.
878         (MethodOrOperator): Started to work on new base class for methods and
879         operators.
880         (Method): Derives from MethodOrOperator.
881         (Constructor.Emit): Emits its own attributes.
882         (AbstractPropertyEventMethod.Emit): Ditto.
883         (Operator): Derives from MethodOrOperator, will refactor fully in extra
884         patch.
885         (Operator.Emit): It's temporary more tricky than should be.
886         
887         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
888
889         * report.cs (InternalErrorException): Add ctor with inner exception.
890
891 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
892
893         A fix for #76744.
894         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
895         only not visible.
896
897 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
898
899         A fix for #77916.
900         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
901         array.
902
903 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
904
905         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
906         attribute is present and Guid not.
907         (Interface.ApplyAttributeBuilder): Ditto.
908
909         * attribute.cs: Add error message.
910
911 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
912
913         A fix for #78020.
914
915         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
916         sources (it's composite) so hold them in extra array as they are used in
917         Emit phase only. It worked in the previous versions by mistake.
918         (Attribute.Emit): Emit attribute for more owners when exist.
919
920         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
921         it has now different behaviour.
922
923 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
924
925         * constant.cs (Constant.IsDefaultInitializer): New method.
926
927         * class.cs: Updated.
928
929         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
930         re-initialize default values. It saves KBs almost for every assembly.
931         Thanks Zoltan for the idea.
932         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
933         (ArrayCreation.DoResolve): Resolve only once.
934         (ArrayCreation.Emit): Emit static initializer only when it is faster.
935         (ArrayCreation.GetAttributableValue): Cope with optimized values.
936
937 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
938
939         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
940         From #77961.
941
942 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
943
944         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
945         in an embedded statement too.
946
947 2006-04-01  Raja R Harinath  <rharinath@novell.com>
948
949         Fix #77958
950         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
951
952 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
953
954         A fix for #77966.
955
956         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
957         was not specified.
958
959         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
960
961 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
962
963         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
964         phase.
965
966         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
967         LocalTemporary change.
968
969         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
970         TypeContainer.
971         (ClassOrStruct.DefineFieldInitializers): Implemented static field
972         initializers optimization.
973         (ClassOrStruct.TypeAttr): Moved from modifiers.
974         (Constructor.CheckBase): Don't crash when static ctor has parameters.
975         (FieldBase.ResolveInitializer): Resolves initializer.
976         (FieldBase.HasDefaultInitializer): New property.
977
978         * cs-parser.jay: Removed message.
979
980         * expression.cs (CompilerGeneratedThis): New specialization.
981
982         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
983
984 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
985
986         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
987
988 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
989
990         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
991         be now EnumConstants only.
992
993 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
994
995         * attribute.cs, driver.cs: Reset more caches.
996
997 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
998
999         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1000
1001 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1002
1003         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1004         for easier reuse. Updated all overrides.
1005         (IntegralConstant): New base class for all integral constants.
1006         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1007         of the constant range, report custom error.
1008         (UIntConstant.Reduce): Fixed uint conversion.
1009
1010         * ecore.cs, literal.cs: Reduce updates.
1011
1012 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1013
1014         A fix for #75813.
1015
1016         * class.cs (Constructor.Define): Removed extra if for default ctors.
1017         A patch from Atsushi Enomoto.
1018
1019 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1020
1021         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1022         GetAttributableValue.
1023
1024         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1025         when required.
1026
1027         * convert.cs (ImplicitConversionRequired): Error message moved to
1028         DoubleLiteral.
1029
1030         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1031         automatic implicit conversion of an output value.
1032         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1033
1034         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1035         conversion.
1036         (TypeOf.GetAttributableValue): Add extra handling for object type.
1037
1038         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1039         special error message.
1040
1041 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1042
1043         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1044         InternalCall.
1045         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1046         compatible with MS runtime.
1047
1048 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1049
1050         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1051         attribute arguments here.
1052
1053         * class.cs (Indexer.Define): The check was moved to attribute class.
1054
1055 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
1056
1057         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1058         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1059         easier.
1060
1061 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1062
1063         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1064         mcs to keep code differences small.
1065         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1066         * typemanager.cs (parameter_default_value_attribute_type): New.
1067         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1068         CS1908 check.
1069
1070 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1071
1072         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1073
1074 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1075
1076         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1077
1078         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1079         the blocks too.
1080
1081 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1082
1083         * doc-bootstrap.cs : fix build.
1084
1085 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1086
1087         * expression.cs (StringConcat.Append): Issue a warning when empty string
1088         is going to append.
1089
1090 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1091
1092         * assign.cs (CompoundAssign.ResolveSource): Removed.
1093
1094         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1095         clean up.
1096
1097         * class.cs (TypeContainer.FindMethods): Removed.
1098         (TypeContainer.CheckMemberUsage): Made static.
1099
1100         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1101
1102         * constant.cs (CheckRange): Removed unused type argument.
1103         (CheckUnsigned): Removed unused type argument.
1104
1105         * cs-parser.jay: Updated after MemberAccess clean up.
1106         Uses Length for empty string test.
1107
1108         * cs-tokenizer.cs: Uses Length for empty string test.
1109         (IsCastToken): Made static.
1110         (is_hex): Made static.
1111         (real_type_suffix): Made static.
1112
1113         * decl.cs (SetupCache): Made static.
1114         (OnGenerateDocComment): Removed unused ds argument.
1115
1116         * delegate.cs (VerifyDelegate): Removed unused argument.
1117
1118         * doc.cs: Uses Length for empty string test.
1119
1120         * driver.cs: Uses Length for empty string test.
1121
1122         * enum.cs (IsValidEnumType): Made static
1123
1124         * expression.cs (EnumLiftUp): Removed unused argument.
1125         (ResolveMethodGroup): Ditto.
1126         (BetterConversion): Ditto.
1127         (GetVarargsTypes): Ditto.
1128         (UpdateIndices): Ditto.
1129         (ValidateInitializers): Ditto.
1130         (MemberAccess.ctor): Ditto.
1131         (GetIndexersForType): Ditto.
1132
1133         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1134
1135         * iterators.cs: Updated after MemberAccess clean up.
1136
1137         * location.cs: Uses Length for empty string test.
1138
1139         * namespace.cs: Uses Length for empty string test.
1140
1141          * report.cs (CheckWarningCode): Made static.
1142
1143         * statement.cs (LabeledStatement): Removed unused argument.
1144
1145         * typemanager.cs (FilterNone): Removed.
1146
1147 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1148
1149         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1150         obsolete.
1151
1152         * class.cs: Updated.
1153
1154 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1155
1156         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1157
1158 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1159
1160         A fix for #77822.
1161
1162         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1163         reporting, it's more tricky than I thought.
1164
1165 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1166
1167         A fix for #77816.
1168
1169         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1170         host container.
1171         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1172         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1173         Add more error reporting; Fixed issue with params.
1174
1175         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1176
1177         * cs-parser.jay: AnonymousMethod requires host container.
1178
1179         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1180
1181 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1182
1183         * class.cs: Change 'TypeContainer ds' constructor argument to
1184         'DeclSpace parent'.  Some classes were missed below due to
1185         different naming convention.
1186
1187         * class.cs (MemberCore.Parent): Delete.  This makes the
1188         ParentContainer changes below enforceable by the compiler.
1189
1190         Treat pointers to enclosing declaration space as 'DeclSpace', not
1191         'TypeContainer'.
1192         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1193         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1194
1195         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1196         of TypeContainer.
1197         (Block.AddThisVariable): Likewise.
1198         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1199         (AbstractPropertyEventMethod.Emit): Likewise.
1200         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1201         (GetMethod.Define, SetMethod.Define): Likewise.
1202         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1203         (DelegateMethod.EmitMethod): Likewise.
1204
1205         Fix regression test-partial-13.cs.
1206         Rationalize use of PartialContainer.  Ensure that the partial
1207         class semantics can be tied to type-correctness, i.e., any
1208         violation will cause a compile error.
1209         * class.cs, const.cs: Access all fields that belong to class
1210         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1211         Resolve()-like functions still use 'Parent'.
1212
1213         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1214         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1215         (PropertyMethod.CheckModifiers): Remove unused argument.
1216         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1217         DeclSpace.
1218
1219 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1220
1221         Make semantics of PartialContainer simpler.
1222         * decl.cs (DeclSpace.IsPartial): Remove.
1223         * class.cs (TypeContainer.IsPartial): Likewise.
1224         (TypeContainer..ctor): Set PartialContainer to point to self.
1225         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1226         (TypeContainer.FindNestedType): Likewise.
1227         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1228
1229 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1230
1231         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1232
1233 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1234
1235         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1236         classes.
1237
1238 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1239
1240         * class.cs (Operator.Define): An error for base conversion was not
1241         reported correctly.
1242
1243 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1244
1245         * iterator.cs : yield break is allowed in try statement which has
1246           catch clauses. Fixed bug #77767.
1247
1248 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1249
1250         A fix for #77593, #77574.
1251
1252         * class.cs (MethodCore.CheckBase): Another if for operator.
1253
1254 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1255
1256         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1257         were not resolved
1258
1259         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1260         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1261         conversion test.
1262         
1263         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1264         not needed.
1265
1266         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1267         Updated after another emitcontext usage was clean up. It should help us to
1268         synchronize with gmcs easier.
1269
1270 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1271
1272         A fix for #77353.
1273
1274         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1275         (Event.Define): ditto
1276         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1277
1278         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1279         Removed redundant code and set NewSlot for Invoke method too.
1280
1281         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1282         (Parameters.MergeGenerated): New method. Use this method when you merge
1283         compiler generated argument with user arguments.
1284
1285 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1286
1287         * attribute.cs (ResolveAsTypeTerminal): Removed.
1288
1289         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1290         specialization for predefined types; 30% speed up.
1291         Finally placed obsolete check to right place.
1292         (Expression.ResolveType): Removed.
1293
1294         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1295         Updated after ResolveType was removed.
1296
1297         * expression.cs (Cast.ctor): Check void cast.
1298         (Binary.ResolveAsTypeTerminal): Is never type.
1299         (Conditional.ResolveAsTypeTerminal): Is never type.
1300
1301         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1302
1303 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1304
1305         Fix #77679.
1306         * expression.cs (ParameterReference.DoResolveBase): Change return
1307         type to bool.
1308         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1309         Update.
1310
1311         Fix #77628.
1312         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1313
1314         Fix #77642.
1315         * typemanager.cs (GetFullNameSignature): Don't nullref on
1316         protected accessors.
1317
1318 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1319
1320         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1321         these two separated members to simplify the code.
1322         (Attribute.Resolve): Refactored to use new fields and methods.
1323         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1324         implemented obsolete attribute checking.
1325         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1326         implemented obsolete checking again. It look line never ending quest ;-)
1327         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1328
1329         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1330
1331         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1332
1333         *class.cs (Property.Define): Add RegisterProperty call.
1334
1335         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1336         argument groups (only 2).
1337
1338         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1339         encoding expression to arguments.
1340         (Expression.ExprClassToResolveFlags): Just turned to property.
1341
1342         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1343         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1344         optimized as well as implemented support for zero-length attributes.
1345
1346         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1347         Add caching of PropertyInfo's.
1348
1349 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1350
1351         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1352         error multiple times.
1353
1354 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1355
1356         New partial class implementation.
1357         A fix for #77027, #77029, #77403
1358
1359         * attribute.cs (Attributable): Made attributes protected.
1360
1361         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1362         the replacements of ClassPart and PartialContainer.
1363         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1364         (TypeContainer.AddInterface): Ditto.
1365         (TypeContainer.AddPartial): The main method for partial classes. It checks
1366         for errors and merges ModFlags and attributes. At the end class is added to
1367         partial_parts list.
1368         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1369         required here.
1370         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1371         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1372         from the rest of partial classes.
1373         (TypeContainer.GetClassBases): Simplified.
1374         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1375         DefineType.
1376         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1377         (TypeContainer.HasExplicitLayout): Uses Flags now.
1378         (PartialContainer): Removed.
1379         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1380         (StaticClass): Was merged with Class.
1381         (Class.GetClassBases): class and static class bases are verified here.
1382         (Class.TypeAttr): Added static attributes when class is static.
1383         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1384         (MemberBase): In some cases we need to call parent container for partial
1385         class. It should be eliminated but it's not easy now.
1386
1387         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1388
1389         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1390         partial classed to accumulate class comments.
1391         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1392
1393         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1394
1395         * driver.cs (MainDriver): Tree.GetDecl was removed.
1396
1397         * modifiers.cs (Modifiers): Add partial modifier.
1398
1399         * tree.cs (Tree.decl): Removed.
1400         (RootTypes): Started to use this class more often for root types
1401         specializations.
1402
1403 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1404
1405         A fix for #77615
1406
1407         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1408         external interface does not have an attribute.
1409
1410 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1411
1412         Another prerequisites for new partial classs implementation.
1413         
1414         * attribute.cs (Attribute.Equal): Implemented.
1415         (Attribute.Emit): Changed as attributes can be applied more than twice.
1416         (Attributes.Emit): Check for duplicate attributes here.
1417
1418         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1419         as a parameter, clean-up.
1420
1421 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1422
1423         A fix for #77485
1424
1425         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1426         contains obsolete attribute check which can in some cases look for base
1427         type of current class which is not initialized yet.
1428         (TypeContainer.BaseType): Replacement of ptype.
1429
1430         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1431
1432 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1433
1434         First of prerequisites for new partial classs implemention.
1435         
1436         * attribute.cs (Attributable): Extended by ResolveContext;
1437         Attributes finally have correct context for resolving in all cases.
1438         (AttachTo): Attribute owner is assigned here.
1439
1440         * codegen.cs (IResolveContext): Introduce new interface to hold
1441         all information needed in resolving phase.
1442         (EmitContext): Implements IResolveContext; more clean-up needed here.
1443         
1444         * decl.cs (MemberCore): Implemented IResolveContext.
1445
1446         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1447         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1448         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1449         Refactored to use new IResolveContext instead of EmitContext; cleanup
1450
1451 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1452
1453         * codegen.cs (EmitScopeInitFromBlock): check here the
1454         capture_context, there is no need to make two calls to the
1455         EmitContext. 
1456
1457         * anonymous.cs: Add some debugging messages that might help me
1458         track other instances of this problem in the future (the
1459         regression of test 467).
1460
1461         * cs-parser.jay: track the variable block, as we need to initalize
1462         any captured variables declared in this block for the "catch"
1463         portion of the "Try" statement.
1464
1465         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1466         scope initialization for captured variables. 
1467
1468         Also, move the emit for the variables after the block location has
1469         been marked.
1470
1471 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1472
1473         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1474
1475 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1476
1477         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1478         commit yesterday, the initialization for the roots is necessary.
1479         What is not necessary is the scope activation.
1480
1481 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1482
1483         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1484         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1485         CS0206 checks.
1486         (Argument.Resolve): Remove CS0206 checks.
1487
1488 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1489
1490         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1491         scopes for all the roots, the scopes will now be emitted when the
1492         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
1493
1494         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1495         code.  This reduces a lot of existing cruft.
1496         
1497         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1498         that the ScopeInfo is generated as we enter the scope, not at the
1499         time of use, which is what we used to do before.
1500
1501         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1502         every time a Block is about to be emitted if we have a
1503         CaptureContext. 
1504
1505 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1506
1507         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1508         (Reset): Update.
1509         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1510
1511         * typemanager.cs (cons_param_array_attribute): Make private.
1512         (Reset): Set it to null.
1513         (InitCoreHelpers): Don't initialize it.
1514         (ConsParamArrayAttribute): New.  Initialize it as needed.
1515         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1516
1517 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1518
1519         * expression.cs: There might be errors reported during the
1520         selection of applicable methods.  If there are errors, do not
1521         continue execution as it will lead the compiler to crash.
1522
1523 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1524
1525         * expression.cs: Member access is not allowed on anonymous
1526         methods.  Fixes #77402.
1527
1528 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1529
1530         Fix #77401
1531         * cs-parser.jay (VariableDeclaration): Don't set
1532         current_array_type to null.
1533         (field_declaration, event_declaration, declaration_statement):
1534         Set it to null here.
1535
1536 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1537
1538         * typemanager.cs (GenericParameterPosition): New.
1539         * doc.cs: Use it.
1540
1541 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1542
1543         * doc.cs : To process "include" elements, first we should create
1544           another list than XmlNodeList, because it could result in node
1545           removal, which could result in that the XmlNodeList gives up
1546           yielding next node.
1547
1548           (Also made code identical to gmcs again.)
1549
1550 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1551
1552         * ecore.cs: Introduce an error report that we were not catching
1553         before, if not silent, we must report the error.  Gonzalo ran into
1554         it.
1555
1556 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1557
1558         A fix for bug: #76957
1559         
1560         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1561         ComputeMethodHost before creating the method, this is a new
1562         requirement. 
1563
1564         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1565         that this method references (RegisterScope).  The actual scope
1566         where the method is hosted is computed with the ComputeMethodHost
1567         before we create the method.
1568
1569         Moved the Deepest routine here.
1570
1571         (AnonymousContainer.ComputeMethodHost): New routine used to
1572         compute the proper ScopeInfo that will host the anonymous method.
1573
1574         (ScopeInfo): Deal with multiple roots.  The problem was that we
1575         did not have a unique root where all ScopeInfos could be hanged
1576         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1577         of roots.  
1578
1579         Remove AdjustMethodScope which is now computed at the end.  Remove
1580         LinkScope which did a partial link, instead link all ScopeInfos
1581         before code generation from the new "LinkScopes" routine. 
1582
1583         Simplify all the Add* routines as they no longer need to maintain
1584         the tree, they just need to record that they are using variables
1585         from a ScopeInfo.
1586
1587         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1588         routines to produce the forest of ScopeInfo trees.
1589
1590         * class.cs (TypeContainer.AppendMethod): This is just like
1591         AddMethod, but ensures that an interface implementation method
1592         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1593         methods, but at the end.
1594
1595         We use this functionality to ensure that the generated MoveNext
1596         method in the iterator class is resolved/emitted before the
1597         enumerator methods created.   
1598
1599         This is required because the MoveNext method computes the right
1600         ScopeInfo for the method.  And the other methods will eventually
1601         need to resolve and fetch information computed from the anonymous
1602         method. 
1603
1604 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1605             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1606
1607         Fix rest of #76995.
1608         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1609         the 'aliases' hash.
1610         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1611         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1612
1613 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1614
1615         Fix #76656, cs0231-2.cs.
1616         * cs-parser.jay (formal_parameter_list): Make error case catch
1617         more issues.
1618         (parenthesized_expression_0): Add CS1026 check.
1619         (invocation_expression): Remove unused { $$ = lexer.Location }.
1620
1621 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1622
1623         Fix #76824.
1624         * cs-parser.jay (statement_expression): Don't list out the
1625         individual statement-expressions.  Convert syntax error into
1626         CS0201 check.
1627
1628 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1629
1630         Fix #76874.
1631         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1632         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1633         CheckIntermediateModification.
1634         (FieldExpr.DoResolve): Add new two-argument version that
1635         allows us to resolve the InstanceExpression as an lvalue.
1636         The one-argument variant is now just a wrapper.
1637         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1638         Resolve the lhs as an lvalue if the it has a value type.
1639         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1640         from Assign.DoResolve.
1641         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1642         resolved as an lvalue.
1643         (PropertyExpr.DoResolve): Update.
1644         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1645         has a value type.  Move CS1612 check here from
1646         CheckIntermediateModification.
1647         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1648         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1649         'right_side' of a ResolveLValue on an 'out' argument.
1650         (EmptyExpression.LValueMemberAccess): New.  Used as the
1651         'right_side' of a propagated ResolveLValue on a value type.
1652         (LocalVariableReference.DoResolveBase): Recognize
1653         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1654         Add CS1654 check.
1655         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1656         EmptyExpression.Null.
1657
1658 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1659
1660         * typemanager.cs : added IsGenericParameter(). In mcs it always
1661           return false.
1662         * doc.cs : for generic parameters, use GenericParameterPosition,
1663           not FullName.
1664
1665 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1666
1667         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1668
1669 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1670
1671         This fixes the problem where we used ldfld instead of ldflda to
1672         load the "THIS" pointer on captured parameters, when THIS is a
1673         value type.  See bug #77205.
1674         
1675         * iterators.cs (CapturedThisReference.Emit): Pass false to
1676         EmitThis (we do not need the address).
1677
1678         * codegen.cs (EmitThis): it needs to know whether we need the
1679         address of `this' or not.  This is used by value types.  
1680
1681         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1682         every other call passes false.
1683
1684 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1685
1686         Fix #77221.
1687         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1688         GetOverride.
1689         * expression.cs (Invocation.OverloadResolve): Update.
1690         (Invocation.DoResolve): Avoid double resolution of invocation.
1691
1692 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1693
1694         Fix #77180.
1695         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1696         unary negation of floating point types as 0-expr; negation cannot
1697         overflow in floating point types.
1698
1699         Fix #77204.
1700         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1701         on operands of 'void' type.
1702
1703         Fix #77200.
1704         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1705         and ExclusiveOr for boolean constants too.
1706
1707 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1708
1709         Fix #75636.
1710         * expression.cs (Invocation.OverloadResolve): Replace reflected
1711         override methods with their base virtual methods, rather than
1712         skipping over them.
1713         * typemanager.cs (TypeManager.GetOverride): New.
1714
1715 2006-01-05  Jb Evain  <jbevain@gmail.com>
1716
1717         * class.cs (Property.Define, Indexer.Define): do not tag the
1718         properties as SpecialName | RTSpecialName.
1719
1720 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1721
1722         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1723         doing a low-level comparission of parameter types.  It was lacking
1724         a check for __argslist. 
1725
1726 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1727
1728         * expression.cs (ParameterReference.DoResolveBase): Allow
1729         reference parameters if they are local to this block. 
1730
1731         This allows the ref and out parameters of a delegate to be used in
1732         an anonymous method, for example:
1733
1734         delegate void set (out int x);
1735
1736         set s = delegate (out int x){
1737                 x = 0;
1738         };
1739
1740         This is used by functionality introduced late in the C# language.
1741         
1742         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1743         method that take ref and out parameters. 
1744
1745         Fixes #77119 which was a late change in the spec.
1746
1747 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1748
1749         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1750         parent if its the same scope.  Fixes #77060.
1751
1752 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1753
1754         * driver.cs: Report the case of no source files and no -out:
1755         argument provided.
1756
1757 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1758
1759         Fix #77035.
1760         * expression.cs (ComposedCast.GetSignatureForError): Define.
1761
1762 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1763
1764         Fix #76995
1765
1766         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1767         ListDictionary, to contain the ExternAliasEntry entries (in
1768         addition to the NamespaceEntry.aliases hashtable). This field is
1769         shared between the original entry and its doppelganger (bodyless 
1770         copy of it).
1771         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1772         extern_aliases field.
1773         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1774         lookup in extern_aliases.
1775
1776 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1777
1778         Fix #77006.
1779         * class.cs (TypeContainer.Mark_HasEquals): New.
1780         (TypeContainer.Mark_HasGetHashCode): New.
1781         (ClassPart): Override them.
1782         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1783
1784         Fix #77008.
1785         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1786         'parent' argument to the base constructor.
1787
1788         Remove all mention of TypeContainer from decl.cs.
1789         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1790         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1791         (DeclSpace.DeclSpace): Likewise.
1792         (DeclSpace.DefineMembers): Remove unused argument.
1793         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1794         debugging check -- we don't care if the debug code throws an
1795         InvalidCastException instead of an InternalErrorException.
1796         * class.cs (TypeContainer.DefineMembers): Update to changes.
1797         (TypeContainer.DoDefineMembers): Likewise.
1798         (TypeContainer.GetMethods): Likewise.
1799         (PropertyMember.Define): Likewise.
1800         (MemberBase.Parent): New property that forwards to
1801         MemberCore.Parent, but ensures that we get a TypeContainer.
1802         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1803         (RootContext.PopulateTypes): Likewise.  Remove special case code
1804         for !RootContext.StdLib: DefineMembers is idempotent.
1805
1806 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1807
1808         * convert.cs (ExplicitConversionCore): Check the return value from
1809         ExplicitConversionCore which can return null on failure.  Fixes #76914
1810
1811 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1812
1813         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1814
1815 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1816
1817         * doc.cs : The search for referenced namespace was insufficient to
1818           get global one as it used to do. Fixed bug #76965.
1819
1820 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1821
1822         * doc.cs : check name in cref in the last phase that whether it is
1823           namespace or not.
1824
1825 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1826
1827         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1828           Mono.C5.
1829
1830 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1831
1832         * doc.cs : so it turned out that we cannot skip override check for 
1833           interface members. Fixed bug #76954.
1834
1835 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1836
1837         * cs-tokenizer.cs : fixed bug #75984:
1838           - #warning and #error should not be handled when the source line
1839             is disabled.
1840           - #line is not checked strictly when the source line is disabled.
1841           - #define and #undef is on the other hand checked strictly at any
1842             state.
1843
1844 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1845
1846         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1847           CS1027 report.
1848
1849 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1850
1851         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1852
1853         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1854         event initializers.
1855         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1856         (FieldBase.Initializer): Initializer is now optional.
1857         (EventField.Define): Only event field can have initializer.
1858
1859         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1860
1861         * const.cs (Const): Reuse initializer.
1862
1863         * cs-parser.jay: Updated after FieldBase changes.
1864         Added current_array_type to simplify array initializers.
1865
1866         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1867
1868         * expression.cs, iterators.cs: Updated.
1869
1870         * namespace.cs (NamespaceEntry): Made UsingFound private.
1871
1872 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1873
1874         * parameterCollection.cs: Obsolete, removed.
1875         * parser.cs: Obsolete, removed.
1876
1877 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1878
1879         Fix #76849.
1880         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1881
1882         * enum.cs (Enum.Define): Set obsolete context here.
1883
1884 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1885
1886         * doc.cs :
1887           - FindDocumentedMember() now expects 1) paramList as null
1888             when "we don't have to check the number of parameters" and
1889             2) Type.EmptyTypes when "there is no arguments".
1890           - Introduced FoundMember struct to hold the exact type which was
1891             used to find the documented member (the above change broke
1892             test-xml-044; it might be better just to use DeclaringType than
1893             what MS does, like this change does, but it depends on usage.)
1894
1895 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1896
1897         * doc.cs : documented member might be from DeclaringType for nested
1898           types. Fixed bug #76782.
1899
1900 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1901
1902         * anonymous.cs: Have the param code handle leaving copies on the
1903         stack etc. Allows anonymous params to take part in the assignment
1904         code (++, +=, etc). Fixes bug #76550
1905
1906         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1907         it down to the anon code.
1908
1909         * iterators.cs: Use dummy var here
1910
1911         * codegen.cs: Handle new vars
1912
1913 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1914
1915         Fix #76849.
1916         * class.cs (MethodData.Define): Set proper Obsolete context.
1917
1918         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1919         obsolete context.
1920         (FieldExpr.DoResolve): Ditto.
1921
1922 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1923
1924         Fix #76849.
1925         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1926         parent is not obsolete.
1927
1928 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1929
1930         * doc.cs : (FindDocumentedMember) find parameterless members first
1931           and get CS0419 in the early stage. Fixed first case of bug #76727.
1932
1933 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1934
1935         Fix #76859.
1936         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1937         no error was reported.
1938
1939         *expression.cs (Binary.DoResolve): left can be null.
1940
1941 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1942
1943         Fix #76783.
1944         * class.cs (MethodData.Emit): Parameters should be labeled first.
1945
1946 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1947
1948         Fix #76761.
1949         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1950
1951 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1952
1953         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1954
1955         * class.cs (MethodCore): Parameter clean up.
1956         (IMethodData): Added ParameterInfo.
1957         (MethodData): Parameter clean up.
1958         (Indexer.Define): Parameter clean up.
1959
1960         * anonymous.cs,
1961         * codegen.cs,
1962         * cs-parser.jay,
1963         * decl.cs,
1964         * doc.cs,
1965         * ecore.cs,
1966         * flowanalysis.cs,
1967         * iterators.cs,
1968         * pending.cs,
1969         * statement.cs,
1970         * typemanager.cs: Parameter clean up.
1971
1972         * delegate.cs (Define): Get rid of duplicated code.
1973
1974         * expression.cs (ParameterReference): Removed useless parameters
1975         and simplified.
1976         (Invocation): Ditto.
1977
1978         * parameter.cs (ParamsParameter): New class, params specialization.
1979         (ArglistParameter): Attemp to separate arglist.
1980         (Parameter): Refactored to be reusable and faster.
1981         (Parameter.Modifier): Made understandable.
1982         (Parameters): Changed to be used as a class for `this' assembly
1983         parameters. Refactored to use new specialized classes.
1984
1985         * support.cs (ParameterData): Added Types property.
1986         (InternalParameters): Deleted.
1987
1988 2005-08-20  Martin Baulig  <martin@ximian.com>
1989
1990         Merging this patch from GMCS to fix #75867.
1991
1992         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1993         scope if we don't already have it.
1994
1995 2005-11-17  Martin Baulig  <martin@ximian.com>
1996
1997         * anonymous.cs
1998         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1999         inherit the scope from our parent.  Fixes #76653.
2000
2001 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2002
2003         * doc.cs : the previous patch does not actually fix the bug.
2004           PropertyInfo override check is now implemented and really fixed it.
2005         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2006
2007 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2008
2009         * doc.cs : apply "override filter" also to properties.
2010           Fixed bug #76730.
2011
2012 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2013
2014         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2015           no need to check overrides. For classes, omit those results from 
2016           interfaces since they must exist in the class. Fixed bug #76726.
2017
2018 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2019
2020         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2021           with different parameters. Fixed the second problem in #76685.
2022
2023 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2024
2025         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2026           get expected 'protected' access in CheckValidFamilyAccess()).
2027           Fixed bug #76692.
2028
2029 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2030
2031         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2032           Fixed bug #76705.  CS1569 was incorrectly commented out.
2033
2034 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2035
2036         * doc.cs : use Invocation.IsOverride() to do real override check.
2037         * expression.cs : made Invocation.IsOverride() internal.
2038
2039 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2040
2041         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2042           TypeBuilder.FindMembers() and filter overriden base members out.
2043           Fixed bug #76990.
2044
2045 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2046
2047         * doc.cs : ref/out parameters are represented as '@' (instead of
2048           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2049
2050 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2051
2052         * doc.cs : when there was no '.' in cref to methods in doc comment,
2053           then parameters were missing in the output. Fixed bug #76691.
2054
2055 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2056
2057         * driver.cs : don't output docs when there is an error.
2058           Fixed bug #76693.
2059
2060 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2061
2062         * doc.cs :
2063           Now it should detect indexers. Fixed primary concern in bug #76685.
2064           Fixed CS0419 message to not show the identical member signature in
2065           the message.
2066
2067 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2068
2069         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2070           instead of Type.FindMembers() since it does not handle events.
2071           Fixed bug #71604.
2072
2073 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2074
2075         * codegen.cs: Fixed typo (speficied -> specified).
2076
2077 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2078
2079         Fix #76369.
2080         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2081
2082 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2083
2084         * attribute.cs: Changed error message.
2085
2086         * cs-tokenizer.cs: One more check.
2087
2088 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2089
2090         * statement.cs (Block.Resolve): Ignore empty statement.
2091
2092 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2093
2094         * report.cs: Made error/warning methods more strict to avoid
2095         their misuse.
2096
2097         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2098         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2099         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2100         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2101
2102 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2103
2104         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2105         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2106
2107         * class.cs (TypeContainer.IsComImport): New property.
2108         (Constructor.Define): Create proper ctor for ComImport types.
2109
2110         * expression.cs (New.CheckComImport): Fixed.
2111
2112 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2113
2114         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2115         that a parameter has been captured does not mean that we do not
2116         have to do the rest of the processing.  This fixes the second part
2117         of #76592.  If there was another anonymous method capturing
2118         values in the past, the Scope would never be set for the second
2119         method that captured the same parameter.
2120
2121         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2122         properly manipulate the stack.   Second part of fix for #76592.
2123
2124         * expression.cs (New): Add support for invoking "new" on
2125         interfaces that have been flagged with the ComImport attribute and
2126         the CoClass.  Fixes #76637 
2127
2128         * statement.cs (Try.DoEmit): When a variable is captured, do not
2129         try to emit the vi.LocalBuilder variable as it has been captured.
2130         Create a temporary variable and store the results on the
2131         FieldBuilder.  Fixes #76642
2132
2133 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2134
2135         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2136
2137         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2138
2139         * expression.cs (Binary.DoResolve): Added && optimalization.
2140     
2141         * typemanager.cs (AddUserType): Removed useless argument.
2142
2143 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2144
2145         * statement.cs (Block.variables): Uses ListDictionary.
2146
2147 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2148
2149         Fix #75969.
2150         * class.cs (PartialContainer.EmitType): Customized to emit
2151         security attributes.
2152         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2153         for partial classes.
2154
2155 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2156
2157         Fix #76599.
2158         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2159         access has to be fixed.
2160         
2161         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2162
2163 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2164
2165         Fix #76590.
2166         * ecore.cs (NullCast.Reduce): Implemented.
2167
2168         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2169         constant type.
2170         
2171         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2172         properly.
2173         (Foreach.Resolve): Catch null properly.
2174
2175 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2176  
2177         * cs-tokenizer.cs: Warning text fix.
2178
2179         * driver.cs: AllWarningNumbers exposed on public interface.
2180
2181         * report.cs (): Reviewed warning numbers.
2182         (IsValidWarning): Use binary search.
2183
2184 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2185  
2186         * driver.cs: Implemeted resource visibility.
2187         (Resources): New class for code sharing between /res: and
2188         /linkres:
2189  
2190 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2191
2192         Fix #76568.
2193         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2194         folding.
2195         
2196         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2197         contants only.
2198         
2199         * ecore.cs (NullCast): Child is contant only.
2200         
2201         * literal.cs (NullLiteral.Reduce): null can be converted to any
2202         reference type.
2203
2204 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2205
2206         * driver.cs: Use Encoding.Default as default code page instead
2207           of ISO-28591.
2208
2209 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2210
2211         Fix #76085.
2212         * expression.cs (Invocation.Error_InvalidArguments): Handle
2213         __arglist parameters.
2214         (Invocation.VerifyArgumentsCompat): Likewise.
2215         * support.cs (ReflectionParameters.GetSignatureForError): Print
2216         __arglist parameters.
2217         (InternalParamters.GetSignatureForError): Likewise.
2218         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2219
2220 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2221
2222         * attribute.cs (GetPropertyValue): Made public.
2223
2224         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2225         Resolve.
2226         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2227         attribute.
2228         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2229         is not defined.
2230         
2231         * driver.cs: Reflect method name change.
2232         
2233         * statement.cs (Try.Resolve): Warn when try has both general
2234         exception handlers.
2235         
2236         * typemanager.cs: runtime_compatibility_attr_type new predefined
2237         type.
2238
2239 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2240
2241         Fix #76419.
2242         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2243         treat it as an empty parameter list.
2244
2245 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2246
2247         Fix #76271.     
2248         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2249         ResolveAsTypeStep silent.
2250         * statement.cs (Block.AddConstant): Mark block as used.
2251         (Block.ResolveMeta): Avoid piling on error messages
2252         if a constant initializer resolution fails.
2253
2254 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2255
2256         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2257         Remove.
2258         (NamespaceEntry.VerifyAllUsing): New.
2259         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2260         behaviour.  Delegates actual resolution of alias to ...
2261         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2262         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2263         Update.
2264         * driver.cs (Driver.MainDriver): Update.
2265         
2266         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2267         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2268         property.
2269         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2270         Remove.
2271         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2272         RootNamespace.DefineNamespacesForAll.
2273
2274 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2275
2276         * typemanager.cs (assemblies, external_aliases, modules)
2277         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2278         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2279         overhead.  Move resposibility ...
2280         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2281         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2282
2283 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2284
2285         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2286         cached_namespaces.  Improve usage.
2287         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2288         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2289         Move from GlobalRootNamespace and simplify.
2290         (RootNamespace.Global): Make instance variable.
2291         (RootNamespace.RootNamespace): Add "alias name" parameter.
2292         (GlobalRootNamespace): Simplify drastically.
2293         (Namespace.Lookup): Don't use GetNamespace.
2294         * typemanager.cs (GetRootNamespace): Rename from
2295         ComputeNamespaceForAlias.
2296         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2297
2298 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2299
2300         * anonymous.cs (AnonymousContainer): Don't crash when container
2301         doesn't exist.
2302
2303 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2304
2305         * expression.cs (Binary.DoResolve): Warn when comparing same
2306         values.
2307
2308 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2309
2310         Fix #76486.
2311         * expression.cs (Binary.DoResolve): It looks like there are no
2312         convetsion rules in enum context.
2313
2314 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2315
2316         Add support for extern alias qualifiers.
2317         * typemanager.cs: Move some LookupTypeReflection code
2318         to namespace.cs, to have cleaner code. Added some methods
2319         to help us keep track of the extern aliased references.
2320         * driver.cs: Add suport for extern alias assemblies on command
2321         line and check for their warnings/errors. Also keep track of the
2322         extern aliased assemblies.
2323         * namespace.cs: Move the global functionality of Namespace
2324         to GlobalRootNamespace/RootNamespace. Now the global namespace
2325         is GlobalRootNamespace.Globa. Also the code moved from 
2326         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2327         Finally added LocalAliasEntry (AliasEntry before) and
2328         ExternAliasEntry, to handle alias statements.
2329         * cs-parser.jay: Add support in the grammar for extern alias
2330         statement.
2331         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2332         Update callings to Namespace (now in GlobalRootNamespace).
2333
2334 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2335
2336         Fix #76371.
2337         * class.cs (TypeContainer.DefineType): Move updating of
2338         topological sort earlier in the code.
2339         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2340
2341 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2342
2343         Fix #76273.
2344         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2345         
2346         * constant.cs (Constant.TryReduce): Moved from Cast class.
2347         (Reduce): Made little bit more OO and fixed missing conversions.
2348         
2349         * ecore.cs (Reduce): Implemented.
2350         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2351         
2352         * literal.cs (Reduce): Implemented.
2353         
2354         * class.cs: Reverted Miguel's wrong commit.
2355
2356 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2357
2358         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2359
2360 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2361
2362         * cs-parser.jay, expression.cs : CS0214 was missing error location
2363           for constants. Fixed bug #76404.
2364
2365 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2366
2367         Fix #76370.
2368         * convert.cs (ExplicitConversionCore): Fixed object->enum
2369         conversion.
2370
2371 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2372
2373         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2374         InstanceExpression.
2375         (PropertyExpr.EmitCall): Likewise.
2376         * expression.cs (Invocation.EmitArguments): Handle case where
2377         arguments == null.
2378         (Invocation.EmitCall): Avoid allocating temporary variable if
2379         there are no arguments.
2380
2381 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2382
2383         Fix #76323.
2384         * convert.cs (ImplicitConversionStandard): Move conversion of
2385         void* to arbitrary pointer types ...
2386         (ExplicitConversionStandard): .. here.
2387         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2388         error to always print typenames.
2389
2390 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2391
2392         * convert.cs (GetConversionOperator): Rename from
2393         GetConversionOperators.  Move operator selection code from ...
2394         (UserDefinedConversion): ... here.
2395
2396 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2397
2398         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2399         conversion.
2400
2401 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2402
2403         * assign.cs (Assign.DoResolve): Error method changed.
2404
2405         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2406         
2407         * const.cs (ResolveValue): Reset in_transit immediately.
2408         
2409         * constant.cs: Error method changed.
2410         
2411         * convert.cs: Removed useless location parameter.
2412         (ExplicitNumericConversion): Don't do double enum check.
2413         (ExplicitConversionCore): Renamed from ExplicitConversion.
2414         (ExplicitUnsafe): Extracted from ExplicitConversion.
2415         (ExplicitConversion): Uses for error reporting.
2416         
2417         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2418         error messages.
2419         (ResolveBoolean): Uses common error method.
2420         (CastToDecimal): Get rid of ec.
2421         (CastFromDecimal): Optimized.
2422         (ConvCast): Get rid of ec.
2423         
2424         * enum.cs (ResolveValue): Reset in_transit immediately.
2425         (Emit): Return after first error.
2426         
2427         * expression.cs: Convert changes.
2428         
2429         * literal.cs: Error method changed.
2430         
2431         * statement.cs: Error method changed.
2432
2433 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2434
2435         * support.cs (SeekableStreamReader.Position): Don't error out when
2436         the requested position is just beyond the end of the current
2437         buffered data.
2438
2439 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2440
2441         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2442         try to keep in sync with the byte count of the underlying Stream.
2443         However, this limits us to a window size of 2048 characters: i.e.,
2444         the maximum lookahead of our lexer/parser can be 2048 characters.
2445
2446 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2447
2448         Fix #76255.
2449         * driver.cs: Fix compilation files with full root path.
2450
2451 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2452
2453         * report.cs (SymbolRelatedToPreviousError): Format the output so
2454         it does not use an open parenthesis that is never closed. 
2455
2456         * driver.cs: Follow coding guidelines
2457
2458 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2459
2460         Fix #72930.
2461         * const.cs (Const.ResolveValue): Check for assigning non-null
2462         value to reference type.
2463
2464 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2465
2466         * anonymous.cs: Implemented ExprClassName.
2467         
2468         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2469         delegate.
2470         
2471         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2472         check.
2473         
2474         * class.cs (StaticClass.DefineContainerMembers): Report protected
2475         members as error.
2476         
2477         * codegen.cs: if(ed) PRODUCTION.
2478         
2479         * convert.cs (Error_CannotImplicitConversion): Better error
2480         distinction.
2481         
2482         * cs-parser.jay: More error checks.
2483         
2484         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2485         
2486         * driver.cs (CSCParseOption): Enabled wrong option check.
2487         
2488         * ecore.cs (Expression.ExprClassName): Turned to property.
2489         (MemberExpr.CheckIntermediateModification): For checking boxed
2490         value types     modification.
2491         
2492         * statement.cs (Fixed.Resolve): Expression type must be
2493         convertible to fixed type.
2494         (CollectionForeach.GetEnumeratorFilter,TryType):
2495         Small refactoring for easier error checking.
2496
2497 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2498
2499         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2500         attributes.
2501         
2502         * class.cs (GeneratedBaseInitializer): New class for customization
2503         compiler generated initializers.
2504         (MemberBase.DoDefine): Check Obsolete attribute here.
2505         (FieldMember.DoDefine): Ditto.
2506         
2507         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2508         constants.
2509         
2510         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2511         (MemberCore.GetObsoleteAttribute): Removed argument.
2512         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2513         (MemberCore.CheckObsoleteType): New helper.
2514         
2515         * delegate.cs,
2516         * enum.cs,
2517         * statement.cs: Updates after MemberCore changes.
2518         
2519         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2520         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2521         
2522         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2523         obsolete attribute for compiler construct.
2524         (As.DoResolve): Cache result.
2525         
2526         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2527
2528 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2529
2530         Fix #76133.
2531         * expression.cs (This.VerifyFixed): In a value type T, the type of
2532         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2533         value type R, 'this' is treated as a value parameter.
2534
2535 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2536
2537         * statement.cs (Lock): Use the TemporaryVariable class instead of
2538         manually using local variables as those do not work when variables
2539         are captured.
2540
2541         * ecore.cs: Moved the TemporaryVariable class from being a nested
2542         class inside Foreach to be a public class that can be employed in
2543         other places. 
2544
2545 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2546
2547         * cs-parser.jay: interface_accessors replaced by
2548         accessor_declarations.
2549
2550         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2551         location.
2552         
2553         * statement.cs (GotoCase.Resolve): Convert null constant to
2554         null case.
2555         (SwitchLabel.ResolveAndReduce): Ditto.
2556         (SwitchLabel.NullStringCase): Custom null stamp.
2557         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2558         
2559         typemanager.cs (CSharpSignature): Don't skip first argument
2560         for full names.
2561
2562 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2563
2564         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2565
2566         * location.cs (InEmacs): in this mode, do not report column
2567         location as it confuses Emacs.
2568
2569 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2570
2571         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2572         expression.cs, iterators.cs, literal.cs: Store constants and
2573         literals location.
2574         
2575         * class.cs (MemberBase.ShortName): Pass location.
2576         
2577         * cs-parser.jay: Some location fixes.
2578         
2579         * ecore.cs (Expression.Location): Made virtual.
2580
2581 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2582
2583         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2584         if the underlying types are the same, otherwise we need to produce
2585         code that will do the proper cast.
2586
2587         This was exposed by Marek's constant rewrite which produced
2588         invalid code for the call site:
2589
2590         enum X : long { a }
2591         void Method (X v) {}
2592
2593         Method ((X) 5)
2594
2595         This fixes test-49.cs
2596
2597 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2598
2599         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2600           Type/Object should be allowed as well. Fixed bug #75968.
2601
2602 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2603
2604         * expression.cs : (Binary.DoResolve): when one is enum constant and
2605           another is constant 0, then return enum one *as enum type*.
2606           Fixed bug 74846.
2607
2608 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2609
2610         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2611         internal.
2612
2613         Fix #75941.
2614         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2615         flow-branching for LocalVariableReferences in case we were invoked
2616         from a MemberAccess.
2617         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2618         Carved out of ...
2619         (LocalVariableReference.DoResolveBase): ... this.
2620         (MemberAccess.Resolve): Do the check that was disabled during
2621         SimpleNameResolve.
2622
2623 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2624
2625         * class.cs :
2626           (PartialContainer.Create): check abstract/sealed/static strictly
2627           but abstract/sealed can exist only at one side. Fixed bug #75883.
2628
2629 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2630
2631         Fix #75945.
2632         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2633         specified, don't default to UnmanagedType.I4.
2634
2635 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2636
2637         * expression.cs : conditional operator should check possibly
2638           incorrect assign expression. Fixed bug #75946.
2639
2640 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2641
2642         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2643           Reverting the change. gmcs is much complex than mcs on this matter.
2644
2645 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2646
2647         * cs-tokenizer.cs : To read another token ahead of the actual 
2648           consumption, use new SavedToken and cache token instead of moving
2649           back the stream with SeekableStreamReader (it seemed problematic).
2650         * cs-parser.jay,
2651           driver.cs : Thus use StreamReader directly.
2652         * support.cs : Thus removed SeekableStreamReader.
2653
2654 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2655
2656         Fix #75934.
2657         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2658         (ScopeInfo.EmitScopeType): Use it to construct field names from
2659         names of captured locals.
2660
2661         Fix #75929.
2662         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2663         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2664         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2665         (ExplicitConversion): Remove enum cases already handled by
2666         implicit conversion.  Move implicit conversion check to the beginning.
2667         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2668         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2669         Don't treat System.Enum as a struct.
2670
2671 2005-08-30  Jb Evain  <jbevain@gmail.com>
2672
2673         * attribute.cs: handles as expression in parameters.
2674
2675 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2676
2677         Fix #75802.
2678         * class.cs (TypeContainer.VerifyClsName): Don't use a
2679         PartialContainer when verifying CLS compliance.
2680         (AbstractPropertyEventMethod): Set Parent here, ...
2681         (PropertyMethod): ... not here.
2682
2683 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2684
2685         * attribute.cs : escaped attribute name should not be allowed to be
2686           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2687
2688 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2689
2690         Fix #75927.
2691         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2692         when converting a long constant to unsigned long.
2693         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2694         detect where IsApplicable and VerifyArgumentsCompat disagree.
2695
2696 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2697         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2698
2699         Fix #75848.
2700         * class.cs (TypeContainer.CanElideInitializer): New helper.
2701         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2702         can safely emitting the initializer of a field.
2703
2704 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2705
2706         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2707           allowed inside a switch (without loop). Fixed bug #75433.
2708
2709 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2710
2711         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2712         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2713
2714 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2715
2716         * driver.cs : kinda reverting the default encoding changes (not exact 
2717           revert since I noticed that "codepage:reset" might not work fine).
2718
2719 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2720
2721         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2722           Location. Now getter and setter store location correctly.
2723           (errors/cs0111-12.cs now reports the expected location.)
2724
2725 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2726
2727         * driver.cs : Use default encoding on the environment.
2728           Removed (now that) extra parameter for SeekableStreamReader.
2729         * support.cs : (SeekableStreamReader) third .ctor() argument for
2730           StreamReader is not required (always true). preamble size could
2731           be acquired in simpler and safe way.
2732
2733 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2734
2735         * cs-parser.jay: report CS0642 at warning level 3
2736           and report CS0642 for an if else statement also
2737           fixes bug #74745. Patch by John Luke (and a bit
2738           modified by me).
2739           Removed extra CS0642 warning check for "while",
2740           "for" and "fixed".
2741         * statement.cs: In Block.Resolve(), CS0642 check
2742           is reimplemented to check a sequence of an empty
2743           statement and a block.
2744
2745           Both fix bug #66777.
2746
2747 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2748
2749         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2750         detection until I fix it.
2751         
2752         * cs-tokenizer.cs: Changed error message.
2753         
2754         * cs-parser.jay: Fixed 2 error locations.
2755         
2756         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2757         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2758         properties.
2759         
2760         * enum.cs (GetSignatureForError): Fixed.
2761         
2762         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2763         method detection.
2764         
2765         * class.cs,
2766         * typemanager.cs (RegisterProperty): Removed.
2767         
2768         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2769
2770 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2771
2772         Fix #75874.
2773         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2774         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2775
2776 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2777
2778         * expression.cs : tiny fix is required for not warning positive ulong.
2779           See test-441.cs.
2780
2781 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2782
2783         * expression.cs : add CS0652 check for constant and integral
2784           expression. Fixed bug #53974.
2785
2786 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2787
2788         * expression.cs : in DoNumericPromotions(), check if there is implicit
2789           conversion overload for string (to check CS0034). Fixed bug #52492.
2790
2791 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2792
2793         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2794
2795 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2796
2797         * ecore.cs : report location when it is *not* Null.
2798
2799 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2800
2801         * codegen.cs,
2802           ecore.cs,
2803           flowanalysis.cs,
2804           expression.cs:
2805           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2806           correctly. Fixed bug #75721.
2807
2808 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2809
2810         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2811         loop that performs 'min (pos, char_count)'.
2812
2813         Fix #75862.
2814         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2815         converted value in Operator.OnesComplement.
2816
2817 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2818
2819         * anonymous.cs: If the anon method is pulled into a helper class,
2820         it needs to be `internal' not `private'. Fixes runtime behavior on
2821         msft. bug #75704
2822
2823 2005-08-20  Martin Baulig  <martin@ximian.com>
2824
2825         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2826         scope if we don't already have it.
2827
2828         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2829         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2830         fixes #75867.
2831
2832 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2833
2834         Fix #75803
2835         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2836         is a partial class.
2837
2838 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2839
2840         The big constants rewrite
2841         Fix #75746, #75685 and more
2842         As a side effect saved 1MB for MWF ;-)
2843         
2844         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2845         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2846         enum based for corlib compilation.
2847         
2848         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2849         subtractions.
2850         
2851         * class.cs (FixedField.Define): Use ResolveAsConstant.
2852         
2853         * const.cs (IConstant): Interface constants and enums.
2854         (Const.ResolveValue): New method for constant resolvning.
2855         (ExternalConstant): Constants from imported assemblies.
2856         
2857         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2858         conversion; like enums.
2859         (Constant.ToType): Converts this constant to different type.
2860         (Constant.Increment): Adds 1.
2861         
2862         * convert.cs (ImplicitConversionRequired): Simplified.
2863         
2864         * cs-parser.jay: Create EnumMember directly.
2865         
2866         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2867         
2868         * doc.cs (GenerateEnumDocComment): Removed.
2869         
2870         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2871         (ConvertIntLiteral): Removed.
2872         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2873         
2874         * enum.cs (EnumMember): Implement IConstant.
2875         (Enum.IsValidEnumConstant): Removed.
2876         (Enum.GetNextDefaultValue): Removed.
2877         (Enum.FindMembers): Updated.
2878         (Enum.GenerateDocComment): Iterate enum members.
2879         
2880         * expression.cs (Cast.TryReduce): Handle enums correctly.
2881         (New.Constantify): Made public.
2882         (MemberAccess.DoResolve): Removed contant specific if(s).
2883         
2884         * literal.cs (NullLiteral): Implement new abstract methods.
2885         
2886         * statement.cs (GotoCase.Resolve): Use new constant methods.
2887         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2888         
2889         * typemanager.cs (LookupEnum): Removed.
2890         (IsEnumType): Fixed to work with corlib.
2891         (RegisterConstant): Removed.
2892         (LookupConstant): Removed.
2893         (GetConstant): Changed to work with IConstant.
2894
2895 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2896
2897         * location.cs : Fixed overflown (>255) column number.
2898
2899 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2900
2901         First cut of the qualified-alias-member feature.
2902         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2903         token.
2904         * cs-parser.jay (DOUBLE_COLON): New token.
2905         (namespace_or_type_name): Add rule for recognizing
2906         qualified-alias-members.
2907         (primary_expression): Likewise.
2908         (element_access): Allow QualifiedAliasMember as a possible
2909         type-bearing expression.
2910         (local_variable_type, local_variable_pointer_type): Likewise.
2911         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2912         aliases in the current and enclosing namespace declarations.
2913         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2914         * decl.cs (MemberName.is_double_colon): New.
2915         (MemberName.MemberName): Add new constructor for alias-member.
2916         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2917         * expression.cs (QualifiedAliasMember): New expression type.
2918
2919 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2920
2921         * location.cs : it borked when no argument was specified.
2922
2923 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2924
2925         * location.cs : tiny ToString() format fix.
2926
2927 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2928
2929         * statement.cs : oops, it was missing.
2930
2931 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2932
2933         A set of fixes for precise line/column location.
2934
2935         * location.cs :
2936           "token" field now holds a file/line "delta", a line number offset 
2937           from the segment, and a column number. See also:
2938           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2939           December/009508.html
2940           Removed static IsNull. Use instance IsNull property instead.
2941         * cs-tokenizer.cs :
2942           For some tokens it stores Location. For Identifier it stores
2943           LocatedToken which is a pair of string name and location.
2944           Column numbers are adjusted only at getChar().
2945         * report.cs :
2946           Use Location.ToString() for reporting (it now contains column).
2947         * cs-parser.jay :
2948           Largely modified to use LocatedToken instead of
2949           string (IDENTIFIER), and to acquire Location from some tokens.
2950         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2951           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2952           codegen.cs :
2953           Now MemberName holds Location. DeclSpace.ctor() receives Location
2954           as a parameter. Removed extra parameters to all derived classes.
2955           Replaced Location.IsNull() with instance property.
2956         * assign.cs, expression.cs :
2957           Added .ctor() overload that omits Location.
2958         * attribute.cs :
2959           Added "nameEscaped" flag that indicates the identifier was escaped
2960           in the source file. This fixes bug #57047.
2961
2962 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2963
2964         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2965         New method, looking for lo-case imported cls type.
2966
2967         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2968         here.
2969
2970         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2971
2972         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2973
2974         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2975         all_imported_types.
2976         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2977
2978         Optimized to save 3.5 MB for SWF compilation.
2979
2980 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2981
2982         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2983         (PartialContainer.Create): Moved logic AddToContainer.
2984         (PartialContainer.MarkForDuplicationCheck): Shares name.
2985         
2986         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2987         place.
2988         
2989         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2990         initialization.
2991         (Namespace.GetSignatureForError): New method.
2992         
2993         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2994         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2995
2996 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2997
2998         Fix #75669.
2999         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3000         member lookup rather than qualifier_type, since qualifier_type can
3001         be null.
3002
3003 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3004
3005         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3006         enum member.
3007
3008 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3009
3010         * statement.cs: Copy the local exception into the exception
3011         captured local.  Fixes 75674
3012
3013 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3014
3015         Fix #75658.
3016         * expression.cs (Invocation.OverloadResolve): Don't report error
3017         CS1501 if error CS1502 has been reported.
3018         (New.DoResolve): Delegate CS1501 reporting to
3019         Invocation.OverloadResolve.
3020
3021         Fix #75656.
3022         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3023         invariant-meaning-in-block property in an enclosing block if
3024         necessary.
3025
3026 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3027
3028         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3029         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3030         (Switch.CheckSwitch): Just save 50kb for SWF.
3031
3032 2005-07-27  Martin Baulig  <martin@ximian.com>
3033
3034         * anonymous.cs (CaptureContext.AddField): Added
3035         `AnonymousContainer am' argument; compute its toplevel scope if
3036         it's not already computed.  Fixes #75649.
3037
3038 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3039
3040         Fix #75628.
3041         * class.cs (Constructor.Emit): Reset block to null if the block
3042         resolve fails.
3043
3044 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3045
3046         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3047
3048 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3049
3050         * class.cs (MethodData.Define): Check whether accessor implementing
3051         interface is public.
3052
3053         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3054
3055 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3056
3057         Fix #57245
3058         * namespace.cs (LookupType): Moved same type check to...
3059         
3060         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3061         with the same name.
3062
3063 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3064
3065         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3066         already found a typebuilder.
3067         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3068         MemberNames, not strings.
3069
3070         * const.cs (Error_ExpressionMustBeConst): 
3071         Rename from Error_EpressionMustBeConst.
3072         * const.cs, class.cs, statement.cd: Update.
3073
3074 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3075
3076         Fix #65573
3077
3078         * const.cs (Const.LookupConstantValue): Report missing contant expression
3079         everytime.
3080         (Error_EpressionMustBeConstant): Only one error method.
3081
3082         * class.cs, statement.c: Updated.
3083
3084 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3085
3086         * statement.cs (Block.Flags): Add back HasVarargs.
3087         (Block.flags): Make protected.
3088         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3089
3090         * typemanager.cs (types, typecontainers, user_types): Remove.
3091         (UserTypes, TypeContainers): Likewise.
3092         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3093         (CleanUp, Reset): Update.
3094         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3095         (GetNestedType): Use Type.GetNestedType.
3096         (CoreLookupType): Take two arguments, the namespace and the
3097         basename of the type.  Update to use the Namespace.Lookup
3098         mechanism.
3099         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3100         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3101         string concatenation and substring matches.
3102         * class.cs, enum.cs, delegate.cs: Update to changes.
3103
3104 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3105
3106         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3107         Expression and made virtual.
3108
3109         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3110         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3111
3112         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3113
3114         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3115         error message.
3116
3117         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3118         change.
3119
3120 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3121
3122         Fix #57707
3123         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3124         AssemblyCultureAttribute is not used on executable.
3125
3126         * rootcontext.cs,
3127         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3128
3129 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3130
3131         Fix #60638.
3132         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3133         New.  Reports CS0252/CS0253.
3134         Mostly taken from preliminary patch by Duncak Mak.
3135         (Binary.DoResolveOperator): Store results of operator lookup.
3136         Use them to detect if we need to warn about unintended reference
3137         comparisons.
3138
3139 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3140
3141         Fix #72969.
3142         * namespace.cs (Namespace.Lookup): Add back location parameter.
3143         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3144         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3145
3146         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3147         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3148         (Namespace.LookupType): ... this.
3149         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3150         of namespaces.
3151         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3152         purported to handle pointers.
3153         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3154         CoreLookupType.
3155
3156 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3157
3158         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3159         type as namespace.
3160
3161 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3162
3163         * namespace.cs (Namespace.Lookup): Drop location parameter.
3164         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3165         (NamespaceEntry.Lookup): ... this.
3166         (NamespaceEntry.Error_AmbiguousTypeReference):
3167         Move here from DeclSpace.
3168         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3169         names ...
3170         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3171         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3172         Move to NamespaceEntry.
3173         * delegate.cs, expression.cs: Update to changes.
3174
3175 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3176
3177         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3178         CheckAttributeType and refactored.
3179         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3180         ResolveAsTypeTerminal error handling.
3181         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3182         handling.
3183         (GetSignatureForError): Print errors in same way.
3184
3185         * class.cs,
3186         * codegen.cs: Reflect attribute GetSignatureForError change.
3187
3188         * ecore.cs,
3189         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3190
3191         * namespace.cs (UsingEntry): Refactored to make fields private.
3192
3193         * assign.cs,
3194         statement.cs: Error_UnexpectedKind has extra parameter.
3195
3196 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3197
3198         * ecore.cs (IAlias): Remove.
3199         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3200         that implement the interface.
3201         * namespace.cs (Namespace): Likewise.
3202         (Namespace.declspaces): Renamed from 'defined_names'.
3203         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3204         DeclSpace instead of an IAlias.
3205         * tree.cs (Tree.AddDecl): Update.
3206
3207 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3208
3209         * statement.cs (Block.Flags); Remove HasVarargs.
3210         (Block.HasVarargs): Move to ToplevelBlock.
3211         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3212         (Block.Variables): Make protected.  Initialize variable hashtable
3213         if necessary.
3214         (Block.AddVariable): Update.
3215         (Block.Resolve): Update to changes.
3216         (ToplevelBlock.HasVarargs): New boolean.
3217         (ToplevelBlock.ThisVariable): Move here from Block.
3218         (ToplevelBlock.AddThisVariable): Likewise.
3219         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3220         * expression.cs (This.ResolveBase): Update to changes.
3221         (ArglistAccess.DoResolve): Likewise.
3222
3223 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3224
3225         Fix #75321
3226         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3227
3228         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3229         not used and not used & assigned.
3230         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3231
3232 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3233
3234         Fix #75053
3235         * expression.cs (Is.DoResolve): null is never provided type.
3236
3237 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3238
3239         Fix #52496
3240         * cs-parser.jay: Less strict event error rule to catch more errors.
3241
3242 2005-07-08  Martin Baulig  <martin@ximian.com>
3243
3244         Fix test-iter-10.cs - distinguish whether we `yield' in a property
3245         gettter (allowed) or setter (not allowed).
3246
3247         * class.cs (Accessor): Implement IIteratorContainer.
3248         (Accessor.Yields): New public field.
3249         (PropertyBase.PropertyMethod.Define): Handle iterators on a
3250         per-accessor basis.
3251
3252         * cs-parser.jay
3253         (get_accessor_declaration, set_accessor_declaration): Set the
3254         `yields' flag on the accessor, not the property.
3255         (property_declaration): Do the iterators check on a per-accessor
3256         basis and not for the whole property.
3257
3258 2005-07-08  Martin Baulig  <martin@ximian.com>
3259
3260         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3261         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3262
3263 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3264
3265         Fix #74975
3266         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3267         (ExtractSecurityPermissionSet): Cope with self referencing security
3268         attributes properly.
3269
3270         * driver.cs (SetOutputFile): Made public property OutputFile.
3271
3272 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3273
3274         Fix #75486.
3275         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3276         has_nonstatic_fields.  Make into a FieldBase pointer.
3277         (TypeContainer.AddField): Add CS0282 check.
3278         (TypeContainer.EmitType): Update.
3279
3280 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3281
3282         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3283         compare if they start with __.
3284
3285 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3286
3287         * statement.cs (Switch.SwitchGoverningType): Only look at
3288         UserCasts that don't need implicit standard conversions to one of
3289         the allowed switch types (Fixes test-322.cs).
3290         (LocalInfo.Resolve): Re-enable sanity-test.
3291
3292 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3293
3294         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3295         
3296         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3297         
3298         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3299
3300 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3301
3302         Fix #75472.
3303         * ecore.cs (SimpleName.GetSignatureForError): Add.
3304         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3305         (MemberAccess.GetSignatureForError): Add.
3306
3307 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3308  
3309         The big error and warning messages review.
3310         
3311         * anonymous.cs,
3312         * assign.cs,
3313         * attribute.cs,
3314         * class.cs,
3315         * codegen.cs,
3316         * convert.cs,
3317         * cs-parser.jay,
3318         * cs-tokenizer.cs,
3319         * decl.cs,
3320         * delegate.cs,
3321         * doc.cs,
3322         * driver.cs,
3323         * ecore.cs,
3324         * enum.cs,
3325         * expression.cs,
3326         * flowanalysis.cs,
3327         * iterators.cs,
3328         * literal.cs,
3329         * location.cs,
3330         * modifiers.cs,
3331         * namespace.cs,
3332         * parameter.cs,
3333         * pending.cs,
3334         * report.cs,
3335         * rootcontext.cs,
3336         * statement.cs,
3337         * support.cs,
3338         * tree.cs,
3339         * typemanager.cs: Updated.
3340         
3341         * class.cs: (MethodCore.SetYields): Moved here to share.
3342         (PropertyMethod.Define): Moved iterator setup here.
3343         
3344         * iterators.cs: Add orig_method to have full access to parent
3345         container.
3346
3347 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3348
3349         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3350         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3351         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3352         variable of struct type.
3353         * expression.cs (Unary.ResolveOperator): Update to change.
3354         (Indirection.VerifyFixed): Likewise.
3355         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3356         (ParameterReference.VerifyFixed): Value parameters are fixed.
3357         (This.VerifyFixed): Treat 'this' as a value parameter.
3358         * statement.cs (LocalInfo.IsFixed): Remove.
3359
3360 2005-07-01  Martin Baulig  <martin@ximian.com>
3361
3362         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3363         `ec.EmitThis ()' to get the correct scope.
3364
3365 2005-07-01  Martin Baulig  <martin@ximian.com>
3366
3367         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3368         instance is a ParameterReference; fixes #75299.
3369
3370 2005-07-01  Martin Baulig  <martin@ximian.com>
3371
3372         Reverted Marek's latest patch (r46725):
3373         - it contains structural changes which are neither mentioned in
3374           the ChangeLog nor explained anywhere; for example the additional
3375           argument of EmitContext's and Iterator's .ctor's and the
3376           TypeContainer.DefineMembers() change.
3377         - structural changes like this should go in in seperate patches
3378           and not be hidden in a huge patch which just seems to affect
3379           warnings and errors.
3380           a big and hard to understand patch.
3381         - it breaks iterators and causes regressions, for instance in
3382           test-iter-03.cs.      
3383
3384 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3385
3386         Fix #75412.
3387         * expression.cs (Indexers.map): Remove.
3388         (Indexers.Append): Filter out inaccessible setters and getters.
3389         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3390
3391         Fix #75283.
3392         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3393         Refactored from ...
3394         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3395         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3396         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3397         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3398
3399 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3400
3401         Fix #75322
3402         * class.cs (FieldBase.GetInitializerExpression): One more field
3403         for backup.
3404
3405 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3406
3407         * pending.cs: Do not define a proxy if the base method is virtual,
3408         it will be picked up by the runtime (bug 75270).
3409
3410 2005-06-08  Martin Baulig  <martin@ximian.com>
3411
3412         The big Iterators rewrite :-)
3413
3414         * iterators.cs: Rewrite this to use the anonymous methods framework.
3415
3416         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3417         before the TypeContainers; see 2test-21.cs.
3418
3419         * class.cs
3420         (TypeContainer.DefineType): Don't create a new EmitContext if we
3421         already have one (this only happens if we're an Iterator).
3422         (TypeContainer.Define): Also call Define() on all our iterators.
3423         (Method.CreateEmitContext): Added support for iterators.
3424
3425         * anonymous.cs
3426         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3427         (AnonymousContainer.CreateMethodHost): Moved here from
3428         AnonymousMethod and made abstract.
3429         (AnonymousContainer.CreateScopeType): New abstract method.
3430         (AnonymousContainer.IsIterator): New public property.
3431         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3432         get the ScopeTypeBuilder rather than manually defining it here. 
3433         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3434         iterators here.
3435
3436         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3437         before RootContext.DefineTypes().
3438
3439         * codegen.cs (EmitContext.RemapToProxy): Removed.
3440         (EmitContext.CurrentAnonymousMethod): Changed type from
3441         AnonymousMethod -> AnonymousContainer.
3442         (EmitContext.ResolveTopBlock): Protect from being called twice.
3443         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3444         (EmitContext.EmitThis): Removed the iterators hacks; use the
3445         anonymous methods framework for that.
3446
3447         * statement.cs
3448         (ToplevelBlock.Container): Make this a property, not a field.
3449         (ToplevelBlock.ReParent): New public method; move the
3450         ToplevelBlock into a new container.
3451         (Foreach.TemporaryVariable): Simplify.
3452
3453 2005-06-05  Martin Baulig  <martin@ximian.com>
3454
3455         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3456         (Block.AddTemporaryVariable): New public method; creates a new
3457         `LocalInfo' for a temporary variable.
3458         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3459         variables here.
3460         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3461         non-iterator variables.
3462
3463 2005-06-05  Martin Baulig  <martin@ximian.com>
3464
3465         * statement.cs (Foreach.TemporaryVariable): Create the
3466         LocalBuilder in the Emit phase and not in Resolve since in some
3467         situations, we don't have an ILGenerator during Resolve; see
3468         2test-19.cs for an example.
3469
3470 2005-06-04  Martin Baulig  <martin@ximian.com>
3471
3472         **** Merged r45395 from GCS ****
3473
3474         The big Foreach rewrite - Part II.
3475
3476         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3477         with `PropertyInfo ienumerator_getcurrent'.
3478
3479         * codegen.cs (VariableStorage): Removed.
3480
3481         * statement.cs
3482         (Foreach): Derive from Statement, not ExceptionStatement.
3483         (Foreach.CollectionForeach): New nested class.  Moved all the code
3484         dealing with collection foreach here.
3485         (Foreach.ForeachHelperMethods): Removed.
3486         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3487
3488 2005-05-23  Martin Baulig  <martin@ximian.com>
3489
3490         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3491         don't need to.  Fix #75014.
3492
3493 2005-05-20  Martin Baulig  <martin@ximian.com>
3494
3495         Merged r44808 from GMCS.
3496
3497         * class.cs (TypeContainer.CircularDepException): Removed.
3498         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3499         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3500         (CS0146) and interface (CS0529) dependencies here.
3501
3502 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3503
3504         * expression.cs (Invocation.EmitCall): Fix initialization
3505         'this_call' to reflect current behaviour.  Fix indentation.
3506
3507         * convert.cs (FindMostEncompassedType): Add two trivial special
3508         cases (number_of_types == 0 || number_of_types == 1).
3509         (FindMostEncompasingType): Likewise.
3510
3511 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3512
3513         Some cleanups preparing for the fix of #75283.
3514         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3515         error testing.
3516         (EventExpr.InstanceResolve): Likewise.
3517         (EventExpr.DoResolve): Remove redundant checks.
3518
3519 2005-06-10  Duncan Mak  <duncan@novell.com>
3520
3521         * cs-tokenizer.cs (process_directives): New flag for controlling
3522         the processing of preprocessor directives.
3523         (x_token): After seeing a '#', return Token.NONE instead of going
3524         to handle_preprocessing_directive() when not processing
3525         directives. This avoids unnecessary processing during the token peek in
3526         is_punct().
3527
3528         This fixes #74939.
3529
3530         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3531         the existing error reporting methods instead of Report.Error.
3532
3533         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3534         after Raja's rewrite.
3535
3536 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3537
3538         * class.cs: Small fix.
3539
3540 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3541
3542         Fix #75160.
3543         * class.cs (GetPartialBases): Fix return value check of
3544         part.GetClassBases.
3545
3546 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3547
3548         Ensure that partial classes are registered in their enclosing
3549         namespace.  Initial part of fix of #75160.
3550         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3551         Register declspace with namespace here, not in
3552         DeclSpace.RecordDecl.
3553         * cs-parser.jay: Pass namespace to RecordDecl.
3554         * class.cs (PartialContainer.Create): Likewise.
3555         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3556         called.
3557         * decl.cs (Declspace.RecordDecl): Remove.
3558         * namespace.cs (NamespaceEntry.DefineName): Remove.
3559
3560 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3561
3562         * rootcontext.cs: Reset TargetExt as well.
3563
3564 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3565
3566         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3567         -langversion:ISO-1.
3568
3569 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3570
3571         Fix #75080, cs0119.cs.
3572         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3573         of ...
3574         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3575         allowing ExprClass.Type and ExprClass.Namespace for
3576         ResolveFlags.VariableOrValue.
3577         (Expression.Resolve) [1-argument variant]: Change default resolve
3578         flags based on language version.
3579         (Expression.Error_UnexpectedKind): Use a simple string array
3580         rather than an ArrayList.
3581         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3582         not ExprClass.Type.
3583         (TypeOfVoid.DoResolve): Likewise.
3584         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3585         flags argument -- it always has the same value.
3586
3587 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3588
3589         Fix #75081.
3590         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3591         Use it in the error message.
3592         * assign.cs, expression.cs, statement.cs: Update.
3593
3594 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3595
3596         Fix #75088.
3597         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3598         the "almostMatchedMember" case too.
3599         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3600         that failed the accessibility checks to 'almost_match'.
3601
3602 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3603
3604         * attribute.cs: Use internal MethodBuilder methods to set
3605         ExactSpelling and SetLastError on PInvoke methods, instead
3606         of passing them via charset.  Fixes #75060.
3607
3608 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3609
3610         * parameter.cs (Parameter): Remove TODO comment.
3611         (Parameter.DefineParameter): Remove Location parameter.
3612         (Parameters.LabelParameters): Likewise.
3613         * class.cs (Constructor.Emit): Update to change.
3614         (MethodData.Emit): Likewise.
3615         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3616         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3617
3618 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3619
3620         * parameter.cs,
3621           Removed Parameters.Location and added Parameter.Location instead.
3622           Removed Location parameter from Emit() and GetSignature().
3623         * anonymous.cs,
3624           class.cs,
3625           cs-parser.jay,
3626           delegate.cs,
3627           iterators.cs,
3628           statement.cs :
3629           Modified all related calls.
3630
3631 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3632
3633         Improve user-defined conversion handling.
3634         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3635         applicable operators.
3636         (AddConversionOperators): New.  Helper for GetConversionOperators.
3637         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3638         there is only one most encompassed/encompassing type.
3639         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3640         "applicable operator" handling.
3641         (UserConversion): Move cache here from GetConversionOperators.
3642         Directly cache the chosen operator, rather than the whole
3643         MethodGroup.
3644         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3645         case.  Allow conversion of decimal to sbyte and byte too.
3646         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3647         New static methods.  Used to avoid allocating EmptyExpressions in
3648         convert.cs.
3649
3650 2005-05-24  Duncan Mak  <duncan@novell.com>
3651
3652         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3653         another class, used in Convert.ExplicitNumericConversion.
3654         (CastToDecimal): New class, similar to above, but casts to
3655         System.Decimal, used in Convert.ImplicitNumericConversion and also
3656         in explicit convesion from double/float to decimal.
3657
3658         * convert.cs (ImplicitNumericConversion): Handle implicit
3659         conversions to System.Decimal.
3660         (ExplicitNumericConversion): handle explicit conversions to
3661         System.Decimal.
3662
3663         This fixes #68711.
3664         
3665 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3666
3667         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3668         know the type at this stage, just break through.   Fixes #75008 
3669
3670 2005-05-19  Martin Baulig  <martin@ximian.com>
3671
3672         * delegate.cs
3673         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3674         to disable error reporting.
3675
3676         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3677         here since we don't want to report an error; see the new test-336.cs.
3678
3679 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3680
3681         * statement.cs (ToplevelBlock.GetParameterReference)
3682         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3683         Move here from class Block.
3684         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3685         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3686
3687 2005-05-18  Martin Baulig  <martin@ximian.com>
3688
3689         Fix #74978.
3690
3691         * flowanalysis.cs
3692         (FlowBranching.Reachability): Add non-static public And() and Or()
3693         methods.
3694         (FlowBranchingSwitch): New class; do the `break_origins' thing
3695         like in FlowBranchingLoop.
3696         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3697         reachability, not just locals and parameters.
3698         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3699         switch; MergeBreakOrigins() now takes care of that.
3700
3701 2005-05-18  Martin Baulig  <martin@ximian.com>
3702
3703         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3704         a loop and may leave it, reset the barrier; fixes #74974.
3705
3706 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3707         
3708         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3709         is back.
3710         
3711         * cs-parser.jay: Catch more lexical errors.
3712         
3713         * report.cs: Add one more Error method.
3714         
3715         * rootcontext.cs,
3716         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3717
3718 2005-05-17  Martin Baulig  <martin@ximian.com>
3719
3720         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3721         #70970. 
3722
3723 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3724
3725         Fix test-382.cs.  Emit values of decimal constants.
3726         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3727         Carved out of ...
3728         (TypeContainer.AddField): ... this.
3729         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3730         with initializers to include 'Const's.
3731         (ClassPart.RegisterFieldForInitialization): Forward to
3732         PartialContainer.
3733         * const.cs (Const.Const): Pass initializer to base class.
3734         (Const.Define): In case of decimal constants, register them for
3735         initialization in a static constructor.
3736
3737 2005-05-14  Martin Baulig  <martin@ximian.com>
3738
3739         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3740         do not call ResolveUnreachable() on unreachable statements in
3741         here, see the comment in the source code.
3742
3743 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3744
3745         Fix #74934.
3746         * expression.cs (BinaryResolveOperator): If one of the operands of
3747         an equality comparison is 'null' and the other is a pointer type,
3748         convert the null to a NullPointer.
3749         * convert.cs (ImplicitReferenceConversion): If the expression is a
3750         NullLiteral and the target type is a pointer type, return a
3751         NullPointer instead.
3752         (ImplicitConversionStandard): Likewise.
3753
3754 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3755         
3756         * cs-parser.jay: Set readonly context based on special constructs.
3757         
3758         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3759         readonly variable error handling.
3760         
3761         * rootcontext.cs (EmitCode): Don't verify members when error
3762         occurred.
3763         
3764         * statement.cs (LocalInfo): Add reaodnly context information.
3765         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3766
3767 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3768
3769         * statement.cs (Block.Resolve): Revert change below.  Modify fix
3770         for #74041 to initialize 'resolved' to false only for explicit
3771         blocks.  Fixes #74873.
3772
3773 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3774
3775         Fix #74920.
3776         * typemanager.cs (unmanaged_enclosing_types): New.
3777         (IsUnmanagedType): Avoid infloops by using
3778         'unmanaged_enclosing_types' to talk with recursive invocations.
3779
3780 2005-05-13  Martin Baulig  <martin@ximian.com>
3781
3782         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3783         instance variable, not a local.  Fix #74873.
3784         (Block.ResolveUnreachable): Set it to true here.
3785
3786 2005-05-11  Duncan Mak  <duncan@novell.com>
3787
3788         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3789         continuing to process for 'arg'.
3790         (handle_preprocessing_directive): Check the argument of the #endif
3791         directive and report error CS1025 if there are any trailing
3792         characters.
3793
3794         According to the C# spec, having even whitespace after the #endif
3795         directive is illegal; however, because we call arg.TrimEnd ()
3796         beforehand, we have the same behavior as csc, allowing whitespace
3797         after the directive.
3798
3799         Fixes #74892.
3800
3801 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3802
3803         Fix #74863.
3804         
3805         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3806         (Constructor.GetObsoleteAttribute): Implemented correctly.
3807
3808 2005-05-10  Martin Baulig  <martin@ximian.com>
3809
3810         * support.cs (ReflectionParameters.ParameterModifier): Use
3811         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3812         and `ParameterAttributes.In'.  Fixes #74884.
3813
3814 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3815
3816         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3817         
3818         * expression.cs (Argument.GetParameterModifier): Turned to property.
3819         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3820         
3821         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3822         its C# equivalent.
3823         
3824 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3825
3826         Fix #74852.
3827         * decl.cs (MemberCache.AddMethods): Register override methods,
3828         rather than non-override methods.
3829         * typemanager.cs (RegisterOverride): New.
3830         (IsOverride): Update.
3831
3832 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3833
3834         Fix #73105.
3835         
3836         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3837         recursive declaration.
3838         
3839         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3840         
3841 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3842
3843         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3844         
3845         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3846
3847 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3848
3849         Fix #74797.
3850         * decl.cs (DeclSpace.FamilyAccessible): 
3851         Use TypeManager.IsNestedFamilyAccessible.
3852
3853         Fix reopened #64812.
3854         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3855         internal'.
3856
3857 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3858             Abin Thomas  <projectmonokochi@rediffmail.com>
3859             Anoob V E  <projectmonokochi@rediffmail.com>
3860             Harilal P R  <projectmonokochi@rediffmail.com>
3861
3862         Fix #64812.
3863         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3864         allow access to all static members.
3865
3866 2005-05-04  Martin Baulig  <martin@ximian.com>
3867
3868         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3869
3870 2005-05-04  Martin Baulig  <martin@ximian.com>
3871
3872         Fix #74655.
3873
3874         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3875         section at the end; make things work if `default' is not the last
3876         section.        
3877
3878 2005-05-04  Martin Baulig  <martin@ximian.com>
3879
3880         Fix #70400.
3881
3882         * statement.cs (Switch): Replaced the `got_default' field with a
3883         `default_section' one.
3884         (Switch.CheckSwitch): Set `default_section' here.
3885         (Switch.Resolve): If we're a constant switch and the constant is
3886         not found, use the default section.
3887
3888 2005-05-03  Martin Baulig  <martin@ximian.com>
3889
3890         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3891
3892         * statement.cs (Foreach.ArrayForeach): New nested class.
3893         (Foreach.TemporaryVariable): New nested class.
3894         (Foreach.EmitArrayForeach): Removed; this is now in the new
3895         ArrayForeach class.
3896
3897 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3898
3899         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3900         more conservative.
3901         (VerifyPendingMethods): Revert change below.
3902
3903         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3904         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3905         that used to trigger warning -28.  Remove warning -28.
3906         * expression.cs (Invocation.OverloadResolve): Use
3907         TypeManager.IsOverride to distinguish override methods.
3908
3909         Fix #74773.
3910         * pending.cs (VerifyPendingMethods): If a base type implements the
3911         requested interface, don't bother checking individual methods of
3912         the base type.  As a side-effect, this prevents the creation of
3913         unnecessary proxies.
3914
3915 2005-05-02  Martin Baulig  <martin@ximian.com>
3916
3917         Fix #70182.
3918
3919         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3920         Also `And' the locals if the old vector is null.
3921         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3922         null; in this case we basically reset all the variables.        
3923
3924 2005-05-02  Martin Baulig  <martin@ximian.com>
3925
3926         Fix #74529.
3927
3928         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3929         Added `FlowBranching branching' argument; always `and' the
3930         variables instead of `or'ing them unless we're an infinite loop.
3931
3932         * statement.cs (While.Resolve): Create a new sibling unless we're
3933         infinite.       
3934
3935 2005-05-02  Martin Baulig  <martin@ximian.com>
3936
3937         Fix #70140.
3938
3939         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3940         arguments; use it instead of creating a new TopLevelBlock.
3941         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3942         our ConstructorInitializer.
3943
3944         * statement.cs
3945         (TopLevelBlock.TopLevelBranching): New public property.
3946         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3947         and create our `TopLevelBranching'.
3948
3949         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3950         anonymous method host, use `block.TopLevelBranching' rather than
3951         creating a new branching.
3952
3953 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3954
3955         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3956         a ScopeInfo, if any of the current children is a child of the new
3957         entry, move those children there.
3958
3959 2005-04-30  Martin Baulig  <martin@ximian.com>
3960
3961         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3962         at the beginning of a SwitchSection.  Fix #73335.
3963
3964 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3965
3966         Fix #74378
3967         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3968         
3969         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3970         (FieldExpr.DoResolve): Obsolete members are ignored for field
3971         initializers.
3972         
3973 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3974
3975         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3976         of arrays detection.
3977
3978         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3979         verification.
3980         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3981
3982         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3983         arrays report.
3984
3985 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3986
3987         * cs-parser.jay: Use the prefered version of -unsafe in error
3988         message.
3989
3990 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3991
3992         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3993         circumstances.
3994
3995 2005-04-20  John Luke  <john.luke@gmail.com>
3996
3997         * driver.cs: fix typo in error message, --outout to --output
3998
3999 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4000
4001         * codegen.cs (InRefOutArgumentResolving): New field.
4002         
4003         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4004         fields outside contructor.
4005         
4006         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4007         
4008 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4009
4010         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4011         parameter code was not completed ever, so it was not as up-to-date
4012         as local variables.  Must finish it.
4013
4014         The bug fix was to compare the Toplevel of the block, not the
4015         current block.  Thanks for Ben for pointing this out. 
4016
4017 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4018
4019         * decl.cs (AddMethods): Use the declaring type of the problem
4020         method to determine if we want to squash a warning.
4021
4022 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4023
4024         * attribute.cs: Removed debug output.
4025
4026         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4027         
4028         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4029         Report.Stderr.
4030         
4031 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4032
4033         Fix #74481.
4034         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4035         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4036         all null comparisons against reference types.
4037
4038 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4039
4040         Fix# 74565
4041         * class.cs (TypeContainer.CircularDepException) New nested
4042         exception class.
4043         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4044         (TypeContainer.DefineType): Removed error, reset InTransit before
4045         exit.
4046         (Class.DefineType): Throw exception when is in Transit.
4047         Catch exception and report error.
4048         (Struct.DefineType): Throw exception when is in Transit.
4049         Catch exception and report error.
4050         (Interface.DefineType): Throw exception when is in Transit.
4051         Catch exception and report error.
4052
4053         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4054         handle nested exception handlers.
4055
4056         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4057         a catch.
4058
4059         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4060         InFinally and InCatch storage.
4061
4062         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4063         (Catch.Resolve): Set and Restore ec.InCatch.
4064         (Try.Resolve): Set and Restore ec.InFinally.
4065         (Try.HasCatch): True when try has catch.
4066
4067 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4068
4069         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4070           for the same event member, so exclude such cases from warning 419.
4071           Fixed bug #74633.
4072
4073 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4074
4075         * expression.cs (Binary.ResolveOperator): Apply patch from John
4076         Luke to fix bug 59864: operators &, | and ^ on enumerations
4077         require that the same enum type on both sides.
4078
4079         * driver.cs: Add warnings to old flag usage, this is to assist
4080         people who produce Makefiles and hope that the Makefiles will be
4081         used on Windows.
4082
4083         * class.cs (TypeContainer.EmitType): Moved the definition of the
4084         special $PRIVATE$ field from the resolve phase to the Emit phase.
4085         During resolve we do not know if we are a struct with
4086         HasExplicitLayout, we know this only after the attributes for the
4087         type are emitted.
4088
4089         Set the FieldOffset to zero on the dummy field that we create for
4090         the class.   Fixes 74590.
4091
4092 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4093
4094         Fix #73834.
4095         * ecore.cs (PropertyExpr.resolved): New.
4096         (DoResolve): Use it to handle a case of double resolution here.
4097         Handle a case of identical-name-and-type-name.
4098         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4099         resolution by storing the results of expression resolution back
4100         into the "probes" array.
4101
4102 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4103
4104         Fix cs0208-7.cs and cs0208-8.cs.
4105         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4106         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4107         error reporting to point out the reason a struct is not unmanaged.
4108
4109 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4110
4111         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4112           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4113
4114 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4115
4116         Fix #74528.
4117         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4118         IdenticalNameAndTypeName here.
4119         (EventExpr.InstanceResolve): Likewise.
4120
4121 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4122
4123         C# 2.0 DefaultCharSetAttribute implementation
4124         
4125         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4126         which allows us to set GlobalNamespace for every resolve.
4127         (Attribute.ResolveArguments): Cut from Resolve.
4128         (Attribute.GetCharSetValue): Returns CharSet named argument.
4129         (Attribute.DefinePInvokeMethod): Gets default charset from
4130         module settings.
4131         (GlobalAttribute.ResolveAsTypeStep): Override.
4132         (GlobalAttribute.ResolveArguments): Override.
4133         
4134         * class.cs (TypeAttr): Is protected.
4135         
4136         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4137         (ModuleClass.DefaultCharSetType): New memeber.
4138         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4139         
4140         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4141         charset from module.
4142         
4143         * delegate.cs (TypeAttr): Override.
4144         (Delegate.DefineType): Use this TypeAttr.
4145         
4146         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4147         at very early stage (before types are defined) to resolve model
4148         module attributes. It will probably not work with corlib but it
4149         should be ok.
4150         
4151         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4152         charset from module.
4153         
4154         * typemanager.cs (default_charset_type): New type.
4155
4156 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4157
4158         * decl.cs (MemberCache.AddMethods): Don't warn if
4159         System.Object.Finalize has buggy MethodAttributes.
4160
4161         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4162         removed below.
4163
4164 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4165
4166         * doc.cs : detect ambiguous reference to overloaded members.
4167           Fixed bug #71603. MS 1.1 csc does not detect it.
4168
4169 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4170
4171         * doc.cs : delegates must not be referenced with parameters.
4172           Fixed bug #71605.
4173
4174 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4175
4176         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4177
4178 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4179
4180         * driver.cs (MainDriver): Stop processing if the CLS stage found
4181         errors. 
4182
4183         (CompilerCallableEntryPoint.InvokeCompiler): Always
4184         reset after execution;   Take a TextWriter argument for the
4185         output.
4186
4187         * report.cs: Use the error stream instead of hardcoding stderr. 
4188
4189 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4190
4191         * class.cs: Reduce code paths to test, too small of an
4192         optimization to make it worth the extra testing.  Always perform
4193         it. 
4194
4195 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4196
4197         Fix #74510.
4198         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4199         operators that had errors reported on them.
4200
4201 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4202
4203         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4204         argument types.
4205         (Attribute.Resolve): Add named argument type checking.
4206         
4207         * class.cs (FixedField.Define): Use IsPrimitiveType
4208         
4209         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4210         
4211         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4212         unsafe parameter types.
4213         
4214         * statement.cs (Using.ResolveExpression): Add better error description.
4215         
4216         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4217         
4218 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4219
4220         Fix #74484.
4221         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4222         AttributeUsageAttribute in the emitcontext of the attribute class,
4223         not in the emitcontext of the attributable entity it was attached to.
4224         * cs-parser.jay: Use 'current_class', not 'current_container',
4225         when creating a GlobalAttribute.
4226
4227 2005-04-08  Alp Toker  <alp@atoker.com>
4228
4229         * pending.cs: The fix to #58413 failed to compile methods implementing
4230         interfaces with/without params modifiers and vice versa, even though
4231         params modifiers aren't part of the signature. Make the modifier check
4232         less strict as in csc.
4233
4234 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4235             Anoob V E  <projectmonokochi@rediffmail.com>
4236             Harilal P R  <projectmonokochi@rediffmail.com>
4237
4238         Fix #58413.
4239         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4240         modifiers of pending methods.
4241         (PendingImplementation.PendingImplementation): Initialize it.
4242         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4243         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4244         with ParameterData.  Add check for modifiers.
4245         * class.cs (MethodData.Define): Update to changes.
4246
4247 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4248
4249         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4250
4251 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4252
4253         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4254         property.
4255         
4256         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4257         
4258         * rootcontext.cs,
4259         * typemanager.cs: Registered RequiredAttributeAttribute.
4260         
4261 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4262
4263         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4264         Warning CS0169 is back at level 3.
4265         (IMethodData.SetMemberIsUsed): New method.
4266         
4267         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4268         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4269         
4270         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4271
4272         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4273         contants.
4274         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4275         is used.
4276         
4277         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4278         is used.
4279         
4280         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4281         to avoid the problems with nested types.
4282
4283 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4284             Anoob V.E  <projectmonokochi@rediffmail.com>
4285             Harilal P.R  <projectmonokochi@rediffmail.com>
4286             Raja R Harinath  <rharinath@novell.com>
4287
4288         Fix #73820.
4289         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4290         attribute.
4291         * typemanager (GetConstructor): Make public.
4292
4293 2005-04-05  John Luke  <john.luke@gmail.com>
4294             Raja R Harinath  <rharinath@novell.com>
4295
4296         Fix #62232.
4297         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4298         struct too.  Return false quicker in a few cases.
4299         (VerifyUnManaged): Use it.
4300
4301 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4302
4303         Fix #74041.
4304         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4305         not 'unreachable_seen'.
4306
4307 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4308
4309         * attribute.cs (Attribute.GetValue): Removed unused.
4310         
4311         * codegen.cs (CodeGen.TrimExt): Removed unused.
4312         
4313         * cs-parser.jay (output): Removed unused.
4314         
4315         * cs-tokenizer.cs (hex_digits): Removed unused.
4316         
4317         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4318         
4319         * expression.cs (Indirection.LoadExprValue): Removed unused.
4320         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4321         
4322         * iterators.cs (Iterator.param_types): Removed unused.
4323         
4324         * statement.cs (Goto.block): Removed unused.
4325         (ToplevelBlock.did): Removed unused.
4326         (Switch.ResolveConstantSwitch): Removed unused.
4327
4328 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4329
4330         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4331         resetting thingy.
4332
4333 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4334
4335         Fix #74232 and cs0208-3.cs.
4336         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4337         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4338         unmanaged type.  Don't use FieldBuilders when 't' is a
4339         TypeBuilder.  Use ModFlags and MemberType fields.
4340         * class.cs (MemberBase.member_type): Rename from MemberType.
4341         (MemberBase.MemberType): New property.  Determines member_type on
4342         demand.
4343         (MemberBase.DoDefine): Don't initialize MemberType here.
4344         (FieldMember.Define): Likewise.
4345
4346 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4347
4348         Fix #74241
4349         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4350         Attributes are emitted there.
4351         
4352 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4353
4354         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4355         keyword in 'partial enum' too.
4356         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4357         is not allowed).
4358         Report from Kamil Skalski <nazgul@omega.pl>.
4359
4360         Fix #74309.
4361         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4362         have partial containers too.
4363
4364         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4365         in block' checks to Block.CheckInvariantMeaningInBlock.
4366         * statement.cs (Block.GetKnownVariableInfo): Make private.
4367         (Block.IsVariableUsedInChildBlock): Remove.
4368         (Block.IsVariableUsedInBlock): Likewise.
4369         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4370         conflicting declaration.
4371         (Block.AddVariable): Make error messages less long-winded and more
4372         specific.  Show location of conflicting declaration.
4373         * parameter.cs (Parameters.Location): New readonly property.
4374
4375 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4376
4377         Clean up semantics of invoking ResolveMemberAccess.
4378         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4379         can have an instance, ensure that we pass in a non-TypeExpression
4380         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4381         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4382         argument.  Update to changes and simplify.
4383         (FieldExpr.Emitinstance): Remove CS0120 check.
4384         (PropertyExpr.EmitInstance): Likewise.
4385         * expression.cs (Argument.Resolve): Likewise.
4386         (Invocation.DoResolve): Update to changes in semantics of
4387         InstanceExpression.
4388
4389 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4390
4391         Fix #74241
4392         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4393         customization.
4394         
4395         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4396
4397 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4398
4399         Fix difference in behaviour with commandline invocation.
4400         * driver.cs (Driver.Reset): New.
4401         (CompilerCallableEntryPoint): Call it.
4402
4403         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4404         variable" warnings if the boolean expression failed to resolve.
4405
4406 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4407
4408         * attribute.cs: Fix the union of several permissions when some of them
4409         are unrestricted (so the result isn't an unrestricted permission set).
4410         Fix #74036.
4411
4412 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4413
4414         * ecore.cs (MemberExpr): New class.  Convert from interface
4415         IMemberExpr.
4416         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4417         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4418         error checks.
4419         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4420         (MethodGroupExpr.IsExplicitImpl): Remove.
4421         (Expression.GetFieldFromEvent): Remove.
4422         (SimpleName.MemberStaticCheck): Remove.
4423         (SimpleName.DoSimpleNameResolve): Update to changes.
4424         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4425         (MemberAccess.IdenticalNameAndTypeName): Remove.
4426         (MemberAccess.error176): Move to MemberExpr.
4427         (MemberAccess.DoResolve): Update to changes.
4428         (BaseAccess.DoResolve): Likewise.
4429
4430 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4431
4432         C# 2.0 Conditional attribute class implementation
4433         
4434         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4435         Analyzes class whether it has attribute which has ConditionalAttribute
4436         and its condition is not defined.
4437         
4438         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4439         (Class.IsExcluded): New method. Search for at least one defined
4440         condition in ConditionalAttribute of attribute class.
4441
4442 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4443
4444         * ecore.cs (PropertyExpr): Derive from Expression, not
4445         ExpressionStatement.
4446         (PropertyExpr.EmitStatement): Remove.
4447
4448 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4449
4450         Fix #74060.
4451         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4452         internal field "value__" of an enum be private.  The examples for
4453         "value__" that I found on MSDN all used FieldAttributes.Private.
4454
4455         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4456         Don't mention IL method attribute names.
4457
4458         Fix #47991.  Remove a TODO.
4459         * statement.cs (Block.Toplevel): Make into a field.
4460         (Block.Parameters): Move into ToplevelBlock.
4461         (Block.known_variables): Rename from child_variable_names.
4462         (Block.Block): Remove variants that take Parameters.  Initialize
4463         'Toplevel' with the immediately surrounding toplevel block.
4464         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4465         LocalInfo parameter.
4466         (Block.GetKnownVariableInfo): New.
4467         (Block.IsVariableNameUsedInChildBlock): Update.
4468         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4469         the block, even though it may not be in scope.
4470         (Block.AddVariable): Remove Parameters parameter.  Use
4471         Toplevel.Parameters instead.
4472         (Block.AddConstant): Remove Parameters parameter.
4473         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4474         (Block.IsParamaterReference): Likewise.
4475         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4476         (ToplevelBlock.Parameters): New.  Moved from Block.
4477         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4478         initialize Parameters to a non-null value.
4479         * cs-parser.jay: Update to changes.
4480         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4481         simple names that mean different things in the same block.  Use
4482         Block.IsVariableNameUsedInBlock.
4483
4484 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4485
4486         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4487         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4488         GetTypeHandle.  It is possible for a reflected type to derive from
4489         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4490         System.Array during mscorlib compilation).
4491         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4492         contain a method_hash, don't create one either.  Don't create a
4493         deep copy of the base cache's method_hash.
4494         (MemberCache.SetupCache): Rename back from DeepCopy.
4495         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4496         already initialized.  If we see an override function, add its
4497         underlying base virtual function to the member_hash too.
4498
4499         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4500
4501 2005-03-26  Raja R Harinath  <harinath@acm.org>
4502
4503         Fix #73038.
4504         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4505         fails to resolve, ensure that the LHS is still resolved as an
4506         lvalue.
4507
4508 2005-03-25  Raja R Harinath  <harinath@acm.org>
4509
4510         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4511         ec.ContainerType.
4512         (Enum.current_ec): Remove.
4513         (Enum.LookupEnumValue): Remove EmitContext argument.
4514         Just uses the one created during DefineType.
4515         (Enum.FindMembers): Update.
4516         * expression.cs (MemberAccess.DoResolve): Update.
4517
4518 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4519
4520         * assign.cs (Assign.DoResolve): Check for CS1717 when
4521         source and target are same (uses Equals).
4522
4523         * expression.cs (LocalVariableReference, ParameterReference,
4524         This): Implemented Equals, GetHashCode.
4525
4526         * statement.cs (Block.GetParameterReference): Removed useless
4527         local variable.
4528
4529 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4530
4531         Fix cs0128.cs
4532         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4533         blocks before deciding whether the error is cs0136 or cs0128.
4534
4535         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4536         (using_alias_directive, using_namespace_directive): Pass
4537         MemberName, not an expression to Namespace.UsingAlias and
4538         Namespace.Using.
4539         (MakeName): Use the MemberName of the namespace.
4540         * namespace.cs (Namespace.MemberName): New.
4541         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4542         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4543         Likewise.
4544         * decl.cs (MemberName.Name): Make readonly.
4545         (MemberName.FromDotted): New "constructor".
4546         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4547         (MemberCore.Name): Compute from MemberName on demand.
4548         (MemberCore.SetMemberName): Provide a way to change the
4549         MemberName.
4550         (MemberCore.AddToContainer): Don't take a fullname parameter.
4551         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4552         fully qualified name of the container to the member name.
4553         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4554         only if the type is a member of the root container.
4555         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4556         MemberName.Left rather than searching for an embedded ".".
4557         (PartialContainer.CreatePart): Update to changes in RootContext.
4558         (MemberBase.ShortName): Turn into a property.  Use
4559         MemberCore.SetMemberName.
4560         (MemberBase.ExplicitInterfaceName): Remove.
4561         (MemberBase.UpdateMemberName): Remove.
4562         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4563         (PropertyBase.SetMemberName): New override.
4564         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4565         (Tree.GetDecl): New.
4566         (Tree.AllDecls): Rename from Decls.
4567         * attribute.cs, enum.cs, report.cs: Update to changes.
4568         * driver.cs (MainDriver): Use MemberName.FromDotted on
4569         RootContext.MainClass.
4570
4571 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4572
4573         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4574         checks.
4575
4576         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4577
4578 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4579
4580         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4581         property accessor modifiers.
4582
4583         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4584         fixed buffer attribute (CS1716).
4585         (PropertyMethod.HasCustomAccessModifier): When property accessor
4586         has custom modifier.
4587
4588         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4589         modifiers.
4590         (PropertyExpr.DoResolveLValue): Add CS0272.
4591
4592 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4593
4594         * convert.cs: When converting to a pointer, use the proper Conv.U
4595         or Conv.I depending on the source data type.
4596
4597         * cs-tokenizer.cs: Make the size for large decimal constants,
4598         fixes #72957.
4599
4600 2005-03-17  Martin Baulig  <martin@ximian.com>
4601
4602         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4603         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4604
4605 2005-03-17  Martin Baulig  <martin@ximian.com>
4606
4607         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4608         to bool so we can return an error condition.
4609         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4610         returned an error.
4611
4612 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4613
4614         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4615         attributes.
4616
4617 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4618
4619         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4620         Refactor to avoid traversing the list of assemblies, and to avoid
4621         string concatenation.
4622         * typemanager.cs (guid_attr_type): Remove.
4623         (negative_hits, pointers, references): Remove hashes.
4624         (type_hash): New.
4625         (GetConstructedType): New.  Uses type_hash to handle constructed
4626         types (arrays, references, pointers).
4627         (GetReferenceType, GetPointerType): Use it.
4628         (GetNestedType): New.  Uses type_hash to handle nested types of
4629         reflected types.
4630         (LookupType, LookupTypeDirect): Remove.
4631         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4632         'types' hash and LookupTypeReflection directly.
4633         (params_string, params_object): Use GetConstructedType.
4634         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4635         top-level types.
4636         (Namespace.Lookup): Use cached_types.
4637         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4638         provided by old TypeManager.LookupType.
4639         * rootcontext.cs (MakeFQN): Remove.
4640         * decl.cs (DeclSpace.MakeFQN): Likewise.
4641         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4642         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4643         TypeManager.GetConstructedType.
4644         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4645
4646 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4647
4648         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4649         indexers.
4650
4651         * cs-parser.jay: Reports CS1527 for any namespace element.
4652
4653         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4654         Added CS0407.
4655
4656         * expression.cs (ParameterReference.IsAssigned): Changed error to
4657         CS0269.
4658         (Error_WrongNumArguments): Moved CS0245 detection here.
4659
4660         * statement.cs (Return.Resolve): Add CS1622 report.
4661
4662 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4663
4664         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4665
4666 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4667
4668         * attribute.cs expression.cs: Get rid of some allocations.
4669
4670 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4671
4672         * doc.cs : just eliminate the latest change.
4673
4674 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4675
4676         * doc.cs : commented out the latest change. It breaks xml-030.cs
4677
4678 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4679
4680         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4681           fail. So invoke CreateType() in FindDocumentedType().
4682
4683 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4684
4685         * cs-tokenizer.cs : added IsKeyword().
4686         * doc.cs : Detect keyword incorrectly used as identifier.
4687           Allow identifiers prefixed by @.
4688
4689 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4690
4691         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4692         It caused exception in namespace resolving (again!).
4693         
4694         * class.cs (Class.ctor): Removed exit.
4695         (PropertyMethod.ctor): ditto.
4696         
4697         * codegen.cs (Codegen.Reset): Reset static data.
4698         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4699         
4700         * cs-tokenizer.cs (Cleanup): Removed.
4701         
4702         * driver.cs (GetSystemDir): Rewrote to one line command.
4703         It caused problem with unloaded dynamic modules.
4704         (UnixParseOption): Removed Exit.
4705         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4706         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4707         Now can be mcs used as library.
4708         
4709         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4710         empty location.
4711         
4712         * location.cs (Reset): Reset static data.
4713         
4714         * namespace.cs (Reset): Reset static data.
4715         
4716         * report.cs (Report.Reset): Reset static data.
4717         
4718         * rootcontext.cs (RootContext.Reset): Reset static data.
4719         
4720         * tree.cs (RootTypes.ctor): Use Location.Null
4721         
4722         * typemanager.cs (TypeManager.Reset): Reset static data.
4723         (CoreLookupType): Removed Exit.
4724         (TypeHandle.Reset): Reset static data.
4725         
4726 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4727
4728         Fix #73516.
4729         * typemanager.cs (ComputeNamespaces): Import namespaces from
4730         referenced modules too.
4731
4732 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4733
4734         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4735         than '.'.
4736
4737 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4738
4739         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4740         enclosing DeclSpace.  This ensures that a name-lookup populates
4741         more caches and there are fewer 'TypeExpression's.  Carve out
4742         nested type lookup into ...
4743         (LookupNestedTypeInHierarchy): ... this.
4744
4745 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4746
4747         Clean up a few partial-class semantics.  
4748         Fixes test-357.cs and cs1618-2.cs.
4749         * cs-parser.jay (struct_declaration): Use 'current_class' as
4750         parent of newly-created struct.  Remove call to Register ().
4751         Use 'pop_current_class' to complete handing the current struct.
4752         (interface_declaration): Likewise.
4753         (class_declaration): Likewise.
4754         (enum_declaration): Use 'current_class' as parent of newly created
4755         enum.
4756         (delegate_declaration): Likewise.
4757         (pop_current_class): New function.  This is used to handle closing
4758         up the 'current_class' and 'current_container', and pointing them
4759         to the enclosing class/container.
4760         (CSharpParser): Initialize 'current_class' too.
4761         * decl.cs (MemberCore): Add check for invariant: a partial
4762         container is not a parsed entity, and thus does not enclose any
4763         parsed members.
4764         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4765         (DeclSpace.BaseTypeExpr): Use it.
4766         (DeclSpace.LookupType): Add check for invariant.
4767         * class.cs (TypeContainer): Add check for invariant: a nested
4768         class should have the same NamespaceEntry as its enclosing class.
4769         (TypeContainer.EmitFieldInitializers): Make virtual.
4770         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4771         MemberCore.
4772         (TypeContainer.Register): Remove.
4773         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4774         null.  Use TypeResolveEmitContext for resolving base types and
4775         interfaces.  Move initialization of Parts.TypeBuilder here from
4776         ...
4777         (TypeContainer.DefineNestedTypes): ... here.
4778         (PartialContainer): Take a Namespace not a NamespaceEntry.
4779         (PartialContainer.Create): Don't use Register.  Call the
4780         appropriate Add... function directly.
4781         (ClassPart): Take both the PartialContainer and the enclosing
4782         class as constructor arguments.
4783         (ClassPart.EmitFieldInitializers): Override.
4784         (ClassPart.PartFindNestedTypes): Remove.
4785         (FieldBase.GetInitializerExpression): Resolve the initializer
4786         expression in the emit context of the enclosing class.
4787         * tree.cs (RootTypes): Remove Register ().
4788         
4789 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4790
4791         * cs-parser.jay: Removed CS0134.
4792         
4793         * driver.cs: Removed CS1901.
4794         
4795         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4796         for predefined types.
4797
4798 2005-03-07  Duncan Mak  <duncan@novell.com>
4799
4800         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4801         well. Fixes bug #73454.
4802
4803 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4804
4805         * cs-tokenizer.cs (xtoken): Add CS1035.
4806         
4807         * class.cs (MethodData.Define): Add CS0683.
4808         (FieldMember.ctor): Add CS0681.
4809
4810 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4811
4812         * ecore.cs (SimpleName.DoResolve): Rename from
4813         SimpleName.DoResolveAllowStatic.
4814         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4815         Pass 'intermediate' flag to MemberStaticCheck.
4816         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4817         of "intermediate" lookups via MemberAccess.
4818         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4819         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4820
4821 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4822
4823         Fix #73394.
4824         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4825         slipped in because of variable names that are identical to a
4826         builtin type's BCL equivalent ('string String;', 'int Int32;').
4827         (PropertyExpr.EmitInstance): Likewise.
4828
4829 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4830
4831         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4832         
4833         * report.cs (warning_ignore_table): Made public.
4834
4835 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4836
4837         Fix #73282.
4838         * class.cs (MethodData.Emit): Pass 'container' to
4839         container.GetObsoleteAttribute instead of 'container.Parent'.
4840
4841 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4842
4843         * cs-parser.jay: Add 1534 error test.
4844
4845         * iterators.cs (Yield.CheckContext): Add error 1629.
4846         (Iterator.ctor): Save unsafe modifier.
4847         (MoveNextMethod.DoEmit): Restore unsafe context.
4848
4849         * namespace.cs (UsingAlias): Better error message.
4850
4851 2005-03-03  Dan Winship  <danw@novell.com>
4852
4853         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4854         the warning message [#73219]
4855
4856 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4857
4858         Fix compile with MCS 1.0.0.0.
4859         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4860         w_restore to not depend on string constant folding.
4861
4862 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4863
4864         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4865         CS0246 check to users who passed 'silent = false'.
4866         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4867         check.
4868         (SimpleName.SimpleNameResolve): Update.
4869         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4870         (MemberAccess.IdenticalNameAndTypeName): Update.
4871         * doc.cs (FindDocumentedTypeNonArray): Update.
4872
4873 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4874
4875         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4876         * parameters.cs (ComputeAndDefineParameters): Remove.
4877         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4878         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4879         Use GetParameterInfo.
4880
4881 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4882
4883         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4884
4885 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4886
4887         Unify DeclSpace.LookupType and DeclSpace.FindType.
4888         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4889         is in charge of defining nested types on demand.
4890         (DeclSpace.LookupType): Use it when the current_type is a
4891         TypeBuilder.  Use LookupTypeDirect for reflected types.
4892         (DeclSpace.FindType): Remove.
4893         (DeclSpace.LookupInterfaceOrClass): Likewise.
4894         (DeclSpace.DefineTypeAndParents): Likewise.
4895         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4896         DeclSpace.LookupType.
4897         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4898         * typemanager.cs (LookupType): Simplify.
4899         (AddUserType): Remove type from negative_hits.
4900         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4901         * class.cs (TypeContainer.FindMembers): Move handling of nested
4902         types ...
4903         (TypeContainer.FindMembers_NestedTypes): ... here.
4904         (TypeContainer.FindNestedType): Implement override.
4905         (ClassPart.FindNestedType): Delegate to PartialContainer.
4906         (ClassPart.PartFindNestedType): Looks up the nested types of the
4907         part alone.
4908
4909 2005-03-02  Martin Baulig  <martin@ximian.com>
4910
4911         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4912         static constructor in static classes.
4913
4914 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4915
4916         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4917         sizeParamIndex is not specified.
4918
4919 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4920
4921         Fix #73117
4922         * report.cs (WarningMessage.IsEnabled): Missing null check.
4923
4924 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4925
4926         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4927         in the fields and not in the properties.
4928
4929 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4930
4931         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4932         fields as well.
4933
4934 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4935
4936         * attribute.cs: Small refactoring (improved robustness).
4937         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4938         (ValidateGuid): Removed.
4939         (Resolve): Removed referenced to above mentioned.
4940         (GetAttributeUsage): Made private and changed to work without
4941         class assistance.
4942         (GetIndexerAttributeValue): Don't crash.
4943         (GetConditionalAttributeValue): Ditto.
4944         (GetClsCompliantAttributeValue): Ditto.
4945         (ExtractSecurityPermissionSet): All attributes exceptions are
4946         error 648.
4947         (GetPropertyValue): New helper.
4948         (GetMethodImplOptions): New method.
4949         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4950         some missing properties.
4951         
4952         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4953         (Method.ApplyAttributeBuilder): Updated.
4954         
4955         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4956         exception.
4957
4958 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4959
4960         Fix #73052.
4961         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4962         non-simple types (array, pointer, reference).
4963
4964 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4965
4966         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4967
4968         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4969         for operators.
4970         (Method.CheckBase): Catch wrong destructor here.
4971         (MethodData.Define): Add errors 550, 668.
4972
4973         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4974
4975         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4976
4977         * pending.cs (VerifyPendingMethods): Add error 551.
4978
4979         * typemanager.cs (CSharpName): Next error report helper.
4980
4981 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4982
4983         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4984         attributes. Removed useless attribute double check.
4985         It saves almost 2MBs for corlib.
4986
4987 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4988
4989         Fix #72924.
4990         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4991         called twice in case of error.
4992
4993 2005-02-23  Chris Toshok  <toshok@ximian.com>
4994
4995         Fix compiler portions of #72827.
4996         * statement.cs (Block.Emit): call Begin/EndScope on the
4997         EmitContext instead of the ILGenerator.
4998
4999         * codegen.cs (EmitContext.BeginScope): new method, call
5000         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5001         we have one.)
5002         (EmitContext.BeginScope): same, but EndScope and CloseScope
5003
5004         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5005         offset and call the superclass's OpenScope(int) with it.
5006         (SymbolWriter.CloseScope): get the current il
5007         offset and call superclass's CloseScope(int) with it.
5008
5009 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5010
5011         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5012         CS1677 for out and ref as well.
5013
5014         * class.cs (Method.Define): Add error CS1599 detection.
5015         
5016         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5017         
5018         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5019         
5020         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5021         
5022         * support.cs.cs (ModifierDesc): New helper method.
5023
5024 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5025             Abin Thomas  <projectmonokochi@rediffmail.com>
5026             Anoob V E  <projectmonokochi@rediffmail.com>
5027             Harilal P R  <projectmonokochi@rediffmail.com>
5028
5029         Fix #57851, #72718.
5030         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5031         MemberLookup (used for error reporting) actually returns a result.
5032         Fix error report number (122, not 112).
5033
5034 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5035             Anoob V E  <projectmonokochi@rediffmail.com>
5036             Harilal P R  <projectmonokochi@rediffmail.com>
5037
5038         Fix #71134.
5039         * pending.cs (PendingImplementation.GetAbstractMethods):
5040         Find NonPublic members too.
5041
5042 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5043
5044         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5045         Fixed error 217.
5046         
5047         * class.cs (MethodCore.CheckMethodAgainstBase):
5048         Add error 239 report.
5049
5050 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5051
5052         Fix #68955.
5053         * expression.cs (Invocation.IsApplicable): Make public.
5054         (Invocation.IsParamsMethodApplicable): Likewise.
5055         * delegate.cs (Delegate.VerifyApplicability): Don't use
5056         Invocation.VerifyArgumentCompat for parameter applicability
5057         testing.  Use Invocation.IsApplicable and
5058         Invocation.IsParamsMethodApplicable.
5059
5060 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5061
5062         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5063         
5064         * class.cs (Operator.Define): Add error 217 report.
5065         
5066 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5067
5068         * namespace.cs (UsingEntry.Resolve): Undo change below.
5069
5070 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5071
5072         Fix #72756.
5073         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5074         disable the error message when the extended MemberLookup also
5075         fails.
5076         (Expression.MemberLookupFinal): Update.
5077         (SimpleName.DoSimpleNameResolve): Update.
5078         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5079         Don't use MemberLookupFinal.
5080         (New.DoResolve): Update.
5081         (BaseAccess.CommonResolve): Update.
5082
5083 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5084
5085         Fix #72732.
5086         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5087         occured previously, don't resolve again.
5088
5089 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5090
5091         Fix #69949
5092         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5093         argument. Call ResolveAttributeUsage for unresolved.
5094         when types doesn't match ctor arguments.
5095         
5096         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5097         for nested attribute classes.
5098         (Class.attribute_usage): Removed.
5099         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5100         for attribute class.
5101         
5102         * ecore.cs (IsAttribute): Removed.
5103         
5104         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5105         
5106         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5107         now normal types.
5108         (attribute_types): Removed.
5109         (EmitCode): Global attributes are emited as the latest.
5110
5111 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5112
5113         * class.cs (EmitFieldInitializers): Don't emit field initializer
5114         for default values when optimilization is on.
5115         
5116         * constant.cs (Constant.IsDefaultValue): New property.
5117         
5118         * driver.cs: Add /optimize handling.
5119         
5120         * constant.cs,
5121         * ecore.cs,
5122         * literal.cs: Implement new IsDefaultValue property.
5123         
5124         * rootcontext.cs (Optimize): New field, holds /optimize option.
5125
5126 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5127
5128         Fix crasher in re-opened #72347.
5129         * namespace.cs (Namespace.Lookup): Return null if
5130         DeclSpace.DefineType returns null.
5131
5132         Fix #72678.
5133         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5134
5135 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5136
5137         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5138         now returns null if it cannot resolve to an lvalue.
5139         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5140         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5141         returned null.  Remove check for SimpleName.
5142         (EventExpr.DoResolveLValue): New.
5143         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5144         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5145         error from ...
5146         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5147         avoid CS0131 error.
5148         (Unary.ResolveOperator): Move CS0211 check ...
5149         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5150         CS0131 error.
5151         (Unary.DoResolveLValue): Simplify.
5152         (AddressOf.DoResolveLValue): New.
5153         (ArrayAccess.DoResolveLValue): New.
5154
5155 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5156
5157         * attribute.cs (Attribute.Resolve): Add arguments casting for
5158         when types doesn't match ctor arguments.
5159
5160 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5161
5162         Fix parts of #63202.
5163         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5164         lookup of operator in base type.  Ensure that all checks happen
5165         when the operator resolves to an "op_..." method.
5166
5167 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5168
5169         Fix #71992.
5170         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5171         'ignore_cs0104' parameter.  Pass it to ...
5172         (NamespaceEntry.Lookup): ... this.
5173         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5174         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5175         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5176         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5177         Update.  Request that cs0104 errors be ignored.
5178         (ComposedCast.ResolveAsTypeStep): Update.
5179
5180 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5181
5182         Fix #59209.
5183         * expression.cs (Invocation.BetterFunction): Remove support for
5184         comparing virtual functions and their overrides.
5185         (Invocation.IsOverride): New.
5186         (Invocation.OverloadResolve): Don't consider 'override' functions
5187         during candidate selection.  Store them in a lookaside list.
5188         If the selected method is a 'virtual' function, use the list to
5189         find any overrides that are closer to the LHS type.
5190
5191 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5192
5193         * expression.cs (New.DoResolve): Add complex core type reduction.
5194         (New.Constantify): Converts complex core type syntax like 'new int ()'
5195         to simple constant.
5196         
5197 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5198
5199         * decl.cs (EntryType.EntryType): New constructor to create an
5200         updated copy of a cache entry.
5201         (MemberCache.AddMethods): Use it.
5202         (MemberCache.ClearDeclaredOnly): Remove.
5203         (MemberCache.MemberCache): Update.
5204
5205 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5206
5207         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5208         variable.  This one is represents the actual low-level declaration
5209         of the method, as opposed to the semantic level `IsStatic'.   
5210
5211         An anonymous method which is hosted into a static method might be
5212         actually an instance method.  IsStatic would reflect the
5213         container, while MethodIsStatic represents the actual code
5214         generated.
5215
5216         * expression.cs (ParameterReference): Use the new MethodIsStatic
5217         instead of IsStatic.
5218
5219         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5220         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5221         set on the current EmitContext. 
5222
5223         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5224         resolve our casted expression as an LValue.  This triggers the
5225         proper LValue processing that is later required by Assign.
5226
5227         This fixes 72347.
5228
5229         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5230
5231 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5232
5233         C# 2.0 Fixed buffer implementation
5234
5235         * anonymous.cs: Update after RegisterHelperClass renaming.
5236
5237         * attribute.cs (AttributeTester.fixed_buffer_cache):
5238         Cache of external fixed buffers.
5239         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5240         implementation if field is fixed buffer else null.
5241
5242         * class.cs
5243         (TypeContainer.AddField): Accept FieldMember instead of Field.
5244         (FieldBase.IsFieldClsCompliant): Extracted code from
5245         VerifyClsCompliance descendant customization.
5246         (FixedField): New class handles fixed buffer fields.
5247         (FixedFieldExternal): Keeps information about imported fixed
5248         buffer.
5249         (IFixedField): Make access to internal or external fixed buffer
5250         same.
5251
5252         * cs-parser.jay: Add fixed buffer parsing.
5253
5254         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5255         buffer.
5256
5257         * expression.cs (Indirection): Extended implementation to accept
5258         fixed buffer field.
5259         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5260         (ElementAccess.MakePointerAccess): Get type as parameter.
5261         (DoResolve): Add fixed buffer field expression conversion.
5262         (DoResolveLValue): Ditto.
5263         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5264         (ArrayPtr): Derives from FixedBufferPtr.
5265         (ArrayPtr.Emit): Add extra emit for array elements.
5266
5267         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5268
5269         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5270         for compiler generated types.
5271         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5272
5273         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5274         and consume less memory.
5275         (Fixed.Resolve): Add fixed buffer case.
5276
5277         * typemanager.cs (compiler_generated_attr_ctor,
5278         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5279         (HasElementType): Add our own implementation to work on every
5280         runtime.
5281
5282 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5283
5284         * anonymous.cs (CaptureContext): Track whether `this' has been
5285         referenced.   
5286
5287         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5288         only captured `this' if it was implicitly done (instance
5289         methods/variables were used). 
5290
5291         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5292         `this' must be captured.
5293
5294 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5295  
5296         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5297         is null it means that there has been no need to capture anything,
5298         so we just create a sibling.
5299
5300         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5301
5302         Just a partial fix.  The other half is fairly elusive.
5303         
5304 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5305
5306         Fix #52586, cs0121-4.cs.
5307         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5308         and return a hashtable.
5309         (MemberCache.ClearDeclaredOnly): New.
5310         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5311         the method_hash of a base type too.
5312         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5313         type methods.  Overwrite entries with the same MethodHandle so
5314         that the ReflectedType is correct.  The process leaves in base
5315         virtual functions and their overrides as distinct entries.
5316         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5317         matters since it was boxed in a ArrayList before.
5318         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5319         modifier.
5320         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5321         case of a virtual function and its override (choose the overload
5322         as better).
5323         (Invocation.OverloadResolve): Avoid 'override' members during
5324         'applicable_type' calculation.
5325
5326 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5327
5328         Combine two near-redundant caches.
5329         * typemanager.cs (method_params): Rename from method_internal_params.
5330         (TypeManager.GetParameterData): New.  Replace
5331         Invocation.GetParameterData.
5332         (TypeManager.LookupParametersByBuilder): Remove.
5333         * expression.cs (Invocation.method_parameter_cache): Remove.
5334         (Invocation.GetParameterData): Remove.
5335         Update to changes.
5336         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5337         Update to changes.
5338
5339 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5340
5341         Fix #72015.
5342         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5343         TypeManager.multicast_delegate_type is null, resolve it by looking
5344         up "System.MulticastDelegate".
5345         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5346
5347 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5348             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5349             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5350
5351         Fix cs0164.cs.
5352         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5353         (LabeledStatement.AddReference): New.  Set 'referenced'.
5354         (Goto.Resolve): Use it.
5355
5356 2005-02-05  John Luke  <john.luke@gmail.com>
5357
5358         * driver.cs: remove duplicate -doc line in Usage ()
5359
5360 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5361
5362         * location.cs (Location.AddFile): Fix CS2002 error report.
5363
5364 2005-02-02  Martin Baulig  <martin@ximian.com>
5365
5366         * delegate.cs (Delegate.DefineType): Report an internal error if
5367         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5368         details.        
5369
5370 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5371
5372         Fix a crasher in a variant of #31984.
5373         * const.cs (Constant.CheckBase): New override that defers the
5374         new-or-override check in case the base type hasn't been populated
5375         yet.
5376         (Constant.Define): Ensure the new-or-override check is performed.
5377
5378 2005-02-01  Duncan Mak  <duncan@ximian.com>
5379
5380         * const.cs (LookupConstantValue): Check that `ce' is not null
5381         before calling GetValue ().
5382
5383 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5384
5385         Fix test-334.cs (#69519).
5386         * cs-parser.jay (using_alias_directive): Pass in an expression to
5387         NamespaceEntry.UsingAlias.
5388         (using_namespace_directive): Pass in an expression to
5389         NamespaceEntry.Using.
5390         (namespace_name): Don't flatten to a string.
5391         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5392         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5393         ResolveAsTypeStep.
5394         (NamespaceEntry.UsingEntry): Likewise.
5395         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5396         changes.
5397         (NamespaceEntry.LookupForUsing): Remove.
5398         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5399         names.
5400         (NamespaceEntry.Lookup): Remove support for dotted names.
5401
5402 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5403
5404         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5405         split into two.
5406         (NamespaceEntry.ImplicitParent): Compute on demand.
5407         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5408         parallels the current.
5409         (NamespaceEntry.LookupForUsing): Use it.
5410         (NamespaceEntry.Lookup): If the current namespace-entry is
5411         implicit, don't search aliases and using tables.
5412
5413 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5414
5415         Fix #31984.
5416         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5417         BaseCache here.
5418         (TypeContainer.BaseCache): Compute on demand.
5419         (TypeContainer.FindMembers): Define constants and types if they're
5420         not already created.
5421         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5422         check.
5423         * const.cs (Constant.Define): Make idempotent.
5424
5425 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5426
5427         * pending.cs: Produce better code (no nops produced by using Ldarg
5428         + value).
5429         
5430         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5431         i - 1' it should be arg + 1.
5432
5433         Fixes bug #71819.
5434
5435 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5436
5437         * attribute.cs (Attribute.CheckAttributeType): Make private
5438         non-virtual.
5439         (Attribute.ResolveType): Make virtual.
5440         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5441         handling of RootContext.Tree.Types.
5442
5443 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5444
5445         Update attribute-handling to use the SimpleName/MemberAccess
5446         mechanisms.
5447         * cs-parser.jay (attribute): Pass in an expression to the
5448         constructors of Attribute and GlobalAttribute.
5449         * attribute.cs (Attribute): Take an expression for the name.
5450         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5451         passed in attribute name expression.
5452         (Attribute.CheckAttributeType): Use it.
5453         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5454         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5455         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5456         argument to prevent error messages if the lookup fails.
5457
5458 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5459
5460         * expression.cs (Indirection): Implemented IVariable interface
5461         to support indirection in AddressOf operator.
5462         (PointerArithmetic.Emit): Add optimalization for case where
5463         result can be precomputed.
5464
5465 2005-01-26  Martin Baulig  <martin@ximian.com>
5466
5467         * class.cs (TypeContainer.AttributeTargets): Return the correct
5468         AttributeTargets depending on our `Kind' instead of throwing an
5469         exception; fixes #71632.
5470
5471 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5472
5473         Fix #71257
5474         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5475         constant members.
5476
5477 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5478
5479         Fix #71602.
5480         * expression.cs (MemberAccess.DoResolve): Don't complain with
5481         cs0572 when the LHS of a member access has identical name and type
5482         name.
5483
5484 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5485
5486         Fix #71651, #71675
5487         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5488         CreatePermission.
5489         Create custom PermissionSet only for PermissionSetAttribute.
5490
5491 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5492
5493         Fix #71649
5494         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5495         delegates in static class.
5496
5497 2005-01-24  Martin Baulig  <martin@ximian.com>
5498
5499         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5500         merging an implicit block, just use its reachability.
5501
5502         * statement.cs (Block.Resolve): Make the unreachable code check
5503         work wrt. implicit blocks; see test-337 from #63842.
5504
5505 2005-01-21  Alp Toker  <alp@atoker.com>
5506  
5507         * cs-parser.jay: destructor_declaration's container is PartialContainer
5508         not Class when partial types are used, so use Kind prop instead of
5509         'is'.
5510         
5511 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5512
5513         * cs-parser.jay: Improve error reporting when an interface
5514         declares new types.
5515
5516 2005-01-20  Dick Porter  <dick@ximian.com>
5517
5518         * support.cs: SeekableStreamReader fix from Sandor Dobos
5519         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5520         chars are read.  Fixes bug 70369.
5521
5522 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5523
5524         * cs-parser.jay (catch_clause): Simplify current_block handling
5525         somewhat.
5526
5527 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5528
5529         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5530         code with ImplicitStandardConversion to handle the implicit
5531         conversion of method groups into valid delegate invocations. 
5532
5533         The problem is that in parameter handling we were using this code
5534         path.  Fixes bug #64698
5535
5536 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5537
5538         * cs-parser.jay: Fix several infelicities.
5539         - Avoid assigning to the parser value stack.  Code like 
5540           '$3 = null' is unclean.  Synthesize a value for the code block
5541           instead. 
5542         - Avoid using oob_stack for storing location information.  Use ...
5543         (_mark_): ... this.  New (empty) rule.  Saves the current location
5544         in $$.
5545         (foreach_statement): Avoid using oob_stack for current_block
5546         handling.  Use technique used in for_statement and
5547         using_statement.  Synthesize a value for the code block to store
5548         additional intermediate information.
5549
5550 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5551
5552         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5553         of a different type is only allowed to private fields of a
5554         containing type, not on fields of a base class.
5555
5556         See test-174.cs and error cs0122-9.cs
5557
5558 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5559
5560         Fix test-335.cs (bug #58126).
5561         * cs-parser.jay (argument): Split out non-expression parts of the
5562         rule into 'non_simple_argument'.
5563         (invocation_expression): Support parenthesized invocations with
5564         multiple arguments, and with single non-simple arguments.
5565
5566 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5567
5568         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5569         places.
5570
5571 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5572
5573         Fix cs0038-1.cs, cs1640-6.cs.
5574         * ecore.cs (Expression.Resolve): Remove special-case for
5575         SimpleName in error-handling.
5576         (Expression.almostMatchedMembers): Relax access permission to
5577         protected.
5578         (Expression.MemberLookupFailed): Handle duplicates in
5579         almostMatchedMembers list.
5580         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5581         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5582         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5583         overload if the passed in MemberInfo is a MethodBase.
5584
5585 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5586
5587         Fix #70749
5588         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5589         for non-CAS & merge permission sets properly.
5590
5591 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5592
5593         Improve standard-compliance of simple name and member access 
5594         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5595         * ecore.cs (FullNamedExpression): New abstract base class 
5596         for Namespaces and TypeExpressions.
5597         (ResolveFlags.SimpleName): Remove.
5598         (SimpleName): Remove support for dotted names.
5599         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5600         DeclSpace.FindType and DeclSpace.LookupType.
5601         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5602         (Expression.ExprClassName): Make member function.
5603         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5604         a namespace.  Remove creation of dotted "SimpleName"s.
5605         (MemberAccess.DoResolve): Likewise.
5606         * decl.cs (DeclSpace.Cache): Make private.
5607         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5608         (DeclSpace.FindType): Update.
5609         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5610         FullNamedExpression.
5611         * namespace.cs (Namespace): Derive from FullNamedExpression
5612         so that it can be part of expression resolution.
5613         (Namespace.Lookup): Return an FullNamedExpression.
5614         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5615         namespace.
5616         * rootcontext.cs (NamespaceLookup): Remove.
5617         (LookupType): Move to DeclSpace.
5618         * attribute.cs (CheckAttributeType): Update.
5619         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5620         (FindDocumentedTypeNonArray): Likewise.
5621
5622 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5623
5624         Fix cs0509.cs, cs1632.cs.
5625         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5626         is the same as IsInterface.
5627         (TypeContainer.GetClassBases): Likewise.
5628         * statement.cs (LabeledStatement.ig): New field.
5629         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5630         label.
5631         (LabeledStatement.DoEmit): Check that the label was created with
5632         the same ILGenerator.
5633
5634 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5635
5636         Fix #71058
5637         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5638         accessors to its properties.
5639
5640         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5641         from accessors to property.
5642         
5643 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5644
5645         Fix #70722
5646         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5647         only for overrides.
5648         
5649 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5650
5651         * attribute.cs: Check for null and empty strings.  
5652
5653         I have lost another battle to Paolo.
5654
5655 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5656
5657         Fix #70942
5658         * class.cs (PropertyMethod): Set Parent field in ctors.
5659         (SetMethod.InternalParameters): Add unsafe switch hack.
5660         Override MarkForDuplicationCheck where it is appropriate.
5661
5662         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5663         It says whether container allows members with the same name.
5664         Base default is no.
5665         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5666         Removed is_method parameter.
5667
5668 2005-01-06  Duncan Mak  <duncan@ximian.com>
5669
5670         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5671         because the previous change led to incorrect reporting of CS1032
5672         ("Cannot define/undefine preprocessor symbols after first token in
5673         file"). Instead of using `tokens_seen' as the only flag that
5674         triggers CS1040, introduce `comments_seen'. This new flag is used
5675         to signify having seen comments on the current line, so it is
5676         unset after a newline.
5677
5678 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5679
5680         * doc.cs : When searching for a type, find nested type too.
5681           This fixes bug #71040.
5682
5683 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5684
5685         * doc.cs :
5686           - Warn missing member comment on those classes which also does not
5687             have doc comments. Fixed bug #71041.
5688           - Don't warn missing doc comment on default constructor.
5689             Fixed bug #71042.
5690
5691 2005-01-06  Duncan Mak  <duncan@ximian.com>
5692
5693         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5694         comments, set `tokens_seen' to true. This allows us to detect
5695         misplaced preprocessor directives (i.e. not at the beginning of
5696         the a line, nor after whitespaces). In that case, report error
5697         CS1040. This fixes bug #56460.
5698
5699         * cs-parser.jay (interface_member_declaration): Add checks for
5700         IsExplicitImpl, and report CS0541 error if an interface member is
5701         defined as an explicit interface declaration.
5702
5703 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5704
5705         Fix #70817
5706         * class.cs (PropertyMethod): Set Parent field in ctors.
5707         (SetMethod.InternalParameters): Add unsafe switch hack.
5708         
5709         * decl.cs (MemberCore.Parent): Cannot be readonly.
5710
5711 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5712
5713         * decl.cs (DeclSpace.ResolveType): Remove.
5714         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5715         Merge in code from ...
5716         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5717         * class.cs, enum.cs: Update to changes.
5718
5719 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5720
5721         * anonymous.cs: Ensure that we init the scope of our parent if it
5722         has not been initialized yet.
5723
5724 2004-12-30  Duncan Mak  <duncan@ximian.com>
5725
5726         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5727         if field.FieldBuilder is null. Fixes #70758.
5728
5729         * convert.cs: Fixed some typos and updated some of the comments.
5730         (ImplicitStandardConversionExists):
5731         (TryImplicitIntConversion): If `target_type' is an interface and
5732         the type of `ic' implements this interface, return true or a new
5733         BoxedCast instead of null. This fixes #70468.
5734
5735 2004-12-29  Duncan Mak  <duncan@ximian.com>
5736
5737         * expression.cs (Argument.Emit): Check that Expr is
5738         IMemoryLocation before casting to it, and report CS1510 otherwise.
5739
5740         This fixes #70402.
5741
5742 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5743
5744         * statement.cs (Block.ThisVariable): remove the recursion here, to
5745         make the --profile more sane.
5746
5747 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5748
5749         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5750         assembly, by JB Evain.
5751
5752 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5753
5754         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5755           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5756         "parent" refers to enclosing type/class.  "base" refers to superclass.
5757
5758 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5759
5760         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5761         Ensure that we only have GlobalAttributes.
5762         * attribute.cs (Attribute.Emit): Make non-virtual.
5763         (GlobalAttribute.Emit): Remove.
5764         (Attribute.Resolve): Make virtual.
5765         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5766         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5767         the argument. Don't create one.
5768         (Attribute.GetObsoleteAttribute): Likewise.
5769         (Attribute.GetClsCompliantAttributeValue): Likewise.
5770         * class.cs, decl.cs: Update to changes.
5771
5772 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5773
5774         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5775         
5776         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5777         
5778         * statement.cs (Foreach.Resolve): Add error 186 report.
5779
5780 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5781
5782         * expression.cs (Conditional.DoResolve): Add warning 429.
5783         
5784         * statement.cs (If.Resolve): Add warning 665.
5785
5786 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5787
5788         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5789         except when in the parser, and in GlobalAttribute.
5790         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5791         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5792         RootContext.Tree.Types.NamespaceEntry once work is done.
5793         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5794         and resets RootContext.Tree.Types.NamespaceEntry.
5795
5796 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5797
5798         * cs-parser.jay: Don't create a block for every variable.
5799
5800 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5801
5802         * location.cs: Provide extra information.
5803
5804         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5805         variables from the captured environment, it is the ldarg_0.
5806
5807 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5808
5809         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5810         find a conclusion.
5811         
5812         * class.cs: Changed warning level for 169 to avoid developer
5813         displeasure from warning flooding. It will be changed back when they
5814         fix most of current BCL warnings.
5815         
5816         * RootContext.cs: Pushed default WarningLevel to 3.
5817         
5818         * statement.cs: Removed unused variable.
5819
5820 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5821
5822         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5823         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5824         Add error 502 report.
5825         (StaticClass.DefineType): Add error 441 report.
5826         (Class.AllowedModifiersProp): New virtual property as temporary
5827         extension to AllowedModifiers.
5828         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5829         to share implementation with StaticClass and don't call virtual
5830         methods from ctor.
5831         
5832         * driver.cs (MainDriver): Add error 1558 test.
5833
5834         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5835         report. Moved error 36 test here.
5836
5837         * statement.cs (Throw.Resolve): Add error 724 report.
5838
5839         * typemanager.cs: Add out_attribute_type core type.
5840         
5841 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5842
5843         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5844         3018 report.
5845         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5846
5847         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5848         3017 report.
5849         
5850         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5851
5852         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5853         Add error 3023 report.
5854         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5855
5856         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5857         implementation.
5858
5859 2004-12-12  John Luke  <john.luke@gmail.com>
5860
5861         * driver.cs (AddArgs): take -- into account when
5862         adding arguments, fixes bug 65710 
5863
5864 2004-12-12  Martin Baulig  <martin@ximian.com>
5865
5866         * expression.cs (Unary.TryReduceNegative): Added support for
5867         SByteConstant and ByteConstant.
5868         (Unary.Reduce): Check error values from TryReduceNegative().
5869
5870 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5871
5872         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5873         and report exception as error 182.
5874
5875 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5876
5877         * driver.cs (Main): Fix message when there are warnings.
5878
5879 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5880
5881         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5882
5883 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5884
5885         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5886         Reduced number of warnings.
5887         
5888         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5889
5890 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5891
5892         * driver.cs: Removed message.
5893
5894         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5895
5896 2004-12-08    <vargaz@freemail.hu>
5897
5898         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5899
5900 2004-12-08  Martin Baulig  <martin@ximian.com>
5901
5902         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5903         instead of a CS3002 for properties and indexer.
5904
5905 2004-12-08  Martin Baulig  <martin@ximian.com>
5906
5907         * decl.cs (MemberName.ToString): Make this work again.
5908
5909 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5910
5911         * attribute.cs (Resolve): Add error 591 detection.
5912
5913         * class.cs (FieldMember.Define): Add error 1547 detection.
5914         (Indexer.Define): Add error 620 detection.
5915         (Operator.Define): Add error 590 detection.
5916
5917         * ecore.cs: Missing argument for error 79.
5918
5919         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5920         detection.
5921
5922 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5923
5924         Fix #70106
5925         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5926         only.
5927
5928 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5929
5930         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5931           Some operator comments were suppressed.
5932         * doc.cs : Implicit/explicit operator name in doc comments are like
5933           "op_Explicit(type)~returnType", so added suffix handling.
5934
5935 2004-12-07  Martin Baulig  <martin@ximian.com>
5936
5937         * decl.cs
5938         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5939         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5940         (DeclSpace.ec): New protected field; store the EmitContext here.
5941         (DeclSpace.EmitContext): New public property; moved here from
5942         `TypeContainer'.
5943         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5944         EmitContext.
5945
5946         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5947         (Enum.Emit): Don't create a new EmitContext.
5948
5949         * delegate.cs (Delegate.DefineType): Always create the
5950         EmitContext.
5951
5952         * iterators.cs (Iterators.DefineIterator): Create a new
5953         EmitContext and store it in `ec'.
5954
5955 2004-08-24  Martin Baulig  <martin@ximian.com>
5956
5957         * typemanager.cs
5958         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5959         this for accessibility checks.
5960         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5961         IsNestedFamilyAccessible.
5962         (TypeManager.IsSubclassOf): New method, do what the name actually
5963         says.   
5964
5965 2004-12-06  Raja R Harinath  <rharinath@novell.com>
5966
5967         Fix crash on cs0657-17.cs.
5968         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5969         Use RootContext.Tree.Types, not 'new RootTypes ()'.
5970         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5971         the case where the NamespaceEntry gets overwritten.
5972
5973 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
5974
5975         Fixed #69195, #56821
5976         * ecore.cs (ResolveBoolean): Tiny refactoring.
5977
5978         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5979         of right expression resolving when left is false constant and
5980         operator is LogicalAnd OR true constant and operator is LogicalOr.
5981
5982         * statement.cs (ResolveUnreachable): Always reports warning.
5983
5984 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
5985
5986         * class.cs: Distinguish between 1721 and 1722 (just a little help
5987         for the programmer).
5988
5989 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
5990
5991         * delegate.cs: Only allow this on new versions of the language. 
5992
5993 2004-12-02  Duncan Mak  <duncan@ximian.com>
5994
5995         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5996         Expression class.
5997         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5998         here as a static method. Take an additional bool out parameter
5999         `must_do_cs1540_check' for signaling to InstanceResolve.
6000         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6001         member field from PropertyExpr class and made it an argument of
6002         the method instead.
6003         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6004         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6005         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6006         and `remove_accessor' as well as InstanceResolve: report CS0122
6007         where applicable.
6008
6009         Fixes #70129.
6010
6011 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6012
6013         Fix test-327.cs, test-328.cs, and put in early infrastructure
6014         for eventually fixing #52697.
6015         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6016         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6017         from other methods.
6018         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6019         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6020         (VerifyUsing, error246): Update.
6021         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6022         'NamespaceEntry.LookupNamespaceOrType'.
6023
6024 2004-12-03  Martin Baulig  <martin@ximian.com>
6025
6026         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6027         method as our child, call AnonymousMethod.Compatible() on it.
6028
6029 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6030
6031         Disable XML documentation support in 'basic' profile.
6032         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6033         Redirect XmlElement to System.Object.
6034         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6035         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6036         * mcs.exe.sources: Add doc-bootstrap.cs.
6037         * doc-bootstrap.cs: New file.  Contains empty stub implementation
6038         of doc.cs.
6039
6040 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6041
6042         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6043           comments are allowed.
6044
6045 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6046
6047         * delegate.cs: Add checks for subtypes in paramaters and return values
6048         in VerifyMethod () to add support for Covariance/Contravariance
6049         in delegates.
6050         
6051 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6052
6053         * report.cs: Remove extra closing parenthesis.
6054
6055         * convert.cs (Error_CannotImplicitConversion): If the name of the
6056         types are the same, provide some extra information.
6057
6058         * class.cs (FieldBase): Use an unused bit field from the field to
6059         encode the `has_offset' property from the FieldMember.  This saves
6060         a couple of Ks on bootstrap compilation.
6061
6062         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6063         method as our child, return the AnonymousMethod resolved
6064         expression.
6065
6066         * expression.cs (New.DoResolve): Allow return values from
6067         NewDelegate to also include AnonymousMethods.
6068
6069         Fixes #70150.
6070
6071 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6072
6073         Fix bug #70102
6074         * attribute.cs (Resolve): Improved implementation of params
6075         attribute arguments.
6076
6077         * support.cs (ParameterData): Add HasParams to be faster.
6078
6079 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6080
6081         all things are for /doc support:
6082
6083         * doc.cs: new file that supports XML documentation generation.
6084         * mcs.exe.sources: added doc.cs.
6085         * driver.cs:
6086           Handle /doc command line option.
6087           Report error 2006 instead of 5 for missing file name for /doc.
6088           Generate XML documentation when required, after type resolution.
6089         * cs-tokenizer.cs:
6090           Added support for picking up documentation (/// and /** ... */),
6091           including a new XmlCommentState enumeration.
6092         * cs-parser.jay:
6093           Added lines to fill Documentation element for field, constant,
6094           property, indexer, method, constructor, destructor, operator, event
6095           and class, struct, interface, delegate, enum.
6096           Added lines to warn incorrect comment.
6097         * rootcontext.cs :
6098           Added Documentation field (passed only when /doc was specified).
6099         * decl.cs:
6100           Added DocComment, DocCommentHeader, GenerateDocComment() and
6101           OnGenerateDocComment() and some supporting private members for
6102           /doc feature to MemberCore.
6103         * class.cs:
6104           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6105         * delegate.cs:
6106           Added overriden DocCommentHeader.
6107         * enum.cs:
6108           Added overriden DocCommentHeader and GenerateDocComment().
6109
6110 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6111
6112         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6113         unwrapping the enumeration values, chain to
6114         DoConstantNumericPromotions again, so we can promote things to the
6115         fundamental types (takes care of enums that are bytes, sbytes).
6116
6117         Fixes bug #62054.
6118
6119 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6120
6121         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6122         Fix long-standing bug in type-lookup.  Use FindType instead of
6123         LookupType when ec.ResolvingTypeTree.
6124         (Attribute.ResolveType, Attribute.Resolve)
6125         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6126         Update to changes.
6127         (Attributes.Search): Remove internal version.  Update.
6128         (Attributes.SearchMulti): Update.
6129         (Attributes.GetClsCompliantAttribute): Remove.
6130         (Attributes.GetIndexerNameAttribute): Remove.
6131         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6132         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6133         * class.cs (Indexer.Define): Likewise.
6134
6135 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6136
6137         Fix bug #68790
6138         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6139         MarshallByReference members access.
6140
6141         * expression.cs: Use CheckMarshallByRefAccess;
6142         Better error CS0197 message.
6143
6144         * report.cs: Print whole related error message.
6145
6146 2004-11-30  Raja R Harinath  <rharinath@novell.com>
6147
6148         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6149         the current directory to help debugging.
6150
6151 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6152
6153         * class (GetClassBases): Better error 60 report.
6154         (EventProperty): Disabled warning 67 detection.
6155
6156 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6157
6158         Fix bug #60324
6159         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6160
6161         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6162         precise values.
6163
6164 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6165
6166         Fix bug #49488
6167         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6168
6169         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6170
6171 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6172
6173         * attribute.cs (Attribute.Resolve): Refine error reporting and
6174         report a cs0117 if the identifier does not exist, to distinguish
6175         from 0617 which is a miss-use of the actual identifier.
6176
6177         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6178         between cs0070 and cs0079.
6179
6180         * class.cs (MemberBase.DoDefine): When reporting a wrong
6181         accessibility level, we use MethodCore to compare instead of
6182         Method (this was a regression in some refactoring effort).
6183
6184         So now we correctly report cs0056 again.
6185
6186         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6187         testing the target_type (which was known to be object_type) and
6188         not the source type (which is anonymous_method).
6189
6190         Fixed reporting of error cs1660.
6191
6192         * expression.cs (UserCast.Source): Expose the underlying cast.
6193
6194         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6195         allowed types to find a match to int32 first (most common).
6196
6197         In addition, it ignores any ImplicitUserConversions that did an
6198         internal implicit conversion (as the switch statement allows only
6199         one integral conversion to exist).
6200
6201         * class.cs (PartialContainer.Create): rename `name' to
6202         `member_name' for clarity.  Then replace the string calls with a
6203         call to MemberName.GetPartialName, as now using
6204         MemberName.ToString is an error (this is due to the side effects
6205         it had, that were fixed in the past).
6206
6207         This will restore the error reporting on a number of partial class
6208         errors that were missusing this (and getting an exception as a
6209         results, which is now just a plain textual warning, because
6210         yyparse debug output would crash otherwise).
6211
6212 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6213
6214         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6215
6216 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6217
6218         * rootcontext.cs (LookupType): Make sure to cache lookups that
6219         don't give us a negative result. This saves about 5% of corlib
6220         compilation time.
6221
6222 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6223
6224         * report.cs (AbstractMessage.Print): messages are sent to stderr
6225
6226         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6227         non-interface in the list of interfaces (at this point, either
6228         parent was properly set, or a base class is being listed in the
6229         interfaces section).
6230
6231         This flags error 1722, and resolves the crash from bug 69259.
6232
6233 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6234
6235         * statement.cs (Using.EmitExpressionFinally): make this work right
6236         for valuetypes. Fixes 69926.
6237
6238 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6239
6240         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6241         converted to an enum" here, before we try to change the underlying
6242         type.  This code exists, but it is a different code path than the
6243         one used while encoding constants.
6244
6245         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6246         old bug: when converting from the null literal to a pointer,
6247         return an EmptyCast, not the NullLiteral.
6248
6249         This fixes #69921, the recent null_type changes probably made this
6250         bug more prominent.
6251
6252         (ImplicitReferenceConversionExists): In addition, resynchronized
6253         the code here, so it matches the same code in
6254         ImplicitReferenceConversionExists for the `from any class-type S
6255         to any interface-type T'.
6256         
6257
6258 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6259
6260         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6261
6262 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6263
6264         * cs-parser.jay: Use verbosity accordingly. 
6265
6266 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6267
6268         * expression.cs (Unary.ResolveOperator): Do not report warning;
6269         AddressOf reads from variable.
6270         
6271         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6272
6273 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6274
6275         Fix bug #69462
6276
6277         * attribute.cs (Attributable): Removed CheckTargets.
6278         (Attributes.Emit): Explicit attribute targets are tested here.
6279
6280         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6281         not enabled for interfaces.
6282
6283         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6284         (GetAssemblyName): Ouch next bug there.
6285
6286 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6287
6288         * expression.cs: Error 275 added.
6289         
6290 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6291
6292         Fix bug #69177 (Implemented decimal constant support)
6293
6294         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6295         (BinaryFold): Add DecimalConstant.
6296
6297         * const.cs (Define): Decimal constant 
6298         (is not constant.
6299         (ChangeType): Add decimal type handling.
6300         (LookupConstantValue): Don't set value for decimal type but
6301         emit DecimalConstantAttribute. Needed for constant optimization.
6302
6303         * constant.cs (ToDecimal): New method.
6304         (ConvertToDecimal): New method.
6305         (IntConstant): Implemented ConvertToDecimal.
6306         (DecimalConstant.Emit): Emit optimized version for decimals in
6307         int range.
6308
6309         * expression.cs (ResolveOperator): Changed order of constant
6310         reduction to work correctly with native types which have
6311         overloaded operators.
6312         (ResolveMemberAccess): Extract constant value from attribute
6313         for decimal type.
6314
6315         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6316
6317         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6318         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6319         (ChangeType): Decimal is special.
6320         (TypeToCoreType): Add decimal type.
6321
6322 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6323
6324         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6325         decimal types.
6326
6327 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6328
6329         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6330         test cs1667-5.cs.
6331
6332 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6333
6334         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6335
6336         * pending.cs (PendingImplementation): Grab only interfaces.
6337
6338 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6339
6340         * statement.cs (ForeachHelperMethods): Add location member and
6341         error 202 detection.
6342
6343 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6344
6345         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
6346         automatically handled by executable.make.
6347         (PROGRAM): Make profile-specific.
6348
6349 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6350
6351         * expression.cs (DoResolveBase): Fixed wrong warning for out
6352         variables.
6353
6354 2004-11-18  Martin Baulig  <martin@ximian.com>
6355
6356         Merged latest changes into gmcs.  Please keep this comment in
6357         here, it makes it easier for me to see what changed in MCS since
6358         the last time I merged.
6359
6360 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6361
6362         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6363         (TypeHandle.GetMemberCache): New.
6364         (TypeHandle.TypeHandle): Update.
6365         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6366         (TypeManager.LookupParentInterfacesCache):
6367         Rename from LookupInterfaceCache.  Optimize slightly.
6368         (TypeManager.MemberLookup_FindMembers): Update.
6369         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6370         multi-type variant.
6371         (AddCacheContents): Rename from AddHashtable.
6372         * class.cs (TypeContainer.parent_container): Remove.
6373         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6374         (TypeContainer.DoDefineMembers): Don't initialize it.
6375         Update to name changes.
6376         
6377 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6378
6379         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6380         that factors the code to check access modifiers on override.  
6381
6382         (PropertyBase): Use the code here.
6383
6384         Patch from Lluis S'anchez, fixes bug #69361.
6385
6386 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6387
6388         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6389         routine that is used to report the use of a captured variable
6390         whose address has been taken.
6391
6392         There are two checks: one when variables are being captured and
6393         the other check is when the address of a variable is taken. 
6394         
6395         (because an anonymous methods might be resolved before *or* after
6396         the address has been taken) and 
6397
6398         * expression.cs (Conditional.DoResolve): Remove the special
6399         casing that Martin added to trueExpr and falseExpr being both
6400         NullLiteral.  We get the right behavior now just by introducing
6401         the null_type into the compiler. 
6402
6403         * convert.cs (ExplicitConversion): Change the code to use
6404         null_type instead of testing `expr is NullLiteral'.
6405         (ImplicitConversionStandard): use null_type too.
6406         (ImplicitReferenceConversionExists): use null_type too.
6407         (ImplicitReferenceConversion): use null_type too.
6408
6409         * literal.cs: The type of `NullLiteral' is now null_type instead
6410         of object_type. 
6411         (Resolve): Set the type here.
6412
6413         * typemanager.cs: Introduce null_type.
6414
6415 2004-11-17  Martin Baulig  <martin@ximian.com>
6416
6417         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6418         direction, like FindMembers() does.  Fixes #69546, testcase is in
6419         test-315.cs.    
6420
6421 2004-11-16  Martin Baulig  <martin@ximian.com>
6422
6423         This is based on a patch from Marek Safar, see bug #69082.
6424         Fixes bugs #63705 and #67130.
6425
6426         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6427         method; create a MemberCache for an interface type and cache the
6428         result.
6429
6430         * decl.cs (IMemberContainer.ParentContainer): Removed.
6431         (IMemberContainer.ParentCache): New property.
6432         (MemberCache.SetupCacheForInterface): Removed.
6433         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6434         to create a cache for an interface's "parent".
6435
6436         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6437         interfaces too.
6438
6439 2004-11-16  Martin Baulig  <martin@ximian.com>
6440
6441         Merged back from gmcs; these changes already went into gmcs a
6442         couple of weeks ago.
6443
6444         * typemanager.cs
6445         (TypeManager.AddUserType): Removed the `ifaces' argument.
6446         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6447         `TypeExpr []'.
6448         (TypeManager.AddUserInterface): Removed.
6449         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6450         `TypeExpr []'.
6451         (TypeManager.GetInterfaces): Likewise.
6452         (TypeManager.GetExplicitInterfaces): Likewise.
6453
6454         * ecore.cs (TypeExpr.GetInterfaces): Removed.
6455
6456         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6457         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6458
6459 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6460
6461         * statement.cs: Avoid adding bools to a hashtable.
6462
6463 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6464
6465         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6466         calling an unsafe method from a safe location.
6467
6468 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6469
6470         Fix #69167
6471         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6472
6473 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6474
6475         * namespace.cs (VerifyUsing): use GetPartialName instead of
6476         ToString. 
6477
6478 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6479
6480         * statement.cs (Return.Resolve): Fix regression in typo: if
6481         `in_exc', we have to request a NeedReturnLabel, this was a typo
6482         introduced in the anonymous method check-in.  Fixes #69131.
6483
6484         * Indexers were using the ShortName when defining themselves,
6485         causing a regression in the compiler bootstrap when applying the
6486         patch from 2004-11-02 (first part), now they use their full name
6487         and the bug is gone.
6488
6489 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6490
6491         * driver.cs: Strip the path from the names of embedded resources. Fixes
6492         #68519.
6493
6494 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6495
6496         Fix error message regression: cs0104-2.cs.
6497         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6498         (AliasEntry.Resolve): Update.
6499         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6500         'silent' flag.
6501         (RootContext.LookupType): Update.
6502
6503 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6504
6505         * cs-parser.jay: Add support for handling accessor modifiers
6506         * class: Add support port accessor modifiers and error checking,
6507         define PropertyMethod.Define as virtual (not abstract anymore)
6508         * ecore.cs: Add checking for proeprties access with access modifiers
6509         * iterators.cs: Modify Accessor constructor call based in the modified
6510         constructor
6511 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6512
6513         * expression.cs (StringConcat): Handle being called twice,
6514         as when we have a concat in a field init with more than two
6515         ctors in the class
6516
6517 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6518
6519         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6520         special case explicit implementations, we should always produce
6521         the .property or .event declaration.
6522         
6523         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6524         since it will not return correct data if people use this
6525         unresolved in the presence of using statements (see test-313).
6526
6527         * class.cs (MethodData.Define): If we are an explicit interface
6528         implementation, set the method name to the full name of the
6529         interface plus the name of the method.  
6530
6531         Notice that using the method.MethodName.GetFullName() does not
6532         work, as it will only contain the name as declared on the source
6533         file (it can be a shorthand in the presence of using statements)
6534         and not the fully qualifed type name, for example:
6535
6536         using System;
6537
6538         class D : ICloneable {
6539                 object ICloneable.Clone ()  {
6540                 }
6541         }
6542
6543         Would produce a method called `ICloneable.Clone' instead of
6544         `System.ICloneable.Clone'.
6545
6546         * namespace.cs (Alias.Resolve): Use GetPartialName.
6547         
6548 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6549
6550         * cs-parser.jay: Add error 1055 report.
6551
6552 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6553
6554         * assign.cs (Assign.DoResolve): Only do the transform of
6555         assignment into a New if the types are compatible, if not, fall
6556         through and let the implicit code deal with the errors and with
6557         the necessary conversions. 
6558
6559 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6560
6561         * cs-parser.jay: Add error 1031 report.
6562
6563         * cs-tokenizer.cs: Add location for error 1038.
6564
6565 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6566
6567         * cs-parser.jay: Add error 1016 report.
6568
6569 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6570
6571         * cs-parser.jay: Add errors 1575,1611 report.
6572
6573 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6574
6575         * cs-parser.jay: Add error 1001 report.
6576
6577 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6578
6579         Fix #68850
6580         * attribute.cs (GetMarshal): Add method argument for
6581         caller identification.
6582
6583         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6584         agument for GetMarshal and RuntimeMissingSupport.
6585
6586 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6587
6588         * attribute.cs (ExtractSecurityPermissionSet): Removed
6589         TypeManager.code_access_permission_type.
6590
6591         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6592
6593 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6594
6595         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6596         for obsolete use of a variable here.   Fixes regression on errors
6597         cs0619-25 and cs0619-26.
6598
6599 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6600
6601         Fix #62358, implemented security attribute encoding.
6602
6603         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6604         Tests permitted SecurityAction for assembly or other types.
6605         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6606         data from SecurityPermissionAttribute to PermisionSet class.
6607
6608         * class.cs (ApplyAttributeBuilder): Added special handling
6609         for System.Security.Permissions.SecurityAttribute based types.
6610
6611         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6612         special handling for System.Security.Permissions.SecurityAttribute
6613         based types.
6614
6615         * enum.cs (ApplyAttributeBuilder): Added special handling
6616         for System.Security.Permissions.SecurityAttribute based types.
6617
6618         * parameter.cs (ApplyAttributeBuilder): Added special handling
6619         for System.Security.Permissions.SecurityAttribute based types.
6620
6621         * rootcontext.cs: Next 2 core types.
6622
6623         * typemanager.cs (TypeManager.security_permission_attr_type):
6624         Built in type for the SecurityPermission Attribute.
6625         (code_access_permission_type): Build in type.
6626
6627 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6628
6629         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6630         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6631         all of this information into
6632         EmitContext.EmitCapturedVariableInstance.
6633         
6634         * codegen.cs (EmitCapturedVariableInstance): move here the
6635         funcionality of emitting an ldarg.0 in the presence of a
6636         remapping.   This centralizes the instance emit code.
6637
6638         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6639         then emit a load of this: it means that we have reached the
6640         topmost ScopeInfo: the one that contains the pointer to the
6641         instance of the class hosting the anonymous method.
6642
6643         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6644         captures to the topmost CaptureContext.
6645
6646 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6647
6648         * expression.cs (LocalVariableReference): Move the knowledge about
6649         the iterators into codegen's EmitCapturedVariableInstance.
6650
6651 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6652
6653         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6654         all code paths return a value from an anonymous method (it is the
6655         same as the 161 error, but for anonymous methods).
6656
6657 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6658
6659         The introduction of anonymous methods in the compiler changed
6660         various ways of doing things in the compiler.  The most
6661         significant one is the hard split between the resolution phase
6662         and the emission phases of the compiler.
6663
6664         For instance, routines that referenced local variables no
6665         longer can safely create temporary variables during the
6666         resolution phase: they must do so from the emission phase,
6667         since the variable might have been "captured", hence access to
6668         it can not be done with the local-variable operations from the runtime.
6669         
6670         * statement.cs 
6671
6672         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6673         is a toplevel block.
6674
6675         (ToplevelBlock): A new kind of Block, these are the blocks that
6676         are created by the parser for all toplevel method bodies.  These
6677         include methods, accessors and anonymous methods.
6678
6679         These contain some extra information not found in regular blocks:
6680         A pointer to an optional CaptureContext (for tracking captured
6681         local variables and parameters).  A pointer to the parent
6682         ToplevelBlock.
6683         
6684         (Return.Resolve): Catch missmatches when returning a value from an
6685         anonymous method (error 1662).
6686         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6687         phase.
6688
6689         (Break.Resolve): ditto.
6690
6691         (SwitchLabel): instead of defining the labels during the
6692         resolution phase, we now turned the public ILLabel and ILLabelCode
6693         labels into methods called GetILLabelCode() and GetILLabel() that
6694         only define the label during the Emit phase.
6695
6696         (GotoCase): Track the SwitchLabel instead of the computed label
6697         (its contained therein).  Emit the code by using
6698         SwitchLabel.GetILLabelCode ().
6699
6700         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6701         whether the Local has been captured or not.
6702
6703         (LocalInfo.IsCaptured): New property, used to tell whether the
6704         local has been captured.
6705         
6706         * anonymous.cs: Vastly updated to contain the anonymous method
6707         support.
6708
6709         The main classes here are: CaptureContext which tracks any
6710         captured information for a toplevel block and ScopeInfo used to
6711         track the activation frames for various local variables.   
6712
6713         Each toplevel block has an optional capture context associated
6714         with it.  When a method contains an anonymous method both the
6715         toplevel method and the anonymous method will create a capture
6716         context.   When variables or parameters are captured, they are
6717         recorded on the CaptureContext that owns them, for example:
6718
6719         void Demo () {
6720              int a;
6721              MyDelegate d = delegate {
6722                  a = 1;
6723              }
6724         }
6725
6726         Here `a' will be recorded as captured on the toplevel
6727         CapturedContext, the inner captured context will not have anything
6728         (it will only have data if local variables or parameters from it
6729         are captured in a nested anonymous method.
6730
6731         The ScopeInfo is used to track the activation frames for local
6732         variables, for example:
6733
6734         for (int i = 0; i < 10; i++)
6735                 for (int j = 0; j < 10; j++){
6736                    MyDelegate d = delegate {
6737                         call (i, j);
6738                    }
6739                 }
6740
6741         At runtime this captures a single captured variable `i', but it
6742         captures 10 different versions of the variable `j'.  The variable
6743         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6744         recorded on a child.  
6745
6746         The toplevel ScopeInfo will also track information like the `this'
6747         pointer if instance variables were referenced (this is necessary
6748         as the anonymous method lives inside a nested class in the host
6749         type of the method). 
6750
6751         (AnonymousMethod): Expanded to track the Toplevel, implement
6752         `AnonymousMethod.Compatible' to tell whether an anonymous method
6753         can be converted to a target delegate type. 
6754
6755         The routine now also produces the anonymous method content
6756
6757         (AnonymousDelegate): A helper class that derives from
6758         DelegateCreation, this is used to generate the code necessary to
6759         produce the delegate for the anonymous method that was created. 
6760
6761         * assign.cs: API adjustments for new changes in
6762         Convert.ImplicitStandardConversionExists.
6763
6764         * class.cs: Adjustments to cope with the fact that now toplevel
6765         blocks are of type `ToplevelBlock'. 
6766
6767         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6768         insteda of standard blocks.
6769
6770         Flag errors if params arguments are passed to anonymous methods.
6771
6772         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6773         `CurrentAnonymousMethod' which points to the current Anonymous
6774         Method.  The variable points to the AnonymousMethod class that
6775         holds the code being compiled.  It is set in the new EmitContext
6776         created for the anonymous method.
6777
6778         (EmitContext.Phase): Introduce a variable and an enumeration to
6779         assist in enforcing some rules about when and where we are allowed
6780         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6781         only one that enfonces this right now).
6782
6783         (EmitContext.HaveCaptureInfo): new helper method that returns
6784         whether we have a CapturedContext initialized.
6785
6786         (EmitContext.CaptureVariable): New method used to register that a
6787         LocalInfo must be flagged for capturing. 
6788
6789         (EmitContext.CapturedParameter): New method used to register that a
6790         parameters must be flagged for capturing. 
6791         
6792         (EmitContext.CapturedField): New method used to register that a
6793         field must be flagged for capturing. 
6794
6795         (EmitContext.HaveCapturedVariables,
6796         EmitContext.HaveCapturedFields): Return whether there are captured
6797         variables or fields. 
6798
6799         (EmitContext.EmitMethodHostInstance): This is used to emit the
6800         instance for the anonymous method.  The instance might be null
6801         (static methods), this (for anonymous methods that capture nothing
6802         and happen to live side-by-side with the current method body) or a
6803         more complicated expression if the method has a CaptureContext.
6804
6805         (EmitContext.EmitTopBlock): Routine that drives the emission of
6806         code: it will first resolve the top block, then emit any metadata
6807         and then emit the code.  The split is done so that we can extract
6808         any anonymous methods and flag any captured variables/parameters.
6809         
6810         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6811         during this phase, the ILGenerator should not be used as labels
6812         and local variables declared here might not be accessible to any
6813         code that is part of an anonymous method.  
6814
6815         Exceptions to this include the temporary variables that are
6816         created by some statements internally for holding temporary
6817         variables. 
6818         
6819         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6820         metadata for a cb
6821
6822         (EmitContext.TemporaryReturn): This method is typically called
6823         from the Emit phase, and its the only place where we allow the
6824         ReturnLabel to be defined other than the EmitMeta.  The reason is
6825         that otherwise we would have to duplicate a lot of logic in the
6826         Resolve phases of various methods that today is on the Emit
6827         phase. 
6828
6829         (EmitContext.NeedReturnLabel): This no longer creates the label,
6830         as the ILGenerator is not valid during the resolve phase.
6831
6832         (EmitContext.EmitThis): Extended the knowledge in this class to
6833         work in anonymous methods in addition to iterators. 
6834
6835         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6836         code is necessary on the stack to access the instance to a local
6837         variable (the variable will be accessed as a field).
6838
6839         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6840         EmitContext.EmitAddressOfParameter): Routines to support
6841         parameters (not completed at this point). 
6842         
6843         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6844         will also remove the parameters.
6845
6846         * convert.cs (Convert): Define a `ConstantEC' which points to a
6847         null.  This is just to prefity some code that uses
6848         ImplicitStandardConversion code and do not have an EmitContext
6849         handy.
6850
6851         The idea is to flag explicitly that at that point in time, it is
6852         known that the conversion will not trigger the delegate checking
6853         code in implicit conversions (which requires a valid
6854         EmitContext). 
6855
6856         Everywhere: pass new EmitContext parameter since
6857         ImplicitStandardConversionExists now requires it to check for
6858         anonymous method conversions. 
6859
6860         (Convert.ImplicitStandardConversionExists): If the type of an
6861         expression is the anonymous_method_type, and the type is a
6862         delegate, we invoke the AnonymousMethod.Compatible method to check
6863         whether an implicit conversion is possible. 
6864
6865         (Convert.ImplicitConversionStandard): Only do implicit method
6866         group conversions if the language level is not ISO_1.
6867
6868         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6869         MethodInfo for the Invoke method.  used by Delegate and
6870         AnonymousDelegate.
6871
6872         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6873         method conversions if the target type is a delegate.
6874
6875         Removed extra debugging nops.
6876
6877         (LocalVariableReference): Turn the `local_info' into a public
6878         field. 
6879
6880         Add `prepared' field, the same hack used for FieldExprs to cope
6881         with composed assignments, as Local variables do not necessarily
6882         operate purely on the stack as they used to: they can be captured
6883         fields. 
6884
6885         Add `temp' for a temporary result, like fields.
6886
6887         Refactor DoResolve and DoResolveLValue into DoResolveBase.
6888
6889         It now copes with Local variables that are captured and emits the
6890         proper instance variable to load it from a field in the captured
6891         case. 
6892
6893         (ParameterReference.DoResolveBase): During the resolve phase,
6894         capture parameters if we are in an anonymous method.
6895
6896         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6897         anonymous method, use the EmitContext helper routines to emit the
6898         parameter reference.
6899
6900         * iterators.cs: Set RemapToProxy to true/false during the
6901         EmitDispose class.
6902
6903         * parameters.cs (GetParameterByName): New helper method. 
6904
6905         * typemanager.cs (anonymous_method_type) a new type that
6906         represents an anonyous method.  This is always an internal type,
6907         used as a fencepost to test against the anonymous-methodness of an
6908         expression. 
6909         
6910 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
6911
6912         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6913         561 report.
6914         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6915
6916 2004-10-18  Martin Baulig  <martin@ximian.com>
6917
6918         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6919         `Type' directly, but call ResolveType() on it.
6920         (Catch.Resolve): Likewise.
6921         (Foreach.Resolve): Likewise.
6922
6923 2004-10-18  Martin Baulig  <martin@ximian.com>
6924
6925         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6926         `Type' directly, but call ResolveType() on it.
6927         (Probe.DoResolve): Likewise.
6928         (ArrayCreation.LookupType): Likewise.
6929         (TypeOf.DoResolve): Likewise.
6930         (SizeOf.DoResolve): Likewise.
6931
6932 2004-10-18  Martin Baulig  <martin@ximian.com>
6933
6934         * expression.cs (Invocation.BetterFunction): Put back
6935         TypeManager.TypeToCoreType().
6936
6937 2004-10-18  Raja R Harinath  <rharinath@novell.com>
6938
6939         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6940         the ResolveType.
6941
6942 2004-10-18  Martin Baulig  <martin@ximian.com>
6943
6944         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
6945         `Type' directly, but call ResolveType() on it.
6946
6947 2004-10-18  Martin Baulig  <martin@ximian.com>
6948
6949         * class.cs (FieldMember.Define): Don't access the TypeExpr's
6950         `Type' directly, but call ResolveType() on it.
6951         (MemberBase.DoDefine): Likewise.
6952
6953         * expression.cs (New.DoResolve): Don't access the TypeExpr's
6954         `Type' directly, but call ResolveType() on it.
6955         (ComposedCast.DoResolveAsTypeStep): Likewise.
6956
6957         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6958         `Type' directly, but call ResolveType() on it.
6959
6960 2004-10-17  John Luke  <john.luke@gmail.com>
6961
6962         * class.cs (Operator.GetSignatureForError): use CSharpName
6963
6964         * parameter.cs (Parameter.GetSignatureForError): Returns
6965         correct name even if was not defined.
6966
6967 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6968
6969         Fix #65816.
6970         * class.cs (TypeContainer.EmitContext): New property.
6971         (DefineNestedTypes): Create an emitcontext for each part.
6972         (MethodCore.DoDefineParameters): Use container's emitcontext.
6973         Pass type array to InternalParameters.
6974         (MemberBase.DoDefine): Use container's emitcontext.
6975         (FieldMember.Define): Likewise.
6976         (Event.Define): Likewise.
6977         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6978         Pass type array to InternalParameters.
6979         (SetIndexerMethod.GetParameterInfo): Likewise.
6980         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6981         * delegate.cs (Define): Pass emitcontext to
6982         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6983         array to InternalParameters.
6984         * expression.cs (ParameterReference.DoResolveBase): Pass
6985         emitcontext to GetParameterInfo.
6986         (ComposedCast.DoResolveAsTypeStep): Remove check on
6987         ec.ResolvingTypeTree.
6988         * parameter.cs (Parameter.Resolve): Change argument to
6989         EmitContext.  Use ResolveAsTypeTerminal.
6990         (Parameter.GetSignature): Change argument to EmitContext.
6991         (Parameters.ComputeSignature): Likewise.
6992         (Parameters.ComputeParameterTypes): Likewise.
6993         (Parameters.GetParameterInfo): Likewise.
6994         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6995         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6996         * support.cs (InternalParameters..ctor): Remove variant that takes
6997         a DeclSpace.
6998         * typemanager.cs (system_intptr_expr): New.
6999         (InitExpressionTypes): Initialize it.
7000
7001 2004-10-12  Chris Toshok  <toshok@ximian.com>
7002
7003         * cs-parser.jay: fix location for try_statement and catch_clause.
7004
7005 2004-10-11  Martin Baulig  <martin@ximian.com>
7006
7007         * report.cs: Don't make --fatal abort on warnings, we have
7008         -warnaserror for that.
7009
7010 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7011
7012         More DeclSpace.ResolveType avoidance.
7013         * decl.cs (MemberCore.InUnsafe): New property.
7014         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7015         with newly created EmitContext.
7016         (FieldMember.Define): Likewise.
7017         * delegate.cs (Delegate.Define): Likewise.
7018         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7019         only if normal name-lookup fails.
7020         (TypeExpr.DoResolve): Enable error-checking.
7021         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7022         (SizeOf.DoResolve): Likewise.
7023         (ComposedCast.DoResolveAsTypeStep): Likewise.
7024         (StackAlloc.DoResolve): Likewise.
7025         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7026         (Block.Unsafe): New property.
7027         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7028         (Unsafe): Set 'unsafe' flag of contained block.
7029         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7030         (Fixed.Resolve): Likewise.
7031         (Catch.Resolve): Likewise.
7032         (Using.ResolveLocalVariableDecls): Likewise.
7033         (Foreach.Resolve): Likewise.
7034
7035 2004-10-05  John Luke <john.luke@gmail.com>
7036
7037         * cs-parser.jay: add location to error CS0175
7038
7039 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7040
7041         * ecore.cs (Expression.Constantity): Add support for turning null
7042         into a constant.
7043
7044         * const.cs (Const.Define): Allow constants to be reference types
7045         as long as the value is Null.
7046
7047 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7048
7049         * namespace.cs (NamespaceEntry.Using): No matter which warning
7050         level is set, check if this namespace name has already been added.
7051
7052 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7053
7054         * expression.cs: reftype [!=]= null should always use br[true,false].
7055         # 67410
7056
7057 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7058
7059         Fix #67108
7060         * attribute.cs: Enum conversion moved to 
7061         GetAttributeArgumentExpression to be applied to the all
7062         expressions.
7063
7064 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7065
7066         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7067         * class.c (TypeContainer.DefineType): Flag error if
7068         base types aren't accessible due to access permissions.
7069         * decl.cs (DeclSpace.ResolveType): Move logic to
7070         Expression.ResolveAsTypeTerminal.
7071         (DeclSpace.ResolveTypeExpr): Thin layer over
7072         Expression.ResolveAsTypeTerminal.
7073         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7074         Refactor code into NestedAccess.  Use it.
7075         (DeclSpace.NestedAccess): New.
7076         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7077         argument to silence errors.  Check access permissions.
7078         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7079         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7080         (Cast.DoResolve): Likewise.
7081         (New.DoResolve): Likewise.
7082         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7083         (TypeOf.DoResolve): Likewise.
7084
7085         * expression.cs (Invocation.BetterConversion): Return the Type of
7086         the better conversion.  Implement section 14.4.2.3 more faithfully.
7087         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7088         section 14.4.2.2 explicit.
7089         (Invocation.OverloadResolve): Update.
7090         (Invocation): Remove is_base field.
7091         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7092         (Invocation.Emit): Likewise.
7093
7094 2004-09-27  Raja R Harinath  <rharinath@novell.com>
7095
7096         * README: Update to changes.
7097
7098 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7099
7100         * cs-parser.jay: Reverted 642 warning fix.
7101
7102 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7103
7104         Fix bug #66615
7105         * decl.cs (FindMemberWithSameName): Indexer can have more than
7106         1 argument.
7107
7108 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7109
7110         * expression.cs (LocalVariableReference.DoResolveLValue):
7111         Do not report warning 219 for out values.
7112         (EmptyExpression.Null): New member to avoid extra allocations.
7113
7114 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7115
7116         * cs-parser.jay: Fix wrong warning 642 report.
7117
7118         * cs-tokenizer.cs (CheckNextToken): New helper;
7119         Inspect next character if is same as expected.
7120
7121 2004-09-23  Martin Baulig  <martin@ximian.com>
7122
7123         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7124         (Convert.ImplicitReferenceConversionExists): Likewise.
7125
7126 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7127
7128         * class.cs (Operator.Define): Add error 448 and 559 report.
7129
7130 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7131
7132         * class.cs (MemberBase.IsTypePermitted): New protected
7133         method for checking error CS0610.
7134
7135 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7136
7137         * class.cs (TypeContainer.HasExplicitLayout): New property
7138         Returns whether container has StructLayout attribute set Explicit.
7139         (FieldMember): New abstract class for consts and fields.
7140         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7141         (Field): Reuse FieldMember.
7142
7143         * const.cs (Const): Reuse FieldMember.
7144
7145         * rootcontext.cs: EmitConstants call moved to class.
7146
7147 2004-09-22  Martin Baulig  <martin@ximian.com>
7148
7149         Thanks to Peter Sestoft for this bug report.
7150
7151         * expression.cs (Conditional): If both the `trueExpr' and the
7152         `falseExpr' is a NullLiteral, return a NullLiteral.
7153
7154 2004-09-22  Martin Baulig  <martin@ximian.com>
7155
7156         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7157         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7158         for the "get_Current" call.
7159
7160 2004-09-22  Martin Baulig  <martin@ximian.com>
7161
7162         Marek and me just fixed one of our oldest bugs: #28562 :-)
7163
7164         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7165
7166         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7167         we're an EnumConstant, just return that.
7168         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7169         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7170         to get the value which'll actually be written into the attribute.
7171         However, we have to use GetValue() to access the attribute's value
7172         in the compiler.        
7173
7174 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7175
7176         * constant.cs (Constant.IsNegative): New abstract property
7177         IsNegative.
7178
7179         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7180         (StackAlloc.DoResolve): Reused IsNegative.
7181
7182 2004-09-21  Martin Baulig  <martin@ximian.com>
7183
7184         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7185         if we're used in an iterator, we may be called from different
7186         methods.
7187
7188         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7189         we actually have an exception block.
7190
7191 2004-09-20  John Luke <jluke@cfl.rr.com>
7192
7193         * class.cs, cs-parser.jay: Improve the error report for 1520:
7194         report the actual line where the error happens, not where the
7195         class was declared.
7196
7197         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7198         Pass location information that was available elsewhere.
7199
7200 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
7201
7202         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7203         runtime to delay sign assemblies.
7204
7205 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7206
7207         * cs-parser.jay: Do not report the stack trace, this is barely
7208         used nowadays.
7209
7210 2004-08-22  John Luke  <john.luke@gmail.com>
7211  
7212         * driver.cs : check that a resource id is not already used
7213         before adding it, report CS1508 if it is, bug #63637
7214
7215 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7216
7217         * ecore.cs: Removed dead code.
7218
7219 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
7220
7221         * class.cs: Do not report warning CS0067 on the interfaces.
7222
7223 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7224
7225         * cs-parser.jay: Add error 504 report.
7226
7227 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7228
7229         * rootcontext.cs: WarningLevel is 4 by default now.
7230
7231         * statement.cs (Fixed.Resolve): Do not null
7232         VariableInfo.
7233
7234 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7235
7236         Fixed bug #55780
7237         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7238         deep search when property is not virtual.
7239         (PropertyExpr.ResolveAccessors): Make one call for both
7240         accessors.
7241
7242 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7243
7244         Fixed bug #65766
7245         * statement.cs: Error 152 report constains also location.
7246
7247 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7248
7249         Fixed bug #65766
7250         * const.cs: Explicitly set constant as static.
7251
7252 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7253
7254         Fixed bug #64226
7255         * cs-parser.jay: Add error 1017 report.
7256
7257 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7258
7259         Fixed bug #59980, #64224
7260         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7261
7262         * typemanager.cs (IsSpecialMethod): Simplified
7263
7264 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7265
7266         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7267         condition with better params.
7268
7269 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7270
7271         Fixed bug #65238
7272         * attribute.cs (Resolve): Property has to have both
7273         accessors.
7274
7275 2004-09-14  Martin Baulig  <martin@ximian.com>
7276
7277         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7278
7279 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7280
7281         Fixed bug #61902
7282         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7283         called and is obsolete then this member suppress message
7284         when call is inside next [Obsolete] method or type.
7285
7286         * expression.cs: Use TestObsoleteMethodUsage member.
7287
7288 2004-09-14  Martin Baulig  <martin@ximian.com>
7289
7290         * cs-parser.jay: Sync a bit with the GMCS version.
7291
7292 2004-09-14  Martin Baulig  <martin@ximian.com>
7293
7294         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7295         (CSharpParser.yacc_verbose_flag): New public field.
7296
7297         * genericparser.cs: Removed.
7298
7299 2004-09-14  Raja R Harinath  <rharinath@novell.com>
7300
7301         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7302
7303 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7304
7305         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7306
7307 2004-09-10  Martin Baulig  <martin@ximian.com>
7308
7309         Backported my MemberName changes from GMCS into MCS.
7310
7311         - we are now using a special `MemberName' class instead of using
7312         strings; in GMCS, the `MemberName' also contains the type
7313         arguments.
7314
7315         - changed the grammar rules a bit:
7316           * the old `member_name' is now a `namespace_or_type_name':
7317             The rule is that we use `namespace_or_type_name' everywhere
7318             where we expect either a "member name" (GetEnumerator) or a
7319             "member name" with an explicit interface name
7320             (IEnumerable.GetEnumerator).
7321             In GMCS, the explicit interface name may include type arguments
7322             (IEnumerable<T>.GetEnumerator).
7323           * we use `member_name' instead of just `IDENTIFIER' for
7324             "member names":
7325             The rule is that we use `member_name' wherever a member may
7326             have type parameters in GMCS.       
7327
7328         * decl.cs (MemberName): New public class.
7329         (MemberCore.MemberName): New public readonly field.
7330         (MemberCore.ctor): Take a `MemberName' argument, not a string.
7331         (DeclSpace): Likewise.
7332
7333         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7334         * enum.cs (Enum.ctor): Likewise.
7335
7336         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7337         MemberName.     
7338         (AliasEntry.ctor): Take a MemberName, not an Expression.
7339         (AliasEntry.UsingAlias): Likewise.
7340
7341         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7342         (IMethodData.MemberName): Changed type from string to MemberName.
7343         (MemberBase.ExplicitInterfaceName): Likewise.
7344         (AbstractPropertyEventMethod.SetupName): Make this private.
7345         (AbstractPropertyEventMethod.ctor): Added `string prefix'
7346         argument; compute the member name here.
7347         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7348         on the `member.MemberName' and the `prefix'.
7349
7350         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7351         not `type_name'.
7352         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7353         thus, we get a `MemberName' instead of a `string'.  These
7354         declarations may have type parameters in GMCS.
7355         (interface_method_declaration, delegate_declaration): Likewise.
7356         (class_declaration, interface_declaration): Likewise.
7357         (method_header): Use `namespace_or_type_name' instead of
7358         `member_name'.  We may be an explicit interface implementation.
7359         (property_declaration, event_declaration): Likewise.
7360         (member_name): This is now just an `IDENTIFIER', not a
7361         `namespace_or_type_name'.
7362         (type_name, interface_type): Removed.
7363         (namespace_or_type_name): Return a MemberName, not an Expression.
7364         (primary_expression): Use `member_name' instead of `IDENTIFIER';
7365         call GetTypeExpression() on the MemberName to get an expression.
7366         (IndexerDeclaration.interface_type): Changed type from string to
7367         MemberName.
7368         (MakeName): Operate on MemberName's instead of string's.
7369
7370 2004-09-13  Raja R Harinath  <rharinath@novell.com>
7371
7372         Fix bug #55770.
7373         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7374         (NamespaceEntry.Lookup): Add new argument to flag if we want the
7375         lookup to avoid symbols introduced by 'using'.
7376         * rootcontext.cs (NamespaceLookup): Update.
7377
7378 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7379
7380         * class.cs (TypeContainer.DoDefineMembers): Do not call
7381         DefineDefaultConstructor for static classes.
7382
7383 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7384
7385         * attribute.cs (Attribute.Resolve): Add error 653 report.
7386
7387         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7388         report.
7389         (Method.ApplyAttributeBuilder): Add error 685 report.
7390         (Operator.Define): Add error 564 report.
7391
7392         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7393
7394         * expression.cs (Invocation.DoResolve): Add error
7395         245 and 250 report.
7396
7397         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7398         error 674 report.
7399
7400 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7401
7402         * class.cs (ConstructorInitializer.Resolve):
7403         Wrong error number (515->516).
7404
7405 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7406
7407         * class.cs (Indexer.Define): Add error 631 report.
7408
7409 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7410
7411         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7412
7413 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7414
7415         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7416
7417 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7418
7419         * cs-parser.jay: Added error CS0241 report.
7420
7421 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7422
7423         * cs-parser.jay (fixed_statement): Introduce a scope for the
7424         declaration in the 'fixed' statement.
7425
7426 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7427
7428         * cs-parser.jay: Added CS0230 error report.
7429
7430 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7431
7432         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7433
7434 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7435
7436         * expression.cs (Argument.Resolve): Added error CS0192 and
7437         CS0199 report.
7438
7439 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7440
7441         C# 2.0 #pragma warning feature
7442
7443         * cs-tokenizer.cs (PreProcessPragma): New method; 
7444         Handles #pragma directive.
7445
7446         * report.cs (WarningRegions): New class; Support
7447         class for #pragma warning directive. It tests whether
7448         warning is enabled for a given line.
7449
7450 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7451
7452         * const.cs: Add more descriptive error report, tahnks to
7453         Sebastien. 
7454
7455 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7456
7457         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7458
7459 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7460
7461         * expression.cs: Apply patch from Ben: Remove dead code from
7462         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7463         as that code just threw an exception anwyays.
7464
7465         * const.cs: Remove the call to the turnintoconstant, for details
7466         see bug: #63144
7467         
7468         * literal.cs: The type of the null-literal is the null type;  So
7469         we use a placeholder type (literal.cs:System.Null, defined here)
7470         for it.
7471
7472         * expression.cs (Conditional.DoResolve): Remove some old code that
7473         is no longer needed, conversions have been fixed.
7474
7475         (ArrayCreationExpression.DoResolve): Return false if we fail to
7476         resolve the inner expression.
7477
7478 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7479
7480         Fix test-290.cs.
7481         * cs-parser.jay (delegate_declaration): Record a delegate
7482         declaration as a type declaration.
7483         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7484
7485 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7486
7487         * parameter.cs: Do not crash if the type can not be resolved. 
7488
7489         * expression.cs: Report errors with unsafe pointers, fixes #64896
7490
7491 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7492
7493         * expression.cs: Pointer arith always needs to do a conv.i
7494         if the operand is a long. fix 65320
7495
7496 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7497
7498         Fixed cs0619-37.cs, cs0619-38.cs
7499
7500         * enum.cs (GetObsoleteAttribute): Removed.
7501
7502         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7503         on Enum member is double staged. The first is tested member
7504         and then enum.
7505
7506 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7507
7508         Fixed #56986, #63631, #65231
7509
7510         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7511         adds member to name container.
7512         (TypeContainer.AddToTypeContainer): New method, adds type to
7513         name container.
7514         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7515         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7516         AddOperator): Simplified by reusing AddToMemberContainer.
7517         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7518         instead of field.
7519         (Method.CheckForDuplications): Fixed implementation to test all
7520         possibilities.
7521         (MemberBase): Detection whether member is explicit interface
7522         implementation is now in constructor.
7523         (MemberBase.UpdateMemberName): Handles IndexerName.
7524         (Accessor): Changed to keep also location information.
7525         (AbstractPropertyEventMethod): Is derived from MemberCore.
7526         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7527         will be emited or not.
7528         (PropertyBase.AreAccessorsDuplicateImplementation):
7529         Tests whether accessors are not in collision with some method.
7530         (Operator): Is derived from MethodCore to simplify common
7531         operations.
7532
7533         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7534         must be performed.
7535         (DeclSpace.AddToContainer): Adds the member to defined_names
7536         table. It tests for duplications and enclosing name conflicts.
7537
7538         * enum.cs (EnumMember): Clean up to reuse the base structures
7539
7540 2004-09-03  Martin Baulig  <martin@ximian.com>
7541
7542         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7543         into TypeContainer, to make partial classes work again.
7544
7545 2004-09-03  Martin Baulig  <martin@ximian.com>
7546
7547         * rootcontext.cs (RootContext.V2): Removed.
7548
7549 2004-03-23  Martin Baulig  <martin@ximian.com>
7550
7551         * expression.cs (Invocation.OverloadResolve): Added `bool
7552         may_fail' argument and use it instead of the Location.IsNull() hack.
7553
7554 2004-09-03  Martin Baulig  <martin@ximian.com>
7555
7556         Merged latest changes into gmcs.  Please keep this comment in
7557         here, it makes it easier for me to see what changed in MCS since
7558         the last time I merged.
7559
7560 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7561
7562         Fix #61128.
7563         * expression.cs (BetterConversion): Don't allow either conversion 
7564         to be null.  Remove redundant implicit conversion test when 'q ==
7565         null' -- when this function is invoked, we already know that the
7566         implicit conversion exists.
7567         (BetterFunction): Assume that 'best' is non-null.  Remove
7568         redundant reimplementation of IsApplicable when 'best' is null.
7569         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7570         number of arguments.
7571         (IsAncestralType): Extract from OverloadResolve.
7572         (OverloadResolve): Make robust to the MethodGroupExpr being
7573         unsorted.  Implement all the logic of Section 14.5.5.1, and
7574         support overloading of methods from multiple applicable types.
7575         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7576
7577         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7578         (RealError, Warning): Append type of report to related symbol.
7579
7580 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7581
7582         * enum.cs: Fixed CLS-Compliance checks for enum members.
7583         Error tests cs3008-8.cs, cs3014-8.cs
7584
7585 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7586
7587         Fixed bug #62342, #63102
7588         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7589         like ImplementMethod.
7590
7591 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7592
7593         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7594         Fixed bug #65170.
7595
7596 2004-09-02  Martin Baulig  <martin@ximian.com>
7597
7598         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7599         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7600         on the MethodBase.
7601
7602 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7603
7604         C# 2.0 Static classes implemented
7605
7606         * class.cs (TypeContainer): instance_constructors,
7607         initialized_fields, initialized_static_fields,
7608         default_constructor, base_inteface_types are protected to be
7609         accessible from StaticClass.
7610         (TypeContainer.DefineDefaultConstructor): New virtual method
7611         for custom default constructor generating
7612         (StaticClass): New class to handle "Static classes" feature.
7613
7614         * cs-parser.jay: Handle static keyword on class like instance
7615         of StaticClass.
7616
7617         * driver.cs: Added "/langversion" command line switch with two
7618         options (iso-1, default).
7619
7620 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7621
7622         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7623
7624 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7625
7626         * delegate.cs: Style.
7627
7628 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7629
7630         * delegate.cs: Add seperate instance expr field for miguel.
7631
7632 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7633
7634         * PointerArithmetic (Resolve): make sure we are not doing
7635         pointer arith on void*. Also, make sure we are resolved
7636         by not setting eclass until resolve.
7637
7638         All callers: Make sure that PointerArithmetic gets resolved.
7639
7640 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7641
7642         * ArrayCreation (LookupType): If the type does not resolve 
7643         to an array, give an error.
7644
7645 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7646
7647         * statement.cs (Try.Resolve): Fixed bug #64222
7648
7649 2004-08-27  Martin Baulig  <martin@ximian.com>
7650
7651         * class.cs
7652         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7653         crash here.     
7654
7655 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7656
7657         * ecore.cs (Constantify): Get underlying type via
7658         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7659         Windows in special cases.
7660
7661 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7662
7663         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7664         for obtaining also private methods.
7665         (GetRemoveMethod): Used GetRemoveMethod (true)
7666         for obtaining also private methods.
7667
7668 2004-08-24  Martin Baulig  <martin@ximian.com>
7669
7670         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7671         MethodAttributes.HideBySig for operators.
7672
7673 2004-08-23  Martin Baulig  <martin@ximian.com>
7674
7675         Back to the old error reporting system :-)
7676
7677         * report.cs (Message): Removed.
7678         (Report.MessageData, ErrorData, WarningData): Removed.
7679         (Report.Error, Warning): Back to the old system.
7680
7681 2004-08-23  Martin Baulig  <martin@ximian.com>
7682
7683         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7684
7685         * class.cs (TypeContainer.ParentContainer): New public virtual
7686         method; replaces the explicit interface implementation.
7687         (ClassPart.ParentContainer): Override.
7688
7689 2004-08-23  Martin Baulig  <martin@ximian.com>
7690
7691         * statement.cs (Switch): Added support for constant switches; see
7692         #59428 or test-285.cs.
7693
7694 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7695
7696         Fixed bug #62740.
7697         * statement.cs (GetEnumeratorFilter): Removed useless
7698         logic because C# specs is strict. GetEnumerator must be
7699         public.
7700
7701 2004-08-22  Martin Baulig  <martin@ximian.com>
7702
7703         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7704         a switch and may break, reset the barrier.  Fixes #59867.
7705
7706 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7707
7708         CLS-Compliance speed up (~5% for corlib)
7709
7710         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7711         New method. Tests container for CLS-Compliant names
7712
7713         * class.cs (TypeContainer.VerifyClsName): New method.
7714         Checks whether container name is CLS Compliant.
7715         (Constructor): Implements IMethodData.
7716
7717         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7718         low-case table for CLS Compliance test.
7719         (MemberCache.VerifyClsParameterConflict): New method.
7720         Checks method parameters for CS3006 error.
7721
7722         * enum.cs (EnumMember): Is derived from MemberCore.
7723         (Enum.VerifyClsName): Optimized for better performance.
7724
7725 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7726
7727         * report.cs: Renamed Error_T to Error and changed all
7728         references.
7729
7730 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7731
7732         * class.cs (TypeContainer.IndexerArrayList): New inner class
7733         container for indexers.
7734         (TypeContainer.DefaultIndexerName): New constant for default
7735         indexer name. Replaced all "Item" with this constant.
7736         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7737
7738         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7739         DefaultMemberAttribute constructor.
7740
7741 2004-08-05  Martin Baulig  <martin@ximian.com>
7742
7743         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7744         Fix bug #59429.
7745
7746 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7747
7748         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7749         multi platforms problem.
7750
7751         * compiler.csproj: Included shared files.
7752
7753 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7754
7755         Fix bug 60333, 55971 in the more general way
7756         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7757         Added arg_type argument for constant conversion.
7758         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7759
7760 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7761
7762         Fix bug #59760
7763         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7764         OperatorArrayList, MethodCoreArrayList for typecontainer
7765         containers. Changed class member types to these new types.
7766         (MethodArrayList.DefineMembers): Added test for CS0659.
7767
7768 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7769
7770         * cfold.cs: Synchronize the folding with the code in expression.cs
7771         Binary.DoNumericPromotions for uint operands.
7772
7773         * attribute.cs: Revert patch from Raja, it introduced a regression
7774         while building Blam-1.2.1 (hard to isolate a test case).
7775
7776 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7777
7778         Fix for #55382
7779         * class.cs:
7780         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7781         name collision.
7782         (MethodCore.parent_method): New member. The method we're overriding
7783         if this is an override method.
7784         (MethodCore.CheckBase): Moved from Method class and made common.
7785         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7786         private.
7787         (MethodCore.CheckForDuplications): New abstract method. For custom
7788         member duplication search in a container
7789         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7790         method and its return type.
7791         (Event.conflict_symbol): New member. Symbol with same name in the
7792         parent class.
7793
7794         * decl.cs:
7795         (MemberCache.FindMemberWithSameName): New method. The method
7796         is looking for conflict with inherited symbols.
7797
7798 2004-08-04  Martin Baulig  <martin@ximian.com>
7799
7800         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7801
7802         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7803
7804 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7805
7806         * report.cs (Message): New enum for better error, warning reference in
7807         the code.
7808         (MessageData): New inner abstract class. It generally handles printing of
7809         error and warning messages.
7810         Removed unused Error, Warning, Message methods.
7811
7812 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7813
7814         Fix for cs0592-8.cs test
7815         * attribute.cs
7816         (Attributable.ValidAttributeTargets): Made public.
7817         (Attribute.ExplicitTarget): New member for explicit target value.
7818         (Attribute.CheckTargets): Now we translate explicit attribute
7819         target to Target here.
7820
7821 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7822
7823         * ecore.cs (MethodGroupExpr): new IsBase property.
7824
7825         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7826
7827         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7828         rather than an instance expr.
7829
7830         (DelegateCreation.Emit): Use the method group rather than
7831         the instance expression. Also, if you have base.Foo as the
7832         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7833
7834         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7835
7836         (NewDelegate.DoResolve): Only check for the existance of Invoke
7837         if the method is going to be needed. Use MethodGroupExpr.
7838
7839         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
7840
7841         * expression.cs: For pointer arith., make sure to use
7842         the size of the type, not the size of the pointer to
7843         the type.
7844
7845 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7846
7847         Fix for #60722
7848         * class.cs (Class): Added error CS0502 test.
7849
7850 2004-08-03  John Luke  <jluke@cfl.rr.com>
7851             Raja R Harinath  <rharinath@novell.com>
7852
7853         Fix for #60997.
7854         * attribute.cs (Attribute.complained_before): New flag.
7855         (Attribute.ResolveType, Attribute.Resolve),
7856         (Attribute.DefinePInvokeMethod): Set it.
7857         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7858         
7859 2004-08-03  Martin Baulig  <martin@ximian.com>
7860
7861         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7862         use a user-defined operator; we still need to do numeric
7863         promotions in case one argument is a builtin type and the other
7864         one has an implicit conversion to that type.  Fixes #62322.
7865
7866 2004-08-02  Martin Baulig  <martin@ximian.com>
7867
7868         * statement.cs (LocalInfo.Flags): Added `IsThis'.
7869         (LocalInfo.IsThis): New public property.
7870         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7871
7872 2004-08-01  Martin Baulig  <martin@ximian.com>
7873
7874         * class.cs (TypeContainer.GetClassBases): Don't set the default
7875         here since we may get called from GetPartialBases().
7876         (TypeContainer.DefineType): If GetClassBases() didn't return a
7877         parent, use the default one.
7878
7879 2004-07-30  Duncan Mak  <duncan@ximian.com>
7880
7881         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
7882
7883 2004-07-30  Martin Baulig  <martin@ximian.com>
7884
7885         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7886
7887         * class.cs (SourceMethod): New public class, derive from the
7888         symbol writer's ISourceMethod.
7889         (Method): Use the new symbol writer API.
7890
7891         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7892         as argument and use the new symbol writer.
7893
7894         * location.cs
7895         (SourceFile): Implement the symbol writer's ISourceFile.
7896         (Location.SymbolDocument): Removed.
7897         (Location.SourceFile): New public property.
7898
7899         * symbolwriter.cs: Use the new symbol writer API.
7900
7901 2004-07-30  Raja R Harinath  <rharinath@novell.com>
7902
7903         * Makefile (install-local): Remove.  Functionality moved to
7904         executable.make.
7905
7906 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
7907
7908         * Makefile: Install mcs.exe.config file together with mcs.exe.
7909         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7910         correct runtime version.
7911         
7912 2004-07-25  Martin Baulig  <martin@ximian.com>
7913
7914         * class.cs
7915         (TypeContainer.RegisterOrder): Removed, this was unused.
7916         (TypeContainer, interface_order): Removed.
7917         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7918         TypeContainer as argument since we can also be called with a
7919         `PartialContainer' for a partial class/struct/interface.
7920         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7921         of checking whether we're an `Interface' - we could be a
7922         `PartialContainer'.
7923         (PartialContainer.Register): Override; call
7924         AddClass()/AddStruct()/AddInterface() on our parent.
7925
7926         * cs-parser.jay (interface_member_declaration): Add things to the
7927         `current_container', not the `current_class'.
7928
7929         * rootcontext.cs (RegisterOrder): The overloaded version which
7930         takes an `Interface' was unused, removed.
7931
7932         * typemanager.cs (TypeManager.LookupInterface): Return a
7933         `TypeContainer', not an `Interface'.
7934         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7935         contain a `PartialContainer' for an interface, so check it's
7936         `Kind' to figure out what it is.
7937
7938 2004-07-25  Martin Baulig  <martin@ximian.com>
7939
7940         * class.cs (Class.DefaultTypeAttributes): New public constant.
7941         (Struct.DefaultTypeAttributes): Likewise.
7942         (Interface.DefaultTypeAttributes): Likewise.
7943         (PartialContainer.TypeAttr): Override this and add the
7944         DefaultTypeAttributes.
7945
7946 2004-07-25  Martin Baulig  <martin@ximian.com>
7947
7948         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7949         we can just use the `Parent' field instead.
7950
7951 2004-07-25  Martin Baulig  <martin@ximian.com>
7952
7953         * class.cs (TypeContainer.Emit): Renamed to EmitType().
7954
7955 2004-07-25  Martin Baulig  <martin@ximian.com>
7956
7957         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7958         our parts before defining any methods.
7959         (TypeContainer.VerifyImplements): Make this virtual.
7960         (ClassPart.VerifyImplements): Override and call VerifyImplements()
7961         on our PartialContainer.
7962
7963 2004-07-25  Martin Baulig  <martin@ximian.com>
7964
7965         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7966
7967         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7968         argument, we can just use the `Parent' field instead.
7969
7970         * class.cs
7971         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
7972         (MemberBase.DoDefine): Likewise.
7973
7974 2004-07-24  Martin Baulig  <martin@ximian.com>
7975
7976         * decl.cs (MemberCore.Parent): New public field.
7977         (DeclSpace.Parent): Moved to MemberCore.
7978
7979         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7980         (MemberBase.ctor): Added TypeContainer argument, pass it to our
7981         parent's .ctor.
7982         (FieldBase, Field, Operator): Likewise.
7983         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7984         (EventField, Event): Likewise.
7985
7986 2004-07-23  Martin Baulig  <martin@ximian.com>
7987
7988         * class.cs (PartialContainer): New public class.
7989         (ClassPart): New public class.
7990         (TypeContainer): Added support for partial classes.
7991         (TypeContainer.GetClassBases): Splitted some of the functionality
7992         out into GetNormalBases() and GetPartialBases().
7993
7994         * cs-tokenizer.cs (Token.PARTIAL): New token.
7995         (Tokenizer.consume_identifier): Added some hacks to recognize
7996         `partial', but only if it's immediately followed by `class',
7997         `struct' or `interface'.
7998
7999         * cs-parser.jay: Added support for partial clases.
8000
8001 2004-07-23  Martin Baulig  <martin@ximian.com>
8002
8003         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8004         a `DeclSpace' and also made it readonly.
8005         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8006         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8007         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8008
8009         * cs-parser.jay: Pass the `current_class', not the
8010         `current_container' (at the moment, this is still the same thing)
8011         to a new Method, Property, Event, Indexer or Constructor.
8012
8013 2004-07-23  Martin Baulig  <martin@ximian.com>
8014
8015         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8016         and removed the `current_interface' one.
8017         (struct_declaration, class_declaration, interface_declaration):
8018         Set `current_class' to the newly created class/struct/interface;
8019         set their `Bases' and call Register() before parsing their body.
8020
8021 2004-07-23  Martin Baulig  <martin@ximian.com>
8022
8023         * class.cs (Kind): New public enum.
8024         (TypeContainer): Made this class abstract.
8025         (TypeContainer.Kind): New public readonly field.
8026         (TypeContainer.CheckDef): New public method; moved here from
8027         cs-parser.jay.
8028         (TypeContainer.Register): New public abstract method.
8029         (TypeContainer.GetPendingImplementations): New public abstract
8030         method.
8031         (TypeContainer.GetClassBases): Removed the `is_class' and
8032         `is_iface' parameters.
8033         (TypeContainer.DefineNestedTypes): Formerly known as
8034         DoDefineType().
8035         (ClassOrStruct): Made this class abstract.
8036
8037         * tree.cs (RootTypes): New public type. 
8038
8039 2004-07-20  Martin Baulig  <martin@ximian.com>
8040
8041         * tree.cs (Tree.RecordNamespace): Removed.
8042         (Tree.Namespaces): Removed.
8043
8044         * rootcontext.cs (RootContext.IsNamespace): Removed.
8045
8046         * cs-parser.jay (namespace_declaration): Just create a new
8047         NamespaceEntry here.
8048
8049 2004-07-20  Martin Baulig  <martin@ximian.com>
8050
8051         * statement.cs (ExceptionStatement): New abstract class.  This is
8052         now used as a base class for everyone who's using `finally'.
8053         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8054         our local variables before using them.
8055
8056         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8057         virtual method.  This is used by Yield.Resolve() to "steal" an
8058         outer block's `finally' clauses.
8059         (FlowBranchingException): The .ctor now takes an ExceptionStatement
8060         argument.
8061
8062         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8063         version which takes an ExceptionStatement.  This version must be
8064         used to create exception branchings.
8065
8066         * iterator.cs
8067         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8068         (Iterator.EmitMoveNext): Added exception support; protect the
8069         block with a `fault' clause, properly handle 'finally' clauses.
8070         (Iterator.EmitDispose): Run all the `finally' clauses here.
8071
8072 2004-07-20  Martin Baulig  <martin@ximian.com>
8073
8074         * iterator.cs: This is the first of a set of changes in the
8075         iterator code.  Match the spec more closely: if we're an
8076         IEnumerable, then GetEnumerator() must be called.  The first time
8077         GetEnumerator() is called, it returns the current instance; all
8078         subsequent invocations (if any) must create a copy.
8079
8080 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
8081
8082         * expression.cs: Resolve the constant expression before returning
8083         it. 
8084
8085 2004-07-19  Martin Baulig  <martin@ximian.com>
8086
8087         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8088         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8089         the return type of the new EmitContext.
8090
8091 2004-07-18  Martin Baulig  <martin@ximian.com>
8092
8093         * class.cs (Property.Define): Fix iterators.
8094
8095         * iterators.cs (Iterator.Define): Moved the
8096         `container.AddInterator (this)' call here from the .ctor; only do
8097         it if we resolved successfully.
8098
8099 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
8100
8101         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8102         `true' for preprocessing directives that we parse.  The return
8103         value indicates whether we should return to regular tokenizing or
8104         not, not whether it was parsed successfully.
8105
8106         In the past if we were in: #if false ... #line #endif, we would
8107         resume parsing after `#line'.  See bug 61604.
8108
8109         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8110         building: IsEnumType should return true only for enums, not for
8111         enums or System.Enum itself.  This fixes #61593.
8112
8113         Likely what happened is that corlib was wrong: mcs depended on
8114         this bug in some places.  The bug got fixed, we had to add the
8115         hack, which caused bug 61593.
8116
8117         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8118         that was a workaround for the older conditions.
8119
8120 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
8121
8122         * assign.cs: IAssignMethod has a new interface, as documented
8123         inline. All assignment code now uses this new api.
8124
8125         * ecore.cs, expression.cs: All classes which implement
8126         IAssignMethod now use the new interface.
8127
8128         * expression.cs (Invocation): add a hack to EmitCall so that
8129         IndexerAccess can be the target of a compound assignment without
8130         evaluating its arguments twice.
8131
8132         * statement.cs: Handle changes in Invocation api.
8133
8134 2004-07-16  Martin Baulig  <martin@ximian.com>
8135
8136         * iterators.cs: Rewrote this.  We're now using one single Proxy
8137         class for both the IEnumerable and the IEnumerator interface and
8138         `Iterator' derives from Class so we can use the high-level API.
8139
8140         * class.cs (TypeContainer.AddIterator): New method.
8141         (TypeContainer.DoDefineType): New protected virtual method, which
8142         is called from DefineType().
8143         (TypeContainer.DoDefineMembers): Call DefineType() and
8144         DefineMembers() on all our iterators.
8145         (TypeContainer.Emit): Call Emit() on all our iterators.
8146         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8147
8148         * codegen.cs (EmitContext.CurrentIterator): New public field.
8149
8150 2004-07-15  Martin Baulig  <martin@ximian.com>
8151
8152         * typemanager.cs
8153         (TypeManager.not_supported_exception_type): New type.   
8154
8155 2004-07-14  Martin Baulig  <martin@ximian.com>
8156
8157         * iterators.cs: Use real error numbers.
8158
8159 2004-07-14  Martin Baulig  <martin@ximian.com>
8160
8161         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8162         requires this to be a System.Collection.IEnumerable and not a
8163         class implementing that interface.
8164         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8165
8166 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8167
8168         * class.cs: Fixed previous fix, it broke some error tests.
8169
8170 2004-07-12  Martin Baulig  <martin@ximian.com>
8171
8172         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8173         Fixes #61293.
8174
8175 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8176
8177         * assign.cs (LocalTemporary): Add new argument: is_address,If
8178         `is_address' is true, then the value that we store is the address
8179         to the real value, and not the value itself.
8180         
8181         * ecore.cs (PropertyExpr): use the new local temporary
8182         stuff to allow us to handle X.Y += z (where X is a struct)
8183
8184 2004-07-08  Martin Baulig  <martin@ximian.com>
8185
8186         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8187         not always return, just like we're doing in Using.Resolve().
8188
8189 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8190
8191         * cs-parser.jay (fixed_statement): flag this as Pinned.
8192
8193 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8194
8195         * typemanager.cs (TypeManager): Removed MakePinned method, this
8196         mechanism is replaced with the .NET 2.x compatible mechanism of
8197         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8198
8199         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8200         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8201         `IsFixed' property which has a different meaning.
8202
8203 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8204
8205         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8206         visible from inside a nested class, not just the names of the
8207         immediately enclosing class.
8208         Fix for bug #60730.
8209
8210 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8211
8212         * expression.cs (BetterConversion): Remove buggy special-case
8213         handling of "implicit constant expression conversions".  At this
8214         point, we already know that the conversion is possible -- we're
8215         only checking to see which is better.
8216
8217 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8218
8219         * cs-parser.jay: Added error CS0210 test.
8220
8221 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8222
8223         * cs-parser.jay: Added error CS0134 test.
8224
8225 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8226
8227         Fix bug #52507
8228         * cs-parser.jay: Added error CS0145 test.
8229
8230 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8231
8232         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8233
8234 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8235         
8236         * expression.cs (StackAlloc.Resolve): The argument may not
8237         be a constant; deal with this case.
8238         
8239 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8240
8241         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8242         GetIndexerAttributeValue.
8243         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8244
8245         * class.cs (Indexer.Define): Added error tests for CS0415,
8246         CS0609.
8247
8248 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8249
8250         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8251         property code.
8252
8253 2004-06-23  Martin Baulig  <martin@ximian.com>
8254
8255         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8256         neither return nor throw, reset the barrier as well.  Fixes #60457.
8257
8258 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8259
8260         * class.cs : EventAttributes is now set to None by default.
8261           This fixes bug #60459.
8262
8263 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8264
8265         Fix bug #60219
8266         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8267         Don't throw exception but return null (it's sufficient now).
8268
8269 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8270
8271         * typemanager.cs (GetArgumentTypes): Faster implementation.
8272
8273 2004-06-18  Martin Baulig  <martin@ximian.com>
8274
8275         * attribute.cs (Attribute.Resolve): Check whether we're an
8276         EmptyCast which a Constant child.  Fixes #60333.
8277
8278 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8279
8280         * statement.cs (EmitCollectionForeach): Account for the fact that
8281         not all valuetypes are in areas which we can take the address of.
8282         For these variables, we store to a temporary variable. Also, make
8283         sure that we dont emit a `callvirt' on a valuetype method.
8284
8285 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8286
8287         * expression.cs (StackAlloc.DoReSolve): Added test for
8288         negative parameter (CS0247).
8289
8290 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8291
8292         Fix bug #59792
8293         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8294
8295 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8296
8297         Fix bug #59781
8298         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8299         ulong.
8300
8301 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8302
8303         Fix bug #58254 & cs1555.cs, cs1556.cs
8304         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8305
8306 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8307
8308         * cs-parser.jay: Added error CS1669 test for indexers.
8309
8310 2004-06-11  Martin Baulig  <martin@ximian.com>
8311
8312         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8313         call this twice: for params and varargs methods.
8314
8315 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8316
8317         * class.cs:
8318         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8319
8320 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8321
8322         * attribute.cs (Attribute.GetValidTargets): Made public.
8323
8324         * class.cs: 
8325         (AbstractPropertyEventMethod): New class for better code sharing.
8326         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8327         CS1667 report.
8328         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8329
8330 2004-06-11  Raja R Harinath  <rharinath@novell.com>
8331
8332         Fix bug #59477.
8333         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8334         that the call to Resolve is part of a MemberAccess.
8335         (Expression.Resolve): Use it for SimpleName resolution.
8336         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8337         Add 'intermediate' boolean argument.
8338         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
8339         error message when the SimpleName can be resolved ambiguously
8340         between an expression and a type.
8341         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8342         public.
8343         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8344         call on the left-side.
8345
8346 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8347
8348         * class.cs:
8349         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8350
8351 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8352
8353         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8354
8355 2004-06-11  Martin Baulig  <martin@ximian.com>
8356
8357         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8358         varargs methods if applicable.
8359
8360 2004-06-11  Martin Baulig  <martin@ximian.com>
8361
8362         * expression.cs (Invocation.EmitCall): Don't use
8363         `method.CallingConvention == CallingConventions.VarArgs' since the
8364         method could also have `CallingConventions.HasThis'.
8365
8366 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8367
8368         * class.cs (Event.GetSignatureForError): Implemented.
8369         Fixed crash in error test cs3010.cs
8370
8371 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
8372
8373         * cs-tokenizer.cs: Change the way we track __arglist to be
8374         consistent with the other keywords.
8375
8376 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
8377
8378         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8379         tomorrow.
8380
8381 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
8382
8383         * codegen.cs: Check that all referenced assemblies have a strongname
8384         before strongnaming the compiled assembly. If not report error CS1577.
8385         Fix bug #56563. Patch by Jackson Harper.
8386         * typemanager.cs: Added a method to return all referenced assemblies.
8387         Fix bug #56563. Patch by Jackson Harper.
8388
8389 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8390
8391         * class.cs:
8392         (Method.ApplyAttributeBuilder): Moved and added conditional
8393         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8394
8395         * delegate.cs:
8396         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8397
8398 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8399
8400         Fixed #59640
8401         * class.cs: (EventField.attribute_targets): Changed default target.
8402
8403 2004-06-08  Martin Baulig  <martin@ximian.com>
8404
8405         * expression.cs (Invocation.EmitCall): Enable varargs methods.
8406
8407 2004-06-08  Martin Baulig  <martin@ximian.com>
8408
8409         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8410
8411 2004-06-07  Martin Baulig  <martin@ximian.com>
8412
8413         Added support for varargs methods.
8414
8415         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8416         keyword.
8417
8418         * cs-parser.jay: Added support for `__arglist'.
8419
8420         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8421
8422         * expression.cs (Argument.AType): Added `ArgList'.
8423         (Invocation): Added support for varargs methods.
8424         (ArglistAccess): New public class.
8425         (Arglist): New public class.
8426
8427         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8428
8429         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
8430         a method's top-level block if the method has varargs.
8431
8432         * support.cs (ReflectionParameters, InternalParameters): Added
8433         support for varargs methods.    
8434
8435 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
8436
8437         * class.cs: Provide location in indexer error report.
8438
8439         * driver.cs: Use standard names.
8440
8441         * namespace.cs: Catch the use of using after a namespace has been
8442         declared also on using aliases.
8443
8444 2004-06-03  Raja R Harinath  <rharinath@novell.com>
8445
8446         Bug #50820.
8447         * typemanager.cs (closure_private_ok, closure_invocation_type)
8448         (closure_qualifier_type, closure_invocation_assembly)
8449         (FilterWithClosure): Move to ...
8450         (Closure): New internal nested class.
8451         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8452         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8453         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8454         (MemberLookup, MemberLookupFailed): Use it.
8455         * expression.cs (New.DoResolve): Treat the lookup for the
8456         constructor as being qualified by the 'new'ed type.
8457         (Indexers.GetIndexersForTypeOrInterface): Update.
8458
8459 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
8460
8461         * attribute.cs
8462         (GetConditionalAttributeValue): New method. Returns
8463         condition of ConditionalAttribute.
8464         (SearchMulti): New method.  Returns all attributes of type 't'.
8465         Use it when attribute is AllowMultiple = true.
8466         (IsConditionalMethodExcluded): New method.
8467
8468         * class.cs
8469         (Method.IsExcluded): Implemented. Returns true if method has conditional
8470         attribute and the conditions is not defined (method is excluded).
8471         (IMethodData): Extended interface for ConditionalAttribute support.
8472         (PropertyMethod.IsExcluded): Implemented.
8473
8474         * decl.cs
8475         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8476
8477         * expression.cs
8478         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8479         on the method.
8480
8481 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8482
8483         * expression.cs (ArrayCreationExpression): Make this just an
8484         `expression'. It can't be a statement, so the code here was
8485         dead.
8486
8487 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8488
8489         Fixed #59072
8490         * typemanager.cs (GetFullNameSignature): New method for
8491         MethodBase types.
8492
8493 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8494
8495         Fixed #56452
8496         * class.cs (MemberBase.GetSignatureForError): New virtual method.
8497         Use this method when MethodBuilder is null.
8498         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8499         Added test for error CS0626 (MONO reports error for this situation).
8500         (IMethodData.GetSignatureForError): Extended interface.
8501
8502 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8503
8504         * attribute.cs
8505         (AttributeTester.GetObsoleteAttribute): Returns instance of
8506         ObsoleteAttribute when type is obsolete.
8507
8508         * class.cs
8509         (TypeContainer.VerifyObsoleteAttribute): Override.
8510         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8511         (MethodCode.VerifyObsoleteAttribute): Override.
8512         (MemberBase.VerifyObsoleteAttribute): Override.
8513
8514         * decl.cs
8515         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8516         and report proper error.
8517
8518         *delegate.cs
8519         Delegate.VerifyObsoleteAttribute): Override.
8520
8521         * ecore.cs
8522         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8523         and report proper error.
8524         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8525
8526         * enum.cs
8527         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8528         and enum member.
8529
8530         * expression.cs
8531         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8532         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8533         Added test for ObsoleteAttribute.
8534
8535         * statement.cs
8536         (Catch): Derived from Statement.
8537
8538 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8539  
8540         Fixed bug #59071 & cs0160.cs
8541  
8542         * statement.cs (Try.Resolve): Check here whether order of catch
8543         clauses matches their dependencies.
8544
8545 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
8546
8547         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
8548         caused a regression: #59343.  Referencing nested classes from an
8549         assembly stopped working.
8550
8551 2004-05-31  Martin Baulig  <martin@ximian.com>
8552
8553         MCS is now frozen for beta 2.
8554
8555 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8556
8557         * convert.cs: add a trivial cache for overload operator resolution.
8558
8559 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8560
8561         * decl.cs: If possible, use lookuptypedirect here. We can only do
8562         this if there is no `.' after the namespace. Avoids using
8563         LookupType, which does lots of slow processing.
8564         (FindNestedType) New method, does what it says :-).
8565         * namespace.cs: use LookupTypeDirect.
8566         * rootcontext.cs: use membercache, if possible.
8567         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8568
8569 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8570
8571         * expression.cs:
8572         According to the spec, 
8573
8574         In a member access of the form E.I, if E is a single identifier,
8575         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8576         field, property, localvariable, or parameter with the same type as
8577         the meaning of E as a type-name (§3.8), then both possible
8578         meanings of E are permitted.
8579
8580         We did not check that E as a simple-name had the same type as E as
8581         a type name.
8582
8583         This trivial check gives us 5-7% on bootstrap time.
8584
8585 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8586
8587         * expression.cs (Invocation.OverloadResolve): Avoid the
8588         use of hashtables and boxing here by allocating on demand.
8589
8590 2004-05-30  Martin Baulig  <martin@ximian.com>
8591
8592         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8593         we're doing a silent lookup.  Don't try to lookup nested types in
8594         TypeManager.object_type (thanks to Ben Maurer).
8595
8596 2004-05-30  Martin Baulig  <martin@ximian.com>
8597
8598         Committing a patch from Ben Maurer.
8599
8600         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8601
8602 2004-05-29  Martin Baulig  <martin@ximian.com>
8603
8604         * class.cs (IMethodData.ShouldIgnore): New method.
8605
8606         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8607         `Location' argument, we don't need it anywhere.  Use
8608         `IMethodData.ShouldIgnore ()' instead of
8609         `MethodData.GetMethodFlags ()'.
8610         (TypeManager.AddMethod): Removed.
8611         (TypeManager.AddMethod2): Renamed to AddMethod.
8612
8613 2004-05-29  Martin Baulig  <martin@ximian.com>
8614
8615         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8616
8617         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8618         converting from a class type S to an interface type and we already
8619         have an object on the stack, don't box it again.  Fixes #52578.
8620
8621 2004-05-29  Martin Baulig  <martin@ximian.com>
8622
8623         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8624         Added support for `params' parameters.  Fixes #59267.
8625
8626 2004-05-29  Martin Baulig  <martin@ximian.com>
8627
8628         * literal.cs (NullPointer): Provide a private .ctor which sets
8629         `type' to TypeManager.object_type.  Fixes #59048.
8630
8631 2004-05-29  Martin Baulig  <martin@ximian.com>
8632
8633         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8634         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8635
8636         * ecore.cs (EventExpr.instance_expr): Make the field private.
8637
8638 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8639
8640         Fixed bug #50080 & cs0214-2.cs
8641         * expression.cs (Cast.DoResolve): Check unsafe context here.
8642         
8643         * statement.cs (Resolve.DoResolve): Likewise.
8644
8645 2004-05-26  Martin Baulig  <martin@ximian.com>
8646
8647         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8648
8649         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8650         (RootContext.LookupType): Pass down the `silent' flag.
8651
8652 2004-05-25  Martin Baulig  <martin@ximian.com>
8653
8654         * expression.cs
8655         (MethodGroupExpr.IdenticalTypeName): New public property.
8656         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8657         expression actually refers to a type.
8658
8659 2004-05-25  Martin Baulig  <martin@ximian.com>
8660
8661         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8662         for #56176 and made it actually work.
8663
8664 2004-05-25  Martin Baulig  <martin@ximian.com>
8665
8666         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8667         (FieldExpr, PropertyExpr): Override and implement
8668         CacheTemporaries.  Fixes #52279.
8669
8670 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8671
8672         * location.cs: In the new compiler listing a file twice is a
8673         warning, not an error.
8674
8675 2004-05-24  Martin Baulig  <martin@ximian.com>
8676
8677         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8678         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8679
8680 2004-05-24  Martin Baulig  <martin@ximian.com>
8681
8682         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8683         walking the `using' list.  Fixes #53921.
8684
8685 2004-05-24  Martin Baulig  <martin@ximian.com>
8686
8687         * const.cs (Const.LookupConstantValue): Added support for
8688         EmptyCast's; fixes #55251.
8689
8690 2004-05-24  Martin Baulig  <martin@ximian.com>
8691
8692         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8693         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8694         which does the CS0135 check.  The reason is that we first need to
8695         check whether the variable actually exists.
8696
8697 2004-05-24  Martin Baulig  <martin@ximian.com>
8698
8699         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8700         than RootContext.LookupType() to find the explicit interface
8701         type.  Fixes #58584.
8702
8703 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8704
8705         * Makefile: Simplify.  Use executable.make.
8706         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8707
8708 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8709
8710         * decl.cs:
8711         * enum.cs:
8712         Use the invariant culture when doing String.Compare for CLS case
8713         sensitivity.
8714         
8715 2004-05-23  Martin Baulig  <martin@ximian.com>
8716
8717         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8718         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8719
8720         * namespace.cs (NamespaceEntry.Lookup): Likewise.
8721         
8722 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8723
8724         * class.cs (MemberBase.Define): Reuse MemberType member for 
8725         resolved type. Other methods can use it too.
8726
8727 2004-05-23  Martin Baulig  <martin@ximian.com>
8728
8729         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8730         the variable also exists in the current block (otherwise, we need
8731         to report a CS0103).  Fixes #58670.
8732
8733 2004-05-23  Martin Baulig  <martin@ximian.com>
8734
8735         * flowanalysis.cs (Reachability.Reachable): Compute this
8736         on-the-fly rather than storing it as a field.
8737
8738 2004-05-23  Martin Baulig  <martin@ximian.com>
8739
8740         * flowanalysis.cs (Reachability.And): Manually compute the
8741         resulting `barrier' from the reachability.      
8742        
8743 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8744
8745         Fix bug #57835
8746         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8747         instance of ObsoleteAttribute when symbol is obsolete.
8748
8749         * class.cs
8750         (IMethodData): Extended interface for ObsoleteAttribute support.
8751
8752 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8753
8754         * attribute.cs: Fix bug #55970
8755
8756 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8757
8758         Fix bug #52705
8759         * attribute.cs
8760         (GetObsoleteAttribute): New method. Creates the instance of
8761         ObsoleteAttribute.
8762         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8763         ObsoleteAttribute when member is obsolete.
8764         (AttributeTester.Report_ObsoleteMessage): Common method for
8765         Obsolete error/warning reporting.
8766
8767         * class.cs
8768         (TypeContainer.base_classs_type): New member for storing parent type.
8769
8770         * decl.cs
8771         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8772         for this MemberCore.
8773
8774 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8775
8776         * attribute.cs, const.cs: Fix bug #58590
8777
8778 2004-05-21  Martin Baulig  <martin@ximian.com>
8779
8780         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8781         out parameters if the end of the method is unreachable.  Fixes
8782         #58098. 
8783
8784 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8785
8786         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8787         Hari was right, why extra method.
8788
8789 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8790
8791         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8792
8793 2004-05-20  Martin Baulig  <martin@ximian.com>
8794
8795         Merged this back from gmcs to keep the differences to a minumum.
8796
8797         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8798         instead of a Declspace.
8799         (Attribute.ResolveType): Likewise.
8800         (Attributes.Search): Likewise.
8801         (Attributes.Contains): Likewise.
8802         (Attributes.GetClsCompliantAttribute): Likewise.
8803
8804         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8805         argument.
8806         (MethodData.ApplyAttributes): Take an EmitContext instead of a
8807         DeclSpace.
8808
8809 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8810
8811         Fix bug #58688 (MCS does not report error when the same attribute
8812         is assigned twice)
8813
8814         * attribute.cs (Attribute.Emit): Distinction between null and default.
8815
8816 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8817
8818         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8819         of a top-level attribute without an attribute target.
8820         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8821         Make non-static.
8822         (Attribute.Conditional_GetConditionName), 
8823         (Attribute.Obsolete_GetObsoleteMessage): Update.
8824         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8825         part of ScanForIndexerName.
8826         (Attribute.CanIgnoreInvalidAttribute): New function.
8827         (Attribute.ScanForIndexerName): Move to ...
8828         (Attributes.ScanForIndexerName): ... here.
8829         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8830         (Attributes.Search): New internal variant that can choose not to
8831         complain if types aren't resolved.  The original signature now
8832         complains.
8833         (Attributes.GetClsCompliantAttribute): Use internal variant, with
8834         complaints suppressed.
8835         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8836         only if it not useful.
8837         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8838         top-level for attributes that are shared between the assembly
8839         and a top-level class.
8840         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8841         * class.cs: Update to reflect changes.
8842         (DefineIndexers): Fuse loops.
8843         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
8844         a couple more variants of attribute names.
8845
8846 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
8847
8848         Fix bug #52585 (Implemented explicit attribute declaration)
8849
8850         * attribute.cs:
8851         (Attributable.ValidAttributeTargets): New abstract method. It gets
8852         list of valid attribute targets for explicit target declaration.
8853         (Attribute.Target): It holds target itself.
8854         (AttributeSection): Removed.
8855         (Attribute.CheckTargets): New method. It checks whether attribute
8856         target is valid for the current element.
8857
8858         * class.cs:
8859         (EventProperty): New class. For events that are declared like
8860         property (with add and remove accessors).
8861         (EventField): New class. For events that are declared like field.
8862         class.cs
8863
8864         * cs-parser.jay: Implemented explicit attribute target declaration.
8865
8866         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
8867         Override ValidAttributeTargets.
8868
8869         * parameter.cs:
8870         (ReturnParameter): Class for applying custom attributes on 
8871         the return type.
8872         (ParameterAtribute): New class. Class for applying custom
8873         attributes on the parameter type.
8874
8875 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
8876
8877         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8878         definitions. 
8879
8880         (Method): Allow UNSAFE here.
8881
8882         * modifiers.cs: Support unsafe reporting.
8883
8884 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
8885
8886         * decl.cs: Fix bug #58478.
8887
8888 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8889
8890         * statement.cs: When checking for unreachable code on an EmptyStatement,
8891         set the location. Fixes bug #58488.
8892
8893 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
8894
8895         * driver.cs: Add -pkg handling.
8896
8897         From Gonzalo: UseShelLExecute=false
8898
8899 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
8900
8901         * attribute.cs:
8902         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8903         for attribute.
8904         (Attribute.IsClsCompliaceRequired): Moved to base for better
8905         accesibility.
8906         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8907         when attribute is AttributeUsageAttribute.
8908         (Attribute.GetValidTargets): Simplified.
8909         (Attribute.GetAttributeUsage): New method returns AttributeUsage
8910         attribute for this type.
8911         (Attribute.ApplyAttributes): Method renamed to Emit and make
8912         non-static.
8913         (GlobalAttributeSection): New class for special handling of global
8914         attributes (assembly, module).
8915         (AttributeSection.Emit): New method.
8916
8917         * class.cs: Implemented Attributable abstract methods.
8918         (MethodCore.LabelParameters): Moved to Parameter class.
8919         (Accessor): Is back simple class.
8920         (PropertyMethod): Implemented Attributable abstract class.
8921         (DelegateMethod): Implemented Attributable abstract class.
8922         (Event): New constructor for disctintion between normal Event
8923         and Event with accessors.
8924
8925         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8926
8927         * codegen.cs, const.cs, decl.cs, delegate.cs:
8928         (CommonAssemblyModulClass): Implemented Attributable abstract class
8929         and simplified.
8930
8931         * enum.cs: Implement IAttributeSupport interface.
8932         (EnumMember): New class for emum members. Implemented Attributable
8933         abstract class
8934
8935         * parameter.cs:
8936         (ParameterBase): Is abstract.
8937         (ReturnParameter): New class for easier [return:] attribute handling.
8938
8939         * typemanager.cs: Removed builder_to_attr.
8940
8941 2004-05-11  Raja R Harinath  <rharinath@novell.com>
8942
8943         Fix bug #57151.
8944         * attribute.cs (Attribute.GetPositionalValue): New function.
8945         * class.cs (TypeContainer.VerifyMembers): New function.
8946         (TypeContainer.Emit): Use it.
8947         (ClassOrStruct): New base class for Class and Struct.
8948         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
8949         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8950         class.
8951         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8952         then each non-static field should have a FieldOffset attribute.
8953         Otherwise, none of the fields should have a FieldOffset attribute.
8954         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
8955         and FieldOffset attributes.
8956         * typemanager.cs (TypeManager.struct_layout_attribute_type)
8957         (TypeManager.field_offset_attribute_type): New core types.
8958         (TypeManager.InitCoreTypes): Initialize them.
8959
8960 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
8961
8962         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8963         Return correct type.
8964         From bug #58270.
8965
8966 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
8967
8968         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8969         be implicitly converted to ulong.
8970         
8971         * expression.cs: The logic for allowing operator &, | and ^ worked
8972         was wrong, it worked before because we did not report an error in
8973         an else branch.  Fixes 57895.
8974
8975         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8976         allow volatile fields to be reference types.
8977
8978 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
8979
8980         * driver.cs: Add support for /debug-
8981
8982 2004-05-07  Raja R Harinath  <rharinath@novell.com>
8983
8984         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
8985         Add a 'complain' parameter to silence errors.
8986         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
8987         silently overlooked type-resolutions.
8988         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8989         to reflect changes.
8990         (Attributes.Search): New function.
8991         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8992         (Attributes.GetAttributeFullName): Remove hack.
8993         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
8994         Update to reflect changes.
8995         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8996         Use Attributes.Search instead of nested loops.
8997
8998 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
8999
9000         * decl.cs:
9001         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9002         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9003         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9004
9005         * report.cs: (Report.Warning): Renamed to Warning_T because of
9006         parameter collision.
9007
9008 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9009
9010         * expression.cs (MemberAccess.ResolveMemberAccess):
9011         Exit with non-zero status after Report.Error.
9012         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9013         Likewise.
9014         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9015
9016 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9017
9018         * support.cs: Don't hang when the file is empty.
9019
9020 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9021
9022         * support.cs: In SeekableStreamReader, compute the preamble size of the
9023           underlying stream. Position changes should take into account that initial
9024           count of bytes.
9025
9026 2004-05-03  Todd Berman  <tberman@sevenl.net>
9027
9028         * driver.cs: remove unused GetSysVersion function.
9029
9030 2004-05-03  Todd Berman  <tberman@sevenl.net>
9031
9032         * driver.cs: Remove the hack from saturday, as well as the hack
9033         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9034         link_paths to get that bit proper.
9035
9036 2004-05-01  Todd Berman  <tberman@sevenl.net>
9037
9038         * driver.cs: Try a LoadFrom before a Load, this checks the current
9039         path. This is currently a bug in mono that is be fixed, however, this
9040         provides a workaround for now. This will be removed when the bug
9041         is fixed.
9042
9043 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9044
9045         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9046         incomplete key pairs (#57941).
9047
9048 2004-05-01  Todd Berman  <tberman@sevenl.net>
9049
9050         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9051         from the GAC
9052
9053 2004-04-30  Jackson Harper  <jackson@ximian.com>
9054
9055         * codegen.cs: Open keys readonly.
9056         
9057 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9058
9059         * typemanager.cs: don't report cyclic struct layout when a struct
9060         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9061         which has 2 Pango.Rectangle fields.
9062
9063 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9064
9065         * expression.cs: Handle IntPtr comparisons with IL code
9066         rather than a method call.
9067
9068 2004-04-29  Martin Baulig  <martin@ximian.com>
9069
9070         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9071         the list of PropertyInfo's in class hierarchy and find the
9072         accessor.  Fixes #56013.
9073
9074 2004-04-29  Martin Baulig  <martin@ximian.com>
9075
9076         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9077
9078 2004-04-29  Martin Baulig  <martin@ximian.com>
9079
9080         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9081
9082         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9083
9084 2004-04-29  Martin Baulig  <martin@ximian.com>
9085
9086         * class.cs (ConstructorInitializer.Resolve): Check whether the
9087         parent .ctor is accessible.  Fixes #52146.
9088
9089 2004-04-29  Martin Baulig  <martin@ximian.com>
9090
9091         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9092
9093         * statement.cs (Using.EmitLocalVariableDecls): Use
9094         TypeManager.idisposable_type, not typeof (IDisposable).
9095         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9096
9097 2004-04-29  Martin Baulig  <martin@ximian.com>
9098
9099         * class.cs (Event.Define): Don't emit the field and don't set
9100         RTSpecialName and SpecialName for events on interfaces.  Fixes
9101         #57703. 
9102
9103 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9104
9105         Refactor Attribute.ApplyAttributes.
9106         * attribute.cs (Attributable): New base class for objects that can
9107         have Attributes applied on them.
9108         (Attribute): Make AttributeUsage fields public.
9109         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9110         (Attribute.IsInternalCall): New property.
9111         (Attribute.UsageAttr): Convert to a public read-only property.
9112         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9113         (Attribute.ResolveType, Attribute.Resolve)
9114         (Attribute.ScanForIndexerName): Update to reflect changes.
9115         (Attribute.CheckAttributeTarget): Re-format.
9116         (Attribute.ApplyAttributes): Refactor, to various
9117         Attributable.ApplyAttributeBuilder methods.
9118         * decl.cs (MemberCore): Make Attributable.
9119         * class.cs (Accessor): Make Attributable.
9120         (MethodData.ApplyAttributes): Use proper attribute types, not
9121         attribute names.
9122         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9123         (TypeContainer.ApplyAttributeBuilder)
9124         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9125         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9126         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9127         (Operator.ApplyAttributeBuilder): New factored-out methods.
9128         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9129         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9130         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9131         * parameter.cs (ParameterBase): New Attributable base class
9132         that can also represent Return types.
9133         (Parameter): Update to the changes.
9134
9135 2004-04-29  Jackson Harper  <jackson@ximian.com>
9136
9137         * driver.cs: Prefer the corlib system version when looking for
9138         assemblies in the GAC. This is still a hack, but its a better hack
9139         now.
9140         
9141 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9142
9143         * decl.cs, enum.cs: Improved error 3005 reporting.
9144   
9145         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9146         (related_symbols): New private member for list of symbols
9147         related to reported error/warning.
9148         
9149         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9150
9151 2004-04-29  Martin Baulig  <martin@ximian.com>
9152
9153         * ecore.cs (Expression.Constantify): If we're an enum and
9154         TypeManager.TypeToCoreType() doesn't give us another type, use
9155         t.UnderlyingSystemType.  Fixes #56178.  
9156
9157 2004-04-29  Martin Baulig  <martin@ximian.com>
9158
9159         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9160         interfaces and for each interface, only add members directly
9161         declared in that interface.  Fixes #53255.
9162
9163 2004-04-28  Martin Baulig  <martin@ximian.com>
9164
9165         * expression.cs (ConditionalLogicalOperator): Use a temporary
9166         variable for `left' to avoid that we evaluate it more than once;
9167         bug #52588.
9168
9169 2004-04-28  Martin Baulig  <martin@ximian.com>
9170
9171         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9172         `void[]' (CS1547).
9173
9174 2004-04-28  Martin Baulig  <martin@ximian.com>
9175
9176         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9177         void (CS1547).
9178
9179         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9180         whether the type is not void (CS1547).
9181
9182 2004-04-28  Martin Baulig  <martin@ximian.com>
9183
9184         * expression.cs (Unary.DoResolveLValue): Override this and report
9185         CS0131 for anything but Operator.Indirection.
9186
9187 2004-04-28  Martin Baulig  <martin@ximian.com>
9188
9189         Committing a patch from Ben Maurer; see bug #50820.
9190
9191         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9192         check for classes.
9193
9194         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9195         classes.        
9196
9197 2004-04-28  Martin Baulig  <martin@ximian.com>
9198
9199         Committing a patch from Ben Maurer; see bug #50820.
9200
9201         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9202         check for classes.
9203
9204         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9205         classes.        
9206
9207 2004-04-28  Martin Baulig  <martin@ximian.com>
9208
9209         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9210         (Block.AddLabel): Call DoLookupLabel() to only search in the
9211         current block.
9212
9213 2004-04-28  Martin Baulig  <martin@ximian.com>
9214
9215         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9216         comparing StringConstants and NullLiterals in Equality and Inequality.
9217
9218 2004-04-28  Jackson Harper  <jackson@ximian.com>
9219
9220         * driver.cs: Attempt to load referenced assemblies from the
9221         GAC. This is the quick and dirty version of this method that
9222         doesnt take into account versions and just takes the first
9223         canidate found. Will be good enough for now as we will not have more
9224         then one version installed into the GAC until I update this method.
9225
9226 2004-04-28  Martin Baulig  <martin@ximian.com>
9227
9228         * typemanager.cs (TypeManager.CheckStructCycles): New public
9229         static method to check for cycles in the struct layout.
9230
9231         * rootcontext.cs (RootContext.PopulateTypes): Call
9232         TypeManager.CheckStructCycles() for each TypeContainer.
9233         [Note: We only need to visit each type once.]
9234
9235 2004-04-28  Martin Baulig  <martin@ximian.com>
9236
9237         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9238
9239         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9240         success and added `out object value'.  Use a `bool resolved' field
9241         to check whether we've already been called rather than
9242         `ConstantValue != null' since this breaks for NullLiterals.
9243
9244 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9245
9246         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9247         setting of this flag, since the 'set' method may be non-public.
9248
9249 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9250
9251         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9252         check on current_vector.Block.
9253
9254 2004-04-27  Martin Baulig  <martin@ximian.com>
9255
9256         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9257         a field initializer.  Fixes #56459.
9258
9259 2004-04-27  Martin Baulig  <martin@ximian.com>
9260
9261         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9262         we're not attempting to use an indexer.  Fixes #52154.
9263
9264 2004-04-27  Martin Baulig  <martin@ximian.com>
9265
9266         * statement.cs (Return): Don't create a return label if we don't
9267         need it; reverts my change from January 20th.  Thanks to Ben
9268         Maurer for this.
9269
9270 2004-04-27  Martin Baulig  <martin@ximian.com>
9271
9272         According to the spec, `goto' can only leave a nested scope, but
9273         never enter it.
9274
9275         * statement.cs (Block.LookupLabel): Only lookup in the current
9276         block, don't recurse into parent or child blocks.
9277         (Block.AddLabel): Check in parent and child blocks, report
9278         CS0140/CS0158 if we find a duplicate.
9279         (Block): Removed this indexer for label lookups.
9280         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9281         this already does the error reporting for us.
9282
9283         * flowanalysis.cs
9284         (FlowBranching.UsageVector.Block): New public variable; may be null.
9285         (FlowBranching.CreateSibling): Added `Block' argument.
9286         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9287         label for the target of a `goto' and check whether we're not
9288         leaving a `finally'.
9289
9290 2004-04-27  Martin Baulig  <martin@ximian.com>
9291
9292         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9293         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9294         just for returns).
9295
9296 2004-04-27  Martin Baulig  <martin@ximian.com>
9297
9298         * statement.cs (Block.AddLabel): Also check for implicit blocks
9299         and added a CS0158 check.
9300
9301 2004-04-27  Martin Baulig  <martin@ximian.com>
9302
9303         * flowanalysis.cs (FlowBranchingLoop): New class.
9304         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9305         UsageVector's instead of an ArrayList.
9306         (FlowBranching.Label): Likewise.
9307         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9308         (FlowBranching.AddBreakVector): New method.
9309
9310 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9311
9312         * attribute.cs: Small regression fix: only convert the type if we
9313         the type is different, fixes System.Drawing build.
9314
9315 2004-04-27  Martin Baulig  <martin@ximian.com>
9316
9317         * attribute.cs (Attribute.Resolve): If we have a constant value
9318         for a named field or property, implicity convert it to the correct
9319         type.
9320
9321 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9322
9323         * statement.cs (Block.Block): Implicit blocks share
9324         'child_variable_names' fields with parent blocks.
9325         (Block.AddChildVariableNames): Remove.
9326         (Block.AddVariable): Mark variable as "used by a child block" in
9327         every surrounding block.
9328         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9329         been used in a child block, complain about violation of "Invariant
9330         meaning in blocks" rule.
9331         * cs-parser.jay (declare_local_variables): Don't use
9332         AddChildVariableNames.
9333         (foreach_statement): Don't create an implicit block: 'foreach'
9334         introduces a scope.
9335
9336 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9337
9338         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9339         converting from 0L to ulong.  Fixes 57522.
9340
9341 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9342
9343         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9344         derived class hides via 'new' keyword field from base class (test-242.cs).
9345         TODO: Handle this in the more general way.
9346         
9347         * class.cs (CheckBase): Ditto.
9348
9349 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9350
9351         * decl.cs (caching_flags): New member for storing cached values
9352         as bit flags.
9353         (MemberCore.Flags): New enum where bit flags for caching_flags
9354         are defined.
9355         (MemberCore.cls_compliance): Moved to caching_flags.
9356         (DeclSpace.Created): Moved to caching_flags.
9357
9358         * class.cs: Use caching_flags instead of DeclSpace.Created
9359         
9360 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9361
9362         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9363         if we are only a derived class, not a nested class.
9364
9365         * typemanager.cs: Same as above, but do this at the MemberLookup
9366         level (used by field and methods, properties are handled in
9367         PropertyExpr).   Allow for the qualified access if we are a nested
9368         method. 
9369
9370 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9371
9372         * class.cs: Refactoring.
9373         (IMethodData): New inteface; Holds links to parent members
9374         to avoid member duplication (reduced memory allocation).
9375         (Method): Implemented IMethodData interface.
9376         (PropertyBase): New inner classes for get/set methods.
9377         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9378         (Event): New inner classes for add/remove methods.
9379         (Event.DelegateMethod): Implemented IMethodData interface.
9380
9381         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9382         EmitContext (related to class.cs refactoring).
9383
9384 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9385
9386         * delegate.cs (Delegate.VerifyApplicability): If the number of
9387         arguments are the same as the number of parameters, first try to
9388         verify applicability ignoring  any 'params' modifier on the last
9389         parameter.
9390         Fixes #56442.
9391
9392 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9393
9394         * class.cs (TypeContainer.AddIndexer): Use
9395         'ExplicitInterfaceName' to determine if interface name was
9396         explicitly specified.  'InterfaceType' is not initialized at this time.
9397         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9398         Indexers array is already in the required order.  Initialize
9399         'IndexerName' only if there are normal indexers.
9400         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9401         (TypeContainer.Emit): Emit DefaultMember attribute only if
9402         IndexerName is initialized.
9403         Fixes #56300.
9404
9405 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9406
9407         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9408         Fixes #57007
9409
9410 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9411
9412         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9413         attributes.
9414         Fix for #56456.
9415
9416         * attribute.cs (Attribute.Resolve): Check for duplicate named
9417         attributes.
9418         Fix for #56463.
9419
9420 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9421
9422         * iterators.cs (MarkYield): track whether we are in an exception,
9423         and generate code accordingly.  Use a temporary value to store the
9424         result for our state.
9425
9426         I had ignored a bit the interaction of try/catch with iterators
9427         since their behavior was not entirely obvious, but now it is
9428         possible to verify that our behavior is the same as MS .NET 2.0
9429
9430         Fixes 54814
9431
9432 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9433
9434         * iterators.cs: Avoid creating temporaries if there is no work to
9435         do. 
9436
9437         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9438         Enumerations, use TypeManager.EnumToUnderlying and call
9439         recursively. 
9440
9441         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9442         bug #57013
9443
9444         (This.Emit): Use EmitContext.EmitThis to emit our
9445         instance variable.
9446
9447         (This.EmitAssign): Ditto.
9448
9449         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9450         codepaths, we will move all the functionality into
9451         Mono.CSharp.This 
9452
9453         (FieldExpr.EmitAssign): Ditto.
9454
9455         This fixes several hidden bugs that I uncovered while doing a code
9456         review of this today.
9457
9458         * codegen.cs (EmitThis): reworked so the semantics are more clear
9459         and also support value types "this" instances.
9460
9461         * iterators.cs: Changed so that for iterators in value types, we
9462         do not pass the value type as a parameter.  
9463
9464         Initialization of the enumerator helpers is now done in the caller
9465         instead of passing the parameters to the constructors and having
9466         the constructor set the fields.
9467
9468         The fields have now `assembly' visibility instead of private.
9469
9470 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9471
9472         * expression.cs (Argument.Resolve): Check if fields passed as ref
9473         or out are contained in a MarshalByRefObject.
9474
9475         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9476         another compiler type.
9477
9478 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9479
9480         * class.cs (Indexer.Define): use the new name checking method.
9481         Also, return false on an error.
9482         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9483         (is_identifier_[start/part]_character): make static.
9484
9485 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9486
9487         * expression.cs (Binary.ResolveOperator): Do no append strings
9488         twice: since we can be invoked more than once (array evaluation)
9489         on the same concatenation, take care of this here.  Based on a fix
9490         from Ben (bug #56454)
9491
9492 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9493
9494         * codegen.cs: Fix another case where CS1548 must be reported (when 
9495         delay-sign isn't specified and no private is available #56564). Fix
9496         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9497         error when MCS is used on the MS runtime and we need to delay-sign 
9498         (which seems unsupported by AssemblyBuilder - see #56621).
9499
9500 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9501
9502         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9503         (TypeManager.ComputeNamespaces): Faster implementation for
9504         Microsoft runtime.
9505
9506         * compiler.csproj: Updated AssemblyName to mcs.
9507
9508 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9509
9510         * rootcontext.cs: Add new types to the boot resolution.
9511
9512         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9513         MulticastDelegate is not allowed.
9514
9515         * typemanager.cs: Add new types to lookup: System.TypedReference
9516         and ArgIterator.
9517
9518         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9519         check for TypedReference or ArgIterator, they are not allowed. 
9520
9521         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9522         makes us properly catch 1510 in some conditions (see bug 56016 for
9523         details). 
9524
9525 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9526
9527         * CryptoConvert.cs: update from corlib version
9528         with endian fixes.
9529
9530 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9531
9532         * class.cs (Indexer.Define): Check indexername declaration
9533
9534 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9535
9536         * attribute.cs (IsClsCompliant): Fixed problem with handling
9537         all three states (compliant, not-compliant, undetected).
9538
9539 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9540
9541         * attribute.cs (Attribute): Location is now public.
9542         (Resolve): Store resolved arguments (pos_values) in attribute class.
9543         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9544         (GetClsCompliantAttributeValue): New method that gets
9545         CLSCompliantAttribute value.
9546         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9547         if exists else null.
9548         (AttributeTester): New class for CLS-Compliant verification routines.
9549
9550         * class.cs (Emit): Add CLS-Compliant verification.
9551         (Method.GetSignatureForError): Implemented.
9552         (Constructor.GetSignatureForError): Implemented
9553         (Constructor.HasCompliantArgs): Returns if constructor has
9554         CLS-Compliant arguments.
9555         (Constructor.Emit): Override.
9556         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9557         is needed to test only parameters.
9558         (FieldBase.GetSignatureForError): Implemented.
9559         (TypeContainer): New member for storing base interfaces.
9560         (TypeContainer.FindMembers): Search in base interfaces too.
9561
9562         * codegen.cs (GetClsComplianceAttribute): New method that gets
9563         assembly or module CLSCompliantAttribute value.
9564         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9565         for assembly.
9566         (ModuleClass.Emit): Add error 3012 test.
9567
9568         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9569
9570         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9571         state for all decl types.
9572         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9573         if CLS-Compliant tests are required.
9574         (IsClsCompliaceRequired): New method. Analyze whether code
9575         must be CLS-Compliant.
9576         (IsExposedFromAssembly): New method. Returns true when MemberCore
9577         is exposed from assembly.
9578         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9579         value or gets cached value.
9580         (HasClsCompliantAttribute): New method. Returns true if MemberCore
9581         is explicitly marked with CLSCompliantAttribute.
9582         (IsIdentifierClsCompliant): New abstract method. This method is
9583         used to testing error 3005.
9584         (IsIdentifierAndParamClsCompliant): New method. Common helper method
9585         for identifier and parameters CLS-Compliant testing.
9586         (VerifyClsCompliance): New method. The main virtual method for
9587         CLS-Compliant verifications.
9588         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9589         null. I don't know why is null (too many public members !).
9590         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9591         and get value of first CLSCompliantAttribute that found.
9592
9593         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9594         (VerifyClsCompliance): Override and add extra tests.
9595
9596         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9597         clscheck- disable CLS-Compliant verification event if assembly is has
9598         CLSCompliantAttribute(true).
9599
9600         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9601         ApllyAttribute is now called in emit section as in the other cases.
9602         Possible future Emit integration.
9603         (IsIdentifierClsCompliant): New override.
9604         (VerifyClsCompliance): New override.
9605         (GetEnumeratorName): Returns full enum name.
9606
9607         * parameter.cs (GetSignatureForError): Implemented.
9608
9609         * report.cs (WarningData): New struct for Warning message information.
9610         (LocationOfPreviousError): New method.
9611         (Warning): New method. Reports warning based on the warning table.
9612         (Error_T): New method. Reports error based on the error table.
9613
9614         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9615         verifications are done here.
9616
9617         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9618
9619         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9620         CLSCompliantAttribute.
9621         (all_imported_types): New member holds all imported types from other
9622         assemblies.
9623         (LoadAllImportedTypes): New method fills static table with exported types
9624         from all referenced assemblies.
9625         (Modules): New property returns all assembly modules.
9626
9627 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
9628
9629         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9630         throwing a parser error.
9631
9632         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9633         which removes the hardcoded get_/set_ prefixes for properties, as
9634         IL allows for the properties to be named something else.  
9635
9636         Bug #56013
9637
9638         * expression.cs: Do not override operand before we know if it is
9639         non-null.  Fix 56207
9640
9641 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9642
9643         * typemanager.cs: support for pinned variables.
9644
9645 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9646
9647         * decl.cs, typemanager.cs: Avoid using an arraylist
9648         as a buffer if there is only one result set.
9649
9650 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9651
9652         * expression.cs: Make sure you cant call a static method
9653         with an instance expression, bug #56174.
9654
9655 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
9656
9657         * class.cs (IsDuplicateImplementation): Improve error reporting to
9658         flag 663 (method only differs in parameter modifier).
9659
9660         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9661         in preprocessor directives.
9662
9663         * location.cs (LookupFile): Allow for the empty path.
9664
9665         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
9666         better approach for some of that patch, but its failing with the
9667         CharSet enumeration.  For now try/catch will do.
9668
9669         * typemanager.cs: Do not crash if a struct does not have fields.
9670         Fixes 56150.
9671
9672 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9673
9674         * expression.cs: cs0213, cant fix a fixed expression.
9675         fixes 50231.
9676
9677 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9678
9679         * cs-parser.jay: detect invalid embeded statements gracefully.
9680         bug #51113.
9681
9682 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9683
9684         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9685         As a regex:
9686         s/
9687         the invocation type may not be a subclass of the tye of the item/
9688         The type of the item must be a subclass of the invocation item.
9689         /g
9690
9691         Fixes bug #50820.
9692
9693 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
9694
9695         * attribute.cs: Added methods to get a string and a bool from an
9696         attribute. Required to information from AssemblyKeyFileAttribute,
9697         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9698         * codegen.cs: Modified AssemblyName creation to include support for
9699         strongnames. Catch additional exceptions to report them as CS1548.
9700         * compiler.csproj: Updated include CryptoConvert.cs.
9701         * compiler.csproj.user: Removed file - user specific configuration.
9702         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
9703         Mono.Security assembly. The original class is maintained and tested in
9704         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9705         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9706         like CSC 8.0 (C# v2) supports.
9707         * Makefile: Added CryptoConvert.cs to mcs sources.
9708         * rootcontext.cs: Added new options for strongnames.
9709
9710 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
9711
9712         * driver.cs: For --expect-error, report error code `2'
9713         if the program compiled with no errors, error code `1' if
9714         it compiled with an error other than the one expected.
9715
9716 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
9717
9718         * compiler.csproj: Updated for Visual Studio .NET 2003.
9719         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9720         * compiler.sln: Updated for Visual Studio .NET 2003.
9721
9722 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
9723
9724         * expression.cs: Fix bug #47234. We basically need to apply the
9725         rule that we prefer the conversion of null to a reference type
9726         when faced with a conversion to 'object' (csc behaviour).
9727
9728 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9729
9730         * statement.cs: Shorter form for foreach, eliminates
9731         a local variable. r=Martin.
9732
9733 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9734
9735         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9736         checks if we can use brtrue/brfalse to test for 0.
9737         * expression.cs: use the above in the test for using brtrue/brfalse.
9738         cleanup code a bit.
9739
9740 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9741
9742         * expression.cs: Rewrite string concat stuff. Benefits:
9743
9744         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9745         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9746         rather than a concat chain.
9747
9748         * typemanager.cs: Add lookups for more concat overloads.
9749
9750 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9751
9752         * expression.cs: Emit shorter il code for array init.
9753
9754         newarr
9755         dup
9756         // set 1
9757
9758         // set 2
9759
9760         newarr
9761         stloc.x
9762
9763         ldloc.x
9764         // set 1
9765
9766         ldloc.x
9767         // set 2
9768
9769 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
9770
9771         * statement.cs: Before, two switch blocks would be merged if the
9772         total size of the blocks (end_item - begin_item + 1) was less than
9773         two times the combined sizes of the blocks.
9774
9775         Now, it will only merge if after the merge at least half of the
9776         slots are filled.
9777
9778         fixes 55885.
9779
9780 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
9781
9782         * class.cs : csc build fix for GetMethods(). See bug #52503.
9783
9784 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
9785
9786         * expression.cs: Make sure fp comparisons work with NaN.
9787         This fixes bug #54303. Mig approved this patch a long
9788         time ago, but we were not able to test b/c the runtime
9789         had a related bug.
9790
9791 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
9792
9793         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
9794
9795 2004-03-19  Martin Baulig  <martin@ximian.com>
9796
9797         * class.cs (MemberCore.IsDuplicateImplementation): Report the
9798         error here and not in our caller.
9799
9800 2004-03-19  Martin Baulig  <martin@ximian.com>
9801
9802         * interface.cs: Completely killed this file.
9803         (Interface): We're now a TypeContainer and live in class.cs.
9804
9805         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9806         argument; we're now also called for interfaces.
9807         (TypeContainer.DefineMembers): Allow this method being called
9808         multiple times.
9809         (TypeContainer.GetMethods): New public method; formerly known as
9810         Interface.GetMethod().  This is used by PendingImplementation.
9811         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9812         it's now private and non-static.
9813         (Interface): Moved this here; it's now implemented similar to
9814         Class and Struct.
9815         (Method, Property, Event, Indexer): Added `bool is_interface'
9816         argument to their .ctor's.
9817         (MemberBase.IsInterface): New public field.
9818
9819         * cs-parser.jay: Create normal Method, Property, Event, Indexer
9820         instances instead of InterfaceMethod, InterfaceProperty, etc.
9821         (opt_interface_base): Removed; we now use `opt_class_base' instead.
9822         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9823
9824 2004-03-19  Martin Baulig  <martin@ximian.com>
9825
9826         * class.cs (MethodCore.IsDuplicateImplementation): New private
9827         method which does the CS0111 checking.
9828         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9829         Use IsDuplicateImplementation().
9830
9831 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9832
9833         * decl.cs (FindMemberToOverride): New method to find the correct
9834         method or property to override in the base class.
9835         * class.cs
9836             - Make Method/Property use the above method to find the
9837               version in the base class.
9838             - Remove the InheritableMemberSignatureCompare as it is now
9839               dead code.
9840
9841         This patch makes large code bases much faster to compile, as it is
9842         O(n) rather than O(n^2) to do this validation.
9843
9844         Also, it fixes bug 52458 which is that nested classes are not
9845         taken into account when finding the base class member.
9846
9847         Reviewed/Approved by Martin.
9848
9849 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
9850
9851         * interface.cs: In all interface classes removed redundant
9852         member initialization.
9853
9854 2004-03-16  Martin Baulig  <martin@ximian.com>
9855
9856         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9857
9858 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9859
9860         * decl.cs (DefineTypeAndParents): New helper method to define a
9861         type's containers before the type itself is defined;  This is a
9862         bug exposed by the recent changes to Windows.Forms when an
9863         implemented interface was defined inside a class that had not been
9864         built yet.   
9865
9866         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9867
9868         (Check): Loop correctly to report errors modifiers
9869         (UNSAFE was not in the loop, since it was the same as TOP).
9870
9871         * interface.cs: Every interface member now takes a ModFlags,
9872         instead of a "is_new" bool, which we set on the base MemberCore. 
9873
9874         Every place where we called "UnsafeOk" in the interface, now we
9875         call the proper member (InterfaceMethod.UnsafeOK) instead to get
9876         the unsafe settings from the member declaration instead of the
9877         container interface. 
9878
9879         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
9880
9881         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9882         `set_indexer_name' to the pending bits (one per type).
9883
9884         We fixed a bug today that was picking the wrong method to
9885         override, since for properties the existing InterfaceMethod code
9886         basically ignored the method name.  Now we make sure that the
9887         method name is one of the valid indexer names.
9888
9889 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
9890  
9891         * support.cs (SeekableStreamReader): Keep track of stream byte
9892         positions and don't mix them with character offsets to the buffer.
9893
9894         Patch from Gustavo Giráldez
9895
9896 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
9897
9898         * interface.cs (InterfaceSetGetBase): Removed double member
9899         initialization, base class does it as well.
9900
9901 2004-03-13  Martin Baulig  <martin@ximian.com>
9902
9903         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9904         when compiling corlib.
9905
9906 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
9907
9908         * convert.cs (ExplicitConversion): We were reporting an error on
9909         certain conversions (object_type source to a value type, when the
9910         expression was `null') before we had a chance to pass it through
9911         the user defined conversions.
9912
9913         * driver.cs: Replace / and \ in resource specifications to dots.
9914         Fixes 50752
9915
9916         * class.cs: Add check for duplicate operators.  Fixes 52477
9917
9918 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
9919
9920         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9921         that are in the middle of the statements, not only at the end.
9922         Fixes #54987
9923
9924         * class.cs (TypeContainer.AddField): No longer set the
9925         `HaveStaticConstructor' flag, now we call it
9926         `UserDefineStaticConstructor' to diferentiate the slightly
9927         semantic difference.
9928
9929         The situation is that we were not adding BeforeFieldInit (from
9930         Modifiers.TypeAttr) to classes that could have it.
9931         BeforeFieldInit should be set to classes that have no static
9932         constructor. 
9933
9934         See:
9935
9936         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9937
9938         And most importantly Zoltan's comment:
9939
9940         http://bugzilla.ximian.com/show_bug.cgi?id=44229
9941
9942         "I think beforefieldinit means 'it's ok to initialize the type sometime 
9943          before its static fields are used', i.e. initialization does not need
9944          to be triggered by the first access to the type. Setting this flag
9945          helps the JIT to compile better code, since it can run the static
9946          constructor at JIT time, and does not need to generate code to call it
9947          (possibly lots of times) at runtime. Unfortunately, mcs does not set
9948          this flag for lots of classes like String. 
9949          
9950          csc sets this flag if the type does not have an explicit static 
9951          constructor. The reasoning seems to be that if there are only static
9952          initalizers for a type, and no static constructor, then the programmer
9953          does not care when this initialization happens, so beforefieldinit
9954          can be used.
9955          
9956          This bug prevents the AOT compiler from being usable, since it 
9957          generates so many calls to mono_runtime_class_init that the AOT code
9958          is much slower than the JITted code. The JITted code is faster, 
9959          because it does not generate these calls if the vtable is type is
9960          already initialized, which is true in the majority of cases. But the
9961          AOT compiler can't do this."
9962
9963 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
9964
9965         * class.cs (MethodData.Emit): Refactor the code so symbolic
9966         information is generated for destructors;  For some reasons we
9967         were taking a code path that did not generate symbolic information
9968         before. 
9969
9970 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9971
9972         * class.cs: Create a Constructor.CheckBase method that
9973         takes care of all validation type code. The method
9974         contains some code that was moved from Define.
9975
9976         It also includes new code that checks for duplicate ctors.
9977         This fixes bug #55148.
9978
9979 2004-03-09  Joshua Tauberer <tauberer@for.net>
9980
9981         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9982         a { ... }-style array creation invokes EmitStaticInitializers
9983         which is not good for reference-type arrays.  String, decimal
9984         and now null constants (NullCast) are not counted toward
9985         static initializers.
9986
9987 2004-03-05  Martin Baulig  <martin@ximian.com>
9988
9989         * location.cs (SourceFile.HasLineDirective): New public field;
9990         specifies whether the file contains or is referenced by a "#line"
9991         directive.
9992         (Location.DefineSymbolDocuments): Ignore source files which
9993         either contain or are referenced by a "#line" directive.        
9994
9995 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
9996
9997         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9998         direct access to our parent, so check the method inline there.
9999
10000 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10001
10002         * expression.cs (Invocation.EmitCall): Miguel's last commit
10003         caused a regression. If you had:
10004
10005             T t = null;
10006             t.Foo ();
10007
10008         In Foo the implict this would be null.
10009
10010 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10011
10012         * expression.cs (Invocation.EmitCall): If the method is not
10013         virtual, do not emit a CallVirt to it, use Call.
10014
10015         * typemanager.cs (GetFullNameSignature): Improve the method to
10016         cope with ".ctor" and replace it with the type name.
10017
10018         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10019         as an argument the ConstructorBuilder where it is being defined,
10020         to catch the recursive constructor invocations.
10021
10022 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10023
10024         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10025         routines to check if a type is an enumerable/enumerator allow
10026         classes that implement the IEnumerable or IEnumerator interfaces.
10027
10028         * class.cs (Property, Operator): Implement IIteratorContainer, and
10029         implement SetYields.
10030
10031         (Property.Define): Do the block swapping for get_methods in the
10032         context of iterators.   We need to check if Properties also
10033         include indexers or not.
10034
10035         (Operator): Assign the Block before invoking the
10036         OperatorMethod.Define, so we can trigger the Iterator code
10037         replacement. 
10038
10039         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10040         Property and Operator classes are not created when we parse the
10041         declarator but until we have the block completed, so we use a
10042         singleton SimpleIteratorContainer.Simple to flag whether the
10043         SetYields has been invoked.
10044
10045         We propagate this setting then to the Property or the Operator to
10046         allow the `yield' to function.
10047
10048 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10049
10050         * codegen.cs: Implemented attribute support for modules.
10051         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10052         Assembly/Module functionality.
10053
10054         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10055         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10056         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10057
10058 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10059
10060         * interface.cs (FindMembers): The operation is performed on all base
10061         interfaces and not only on the first. It is required for future CLS Compliance patch.
10062
10063 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10064
10065         * statement.cs, codegen.cs:
10066         This patch deals with patterns such as:
10067
10068         public class List : IEnumerable {
10069
10070                 public MyEnumerator GetEnumerator () {
10071                         return new MyEnumerator(this);
10072                 }
10073
10074                 IEnumerator IEnumerable.GetEnumerator () {
10075                         ...
10076                 }
10077                 
10078                 public struct MyEnumerator : IEnumerator {
10079                         ...
10080                 }
10081         }
10082
10083         Before, there were a few things we did wrong:
10084         1) we would emit callvirt on a struct, which is illegal
10085         2) we emited ldarg when we needed to emit ldarga
10086         3) we would mistakenly call the interface methods on an enumerator
10087         type that derived from IEnumerator and was in another assembly. For example:
10088
10089         public class MyEnumerator : IEnumerator
10090
10091         Would have the interface methods called, even if there were public impls of the
10092         method. In a struct, this lead to invalid IL code.
10093
10094 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10095
10096         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10097           renamed to Emit.
10098
10099         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10100
10101 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10102
10103         * cs-parser.jay: Fix small regression: we were not testing V2
10104         compiler features correctly.
10105
10106         * interface.cs: If the emit context is null, then create one
10107
10108 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10109
10110         * decl.cs (GetSignatureForError): New virtual method to get full name
10111           for error messages.
10112
10113         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10114           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10115
10116         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10117           Duplicated members and code in these classes has been removed.
10118           Better encapsulation in these classes.
10119
10120 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10121
10122         * assign.cs (Assign.DoResolve): When dealing with compound
10123         assignments, there is a new rule in ECMA C# 2.4 (might have been
10124         there before, but it is documented here) that states that in:
10125
10126         a op= b;
10127
10128         If b is of type int, and the `op' is a shift-operator, then the
10129         above is evaluated as:
10130
10131         a = (int) a op b 
10132
10133         * expression.cs (Binary.ResolveOperator): Instead of testing for
10134         int/uint/long/ulong, try to implicitly convert to any of those
10135         types and use that in pointer arithmetic.
10136
10137         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10138         method to print information for from the type, not from the
10139         null-method we were given.
10140
10141 2004-02-01  Duncan Mak  <duncan@ximian.com>
10142
10143         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10144         parsing for cmd, fixes bug #53694.
10145
10146 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10147
10148         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10149         in the member name duplication tests. Property and operator name duplication
10150         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10151
10152 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10153
10154         * interface.cs (PopulateMethod): Fixed crash when interface method
10155         returns not existing type (error test cs0246-3.cs).
10156
10157 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10158
10159         * cs-parser.jay (interface_accessors): Re-write actions to also
10160         store attributes attached to get and set methods. Fix spelling
10161         while at it.
10162
10163         (inteface_property_declaration): Modify accordingly.
10164
10165         (InterfaceAccessorInfo): New helper class to store information to pass
10166         around between rules that use interface_accessors.
10167
10168         * interface.cs (Emit): Apply attributes on the get and set
10169         accessors of properties and indexers too.
10170
10171         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10172         right MethodBuilder when applying attributes to the get and set accessors.
10173
10174 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10175
10176         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10177
10178 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10179
10180         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10181
10182 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10183
10184         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10185         changes that treat `yield' specially when present before `break'
10186         or `return' tokens.
10187
10188         * cs-tokenizer.cs: yield is no longer a keyword.
10189
10190 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10191
10192         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10193         setting for default constructors.
10194         For default constructors are almost every time set wrong Modifier. The
10195         generated IL code has been alright. But inside mcs this values was
10196         wrong and this was reason why several of my CLS Compliance tests
10197         failed.
10198
10199 2004-01-22  Martin Baulig  <martin@ximian.com>
10200
10201         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10202         not a QualifiedIdentifier.  This is what `type_name_expression'
10203         was previously doing.
10204         (type_name_expression): Removed; the code is now in
10205         `namespace_or_type_name'.
10206         (qualified_identifier): Removed, use `namespace_or_type_name'
10207         instead.
10208         (QualifiedIdentifier): Removed this class.      
10209
10210 2004-01-22  Martin Baulig  <martin@ximian.com>
10211
10212         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10213         not a string as alias name.
10214
10215 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10216
10217         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10218         #52730 bug, and instead compute correctly the need to use a
10219         temporary variable when requesting an address based on the
10220         static/instace modified of the field and the constructor.
10221  
10222 2004-01-21  Martin Baulig  <martin@ximian.com>
10223
10224         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10225         class and namespace before looking up aliases.  Fixes #52517.
10226
10227 2004-01-21  Martin Baulig  <martin@ximian.com>
10228
10229         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10230         assinged in a 'try'; fixes exception4.cs.
10231
10232 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10233         * class.cs : Implemented parameter-less constructor for TypeContainer
10234
10235         * decl.cs: Attributes are now stored here. New property OptAttributes
10236
10237         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10238
10239         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10240
10241 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10242
10243         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10244           (CSharpSignature): New method for indexer and property signature.
10245
10246 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10247
10248         * pending.cs (IsVirtualFilter): Faster implementation.
10249
10250 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10251
10252         * typemanager.cs: Avoid inclusion of same assembly more than once.
10253
10254 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10255
10256         * cs-parser.jay: Fixed problem where the last assembly attribute
10257           has been applied also to following declaration (class, struct, etc.)
10258           
10259 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10260
10261         * class.cs: Added error CS0538, CS0539 reporting.
10262         Fixed crash on Microsoft runtime when field type is void.
10263
10264         * cs-parser.jay: Added error CS0537 reporting.
10265
10266         * pending.cs: Added error CS0535 reporting.
10267         Improved error report for errors CS0536, CS0534.
10268
10269 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10270
10271         Merge a few bits from the Anonymous Method MCS tree.
10272
10273         * statement.cs (ToplevelBlock): New class for toplevel methods,
10274         will hold anonymous methods, lifted variables.
10275
10276         * cs-parser.jay: Create toplevel blocks for delegates and for
10277         regular blocks of code. 
10278
10279 2004-01-20  Martin Baulig  <martin@ximian.com>
10280
10281         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10282         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10283         and `NeedExplicitReturn'; added `IsLastStatement'.
10284         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10285         have a `ReturnLabel' or we're not unreachable.
10286
10287         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10288         child's reachability; don't just override ours with it.  Fixes
10289         #58058 (lluis's example).
10290         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10291         InFinally(), InLoop(), InSwitch() and
10292         BreakCrossesTryCatchBoundary() methods.
10293
10294         * statement.cs (Return): Do all error checking in Resolve().
10295         Unless we are the last statement in a top-level block, always
10296         create a return label and jump to it.
10297         (Break, Continue): Do all error checking in Resolve(); also make
10298         sure we aren't leaving a `finally'.
10299         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10300         statement in a top-level block.
10301         (Block.Flags): Added `IsDestructor'.
10302         (Block.IsDestructor): New public property.
10303
10304 2004-01-20  Martin Baulig  <martin@ximian.com>
10305
10306         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10307
10308 2004-01-20  Martin Baulig  <martin@ximian.com>
10309
10310         * statement.cs (Statement.ResolveUnreachable): New public method.
10311         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10312         (Block.Resolve): Resolve unreachable statements.
10313
10314 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10315
10316         * expression.cs: We need to fix the case where we do
10317         not have a temp variable here.
10318
10319         * assign.cs: Only expression compound assignments need
10320         temporary variables.
10321
10322 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10323
10324         * flowanalysis.cs: Reduce memory allocation in a few ways:
10325           - A block with no variables should not allocate a bit
10326             vector for itself.
10327           - A method with no out parameters does not need any tracking
10328             for assignment of the parameters, so we need not allocate
10329             any data for it.
10330           - The arrays:
10331                 public readonly Type[] VariableTypes;
10332                 public readonly string[] VariableNames;
10333             Are redundant. The data is already stored in the variable
10334             map, so we need not allocate another array for it.
10335           - We need to add alot of checks for if (params | locals) == null
10336             due to the first two changes.
10337
10338 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10339
10340         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10341         implement IMemoryLocation, we store a copy on a local variable and
10342         take the address of it.  Patch from Benjamin Jemlich
10343
10344         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10345         to use a special "type_name_expression" rule which reduces the
10346         number of "QualifiedIdentifier" classes created, and instead
10347         directly creates MemberAccess expressions.
10348
10349 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
10350
10351         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10352         that fixes #52853.  Null literal assignment to ValueType
10353
10354         * class.cs (MethodData.Emit): Instead of checking the name of the
10355         method to determine if its a destructor, create a new derived
10356         class from Method called Destructor, and test for that.  
10357
10358         * cs-parser.jay: Create a Destructor object instead of a Method.  
10359
10360         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10361
10362         Fixes: 52933
10363
10364 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
10365
10366         * expression.cs (Binary.ResolveOperator): Perform an implicit
10367         conversion from MethodGroups to their delegate types on the
10368         Addition operation.
10369
10370         * delegate.cs: Introduce a new class DelegateCreation that is the
10371         base class for `NewDelegate' and `ImplicitDelegateCreation',
10372         factor some code in here.
10373
10374         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10375         conversion from MethodGroups to compatible delegate types. 
10376
10377         * ecore.cs (Expression.Resolve): Do not flag error 654
10378         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10379         we allow conversions from MethodGroups to delegate types now.
10380
10381         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10382         assignments in v2 either.
10383
10384 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
10385
10386         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10387         static read-only fields in ctors.
10388
10389         Applied patch from Benjamin Jemlich 
10390
10391         * expression.cs (UnaryMutator): Avoid leaking local variables. 
10392
10393 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
10394
10395         * cs-tokenizer.cs (IsCastToken): Allow the various native types
10396         here to return true, as they can be used like this:
10397
10398                 (XXX) int.MEMBER ()
10399
10400         Fixed 49836 and all the other dups
10401
10402 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
10403
10404         * driver.cs: Implement /win32res and /win32icon.
10405
10406 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
10407
10408         * cs-parser.jay: Add a rule to improve error handling for the
10409         common mistake of placing modifiers after the type.
10410
10411 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
10412
10413         * cs-parser.jay (interface_event_declaration): Catch
10414         initialization of events on interfaces, and report cs0068
10415
10416         * cs-parser.jay (interface_event_declaration): Catch
10417         initialization of events. 
10418
10419         * ecore.cs: Better report missing constructors.
10420
10421         * expression.cs (Binary.ResolveOperator): My previous bug fix had
10422         the error reporting done in the wrong place.  Fix.
10423
10424         * expression.cs (Binary.ResolveOperator): Catch the 
10425         operator + (E x, E y) error earlier, and later allow for implicit
10426         conversions in operator +/- (E e, U x) from U to the underlying
10427         type of E.
10428
10429         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10430         52596, if the container class is abstract, the default constructor
10431         is protected otherwise its public (before, we were always public).
10432
10433         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10434         fixed statement.
10435
10436         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10437         Jemlich that fixes bug #52597, MCS was generating invalid code for
10438         idisposable structs.   Thanks to Ben for following up with this
10439         bug as well.
10440
10441 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
10442
10443         * driver.cs: Allow assemblies without code to be generated, fixes
10444         52230.
10445
10446 2004-01-07  Nick Drochak <ndrochak@gol.com>
10447
10448         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10449
10450 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
10451
10452         * cs-parser.jay: Add rules to improve error reporting if fields or
10453         methods are declared at the namespace level (error 116)
10454
10455         * Add rules to catch event add/remove
10456
10457 2004-01-04  David Sheldon <dave-mono@earth.li>
10458
10459   * expression.cs: Added matching ")" to error message for 
10460   CS0077
10461
10462 2004-01-03 Todd Berman <tberman@gentoo.org>
10463
10464         * ecore.cs, attribute.cs:
10465         Applying fix from #52429.
10466
10467 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10468
10469         * ecore.cs, expression.cs, statement.cs:
10470         Total rewrite of how we handle branching. We
10471         now handle complex boolean expressions with fewer
10472         jumps. As well if (x == 0) no longer emits a ceq.
10473
10474         if (x is Foo) is much faster now, because we generate
10475         better code.
10476
10477         Overall, we get a pretty big improvement on our benchmark
10478         tests. The code we generate is smaller and more readable.
10479
10480         I did a full two-stage bootstrap. The patch was reviewed
10481         by Martin and Miguel.
10482
10483 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10484
10485         * cs-parser.jay: Make primary_expression not take a QI.
10486         we dont need this because the member_access rule covers
10487         us here. So we replace the rule with just IDENTIFIER.
10488
10489         This has two good effects. First, we remove a s/r conflict.
10490         Second, we allocate many fewer QualifiedIdentifier objects.
10491
10492 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10493
10494         * attribute.cs: Handle MarshalAs attributes as pseudo, and
10495         set the correct information via SRE. This prevents
10496         hanging on the MS runtime. Fixes #29374.
10497
10498 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10499
10500         * convert.cs: correctly handle conversions to value types
10501         from Enum and ValueType as unboxing conversions.
10502
10503         Fixes bug #52569. Patch by Benjamin Jemlich.
10504
10505 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10506
10507         * expression.cs (BetterConversion): Prefer int -> uint
10508         over int -> ulong (csc's behaviour). This fixed bug #52046.
10509
10510 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10511
10512         * decl.cs (MemberCache.FindMembers): now returns a
10513         MemberInfo [].
10514
10515         * typemanager.cs: In general, go with with ^^.
10516         (CopyNewMethods): take an IList.
10517         (RealMemberLookup): Only allocate an arraylist
10518         if we copy from two sets of methods.
10519
10520         This change basically does two things:
10521         1) Fewer array lists allocated due to CopyNewMethods.
10522         2) the explicit cast in MemberList costed ALOT.
10523
10524 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10525
10526         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10527         a hashtable to avoid needless string allocations when an identifier is
10528         used more than once (the common case).
10529
10530 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10531
10532         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10533         is broken, it will not return anything. So, we
10534         have to use the information we have in mcs to
10535         do the task.
10536
10537         * typemanager.cs: Add a cache for GetInterfaces,
10538         since this will now be used more often (due to ^^)
10539
10540         (GetExplicitInterfaces) New method that gets the
10541         declared, not effective, interfaces on a type
10542         builder (eg, if you have interface IFoo, interface
10543         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10544         { IBar }.
10545
10546         This patch makes MCS able to bootstrap itself on
10547         Windows again.
10548
10549 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10550
10551         * expression.cs: Remove the Nop's that Miguel put
10552         in by mistake.
10553
10554 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10555
10556         * report.cs, codegen.cs: Give the real stack trace to
10557         the error when an exception is thrown.
10558
10559 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10560
10561         * decl.cs: only allocate hashtables for ifaces if 
10562         it is an iface!
10563
10564 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10565
10566         * expression.cs: fix the error from cs0121-2.cs
10567         (a parent interface has two child interfaces that
10568         have a function with the same name and 0 params
10569         and the function is called through the parent).
10570
10571 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10572
10573         * class.cs, rootcontext.cs, typmanager.cs: do not
10574         leak pointers.
10575
10576 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10577
10578         * codegen.cs: remove stack for the ec flow branching.
10579         It is already a linked list, so no need.
10580
10581 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10582
10583         * Makefile: Allow custom profiler here.
10584
10585 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10586
10587         * typemanager.cs (LookupType):
10588           - Use a static char [], because split takes
10589             a param array for args, so it was allocating
10590             every time.
10591           - Do not store true in a hashtable, it boxes.
10592
10593 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10594
10595         * flowanalysis.cs: bytify common enums.
10596
10597 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10598
10599         * modifiers.cs: Add a new set of flags for the
10600         flags allowed on explicit interface impls.
10601         * cs-parser.jay: catch the use of modifiers in
10602         interfaces correctly.
10603         * class.cs: catch private void IFoo.Blah ().
10604
10605         All related to bug #50572.
10606
10607 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10608
10609         * decl.cs: Rewrite the consistant accessability checking.
10610         Accessability is not linear, it must be implemented in
10611         a tableish way. Fixes #49704.
10612
10613 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10614
10615         * expression.cs: Handle negation in a checked context.
10616         We must use subtraction from zero. Fixes #38674.
10617
10618 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10619
10620         * class.cs: Ignore static void main in DLLs.
10621         * rootcontext.cs: Handle the target type here,
10622         since we are have to access it from class.cs
10623         * driver.cs: account for the above.
10624
10625 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10626
10627         * report.cs: Give line numbers and files if available.
10628
10629 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10630
10631         * driver.cs: Implement /addmodule.
10632
10633         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10634         ModuleBuilders.
10635
10636 2003-12-20  Martin Baulig  <martin@ximian.com>
10637
10638         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10639         (FieldBase.IsAssigned): Removed this field.
10640         (FieldBase.SetAssigned): New public method.
10641         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10642
10643 2003-12-20  Martin Baulig  <martin@ximian.com>
10644
10645         * expression.cs (LocalVariableReference.DoResolve): Don't set
10646         `vi.Used' if we're called from DoResolveLValue().
10647
10648         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10649         returns the usage vector it just merged into the current one -
10650         pass this one to UsageWarning().
10651         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10652         of the `EmitContext', don't call this recursively on our children.
10653
10654 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
10655
10656         * driver.cs: Implement /target:module.
10657
10658 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10659
10660         * support.cs (CharArrayHashtable): New helper class.
10661
10662         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
10663         char arrays, not strings, so we can avoid creating a string in
10664         consume_identifier if the identifier is a keyword.
10665
10666 2003-12-16  Martin Baulig  <martin@ximian.com>
10667
10668         * statement.cs (LocalInfo.Assigned): Removed this property.
10669         (LocalInfo.Flags): Removed `Assigned'.
10670         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10671         and uses flow analysis.
10672         (Block.UsageWarning): Made this method private.
10673         (Block.Resolve): Call UsageWarning() if appropriate.
10674
10675         * expression.cs (LocalVariableReference.DoResolve): Always set
10676         LocalInfo.Used here.
10677
10678 2003-12-13  Martin Baulig  <martin@ximian.com>
10679
10680         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10681         any value here; we're now using flow analysis to figure out
10682         whether a statement/block returns a value.
10683
10684 2003-12-13  Martin Baulig  <martin@ximian.com>
10685
10686         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10687         working again.
10688         (FlowBranching.MergeFinally): Don't call
10689         `branching.CheckOutParameters()' here, this is called in
10690         MergeTopBlock().
10691         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10692         when adding the `finally' vector.       
10693
10694 2003-12-13  Martin Baulig  <martin@ximian.com>
10695
10696         * flowanalysis.cs
10697         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10698         actually work and also fix #48962.
10699
10700 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10701
10702         * decl.cs: Do not check System.Object for nested types,
10703         since we know it does not have any. Big bang for buck:
10704
10705         BEFORE:
10706            Run 1:   8.35 seconds
10707            Run 2:   8.32 seconds
10708            corlib:  17.99 seconds
10709         AFTER:
10710            Run 1:   8.17 seconds
10711            Run 2:   8.17 seconds
10712            corlib:  17.39 seconds
10713
10714 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10715
10716         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10717         time we are returning 0 members, so we save alot here.
10718
10719 2003-12-11  Martin Baulig  <martin@ximian.com>
10720
10721         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10722         `MergeChild()', also just take the `FlowBranching' as argument;
10723         call Merge() on it and return the result.
10724         (FlowBranching.Merge): We don't need to do anything if we just
10725         have one sibling.
10726
10727 2003-12-11  Martin Baulig  <martin@ximian.com>
10728
10729         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10730         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10731         Maurer for this idea.
10732
10733 2003-12-11  Martin Baulig  <martin@ximian.com>
10734
10735         * flowanalysis.cs (MergeResult): This class is now gone; we now
10736         use the `UsageVector' for this.  The reason for this is that if a
10737         branching just has one sibling, we don't need to "merge" them at
10738         all - that's the next step to do.
10739         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10740         `MergeResult'.
10741
10742 2003-12-11  Martin Baulig  <martin@ximian.com>
10743
10744         Reworked flow analyis and made it more precise and bug-free.  The
10745         most important change is that we're now using a special `Reachability'
10746         class instead of having "magic" meanings of `FlowReturns'.  I'll
10747         do some more cleanups and optimizations and also add some more
10748         documentation this week.
10749
10750         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10751         largely reworked this class.
10752         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10753         the new `Reachability' class instead of having "magic" values here.
10754         (FlowBranching): We're now using an instance of `Reachability'
10755         instead of having separate `Returns', `Breaks' etc. fields.
10756
10757         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10758         based on flow analysis; ignore the return value of block.Emit ().
10759
10760 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10761
10762         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10763         if they are private.
10764
10765 2003-12-09  Martin Baulig  <martin@ximian.com>
10766
10767         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10768         call them directly on the UsageVector.
10769
10770 2003-12-09  Martin Baulig  <martin@ximian.com>
10771
10772         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10773         Changed return type from `FlowReturns' to `Reachability'.
10774
10775 2003-12-09  Martin Baulig  <martin@ximian.com>
10776
10777         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10778         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10779         `Reachable' fields with a single `Reachability' one.
10780
10781 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10782
10783         * class.cs (FindMembers): Remove foreach's.
10784
10785         Bootstrap times:
10786
10787         BEFORE
10788                 Run 1:   8.74 seconds
10789                 Run 2:   8.71 seconds
10790
10791         AFTER
10792                 Run 1:   8.64 seconds
10793                 Run 2:   8.58 seconds
10794
10795
10796 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10797
10798         * cs-parser.jay:
10799         * gen-treedump.cs:
10800         * statement.cs:
10801         This patch does a few things:
10802                 1. EmptyStatement is now a singleton, so it is never reallocated.
10803                 2. All blah is EmptyStatement constructs have been changed to
10804                    blah == EmptyStatement.Value, which is much faster and valid
10805                    now that EmptyStatement is a singleton.
10806                 3. When resolving a block, rather than allocating a new array for
10807                    the non-empty statements, empty statements are replaced with
10808                    EmptyStatement.Value
10809                 4. Some recursive functions have been made non-recursive.
10810         Mainly the performance impact is from (3), however (1) and (2) are needed for
10811         this to work. (4) does not make a big difference in normal situations, however
10812         it makes the profile look saner.
10813
10814         Bootstrap times:
10815
10816         BEFORE
10817         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10818         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10819         Total memory allocated: 56397 KB
10820
10821         AFTER
10822         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10823         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10824         Total memory allocated: 55666 KB
10825
10826 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10827
10828         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10829         than the hashtable in a hashtable version
10830
10831         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10832         we always end up concating a string. This results in a huge perf
10833         loss, because many strings have to be tracked by the GC. In this
10834         patch, we first use a hashtable that works with two keys, so that
10835         the strings do not need to be concat'ed.
10836
10837         Bootstrap times:
10838         BEFORE
10839                 Run 1:   8.74 seconds
10840                 Run 2:   8.71 seconds
10841
10842         AFTER
10843                 Run 1:   8.65 seconds
10844                 Run 2:   8.56 seconds
10845
10846 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10847
10848         * Makefile: Add a new target `do-time' that does a quick and simple
10849         profile, leaving easy to parse output.
10850
10851 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10852
10853         * codegen.cs (Init): Create the dynamic assembly with 
10854         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10855
10856 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10857
10858         * support.cs: Make the PtrHashtable use only one
10859         instance of its comparer.
10860
10861 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10862
10863         * typemanager.cs: Fix lookup of GetNamespaces.
10864
10865 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10866
10867         * expression.cs: Removed redundant line.
10868
10869         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10870         ArrayLists, use for loops with bounds.  
10871
10872         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10873         arraylist.
10874
10875         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10876         arraylists, use for loop with bounds.
10877
10878         The above three changes give us a 0.071 second performance
10879         improvement out of 3.294 seconds down to 3.223.  On my machine
10880         the above changes reduced the memory usage by 1,387 KB during
10881         compiler bootstrap.
10882
10883         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10884         QualifiedIdentifiers.  Before we created a new string through
10885         concatenation, and mostly later on, the result would be
10886         manipulated by DecomposeQI through string manipulation.
10887
10888         This reduced the compiler memory usage for bootstrapping from
10889         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10890         compile times in 0.05 seconds.
10891
10892 2003-11-28  Dick Porter  <dick@ximian.com>
10893
10894         * support.cs: Do string compares with the Invariant culture.
10895
10896         * rootcontext.cs: 
10897         * gen-treedump.cs: 
10898         * expression.cs: 
10899         * driver.cs: 
10900         * decl.cs: 
10901         * codegen.cs: 
10902         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10903         the comparison is done with the Invariant culture.
10904
10905 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10906
10907         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10908         GetEnumerator method.
10909
10910         (ProbeCollectionType): Iterate starting at the most specific type
10911         upwards looking for a GetEnumerator
10912
10913         * expression.cs: Shift count can be up to 31 for int/uint and 63
10914         for long/ulong.
10915
10916 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10917
10918         * statement.cs (Block.LookupLabel): Also look for the label on the
10919         children blocks.  Use a hash table to keep track of visited
10920         nodes. 
10921
10922         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10923         we actually did transform the other operand, otherwise fall back
10924         to the common codepath that casts to long.
10925
10926         * cs-tokenizer.cs: Use the same code pattern as the int case.
10927         Maybe I should do the parsing myself, and avoid depending on the
10928         Parse routines to get this done.
10929
10930 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10931
10932         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10933         which fixes bug 51347.  This time test it.
10934
10935         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10936         attributes for example can not tell the difference between these.
10937         The difference was only a syntax feature of the language. 
10938
10939         * attribute.cs: Apply attributes to delegates.
10940
10941         * delegate.cs: Call the apply attributes method.
10942
10943 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10944
10945         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10946         comparing 0 vs Byte.MinValue, not the value
10947
10948         (ImplicitConversionRequired): When reporting a conversion error,
10949         use error 31 to print out the constant error instead of the
10950         simpler 29.
10951
10952         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10953         which fixes bug 51347.
10954
10955 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10956
10957         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10958         which fixes the -warnaserror command line option.
10959
10960 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10961
10962         * cfold.cs (DoNumericPromotions): During constant folding of
10963         additions on UIntConstant, special case intconstants with
10964         IntConstants like we do on the expression binary operator. 
10965
10966 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10967
10968         * convert.cs (ImplicitReferenceConversion): We were missing a case
10969         (System.Enum are not value types or class types, so we need to
10970         classify them separatedly).
10971
10972         * driver.cs: We do not support error 2007.
10973
10974 2003-11-12 Jackson Harper <jackson@ximian.com>
10975
10976         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10977         system directory. Also use the full file name so users can
10978         libraries names mscorlib-o-tron.dll in a non system dir.
10979
10980 2003-11-10  Martin Baulig  <martin@ximian.com>
10981
10982         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10983         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10984         calling `ResolveType()' on them, directly assign their `Type'.
10985
10986 2003-11-08  Martin Baulig  <martin@ximian.com>
10987
10988         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10989         return value and the `out parent' parameter.
10990         (TypeContainer.DefineType): Moved the CS0644 check into
10991         GetClassBases().  Don't pass the interface types to the
10992         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10993         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10994
10995         * ecore.cs (TypeExpr.IsAttribute): New property.
10996         (TypeExpr.GetInterfaces): New method.
10997
10998         * interface.cs (Interface.GetInterfaceTypeByName): Return a
10999         TypeExpr instead of a Type.
11000         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11001         (Interface.DefineType): Don't pass the interface types to the
11002         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11003         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11004
11005         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11006         instead of a `Type[]'.
11007         (TypeManager.RegisterBuilder): Likewise.
11008         (TypeManager.AddUserInterface): Likewise.
11009         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11010         `Type[]' and also return a `TypeExpr[]'.
11011         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11012
11013 2003-11-08  Martin Baulig  <martin@ximian.com>
11014
11015         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11016         Expression.     
11017
11018 2003-11-08  Martin Baulig  <martin@ximian.com>
11019
11020         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11021         TypeManager.ResolveExpressionTypes().
11022
11023         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11024         instead of an Expression.
11025         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11026         (TypeExpression): New public class; formerly known as `TypeExpr'.
11027
11028         * expression.cs (ComposedCast): Derive from TypeExpr.
11029
11030         * typemanager.cs (TypeManager.system_*_expr): These are now
11031         TypExpr's instead of Expression's.
11032         (TypeManager.ResolveExpressionTypes): New public static function;
11033         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11034         of them.        
11035
11036 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11037
11038         * expression.cs (New.DoResolve): Do not dereference value that
11039         might be a null return.
11040
11041         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11042         sure that the constant value has the right type.  Fixes an
11043         unreported bug, similar to 50425.
11044
11045         * const.cs (Const.LookupConstantValue): Call
11046         ImplicitStandardConversionExists before doing a conversion to
11047         avoid havng the TypeManager.ChangeType do conversions.
11048
11049         Reduced the number of casts used
11050
11051         (Const.ChangeType): New routine to enable reuse of the constant
11052         type changing code from statement.
11053
11054         * typemanager.cs (ChangeType): Move common initialization to
11055         static global variables.
11056
11057         Fixes #50425.
11058
11059         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11060         every value type to go through, even if it was void.  Fix that. 
11061
11062         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11063         character of the define, and the is_identifier_part_character for
11064         the rest of the string.
11065
11066 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11067
11068         * expression.cs (UnaryMutator.EmitCode): When I updated
11069         LocalVariableReference.DoResolve, I overdid it, and dropped an
11070         optimization done on local variable references.
11071
11072 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11073
11074         * ecore.cs: Convert the return from Ldlen into an int.
11075
11076 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11077
11078         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11079         the accessibility, this is a special case for toplevel non-public
11080         classes (internal for instance).
11081
11082 2003-10-20  Nick Drochak <ndrochak@gol.com>
11083
11084         * ecore.cs: Fix typo and build.  Needed another right paren.
11085
11086 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11087
11088         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11089         `internal' case regular and protected, but not allowing protected
11090         to be evaluated later.  Bug 49840
11091
11092 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11093
11094         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11095         to kb.Nlast, and not the kb.nFirst to isolate the switch
11096         statement.
11097
11098         Extract the underlying type, so enumerations of long/ulong are
11099         treated like long/ulong.
11100
11101 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11102
11103         * expression.cs (New): Overload the meaning of RequestedType to
11104         track the possible creation of the NewDelegate type, since
11105         DoResolve is invoked more than once for new constructors on field
11106         initialization.
11107
11108         See bugs: #48800 and #37014
11109
11110         * cs-parser.jay (declare_local_constants): Take an arraylist
11111         instead of a single constant.
11112
11113         (local_constant_declaration): It should take a
11114         constant_declarators, not a constant_declarator.  Fixes 49487
11115
11116         * convert.cs: Fix error report.
11117
11118 2003-10-13 Jackson Harper <jackson@ximian.com>
11119
11120         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11121         bug #49611
11122
11123 2003-10-09  Martin Baulig  <martin@ximian.com>
11124
11125         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11126         to the .ctor.
11127         (MethodCore.DoDefineParameters): Removed the TypeContainer
11128         argument; use the DeclSpace which was passed to the .ctor instead.
11129         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11130         TypeContainer; we only need a DeclSpace here.
11131
11132 2003-10-09  Martin Baulig  <martin@ximian.com>
11133
11134         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11135         to the .ctor.
11136         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11137         EmitContext's .ctor.    
11138
11139 2003-10-09  Martin Baulig  <martin@ximian.com>
11140
11141         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11142         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11143         AsAccessible(), moved them as well.
11144
11145         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11146
11147 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11148
11149         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11150
11151 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11152
11153         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11154         generation for >=, as spotted by Paolo, bug 48679.  
11155         Patch from David Waite.
11156
11157         * cs-tokenizer.cs: Add handling for #pragma.
11158
11159         * cs-parser.jay: Allow for both yield and yield return in the
11160         syntax.  The anti-cobolization of C# fight will go on!
11161
11162         * class.cs (TypeBuilder.DefineType): Catch error condition here
11163         (Parent.DefineType erroring out and returning null).
11164
11165         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11166         coping with enumerations variables, we were mistakenly processing
11167         them as a regular value type instead of built-in types.  Fixes the
11168         bug #48063
11169
11170         * typemanager.cs (IsBuiltinOrEnum): New method.
11171
11172 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
11173
11174         * cs-parser.jay: Upgrade: yield now needs the return clause.
11175
11176 2003-09-19  Martin Baulig  <martin@ximian.com>
11177
11178         * decl.cs (MemberCache.SetupCacheForInterface): Take a
11179         `MemberCache parent' argument.  Normally, an interface doesn't
11180         have a parent type except System.Object, but we use this in gmcs
11181         for generic type parameters.
11182
11183 2003-09-18  Martin Baulig  <martin@ximian.com>
11184
11185         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11186         on `type.IsInterface'; don't check whether the type has a parent
11187         to determine whether it's an interface.
11188
11189 2003-09-15  Martin Baulig  <martin@ximian.com>
11190
11191         * class.cs (TypeContainer.DefineType): Added an error flag to
11192         avoid reporting duplicate CS0146's ("class definition is
11193         circular.").
11194
11195         * driver.cs (Driver.MainDriver): Abort if
11196         RootContext.ResolveTree() reported any errors.
11197
11198 2003-09-07  Martin Baulig  <martin@ximian.com>
11199
11200         * report.cs (Error, Warning): Added overloaded versions which take
11201         a `params object[] args' and call String.Format().
11202
11203 2003-09-07  Martin Baulig  <martin@ximian.com>
11204
11205         * decl.cs (DeclSpace..ctor): Don't call
11206         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11207         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11208         (DeclSpace.RecordDecl): New method.
11209
11210         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11211
11212 2003-09-02  Ravi Pratap  <ravi@ximian.com>
11213
11214         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11215         value attributes to be applied to ParameterBuilders.
11216
11217         * class.cs (MethodCore.LabelParameters): Make static and more
11218         generic so that it can be used from other places - like interface
11219         methods, for instance.
11220
11221         * interface.cs (Interface.Emit): Call LabelParameters before
11222         emitting attributes on the InterfaceMethod.
11223
11224 2003-08-26  Martin Baulig  <martin@ximian.com>
11225
11226         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11227         resolving aliases; fixes #47927.
11228
11229 2003-08-26  Martin Baulig  <martin@ximian.com>
11230
11231         * statement.cs (Using.DoResolve): This is internally emitting a
11232         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11233         do not always return.  Fixes #47681.
11234
11235 2003-08-26  Martin Baulig  <martin@ximian.com>
11236
11237         * decl.cs (MemberCore): Moved WarningNotHiding(),
11238         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11239         into MemberBase.
11240         (AdditionResult): Make this nested in DeclSpace.
11241         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11242         argument; call NamespaceEntry.Define() unless we're nested in a
11243         class or struct.
11244
11245         * namespace.cs (Namespace.DefineName): New public function.  This
11246         is called from DeclSpace's .ctor to add 
11247         (Namespace.Lookup): Include DeclSpaces in the lookup.
11248
11249         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11250
11251         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11252
11253 2003-08-25  Martin Baulig  <martin@ximian.com>
11254
11255         * convert.cs (Convert.ExplicitReferenceConversion): When
11256         converting from an interface type to a class, unbox if the target
11257         type is a struct type.  Fixes #47822.
11258
11259 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11260
11261         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11262         #47854.
11263
11264 2003-08-22  Martin Baulig  <martin@ximian.com>
11265
11266         * class.cs (TypeManager.DefineType): When defining a nested type,
11267         call DefineType() on our parent; fixes #47801.
11268
11269 2003-08-22  Martin Baulig  <martin@ximian.com>
11270
11271         * class.cs (MethodData.Define): While checking if a method is an
11272         interface implementation, improve the test a bit more to fix #47654.
11273
11274 2003-08-22  Martin Baulig  <martin@ximian.com>
11275
11276         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11277         correctly; fixes #47722.
11278
11279 2003-08-22  Martin Baulig  <martin@ximian.com>
11280
11281         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11282         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11283
11284         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11285
11286 2003-08-22  Martin Baulig  <martin@ximian.com>
11287
11288         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11289         can only be assigned in static constructors.  Fixes #47161.
11290
11291 2003-08-22  Martin Baulig  <martin@ximian.com>
11292
11293         Rewrote and improved the flow analysis code.
11294
11295         * flowbranching.cs (FlowBranching): Make this class abstract.
11296         (FlowBranching.CreateBranching): New static function to create a
11297         new flow branching.
11298         (FlowBranchingBlock, FlowBranchingException): New classes.
11299         (FlowBranching.UsageVector.Type): New public readonly field.
11300         (FlowBranching.UsageVector.Breaks): Removed the setter.
11301         (FlowBranching.UsageVector.Returns): Removed the setter.
11302         (FlowBranching.UsageVector): Added Break(), Return(),
11303         NeverReachable() and Throw() methods to modify the reachability.
11304         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11305         done by FlowBranching.Merge().
11306         (FlowBranching.UsageVector.MergeChild): New method; merges the
11307         merge result into the current vector.
11308         (FlowBranching.Merge): New abstract method to merge a branching.
11309
11310 2003-08-12  Martin Baulig  <martin@ximian.com>
11311
11312         * expression.cs (Indirection.CacheTemporaries): Create the
11313         LocalTemporary with the pointer type, not its element type.
11314
11315 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11316
11317         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11318         token was a keyword or not.
11319
11320         Add `error' options where an IDENTIFIER was expected;  Provide
11321         CheckToken and CheckIdentifierToken convenience error reporting
11322         functions. 
11323
11324         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11325
11326         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11327         NameSpaceEntry NameSpaceEntry.
11328
11329         (LookupInterfaceOrClass): Avoid creating a full qualified name
11330         from namespace and name: avoid doing lookups when we know the
11331         namespace is non-existant.   Use new Tree.LookupByNamespace which
11332         looks up DeclSpaces based on their namespace, name pair.
11333
11334         * driver.cs: Provide a new `parser verbose' to display the
11335         exception thrown during parsing.  This is turned off by default
11336         now, so the output of a failure from mcs is more graceful.
11337
11338         * namespace.cs: Track all the namespaces defined in a hashtable
11339         for quick lookup.
11340
11341         (IsNamespace): New method
11342
11343 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11344
11345         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11346         we know that we need to concatenate (full typename can never be
11347         null). 
11348
11349         * class.cs: ditto.
11350
11351         * statement.cs: Use a bitfield;  Do not initialize to null things
11352         which are done by the constructor by default.
11353
11354         * cs-parser.jay: bug fix, parameter was 4, not 3.
11355
11356         * expression.cs: Just use the property;
11357
11358         * statement.cs: No need for GetVariableInfo method.
11359
11360 2003-08-08  Martin Baulig  <martin@ximian.com>
11361
11362         * flowanalysis.cs (FlowReturns): This is now nested in the
11363         `FlowBranching' class.
11364         (MyBitVector): Moved this here from statement.cs.
11365         (FlowBranching.SiblingType): New enum type.
11366         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11367
11368 2003-08-07  Martin Baulig  <martin@ximian.com>
11369
11370         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11371         `FlowBranching' class and called `BranchingType'.
11372
11373 2003-08-07  Martin Baulig  <martin@ximian.com>
11374
11375         * flowanalysis.cs: Moved all the control flow analysis code into
11376         its own file.
11377
11378 2003-08-07  Martin Baulig  <martin@ximian.com>
11379
11380         * assign.cs (Assign.DoResolve): `target' must either be an
11381         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11382         #37319.
11383
11384 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11385
11386         * expression.cs (BinaryMethod): This kind of expression is created by the
11387         Binary class if it determines that the operator has to be handled
11388         by a method.
11389
11390         (BinaryDelegate): This kind of expression is created if we are
11391         dealing with a + or - operator on delegates.
11392
11393         (Binary): remove method, argumetns, and DelegateOperator: when
11394         dealing with methods, 
11395
11396         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11397
11398         * statement.cs (Block): use bitfields for the three extra booleans
11399         we had in use.   Remove unused topblock parameter.
11400
11401         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11402
11403         * assign.cs: Drop extra unneeded tests.
11404
11405 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11406
11407         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11408
11409         * statement.cs (Foreach): Use VariableStorage instead of
11410         LocalBuilders.   
11411
11412         * codegen.cs (VariableStorage): New class used by clients that
11413         require a variable stored: locals or fields for variables that
11414         need to live across yield.
11415
11416         Maybe provide a convenience api for EmitThis+EmitLoad?
11417
11418         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11419         these bad boys.
11420
11421 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11422
11423         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11424         RemapParameterLValue): New methods that are used to turn a
11425         precomputed FieldInfo into an expression like this:
11426
11427                 instance.FieldInfo
11428
11429         The idea is to use this instead of making LocalVariableReference
11430         have more than one meaning.
11431
11432         * cs-parser.jay: Add error production to BASE.
11433
11434         * ecore.cs: Deal with TypeManager.GetField returning null, which
11435         is now a valid return value.
11436
11437         (FieldExprNoAddress): New expression for Fields whose address can
11438         not be taken.
11439
11440         * expression.cs (LocalVariableReference): During the resolve
11441         phases, create new expressions if we are in a remapping context.
11442         Remove code that dealt with remapping here.
11443
11444         (ParameterReference): same.
11445
11446         (ProxyInstance): New expression, like the `This' expression, but
11447         it is born fully resolved.  We know what we are doing, so remove
11448         the errors that are targeted to user-provided uses of `this'.
11449
11450         * statement.cs (Foreach): our variable is now stored as an
11451         Expression;  During resolution, follow the protocol, dont just
11452         assume it will return this.
11453
11454 2003-08-06  Martin Baulig  <martin@ximian.com>
11455
11456         * support.cs (SeekableStreamReader.cs): New public class.
11457
11458         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11459         SeekableStreamReader instead of the normal StreamReader.
11460
11461 2003-08-04  Martin Baulig  <martin@ximian.com>
11462
11463         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11464         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11465         deambiguate casts and delegate invocations.
11466         (parenthesized_expression): Use the new tokens to ensure this is
11467         not a cast of method invocation.
11468
11469         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11470         when reading a `)' and Deambiguate_CloseParens () was previously
11471         called.
11472
11473         * expression.cs (ParenthesizedExpression): New class.  This is
11474         just used for the CS0075 test.
11475         (Binary.DoResolve): Check for CS0075.   
11476
11477 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11478
11479         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11480         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11481         reference comparison.
11482
11483         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11484         examine the ReturnType for equality - this is necessary in the
11485         cases of implicit and explicit operators whose signature also
11486         includes the return type.
11487
11488 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11489
11490         * namespace.cs: Cache the result of the namespace computation,
11491         instead of computing it every time.
11492
11493 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11494
11495         * decl.cs: Use a global arraylist that we reuse over invocations
11496         to avoid excesive memory consumption.  Reduces memory usage on an
11497         mcs compile by one meg (45 average).
11498
11499         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11500         private, work around that.
11501
11502 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11503
11504         * literal.cs (IntLiteral): Define Zero and One static literals. 
11505
11506         * cs-parser.jay (integer_literal): use static literals to reduce
11507         memory usage for the most used literals (0, 1 and -1).  211kb
11508         reduced in memory usage.
11509
11510         Replace all calls to `new ArrayList' with `new
11511         ArrayList(4)' which is a good average number for most allocations,
11512         and also requires only 16 bytes of memory for its buffer by
11513         default. 
11514
11515         This reduced MCS memory usage in seven megabytes for the RSS after
11516         bootstrapping.
11517
11518 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11519
11520         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11521         handle params methods the correct way by forming only one
11522         applicable set with params and normal methods in them. Earlier we
11523         were looking at params methods only if we found no normal methods
11524         which was not the correct thing to do.
11525
11526         (Invocation.BetterFunction): Take separate arguments indicating
11527         when candidate and the best method are params methods in their
11528         expanded form.
11529
11530         This fixes bugs #43367 and #46199.
11531
11532         * attribute.cs: Documentation updates.
11533
11534         (CheckAttribute): Rename to CheckAttributeTarget.
11535         (GetValidPlaces): Rename to GetValidTargets.
11536
11537         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11538         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11539
11540         Fixes bug #44468.
11541
11542 2003-07-28  Martin Baulig  <martin@ximian.com>
11543
11544         * class.cs (TypeContainer.DefineMembers): Use the base type's full
11545         name when looking up the base class of a nested class.  Fixes #46977.
11546
11547 2003-07-26  Martin Baulig  <martin@ximian.com>
11548
11549         * expression.cs (Indexers.Indexer): New nested struct; contains
11550         getter, setter and the indexer's type.
11551         (Indexers.Properties): This is now an ArrayList of
11552         Indexers.Indexer's.
11553         (IndexerAccess.DoResolveLValue): Correctly set the type if the
11554         indexer doesn't have any getters.
11555
11556         * assign.cs (Assign.DoResolve): Also do the implicit conversions
11557         for embedded property and indexer assignments.
11558
11559 2003-07-26  Martin Baulig  <martin@ximian.com>
11560
11561         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11562         preprocessor directive is not the first non-whitespace character
11563         on a line.
11564
11565 2003-07-26  Martin Baulig  <martin@ximian.com>
11566
11567         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11568         namespace parsing, follow the spec more closely.
11569
11570         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11571         NamespaceEntry.Lookup().
11572
11573 2003-07-25  Martin Baulig  <martin@ximian.com>
11574
11575         * MethodCore.cs (OverridesSomething): New public field; it's set
11576         from TypeContainer.DefineMembers if this method overrides
11577         something (which doesn't need to be a method).  Fix #39462.
11578
11579 2003-07-25  Ravi Pratap  <ravi@ximian.com>
11580
11581         * typemanager.cs (GetMembers): Ensure that the list of members is
11582         reversed. This keeps things in sync.
11583
11584         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11585         find an AttributeUsage attribute.
11586
11587         * expression.cs (Invocation.OverloadResolve): Perform the check
11588         which disallows Invoke to be directly called on a Delegate.
11589
11590         (Error_InvokeOnDelegate): Report error cs1533.
11591
11592 2003-07-25  Martin Baulig  <martin@ximian.com>
11593
11594         * expression.cs (Indexers.GetIndexersForType): Only look in the
11595         interface hierarchy if the requested type is already an
11596         interface.  Fixes #46788 while keeping #46502 fixed.
11597
11598 2003-07-25  Martin Baulig  <martin@ximian.com>
11599
11600         * class.cs (TypeContainer.DefineMembers): Check whether all
11601         readonly fields have been assigned and report warning CS0649 if
11602         not.
11603
11604         * statement.cs (LocalInfo.IsFixed): Always return true if this is
11605         a valuetype.
11606
11607 2003-07-24  Ravi Pratap  <ravi@ximian.com>
11608
11609         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11610         returned from GetMethods to make things consistent with the
11611         assumptions MCS makes about ordering of methods.
11612
11613         This should comprehensively fix bug #45127 and it does :-)
11614
11615         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11616         ordering is actually reverse.
11617
11618         * Clean up some debug messages I left lying around.
11619
11620         * interface.cs (Populate*): Get rid of code which emits attributes
11621         since the stage in which we emit attributes is the 'Emit' stage,
11622         not the define stage.
11623
11624         (Emit): Move attribute emission for interface members here.
11625
11626 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11627
11628         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11629         closely: we eliminate methods in base types when we have an
11630         applicable method in a top-level type.
11631
11632         Please see section 14.5.5.1 for an exact description of what goes
11633         on. 
11634
11635         This fixes bug #45127 and a host of other related to corlib compilation.
11636
11637         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11638         array is the method corresponding to the top-level type (this is
11639         because of the changes made to icall.c) so we change this
11640         accordingly.
11641
11642         (MethodGroupExpr.Name): This too.
11643
11644         * typemanager.cs (GetElementType): New method which does the right
11645         thing when compiling corlib. 
11646
11647         * everywhere: Make use of the above in the relevant places.
11648
11649 2003-07-22  Martin Baulig  <martin@ximian.com>
11650
11651         * cs-parser.jay (invocation_expression): Moved
11652         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11653         `cast_expression', but create a InvocationOrCast which later
11654         resolves to either an Invocation or a Cast.
11655
11656         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11657         method; call this before EmitStatement() to make sure that this
11658         expression can be used as a statement.
11659
11660         * expression.cs (InvocationOrCast): New class; resolves to either
11661         an Invocation or a Cast.
11662
11663         * statement.cs (StatementExpression): Call ResolveStatement() on
11664         the ExpressionStatement before emitting it.
11665
11666 2003-07-21  Martin Baulig  <martin@ximian.com>
11667
11668         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11669         `ref' and `out' attributes match; fixes #46220.
11670         (MemberAccess.ResolveMemberAccess): You can't reference a type
11671         through an expression; fixes #33180.
11672         (Indexers.GetIndexersForType): Don't return the indexers from
11673         interfaces the class implements; fixes #46502.
11674
11675 2003-07-21  Martin Baulig  <martin@ximian.com>
11676
11677         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11678         CS0661 checks; fixes bug #30442.
11679
11680 2003-07-21  Martin Baulig  <martin@ximian.com>
11681
11682         * decl.cs (AdditionResult): Added `Error'.
11683
11684         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11685
11686         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11687         makes cs0031.cs actually work.
11688
11689 2003-07-20  Martin Baulig  <martin@ximian.com>
11690
11691         * namespace.cs: Fixed that bug which caused a crash when compiling
11692         the debugger's GUI.
11693
11694 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11695
11696         * typemanager.cs (LookupTypeReflection): Never expose types which
11697         are NotPublic, NestedPrivate, NestedAssembly, or
11698         NestedFamANDAssem.  We used to return these, and later do a check
11699         that would report a meaningful error, but the problem is that we
11700         would not get the real match, if there was a name override.
11701
11702 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11703
11704         * namespace.cs (Namespace, Name): Do not compute the namespace
11705         name dynamically, compute it in the constructor.  This reduced
11706         memory usage by 1697 KB.
11707
11708         * driver.cs: Use --pause to pause at the end.
11709
11710 2003-07-17  Peter Williams  <peter@newton.cx>
11711
11712         * Makefile: Change the name of the test target so that it doesn't
11713         conflict with the recursive test target.
11714
11715 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11716
11717         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11718         AddressOf): Do not use EmitThis, that was wrong, use the actual
11719         this pointer.
11720
11721 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11722
11723         * class.cs (MethodData.Define): While checking if a method is an
11724         interface implementation, improve the test: If we are not public
11725         (use new test here: use the computed MethodAttributes directly,
11726         instead of the parsed modifier flags) check if the `implementing'
11727         method comes from an interface or not.
11728
11729         * pending.cs (VerifyPendingMethods): Slightly better error
11730         message.
11731
11732         * makefile: add test target that does the mcs bootstrap.
11733
11734 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11735
11736         * interface.cs (Define): Do nothing here since there are no
11737         members to populate etc. Move the attribute emission out of here
11738         since this was just totally the wrong place to put it. Attribute
11739         application happens during the 'Emit' phase, not in the 'Define'
11740         phase.
11741
11742         (Emit): Add this method and move the attribute emission here
11743
11744         * rootcontext.cs (EmitCode): Call the Emit method on interface
11745         types too.
11746
11747 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11748
11749         * expression.cs (OverloadResolve): Report error only if Location
11750         is not 'Null' which means that there was a probe going on.
11751
11752 2003-07-14  Martin Baulig  <martin@ximian.com>
11753
11754         * expression.cs (ConditionalLogicalOperator): New public class to
11755         implement user defined conditional logical operators.
11756         This is section 14.11.2 in the spec and bug #40505.
11757
11758 2003-07-14  Martin Baulig  <martin@ximian.com>
11759
11760         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11761
11762 2003-07-14  Martin Baulig  <martin@ximian.com>
11763
11764         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11765
11766         * ecore.cs (IVariable.VerifyFixed): New interface method.
11767
11768         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11769         operator, check whether the variable is actually fixed.  Fixes bug
11770         #36055.  Set a variable definitely assigned when taking its
11771         address as required by the spec.
11772
11773         * statement.cs (LocalInfo.IsFixed): New field.
11774         (LocalInfo.MakePinned): Set `IsFixed' to true.
11775
11776 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11777
11778         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11779         for .ctors, ensure that we only ask for members declared in the
11780         attribute type (BindingFlags.DeclaredOnly).
11781
11782         Fixes bug #43632.
11783
11784         * expression.cs (Error_WrongNumArguments): Report error 1501
11785         correctly the way CSC does.
11786
11787 2003-07-13  Martin Baulig  <martin@ximian.com>
11788
11789         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11790         lookup on the fully qualified name, to make things like "X.X" work
11791         where "X.X" is a fully qualified type name, but we also have a
11792         namespace "X" in the using list.  Fixes #41975.
11793
11794 2003-07-13  Martin Baulig  <martin@ximian.com>
11795
11796         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11797         function. If we're a CompoundAssign, we need to create an embedded
11798         CompoundAssign, not an embedded Assign.
11799         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11800         Fixes #45854.
11801
11802 2003-07-13  Martin Baulig  <martin@ximian.com>
11803
11804         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11805         work to fix bug #46088.
11806
11807 2003-07-13  Ravi Pratap <ravi@ximian.com>
11808
11809         * class.cs (Operator.Emit): Do not emit attributes here - it is
11810         taken care of by the Method class that we delegate too. This takes
11811         care of bug #45876.
11812
11813 2003-07-10  Martin Baulig  <martin@ximian.com>
11814
11815         * expression.cs (TypeOfVoid): New class.
11816         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11817
11818 2003-07-10  Martin Baulig  <martin@ximian.com>
11819
11820         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11821         bug #35957.
11822
11823 2003-07-10  Martin Baulig  <martin@ximian.com>
11824
11825         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11826         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11827
11828         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11829
11830         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11831
11832 2003-07-10  Martin Baulig  <martin@ximian.com>
11833
11834         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11835         of decimal.  Fixes #42850.
11836
11837         NOTE: I also fixed the created byte blob, but this doesn't work on
11838         the MS runtime and csc never produces any byte blobs for decimal
11839         arrays.
11840
11841 2003-07-10  Martin Baulig  <martin@ximian.com>
11842
11843         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11844         structs; fixes #32068.
11845         (Block.AddChildVariableNames): Fixed #44302.
11846
11847 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11848
11849         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11850
11851 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11852
11853         * attribute.cs: And this test is onger needed.
11854
11855 2003-07-08  Martin Baulig  <martin@ximian.com>
11856
11857         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11858         inaccessible types.  Fixes #36313.
11859
11860         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11861
11862         * namespace.cs (NamespaceEntry): Create implicit entries for all
11863         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11864         implicit entries for N1.N2 and N1.
11865
11866 2003-07-08  Martin Baulig  <martin@ximian.com>
11867
11868         Rewrote the handling of namespaces to fix a lot of the issues
11869         wrt. `using' aliases etc.
11870
11871         * namespace.cs (Namespace): Splitted this class into a
11872         per-assembly `Namespace' and a per-file `NamespaceEntry'.
11873
11874         * typemanager.cs (TypeManager.IsNamespace): Removed.
11875         (TypeManager.ComputeNamespaces): Only compute namespaces from
11876         loaded assemblies here, not the namespaces from the assembly we're
11877         currently compiling.
11878
11879 2003-07-08  Martin Baulig  <martin@ximian.com>
11880
11881         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11882
11883 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11884
11885         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11886         already fixed it.  
11887
11888         I thought about the memory savings here, but LookupTypeReflection
11889         is used under already very constrained scenarios.  Compiling
11890         corlib or mcs only exposes one hit, so it would not really reduce
11891         any memory consumption.
11892
11893 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11894
11895         * typemanager.cs: fixes bug #45889 by only adding public types from
11896         other assemblies to the list of known types.
11897
11898 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11899
11900         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11901         on the type we resolved.
11902
11903 2003-07-05  Martin Baulig  <martin@ximian.com>
11904
11905         * pending.cs (PendingImplementation.ParentImplements): Don't
11906         create the proxy if the parent is abstract.
11907
11908         * class.cs (TypeContainer.DefineIndexers): Process explicit
11909         interface implementations first.  Fixes #37714.
11910
11911 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
11912
11913         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11914         defined recursively;  but since we modify the input parameters
11915         (left is set to `this' temporarily), we reset this value if the
11916         left_is_explicit is false, which gives the original semantics to
11917         the code.  
11918
11919         * literal.cs (NullPointer): new class used to represent a null
11920         literal in a pointer context.
11921
11922         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11923         type is a pointer, use a NullPointer object instead of a
11924         NullLiteral.   Closes 43687
11925
11926         (ExplicitConversion): Convert pointer values using
11927         the conv opcode to the proper type.
11928
11929         * ecore.cs (New): change ValueTypeVariable property into a method,
11930         that returns whether the valuetype is suitable for being used.
11931
11932         * expression.cs (Binary.DoNumericPromotions): Only return if we
11933         the int constant was a valid uint, and we can return both left and
11934         right as uints.  If not, we continue processing, to trigger the
11935         type conversion.  This fixes 39018.
11936
11937         * statement.cs (Block.EmitMeta): During constant resolution, set
11938         the CurrentBlock property on the emitcontext, so that we resolve
11939         constants propertly.
11940
11941 2003-07-02  Martin Baulig  <martin@ximian.com>
11942
11943         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11944         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11945
11946         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11947         than emitting it here.
11948
11949         * statement.cs: Fixed some more flow analysis bugs.
11950
11951 2003-07-02  Martin Baulig  <martin@ximian.com>
11952
11953         * class.cs (MethodData.Define): When implementing interface
11954         methods, set Final unless we're Virtual.
11955
11956         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11957         check work for interface methods.
11958
11959 2003-07-01  Martin Baulig  <martin@ximian.com>
11960
11961         * ecore.cs (EmitContext.This): Replaced this property with a
11962         GetThis() method which takes a Location argument.  This ensures
11963         that we get the correct error location for a CS0188.
11964
11965 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
11966
11967         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11968         ImplicitStandardConversion.
11969
11970         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11971
11972 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
11973
11974         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11975         optimization.
11976
11977 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
11978
11979         * class.cs (Constructor.Define): Turn off initlocals for unsafe
11980         constructors.
11981
11982         (MethodData.Define): Turn off initlocals for unsafe methods.
11983
11984 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
11985
11986         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11987         complete;  Fixes #37521.
11988
11989         * delegate.cs: Use Modifiers.TypeAttr to compute the
11990         TypeAttributes, instead of rolling our own.  This makes the flags
11991         correct for the delegates.
11992
11993 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
11994
11995         * class.cs (Constructor.Define): Set the private flag for static
11996         constructors as well.
11997
11998         * cs-parser.jay (statement_expression): Set the return value to
11999         null, to avoid a crash when we catch an error.
12000
12001 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12002
12003         * cs-parser.jay: Applied patch from Jackson that adds support for
12004         extern and unsafe modifiers to destructor declarations.
12005
12006         * expression.cs: Report error 21 if the user is trying to index a
12007         System.Array.
12008
12009         * driver.cs: Add an error message, suggested by the bug report.
12010
12011         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12012         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12013
12014 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12015
12016         * namespace.cs: Add some information to reduce FAQs.
12017
12018 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12019
12020         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12021         underlying enumeration types.  Fixes #43915.
12022
12023         * expression.cs: Treat ushort/short as legal values to be used in
12024         bitwise operations.
12025
12026 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12027
12028         * delegate.cs: transfer custom attributes for paramenters from
12029         the delegate declaration to Invoke and BeginInvoke.
12030
12031 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12032
12033         * attribute.cs: handle custom marshalers and emit marshal info
12034         for fields, too.
12035
12036 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12037
12038         * makefile.gnu: Added anonymous.cs to the compiler sources.
12039
12040 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12041
12042         * iterators.cs: Change the name of the proxy class to include two
12043         underscores.
12044
12045         * cs-parser.jay: Update grammar to include anonymous methods.
12046
12047         * anonymous.cs: new file.
12048
12049 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12050
12051         * class.cs (Field.Define): Add missing test for pointers and
12052         safety. 
12053
12054 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12055
12056         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12057         we use the stobj opcode.
12058
12059         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12060         since it wasn't the correct fix. 
12061
12062         It still is puzzling that we are required to use stobj for IntPtr
12063         which seems to be a ValueType.
12064
12065 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12066
12067         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12068         during regular simple name resolution.   Now, the trick is that
12069         instead of returning for processing the simplename, we do a
12070         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12071         contextual lookup type).   If a match is found, return that, if
12072         not, return for further composition.
12073
12074         This fixes long-standing 30485.
12075
12076         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12077         using the address to initialize an object, do an Stobj instead of
12078         using the regular Stelem.
12079
12080         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12081         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12082         Because if we are a BaseIndexerAccess that value will be true.
12083         Fixes 43643.
12084
12085         * statement.cs (GotoCase.Resolve): Return after reporting an
12086         error, do not attempt to continue. 
12087
12088         * expression.cs (PointerArithmetic.Emit): If our operand is a
12089         long, convert our constants to match the operand before
12090         multiplying.  Convert to I type before adding.   Fixes 43670.
12091
12092 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12093
12094         * enum.cs (ImplicitConversionExists) : Rename to
12095         ImplicitEnumConversionExists to remove ambiguity. 
12096
12097         * ecore.cs (NullCast): New type of cast expression class which
12098         basically is very similar to EmptyCast with the difference being
12099         it still is a constant since it is used only to cast a null to
12100         something else
12101         (eg. (string) null)
12102
12103         * convert.cs (ImplicitReferenceConversion): When casting a null
12104         literal, we return a NullCast.
12105
12106         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12107         should be around anymore.
12108
12109         The renaming (reported was slightly wrong). Corrections:
12110
12111         ConvertImplicitStandard -> ImplicitConversionStandard
12112         ConvertExplicitStandard -> ExplicitConversionStandard
12113
12114         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12115         before passing them in !
12116
12117         * convert.cs (ImplicitConversionStandard): When comparing for
12118         equal expr and target types, ensure that expr is not a
12119         NullLiteral.
12120
12121         In general, we must not be checking (expr_type ==
12122         target_type) in the top level conversion methods
12123         (ImplicitConversion, ExplicitConversion etc). This checking is
12124         done in the methods that they delegate to.
12125
12126 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12127
12128         * convert.cs: Move Error_CannotConvertType,
12129         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12130         ImplicitNumericConversion, ImplicitConversionExists,
12131         ImplicitUserConversionExists, StandardConversionExists,
12132         FindMostEncompassedType, FindMostSpecificSource,
12133         FindMostSpecificTarget, ImplicitUserConversion,
12134         ExplicitUserConversion, GetConversionOperators,
12135         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12136         TryImplicitIntConversion, Error_CannotConvertImplicit,
12137         ConvertImplicitRequired, ConvertNumericExplicit,
12138         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12139         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12140         its own file.
12141
12142         Perform the following renames:
12143
12144         StandardConversionExists -> ImplicitStandardConversionExists
12145         ConvertImplicit -> ImplicitConversion
12146         ConvertImplicitStandard -> ImplicitStandardConversion
12147         TryImplicitIntConversion -> ImplicitIntConversion
12148         ConvertImplicitRequired -> ImplicitConversionRequired
12149         ConvertNumericExplicit -> ExplicitNumericConversion
12150         ConvertReferenceExplicit -> ExplicitReferenceConversion
12151         ConvertExplicit -> ExplicitConversion
12152         ConvertExplicitStandard -> ExplicitStandardConversion
12153
12154 2003-05-19  Martin Baulig  <martin@ximian.com>
12155
12156         * statement.cs (TypeInfo.StructInfo): Made this type protected.
12157         (TypeInfo): Added support for structs having structs as fields.
12158
12159         * ecore.cs (FieldExpr): Implement IVariable.
12160         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12161         VariableInfo for the field.
12162
12163 2003-05-18  Martin Baulig  <martin@ximian.com>
12164
12165         * expression.cs (This.DoResolve): Report a CS0027 if we're
12166         emitting a field initializer.
12167
12168 2003-05-18  Martin Baulig  <martin@ximian.com>
12169
12170         * expression.cs (This.ResolveBase): New public function.
12171         (This.DoResolve): Check for CS0188.
12172
12173         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12174         This.Resolve().
12175
12176         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12177         `instance_expression' to null if we don't have any non-static
12178         methods.
12179
12180 2003-05-18  Martin Baulig  <martin@ximian.com>
12181
12182         Reworked the way how local variables and parameters are handled by
12183         the flow analysis code.
12184
12185         * statement.cs (TypeInfo, VariableMap): New public classes.
12186         (VariableInfo): New public class.  This is now responsible for
12187         checking whether a variable has been assigned.  It is used for
12188         parameters and local variables.
12189         (Block.EmitMeta): Take the InternalParameters as argument; compute
12190         the layout of the flow vectors here.
12191         (Block.LocalMap, Block.ParameterMap): New public properties.
12192         (FlowBranching): The .ctor doesn't get the InternalParameters
12193         anymore since Block.EmitMeta() now computes the layout of the flow
12194         vector.
12195         (MyStructInfo): This class is now known as `StructInfo' and nested
12196         in `TypeInfo'; we don't access this directly anymore.
12197
12198         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12199         property and removed IsAssigned(), IsFieldAssigned(),
12200         SetAssigned() and SetFieldAssigned(); we now call them on the
12201         VariableInfo so we don't need to duplicate this code everywhere.
12202
12203         * expression.cs (ParameterReference): Added `Block block' argument
12204         to the .ctor.
12205         (LocalVariableReference, ParameterReference, This): The new
12206         VariableInfo class is now responsible for all the definite
12207         assignment stuff.
12208
12209         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12210         IsParameterAssigned, SetParameterAssigned): Removed.
12211
12212 2003-05-18  Martin Baulig  <martin@ximian.com>
12213
12214         * typemanager.cs (InitCoreTypes): Try calling
12215         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12216         the 3-args-version.  Corlib now also needs our `void_type'.
12217         (GetMethod): Added overloaded version which takes an optional
12218         `bool report_errors' to allow lookups of optional methods.
12219
12220 2003-05-12  Martin Baulig  <martin@ximian.com>
12221
12222         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12223         only used for locals and not for parameters.
12224
12225 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12226
12227         * support.cs (InternalParameters.ParameterType): Return the
12228         ExternalType of the parameter.
12229
12230         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12231         they were unused.
12232
12233 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12234
12235         * class.cs (MethodData.Define): Do not set the `newslot' on
12236         interface members, if they are also flagged as "override".
12237
12238         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12239         better code for ++i and i++.  This only works for static fields
12240         and local variables.
12241
12242         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12243         want to pull the DeclSpace out of the builder_to_declspace instead
12244         of the TypeBuilder (like in TypeContainer.FindMembers).
12245
12246         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12247         instead of LookupTypeContainer.  Fixes the crash on .NET for
12248         looking up interface members.
12249
12250         * const.cs: Create our own emit context during the Definition
12251         stage, so that constants are evaluated in the proper context, when
12252         a recursive definition happens.
12253
12254 2003-05-11  Martin Baulig  <martin@ximian.com>
12255
12256         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12257         new block for a switch section.
12258         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12259         the adding/lookup in the switch block.  Fixes #39828.
12260
12261 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12262
12263         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12264         functionality: I needed to convert the data after I had performed
12265         the add/sub operation into the operands type size.
12266
12267         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12268         pass the type for the box operation, otherwise the resulting
12269         object would have been of type object.
12270
12271         (BoxedCast): Add constructor to specify the type to box as.
12272
12273 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12274
12275         * iterators.cs: I was reusing the `count' variable inadvertently,
12276         take steps to not allow this to happen.
12277
12278 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12279
12280         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12281         by creating an array at the point where the params starts and
12282         putting all those arguments there, then adjusting the size of the
12283         array.
12284
12285 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12286
12287         * expression.cs (New.AddressOf): Implement interface
12288         IMemoryLocation.  This is used when the `new' operator is used in
12289         the context of an invocation to a method on a value type.
12290
12291         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12292         example. 
12293
12294         * namespace.cs: Also check the using aliases here.
12295
12296         * driver.cs: Move the test for using validity after the types have
12297         been entered, so we do a single pass that also includes the using
12298         aliases. 
12299
12300         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12301         in the regular case.   CreateSiblingForFinally is doing extra
12302         error checking.
12303
12304         * attribute.cs (GetAttributeArgumentExpression): Store the result
12305         on an out value, and use the return value to indicate failure
12306         instead of using null (which is a valid return for Constant.GetValue).
12307
12308         * statement.cs: Perform the analysis flow for the increment
12309         portion after the statement, because this will be the real flow of
12310         execution.  Fixes #42385
12311
12312         * codegen.cs (EmitContext.EmitArgument,
12313         EmitContext.EmitStoreArgument): New helper functions when the
12314         RemapToProxy flag is set.
12315
12316         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12317         function.
12318
12319         Add support for remapping parameters. 
12320
12321         * iterators.cs: Propagate parameter values;  Store parameter
12322         values in the proxy classes.
12323
12324 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12325
12326         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12327         need a proxy reference;  I do not know what I was thinking
12328
12329         * cs-parser.jay (constructor_initializer): catch another error,
12330         and display nice message.
12331
12332         (field_declaration): catch void field declaration
12333         to flag a better error. 
12334
12335         * class.cs (MemberBase.CheckBase): Report an error instead of a
12336         warning if a new protected member is declared in a struct. 
12337         (Field.Define): catch the error of readonly/volatile.
12338
12339         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12340
12341         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12342         volatile variable is taken
12343
12344 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12345
12346         * statement.cs (Fixed.Resolve): Report an error if we are not in
12347         an unsafe context.
12348
12349 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12350
12351         * typemanager.cs: reuse the code that handles type clashes for
12352         delegates and enumerations.
12353
12354         * class.cs (Report28): Always report.
12355
12356         * expression.cs (EncodeAsAttribute): Allow nulls here.
12357
12358 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12359
12360         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12361         the functionality for testing whether an expression is valid for
12362         an attribute here.  Also handle the case of arrays of elements
12363         being stored. 
12364
12365         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12366         encoding a linear array into an array of objects that are suitable
12367         to be passed to an CustomAttributeBuilder.
12368
12369         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12370
12371         * ecore.cs: (FieldExpr): Handle field remapping here.
12372
12373         * iteratators.cs: Pass the instance variable (if the method is an
12374         instance method) to the constructors, so we can access the field
12375         variables on the class.
12376
12377         TODO: Test this with structs.  I think the THIS variable on
12378         structs might have to be a pointer, and not a refenrece
12379
12380 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12381
12382         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12383         local variables to fields in a proxy class.
12384
12385         * iterators.cs (PopulateProxy): Rename our internal fields to
12386         <XXX>.  
12387         Create a <THIS> field if we are an instance method, so we can
12388         reference our parent container variables.
12389         (MapVariable): Called back from the EmitContext code to enter a
12390         new variable to field mapping into the proxy class (we just create
12391         a FieldBuilder).
12392
12393         * expression.cs
12394         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12395         for using the remapped locals to fields.
12396
12397         I placed the code here, because that gives the same semantics to
12398         local variables, and only changes the Emit code.
12399
12400         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12401         statements inside iterators.
12402         (VariableInfo): Add a FieldBuilder for the cases when we are
12403         remapping local variables to fields in a proxy class
12404
12405         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12406         current_block != null.
12407
12408         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12409         not cope with strings, as it has been moved to the
12410         TableSwitchEmit.  Fixed bug in switch generation.
12411
12412         * expression.cs (New.DoResolve): Provide more context for the user
12413         when reporting an error.
12414
12415         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12416         pointers. 
12417
12418         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12419         check the permissions for it.  Note than in a type-resolution
12420         context the check was already present in DeclSpace.ResolveType,
12421         but was missing from the MemberAccess.
12422
12423         (ArrayCreation.CheckIndices): warn if the user has
12424         more nested levels of expressions, but there are no more
12425         dimensions specified.  Avoids crash on bug 41906.
12426
12427 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12428
12429         * statement.cs (Block): replace Implicit bool, for a generic
12430         flags.   
12431         New flag: `Unchecked'.  This is used during the EmitMeta phase
12432         (which is out-of-line with the regular Resolve/Emit process for a
12433         statement, as this is done ahead of time, but still gets a chance
12434         to call constant resolve).
12435
12436         (Block.Flags): new enum for adding a new flag.
12437
12438         (Block.EmitMeta): track the state of unchecked.
12439
12440         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12441         to enable constant resolution to work there as well.
12442
12443 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12444
12445         * typemanager.cs (ienumerable_type): Also look up
12446         System.Collections.IEnumerable. 
12447
12448 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12449
12450         TODO: Test more than one conditional per method.
12451
12452         * class.cs (Indexer.Define): Report the location where the user is
12453         referencing the unsupported feature.
12454
12455         (MethodData): Overload the use of `conditionals' to
12456         minimize the creation of needless ArrayLists.   This saves roughly
12457         212kb on my machine.
12458
12459         (Method): Implement the new IIteratorContainer interface.
12460         (Method.SetYields): Implement the method by setting the ModFlags
12461         to contain METHOD_YIELDS.
12462
12463         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12464         which just got set to null.
12465
12466         * iterators.cs: New file.
12467
12468         (Yield, YieldBreak): New statements.
12469
12470         * statement.cs (Return.Resolve): Flag an error if we are used in
12471         an iterator method.
12472
12473         * codegen.cs (InIterator): New flag set if the code is being
12474         compiled in an iterator method.
12475
12476         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12477         internal modifier, and we just use it to avoid adding extra
12478         fields, as this is seldom used.  
12479
12480         * cs-parser.jay: Add yield_statement (yield and yield break).
12481
12482         * driver.cs: New flag -v2 to turn on version 2 features. 
12483
12484         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12485         hashtable when v2 is enabled.
12486
12487 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12488
12489         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12490         there is already a namespace defined with this name.
12491
12492         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12493         people upgraded their corlibs.
12494
12495         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12496         always use fully qualified types, no need to use the compiler
12497         front end.
12498
12499         (TypeManager.IsNamespace): Use binarysearch.
12500
12501         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12502         AddDelegate): I did not quite use the new IsValid API properly: I
12503         have to pass the short-name and the fullname.  I was passing only
12504         the basename instead of the fullname sometimes. 
12505
12506         (TypeContainer.DefineType): call NamespaceClash.
12507
12508         * interface.cs (Interface.DefineType): use NamespaceClash before
12509         defining the type.
12510
12511         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12512         defining the type.
12513
12514         * enum.cs: (Enum.DefineType): use NamespaceClash before
12515         defining the type.
12516
12517         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12518         speed increase.  First, use the negative_hits cache when we get a
12519         negative.  Second, add the type with its full original name
12520         instead of the new . and + encoded name (reflection uses + to
12521         separate type from a nested type).  Use LookupTypeReflection
12522         directly which bypasses the type->name hashtable (that we already
12523         know does not contain the type.
12524
12525         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12526         location/container type. 
12527
12528         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12529
12530 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12531
12532         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12533
12534         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12535         method is being referenced in the method group from a static
12536         context, and report error 120 if so.
12537
12538         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12539         Error118. 
12540
12541         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12542         is created, we create the A namespace).
12543
12544         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12545         Fixes #41591
12546
12547 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12548
12549         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12550         invocation to ModuleBuilder.GetType with the same values will
12551         return a new type instance, so we need to cache its return
12552         values. 
12553
12554         * expression.cs (Binary.ResolveOperator): Only allow the compare
12555         operators on enums if they are of the same type.
12556
12557         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12558         types of ValueType on their own case.  Before we were giving them
12559         the same treatment as objects.
12560
12561         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12562         fullname.  Short name is used to compare against container name.
12563         Fullname is used to check against defined namespace names.
12564
12565         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12566         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12567
12568         (Method.CheckBase): Call parent.
12569         (MemberBase.CheckBase): Check for protected members on sealed
12570         classes.
12571         (PropertyBase.CheckBase): Call parent.
12572         (Field.Define): Call parent.
12573
12574         * report.cs: Negative error codes are now mapped to 8000 - code,
12575         so that the display is render more nicely.
12576
12577         * typemanager.cs: Do not use try/catch, instead report a regular
12578         error. 
12579
12580         (GetPointerType, GetReferenceType): These methods provide
12581         mechanisms to obtain the T* and T& from a T.  We had the code
12582         previously scattered around the code base, and it also used
12583         TypeManager.LookupType that would go through plenty of caches.
12584         This one goes directly to the type source.
12585
12586         In some places we did the Type.GetType followed by
12587         ModuleBuilder.GetType, but not in others, so this unifies the
12588         processing as well.
12589
12590         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12591         statements now that we have namespace information.
12592
12593         * typemanager.cs (IsNamespace): New method, returns whether the
12594         string presented is a namespace or not.
12595
12596         (ComputeNamespaces): New public entry point, computes the list of
12597         available namespaces, using the GetNamespaces API call in Mono, or
12598         the slower version in MS.NET.   
12599
12600         Now before we start the semantic analysis phase, we have a
12601         complete list of namespaces including everything that the user has
12602         provided.
12603
12604         Deleted old code to cache namespaces in .nsc files.
12605
12606 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12607
12608         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12609         class/struct location definition Location for the implicit
12610         constructor location.
12611
12612         (Operator.Define): Use the location of the operator for the
12613         implicit Method definition.
12614
12615         (Constructor.Emit): use the constructor location for the implicit
12616         base initializer constructor.
12617
12618         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12619         and the Expression class now contains two new methods:
12620
12621         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12622         isolate type lookup from the rest of the resolution process.
12623
12624         Since we use Expressions to hold type definitions due to the way
12625         we parse the input we have historically overloaded Resolve to
12626         perform the Type lookups if a special flag is passed.  Now this is
12627         eliminated and two methods take their place. 
12628
12629         The differences in the two methods between xStep and xTerminal is
12630         that xStep is involved in our current lookup system that uses
12631         SimpleNames to compose a name, while xTerminal is used just to
12632         catch the case where the simplename lookup failed.
12633
12634 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12635
12636         * expression.cs (ResolveMemberAccess): Remove redundant code.
12637         TypeExpr expressions are always born fully resolved.
12638
12639         * interface.cs (PopulateMethod): Do not lookup the types twice.
12640         We were doing it once during SemanticAnalysis and once during
12641         PopulateMethod.
12642
12643         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12644         in local variable type definitions, were being returned as a
12645         SimpleName (we decomposed everything into a string), that is
12646         because primary_expression was being used instead of a type in the
12647         grammar (reduce/reduce conflicts).
12648
12649         The part that was wrong is that we converted the expression into a
12650         string (an oversimplification in one hand, compounded with primary
12651         expressions doing string concatenation).
12652
12653         So things like:
12654
12655         A.B.C [] x;
12656
12657         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12658         using clauses from working on this particular context.  And a type
12659         was being matched directly against "A.B.C[]".
12660
12661         We now use the correct approach, and allow for ComposedCast to be
12662         part of the unary expression.  So the "A.B.C []" become a composed
12663         cast of "A.B.C" (as a nested group of MemberAccess with a
12664         SimpleName at the end) plus the rank composition "[]". 
12665
12666         Also fixes 35567
12667
12668 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12669
12670         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12671         for the access level checking.
12672
12673         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12674         `TypeContainer container', because I kept getting confused when I
12675         was debugging this code.
12676
12677         * expression.cs (Indexers): Instead of tracking getters/setters,
12678         we now track them in parallel.  We create one arraylist less, but
12679         most importantly it is possible now for the LValue code to find a
12680         matching get for a set.
12681
12682         (IndexerAccess.DoResolveLValue): Update the code.
12683         GetIndexersForType has been modified already to extract all the
12684         indexers from a type.  The code assumed it did not.
12685
12686         Also make the code set the correct return type for the indexer.
12687         This was fixed a long time ago for properties, but was missing for
12688         indexers.  It used to be void_type.
12689
12690         (Binary.Emit): Test first for doubles instead of
12691         floats, as they are more common.
12692
12693         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12694         when dealing with floats and the <=, >= operators.  This fixes bug
12695         #39314 
12696
12697         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12698         to load the array value by emitting a load on the foreach variable
12699         type.  This was incorrect.  
12700
12701         We now emit the code to load an element using the the array
12702         variable type, and then we emit the conversion operator.
12703
12704         Fixed #40176
12705
12706 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12707
12708         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12709
12710 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12711
12712         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12713         test for protection before we test for signatures. 
12714
12715         (MethodSignature.ToString): implement.
12716
12717         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12718         to the case where we reduced into a LongConstant.
12719
12720         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12721         depend on whether the information is acurrate, because the
12722         Microsoft runtime will always claim that the array type is public,
12723         regardless of the real state.
12724
12725         If the type is a pointer, another problem happens: the type is
12726         reported as non-public in Microsoft.  
12727
12728         In both cases we have to call CheckAccessLevel recursively with
12729         the underlying type as the argument to be tested.
12730
12731 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12732
12733         * assign.cs (Assign.Emit): If we are dealing with a compound
12734         assignment expression, we should use the code path that stores the
12735         intermediate result in a temporary value.  This fixes #40903.
12736
12737         *expression.cs (Indirection.ToString): Provide ToString method for
12738         debugging. 
12739
12740 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12741
12742         * class.cs: Null out fields holding references to Block objects so
12743         they can be garbage collected.
12744
12745         * expression.cs (OverloadResolve): Remove unused local.
12746
12747 2003-04-07  Martin Baulig  <martin@ximian.com>
12748
12749         * codegen.cs (EmitContext.CurrentFile): New public field.
12750         (EmitContext.Mark): Use the CurrentFile to check whether the
12751         location is in the correct file.
12752         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12753
12754 2003-04-07  Martin Baulig  <martin@ximian.com>
12755
12756         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12757
12758         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12759         location.  [FIXME: The location argument which gets passed to this
12760         method is sometimes wrong!]
12761
12762 2003-04-07  Nick Drochak <ndrochak@gol.com>
12763
12764         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12765
12766 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12767
12768         * expression.cs (Indirection.EmitAssign): We were using the
12769         temporary, but returning immediately instead of continuing the
12770         EmitAssing flow.
12771
12772 2003-04-06  Martin Baulig  <martin@ximian.com>
12773
12774         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12775         if it's a nested child, but also deriving from the outer class.
12776         See test 190.cs.
12777
12778         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12779         nested child, but also deriving from the outer class.  See
12780         test-190.cs.
12781         (FilterWithClosure): We may access private members of the outer
12782         class if we're a nested child and deriving from the outer class.
12783         (RealMemberLookup): Only set `closure_private_ok' if the
12784         `original_bf' contained BindingFlags.NonPublic.
12785
12786 2003-04-05  Martin Baulig  <martin@ximian.com>
12787
12788         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12789
12790 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12791
12792         * class.cs (Event.Define): Do not allow abstract events to have
12793         initializers. 
12794
12795 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12796
12797         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12798         block in event declarations.
12799
12800         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12801         value type, get its address.
12802
12803         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12804         leaving a class on the stack instead of a boolean value (int
12805         0/1).  Change the code so we compare against null, and then the
12806         result against zero.
12807
12808         * class.cs (TypeContainer.GetClassBases): We were checking for the
12809         parent class being sealed too late.
12810
12811         * expression.cs (Binary.Emit): For <= and >= when dealing with
12812         floating point values, use cgt.un and clt.un instead of cgt and
12813         clt alone.
12814
12815 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12816
12817         * statement.cs: Apply the same optimization as MS: skip the 
12818         GetEnumerator returning an IEnumerator, and use the one returning a 
12819         CharEnumerator instead. This allows us to avoid the try-finally block 
12820         and the boxing.
12821
12822 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12823
12824         * cs-parser.jay: Attributes cannot be applied to
12825                          namespaces. Fixes #40473
12826
12827 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12828
12829         * class.cs:
12830         (Add*): check if the name is valid using the full name for constants,
12831         fields, properties and events.
12832
12833 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12834
12835         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12836         char constants to be part of the enumeration.
12837
12838         * expression.cs (Conditional.DoResolve): Add support for operator
12839         true. Implements the missing functionality from 14.12
12840
12841         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12842         operator true/false as required by the spec.
12843
12844         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12845         implicit conversion to boolean.
12846
12847         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12848         also one where the type implements `operator true'. 
12849
12850         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12851         get an expression that will invoke operator true based on an
12852         expression.  
12853
12854         (GetConversionOperators): Removed the hack that called op_True
12855         here.  
12856
12857         (Expression.ResolveBoolean): Move this from Statement.
12858
12859 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12860
12861         * ecore.cs (FieldExpr): do not allow initialization of initonly
12862         fields on derived classes
12863
12864 2003-03-13  Martin Baulig  <martin@ximian.com>
12865
12866         * statement.cs (Block.Emit): Call ig.BeginScope() and
12867         ig.EndScope() when compiling with debugging info; call
12868         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12869
12870 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
12871
12872         * expression.cs (Indexers): Do not construct immediately, allow
12873         for new members to be appended as we go.  Fixes 38143
12874
12875 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12876
12877         * expression.cs: save/restore context when resolving an unchecked
12878         expression.
12879
12880 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
12881
12882         * cfold.cs: Catch division by zero in modulus operator during
12883         constant folding.
12884
12885 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
12886
12887         * interface.cs (Interface.DefineMembers): Avoid defining members
12888         twice. 
12889
12890 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
12891
12892         * driver.cs: handle the +/- options for -noconfig
12893
12894         * statement.cs (Unckeched.Resolve): Also track the state of
12895         unchecked in the Resolve phase.
12896
12897 2003-02-27  Martin Baulig  <martin@ximian.com>
12898
12899         * ecore.cs (Expression.MemberLookup): Don't create a
12900         MethodGroupExpr for something which is not a method.  Fixes #38291.
12901
12902 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
12903
12904         * class.cs (MemberBase.CheckParameters): Also check that the type
12905         is unmanaged if it is a pointer.
12906
12907         * expression.cs (SizeOf.Resolve): Add location information.
12908
12909         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12910         a managed type is declared.
12911
12912         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12913         parameter modifiers as well.  Fixes bug 38606
12914
12915         * class.cs: Very sad.  Am backing out the speed up changes
12916         introduced by the ArrayList -> Array in the TypeContainer, as they
12917         were not actually that much faster, and introduced a bug (no error
12918         reports on duplicated methods).
12919
12920         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12921         source first, this will guarantee that we have a valid expression
12922         before calling in lower levels functions that will require a
12923         resolved object.  Then use this original_source in the
12924         target.ResolveLValue instead of the original source that was
12925         passed to us.
12926
12927         Another change.  Use target.Resolve instead of LValueResolve.
12928         Although we are resolving for LValues, we will let the Assign code
12929         take care of that (it will be called again from Resolve).  This
12930         basically allows code like this:
12931
12932         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12933         class Y { void A (X x) { x [0] += o; }
12934
12935         The problem was that the indexer was trying to resolve for
12936         set_Item (idx, object o) and never finding one.  The real set_Item
12937         was set_Item (idx, X).  By delaying the process we get the right
12938         semantics. 
12939
12940         Fixes bug 36505
12941
12942 2003-02-23  Martin Baulig  <martin@ximian.com>
12943
12944         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12945         while calling DoEmit ().
12946
12947         * codegen.cs (EmitContext.Mark): Don't mark locations in other
12948         source files; if you use the #line directive inside a method, the
12949         compiler stops emitting line numbers for the debugger until it
12950         reaches the end of the method or another #line directive which
12951         restores the original file.
12952
12953 2003-02-23  Martin Baulig  <martin@ximian.com>
12954
12955         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12956
12957 2003-02-23  Martin Baulig  <martin@ximian.com>
12958
12959         * statement.cs (Block.AddChildVariableNames): We need to call this
12960         recursively, not just for our immediate children.
12961
12962 2003-02-23  Martin Baulig  <martin@ximian.com>
12963
12964         * class.cs (Event.Define): Always make the field private, like csc does.
12965
12966         * typemanager.cs (TypeManager.RealMemberLookup): Make events
12967         actually work, fixes bug #37521.
12968
12969 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12970
12971         * delegate.cs: When creating the various temporary "Parameters"
12972         classes, make sure that we call the ComputeAndDefineParameterTypes
12973         on those new parameters (just like we do with the formal ones), to
12974         allow them to be resolved in the context of the DeclSpace.
12975
12976         This fixes the bug that Dick observed in Bugzilla #38530.
12977
12978 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12979
12980         * expression.cs (ResolveMemberAccess): When resolving a constant,
12981         do not attempt to pull a constant if the value was not able to
12982         generate a valid constant.
12983
12984         * const.cs (LookupConstantValue): Do not report more errors than required.
12985
12986 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12987
12988         * expression.cs: fixes bug #38328.
12989
12990 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12991
12992         * class.cs: Changed all the various members that can be part of a
12993         class from being an ArrayList to be an Array of the right type.
12994         During the DefineType type_list, interface_list, delegate_list and
12995         enum_list are turned into types, interfaces, delegates and enums
12996         arrays.  
12997
12998         And during the member population, indexer_list, event_list,
12999         constant_list, field_list, instance_constructor_list, method_list,
13000         operator_list and property_list are turned into their real arrays.
13001
13002         Although we could probably perform this operation earlier, for
13003         good error reporting we need to keep the lists and remove the
13004         lists for longer than required.
13005
13006         This optimization was triggered by Paolo profiling the compiler
13007         speed on the output of `gen-sample-program.pl' perl script. 
13008
13009         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13010         not crash in methods like MemberLookupFailed that use this field.  
13011
13012         This problem arises when the compiler fails to resolve a type
13013         during interface type definition for example.
13014
13015 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13016
13017         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13018         inherit from System.Object, so we have to stop at null, not only
13019         when reaching System.Object.
13020
13021 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13022
13023         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13024         DeclaredOnly because the parent indexer might have had a different
13025         name, but did not loop until the top of the hierarchy was reached.
13026
13027         The problem this one fixes is 35492: when a class implemented an
13028         indexer from an interface, we were getting the interface method
13029         (which was abstract) and we were flagging an error (can not invoke
13030         abstract method).
13031
13032         This also keeps bug 33089 functioning, and test-148 functioning.
13033
13034         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13035         out if a method is special is to see if it is declared in a
13036         property or event, or whether it is one of the predefined operator
13037         names.   This should fix correctly #36804.
13038
13039 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13040
13041         The goal here is to remove the dependency on EmptyCast.Peel ().
13042         Killing it completely.
13043
13044         The problem is that currently in a number of places where
13045         constants are expected, we have to "probe" for an EmptyCast, and
13046         Peel, which is not the correct thing to do, as this will be
13047         repetitive and will likely lead to errors. 
13048
13049         The idea is to remove any EmptyCasts that are used in casts that
13050         can be reduced to constants, so we only have to cope with
13051         constants. 
13052
13053         This bug hunt was triggered by Bug 37363 and the desire to remove
13054         the duplicate pattern where we were "peeling" emptycasts to check
13055         whether they were constants.  Now constants will always be
13056         constants.
13057
13058         * ecore.cs: Use an enumconstant here instead of wrapping with
13059         EmptyCast.  
13060
13061         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13062         throwing me off.  By handling this we can get rid of a few hacks.
13063
13064         * statement.cs (Switch): Removed Peel() code.
13065
13066 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13067
13068         * class.cs: Location information for error 508
13069
13070         * expression.cs (New.DoResolve): Add a guard against double
13071         resolution of an expression.  
13072
13073         The New DoResolve might be called twice when initializing field
13074         expressions (see EmitFieldInitializers, the call to
13075         GetInitializerExpression will perform a resolve on the expression,
13076         and later the assign will trigger another resolution
13077
13078         This leads to bugs (#37014)
13079
13080         * delegate.cs: The signature for EndInvoke should contain any ref
13081         or out parameters as well.  We were not doing this in the past. 
13082
13083         * class.cs (Field.Define): Do not overwrite the type definition
13084         inside the `volatile' group.  Turns out that volatile enumerations
13085         were changing the type here to perform a validity test, which
13086         broke conversions. 
13087
13088 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13089
13090         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13091         and structs, we do not want to load the instance variable
13092
13093         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13094         enum_type has to be handled like an object reference (implicit
13095         conversions exists from this to object), but the regular IsClass
13096         and IsValueType tests will never return true for this one.
13097
13098         Also we use TypeManager.IsValueType instead of type.IsValueType,
13099         just for consistency with the rest of the code (this is only
13100         needed if we ever use the construct exposed by test-180.cs inside
13101         corlib, which we dont today).
13102
13103 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13104
13105         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13106         just InternalCall.
13107
13108 2003-02-09  Martin Baulig  <martin@ximian.com>
13109
13110         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13111         (Namespace.DefineNamespaces): New static public method; this is
13112         called when we're compiling with debugging to add all namespaces
13113         to the symbol file.
13114
13115         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13116         pass it to the Namespace's .ctor.
13117
13118         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13119         and MethodBase arguments; pass the namespace ID to the symwriter;
13120         pass the MethodBase instead of the token to the symwriter.
13121         (SymbolWriter.DefineNamespace): New method to add a namespace to
13122         the symbol file.
13123
13124 2003-02-09  Martin Baulig  <martin@ximian.com>
13125
13126         * symbolwriter.cs: New file.  This is a wrapper around
13127         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13128         methods here in near future.
13129
13130 2003-02-09  Martin Baulig  <martin@ximian.com>
13131
13132         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13133         ILGenerator.MarkSequencePoint() which are actually used by the
13134         symbol writer.
13135
13136 2003-02-09  Martin Baulig  <martin@ximian.com>
13137
13138         * location.cs (SourceFile): New public sealed class.  This
13139         contains the name and an index which is used in the location's token.
13140         (Location): Reserve an appropriate number of bits in the token for
13141         the source file instead of walking over that list, this gives us a
13142         really huge performance improvement when compiling with debugging.
13143
13144         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13145         `SourceFile' argument instead of a string.
13146         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13147         but don't parse/tokenize here, we need to generate the list of all
13148         source files before we do that.
13149         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13150         the files.
13151
13152         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13153         instead of a string.
13154
13155         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13156         of a string.
13157
13158 2003-02-09  Martin Baulig  <martin@ximian.com>
13159
13160         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13161         filename on `#line default'.
13162
13163 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13164
13165         * statement.cs: don't clear the pinned var when the fixed statement
13166         returns from the method (fixes bug#37752).
13167
13168 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13169
13170         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13171         to IsValueType.
13172
13173 2003-02-07  Martin Baulig  <martin@ximian.com>
13174
13175         * driver.cs: Removed the `--debug-args' command line argument.
13176
13177         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13178         automatically by the AsssemblyBuilder.
13179         (CodeGen.InitializeSymbolWriter): We don't need to call any
13180         initialization function on the symbol writer anymore.  This method
13181         doesn't take any arguments.
13182
13183 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13184
13185         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13186         from referenced assemblies as well.
13187
13188 2003-02-02  Martin Baulig  <martin@ximian.com>
13189
13190         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13191
13192 2003-02-02  Martin Baulig  <martin@ximian.com>
13193
13194         * class.cs (Constructor.Emit): Open the symbol writer before
13195         emitting the constructor initializer.
13196         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13197         single-stepping through constructor initializers.
13198
13199 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13200
13201         * class.cs: Handle error 549: do not allow virtual methods in
13202         sealed classes. 
13203
13204 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13205
13206         * decl.cs: Check access levels when resolving types
13207
13208 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13209
13210         * statement.cs: Add parameters and locals set in catch blocks that might 
13211         return to set vector
13212
13213 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13214
13215         * class.cs (Operator): Set the SpecialName flags for operators.
13216
13217         * expression.cs (Invocation.DoResolve): Only block calls to
13218         accessors and operators on SpecialName methods.
13219
13220         (Cast.TryReduce): Handle conversions from char constants.
13221
13222
13223 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13224
13225         * statement.cs: small memory and time optimization in FlowBranching.
13226
13227 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13228
13229         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13230         problem that the last fix but in the other sid (Set).
13231
13232         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13233         access when there is no indexer in the hierarchy.
13234
13235 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13236
13237         * class.cs: Combine some if statements.
13238
13239 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13240
13241         * driver.cs: fixed bug #37187.
13242
13243 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13244
13245         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13246         any indexer, it's needed to build a list with all the indexers in the
13247         hierarchy (AllGetters), else we have problems. Fixes #35653.
13248
13249 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13250
13251         * class.cs (MethodData.Define): It is wrong for an interface
13252         implementation to be static in both cases: explicit and implicit.
13253         We were only handling this in one case.
13254
13255         Improve the if situation there to not have negations.
13256
13257         * class.cs (Field.Define): Turns out that we do not need to check
13258         the unsafe bit on field definition, only on usage.  Remove the test.
13259
13260 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13261
13262         * driver.cs: use assembly.Location instead of Codebase (the latest
13263         patch made mcs fail when using MS assemblies).
13264
13265 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13266
13267         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13268         get the path to *corlib.dll.
13269
13270 2003-01-21  Nick Drochak <ndrochak@gol.com>
13271
13272         * cs-tokenizer.cs:
13273         * pending.cs:
13274         * typemanager.cs: Remove compiler warnings
13275
13276 2003-01-20  Duncan Mak  <duncan@ximian.com>
13277
13278         * AssemblyInfo.cs: Bump the version number to 0.19.
13279
13280 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13281
13282         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13283
13284 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13285
13286         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13287
13288 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13289
13290         * cs-parser.jay: Small fix: we were not comparing the constructor
13291         name correctly.   Thanks to Zoltan for the initial pointer.
13292
13293 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13294
13295         * cs-tokenizer.cs: Set file name when specified with #line
13296
13297 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13298
13299         * cs-parser.jay: Only perform the constructor checks here if we
13300         are named like the class;  This will help provider a better
13301         error.  The constructor path is taken when a type definition is
13302         not found, but most likely the user forgot to add the type, so
13303         report that rather than the constructor error.
13304
13305 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13306
13307         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13308         allocations.
13309
13310 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13311
13312         * cs-parser.jay: Add cleanup call.
13313
13314 2003-01-13  Duncan Mak  <duncan@ximian.com>
13315
13316         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13317         consistent with other methods.
13318
13319 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13320
13321         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13322
13323 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13324
13325         * attribute.cs: only set GuidAttr to true when we have a
13326         GuidAttribute.
13327
13328 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13329
13330         * ecore.cs:
13331         * expression.cs:
13332         * typemanager.cs: fixes to allow mcs compile corlib with the new
13333         Type.IsSubclassOf fix.
13334
13335 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13336
13337         * expression.cs (LocalVariableReference.DoResolve): Classify a
13338         constant as a value, not as a variable.   Also, set the type for
13339         the variable.
13340
13341         * cs-parser.jay (fixed_statement): take a type instead of a
13342         pointer_type, so we can produce a better error message later.
13343
13344         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13345         as an error.  
13346
13347         (For.DoEmit): Make inifinite loops have a
13348         non-conditional branch back.
13349
13350         (Fixed.DoEmit): First populate the pinned variables, then emit the
13351         statement, then clear the variables.  Before I was emitting the
13352         code once for each fixed piece.
13353
13354
13355 2003-01-08  Martin Baulig  <martin@ximian.com>
13356
13357         * statement.cs (FlowBranching.MergeChild): A break in a
13358         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13359
13360 2003-01-08  Martin Baulig  <martin@ximian.com>
13361
13362         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13363         lives in the same number space than `param_map'.  Fixes #36154.
13364
13365 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13366
13367         * cs-parser.jay (constructor_declaration): Set the
13368         Constructor.ModFlags before probing for it.  This makes the
13369         compiler report 514, 515 and 132 (the code was there, but got
13370         broken). 
13371
13372         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13373         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13374         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13375
13376 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13377
13378         * enum.cs: create the enum static fields using the enum type.
13379
13380 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13381
13382         * class.cs: don't try to create the ParamBuilder for the return
13383         type if it's not needed (and handle it breaking for the ms runtime
13384         anyway).
13385
13386 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13387
13388         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13389
13390 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13391
13392         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13393         the command.   This showed up while compiling the JANET source
13394         code, which used \r as its only newline separator.
13395
13396 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13397
13398         * class.cs (Method.Define): If we are an operator (because it
13399         reuses our code), then set the SpecialName and HideBySig.  #36128
13400
13401 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13402
13403         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13404         exception, report error 120 `object reference required'.
13405
13406         * driver.cs: Add --pause option, used during to measure the size
13407         of the process as it goes with --timestamp.
13408
13409         * expression.cs (Invocation.DoResolve): Do not allow methods with
13410         SpecialName to be invoked.
13411
13412 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13413
13414         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13415         number before adding it.
13416
13417 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13418
13419         * ecore.cs (StandardImplicitConversion): When in an unsafe
13420         context, we allow conversion between void * to any other pointer
13421         type. This fixes bug #35973.
13422
13423 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13424
13425         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13426         is not thrown when extensionless outputs are used 
13427
13428 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13429
13430         * rootcontext.cs: fixed compilation of corlib.
13431
13432 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13433
13434         * attribute.cs (Attributes.Contains): Add new method.
13435
13436         * class.cs (MethodCore.LabelParameters): if the parameter is an
13437         `out' parameter, check that no attribute `[In]' has been passed.
13438
13439         * enum.cs: Handle the `value__' name in an enumeration.
13440
13441 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13442
13443         * decl.cs: Added special case to allow overrides on "protected
13444         internal" methods
13445
13446 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13447
13448         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13449         since it makes much more sense.
13450
13451         (Attributes.ctor): Don't require a Location parameter.
13452
13453         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13454
13455         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13456         since we already have that information per attribute.
13457
13458         * everywhere : make appropriate changes.
13459
13460         * class.cs (LabelParameters): Write the code which actually
13461         applies attributes to the return type. We can't do this on the MS
13462         .NET runtime so we flag a warning in the case an exception is
13463         thrown.
13464
13465 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13466
13467         * const.cs: Handle implicit null conversions here too.
13468
13469 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13470
13471         * class.cs (MethodCore.LabelParameters): Remove the extra
13472         Type [] parameter since it is completely unnecessary. Instead
13473         pass in the method's attributes so that we can extract
13474         the "return" attribute.
13475
13476 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13477
13478         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13479         of ignoring it and letting the compile continue.
13480
13481         * typemanager.cs (ChangeType): use an extra argument to return an
13482         error condition instead of throwing an exception.
13483
13484 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13485
13486         * expression.cs (Unary.TryReduce): mimic the code for the regular
13487         code path.  Perform an implicit cast in the cases where we can
13488         implicitly convert to one of the integral types, and then reduce
13489         based on that constant.   This fixes bug #35483.
13490
13491 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13492
13493         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13494
13495 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13496
13497         * namespace.cs: fixed bug #35489.
13498
13499 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13500
13501         * class.cs: Remove some dead code.
13502
13503         * cs-parser.jay: Estimate the number of methods needed
13504         (RootContext.MethodCount);
13505
13506         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13507         numbers instead of StringBuilders.
13508
13509         * support.cs (PtrHashtable): Add constructor with initial size;
13510         We can now reduce reallocations of the method table.
13511
13512 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13513
13514         * attribute.cs (ApplyAttributes): Keep track of the emitted
13515         attributes on a per-target basis. This fixes bug #35413.
13516
13517 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13518
13519         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13520         default to the Windows 1252 encoding.
13521
13522         (UnixParseOption): Support version, thanks to Alp for the missing
13523         pointer. 
13524
13525         * AssemblyInfo.cs: Add nice assembly information.
13526
13527         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13528         (bug 35169).
13529
13530         * cs-parser.jay: Allow a trailing comma before the close bracked
13531         in the attribute_section production.
13532
13533         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13534         address of the instance was being taken, I will take this out,
13535         because we take the address of the object immediately here.
13536
13537 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13538
13539         * typemanager.cs (AreMultipleAllowed): Take care of the most
13540         obvious case where attribute type is not in the current assembly -
13541         stupid me ;-)
13542
13543 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13544
13545         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13546         definitions, instead of doing that afterwards.  
13547
13548         Also we use a nice little hack, depending on the constructor, we
13549         know if we are a "composed" name or a simple name.  Hence, we
13550         avoid the IndexOf test, and we avoid 
13551
13552         * codegen.cs: Add code to assist in a bug reporter to track down
13553         the source of a compiler crash. 
13554
13555 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13556
13557         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13558         types have been emitted for a given element and flag an error
13559         if something which does not have AllowMultiple set is used more
13560         than once.
13561
13562         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13563         attribute types and their corresponding AllowMultiple properties
13564
13565         (AreMultipleAllowed): Check the property for a given type.
13566
13567         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13568         property in the case we have a TypeContainer.
13569
13570         (Attributes.AddAttribute): Detect duplicates and just skip on
13571         adding them. This trivial fix catches a pretty gross error in our
13572         attribute emission - global attributes were being emitted twice!
13573
13574         Bugzilla bug #33187 is now fixed.
13575
13576 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13577
13578         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13579         instead of pp_and).
13580
13581         * expression.cs (Binary.ResolveOperator): I can only use the
13582         Concat (string, string, string) and Concat (string, string,
13583         string, string) if the child is actually a concatenation of
13584         strings. 
13585
13586 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13587
13588         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13589         context where we need a 2-character lookahead.
13590
13591         * pending.cs (PendingImplementation): Rework so we can keep track
13592         of interface types all the time, and flag those which were
13593         implemented by parents as optional.
13594
13595 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13596
13597         * expression.cs (Binary.ResolveOperator): Use
13598         String.Concat(string,string,string) or
13599         String.Concat(string,string,string,string) when possible. 
13600
13601         * typemanager: More helper methods.
13602
13603
13604 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13605
13606         * pending.cs: remove the bogus return from GetMissingInterfaces()
13607         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13608
13609 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13610
13611         * namespace.cs: avoid duplicated 'using xxx' being added to
13612         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13613         when we get more than one 'using' statement for the same namespace.
13614         Report a CS0105 warning for it.
13615
13616 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13617
13618         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13619         of calling getChar/putback, uses internal knowledge of it.    
13620
13621         (xtoken): Reorder tokenizer so most common patterns are checked
13622         first.  This reduces the compilation time in another 5% (from 8.11s
13623         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13624
13625         The parsing time is 22% of the compilation in mcs, and from that
13626         64% is spent on the tokenization process.  
13627
13628         I tried using a binary search for keywords, but this is slower
13629         than the hashtable.  Another option would be to do a couple of
13630         things:
13631
13632                 * Not use a StringBuilder, instead use an array of chars,
13633                   with a set value.  Notice that this way we could catch
13634                   the 645 error without having to do it *afterwards*.
13635
13636                 * We could write a hand-parser to avoid the hashtable
13637                   compares altogether.
13638
13639         The identifier consumption process takes 37% of the tokenization
13640         time.  Another 15% is spent on is_number.  56% of the time spent
13641         on is_number is spent on Int64.Parse:
13642
13643                 * We could probably choose based on the string length to
13644                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13645                   computations. 
13646
13647         Another 3% is spend on wrapping `xtoken' in the `token' function.
13648
13649         Handle 0xa0 as whitespace (#34752)
13650
13651 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13652
13653         * typemanager.cs (IsCLRType): New routine to tell whether a type
13654         is one of the builtin types.  
13655
13656         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13657         typecode in more places instead of doing pointer comparissions.
13658         We could leverage some knowledge about the way the typecodes are
13659         laid out.
13660
13661         New code to cache namespaces in assemblies, it is currently not
13662         invoked, to be used soon.
13663
13664         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13665
13666         * expression.cs (Binary.ResolveOperator): specially handle
13667         strings, and do not perform user-defined operator overloading for
13668         built-in types.
13669
13670 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13671
13672         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13673         internalcall as it is a pretty simple operation;  Avoid whenever
13674         possible to call Char.IsLetter.
13675
13676         (consume_identifier): Cut by half the number of
13677         hashtable calls by merging the is_keyword and GetKeyword behavior.
13678
13679         Do not short-circuit, because if we do, we
13680         report errors (ie, #if false && true would produce an invalid
13681         directive error);
13682
13683
13684 2002-11-24  Martin Baulig  <martin@ximian.com>
13685
13686         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13687         check constant ranges and report a CS0221.  Fixes #33186.
13688
13689 2002-11-24  Martin Baulig  <martin@ximian.com>
13690
13691         * cs-parser.jay: Make this work for uninitialized variable
13692         declarations in the `for' initializer.  Fixes #32416.
13693
13694 2002-11-24  Martin Baulig  <martin@ximian.com>
13695
13696         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13697         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13698
13699 2002-11-24  Martin Baulig  <martin@ximian.com>
13700
13701         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13702         argument; if true, we also check for user-defined conversions.
13703         This is only needed if both arguments are of a user-defined type.
13704         Fixes #30443, added test-175.cs.
13705         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13706
13707         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13708
13709 2002-11-24  Martin Baulig  <martin@ximian.com>
13710
13711         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13712         function to get the store opcode.
13713         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13714         only emit the Ldelema if the store opcode is Stobj.  You must run
13715         both test-34 and test-167 to test this.  Fixes #34529.
13716
13717 2002-11-23  Martin Baulig  <martin@ximian.com>
13718
13719         * ecore.cs (Expression.MemberLookup): Added additional
13720         `qualifier_type' argument which is used when we're being called
13721         from MemberAccess.DoResolve() and null if we're called from a
13722         SimpleName lookup.
13723         (Expression.MemberLookupFailed): New method to report errors; this
13724         does the CS1540 check and reports the correct error message.
13725
13726         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13727         argument for the CS1540 check and redone the way how we're dealing
13728         with private members.  See the comment in the source code for details.
13729         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13730         `closure_start_type' to `closure_qualifier_type' and check whether
13731         it's not null.  It was not this filter being broken, it was just
13732         being called with the wrong arguments.
13733
13734         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13735         and pass it the correct `qualifier_type'; this also does the error
13736         handling for us.
13737
13738 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13739
13740         * expression.cs (Invocation.EmitParams): If the we are dealing
13741         with a non-built-in value type, load its address as well.
13742
13743         (ArrayCreation): Use a a pretty constant instead
13744         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13745         static initializers.  
13746
13747         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13748         because they are not really value types, just glorified integers. 
13749
13750         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13751
13752         * ecore.cs: Remove redundant code for enumerations, make them use
13753         the same code path as everything else, fixes the casting issue
13754         with enumerations in Windows.Forms.
13755
13756         * attribute.cs: Do only cast to string if it is a string, the
13757         validation happens later.
13758
13759         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13760         people upgrade their corlibs.
13761
13762         * ecore.cs: Oops, enumerations were not following the entire code path
13763
13764 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13765
13766         * typemanager.cs (FilterWithClosure): Commented out the test for
13767         1540 in typemanager.cs, as it has problems when accessing
13768         protected methods from a parent class (see test-174.cs). 
13769
13770         * attribute.cs (Attribute.ValidateGuid): new method.
13771         (Attribute.Resolve): Use above.
13772
13773 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13774
13775         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13776
13777         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13778         handling for enumerations, as we only needed the TypeContainer
13779         functionality to begin with (this is required for the fix below to
13780         work for enums that reference constants in a container class for
13781         example). 
13782
13783         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13784
13785         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13786         a valid TypeBuilder to perform lookups on.o
13787
13788         * class.cs (InheritableMemberSignatureCompare): Use true in the
13789         call to GetGetMethod and GetSetMethod, because we are comparing
13790         the signature, and we need to get the methods *even* if they are
13791         private. 
13792
13793         (PropertyBase.CheckBase): ditto.
13794
13795         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13796         GotoCase.Resolve): Use Peel on EmpytCasts.
13797
13798         * ecore.cs (EmptyCast): drop child, add Peel method.
13799
13800 2002-11-17  Martin Baulig  <martin@ximian.com>
13801
13802         * ecore.cs (EmptyCast.Child): New public property.
13803
13804         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13805         label resolved to an EmptyCast.  Fixes #34162.
13806         (GotoCase.Resolve): Likewise.
13807         (Block.EmitMeta): Likewise.
13808
13809 2002-11-17  Martin Baulig  <martin@ximian.com>
13810
13811         * expression.cs (Invocation.BetterConversion): Prefer int over
13812         uint; short over ushort; long over ulong for integer literals.
13813         Use ImplicitConversionExists instead of StandardConversionExists
13814         since we also need to check for user-defined implicit conversions.
13815         Fixes #34165.  Added test-173.cs.
13816
13817 2002-11-16  Martin Baulig  <martin@ximian.com>
13818
13819         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13820         with the `true' and `false' literals.  Fixes #33151.
13821
13822 2002-11-16  Martin Baulig  <martin@ximian.com>
13823
13824         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13825         October 22nd; don't do the cs1540 check for static members.
13826
13827         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13828         now using our own filter here and doing the cs1540 check again.
13829
13830 2002-11-16  Martin Baulig  <martin@ximian.com>
13831
13832         * support.cs (InternalParameters): Don't crash if we don't have
13833         any fixed parameters.  Fixes #33532.
13834
13835 2002-11-16  Martin Baulig  <martin@ximian.com>
13836
13837         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13838         when looking up static methods to make this work on Windows.
13839         Fixes #33773.
13840
13841 2002-11-16  Martin Baulig  <martin@ximian.com>
13842
13843         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13844         a setter rather than using PropertyInfo.CanWrite.
13845
13846 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13847
13848         * class.cs: Allow acces to block member by subclasses. Fixes build
13849         breaker.
13850
13851 2002-11-14  Martin Baulig  <martin@ximian.com>
13852
13853         * class.cs (Constructor.Emit): Added the extern/block check.
13854         Fixes bug #33678.
13855
13856 2002-11-14  Martin Baulig  <martin@ximian.com>
13857
13858         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13859         iteration while looking for indexers, this is needed because the
13860         indexer may have a different name in our base classes.  Fixed the
13861         error reporting (no indexers at all, not get accessor, no
13862         overloaded match).  Fixes bug #33089.
13863         (IndexerAccess.DoResolveLValue): Likewise.
13864
13865 2002-11-14  Martin Baulig  <martin@ximian.com>
13866
13867         * class.cs (PropertyBase.CheckBase): Make this work for multiple
13868         indexers.  Fixes the first part of bug #33089.
13869         (MethodSignature.InheritableMemberSignatureCompare): Added support
13870         for properties.
13871
13872 2002-11-13  Ravi Pratap  <ravi@ximian.com>
13873
13874         * attribute.cs (Attribute.Resolve): Catch the
13875         NullReferenceException and report it since it isn't supposed to
13876         happen. 
13877
13878 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
13879
13880         * expression.cs (Binary.EmitBranchable): Also handle the cases for
13881         LogicalOr and LogicalAnd that can benefit from recursively
13882         handling EmitBranchable.  The code now should be nice for Paolo.
13883
13884 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
13885
13886         * typemanager.cs (LookupType): Added a negative-hit hashtable for
13887         the Type lookups, as we perform quite a number of lookups on
13888         non-Types.  This can be removed once we can deterministically tell
13889         whether we have a type or a namespace in advance.
13890
13891         But this might require special hacks from our corlib.
13892
13893         * TODO: updated.
13894
13895         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13896         and double which avoids a conversion from an integer to a double.
13897
13898         * expression.cs: tiny optimization, avoid calling IsConstant,
13899         because it effectively performs the lookup twice.
13900
13901 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
13902
13903         But a bogus return here to keep the semantics of the old code
13904         until the Mono runtime is fixed.
13905
13906         * pending.cs (GetMissingInterfaces): New method used to remove all
13907         the interfaces that are already implemented by our parent
13908         classes from the list of pending methods. 
13909
13910         * interface.cs: Add checks for calls after ResolveTypeExpr.
13911
13912 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
13913
13914         * class.cs (Class.Emit): Report warning 67: event not used if the
13915         warning level is beyond 3.
13916
13917         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13918         being a NullLiteral.
13919
13920         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13921         specifiers. 
13922
13923         * class.cs (TypeContainer.GetClassBases): Cover a missing code
13924         path that might fail if a type can not be resolved.
13925
13926         * expression.cs (Binary.Emit): Emit unsigned versions of the
13927         operators. 
13928
13929         * driver.cs: use error 5.
13930
13931 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13932
13933         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13934
13935 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
13936
13937         * cs-parser.jay (switch_section): A beautiful patch from Martin
13938         Baulig that fixed 33094.
13939
13940 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
13941
13942         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13943         Check whether the base is abstract and report an error if so.
13944
13945         * expression.cs (IndexerAccess.DoResolveLValue,
13946         IndexerAccess.DoResolve): ditto. 
13947
13948         (Invocation.DoResolve): ditto.
13949
13950         (Invocation.FullMethodDesc): Improve the report string.
13951
13952         * statement.cs (Block): Eliminate IsVariableDefined as it is
13953         basically just a wrapper for GetVariableInfo.
13954
13955         * ecore.cs (SimpleName): Use new 
13956
13957         * support.cs (ReflectionParamter.ParameterType): We unwrap the
13958         type, as we return the actual parameter ref/unref state on a
13959         different call.
13960
13961 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
13962
13963         * support.cs: Return proper flags REF/OUT fixing the previous
13964         commit.  
13965
13966         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
13967         not used to mean `ref' but `ref or out' in ParameterReference
13968
13969         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13970         full type signature instead of calling TypeManger.CSharpName
13971         ourselves. 
13972
13973         * support.cs (InternalParameters.ParameterDesc): Do not compare
13974         directly to the modflags, because REF/OUT will actually be bitsets
13975         if set. 
13976
13977         * delegate.cs (VerifyMethod): Check also the modifiers.
13978
13979         * cs-tokenizer.cs: Fix bug where floating point values with an
13980         exponent where a sign was missing was ignored.
13981
13982         * driver.cs: Allow multiple assemblies to be specified in a single
13983         /r: argument
13984
13985 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13986
13987         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13988         because identifiers after a parenthesis would end up in this kind
13989         of production, and we needed to desamiguate it for having casts
13990         like:
13991
13992                 (UserDefinedType *) xxx
13993
13994 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
13995
13996         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13997         we should set on the Bindingflags.NonPublic, but not turn on
13998         private_ok.  private_ok controls whether a Private member is
13999         returned (this is chekced on the filter routine), while the
14000         BindingFlags.NonPublic just controls whether private/protected
14001         will be allowed.   This fixes the problem part of the problem of
14002         private properties being allowed to be used in derived classes.
14003
14004         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14005         so we can call the children DoResolveLValue method (this will
14006         properly signal errors on lvalue assignments to base properties)
14007
14008         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14009         getter are null, and we have a property info, we know that this
14010         happened because the lookup failed, so we report an error 122 for
14011         protection level violation.
14012
14013         We also silently return if setter and getter are null in the
14014         resolve functions, this condition only happens if we have flagged
14015         the error before.  This is the other half of the problem. 
14016
14017         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14018         not have accessibility information, that is why we were returning
14019         true in the filter function in typemanager.cs.
14020
14021         To properly report 122 (property is inaccessible because of its
14022         protection level) correctly, we report this error in ResolveAccess
14023         by failing if both the setter and the getter are lacking (ie, the
14024         lookup failed). 
14025
14026         DoResolve and DoLResolve have been modified to check for both
14027         setter/getter being null and returning silently, the reason being
14028         that I did not want to put the knowledge about this error in upper
14029         layers, like:
14030
14031         int old = Report.Errors;
14032         x = new PropertyExpr (...);
14033         if (old != Report.Errors)
14034                 return null;
14035         else
14036                 return x;
14037
14038         So the property expr is returned, but it is invalid, so the error
14039         will be flagged during the resolve process. 
14040
14041         * class.cs: Remove InheritablePropertySignatureCompare from the
14042         class, as we no longer depend on the property signature to compute
14043         whether it is possible to implement a method or not.
14044
14045         The reason is that calling PropertyInfo.GetGetMethod will return
14046         null (in .NET, in Mono it works, and we should change this), in
14047         cases where the Get Method does not exist in that particular
14048         class.
14049
14050         So this code:
14051
14052         class X { public virtual int A { get { return 1; } } }
14053         class Y : X { }
14054         class Z : Y { public override int A { get { return 2; } } }
14055
14056         Would fail in Z because the parent (Y) would not have the property
14057         defined.  So we avoid this completely now (because the alternative
14058         fix was ugly and slow), and we now depend exclusively on the
14059         method names.
14060
14061         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14062         reference method, instead of using the property.
14063
14064         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14065         routines are gone now.
14066
14067         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14068         names, they were incorrectly named.
14069
14070         * cs-tokenizer.cs: Return are more gentle token on failure. 
14071
14072         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14073         had an out-of-sync index variable, which caused it to remove from
14074         the list of pending methods the wrong method sometimes.
14075
14076 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14077
14078         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14079         CanWrite, because those refer to this particular instance of the
14080         property, and do not take into account the fact that we can
14081         override single members of a property.
14082
14083         Constructor requires an EmitContext.  The resolution process does
14084         not happen here, but we need to compute the accessors before,
14085         because the resolution does not always happen for properties.
14086
14087         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14088         subclass, before we did not update this flag, but we did update
14089         bindingflags. 
14090
14091         (GetAccessors): Drop this routine, as it did not work in the
14092         presence of partially overwritten set/get methods. 
14093
14094         Notice that this broke the cs1540 detection, but that will require
14095         more thinking. 
14096
14097 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14098
14099         * class.cs:
14100         * codegen.cs:
14101         * driver.cs: issue a warning instead of an error if we don't support
14102         debugging for the platform. Also ignore a couple of errors that may
14103         arise when trying to write the symbols. Undo my previous patch.
14104
14105 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14106
14107         * driver.cs: ignore /debug switch except for Unix platforms.
14108
14109 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14110
14111         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14112
14113 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14114
14115         * driver.cs: Do not make mcs-debug conditional, so we do not break
14116         builds that use it.
14117
14118         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14119         review this patch.  But basically after all the children variables
14120         have been merged, the value of "Breaks" was not being set to
14121         new_breaks for Switch blocks.  I think that it should be set after
14122         it has executed.  Currently I set this to the value of new_breaks,
14123         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14124         conservative, but I do not understand this code very well.
14125
14126         I did not break anything in the build, so that is good ;-)
14127
14128         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14129
14130 2002-10-20  Mark Crichton  <crichton@gimp.org>
14131
14132         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14133
14134 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14135
14136         * cfold.cs: Fixed compile blocker.
14137
14138 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14139
14140         * driver.cs: I was chekcing the key, not the file.
14141
14142 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14143
14144         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14145         message that we were generating - we just need to silently return
14146         a null.
14147
14148 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14149
14150         * class.cs (Event.Define): Change my previous commit, as this
14151         breaks the debugger.  This is a temporary hack, as it seems like
14152         the compiler is generating events incorrectly to begin with.
14153
14154         * expression.cs (Binary.ResolveOperator): Added support for 
14155         "U operator - (E x, E y)"
14156
14157         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14158         y)".
14159
14160         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14161         init-only variables, but this path did not take into account that
14162         there might be also instance readonly variables.  Correct this
14163         problem. 
14164
14165         This fixes bug 32253
14166
14167         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14168         delegates as well.
14169
14170         * driver.cs: Change the extension for modules to `netmodule'
14171
14172         * cs-parser.jay: Improved slightly the location tracking for
14173         the debugger symbols.
14174
14175         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14176         modifiers that were specified instead of the hardcoded value
14177         (FamAndAssem).  This was basically ignoring the static modifier,
14178         and others.  Fixes 32429.
14179
14180         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14181         fixed a bug in the process (32476)
14182
14183         * expression.cs (ArrayAccess.EmitAssign): Patch from
14184         hwang_rob@yahoo.ca that fixes bug 31834.3
14185
14186 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14187
14188         * driver.cs: Make the module extension .netmodule.
14189
14190 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14191
14192         * driver.cs: Report an error if the resource file is not found
14193         instead of crashing.
14194
14195         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14196         false, like Emit does.
14197
14198 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14199
14200         * typemanager.cs: Remove unused private member.  Also reported mcs
14201         bug to report this as a warning like csc.
14202
14203 2002-10-15  Martin Baulig  <martin@gnome.org>
14204
14205         * statement.cs (Statement.Emit): Made this a virtual method; emits
14206         the line number info and calls DoEmit().
14207         (Statement.DoEmit): New protected abstract method, formerly knows
14208         as Statement.Emit().
14209
14210         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14211
14212 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14213
14214         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14215         have fixed a remaining problem: not every AddXXXX was adding a
14216         fully qualified name.  
14217
14218         Now everyone registers a fully qualified name in the DeclSpace as
14219         being defined instead of the partial name.  
14220
14221         Downsides: we are slower than we need to be due to the excess
14222         copies and the names being registered this way.  
14223
14224         The reason for this is that we currently depend (on the corlib
14225         bootstrap for instance) that types are fully qualified, because
14226         we dump all the types in the namespace, and we should really have
14227         types inserted into the proper namespace, so we can only store the
14228         basenames in the defined_names array.
14229
14230 2002-10-10  Martin Baulig  <martin@gnome.org>
14231
14232         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14233         from bug #31834, see the bug report for a testcase which is
14234         miscompiled.
14235
14236 2002-10-10  Martin Baulig  <martin@gnome.org>
14237
14238         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14239         flow analysis code for this.
14240
14241         * statement.cs (Do, While, For): Tell the flow analysis code about
14242         infinite loops.
14243         (FlowBranching.UsageVector): Added support for infinite loops.
14244         (Block.Resolve): Moved the dead code elimination here and use flow
14245         analysis to do it.
14246
14247 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14248
14249         * class.cs (Field.Define): Catch cycles on struct type
14250         definitions. 
14251
14252         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14253         fields if the fields are static.  We only need to check instance
14254         fields. 
14255
14256         * expression.cs (As.DoResolve): Test for reference type.
14257
14258         * statement.cs (Using.ResolveExpression): Use
14259         ConvertImplicitRequired, not ConvertImplicit which reports an
14260         error on failture
14261         (Using.ResolveLocalVariableDecls): ditto.
14262
14263         * expression.cs (Binary.ResolveOperator): Report errors in a few
14264         places where we had to.
14265
14266         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14267
14268 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14269
14270         * expression.cs: Use StoreFromPtr instead of extracting the type
14271         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14272
14273         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14274         an enumeration value to a System.Enum, but System.Enum is not a
14275         value type, but an class type, so we need to box.
14276
14277         (Expression.ConvertExplicit): One codepath could return
14278         errors but not flag them.  Fix this.  Fixes #31853
14279
14280         * parameter.cs (Resolve): Do not allow void as a parameter type.
14281
14282 2002-10-06  Martin Baulig  <martin@gnome.org>
14283
14284         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14285         if it's a class type and not a struct.  Fixes #31815.
14286
14287 2002-10-06  Martin Baulig  <martin@gnome.org>
14288
14289         * statement.cs: Reworked the flow analysis code a bit to make it
14290         usable for dead code elimination.
14291
14292 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14293
14294         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14295
14296 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14297
14298         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14299         to fix the test 165, will investigate deeper.
14300
14301 2002-10-04  Martin Baulig  <martin@gnome.org>
14302
14303         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14304         finally blocks actually work.
14305         (Try.Resolve): We don't need to create a sibling for `finally' if
14306         there is no finally block.
14307
14308 2002-10-04  Martin Baulig  <martin@gnome.org>
14309
14310         * class.cs (Constructor.Define): The default accessibility for a
14311         non-default constructor is private, not public.
14312
14313 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14314
14315         * class.cs (Constructor): Make AllowedModifiers public, add
14316         EXTERN.
14317
14318         * cs-parser.jay: Perform the modifiers test here, as the
14319         constructor for the Constructor class usually receives a zero
14320         because of the way we create it (first we create, later we
14321         customize, and we were never checking the modifiers).
14322
14323         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14324         is a version of LookupTypeReflection that includes the type-name
14325         cache.  This can be used as a fast path for functions that know
14326         the fully qualified name and are only calling into *.GetType() to
14327         obtain a composed type.
14328
14329         This is also used by TypeManager.LookupType during its type
14330         composition.
14331
14332         (LookupType): We now also track the real type name, as sometimes
14333         we can get a quey for the real type name from things like
14334         ComposedCast.  This fixes bug 31422.
14335
14336         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14337         complete type fullname, it does not have to go through the type
14338         resolution system to obtain the composed version of the type (for
14339         obtaining arrays or pointers).
14340
14341         (Conditional.Emit): Use the EmitBoolExpression to
14342         generate nicer code, as requested by Paolo.
14343
14344         (ArrayCreation.CheckIndices): Use the patch from
14345         hwang_rob@yahoo.ca to validate the array initializers. 
14346
14347 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14348
14349         * class.cs (ConstructorInitializer.Emit): simplify code by using
14350         Invocation.EmitCall, and at the same time, fix the bugs in calling
14351         parent constructors that took variable arguments. 
14352
14353         * ecore.cs (Expression.ConvertNumericExplicit,
14354         Expression.ImplicitNumericConversion): Remove the code that
14355         manually wrapped decimal (InternalTypeConstructor call is now gone
14356         as well).
14357
14358         * expression.cs (Cast.TryReduce): Also handle decimal types when
14359         trying to perform a constant fold on the type.
14360
14361         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14362
14363         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14364         that only turned off an error report, and did nothing else. 
14365
14366 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14367
14368         * driver.cs: Handle and ignore /fullpaths
14369
14370 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14371
14372         * expression.cs (Binary.ResolveOperator): Catch the case where
14373         DoNumericPromotions returns true, 
14374
14375         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14376
14377 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14378
14379         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14380         report error 70.
14381
14382 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14383
14384         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14385         conversion exists, but it is also required that the conversion be
14386         performed.  This manifested in "(Type64Enum) 2".  
14387
14388         * class.cs (TypeManager.AddMethod): The fix is not to change
14389         AddEnum, because that one was using a fully qualified name (every
14390         DeclSpace derivative does), but to change the AddMethod routine
14391         that was using an un-namespaced name.  This now correctly reports
14392         the duplicated name.
14393
14394         Revert patch until I can properly fix it.  The issue
14395         is that we have a shared Type space across all namespaces
14396         currently, which is wrong.
14397
14398         Options include making the Namespace a DeclSpace, and merge
14399         current_namespace/current_container in the parser.
14400
14401 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14402
14403         * cs-parser.jay: Improve error reporting when we get a different
14404         kind of expression in local_variable_type and
14405         local_variable_pointer_type. 
14406
14407         Propagate this to avoid missleading errors being reported.
14408
14409         * ecore.cs (ImplicitReferenceConversion): treat
14410         TypeManager.value_type as a target just like object_type.   As
14411         code like this:
14412
14413         ValueType v = 1;
14414
14415         Is valid, and needs to result in the int 1 being boxed before it
14416         is assigned to the value type v.
14417
14418         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14419         to validate the enumeration name.
14420
14421         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14422         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14423         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14424
14425         * ecore.cs (TryImplicitIntConversion): When doing an
14426         implicit-enumeration-conversion, check if the type is 64-bits and
14427         perform a conversion before passing to EnumConstant.
14428
14429 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14430
14431         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14432         report ambiguous type references.  Unlike the MS version, we
14433         report what the ambiguity is.   Innovation at work ;-)
14434
14435         (DeclSpace.FindType): Require a location argument to
14436         display when we display an ambiguous error.
14437
14438         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14439
14440         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14441
14442         * expression.cs (EmitDynamicInitializers): Apply patch from
14443         hwang_rob@yahoo.ca that fixes the order in which we emit our
14444         initializers. 
14445
14446 2002-09-21  Martin Baulig  <martin@gnome.org>
14447
14448         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14449         delegate takes no arguments.
14450
14451 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14452
14453         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14454         from integers.
14455
14456         * expression.cs: Extract the underlying type.
14457
14458         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14459
14460         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14461
14462 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14463
14464         * class.cs (TypeContainer.DefineType): We can not use the nice
14465         PackingSize with the size set to 1 DefineType method, because it
14466         will not allow us to define the interfaces that the struct
14467         implements.
14468
14469         This completes the fixing of bug 27287
14470
14471         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14472         means also structs.  This fixes part of the problem. 
14473         (Expresion.ImplicitReferenceConversionExists): ditto.
14474
14475         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14476         error if there were no errors reported during the type lookup
14477         process, to avoid duplicates or redundant errors.  Without this
14478         you would get an ambiguous errors plus a type not found.  We have
14479         beaten the user enough with the first error.  
14480
14481         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14482         reference. 
14483
14484         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14485         during the resolution process, stop the lookup, this avoids
14486         repeated error reports (same error twice).
14487
14488         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14489
14490         * typemanager.cs (LookupType): Redo the type lookup code to match
14491         the needs of System.Reflection.  
14492
14493         The issue is that System.Reflection requires references to nested
14494         types to begin with a "+" sign instead of a dot.  So toplevel
14495         types look like: "NameSpace.TopLevelClass", and nested ones look
14496         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14497         levels. 
14498
14499 2002-09-19  Martin Baulig  <martin@gnome.org>
14500
14501         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14502         says that a method always returns or always throws an exception,
14503         don't report the CS0161.
14504
14505         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14506         set `Returns = new_returns'.
14507
14508 2002-09-19  Martin Baulig  <martin@gnome.org>
14509
14510         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14511         to an enum constant, check for a CS0176.
14512
14513 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14514
14515         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14516         for operators that must be in pairs and report errors.
14517
14518         * ecore.cs (SimpleName.DoResolveType): During the initial type
14519         resolution process, when we define types recursively, we must
14520         check first for types in our current scope before we perform
14521         lookups in the enclosing scopes.
14522
14523         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14524
14525         (Invocation.VerifyArgumentsCompat): Call
14526         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14527         I thought we were supposed to always call this, but there are a
14528         few places in the code where we dont do it.
14529
14530 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14531
14532         * driver.cs: Add support in -linkres and -resource to specify the
14533         name of the identifier.
14534
14535 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14536
14537         * ecore.cs (StandardConversionExists): Sync with the conversion
14538         code: allow anything-* to void* conversions.
14539
14540         (FindMostSpecificSource): Use an Expression argument
14541         instead of a Type, because we might be handed over a Literal which
14542         gets a few more implicit conversions that plain types do not.  So
14543         this information was being lost.
14544
14545         Also, we drop the temporary type-holder expression when not
14546         required.
14547
14548 2002-09-17  Martin Baulig  <martin@gnome.org>
14549
14550         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14551         this is an explicit interface implementation.
14552
14553 2002-09-17  Martin Baulig  <martin@gnome.org>
14554
14555         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14556         different `IndexerName' attributes.
14557
14558         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14559         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14560         virtual CommonResolve().
14561
14562 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14563
14564         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14565         and convert that to the UnderlyingType.
14566
14567         * statement.cs (Foreach.Resolve): Indexers are just like variables
14568         or PropertyAccesses.
14569
14570         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14571         inside quoted strings, we were not doing this before.
14572
14573 2002-09-16  Martin Baulig  <martin@gnome.org>
14574
14575         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14576         resolve it.  This is needed for the definite assignment check of the
14577         instance expression, fixes bug #29846.
14578         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14579
14580 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14581
14582         * parameter.cs: Fix compile error.  Cannot reference static member
14583         from an instance object.  Is this an mcs bug?
14584
14585 2002-09-14  Martin Baulig  <martin@gnome.org>
14586
14587         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14588         multiple times.  Fixes bug #30295, added test-166.cs.
14589
14590 2002-09-14  Martin Baulig  <martin@gnome.org>
14591
14592         * statement.cs (Block.Emit): Don't emit unreachable code.
14593         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14594         `break' statements.
14595         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14596
14597 2002-09-14  Martin Baulig  <martin@gnome.org>
14598
14599         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14600         is set.
14601
14602 2002-09-14  Martin Baulig  <martin@gnome.org>
14603
14604         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14605         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14606         be false on the ms runtime.
14607
14608 2002-09-13  Martin Baulig  <martin@gnome.org>
14609
14610         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14611         the CS0038 error message.
14612
14613 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14614
14615         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14616         constant inside, return it.
14617
14618 2002-09-12  Martin Baulig  <martin@gnome.org>
14619
14620         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14621         implicit conversion can be done between enum types.
14622
14623         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14624         check whether an implicit conversion to the current enum's UnderlyingType
14625         exists and report an error if not.
14626
14627         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14628         without debugging support.
14629
14630         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14631         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14632
14633 2002-09-12  Martin Baulig  <martin@gnome.org>
14634
14635         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14636
14637         * ecore.cs (IMemberExpr.DeclaringType): New property.
14638         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14639         nonstatic member of an outer type (CS0038).
14640
14641 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14642
14643         * driver.cs: Activate the using-error detector at warning level
14644         4 (at least for MS-compatible APIs).
14645
14646         * namespace.cs (VerifyUsing): Small buglett fix.
14647
14648         * pending.cs (PendingImplementation): pass the container pointer. 
14649
14650         * interface.cs (GetMethods): Allow for recursive definition.  Long
14651         term, I would like to move every type to support recursive
14652         definitions, not the current ordering mechanism that we have right
14653         now.
14654
14655         The situation is this: Attributes are handled before interfaces,
14656         so we can apply attributes to interfaces.  But some attributes
14657         implement interfaces, we will now handle the simple cases
14658         (recursive definitions will just get an error).  
14659
14660         * parameter.cs: Only invalidate types at the end if we fail to
14661         lookup all types.  
14662
14663 2002-09-09  Martin Baulig  <martin@gnome.org>
14664
14665         * ecore.cs (PropertyExpr.Emit): Also check for
14666         TypeManager.system_int_array_get_length so this'll also work when
14667         compiling corlib.  Fixes #30003.
14668
14669 2002-09-09  Martin Baulig  <martin@gnome.org>
14670
14671         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14672         and throw an exception if we can't get the type's size.  Fixed #30040,
14673         added test-165.cs.
14674
14675 2002-09-09  Martin Baulig  <martin@gnome.org>
14676
14677         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14678
14679         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14680         context.  Fixes bug #30027.
14681
14682         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14683         virtual functions.  Fixes bug #30043, added test-164.cs.
14684
14685 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14686
14687         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14688
14689 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14690
14691         * driver.cs: Use an object to get the windows codepage since it's not a
14692         static property.
14693
14694 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14695
14696         * statement.cs (For.Emit): for infinite loops (test == null)
14697         return whether there is a break inside, not always "true".
14698
14699         * namespace.cs (UsingEntry): New struct to hold the name of the
14700         using definition, the location where it is defined, and whether it
14701         has been used in a successful type lookup.
14702
14703         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14704         strings.
14705
14706         * decl.cs: ditto.
14707
14708 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14709
14710         * attribute.cs : Fix incorrect code which relied on catching
14711         a NullReferenceException to detect a null being passed in
14712         where an object was expected.
14713
14714 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14715
14716         * statement.cs (Try): flag the catch variable as assigned
14717
14718         * expression.cs (Cast): Simplified by using ResolveType instead of
14719         manually resolving.
14720
14721         * statement.cs (Catch): Fix bug by using ResolveType.
14722
14723 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14724
14725         * expression.cs (BetterConversion): Special case for when we have
14726         a NullLiteral as the argument and we have to choose between string
14727         and object types - we choose string the way csc does.
14728
14729         * attribute.cs (Attribute.Resolve): Catch the
14730         NullReferenceException and report error #182 since the Mono
14731         runtime no more has the bug and having this exception raised means
14732         we tried to select a constructor which takes an object and is
14733         passed a null.
14734
14735 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14736
14737         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14738         message (1502, 1503) when we can't locate a method after overload
14739         resolution. This is much more informative and closes the bug
14740         Miguel reported.
14741
14742         * interface.cs (PopulateMethod): Return if there are no argument
14743         types. Fixes a NullReferenceException bug.
14744
14745         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14746         expressions too. Previously we were checking only in one place for
14747         positional arguments leaving out named arguments.
14748
14749         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14750         type to the enum type is not allowed. Remove code corresponding to
14751         that.
14752
14753         (ConvertNumericExplicit): Allow explicit conversions from
14754         the underlying type to enum type. This precisely follows the spec
14755         and closes a bug filed by Gonzalo.
14756
14757 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14758
14759         * compiler.csproj:
14760         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14761
14762 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14763
14764         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14765         it was important that we stored the right value after the
14766         reduction in `converted'.
14767
14768 2002-09-04  Martin Baulig  <martin@gnome.org>
14769
14770         * location.cs (Location.SymbolDocument): Use full pathnames for the
14771         source files.
14772
14773 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14774
14775         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14776         of the expression resolve mechanism, because that will catch the
14777         SimpleName error failures.
14778
14779         (Conditional): If we can not resolve the
14780         expression, return, do not crash.
14781
14782 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14783
14784         * cs-tokenizer.cs:
14785         (location): display token name instead of its number.
14786
14787 2002-08-28  Martin Baulig  <martin@gnome.org>
14788
14789         * expression.cs (Binary.ResolveOperator): Don't silently return
14790         but return an error if an operator cannot be applied between two
14791         enum types.
14792
14793 2002-08-28  Martin Baulig  <martin@gnome.org>
14794
14795         * class.cs (Constructor.Define): Set the permission attributes
14796         correctly instead of making all constructors public.
14797
14798 2002-08-28  Martin Baulig  <martin@gnome.org>
14799
14800         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14801         for private members before reporting a CS0103; if we find anything,
14802         it's a CS0122.
14803
14804 2002-08-28  Martin Baulig  <martin@gnome.org>
14805
14806         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14807         to check whether `closure_start_type == closure_invocation_type',
14808         we also need to check whether `m.DeclaringType == closure_invocation_type'
14809         before bypassing the permission checks.  We might be accessing
14810         protected/private members from the base class.
14811         (TypeManager.RealMemberLookup): Only set private_ok if private
14812         members were requested via BindingFlags.NonPublic.
14813
14814         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14815
14816         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14817         MethodGroupExpr.IsExplicitImpl if appropriate.
14818         (Invocation.DoResolve): Don't report the CS0120 for explicit
14819         interface implementations.
14820
14821 2002-08-27  Martin Baulig  <martin@gnome.org>
14822
14823         * expression.cs (Invocation.DoResolve): If this is a static
14824         method and we don't have an InstanceExpression, we must report
14825         a CS0120.
14826
14827 2002-08-25  Martin Baulig  <martin@gnome.org>
14828
14829         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14830         `==' between a valuetype and an object.
14831
14832 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14833
14834         * ecore.cs (TypeExpr): Provide a ToString method.
14835
14836 2002-08-24  Martin Baulig  <martin@gnome.org>
14837
14838         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14839         now called proggie.dbg and it's a binary file.
14840
14841 2002-08-23  Martin Baulig  <martin@gnome.org>
14842
14843         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14844
14845 2002-08-23  Martin Baulig  <martin@gnome.org>
14846
14847         * struct.cs (MyStructInfo.ctor): Make this work with empty
14848         structs; it's not allowed to use foreach() on null.
14849
14850 2002-08-23  Martin Baulig  <martin@gnome.org>
14851
14852         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14853         writer the full pathname of the generated assembly.
14854
14855 2002-08-23  Martin Baulig  <martin@gnome.org>
14856
14857         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14858         A `finally' block never returns or breaks; improved handling of
14859         unreachable code.
14860
14861 2002-08-23  Martin Baulig  <martin@gnome.org>
14862
14863         * statement.cs (Throw.Resolve): Allow `throw null'.
14864
14865 2002-08-23  Martin Baulig  <martin@gnome.org>
14866
14867         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14868         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14869         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
14870         MemberLookup would return a wrong event if this is an explicit
14871         interface implementation and the class has an event with the same
14872         name.
14873
14874 2002-08-23  Martin Baulig  <martin@gnome.org>
14875
14876         * statement.cs (Block.AddChildVariableNames): New public method.
14877         (Block.AddChildVariableName): Likewise.
14878         (Block.IsVariableNameUsedInChildBlock): Likewise.
14879         (Block.AddVariable): Check whether a variable name has already
14880         been used in a child block.
14881
14882         * cs-parser.jay (declare_local_variables): Mark all variable names
14883         from the current block as being used in a child block in the
14884         implicit block.
14885
14886 2002-08-23  Martin Baulig  <martin@gnome.org>
14887
14888         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14889         find the symbol writer.
14890
14891         * driver.cs: csc also allows the arguments to /define being
14892         separated by commas, not only by semicolons.
14893
14894 2002-08-23  Martin Baulig  <martin@gnome.org>
14895
14896         * interface.cs (Interface.GetMembers): Added static check for events.
14897
14898 2002-08-15  Martin Baulig  <martin@gnome.org>
14899
14900         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14901         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14902
14903         * ecore.cs (Expression.MemberLookup): Added documentation and explained
14904         why the MethodData.EmitDestructor() change was necessary.
14905
14906 2002-08-20  Martin Baulig  <martin@gnome.org>
14907
14908         * class.cs (TypeContainer.FindMembers): Added static check for events.
14909
14910         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14911
14912         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14913         use Type.GetEvents(), not Type.FindMembers().
14914
14915 2002-08-20  Martin Baulig  <martin@gnome.org>
14916
14917         * decl.cs (MemberCache): Added a special method cache which will
14918         be used for method-only searched.  This ensures that a method
14919         search will return a MethodInfo with the correct ReflectedType for
14920         inherited methods.      
14921
14922 2002-08-20  Martin Baulig  <martin@gnome.org>
14923
14924         * decl.cs (DeclSpace.FindMembers): Made this public.
14925
14926 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14927
14928         * delegate.cs: fixed build on windows.
14929         [FIXME:  Filed as bug #29150: MCS must report these errors.]
14930
14931 2002-08-19  Ravi Pratap  <ravi@ximian.com>
14932
14933         * ecore.cs (StandardConversionExists): Return a false
14934         if we are trying to convert the void type to anything else
14935         since that is not allowed.
14936
14937         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14938         we flag error 70 in the event an event is trying to be accessed
14939         directly from outside the declaring type.
14940
14941 2002-08-20  Martin Baulig  <martin@gnome.org>
14942
14943         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14944         MemberCache from typemanager.cs to decl.cs.
14945
14946 2002-08-19  Martin Baulig  <martin@gnome.org>
14947
14948         * class.cs (TypeContainer): Implement IMemberContainer.
14949         (TypeContainer.DefineMembers): Create the MemberCache.
14950         (TypeContainer.FindMembers): Do better BindingFlags checking; only
14951         return public members if BindingFlags.Public was given, check
14952         whether members are static.
14953
14954 2002-08-16  Martin Baulig  <martin@gnome.org>
14955
14956         * decl.cs (DeclSpace.Define): Splitted this in Define and
14957         DefineMembers.  DefineMembers is called first and initializes the
14958         MemberCache.
14959
14960         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
14961         DefineMembers() on all our DeclSpaces.
14962
14963         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14964         but call DefineMembers() on all nested interfaces.  We call their
14965         Define() in our new Define() function.
14966
14967         * interface.cs (Interface): Implement IMemberContainer.
14968         (Interface.Define): Moved all code except the attribute stuf to
14969         DefineMembers().
14970         (Interface.DefineMembers): Initialize the member cache.
14971
14972         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14973         need this anymore since we can use MemberCache.FindMembers directly.
14974
14975 2002-08-19  Martin Baulig  <martin@gnome.org>
14976
14977         * typemanager.cs (MemberCache): When creating the cache for an
14978         interface type, add all inherited members.
14979         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14980         to `out bool used_cache' and documented it.
14981         (TypeManager.MemberLookup): If we already used the cache in the first
14982         iteration, we don't need to do the interfaces check.
14983
14984 2002-08-19  Martin Baulig  <martin@gnome.org>
14985
14986         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14987         here from IMemberFinder and don't implement this interface anymore.
14988         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14989
14990         * typemanager.cs (IMemberFinder): This interface is now only used by
14991         classes which actually support the member cache.
14992         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14993         since we only put DeclSpaces into this Hashtable.
14994         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14995         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14996
14997 2002-08-16  Martin Baulig  <martin@gnome.org>
14998
14999         * typemanager.cs (ICachingMemberFinder): Removed.
15000         (IMemberFinder.MemberCache): New property.
15001         (TypeManager.FindMembers): Merged this with RealFindMembers().
15002         This function will never be called from TypeManager.MemberLookup()
15003         so we can't use the cache here, just the IMemberFinder.
15004         (TypeManager.MemberLookup_FindMembers): Check whether the
15005         IMemberFinder has a MemberCache and call the cache's FindMembers
15006         function.
15007         (MemberCache): Rewrote larger parts of this yet another time and
15008         cleaned it up a bit.
15009
15010 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15011
15012         * driver.cs (LoadArgs): Support quoting.
15013
15014         (Usage): Show the CSC-like command line arguments.
15015
15016         Improved a few error messages.
15017
15018 2002-08-15  Martin Baulig  <martin@gnome.org>
15019
15020         * typemanager.cs (IMemberContainer.Type): New property.
15021         (IMemberContainer.IsInterface): New property.
15022
15023         The following changes are conditional to BROKEN_RUNTIME, which is
15024         defined at the top of the file.
15025
15026         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15027         class'es members, but add all members from TypeHandle.ObjectType
15028         if we're an interface.
15029         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15030         is the current type.
15031         (MemberCache.CacheEntry.Container): Removed this field.
15032         (TypeHandle.GetMembers): Include inherited members.
15033
15034 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15035
15036         * typemanager.cs: fixed compilation and added a comment on a field that
15037         is never used.
15038
15039 2002-08-15  Martin Baulig  <martin@gnome.org>
15040
15041         * class.cs (ConstructorInitializer.Resolve): In the
15042         Expression.MemberLookup call, use the queried_type as
15043         invocation_type.
15044
15045         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15046         declared' attribute, it's always true.
15047         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15048         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15049         temporary wrapper for FindMembers which tells MemberLookup whether
15050         members from the base classes are included in the return value.
15051         This will go away soon.
15052         (TypeManager.MemberLookup): Use this temporary hack here; once the
15053         new MemberCache is completed, we don't need to do the DeclaredOnly
15054         looping here anymore since the MemberCache will take care of this.
15055         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15056         (MemberCache): When creating the MemberCache for a class, get
15057         members from the current class and all its base classes.
15058         (MemberCache.CacheEntry.Container): New field.  This is a
15059         temporary hack until the Mono runtime is fixed to distinguish
15060         between ReflectedType and DeclaringType.  It allows us to use MCS
15061         with both the MS runtime and the unfixed Mono runtime without
15062         problems and without accecting performance.
15063         (MemberCache.SearchMembers): The DeclaredOnly looping from
15064         TypeManager.MemberLookup is now done here.      
15065
15066 2002-08-14  Martin Baulig  <martin@gnome.org>
15067
15068         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15069         Type.GetFields on dynamic types but get the fields from the
15070         corresponding TypeContainer.
15071         (MyStructInfo.GetStructInfo): Added check for enum types.
15072
15073         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15074         (MemberList.SyncRoot): Implemented.
15075         (TypeManager.FilterWithClosure): No need to check permissions if
15076         closure_start_type == closure_invocation_type, don't crash if
15077         closure_invocation_type is null.
15078
15079 2002-08-13  Martin Baulig  <martin@gnome.org>
15080
15081         Rewrote TypeContainer.FindMembers to use a member cache.  This
15082         gives us a speed increase of about 35% for the self-hosting MCS
15083         build and of about 15-20% for the class libs (both on GNU/Linux).
15084
15085         * report.cs (Timer): New class to get enhanced profiling.  This
15086         whole class is "TIMER" conditional since it remarkably slows down
15087         compilation speed.
15088
15089         * class.cs (MemberList): New class.  This is an IList wrapper
15090         which we're now using instead of passing MemberInfo[]'s around to
15091         avoid copying this array unnecessarily.
15092         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15093         (ICachingMemberFinder, IMemberContainer): New interface.
15094         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15095         has already been checked, otherwise use it for the name comparision.
15096         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15097         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15098         if possible.  Returns a MemberList, not a MemberInfo [].
15099         (TypeHandle): New class, implements IMemberContainer.  We create
15100         one instance of this class per type, it contains a MemberCache
15101         which is used to do the member lookups.
15102         (MemberCache): New class.  Each instance of this class contains
15103         all members of a type and a name-based hash table.
15104         (MemberCache.FindMembers): This is our new member lookup
15105         function.  First, it looks up all members of the requested name in
15106         the hash table.  Then, it walks this list and sorts out all
15107         applicable members and returns them.
15108
15109 2002-08-13  Martin Baulig  <martin@gnome.org>
15110
15111         In addition to a nice code cleanup, this gives us a performance
15112         increase of about 1.4% on GNU/Linux - not much, but it's already
15113         half a second for the self-hosting MCS compilation.
15114
15115         * typemanager.cs (IMemberFinder): New interface.  It is used by
15116         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15117         Enum, Delegate or Interface.
15118         (TypeManager.finder_to_member_finder): New PtrHashtable.
15119         (TypeManager.finder_to_container): Removed.
15120         (TypeManager.finder_to_delegate): Removed.
15121         (TypeManager.finder_to_interface): Removed.
15122         (TypeManager.finder_to_enum): Removed.
15123
15124         * interface.cs (Interface): Implement IMemberFinder.
15125
15126         * delegate.cs (Delegate): Implement IMemberFinder.
15127
15128         * enum.cs (Enum): Implement IMemberFinder.
15129
15130         * class.cs (TypeContainer): Implement IMemberFinder.
15131
15132 2002-08-12  Martin Baulig  <martin@gnome.org>
15133
15134         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15135
15136 2002-08-12  Martin Baulig  <martin@gnome.org>
15137
15138         * ecore.cs (ITypeExpression): New interface for expressions which
15139         resolve to a type.
15140         (TypeExpression): Renamed to TypeLookupExpression.
15141         (Expression.DoResolve): If we're doing a types-only lookup, the
15142         expression must implement the ITypeExpression interface and we
15143         call DoResolveType() on it.
15144         (SimpleName): Implement the new ITypeExpression interface.
15145         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15146         hack, the situation that we're only looking up types can't happen
15147         anymore when this method is called.  Moved the type lookup code to
15148         DoResolveType() and call it.
15149         (SimpleName.DoResolveType): This ITypeExpression interface method
15150         is now doing the types-only lookup.
15151         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15152         (ResolveFlags): Added MaskExprClass.
15153
15154         * expression.cs (MemberAccess): Implement the ITypeExpression
15155         interface.
15156         (MemberAccess.DoResolve): Added support for a types-only lookup
15157         when we're called via ITypeExpression.DoResolveType().
15158         (ComposedCast): Implement the ITypeExpression interface.
15159
15160         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15161         Expression.Resolve() with ResolveFlags.Type instead.
15162
15163 2002-08-12  Martin Baulig  <martin@gnome.org>
15164
15165         * interface.cs (Interface.Define): Apply attributes.
15166
15167         * attribute.cs (Attribute.ApplyAttributes): Added support for
15168         interface attributes.
15169
15170 2002-08-11  Martin Baulig  <martin@gnome.org>
15171
15172         * statement.cs (Block.Emit): Only check the "this" variable if we
15173         do not always throw an exception.
15174
15175         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15176         whether the property has a set accessor.
15177
15178 2002-08-11  Martin Baulig  <martin@gnome.org>
15179
15180         Added control flow analysis support for structs.
15181
15182         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15183         with control flow analysis turned off.
15184         (IVariable): New interface.
15185         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15186         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15187         (FieldExpr.DoResolve): Resolve the instance expression with flow
15188         analysis turned off and do the definite assignment check after the
15189         resolving when we know what the expression will resolve to.
15190
15191         * expression.cs (LocalVariableReference, ParameterReference):
15192         Implement the new IVariable interface, only call the flow analysis
15193         code if ec.DoFlowAnalysis is true.
15194         (This): Added constructor which takes a Block argument.  Implement
15195         the new IVariable interface.
15196         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15197         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15198         This does the definite assignment checks for struct members.
15199
15200         * class.cs (Constructor.Emit): If this is a non-static `struct'
15201         constructor which doesn't have any initializer, call
15202         Block.AddThisVariable() to tell the flow analysis code that all
15203         struct elements must be initialized before control returns from
15204         the constructor.
15205
15206         * statement.cs (MyStructInfo): New public class.
15207         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15208         argument to this indexer.  If non-zero, check an individual struct
15209         member, not the whole struct.
15210         (FlowBranching.CheckOutParameters): Check struct members.
15211         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15212         overloaded versions of these methods which take an additional
15213         `int field_idx' argument to check struct members.
15214         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15215         overloaded versions of these methods which take an additional
15216         `string field_name' argument to check struct member.s
15217         (VariableInfo): Implement the IVariable interface.
15218         (VariableInfo.StructInfo): New public property.  Returns the
15219         MyStructInfo instance of the variable if it's a struct or null.
15220         (Block.AddThisVariable): New public method.  This is called from
15221         Constructor.Emit() for non-static `struct' constructor which do
15222         not have any initializer.  It creates a special variable for the
15223         "this" instance variable which will be checked by the flow
15224         analysis code to ensure that all of the struct's fields are
15225         initialized before control returns from the constructor.
15226         (UsageVector): Added support for struct members.  If a
15227         variable/parameter is a struct with N members, we reserve a slot
15228         in the usage vector for each member.  A struct is considered fully
15229         initialized if either the struct itself (slot 0) or all its
15230         members are initialized.
15231
15232 2002-08-08  Martin Baulig  <martin@gnome.org>
15233
15234         * driver.cs (Driver.MainDriver): Only report an error CS5001
15235         if there were no compilation errors.
15236
15237         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15238         `UnsafeContext' property to determine whether the parent is in
15239         unsafe context rather than checking the parent's ModFlags:
15240         classes nested in an unsafe class are unsafe as well.
15241
15242 2002-08-08  Martin Baulig  <martin@gnome.org>
15243
15244         * statement.cs (UsageVector.MergeChildren): Distinguish between
15245         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15246         we return.  Added test17() and test18() to test-154.cs.
15247
15248 2002-08-08  Martin Baulig  <martin@gnome.org>
15249
15250         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15251         Family access, make sure the invoking type isn't a subclass of the
15252         queried type (that'd be a CS1540).
15253
15254         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15255         this method which takes an additional `Type invocation_type'.
15256
15257         * expression.cs (BaseAccess.DoResolve): Use the base type as
15258         invocation and query type.
15259         (MemberAccess.DoResolve): If the lookup failed and we're about to
15260         report a CS0122, try a lookup with the ec.ContainerType - if this
15261         succeeds, we must report a CS1540.
15262
15263 2002-08-08  Martin Baulig  <martin@gnome.org>
15264
15265         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15266         (MethodGroupExpr): Implement the IMemberExpr interface.
15267
15268         * expression (MemberAccess.ResolveMemberAccess): No need to have
15269         any special code for MethodGroupExprs anymore, they're now
15270         IMemberExprs.   
15271
15272 2002-08-08  Martin Baulig  <martin@gnome.org>
15273
15274         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15275         Family, FamANDAssem and FamORAssem permissions.
15276         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15277
15278 2002-08-08  Martin Baulig  <martin@gnome.org>
15279
15280         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15281         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15282         or loop block.
15283
15284 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15285
15286         * driver.cs: implemented /resource option to embed managed resources.
15287
15288 2002-08-07  Martin Baulig  <martin@gnome.org>
15289
15290         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15291         (FieldBase.HasFieldInitializer): New public property.
15292         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15293         returns the field initializer and makes sure it is only resolved once.
15294         (TypeContainer.EmitFieldInitializers): Call
15295         FieldBase.GetInitializerExpression to get the initializer, this ensures
15296         that it isn't resolved multiple times.
15297
15298         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15299         the resolving process (SimpleName/MemberLookup) that we're currently
15300         emitting a field initializer (which must not access any instance members,
15301         this is an error CS0236).
15302
15303         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15304         argument, if the `IsFieldInitializer' flag is set, we must report and
15305         error CS0236 and not an error CS0120.   
15306
15307 2002-08-07  Martin Baulig  <martin@gnome.org>
15308
15309         * ecore.cs (IMemberExpr): New public interface.
15310         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15311         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15312         if the expression is an IMemberExpr.
15313
15314         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15315         to be null, implicitly default to `this' if we're non-static in
15316         this case.  Simplified the code a lot by using the new IMemberExpr
15317         interface.  Also fixed bug #28176 here.
15318
15319 2002-08-06  Martin Baulig  <martin@gnome.org>
15320
15321         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15322         ParameterReferences during semantic analysis so that we can do a
15323         type-only search when resolving Cast, TypeOf and SizeOf.
15324         (block): Pass the `current_local_parameters' to the Block's
15325         constructor.
15326
15327         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15328         argument to the constructor.
15329         (ConstructorInitializer.Resolve): Create a temporary implicit
15330         block with the parameters.
15331
15332         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15333         references here if we aren't doing a type-only search.
15334
15335         * statement.cs (Block): Added constructor which takes a
15336         `Parameters parameters' argument.
15337         (Block.Parameters): New public property.
15338
15339         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15340         to `Parameters' and made it public readonly.
15341
15342 2002-08-06  Martin Baulig  <martin@gnome.org>
15343
15344         * ecore.cs (Expression.Warning): Made this public as well.
15345
15346         * report.cs (Report.Debug): Print the contents of collections.
15347
15348 2002-08-06  Martin Baulig  <martin@gnome.org>
15349
15350         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15351         used to tell Resolve() which kinds of expressions it may return.
15352         (Expression.Resolve): Added overloaded version of this method which
15353         takes a `ResolveFlags flags' argument.  This can be used to tell
15354         Resolve() which kinds of expressions it may return.  Reports a
15355         CS0118 on error.
15356         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15357         ResolveFlags.SimpleName.
15358         (Expression.Error118): Added overloaded version of this method which
15359         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15360         which kinds of expressions are allowed.
15361
15362         * expression.cs (Argument.ResolveMethodGroup): New public method.
15363         Resolves an argument, but allows a MethodGroup to be returned.
15364         This is used when invoking a delegate.
15365
15366         * TODO: Updated a bit.
15367
15368 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15369
15370         Fixed compilation with csc.
15371
15372         * ecore.cs: Expression.Error made public. Is this correct? Should
15373         Warning be made public too?
15374
15375         * expression.cs: use ea.Location instead of ea.loc.
15376         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15377
15378 2002-08-06  Martin Baulig  <martin@gnome.org>
15379
15380         * ecore.cs (Expression.loc): Moved the location here instead of
15381         duplicating it in all derived classes.
15382         (Expression.Location): New public property.
15383         (Expression.Error, Expression.Warning): Made them non-static and
15384         removed the location argument.
15385         (Expression.Warning): Added overloaded version which takes an
15386         `int level' argument.
15387         (Expression.Error118): Make this non-static and removed the
15388         expression and location arguments.
15389         (TypeExpr): Added location argument to the constructor.
15390
15391         * expression.cs (StaticCallExpr): Added location argument to
15392         the constructor.
15393         (Indirection, PointerArithmetic): Likewise.
15394         (CheckedExpr, UnCheckedExpr): Likewise.
15395         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15396         (StringPtr): Likewise.
15397
15398
15399 2002-08-05  Martin Baulig  <martin@gnome.org>
15400
15401         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15402
15403         * assign.cs (Assign.DoResolve): Check whether the source
15404         expression is a value or variable.
15405
15406         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15407         while resolving the corresponding blocks.
15408
15409         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15410         an error, don't silently return null.
15411
15412         * statement.cs (Block.AddVariable): Do the error reporting here
15413         and distinguish between CS0128 and CS0136.
15414         (Block.DoResolve): Report all unused labels (warning CS0164).
15415         (LabeledStatement): Pass the location to the constructor.
15416         (LabeledStatement.HasBeenReferenced): New property.
15417         (LabeledStatement.Resolve): Set it to true here.
15418
15419         * statement.cs (Return.Emit): Return success even after reporting
15420         a type mismatch error (CS0126 or CS0127), this is what csc does and
15421         it avoids confusing the users with any consecutive errors.
15422
15423 2002-08-05  Martin Baulig  <martin@gnome.org>
15424
15425         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15426
15427         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15428
15429         * expression.cs (MemberAccess.DoResolve): Silently return if an
15430         error has already been reported.
15431
15432         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15433         error has already been reported.
15434
15435 2002-08-05  Martin Baulig  <martin@gnome.org>
15436
15437         * statement.cs (UsageVector): Only initialize the `parameters'
15438         vector if we actually have any "out" parameters.
15439
15440 2002-08-05  Martin Baulig  <martin@gnome.org>
15441
15442         * expression.cs (Binary.ResolveOperator): When combining delegates,
15443         they must have the same type.
15444
15445 2002-08-05  Martin Baulig  <martin@gnome.org>
15446
15447         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15448         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15449         work with the ms runtime and we also don't need it: if we're a
15450         PropertyBuilder and not in the `indexer_arguments' hash, then we
15451         are a property and not an indexer.
15452
15453         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15454         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15455         since the latter one doesn't work with the ms runtime.
15456
15457 2002-08-03  Martin Baulig  <martin@gnome.org>
15458
15459         Fixed bugs #27998 and #22735.
15460
15461         * class.cs (Method.IsOperator): New public field.
15462         (Method.CheckBase): Report CS0111 if there's already a method
15463         with the same parameters in the current class.  Report CS0508 when
15464         attempting to change the return type of an inherited method.
15465         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15466         and it's not marked abstract or extern.
15467         (PropertyBase): New abstract base class for Property and Indexer.
15468         (PropertyBase.CheckBase): Moved here from Property and made it work
15469         for indexers.
15470         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15471         the same so we can reuse it there.
15472         (Property, Indexer): Derive from PropertyBase.
15473         (MethodSignature.inheritable_property_signature_filter): New delegate
15474         to find properties and indexers.
15475
15476         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15477         argument and improved error reporting.
15478
15479         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15480         EmptyReadOnlyParameters and made it a property.
15481
15482         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15483         version of this method which takes a `PropertyInfo indexer'.
15484         (TypeManager.RegisterIndexer): New method.
15485
15486         * class.cs: Added myself as author of this file :-)
15487
15488 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15489
15490         * class.cs: fixed compilation on windoze.
15491
15492 2002-08-03  Martin Baulig  <martin@gnome.org>
15493
15494         * interface.cs (Interface.GetInterfaceBases): Check whether all
15495         base interfaces are at least as accessible than the current one.
15496
15497         * class.cs (TypeContainer.GetClassBases): Check whether base types
15498         are at least as accessible than the current type.
15499         (TypeContainer.AsAccessible): Implemented and made non-static.
15500         (MemberBase.CheckParameters): Report errors if the accessibility
15501         checks fail.
15502
15503         * delegate.cs (Delegate.Delegate): The default visibility is
15504         internal for top-level types and private for nested types.
15505         (Delegate.Define): Report errors if the accessibility checks fail.
15506
15507         * enum.cs (Enum.Enum): The default visibility is internal for
15508         top-level types and private for nested types.
15509         (Enum.DefineType): Compute the correct visibility.
15510
15511         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15512         function which takes a `bool is_toplevel' instead of a TypeContainer.
15513
15514         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15515         builtin type.
15516
15517 2002-08-02  Martin Baulig  <martin@gnome.org>
15518
15519         * expression.cs (LocalVariableReferenc): Added constructor which
15520         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15521         (LocalVariableReference.IsReadOnly): New property.
15522         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15523         variable is readonly, use our own readonly flag to do this; you can
15524         use the new constructor to get a writable reference to a read-only
15525         variable.
15526
15527         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15528         reference to the local variable.
15529
15530 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15531
15532         * rootcontext.cs (ResolveCore): Also include System.Exception
15533
15534         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15535         we reach an EmptyStatement.
15536
15537         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15538         is also fine.
15539
15540         * expression.cs (Binary.ResolveOperator): Check error result in
15541         two places.
15542
15543         use brtrue/brfalse directly and avoid compares to null.
15544
15545 2002-08-02  Martin Baulig  <martin@gnome.org>
15546
15547         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15548         Fixes bug #28407, added test-155.cs.
15549
15550 2002-08-01  Martin Baulig  <martin@gnome.org>
15551
15552         * class.cs (Event.EmitDefaultMethod): Make this work with static
15553         events.  Fixes #28311, added verify-3.cs.
15554
15555 2002-08-01  Martin Baulig  <martin@gnome.org>
15556
15557         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15558         `is_disposable' fields.
15559         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15560         `hm.is_disposable' if we're using the collection pattern.
15561         (Foreach.EmitCollectionForeach): Use the correct type for the
15562         enumerator's local variable, only emit the try/finally block if
15563         necessary (fixes #27713).
15564
15565 2002-08-01  Martin Baulig  <martin@gnome.org>
15566
15567         * ecore.cs (Expression.report118): Renamed to Error118 and made
15568         it public static.
15569
15570         * statement.cs (Throw.Resolve): Check whether the expression is of
15571         the correct type (CS0118) and whether the type derives from
15572         System.Exception (CS0155).
15573         (Catch.Resolve): New method.  Do the type lookup here and check
15574         whether it derives from System.Exception (CS0155).
15575         (Catch.CatchType, Catch.IsGeneral): New public properties.
15576
15577         * typemanager.cs (TypeManager.exception_type): Added.
15578
15579 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15580
15581         * driver.cs: Updated About function.
15582
15583 2002-07-31  Martin Baulig  <martin@gnome.org>
15584
15585         Implemented Control Flow Analysis.
15586
15587         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15588         (EmitContext.CurrentBranching): Added.
15589         (EmitContext.StartFlowBranching): Added.
15590         (EmitContext.EndFlowBranching): Added.
15591         (EmitContext.KillFlowBranching): Added.
15592         (EmitContext.IsVariableAssigned): Added.
15593         (EmitContext.SetVariableAssigned): Added.
15594         (EmitContext.IsParameterAssigned): Added.
15595         (EmitContext.SetParameterAssigned): Added.
15596         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15597         Added control flow analysis stuff here.
15598
15599         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15600         resolve the expression as lvalue.
15601         (LocalVariableReference.DoResolve): Check whether the variable has
15602         already been assigned.
15603         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15604         the parameter as assigned here.
15605         (ParameterReference.DoResolve): Check whether the parameter has already
15606         been assigned.
15607         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15608         expression as lvalue.
15609
15610         * statement.cs (FlowBranching): New class for the flow analysis code.
15611         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15612         (LabeledStatement.IsDefined): New public property.
15613         (LabeledStatement.AddUsageVector): New public method to tell flow
15614         analyis that the label may be reached via a forward jump.
15615         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15616         flow analysis.
15617         (VariableInfo.Number): New public field.  This is used by flow analysis
15618         to number all locals of a block.
15619         (Block.CountVariables): New public property.  This is the number of
15620         local variables in this block (including the locals from all parent
15621         blocks).
15622         (Block.EmitMeta): Number all the variables.
15623
15624         * statement.cs: Added flow analysis support to all classes.
15625
15626 2002-07-31  Martin Baulig  <martin@gnome.org>
15627
15628         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15629         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15630         then use this argument.
15631
15632         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15633
15634         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15635         use this to specify /define options.
15636
15637 2002-07-29  Martin Baulig  <martin@gnome.org>
15638
15639         * statement.cs (Fixed): Moved all code that does variable lookups
15640         and resolvings from Emit to Resolve.
15641
15642         * statement.cs (For): Moved all code that does variable lookups
15643         and resolvings from Emit to Resolve.
15644
15645         * statement.cs (Using): Moved all code that does variable lookups
15646         and resolvings from Emit to Resolve.
15647
15648 2002-07-29  Martin Baulig  <martin@gnome.org>
15649
15650         * attribute.cs (Attribute.Resolve): Explicitly catch a
15651         System.NullReferenceException when creating the
15652         CustromAttributeBuilder and report a different warning message.
15653
15654 2002-07-29  Martin Baulig  <martin@gnome.org>
15655
15656         * support.cs (ParameterData.ParameterName): Added method to
15657         get the name of a parameter.
15658
15659         * typemanager.cs (TypeManager.IsValueType): New public method.
15660
15661 2002-07-29  Martin Baulig  <martin@gnome.org>
15662
15663         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15664         is a flag which specifies that it's either ref or out.
15665         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15666         the out parameter to `out Parameter.Modifier mod', also set the
15667         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15668
15669         * support.cs (InternalParameters.ParameterModifier): Distinguish
15670         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15671         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15672
15673         * expression.cs (Argument.GetParameterModifier): Distinguish
15674         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15675         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15676
15677 2002-07-29  Martin Baulig  <martin@gnome.org>
15678
15679         * expression.cs (ParameterReference.ParameterReference): Added
15680         `Location loc' argument to the constructor.
15681
15682         * cs-parser.jay: Pass location to ParameterReference.
15683
15684 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15685
15686         * statement.cs (Try): Initialize the location.
15687
15688         * cs-parser.jay: pass location to Try.
15689
15690         * expression.cs (Unary.Reduce): Change the prototype to return
15691         whether a constant fold could be performed or not.  The result is
15692         returned in an out parameters.  In the case of Indirection and
15693         AddressOf, we want to perform the full tests.
15694
15695 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15696
15697         * statement.cs (Statement.Emit): Flag dead code.
15698
15699 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15700
15701         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15702
15703 2002-07-27  Martin Baulig  <martin@gnome.org>
15704
15705         * class.cs (MethodData.Define): Put back call to
15706         TypeManager.AddMethod(), accidentally commented this out.
15707
15708         * report.cs (Debug): New public method to print debugging information,
15709         this is `[Conditional ("DEBUG")]'.
15710
15711 2002-07-26  Martin Baulig  <martin@gnome.org>
15712
15713         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15714         (switch_statement): Push the current_block to the switch_stack and
15715         pop it again when we're done with the switch.
15716         (switch_section): The new block is a child of the current_block.
15717         Fixes bug #24007, added test-152.cs.
15718
15719 2002-07-27  Martin Baulig  <martin@gnome.org>
15720
15721         * expression.cs (Invocation.EmitArguments): When calling a varargs
15722         function with only its fixed arguments, we need to pass an empty
15723         array.
15724
15725 2002-07-27  Martin Baulig  <martin@gnome.org>
15726
15727         Mono 0.13 has been released.
15728
15729 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15730
15731         * driver.cs: Rename --resource to --linkres, because that is what
15732         we do currently, we dont support --resource yet.
15733
15734         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15735
15736 2002-07-25  Martin Baulig  <martin@gnome.org>
15737
15738         * class.cs (MethodData): New public class.  This is a `method builder'
15739         class for a method or one accessor of a Property/Indexer/Event.
15740         (MethodData.GetMethodFlags): Moved here from MemberBase.
15741         (MethodData.ApplyAttributes): Likewise.
15742         (MethodData.ApplyObsoleteAttribute): Likewise.
15743         (MethodData.ApplyConditionalAttribute): Likewise.
15744         (MethodData.ApplyDllImportAttribute): Likewise.
15745         (MethodData.CheckAbstractAndExternal): Likewise.
15746         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15747         (MethodData.Emit): Formerly known as Method.Emit().
15748         (MemberBase): Moved everything which was specific to a single
15749         accessor/method to MethodData.
15750         (Method): Create a new MethodData and call Define() and Emit() on it.
15751         (Property, Indexer, Event): Create a new MethodData objects for each
15752         accessor and call Define() and Emit() on them.
15753
15754 2002-07-25  Martin Baulig  <martin@gnome.org>
15755
15756         Made MethodCore derive from MemberBase to reuse the code from there.
15757         MemberBase now also checks for attributes.
15758
15759         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15760         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15761         as virtual.
15762         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15763         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15764         (MemberBase.ApplyAttributes): New virtual method; applies the
15765         attributes to a method or accessor.
15766         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15767         (MemberBase.ApplyConditionalAttribute): Likewise.
15768         (MemberBase.ApplyDllImportAttribute): Likewise.
15769         (MemberBase.CheckAbstractAndExternal): Likewise.
15770         (MethodCore.ParameterTypes): This is now a property instead of a
15771         method, it's initialized from DoDefineParameters().
15772         (MethodCore.ParameterInfo): Removed the set accessor.
15773         (MethodCore.DoDefineParameters): New protected virtual method to
15774         initialize ParameterTypes and ParameterInfo.
15775         (Method.GetReturnType): We can now simply return the MemberType.
15776         (Method.GetMethodFlags): Override the MemberBase version and add
15777         the conditional flags.
15778         (Method.CheckBase): Moved some code from Define() here, call
15779         DoDefineParameters() here.
15780         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15781         here to avoid some larger code duplication.
15782         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15783         ensure that abstract and external accessors don't declare a body.
15784
15785         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15786         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15787         lookup in the attribute's parent classes, so we need to abort as soon
15788         as we found the first match.
15789         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15790         the attribute has no arguments.
15791
15792         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15793         of a Method.
15794
15795 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15796
15797         * cs-parser.jay: reverted previous patch.
15798
15799 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15800
15801         * cs-parser.jay: fixed bug #22119.
15802
15803 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15804
15805         * attribute.cs: fixed compilation. The error was:
15806         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15807         be assigned to before control leaves the current method."
15808         [FIXME:  Filed as bug #28186: MCS must report this error.]
15809
15810 2002-07-25  Martin Baulig  <martin@gnome.org>
15811
15812         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15813         method to pull the condition name ouf of a Conditional attribute.
15814         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15815         the obsolete message and error flag out of an Obsolete attribute.
15816
15817         * class.cs (Method.GetMethodFlags): New public method to get the
15818         TypeManager.MethodFlags for this method.
15819         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15820         private methods.
15821         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15822         if we're overriding a virtual function, set the new private variable
15823         `parent_method'; call the new TypeManager.AddMethod().
15824
15825         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15826         the MethodBuilder and the Method in a PtrHashtable.
15827         (TypeManager.builder_to_method): Added for this purpose.
15828         (TypeManager.MethodFlags): Added IsObsoleteError.
15829         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15830         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15831         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15832         the message from the attribute.
15833
15834 2002-07-24  Martin Baulig  <martin@gnome.org>
15835
15836         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15837         preprocessor directives, ensure that the argument to #define/#undef is
15838         exactly one identifier and that it's actually an identifier.
15839
15840         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15841         did not work ....
15842
15843 2002-07-24  Martin Baulig  <martin@gnome.org>
15844
15845         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15846         initialize it to TypeManager.object_type in the constructor.
15847         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15848         of the `hm.get_current' method if we're using the collection pattern.
15849         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15850         for the explicit conversion to make it work when we're using the collection
15851         pattern and the `Current' property has a different return type than `object'.
15852         Fixes #27713.
15853
15854 2002-07-24  Martin Baulig  <martin@gnome.org>
15855
15856         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15857         does not match, but don't report any errors.  This method is called in
15858         order for all methods in a MethodGroupExpr until a matching method is
15859         found, so we don't want to bail out if the first method doesn't match.
15860         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15861         matches, report the 123.  Fixes #28070.
15862
15863 2002-07-24  Martin Baulig  <martin@gnome.org>
15864
15865         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15866         TypeManager.TypeToCoreType() to the top of the method so the
15867         following equality checks will work.  Fixes #28107.
15868
15869 2002-07-24  Martin Baulig  <martin@gnome.org>
15870
15871         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15872         operand is of type uint, and the other operand is of type sbyte,
15873         short or int, the operands are converted to type long." -
15874         Actually do what this comment already told us.  Fixes bug #28106,
15875         added test-150.cs.
15876
15877 2002-07-24  Martin Baulig  <martin@gnome.org>
15878
15879         * class.cs (MethodBase): New abstract class.  This is now a base
15880         class for Property, Indexer and Event to avoid some code duplication
15881         in their Define() and DefineMethods() methods.
15882         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15883         generic methods for Define() and DefineMethods().
15884         (FieldBase): Derive from MemberBase, not MemberCore.
15885         (Property): Derive from MemberBase, not MemberCore.
15886         (Property.DefineMethod): Moved all the code from this method to the
15887         new MethodBase.DefineAccessor(), just call it with appropriate
15888         argumetnts.
15889         (Property.Define): Call the new Property.DoDefine(), this does some
15890         sanity checks and we don't need to duplicate the code everywhere.
15891         (Event): Derive from MemberBase, not MemberCore.
15892         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15893         accessors, this will also make them work with interface events.
15894         (Indexer): Derive from MemberBase, not MemberCore.
15895         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15896         (Indexer.Define): Use the new MethodBase functions.
15897
15898         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15899         argument to the constructor.
15900         (Interface.FindMembers): Added support for interface events.
15901         (Interface.PopluateEvent): Implemented.
15902
15903         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
15904
15905 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
15906
15907         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15908         but this is required to check for a method name being the same as
15909         the containing class.  
15910
15911         Handle this now.
15912
15913 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15914
15915         * interface.cs: initialize variable.
15916
15917 2002-07-23  Martin Baulig  <martin@gnome.org>
15918
15919         Implemented the IndexerName attribute in interfaces.
15920
15921         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15922         name if this is an explicit interface implementation.
15923         (Indexer.InterfaceIndexerName): New public variable.  If we're
15924         implementing an interface indexer, this is the IndexerName in that
15925         interface.  Otherwise, it's the IndexerName.
15926         (Indexer.DefineMethod): If we're implementing interface indexer,
15927         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
15928         and Pending.ImplementIndexer methods.
15929         (Indexer.Define): Also define the PropertyBuilder if we're
15930         implementing an interface indexer and this is neither an explicit
15931         interface implementation nor do the IndexerName match the one in
15932         the interface.
15933
15934         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15935         If a method is defined here, then we always need to create a proxy
15936         for it.  This is used when implementing interface indexers.
15937         (Pending.IsInterfaceIndexer): New public method.
15938         (Pending.ImplementIndexer): New public method.
15939         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15940         This is used when implementing interface indexers to define a proxy
15941         if necessary.
15942         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15943         define a proxy if necessary.
15944
15945         * interface.cs (Interface.IndexerName): New public variable.
15946         (Interface.PopulateIndexer): Set the IndexerName.
15947         (Interface.DefineIndexers): New private method.  Populate all the
15948         indexers and make sure their IndexerNames match.
15949
15950         * typemanager.cs (IndexerPropertyName): Added support for interface
15951         indexers.
15952
15953 2002-07-22  Martin Baulig  <martin@gnome.org>
15954
15955         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15956         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15957         ret if HasReturnLabel.
15958         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15959         variables.
15960
15961         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15962         and set the ec.LoopBeginTryCatchLevel.
15963         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15964         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15965         the current ec.TryCatchLevel, the branch goes out of an exception
15966         block.  In this case, we need to use Leave and not Br.
15967
15968 2002-07-22  Martin Baulig  <martin@gnome.org>
15969
15970         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15971         block unless the block does not always return or it is contained in
15972         another try { ... } catch { ... } block.  Fixes bug #26506.
15973         Added verify-1.cs to the test suite.
15974
15975 2002-07-22  Martin Baulig  <martin@gnome.org>
15976
15977         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15978         then we do not always return.  Fixes bug #24985.
15979
15980 2002-07-22  Martin Baulig  <martin@gnome.org>
15981
15982         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15983         lookup on a per-class level; ie. walk up the class hierarchy until we
15984         found at least one applicable method, then choose the best among them.
15985         Fixes bug #24463 and test-29.cs.
15986
15987 2002-07-22  Martin Baulig  <martin@gnome.org>
15988
15989         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15990         return types of the methods.  The return type is not part of the
15991         signature and we must not check it to make the `new' modifier work.
15992         Fixes bug #27999, also added test-147.cs.
15993         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15994
15995         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15996         on the method's return type.
15997
15998 2002-07-21  Martin Baulig  <martin@gnome.org>
15999
16000         * assign.cs: Make this work if the rightmost source is a constant and
16001         we need to do an implicit type conversion.  Also adding a few more tests
16002         to test-38.cs which should have caught this.
16003
16004         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16005         target in the makefile for this.  The makefile.gnu is primarily intended
16006         for end-users who don't want to debug the compiler.
16007
16008 2002-07-21  Martin Baulig  <martin@gnome.org>
16009
16010         * assign.cs: Improved the Assign class so it can now handle embedded
16011         assignments (X = Y = Z = something).  As a side-effect this'll now also
16012         consume less local variables.  test-38.cs now passes with MCS, added
16013         a few new test cases to that test.
16014
16015 2002-07-20  Martin Baulig  <martin@gnome.org>
16016
16017         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16018         instructions.  Fixes bug #27977, also added test-146.cs.
16019
16020 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16021
16022         * cs-tokenizer.cs: fixed getHex ().
16023
16024 2002-07-19  Martin Baulig  <martin@gnome.org>
16025
16026         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16027         not Type.GetType() to lookup the array type.  This is needed when
16028         we're constructing an array of a user-defined type.
16029         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16030         single-dimensional arrays, but also for single-dimensial arrays of
16031         type decimal.
16032
16033 2002-07-19  Martin Baulig  <martin@gnome.org>
16034
16035         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16036         this function is called, it's not allowed to share LocalBuilders
16037         among ILGenerators.
16038
16039 2002-07-19  Martin Baulig  <martin@gnome.org>
16040
16041         * expression.cs (Argument.Resolve): Report an error 118 when trying
16042         to pass a type as argument.
16043
16044 2002-07-18  Martin Baulig  <martin@gnome.org>
16045
16046         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16047         Conv_R_Un for the signed `long' type.
16048
16049 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16050
16051         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16052         `expr' for the temporary result, as that will fail if we do
16053         multiple resolves on the same expression.
16054
16055 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16056
16057         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16058         ec.TypeContainer for looking up aliases. 
16059
16060         * class.cs (TypeContainer): Remove LookupAlias from here.
16061
16062         * decl.cs (DeclSpace); Move here.
16063
16064 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16065
16066         * class.cs (FindMembers): Only call filter if the constructor
16067         bulider is not null.
16068
16069         Also handle delegates in `NestedTypes' now.  Now we will perform
16070         type lookups using the standard resolution process.  This also
16071         fixes a bug.
16072
16073         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16074         This uses Expressions (the limited kind that can be parsed by the
16075         tree) instead of strings.
16076
16077         * expression.cs (ComposedCast.ToString): Implement, used to flag
16078         errors since now we have to render expressions.
16079
16080         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16081         FormArrayType. 
16082
16083         * ecore.cs (SimpleName.ToString): ditto.
16084
16085         * cs-parser.jay: Instead of using strings to assemble types, use
16086         Expressions to assemble the type (using SimpleName, ComposedCast,
16087         MemberAccess).  This should fix the type lookups in declarations,
16088         because we were using a different code path for this.
16089
16090         * statement.cs (Block.Resolve): Continue processing statements
16091         even when there is an error.
16092
16093 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16094
16095         * class.cs (Event.Define): Also remove the `remove' method from
16096         the list of pending items.
16097
16098         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16099         generate more compact code. 
16100
16101 2002-07-17  Martin Baulig  <martin@gnome.org>
16102
16103         * const.cs (Const.LookupConstantValue): Add support for constant
16104         `unchecked' and `checked' expressions.
16105         Also adding test case test-140.cs for this.
16106
16107 2002-07-17  Martin Baulig  <martin@gnome.org>
16108
16109         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16110         check whether mi.ReturnType implements the IEnumerator interface; the
16111         `==' and the IsAssignableFrom() will fail in this situation.
16112
16113 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16114
16115         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16116         here too.
16117
16118 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16119
16120         * expression.cs: fixed bug #27811.
16121
16122 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16123
16124         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16125         Molaro: when we are a ref, the value already contains a pointer
16126         value, do not take the address of it.
16127
16128 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16129         * removed mb-parser.jay and mb-tokenizer.cs
16130
16131 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16132
16133         * expression.cs: check against the building corlib void type.
16134
16135 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16136
16137         * ecore.cs: fix for valuetype static readonly fields: when 
16138         initializing them, we need their address, not the address of a copy.
16139
16140 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16141
16142         * typemanager.cs: register also enum_type in corlib.
16143
16144 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16145
16146         * class.cs: allow calling this (but not base) initializers in structs.
16147
16148 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16149
16150         * ecore.cs: make sure we compare against the building base types
16151         in GetTypeSize ().
16152
16153 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16154
16155         * typemanager.cs: fix TypeToCoreType() to handle void and object
16156         (corlib gets no more typerefs after this change).
16157
16158 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16159
16160         * expression.cs (ArrayCreation.EmitArrayArguments): use
16161         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16162
16163         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16164         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16165         array indexes, the runtime actually forbids them.
16166
16167         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16168         for array arguments here.
16169
16170         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16171         instead of the default for ValueTypes.
16172
16173         (New.DoEmit): Use IsValueType instead of
16174         IsSubclassOf (value_type)
16175         (New.DoResolve): ditto.
16176         (Invocation.EmitCall): ditto.
16177
16178         * assign.cs (Assign): ditto.
16179
16180         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16181         Statements *are* currently doing part of their resolution during
16182         Emit.  
16183
16184         Expressions do always resolve during resolve, but statements are
16185         only required to propagate resolution to their children.
16186
16187 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16188
16189         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16190
16191         (LoadAssembly): Do not add the dll if it is already specified
16192
16193         (MainDriver): Add the System directory to the link path at the end,
16194         after all the other -L arguments. 
16195
16196         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16197         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16198         ldelem.u1) and using the opposite for sbytes.
16199
16200         This fixes Digger, and we can finally run it.
16201
16202         * driver.cs (UnixParseOption): Move the option parsing here.  
16203         (CSCParseOption): Implement CSC-like parsing of options.
16204
16205         We now support both modes of operation, the old Unix way, and the
16206         new CSC-like way.  This should help those who wanted to make cross
16207         platform makefiles.
16208
16209         The only thing broken is that /r:, /reference: and /lib: are not
16210         implemented, because I want to make those have the same semantics
16211         as the CSC compiler has, and kill once and for all the confussion
16212         around this.   Will be doing this tomorrow.
16213
16214         * statement.cs (Unsafe.Resolve): The state is checked during
16215         resolve, not emit, so we have to set the flags for IsUnsfe here.
16216
16217 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16218
16219         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16220         not catch the Error_ObjectRefRequired in SimpleName (as it is
16221         possible to have a class/instance variable name that later gets
16222         deambiguated), we have to check this here.      
16223
16224 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16225
16226         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16227         make static and put into Expression.
16228
16229         (Event.Define): Register the private field of the event with the 
16230         TypeManager so that GetFieldFromEvent can get at it.
16231
16232         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16233         keep track of the private field associated with an event which
16234         has no accessors.
16235
16236         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16237         private field.
16238
16239         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16240
16241 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16242
16243         * expression.cs (Binary.EmitBranchable): this routine emits the
16244         Binary expression in a branchable context.  This basically means:
16245         we need to branch somewhere, not just get the value on the stack.
16246
16247         This works together with Statement.EmitBoolExpression.
16248
16249         * statement.cs (Statement.EmitBoolExpression): Use
16250         EmitBranchable. 
16251
16252 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16253
16254         * statement.cs (For): Reduce the number of jumps in loops.
16255
16256         (For): Implement loop inversion for the For statement.
16257
16258         (Break): We can be breaking out of a Try/Catch controlled section
16259         (foreach might have an implicit try/catch clause), so we need to
16260         use Leave instead of Br.
16261
16262         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16263         now).  If the instace expression supports IMemoryLocation, we use
16264         the AddressOf method from the IMemoryLocation to extract the
16265         address instead of emitting the instance.
16266
16267         This showed up with `This', as we were emitting the instance
16268         always (Emit) instead of the Address of This.  Particularly
16269         interesting when This is a value type, as we dont want the Emit
16270         effect (which was to load the object).
16271
16272 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16273
16274         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16275
16276         * statement.cs (Checked): Set the CheckedState during the resolve
16277         process too, as the ConvCast operations track the checked state on
16278         the resolve process, and not emit.
16279
16280         * cs-parser.jay (namespace_member_declaration): Flag that we have
16281         found a declaration when we do.  This is used to flag error 1529
16282
16283         * driver.cs: Report ok when we display the help only.
16284
16285 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16286
16287         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16288
16289 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16290
16291         * cs-tokenizer.cs (define): We also have to track locally the
16292         defines.  AllDefines is just used for the Conditional Attribute,
16293         but we also need the local defines for the current source code. 
16294
16295 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16296
16297         * statement.cs (While, For, Do): These loops can exit through a
16298         Break statement, use this information to tell whether the
16299         statement is the last piece of code.
16300
16301         (Break): Flag that we break.
16302
16303         * codegen.cs (EmitContexts): New `Breaks' state variable.
16304
16305 2002-07-03  Martin Baulig  <martin@gnome.org>
16306
16307         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16308         modifiers in method declarations in structs.  Otherwise, you won't
16309         be able to override things like Object.Equals().
16310
16311 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16312
16313         * class.cs (Method, Property, Indexer): Do not allow the public
16314         modifier to be used in explicit interface implementations.
16315
16316         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16317         override modifiers in method declarations in structs
16318
16319 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16320
16321         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16322         integer or real overflow, report an error
16323
16324 2002-07-02  Martin Baulig  <martin@gnome.org>
16325
16326         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16327         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16328         to tell the runtime about our newly created System.Object and
16329         System.ValueType types.
16330
16331 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16332
16333         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16334         struct instead of Ldarg/Starg.
16335
16336 2002-07-02  Martin Baulig  <martin@gnome.org>
16337
16338         * expression.cs (Indirection.Indirection): Call
16339         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16340
16341 2002-07-02  Martin Baulig  <martin@gnome.org>
16342
16343         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16344         ValueType, call TypeManager.TypeToCoreType() on it.
16345         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16346         the OpCodes.Newarr argument.
16347
16348 2002-07-02  Martin Baulig  <martin@gnome.org>
16349
16350         * expression.cs (Invocation.EmitCall): When compiling corlib,
16351         replace all calls to the system's System.Array type to calls to
16352         the newly created one.
16353
16354         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16355         System.Array methods.
16356         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16357         from the system's System.Array type which must be replaced.
16358
16359 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16360
16361         * typemanager.cs: load unverifiable_code_ctor so we can build
16362         corlib using the correct type. Avoid using GetTypeCode() with
16363         TypeBuilders.
16364         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16365         TypeManager.object_type to allow building corlib.
16366
16367 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16368
16369         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16370
16371 2002-07-01  Martin Baulig  <martin@gnome.org>
16372
16373         * class.cs: Make the last change actually work, we need to check
16374         whether `ifaces != null' to avoid a crash.
16375
16376 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16377
16378         * class.cs: when we build structs without fields that implement
16379         interfaces, we need to add the interfaces separately, since there is
16380         no API to both set the size and add the interfaces at type creation
16381         time.
16382
16383 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16384
16385         * expression.cs: the dimension arguments to the array constructors
16386         need to be converted if they are a long.
16387
16388 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16389
16390         * class.cs: don't emit ldarg.0 if there is no parent constructor
16391         (fixes showstopper for corlib).
16392
16393 2002-06-29  Martin Baulig  <martin@gnome.org>
16394
16395         MCS now compiles corlib on GNU/Linux :-)
16396
16397         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16398         ie. check for MethodImplOptions.InternalCall.
16399
16400         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16401         and TypeManager.attribute_type are null, so we must explicitly check
16402         whether parent is not null to find out whether it's an attribute type.
16403         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16404         and SetBuilder, not only if the property is neither abstract nor external.
16405         This is necessary to set the MethodImplOptions on the accessor methods.
16406         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16407         SetBuilder, see Property.Emit().
16408
16409         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16410         populate "System.Object", "System.ValueType" and "System.Attribute" since
16411         they've already been populated from BootCorlib_PopulateCoreTypes().
16412
16413 2002-06-29  Martin Baulig  <martin@gnome.org>
16414
16415         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16416         is the NullLiteral, we also need to make sure that target_type is not
16417         an enum type.   
16418
16419 2002-06-29  Martin Baulig  <martin@gnome.org>
16420
16421         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16422         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16423         before calling BootstrapCorlib_ResolveDelegate ().
16424
16425 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16426
16427         * statement.cs: fixed build-breaker. All tests passed ok.
16428
16429 2002-06-27  Martin Baulig  <martin@gnome.org>
16430
16431         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16432         for System.Decimal when compiling corlib.
16433
16434 2002-06-27  Martin Baulig  <martin@gnome.org>
16435
16436         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16437         switch blocks which contain nothing but a default clause.
16438
16439 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16440
16441        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16442
16443 2002-06-27  Martin Baulig  <martin@gnome.org>
16444
16445         * ecore.cs (PropertyExpr.PropertyExpr): Call
16446         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16447
16448         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16449         is already a TypeBuilder.
16450
16451 2002-06-27  Martin Baulig  <martin@gnome.org>
16452
16453         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16454         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16455         the "from an array-type to System.Array" case.  This makes it work
16456         when compiling corlib.
16457
16458 2002-06-27  Martin Baulig  <martin@gnome.org>
16459
16460         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16461         non-static PropertyExpr, set its InstanceExpression.  This makes
16462         the `ICollection.Count' property work in System/Array.cs.
16463
16464 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16465
16466         * driver.cs: Made error handling more consistent.  Errors now
16467         tracked by Report class, so many methods which used to return int
16468         now return void.  Main() now prints success/failure and 
16469         errors/warnings message.
16470
16471         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16472         the magic number return values (123 and 124).  Now, if the
16473         expected error occurs, the compiler exits with success (exit value
16474         0).  If the compilation completes without seeing that particular
16475         error, the compiler exits with failure (exit value 1).  The
16476         makefile in mcs/errors has been changed to handle the new behaviour.
16477
16478         * report.cs: Made 'expected error' number a property and renamed
16479         it from 'Probe' to 'ExpectedError'.
16480
16481         * genericparser.cs: Removed error handling support, since it is
16482         now all done by Report class.
16483
16484         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16485         class, so parse() no longer returns an int.
16486
16487         * namespace.cs: Use Report.Error instead of GenericParser.error
16488
16489 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16490
16491         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16492         TypeContainer.AddOperator): At the front of the list put the
16493         explicit implementations, so they get resolved/defined first. 
16494
16495 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16496
16497         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16498         interface type is implemented by this TypeContainer.  Used during
16499         explicit interface implementation.
16500
16501         (Property.Define, Indexer.Define, Method.Define): Validate that
16502         the given interface in the explicit implementation is one of the
16503         base classes for the containing type.
16504
16505         Also if we are explicitly implementing an interface, but there is
16506         no match in the pending implementation table, report an error.
16507
16508         (Property.Define): Only define the property if we are
16509         not explicitly implementing a property from an interface.  Use the
16510         correct name also for those properties (the same CSC uses,
16511         although that is really not needed).
16512
16513         (Property.Emit): Do not emit attributes for explicitly implemented
16514         properties, as there is no TypeBuilder.
16515
16516         (Indexer.Emit): ditto.
16517
16518         Hiding then means that we do not really *implement* a pending
16519         implementation, which makes code fail.
16520
16521 2002-06-22  Martin Baulig  <martin@gnome.org>
16522
16523         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16524         the return value of Object.GetType().  [FIXME: we need to do this whenever
16525         we get a type back from the reflection library].
16526
16527 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16528
16529         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16530
16531 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16532
16533         * attribute.cs: Return null if we can not look up the type.
16534
16535         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16536         the interface types found.
16537
16538         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16539         interface types found.
16540
16541         * typemanager.cs (GetInterfaces): Make this routine returns alll
16542         the interfaces and work around the lame differences between
16543         System.Type and System.Reflection.Emit.TypeBuilder in the results
16544         result for GetInterfaces.
16545
16546         (ExpandInterfaces): Given an array of interface types, expand and
16547         eliminate repeated ocurrences of an interface.  This expands in
16548         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16549         be IA, IB, IC.
16550
16551 2002-06-21  Martin Baulig  <martin@gnome.org>
16552
16553         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16554         on System.Enum.
16555
16556 2002-06-21  Martin Baulig  <martin@gnome.org>
16557
16558         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16559         and called with one of the core types, return the corresponding typebuilder for
16560         that type.
16561
16562         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16563         element type.
16564
16565 2002-06-21  Martin Baulig  <martin@gnome.org>
16566
16567         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16568         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16569         (Expression.ConvertReferenceExplicit): Likewise.
16570
16571         * expression.cs (ElementAccess.DoResolve): Likewise.
16572         (ElementAccess.DoResolveLValue): Likewise.
16573
16574 2002-06-10  Martin Baulig  <martin@gnome.org>
16575
16576         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16577         add the "value" parameter to the parameter list.
16578
16579         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16580         to our caller.
16581
16582 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16583
16584         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16585         the argument to an int, uint, long or ulong, per the spec.  Also
16586         catch negative constants in array creation.
16587
16588 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16589
16590         * class.cs: do not allow the same interface to appear twice in
16591         the definition list.
16592
16593 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16594
16595         * ecore.cs: don't use ldlen with System.Array.
16596
16597 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16598
16599         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16600
16601 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16602
16603         * modifiers.cs: produce correct field attributes for protected
16604         internal. Easy fix so miguel can work on ther harder stuff:-)
16605
16606 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * pending.cs: New file.  Move the code from class.cs here.
16609         Support clearning the pending flag for all methods (when not doing
16610         explicit interface implementation).
16611
16612 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16613
16614         * rootcontext.cs: added a couple more types needed to bootstrap.
16615
16616 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16617
16618         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16619         constructor in the type, instead of any constructor in the type
16620         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16621         a bug in the Mono runtime when applying the params attribute). 
16622
16623 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16624         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16625
16626 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16627
16628         * expression.cs (Unary.ResolveOperator): Use TypeManager
16629         to resolve the type.
16630
16631 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16632
16633         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16634         attached.
16635
16636         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16637         with each member too.
16638
16639         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16640         field builders too - this takes care of the enum member case.
16641
16642 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16643
16644         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16645         address-of operator on both value types and pointers.
16646
16647 2002-06-10  Martin Baulig  <martin@gnome.org>
16648
16649         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16650         PropertyBuilder to the `property_builders' list.
16651
16652         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16653         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16654         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16655         find any indexers which are inherited from an interface.
16656
16657 2002-06-09  Martin Baulig  <martin@gnome.org>
16658
16659         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16660         the same type as the constant if necessary.  There's also a test-130.cs
16661         for this.
16662
16663         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16664
16665         * typemanager.cs (TypeManager.ChangeType): Previously known as
16666         Enum.ChangeEnumType().
16667
16668 2002-06-09  Martin Baulig  <martin@gnome.org>
16669
16670         * expression.cs (Cast.TryReduce): Added support for consts.
16671
16672 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16673
16674         * class.cs (Accessor): Hold attributes information so we can pass
16675         it along.
16676
16677         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16678         Modify to pass in attributes attached to the methods.
16679
16680         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16681
16682         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16683         to handle the Accessor kind :-)
16684
16685         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16686
16687 2002-06-08  Martin Baulig  <martin@gnome.org>
16688
16689         * expression.cs (Unary.TryReduceNegative): Added support for
16690         ULongConstants.
16691
16692 2002-06-08  Martin Baulig  <martin@gnome.org>
16693
16694         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16695         name can't be found in the `defined_names' - the caller will do a
16696         MemberLookup in this case and thus find methods in System.Enum
16697         such as Enum.IsDefined().
16698
16699 2002-06-08  Martin Baulig  <martin@gnome.org>
16700
16701         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16702         Convert.ChangeType() which works with TypeBuilder created types.
16703         (Enum.LookupEnumValue, Enum.Define): Use it here.
16704
16705         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16706         `TypeBuilder.BaseType != null' check.
16707         (TypeContainer.FindMembers): Only lookup parent members if we
16708         actually have a parent.
16709         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16710         (ConstructorInitializer.Resolve): Likewise.
16711
16712         * interface.cs (Interface.FindMembers): Added
16713         `TypeBuilder.BaseType != null' check.
16714
16715         * rootcontext.cs (RootContext.ResolveCore): Added
16716         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16717         classes_second_stage.
16718
16719         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16720         debug_type and trace_type when compiling with --nostdlib.       
16721
16722 2002-06-07  Martin Baulig  <martin@gnome.org>
16723
16724         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16725         (AddField): Set it to true when adding a non-static field.
16726         (DefineType): Use `have_nonstatic_fields' to find out whether we
16727         have non-static fields, not `Fields != null'.
16728
16729 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16730
16731         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16732         dereferencing a null on the static-field code path)
16733
16734 2002-05-30  Martin Baulig  <martin@gnome.org>
16735
16736         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16737         to take command line arguments.  Use reflection to call the new
16738         custom `Initialize' function on the symbol writer and pass it the
16739         command line arguments.
16740
16741         * driver.cs (--debug-args): New command line argument to pass command
16742         line arguments to the symbol writer.
16743
16744 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16745
16746         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16747         the target type for indexers and properties.  Thanks to Joe for
16748         catching this.
16749
16750 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16751
16752         * typemanager.cs (MethodFlags): returns the method flags
16753         (Obsolete/ShouldIgnore) that control warning emission and whether
16754         the invocation should be made, or ignored. 
16755
16756         * expression.cs (Invocation.Emit): Remove previous hack, we should
16757         not do this on matching a base type, we should do this based on an attribute
16758
16759         Only emit calls to System.Diagnostics.Debug and
16760         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16761         on the command line.
16762
16763         * rootcontext.cs: Global settings for tracing and debugging.
16764
16765         * cs-tokenizer.cs (define): New utility function to track
16766         defines.   Set the global settings for TRACE and DEBUG if found.
16767
16768 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16769
16770         * interface.cs (Populate*): Pass in the TypeContainer as well as
16771         the DeclSpace as parameters so that we can create EmitContexts and
16772         then use that to apply attributes etc.
16773
16774         (PopulateMethod, PopulateEvent, PopulateProperty)
16775         (PopulateIndexer): Apply attributes everywhere.
16776
16777         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16778         etc.
16779
16780         (ApplyAttributes): Update accordingly.
16781
16782         We now apply interface attributes for all members too.
16783
16784 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16785
16786         * class.cs (Indexer.Define); Correctly check if we are explicit
16787         implementation (instead of checking the Name for a ".", we
16788         directly look up if the InterfaceType was specified).
16789
16790         Delay the creation of the PropertyBuilder.
16791
16792         Only create the PropertyBuilder if we are not an explicit
16793         interface implementation.   This means that explicit interface
16794         implementation members do not participate in regular function
16795         lookups, and hence fixes another major ambiguity problem in
16796         overload resolution (that was the visible effect).
16797
16798         (DefineMethod): Return whether we are doing an interface
16799         implementation. 
16800
16801         * typemanager.cs: Temporary hack until we get attributes in
16802         interfaces (Ravi is working on that) and we get IndexerName
16803         support in interfaces.
16804
16805         * interface.cs: Register the indexers as properties.
16806
16807         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16808         warning, I have verified that this is a bug in the .NET runtime
16809         (JavaScript suffers of the same problem).
16810
16811         * typemanager.cs (MemberLookup): When looking up members for
16812         interfaces, the parent of an interface is the implicit
16813         System.Object (so we succeed in searches of Object methods in an
16814         interface method invocation.  Example:  IEnumerable x;  x.ToString
16815         ()) 
16816
16817 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16818
16819         * class.cs (Event): Events should also register if they do
16820         implement the methods that an interface requires.
16821
16822         * typemanager.cs (MemberLookup); use the new GetInterfaces
16823         method. 
16824
16825         (GetInterfaces): The code used to lookup interfaces for a type is
16826         used in more than one place, factor it here. 
16827
16828         * driver.cs: Track the errors at the bottom of the file, we kept
16829         on going.
16830
16831         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16832         instance if the method we are calling is static!
16833
16834 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16835
16836         * attribute.cs (ApplyAttributes): Make this function filter out
16837         the IndexerName attribute (as that attribute in reality is never
16838         applied) and return the string constant for the IndexerName
16839         attribute. 
16840
16841         * class.cs (TypeContainer.Emit): Validate that all the indexers
16842         have the same IndexerName attribute, and if so, set the
16843         DefaultName attribute on the class. 
16844
16845         * typemanager.cs: The return value might contain other stuff (not
16846         only methods).  For instance, consider a method with an "Item"
16847         property and an Item method.
16848
16849         * class.cs: If there is a problem with the parameter types,
16850         return. 
16851
16852 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16853
16854         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16855         looks at user defined conversion after making a call to 
16856         StandardConversionExists - we need this for overload resolution.
16857
16858         * expression.cs : Update accordingly the various method calls.
16859
16860         This fixes 2 bugs filed against implicit user defined conversions 
16861
16862 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
16863
16864         * statement.cs: Track the result of the assignment.
16865
16866 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
16867
16868         * expression.cs (MemberAccess): Improved error reporting for
16869         inaccessible members.
16870
16871 2002-05-22  Martin Baulig  <martin@gnome.org>
16872
16873         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
16874         itself with debugging support.
16875
16876 2002-05-22  Martin Baulig  <martin@gnome.org>
16877
16878         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16879         Removed, this isn't needed anymore.
16880
16881 2002-05-20  Martin Baulig  <martin@gnome.org>
16882
16883         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16884         be underlying type for an enum.
16885
16886 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
16887
16888         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16889         that splits out the loading of just the core types.
16890
16891         * rootcontext.cs (ResolveCore): Split the struct resolution in
16892         two, so we can load the enumeration underlying types before any
16893         enums are used.
16894
16895         * expression.cs (Is): Bandaid until we fix properly Switch (see
16896         bug #24985 for details).
16897
16898         * typemanager.cs (ImplementsInterface): The hashtable will contain
16899         a null if there are no interfaces implemented.
16900
16901 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
16902
16903         * cs-parser.jay (indexer_declarator): It is fine to have array
16904         parameters
16905
16906 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16907
16908         * typemanager.cs: (RegisterBuilder): New function used to register
16909         TypeBuilders that implement interfaces.  Since
16910         TypeBuilder.GetInterfaces (as usual) does not work with lame
16911         Reflection.Emit. 
16912         (AddUserType): register interfaces.
16913
16914         (ImplementsInterface): Use the builder_to_ifaces hash if we are
16915         dealing with TypeBuilder.  Also, arrays are showing up as
16916         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16917         methods can not be invoked on them!
16918
16919         * ecore.cs (ExplicitReferenceConversionExists): Made public.
16920         (ImplicitReferenceConversionExists): Split out from
16921         StandardConversionExists. 
16922
16923         * expression.cs (As): We were only implementing one of the three
16924         cases for the as operator.  We now implement them all.
16925         (Is): Implement the various other cases for Is as well.
16926
16927         * typemanager.cs (CACHE): New define used to control if we want or
16928         not the FindMembers cache.  Seems to have a negative impact on
16929         performance currently
16930
16931         (MemberLookup): Nested types have full acess to
16932         enclosing type members
16933
16934         Remove code that coped with instance/static returns for events, we
16935         now catch this in RealFindMembers.
16936
16937         (RealFindMembers): only perform static lookup if the instance
16938         lookup did not return a type or an event.  
16939
16940 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16941
16942         * assign.cs (CompoundAssign): We pass more semantic information
16943         now to Compound Assignments than we did before: now we have all
16944         the information at hand, and now we resolve the target *before* we
16945         do the expression expansion, which allows the "CacheValue" method
16946         to have the effect we intended (before, a [x] += 1 would generate
16947         two differen ArrayAccess expressions from the ElementAccess,
16948         during the resolution process).
16949
16950         (CompoundAssign.DoResolve): Resolve target and original_source here.
16951
16952 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
16953
16954         * expression.cs (ArrayAccess): dropped debugging information. 
16955
16956         * typemanager.cs: Small bug fix: I was always returning i_members,
16957         instead of one of i_members or s_members (depending on which had
16958         the content).
16959
16960         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
16961         method is invoked before any code generation takes place, and it
16962         is a mechanism to inform that the expression will be invoked more
16963         than once, and that the method should use temporary values to
16964         avoid having side effects
16965
16966         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16967
16968         * ecore.cs (Expression.CacheTemporaries): Provide empty default
16969         implementation.
16970
16971         * expression.cs (Indirection, ArrayAccess): Add support for
16972         CacheTemporaries in these two bad boys. 
16973
16974         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16975         ldobj or ldind_ref.  
16976         (StoreFromPtr): Handle stobj as well.
16977
16978         * expression.cs (UnaryMutator): Share more code.
16979
16980         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16981         down: I was not tracking the Filter function as well, which
16982         was affecting the results of the cache.
16983
16984 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16985
16986         * attribute.cs: Remove the hack to handle the CharSet property on
16987         StructLayouts. 
16988
16989 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16990
16991         * attribute.cs (DoResolve): More uglyness, we now only try to
16992         resolve the attribute partially, to extract the CharSet
16993         information (only if we are a StructLayout attribute).  Otherwise 
16994
16995         (GetExtraTypeInfo): Add some code to conditionally kill in the
16996         future this.   I am more and more convinced that the .NET
16997         framework has special code to handle the attribute setting on
16998         certain elements.
16999
17000         * expression.cs (IsParamsMethodApplicable): Revert my previous
17001         foreach change here, it was wrong.
17002
17003 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17004
17005         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17006         (pp_expr): do not abort on unknown input, just return.
17007         (eval): abort if there are pending chars.
17008
17009         * attribute.cs (Attribute.Resolve): Positional parameters are
17010         optional.  Deal with that case.
17011
17012         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17013         the Ansi/Unicode/Auto information for the type.
17014
17015         (TypeContainer.DefineType): instantiate the EmitContext here, as
17016         we will be using it during the type definition (to resolve
17017         attributes) and during the emit phase.
17018
17019         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17020         to pull type information out of the attributes
17021
17022         (Attribute.Resolve): track the constructor builder, and allow for
17023         multiple invocations (structs and classes will use this).
17024
17025         * ecore.cs (MemberLookupFinal): new version with all the
17026         parameters customizable.
17027
17028         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17029         constructors.  Return if the result value is null (as the error
17030         would have been flagged already by MemberLookupFinal)
17031
17032         Do not allow instances of abstract classes or interfaces to be
17033         created.
17034
17035         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17036         We have to compare the assembly property here when dealing with
17037         FamANDAssem and Assembly access modifiers, because we might be
17038         creating an assembly from *modules* (that means that we are not
17039         getting TypeBuilders for types defined in other modules that are
17040         part of this assembly).
17041
17042         (Method.Emit): If the method is marked abstract and has a body,
17043         emit an error. 
17044
17045         (TypeContainer.DefineMembers): If both the defined member and the
17046         parent name match are methods, then do not emit any warnings: let
17047         the Method.Define routine take care of flagging warnings.  But if
17048         there is a mismatch (method overrides something else, or method is
17049         overriwritten by something, then emit warning).
17050
17051         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17052         set to null, this means `do not check for the return type on the
17053         signature'. 
17054
17055         (Method.Define): set the return type for the method signature to
17056         null, so that we get methods with the same name and parameters and
17057         different return types.  This is used to flag warning 114 (you are
17058         hiding a method, and you probably want to use the new/override
17059         keywords instead).
17060
17061         * typemanager.cs (MemberLookup): Implemented proper access
17062         control, closing a long standing set of bug reports.  The problem
17063         was that the Framework only has two bits: Public and NonPublic,
17064         and NonPublic includes private and protected methods, but we need
17065         to enforce the FamANDAssem, FamOrAssem and Family. 
17066
17067 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17068
17069         * statement.cs (GotoCase): Return true: Ammounts to giving up
17070         knowledge on whether we return or not, and letting the other case
17071         be responsible for it.
17072
17073 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17074
17075         * driver.cs: Do not load directories for each file processed, only
17076         do it if there is a pattern.
17077
17078         * ecore.cs: Report readonly assigns here as well, as we might have
17079         been resolved only by MemberAccess.
17080
17081         (SimpleName.SimpleNameResolve): Also be useful for LValue
17082         resolution.   We need this to propagate assign to local readonly variables
17083
17084         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17085         do not want to reuse potential criteria memory.
17086
17087         * class.cs (MyEventBuilder): Set reflected_type;
17088
17089         * ecore.cs (Constantify): Added support for constifying bools.
17090
17091         (RootContext.LookupType): Added a cache for values looked up in
17092         the declaration space.
17093
17094         * typemanager.cs (FindMembers): Now is a front-end to
17095         RealFindMembers, and provides a two-level hashtable-based cache to
17096         the request.  
17097
17098         15% performance improvement: from 22.5 to 19.2 seconds.
17099
17100         * expression.cs (IsParamsMethodApplicable): use foreach.
17101         (Invocation.DoResolve): ditto.
17102         (New.DoResolve): ditto.
17103         (ArrayCreation.DoResolve): ditto.
17104
17105         * ecore.cs (FindMostEncompassingType): use foreach.
17106
17107         * delegate.cs (NewDelegate.DoResolve): Use foreach
17108
17109         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17110         (RemoveMethods): use foreach.
17111
17112         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17113         nested foreach statements instead of for, and also break out of
17114         the inner loop once a match is found.
17115
17116         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17117
17118 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17119
17120         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17121         we actually unwrap the expression to allow for extra information
17122         to be extracted. 
17123
17124         * expression.cs: Use Shr_Un on unsigned operations. 
17125
17126 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17127
17128         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17129         applicable operators was not being considered correctly. This closes
17130         the bug Miguel reported.
17131
17132 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17133
17134         * attribute.cs: check that the type derives from System.Attribute
17135         and report the correct error in that case (moved the duplicate code to
17136         its own method, too).
17137
17138 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17139
17140         * attribute.cs: lookup attribute type name as the spec says: first the
17141         bare attribute name and then name + "Attribute" (nant compiles with
17142         mcs after this fix).
17143
17144 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17145
17146         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17147         Because of the way we parse things, we should try to see if a
17148         UIntConstant can fit in an integer.
17149
17150 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17151
17152         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17153         when we are in an explicit context.
17154
17155         (ConvertReferenceExplicit): When converting from Iface type S to Class
17156         T make sure the rules are implemented as an OR.
17157
17158         * parameter.cs (ParameterType): Make it a property for now although the
17159         purpose really isn't anything immediate.
17160
17161         * expression.cs (Is*Applicable): Do better checking on the parameter type
17162         of a ref/out parameter. The ones from the system assemblies are already 
17163         marked with the correct type so we don't need to do any correction.
17164
17165         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17166         the object type is standard too so include that.
17167
17168 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17169
17170         * ecore.cs (StandardConversionExists): Augment with missing code:
17171         deal with IntConstant, LongConstants and Enumerations.
17172
17173         * assign.cs: Report the error, instead of failing silently
17174
17175         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17176         typecontainer that they are declared, because the
17177         typecontainer/namespace will have the list of using clauses that
17178         need to be applied.
17179
17180         Assembly Attributes were escaping the normal registration
17181         mechanism. 
17182
17183         (EmitCode): Apply attributes within an EmitContext that represents
17184         the container they were declared on.
17185
17186         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17187
17188 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17189
17190         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17191         Revamp completely - make much cleaner as we now operate only
17192         on a set of Types.
17193
17194         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17195         to implement the logic detailed in the spec more correctly.
17196
17197         (UserDefinedConversion): Update accordingly.
17198
17199 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17200
17201         * statement.cs: Return flow analysis information up.
17202
17203         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17204         and the default.
17205
17206         (token): Do not consume an extra character before calling
17207         decimal_digits.
17208
17209 2002-05-06  Piers Haken <piersh@friskit.com>
17210
17211         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17212
17213 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17214
17215         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17216         EmitContext during the instance constructor initializer
17217         resolution, to stop access to instance variables.
17218
17219         This is mandated by the spec, last paragraph of the `constructor
17220         initializers' section. 
17221
17222 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17223
17224         * cs-parser.jay, class.cs (Accessor): new class used to represent
17225         an accessor (get or set).  In the past we used `null' to represent
17226         a missing accessor.  But this is ambiguous because there was no
17227         way to tell in abstract indexers/properties if one of them was
17228         specified.
17229
17230         Now there is a way of addressing that.
17231
17232         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17233         instead of FindMembers.
17234
17235         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17236         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17237
17238         * attribute.cs: Treat indexers and properties as the same in terms
17239         of applying attributes
17240
17241         * ecore.cs (FindMostEncompassedType): Use statically initialized
17242         EmptyExpressions()s like we do elsewhere to avoid creating useless
17243         objects (and we take this out of the tight loop).
17244
17245         (GetConversionOperators): Move the code to extract the actual
17246         operators to a separate routine to clean things up.
17247
17248 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17249
17250         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17251         events are always registered FieldBuilders.
17252
17253         * class.cs (FieldBase): New class shared by Fields 
17254
17255         * delegate.cs: If we are a toplevel delegate, use our full name.
17256         If we are a nested delegate, then only use our tail name.
17257
17258 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17259
17260         * expression.cs (IsApplicable): Ensure that we add the "&" to
17261         ref/out types before comparing it with the type of the argument.
17262
17263         (IsParamsMethodApplicable): Ditto.
17264
17265         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17266         silly me ;-)
17267
17268         * delegate.cs : Handle the case when we have more than one applicable
17269         method. Flag an error only when we finish checking all.
17270
17271 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17272
17273         * expression.cs: Add support for boolean static initializers.
17274
17275 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17276
17277         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17278
17279         * parameter.cs (ComputeParameterTypes,
17280         ComputeAndDefineParameterTypes): Better error handling: now we
17281         clear the `types' cache if we fail during any of the type lookups.
17282         We also return the status code correctly to our caller
17283
17284         * delegate.cs: If we fail to define a delegate, abort the extra
17285         steps. 
17286
17287         * expression.cs (Binary.ResolveOperator): for
17288         operator==(object,object) and operator !=(object, object) we also
17289         have to verify that there is an implicit conversion from one to
17290         the other.
17291
17292         (ArrayAccess.DoResolve): Array Access can operate on
17293         non-variables. 
17294
17295 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17296
17297         * assign.cs (CompoundAssign): A new class used as a "flag" that
17298         the assignment actually is happening as part of a compound
17299         assignment operator.
17300
17301         During compound assignment, a few new rules exist to enable things
17302         like:
17303
17304         byte b |= 1 + 2
17305
17306         From the spec:
17307
17308         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17309         to the type of x) if y is implicitly convertible to the type of x,
17310         and the operator is a builtin operator and the return type of the
17311         operator is explicitly convertible to the type of x. 
17312
17313         * rootcontext.cs: Reset warning level to 2.  4 catches various
17314         "interesting" features in mcs, we must clean this up at some
17315         point, but currently am trying to kill other bugs ;-)
17316
17317         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17318         in container classes as well.  
17319
17320         * expression.cs (Binary.ResolveOperator): Handle string case
17321         before anything else (as operator overloading does emit an error
17322         before doing anything else).
17323
17324         This code could go away when we move to a table driven model, but
17325         i could not come up with a good plan last night.
17326
17327 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17328
17329         * typemanager.cs (CSharpName): reimplementation using regex.
17330         * class.cs: added null check for fields in Emit
17331         * rootcontext.cs: set warninglevel to 4
17332
17333 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17334
17335         * typemanager.cs (CSharpName): reimplemented with Lupus
17336         suggestion.
17337
17338 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17339
17340         * statement.cs (If): correclty implement Resolve, because we were
17341         not catching sem errors in there.  The same process is needed
17342         everywhere else. 
17343         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17344
17345
17346         (Statement.Warning_DeadCodeFound): Factorize code.
17347         (While): Report dead code here too.
17348
17349         (Statement): Added Resolve virtual method to allow
17350         for resolution split from the emit code.
17351
17352 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17353
17354         * statement.cs (EmitBoolExpression): No longer try to resolve the
17355         expression here.    
17356         (MakeBoolean): New utility function that resolve, implicitly
17357         converts to boolean and tags the expression. 
17358
17359
17360         (If, Do): Implement dead code elimination.
17361         (While): Implement loop inversion
17362
17363         (Do, While, For, If): Resolve the expression prior to calling our
17364         code generation.
17365
17366 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17367
17368         * class.cs:
17369           - added method Report28 (warning: program has more than one entry point)
17370           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17371           - modified method Method.Define, the part at the end of the method
17372
17373         * rootcontext.cs: added static public Location EntryPointLocation;
17374           
17375         * ../errors/cs0028.cs : Add test case for the above warning.              
17376
17377         * typemanager.cs:
17378           - modified method CSharpName to allow arrays of primitive type to
17379             be printed nicely (e.g. instead of System.Int32[][] it now prints
17380             int[][])
17381           - added method CSharpSignature: returns the signature of a method
17382             in string format to be used in reporting errors, warnings, etc.
17383
17384         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17385         with String.Empty.
17386
17387 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17388
17389         * delegate.cs (Define): Fix extremely silly bug where I was
17390         setting the type of the 'object' parameter of the BeginInvoke
17391         method to System.IAsyncResult instead of System.Object ;-)
17392
17393 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17394
17395         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17396         here. 
17397
17398         (Constructor.Emit): return if we fail to initialize the
17399         constructor.  Another door closed!  
17400
17401         * expression.cs (New.DoResolve): Improve error message (from -6 to
17402         1501).  Use DeclaredOnly lookup to find the exact constructor.
17403
17404         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17405         loop.  This is useful.
17406
17407         * cs-parser.jay: Adjust the default parameters so that destructors
17408         have the proper signature.
17409
17410 2002-04-26  Martin Baulig  <martin@gnome.org>
17411
17412         * driver.cs (LoadAssembly): If `assembly' contains any characters
17413         which are only valid in path names and not in assembly names
17414         (currently slash, backslash and point), use Assembly.LoadFrom ()
17415         instead of Assembly.Load () on the `assembly' (before iteration
17416         over the link_paths).
17417
17418 2002-04-26  Martin Baulig  <martin@gnome.org>
17419
17420         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17421
17422 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17423
17424         * class.cs (Property): use the new typemanager.MemberLookup
17425
17426         (TypeContainer.MemberLookup): Implement using the
17427         TypeManager.MemberLookup now. 
17428
17429         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17430         and return MemberInfos, so that these can be used without an
17431         EmitContext (what we had before).
17432
17433 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17434
17435         * expression.cs: Fix the case where the argument to params if the
17436         type of the params.  I omitted handling this before.   Fixed
17437
17438 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17439
17440         * driver.cs: Call BootCorlib_PopulateCoreType
17441
17442         * class.cs (Property.CheckBase): Check for properties only, not
17443         for all members. 
17444
17445         * interface.cs: Temporary hack: try/catch around the
17446         CustomAttributeBuilder, because I am getting an exception that I
17447         do not understand.
17448
17449         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17450         types whose definitions are required to be there (attributes are
17451         defined before standard types).
17452
17453         Compute definitions as we boot the various types, as they are used
17454         immediately (value_type class will need object_type, but if we do
17455         not initialize object_type, we will pass a null, which will let
17456         the runtime pick the System.Object from the existing corlib, which
17457         is not what we want).
17458
17459 2002-04-22  Patrik Torstensson <totte@labs2.com>
17460
17461         * cs-tokenizer.cs: fixed a number of trim() issues.
17462
17463 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17464
17465         * expression.cs (Argument.Type): Ensure that we return the correct
17466         type when we have out or ref parameters [in which case we 
17467         append a "&"].
17468
17469 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17470
17471         * class.cs (Property, Indexer): Allow extern modifier in there. 
17472
17473         * typemanager.cs (InitBaseTypes): Initializes object_type and
17474         value_type, since those will be used early on during the bootstrap
17475         process to compile corlib.
17476
17477         (InitCoreTypes): Move code from here to InitBaseTypes.
17478
17479 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17480
17481         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17482         single-dimension arrays as using the ldlen opcode.  
17483
17484         Daniel Lewis discovered this optimization.  
17485
17486         * typemanager.cs: Add signature for System.Array::get_Length
17487
17488 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17489
17490         * statement.cs: report the error when the foreach does not apply to an
17491         array nor a collection.
17492
17493 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17494
17495         * expression.cs: Add implicit conversions to the operator ~.
17496
17497         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17498
17499         * typemanager.cs: Locate the decimal constructor.
17500
17501 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17502
17503         * attribute.cs: use the new property of TypeOf.
17504         * expression.cs: added 'get' property around typearg.
17505
17506         These changes fix a build breaker reported by NickD. Is this the
17507         correct way to fix?  If not, please, revert my changes and make it
17508         work :-).
17509
17510 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17511
17512         * attribute.cs: Add support for typeof in attribute invocations.
17513         I am not sure that this is right though.
17514
17515 2002-04-14  Duncan Mak  <duncan@ximian.com>
17516
17517         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17518         Binary.Operator.Division case.
17519
17520 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17521
17522         * class.cs (DefineType): Ensure that we do a proper check on
17523         attribute types and also register it with the TypeManager.
17524
17525         (TypeContainer.Targets): The default for attribute types is
17526         AttributeTargets.All.
17527
17528         * attribute.cs (ApplyAttributes): Registering the attribute type
17529         is done elsewhere, not when we discover we have a Usage attribute.
17530
17531 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17532
17533         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17534         and get rid of is_delegate parameter.
17535
17536         * everywhere : update.
17537
17538 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17539
17540         * cs-parser.jay (compilation_unit): Revamp completely to use
17541         some new ideas that I got from Rhys' grammar to solve the problems
17542         with assembly level attributes.
17543
17544         (outer_declaration): New grammar production.
17545
17546         (attribute_sections): Add.
17547
17548         (opt_attributes): Base on attribute_sections
17549
17550         (namespace_declaration): Allow opt_attributes to tackle the case
17551         when we have assembly level attributes - we are clever in this
17552         regard now ;-)
17553
17554         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17555         attributes in the non-global context.
17556
17557         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17558         instead of SetGlobalAttributes.
17559
17560         * class.cs, rootcontext.cs : Ensure we define and generate 
17561         attribute types before anything else.
17562
17563         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17564         and flag the new error -20 for the case when the attribute type
17565         does not have valid targets specified. csc does not catch this.
17566
17567         * ../errors/errors.txt : update for error # -20
17568
17569 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17570
17571         * support.cs (InternalParameters.ParameterModifier): Do some null
17572         checking and return sane values.
17573
17574         * class.cs (Method.Define): If we are a PInvoke method, ensure
17575         that we are static and extern. Report error # 601
17576
17577         * ../errors/cs0601.cs : Add test case for the above error.
17578
17579 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17580
17581         * rootcontext.cs (attribute_types): We need to keep type of
17582         all attribute types separately and emit code for them first.
17583
17584         (RegisterAttribute) : Implement.
17585
17586         * class.cs (DefineType): Check if the current Type is a custom
17587         attribute type and register it accordingly.
17588
17589         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17590         adding the first attribute twice and rename to
17591
17592         (SetGlobalAttributes): this.
17593
17594         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17595         lookups.
17596
17597         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17598         if we are processing global arguments. Hmm, I am unsure of this.
17599
17600 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17601
17602         * expression.cs: added static array of strings to avoid calling
17603         Enum.ToString () for Operator in Binary. Significant recover of
17604         performance.
17605
17606 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17607
17608         * class.cs (FindMembers): Allow the Builders of the various
17609         members to be null.  If they are skip them.  This only happens
17610         during the PInvoke declaration.
17611
17612 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17613
17614         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17615         failure, so we do not keep going afterwards.
17616
17617         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17618         wanted to pass `false' as the `is_delegate' argument.  If this is
17619         the case, why not use delegate_type == null to mean `is_delegate =
17620         false' and anything else as is_delegate = true.
17621
17622 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17623
17624         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17625         code for the section, not the beginning of the tests.
17626
17627 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17628
17629         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17630
17631         * expression.cs (Binary): same.  Warn about errors where we have
17632         Enum/Enum in operator + as well.
17633
17634 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17635
17636         * statement.cs:
17637                 - added support for switch(bool)
17638                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17639                 - add TableSwitchEmit() to handle table-based switch statements
17640
17641 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17642
17643         * expression.cs (Invocation.OverloadResolve): Factor out code which
17644         does parameter compatibility checking with arguments so that we can 
17645         re-use the code even from Delegate.VerifyApplicability
17646
17647         (VerifyArgumentsCompat): Move above code here.
17648
17649         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17650         and instead make a call to the above method.
17651
17652 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17653
17654         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17655         We use it to keep track of classes which are attribute types.
17656
17657 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17658
17659         * delegate.cs (Delegate.Define): Correctly define the types in the
17660         presence of fixed and array parameters.
17661
17662         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17663         doing FindMembers.
17664
17665         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17666         include NonPublic after the first iteration.
17667
17668         * class.cs (Indexer.CheckBase): Only check if both parents are
17669         non-null. 
17670
17671         * cs-parser.jay (accessor_body): If empty, set to null.
17672
17673         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17674         same code path here to resolve constants names that we did have in
17675         MemberAccess.DoResolve.  There is too much code duplicated here.
17676
17677 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17678
17679         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17680
17681         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17682         to MakeUnionSet.
17683
17684         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17685         tokens, numbers and strings.
17686
17687         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17688         parenthesis.
17689
17690         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17691         asyncronous parameters and the regular parameters.  
17692
17693         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17694         specify the target directory.
17695
17696         * expression.cs: (This.DoResolve): Simplify
17697         (As.Emit): Optimize, do not generate IsInst if the expression is
17698         always of the given type.
17699
17700         (Is.DoResolve): Bug fix, we were reporting both always/never for
17701         the is expression.
17702
17703         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17704         creating too many unnecessary arrays.
17705
17706 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17707
17708         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17709         fields instead of rolling our own initializer.   Takes care of all
17710         implicit conversions, and drops unnecessary static checks/argument.
17711
17712 2002-03-31  Dick Porter  <dick@ximian.com>
17713
17714         * driver.cs: use the GetDirectories() return values properly, and
17715         use "/" as path separator.
17716
17717 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17718
17719         * expression.cs (Unary): Optimize - - expr into expr.
17720         (Binary): Optimize a + (-b) into a -b.
17721
17722         * codegen.cs (CodeGen): Made all methods static.
17723
17724 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17725
17726         * rootcontext.cs: 
17727
17728         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17729         TypeBuilder property.
17730
17731         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17732         instead. 
17733
17734         * tree.cs: Removed the various RecordXXXX, and replaced with a
17735         single RecordDecl.  Removed all the accessor methods, and just
17736         left a single access point Type 
17737
17738         * enum.cs: Rename DefineEnum to DefineType.
17739
17740         * decl.cs: New abstract method `DefineType' used to unify the
17741         Defines for Enumerations, Interfaces, TypeContainers and
17742         Delegates.
17743
17744         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17745         LookupBaseClasses method that used to live in class.cs and
17746         interface.cs here, and renamed to FindType.
17747
17748         * delegate.cs: Implement DefineType.  Take advantage of the
17749         refactored pattern for locating the parent builder without taking
17750         the parent_builder argument (which we know does not work if we are
17751         nested, and triggering a toplevel definition).
17752
17753 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17754
17755         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17756         accessibility of a member has changed during override and report
17757         an error if so.
17758
17759         * class.cs (Method.Define, Property.Define): Only complain on
17760         overrides if the method is private, any other accessibility is
17761         fine (and since we just checked the permission is the same, we are
17762         good to go).
17763
17764         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17765         and elif are processed always.  The other pre-processing
17766         directives are only processed if we are "taking" the path
17767
17768 2002-03-29  Martin Baulig  <martin@gnome.org>
17769
17770         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17771         current location is not Null.
17772
17773         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17774         a separate method so we can profile it.
17775
17776         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17777         `span.Seconds' are just seconds, but no minutes or hours.
17778         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17779
17780 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17781
17782         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17783         Remove the gratuitous set of Final:
17784
17785                                 // If an interface implementation, then we can set Final.
17786                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17787                                     implementing.DeclaringType.IsInterface)
17788                                         flags |= MethodAttributes.Final;
17789
17790         I do not know what I was smoking when I used that.
17791
17792
17793         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17794         step into fixing the name resolution issues for delegates and
17795         unifying the toplevel name resolution.
17796
17797 2002-03-28  Martin Baulig  <martin@gnome.org>
17798
17799         * class.cs (Method.Emit): If we have a symbol writer, call its
17800         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17801         tell it about the current method.
17802
17803         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17804         writer that we're going to emit the first byte of IL code for a new
17805         statement (a new source line).
17806         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17807         EmitContext.Mark() before emitting any code.
17808
17809         * location.cs (SymbolDocument): Return null when we're Null.
17810
17811         * statement.cs (Statement): Moved the `Location loc' variable here.
17812         (Statement.EmitBoolExpression): If we have a symbol writer, call
17813         ec.Mark() before emitting any code to tell it that we're at the
17814         beginning of a new statement.
17815         (StatementExpression): Added `Location' argument to the constructor.
17816         (Block): Added public readonly variable `StartLocation' and public
17817         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17818         (Block): Added constructor which takes a start and end location.
17819         (Block.SetEndLocation): New method. This sets the end location.
17820         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17821         local variables we create.
17822         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17823         each statement and do also mark the begin and end of the block.
17824
17825         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17826         tell it the current lexer.Location, use Location.Null for the end of the
17827         block.
17828         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17829         current block, set its end location using SetEndLocation().
17830         (statement_expression): StatementExpression constructor now takes the
17831         lexer.Location as additional argument.
17832         (for_statement, declare_local_variables): Likewise.
17833         (declare_local_variables): When creating a new implicit block, use the
17834         new Block constructor and pass it the lexer.Location.
17835
17836 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17837
17838         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17839         members also on the parent interfaces recursively.
17840
17841 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17842
17843         * report.cs: Use new formats, since Gonzalo finished the missing
17844         bits. 
17845
17846         * expression.cs (Binary.ResolveOperator): added missing operator|
17847         operator& and operator^ for bool/bool.
17848
17849         * cs-parser.jay: CheckDef now takes a Location argument that is
17850         used to report errors more precisly (instead of reporting the end
17851         of a definition, we try to track something which is a lot closer
17852         to the source of the problem).
17853
17854         * cs-tokenizer.cs: Track global token use, so we can properly flag
17855         the use of #define/#undef after the first token has been seen.
17856
17857         Also, rename the reportXXXX to Error_DescriptiveName
17858
17859         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17860         TypeContainer, so that Enum and Interface can use this too.
17861
17862         * class.cs (TypeContainer.LookupInterfaceOrClass,
17863         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17864         `builder' argument.  Typically this was used to pass the parent
17865         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17866         the definition).  
17867
17868         The problem is that a nested class could trigger the definition of
17869         a toplevel class, and the builder would be obviously wrong in that
17870         case. 
17871
17872         So we drop this argument, and we compute dynamically the
17873         TypeBuilder/ModuleBuilder (the correct information was available
17874         to us anyways from DeclSpace.Parent)
17875
17876         * interface.cs (Interface.DefineInterface): Drop builder
17877         parameter cleanup like class.cs
17878
17879         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
17880         like class.cs
17881
17882         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17883         values. 
17884
17885         (Try.Emit): Propagate the returns value from the statement.
17886
17887         (Return.Emit): Even if we are leavning 
17888
17889         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17890
17891         * modifiers.cs: Fix the computation of MethodAttributes flags.
17892
17893 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17894
17895         * driver.cs: allow compilation of files that start with '/'.
17896         Add a default case when checking the argument of --target.
17897
17898 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
17899
17900         * interface.cs: Implement the same search algorithm for types in
17901         the interface code.
17902
17903         * delegate.cs: Do not allow multiple definition.
17904
17905         * Recovered ChangeLog that got accidentally amputated
17906
17907         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17908
17909         * rootcontext.cs: Load manually enum to allow core classes to
17910         contain enumerations.
17911
17912         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17913         Update to new static methods in TypeManager.
17914
17915         * typemanager.cs (GetMethod, GetConstructor): Use our
17916         implementation of FindMembers to find the members, since during
17917         corlib compilation, the types are TypeBuilders and GetMethod and
17918         GetConstructor do not work.
17919
17920         Make all methods in TypeManager static.
17921
17922         (InitCodeHelpers): Split the functionality from
17923         the InitCodeTypes function.
17924
17925         * driver.cs: Call InitCodeHelpers after we have populated the
17926         types. 
17927
17928         * cs-parser.jay (delegate_declaration): we did not used to compute
17929         the delegate name correctly for void delegates.
17930
17931 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
17932
17933         * rootcontext.cs (RootContext): Init the interface_resolve_order
17934         and type_container_resolve_order always.
17935
17936         (ResolveCore, BootstrapCorlib_ResolveClass,
17937         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17938         compiler when compiling with --nostdlib
17939
17940         * class.cs (TypeContainer.DefineType): Check that our parent is
17941         not null.  This test is most important when we are bootstraping
17942         the core types.
17943
17944         * codegen.cs: Split out the symbol writing code.
17945
17946 2002-03-25  Martin Baulig  <martin@gnome.org>
17947
17948         * driver.cs (-g): Made -g an alias for --debug.
17949
17950 2002-03-24  Martin Baulig  <martin@gnome.org>
17951
17952         * codegen.cs (SymbolWriter): New public variable. Returns the
17953         current symbol writer.
17954         (CodeGen): Added `bool want_debugging_support' argument to the
17955          constructor. If true, tell the ModuleBuild that we want debugging
17956         support and ask it for the ISymbolWriter.
17957         (Save): If we have a symbol writer, call it's Close() method after
17958         saving the assembly.
17959
17960         * driver.c (--debug): New command line argument to create a
17961         debugger information file.
17962
17963         * location.cs (SymbolDocument): New public property. Returns an
17964         ISymbolDocumentWriter object for the current source file or null
17965         if we don't have a symbol writer.
17966
17967 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
17968
17969         * driver.cs (LoadAssembly): Correctly return when all the paths
17970         have been tried and not before.
17971
17972         * statement.cs (Switch.Emit): return the actual coverage for this
17973         statement (returns/not-returns)
17974
17975         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17976         switch of the statement if we are the last switch section.  That
17977         kills two problems: try/catch problems (we used to emit an empty
17978         nop at the end) and switch statements where all branches would
17979         return. 
17980
17981 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17982
17983         * driver.cs: Add default assemblies (the equivalent to the
17984         Microsoft CSC.RSP file)
17985
17986         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17987         also update tokens_seen and set it to false.
17988
17989         * driver.cs: Implement --recurse for Mike.
17990
17991         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17992         correctly splitting out the paths.
17993
17994 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
17995
17996         * interface.cs (Interface.PopulateProperty): Instead of using
17997         `parent' as the declaration space for the set parameters, use
17998         `this' 
17999
18000         * support.cs (InternalParameters): InternalParameters constructor
18001         takes a DeclSpace instead of a TypeContainer.
18002
18003         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18004         types are being initialized, load the address of it before calling
18005         the function.  
18006
18007         (New): Provide a mechanism to disable the generation of local
18008         value type temporaries when the caller will be providing us with
18009         an address to store it.
18010
18011         (ArrayCreation.EmitDynamicInitializers): Use it.
18012
18013 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18014
18015         * expression.cs (Invocation.EmitArguments): Only probe for array
18016         property if there is more than one argument.  Sorry about that.
18017
18018         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18019         empty param arrays.
18020
18021         * class.cs (Method.LabelParameters): Fix incorrect code path that
18022         prevented the `ParamArrayAttribute' from being applied to the
18023         params attribute.
18024
18025 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18026
18027         * support.cs (ReflectionParameters): Correctly compute whether the
18028         last argument is a params array.  Fixes the problem with
18029         string.Split ('a')
18030
18031         * typemanager.cs: Make the assemblies array always be non-null
18032         (empty, but non-null)
18033
18034         * tree.cs (RecordDecl): New function that abstracts the recording
18035         of names.  This reports error 101, and provides a pointer to the
18036         previous declaration.  Fixes a crash in the compiler.
18037
18038         * cs-parser.jay (constructor_declaration): Update to new grammar,
18039         and provide a constructor_body that can be empty.
18040
18041 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18042
18043         * driver.cs: Add support for --resources.
18044
18045         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18046         Make all types for the various array helper methods be integer.
18047
18048         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18049         CheckState to ConvCast.
18050
18051         (ConvCast): Now it takes a `checked' state argument, to avoid
18052         depending on the emit context for the conversion, and just using
18053         the resolve time setting.
18054
18055         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18056         instead of Invocation.EmitArguments.  We do not emit the original
18057         arguments, instead we emit those which have been converted to
18058         unsigned int expressions.
18059
18060         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18061
18062         * codegen.cs: ditto.
18063
18064         * expression.cs (LocalVariableReference): Drop the use of the
18065         Store function that depended on the variable index.
18066
18067         * statement.cs (VariableInfo): Drop the `Idx' property from this
18068         class, as this is not taking into account the indexes for
18069         temporaries tat we generate during the execution, getting the
18070         indexes wrong.
18071
18072         * class.cs: First emit class initializers, then call the parent
18073         constructor. 
18074
18075         * expression.cs (Binary): Fix opcode emision.
18076         (UnaryMutator.EmitCode): Support checked code generation
18077
18078         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18079         matches for events for both the Static and Instance scans,
18080         pointing to the same element.   Fix that.
18081
18082 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18083
18084         * rootcontext.cs (ResolveTree): Always set the
18085         interface_resolve_order, because nested interfaces will be calling
18086         into us.
18087
18088         * class.cs (GetInterfaceOrClass): Track the same resolution
18089         process used by TypeManager.LookupType.  This fixes the nested
18090         type lookups in class declarations (separate path from
18091         LookupType). 
18092
18093         (TypeContainer.DefineType): Also define nested interfaces.
18094         (TypeContainer.RegisterOrder): New public function used to
18095         register the order in which child interfaces need to be closed.
18096
18097         Nested interfaces need to be closed after their parents have been
18098         created. 
18099
18100         * interface.cs (InterfaceAttr): Put all the logic for computing
18101         the interface attribute here. 
18102
18103         (DefineInterface): Register our interface order with the
18104         RootContext or with the TypeContainer depending on the case.
18105
18106 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18107
18108         * cs-parser.jay: rework foreach statement to work with the new
18109         changes to the policy on SimpleNames.
18110
18111         * report.cs: support Stacktrace on warnings as well.
18112
18113         * makefile: drop --unsafe and /unsafe from the compile.
18114
18115 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18116
18117         * ecore.cs (StandardConversionExists): Modify to take an Expression
18118         as the first parameter. Ensure we do null -> reference type conversion
18119         checking.
18120
18121         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18122         temporary Expression objects.
18123
18124 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18125
18126         * interface.cs: workaround bug in method overloading resolution
18127         (there is already a bugzilla bug for it).
18128
18129 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18130
18131         We could also solve this problem by having a separate path for
18132         performing type lookups, instead of DoResolve, we could have a
18133         ResolveType entry point, and only participating pieces of the
18134         production (simplename, deref, array) would implement this. 
18135
18136         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18137         signal SimpleName to only resolve type names and not attempt to
18138         resolve anything else.
18139
18140         * expression.cs (Cast): Set the flag.
18141
18142         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18143
18144         * class.cs: Only report 108 if there is no `new' modifier.
18145
18146         * cs-parser.jay: rework foreach statement to work with the new
18147         changes to the policy on SimpleNames.
18148
18149         * report.cs: support Stacktrace on warnings as well.
18150
18151         * makefile: drop --unsafe and /unsafe from the compile.
18152
18153 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18154
18155         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18156         lookups here, instead of doing that at parse time.  This means
18157         that our grammar will not introduce `LocalVariableReferences' as
18158         expressions at this point.  That solves the problem of code like
18159         this:
18160
18161         class X {
18162            static void Main ()
18163            { int X = 1;
18164             { X x = null }}}
18165
18166         This is only half the fix.  The full fix requires parameters to
18167         also be handled in this way.
18168
18169         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18170         makes the use more obvious of the DeclSpace.  The
18171         ec.TypeContainer.TypeBuilder is now only used to pull the
18172         TypeBuilder for it.
18173
18174         My theory is that I can get rid of the TypeBuilder completely from
18175         the EmitContext, and have typecasts where it is used (from
18176         DeclSpace to where it matters).  
18177
18178         The only pending problem is that the code that implements Aliases
18179         is on TypeContainer, and probably should go in DeclSpace.
18180
18181         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18182         lookups here, instead of doing that at parse time.  This means
18183         that our grammar will not introduce `LocalVariableReferences' as
18184         expressions at this point.  That solves the problem of code like
18185         this:
18186
18187         class X {
18188            static void Main ()
18189            { int X = 1;
18190             { X x = null }}}
18191
18192         This is only half the fix.  The full fix requires parameters to
18193         also be handled in this way.
18194
18195         * class.cs (Property.DefineMethod): When implementing an interface
18196         method, set newslot, when implementing an abstract method, do not
18197         set the flag (before we tried never setting it, or always setting
18198         it, which is the difference).
18199         (Indexer.DefineMethod): same.
18200         (Method.DefineMethod): same.
18201
18202         * ecore.cs: Only set the status used flag if we get back a Field.
18203
18204         * attribute.cs: Temporary hack, so Paolo can keep working.
18205
18206 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18207
18208         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18209         the unmanaged type in the case we have a MarshalAs attribute.
18210
18211         (Resolve): Handle the case when we are parsing the special MarshalAs
18212         attribute [we need to store the unmanaged type to use later]
18213
18214         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18215         MarshalAs Attribute.
18216
18217         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18218         on parameters and accordingly set the marshalling info.
18219
18220 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18221
18222         * class.cs: Optimizing slightly by removing redundant code after
18223         we switched to the `NoTypes' return value.
18224         (Property.DefineMethod): use NoTypes here too.
18225
18226         This fixes the bug I introduced in my last batch of changes.
18227
18228 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18229
18230         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18231
18232         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18233         Enums since those are types too. 
18234
18235         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18236
18237         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18238         thanks to a call during the lookup process.
18239
18240 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18241
18242         * statement.cs (Foreach): Lots of work to accomodate a particular
18243         kind of foreach statement that I had not kept in mind.  It is
18244         possible to have foreachs on classes that provide a GetEnumerator
18245         method that return objects that implement the "pattern" for using
18246         a foreach, there is no need to support GetEnumerator
18247         specifically. 
18248
18249         This is needed to compile nant.
18250
18251         * decl.cs: Only report 114 if the member is not `Finalize' and if
18252         the warning level is at least 2.
18253
18254         * class.cs: Moved the compare function from Method to
18255         MethodSignature. 
18256
18257         (MethodSignature.InheritableMemberSignatureCompare): Add new
18258         filter function that is used to extract inheritable methods from a
18259         class. 
18260
18261         (Method.Define): Use the new `inheritable_method_signature_filter'
18262         delegate
18263
18264         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18265         command. 
18266
18267 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18268
18269         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18270
18271         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18272
18273         * expression.cs: Pass location information to
18274         ConvertImplicitStandard. 
18275
18276         * class.cs: Added debugging code to track return values from
18277         interfaces. 
18278
18279 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18280
18281         * expression.cs (Is.DoResolve): If either side of the `is' is an
18282         interface, do not flag the warning.
18283
18284         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18285         for interfaces
18286
18287         * report.cs: Allow for --fatal to be used with --probe.
18288
18289         * typemanager.cs (NoTypes): Move the definition for the empty Type
18290         array here. 
18291
18292         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18293         properties. 
18294         (TypeContainer.DefineProxy): New function used to proxy to parent
18295         implementations when implementing interfaces.
18296         (TypeContainer.ParentImplements): used to lookup if our parent
18297         implements a public function that is required by an interface.
18298         (TypeContainer.VerifyPendingMethods): Hook this up.
18299
18300         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18301         `modules' and `assemblies' arraylists into arrays.  We only grow
18302         these are the very early start up of the program, so this improves
18303         the speedof LookupType (nicely measured).
18304
18305         * expression.cs (MakeByteBlob): Replaced unsafe code with
18306         BitConverter, as suggested by Paolo.
18307
18308         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18309         folding of string concatenation, but if either side is a string,
18310         and the other is not, then return null, and let the runtime use
18311         the concatenation on the string plus the object (using
18312         `Object.ToString'). 
18313
18314 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18315
18316         Constant Folding has been implemented now.
18317
18318         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18319         the error instead on types that are not supported in one's
18320         complement. 
18321
18322         * constant.cs (Constant and all children): New set of functions to
18323         perform implict and explicit conversions.
18324
18325         * ecore.cs (EnumConstant): Implement the new functions to perform
18326         conversion by proxying to the child expression.
18327
18328         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18329         own separate setting that can not be turned off from the command
18330         line using --unchecked or --checked and is only controlled using
18331         the checked/unchecked statements and expressions.  This setting is
18332         used by the constant folder to flag errors.
18333
18334         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18335         ConstantCheckState as well.   
18336
18337         During Resolve, they also have to flag the state, because the
18338         constant folder runs completely in the Resolve phase.
18339
18340         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18341         well.
18342
18343 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18344
18345         * cfold.cs: New file, this file contains the constant folder.
18346
18347         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18348         argument to track whether we are using the resulting address to
18349         load or store a value and provide better error messages. 
18350
18351         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18352         new AddressOf arguments.
18353
18354         * statement.cs (Foreach.EmitCollectionForeach): Update
18355
18356         * expression.cs (Argument.Emit): Call AddressOf with proper
18357         arguments to track usage.
18358
18359         (New.DoEmit): Call AddressOf with new arguments.
18360
18361         (Unary.Emit): Adjust AddressOf call.
18362
18363 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18364
18365         * cs-parser.jay (member_access): Change the case for pre-defined types
18366         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18367         this suggestion.
18368
18369         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18370         a method body.
18371
18372         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18373         essentially like methods and apply attributes like MethodImplOptions to them too.
18374
18375         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18376         not being null.
18377
18378         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18379         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18380         is the DeclSpace.
18381
18382         * Update code everywhere accordingly.
18383
18384         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18385
18386         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18387
18388 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18389
18390         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18391         try performing lookups against those instead of jumping straight into using
18392         the 'using' clauses.
18393
18394         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18395
18396         (LookupType): Perform lookups in implicit parents too.
18397
18398         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18399         sequence as RootContext.LookupType. 
18400
18401         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18402         the various cases of namespace lookups into this method.
18403
18404 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18405
18406         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18407         in positional arguments)
18408
18409         * class.cs (Operator): Update the AllowedModifiers to contain
18410         extern. 
18411
18412         * cs-parser.jay: Update operator declaration to allow for the
18413         operator body to be empty.
18414
18415         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18416         values. 
18417
18418 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18419
18420         * class.cs (Method.Emit): Label parameters.
18421
18422         * driver.cs: Return 1 or 0 as the program exit code.
18423
18424 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18425
18426         * expression.cs: Special case the `null' object when trying to
18427         auto-compute the type, as anything can be explicitly converted to
18428         that. 
18429
18430         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18431         spotting this Paolo.
18432
18433         (Expression.ImplicitNumericConversion): Perform comparissions of
18434         the type using the underlying type in the case of an enumeration
18435         rather than using the enumeration type for the compare.
18436
18437         Cope with the underlying == type case, which is not possible to
18438         catch before. 
18439
18440         (Expression.ConvertNumericExplicit): Perform comparissions of
18441         the type using the underlying type in the case of an enumeration
18442         rather than using the enumeration type for the compare.
18443
18444         * driver.cs: If the user does not supply an extension, assume .exe
18445
18446         * cs-parser.jay (if_statement): Rewrote so that we can track the
18447         location for the if statement.
18448
18449         * expression.cs (Binary.ConstantFold): Only concat strings when
18450         the operation is "+", not everything ;-)
18451
18452         * statement.cs (Statement.EmitBoolExpression): Take a location
18453         argument. 
18454         (If, While, Do): Track location.
18455
18456         * expression.cs (Binary.ResolveOperator): In the object + string
18457         case, I was missing a call to ConvertImplicit
18458
18459 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18460
18461         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18462         Location arguments. Ensure we use RootContext.LookupType to do our work
18463         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18464
18465         * interface.cs (PopulateMethod): Handle the type of the parameter being
18466         null gracefully.
18467
18468         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18469         have a params method with no fixed arguments and a call is made with no
18470         arguments.
18471
18472 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18475         the verbatim-string-literal
18476
18477         * support.cs (InternalParameters.ParameterModifier): handle null
18478         fixed parameters.
18479         (InternalParameters.ParameterType): ditto.
18480
18481         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18482         duplicating the name of the variable parameter.
18483         (GetParameterByName): Fix bug where we were not looking up array
18484         paramters if they were the only present (thanks Paolo!).
18485         (GetParameterInfo): We only have an empty set of types if both
18486         fixed and array are set to null.
18487         (GetParameterInfo-idx): Handle FixedParameter == null
18488
18489         * cs-parser.jay: Handle the case where there is no catch
18490         statements (missing null test).
18491
18492 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18493
18494         * driver.cs (MainDriver): Be conservative on our command line
18495         handling.
18496
18497         Catch DirectoryNotFoundException when calling GetFiles.
18498
18499         (SplitPathAndPattern): Used to split the input specification into
18500         a path and a pattern that we can feed to Directory.GetFiles.
18501
18502 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18503
18504         * statement.cs (Fixed): Implement the last case of the Fixed
18505         statement (string handling).
18506
18507         * expression.cs (StringPtr): New class used to return a char * to
18508         a string;  Used by the Fixed statement.
18509
18510         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18511
18512         * expression.cs (Binary.ResolveOperator): Remove redundant
18513         MemberLookup pn parent type.
18514         Optimize union call, we do not need a union if the types are the same.
18515         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18516         type.
18517
18518         Specialize the use of MemberLookup everywhere, instead of using
18519         the default settings. 
18520
18521         (StackAlloc): Implement stackalloc keyword.
18522
18523         * cs-parser.jay: Add rule to parse stackalloc.
18524
18525         * driver.cs: Handle /h, /help, /?
18526
18527         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18528         before we supported unsafe code.
18529
18530         * makefile: add --unsafe to the self compilation of mcs.
18531
18532 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18533
18534         * expression.cs (PointerArithmetic): New class that is used to
18535         perform pointer arithmetic.
18536         (Binary.Resolve): Handle pointer arithmetic
18537         Handle pointer comparission.
18538         (ArrayPtr): Utility expression class that is used to take the
18539         address of an array.
18540
18541         (ElementAccess): Implement array access for pointers
18542
18543         * statement.cs (Fixed): Implement fixed statement for arrays, we
18544         are missing one more case before we are done.
18545
18546         * expression.cs (Indirection): Implement EmitAssign and set the
18547         ExprClass to Variable.  This allows pointer dereferences to be
18548         treated as variables, and to have values assigned to them.
18549
18550         * ecore.cs (Expression.StoreFromPtr): New utility function to
18551         store values dereferencing.
18552
18553 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18554
18555         * expression.cs (Binary.ResolveOperator): Ensure that we are
18556         not trying to operate on a void type - this fixes the reported
18557         bug.
18558
18559         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18560         the parent implementation is sealed.
18561
18562         * ../errors/cs0239.cs : Add.
18563
18564         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18565
18566         * typemanager.cs (unverifiable_code_type): Corresponds to 
18567         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18568         which have unsafe code in them.
18569
18570         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18571         unsafe context.
18572
18573 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18574
18575         * cs-tokenizer.cs: Add support for @"litreal strings"
18576
18577         Make tokenizer accept pre-processor directives
18578         on any column (remove the old C-like limitation). 
18579
18580         * rootcontext.cs (EmitCode): Emit any global attributes.
18581         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18582
18583         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18584
18585         * cs-parser.jay: Add support for global attributes.  
18586
18587 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18588
18589         * expression.cs (Indirection): New helper class.  Unary will
18590         create Indirection classes to be able to implement the
18591         IMemoryLocation interface on it.
18592
18593 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18594
18595         * cs-parser.jay (fixed_statement): reference the right statement.
18596
18597         * statement.cs (Fixed.Emit): Finish implementing the fixed
18598         statement for the &x case.
18599
18600 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18601
18602         * class.cs (Property.Define, Method.Define): Remove newslot when
18603         `implementing'.  
18604
18605         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18606         wrong.  NewSlot should only be used if the `new' keyword is present.
18607
18608         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18609         locating our system dir.  Sorry about this.
18610
18611 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18612
18613         * driver.cs (GetSystemDir): Compute correctly the location of our
18614         system assemblies.  I was using the compiler directory instead of
18615         the library directory.
18616
18617 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18618
18619         * expression.cs (BetterFunction): Put back in what Miguel commented out
18620         since it is the correct fix. The problem is elsewhere ;-)
18621
18622         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18623         parameters of the parms method are themselves compatible or not !
18624
18625         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18626         to check that a class implements an interface before saying that an implicit
18627         conversion was allowed. Use ImplementsInterface to do the checking.
18628
18629 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18630
18631         * class.cs (Method.Define): Track whether we are an explicit
18632         implementation or not.  And only call DefineMethodOverride if we
18633         are an explicit implementation.
18634
18635         (Property.DefineMethod): Ditto.
18636
18637 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18638
18639         * expression.cs (BetterFunction): Catch hideous bug which was
18640          preventing us from detecting ambiguous calls due to implicit casts i.e
18641         cs0121.
18642
18643 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18644
18645         * support.cs (Pair): Remove un-needed method.  I figured why I was
18646         getting the error in cs-parser.jay, the variable in a foreach loop
18647         is readonly, and the compiler does not really treat this as a variable.
18648
18649         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18650         instead of EQUALS in grammar.  
18651
18652         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18653
18654         * expression.cs (Unary.DoResolve): Check whether the argument is
18655         managed or not.
18656
18657 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18658
18659         * support.cs: Api for Pair to set a value.  Despite the fact that
18660         the variables are public the MS C# compiler refuses to compile
18661         code that accesses the field if the variable is part of a foreach
18662         statement. 
18663
18664         * statement.cs (Fixed): Begin implementation of the fixed
18665         statement.
18666
18667         (Block.AddVariable): Return the VariableInfo on success and null
18668         on failure instead of true/false. 
18669
18670         * cs-parser.jay (foreach): Catch errors on variables already
18671         defined (we were ignoring this value before) and properly unwind
18672         the block hierarchy
18673
18674         (fixed_statement): grammar for the fixed statement.
18675
18676 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18677
18678         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18679         pointer types to be incretemented.
18680
18681         (SizeOf): Implement.
18682
18683         * cs-parser.jay (pointer_member_access): Implement
18684         expr->IDENTIFIER production.
18685
18686         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18687         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18688         on safe contexts.
18689
18690         (Unary): Implement indirection.
18691
18692         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18693         use in non-unsafe context).
18694
18695         (SimpleName.DoResolve): Check for pointers in field access on safe
18696         contexts. 
18697
18698         (Expression.LoadFromPtr): Factor the load-indirect code in this
18699         function.  This was duplicated in UnboxCast and ParameterReference
18700
18701 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18702
18703         * expression.cs (ComposedCast): report an error if a pointer cast
18704         is used in a safe region.
18705
18706         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18707         pointer type casts in unsafe context.
18708
18709         * codegen.cs (EmitContext): Set up IsUnsafe.
18710
18711         * cs-parser.jay (non_expression_type): Add productions for pointer
18712         casts. 
18713
18714         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18715         code.  We should not use force into static mode if the method is
18716         not virtual.  Fixes bug in MIS
18717
18718         * statement.cs (Do.Emit, While.Emit, For.Emit,
18719         Statement.EmitBoolExpression): Add support to Do and While to
18720         propagate infinite loop as `I do return' semantics.
18721
18722         Improve the For case to also test for boolean constants.
18723
18724         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18725         to the list of attributes we can add.
18726
18727         Remove `EmitContext' argument.
18728
18729         * class.cs (Method.Define): Apply parameter attributes.
18730         (Constructor.Define): Apply parameter attributes.
18731         (MethodCore.LabelParameters): Move here the core of labeling
18732         parameters. 
18733
18734         * support.cs (ReflectionParameters.ParameterModifier,
18735         InternalParameters.ParameterModifier): Use IsByRef on the type and
18736         only return the OUT bit for these parameters instead of in/out/ref
18737         flags.
18738
18739         This is because I miss-understood things.  The ParameterInfo.IsIn
18740         and IsOut represent whether the parameter has the [In] and [Out]
18741         attributes set.  
18742
18743 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18744
18745         * ecore.cs (FieldExpr.Emit): Release temporaries.
18746
18747         * assign.cs (LocalTemporary.Release): new function.
18748
18749         * codegen.cs (EmitContext.GetTemporaryStorage,
18750         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18751         temporary storage.  Now we can "put back" localbuilders when we
18752         are done with them
18753
18754 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18755
18756         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18757         need to make a copy of the variable to generate verifiable code.
18758
18759 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18760
18761         * driver.cs: Compute dynamically the system directory.
18762
18763         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18764         Slower, but more generally useful.  Used by the abstract
18765         registering implementation. 
18766
18767         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18768         the rules for the special rule on Type/instances.  First check if
18769         we have the same name, and if so, try that special static path
18770         rather than the instance path.
18771
18772 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18773
18774         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18775         for, while and if.
18776
18777         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18778         Enum, ValueType, Delegate or Array for non-corlib compiles.
18779
18780         * cs-tokenizer.cs: Catch long identifiers (645)
18781
18782         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18783         piece of code.
18784
18785         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18786         fix, we were returning too early, so we were not registering
18787         pending methods from abstract classes.
18788
18789         Do not register pending methods if the class is abstract.
18790
18791         * expression.cs (Conditional.DoResolve): Report circular implicit
18792         conversions when we neecd to compute it for conditional
18793         expressions. 
18794
18795         (Is.DoResolve): If the expression is always of the provided type,
18796         flag warning 183.  If the expression can not ever be of the
18797         provided type flag warning 184.
18798
18799         * class.cs: Catch 169 as well.
18800
18801         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18802         read. 
18803
18804 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18805
18806         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18807
18808 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18809
18810         * interface.cs: (PopulateMethod): Check for pointers being defined
18811         only if the unsafe context is active.
18812         (PopulateProperty): ditto.
18813         (PopulateIndexer): ditto.
18814
18815         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18816         specified.  If pointers are present, make sure that they are
18817         present in an unsafe context.
18818         (Constructor, Constructor.Define): ditto.
18819         (Field, Field.Define): ditto.
18820         (Property, Property.Define): ditto.
18821         (Event, Event.Define): ditto.
18822
18823         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18824         hashtable if there are classes or structs defined.
18825
18826         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18827         code, as the constant resolution moved.
18828
18829         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18830         the metadata, so we can flag error 133. 
18831
18832         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18833         pointer is being declared in an unsafe context.
18834
18835 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18836
18837         * modifiers.cs (Modifiers.Check): Require a Location argument.
18838         Report error 227 for Unsafe use.
18839
18840         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18841
18842         * statement.cs (For.Emit): If the test is null, then report that
18843         we do `return', as we wont reach anything afterwards.
18844
18845         (Switch.SwitchGoverningType): Track the expression that matched
18846         the conversion.
18847
18848         * driver.cs: Allow negative numbers as an error code to flag.
18849
18850         * cs-parser.jay: Handle 1551.
18851
18852         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18853
18854 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18855
18856         * cs-parser.jay: Report 1518 (type declaration can only contain
18857         class, struct, interface, enum or delegate)
18858
18859         (switch_label): Report 1523 (keywords `case' or `default' must
18860         preced code)
18861
18862         (opt_switch_sections): Report 1522 (empty switch)
18863
18864         * driver.cs: Report 1515 (response file specified multiple times)
18865         Report 1516 (Source file specified multiple times).
18866
18867         * expression.cs (Argument.Resolve): Signal 1510
18868
18869         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18870         access not allowed in static code)
18871
18872 2002-01-11  Ravi Pratap  <ravi@ximian.com>
18873
18874         * typemanager.cs (IsPointerType): Utility method which we are going
18875         to need a lot.
18876
18877         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18878         the object type, so we take care of that.
18879
18880         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18881
18882         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18883         added to non-params parameters :-)
18884
18885         * typemanager.cs (CSharpName): Include 'void' type too. 
18886
18887         (void_ptr_type): Include in the set of core types.
18888
18889         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
18890         duplicating code.
18891
18892         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
18893         an unsafe context.
18894
18895         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
18896         completely forgotten about it.
18897
18898 2002-01-10  Ravi Pratap  <ravi@ximian.com>
18899
18900         * cs-parser.jay (pointer_type): Add. This begins our implementation
18901         of parsing rules for unsafe code.
18902
18903         (unsafe_statement): Implement.
18904
18905         (embedded_statement): Modify to include the above.
18906
18907         * statement.cs (Unsafe): Implement new class for unsafe blocks.
18908
18909         * codegen.cs (EmitContext.InUnsafe): Add. This determines
18910         if the current context is an unsafe one.
18911
18912         * cs-parser.jay (local_variable_pointer_type): Since local variable types
18913         are handled differently, we need separate rules for them.
18914
18915         (local_variable_declaration): Update to use local_variable_pointer_type
18916         to allow variable declarations of unmanaged pointer types.
18917
18918         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18919         in unsafe contexts.
18920
18921         * ../errors/cs0214.cs : Add.
18922
18923 2002-01-16  Nick Drochak  <ndrochak@gol.com>
18924
18925         * makefile: remove 'response' file when cleaning.
18926
18927 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18928
18929         * cs-parser.jay: Report 1524.
18930
18931 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
18932
18933         * typemanager.cs (RegisterMethod): drop checking if we have
18934         registered this from here
18935
18936 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
18937
18938         * class.cs (Method.EmitDestructor): Implement calling our base
18939         destructor. 
18940
18941         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18942         value of InFinally.
18943
18944         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18945         this routine and will wrap the call in a try/catch block.  Deal
18946         with the case.
18947
18948 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
18949
18950         * ecore.cs (Expression.MemberLookup): instead of taking a
18951         parameter `same_type' that was used to tell whether we could
18952         access private members we compute our containing type from the
18953         EmitContext.
18954
18955         (FieldExpr): Added partial support for volatile fields.  This does
18956         not work for volatile fields exposed from assemblies, as I can not
18957         figure out how to extract the modreq from it.
18958
18959         Updated all the source files to use this.
18960
18961         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18962         because it is referenced by MemberLookup very often. 
18963
18964 2002-01-09  Ravi Pratap  <ravi@ximian.com>
18965
18966         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18967         TypeBuilder.GetCustomAttributes to retrieve what we need.
18968
18969         Get rid of redundant default_member_attr_type as this is the same as
18970         default_member_type which already exists.
18971
18972         * interface.cs, attribute.cs : Update accordingly.
18973
18974 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18975
18976         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18977         work for TYpeBuilders though.  Ravi, can you please fix this?
18978
18979         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18980
18981         * expression.cs (Argument.Emit): Handle the case of ref objects
18982         being passed to ref functions;  
18983
18984         (ParameterReference.EmitLoad): Loads the content of the pointer
18985         without dereferencing.
18986
18987 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18988
18989         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18990
18991 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18992
18993         * class.cs (Indexer.DefineMethod): Incorporate the interface
18994         type in the name of the method if we are doing explicit interface
18995         implementation.
18996
18997         * expression.cs (ConversionExists): Remove as it is completely obsolete.
18998
18999         (BetterConversion): Fix extremely trivial bug where we were referring to
19000         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19001         again !
19002
19003         * ../errors/bug16.cs : Add although we have fixed it.
19004
19005 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19006
19007         * expression.cs (BaseIndexer): Begin implementation.
19008
19009         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19010
19011         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19012         production directly to remove a shift/reduce, and implement
19013         explicit interface implementation.
19014
19015         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19016         after a floating point suffix.
19017
19018         * expression.cs (DoNumericPromotions): Improved the conversion for
19019         uint/uint.  If we have a constant, we avoid doing a typecast to a
19020         larger type.
19021
19022         * class.cs (Indexer): Implement explicit interface implementation
19023         for indexers.
19024
19025 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19026
19027         * class.cs: make the default instance constructor public and hidebysig.
19028
19029 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19030
19031         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19032         so we can call it from elsewhere.
19033
19034         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19035         we emit it internally if the class has a defined indexer; otherwise the user
19036         emits it by decorating the class definition with the DefaultMemberAttribute.
19037
19038         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19039         attribute is not used on a type which defines an indexer.
19040
19041         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19042         character when we skip whitespace.
19043
19044         * ../errors/cs0646.cs : Add.
19045
19046 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19047
19048         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19049         again. 
19050
19051         * makefile: Add practical target `mcs3.exe' which builds the third
19052         generation compiler. 
19053
19054         * expression.cs (New): Fix structures constructor calling.
19055
19056         * class.cs (Property, Method, Indexer): Emit Final flag on the
19057         method if we are an interface implementation and we are not
19058         abstract. 
19059
19060         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19061         whether this property is referencing a `base' method.
19062
19063         * expression.cs (Invocation.EmitCall): take an extra argument:
19064         is_base, this is used to determine whether the `call' or
19065         `callvirt' opcode should be used.
19066
19067
19068         * delegate.cs: update EmitCall.
19069
19070         * class.cs (Method.Define): Set NewSlot for the cases where we are
19071         not implementing an interface method.
19072
19073         (Property.Define): ditto.
19074
19075 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19076
19077         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19078         'r'.  Allows mcs to parse itself fully.
19079
19080 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19081
19082         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19083         of the number of initializers that require the InitializeArray method.
19084
19085         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19086         update the above field where necessary.
19087
19088         (MakeByteBlob): Update accordingly.
19089
19090         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19091         greater than 2.
19092
19093         (EmitDynamicInitializers): Update in accordance with the new optimization.
19094
19095         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19096         same OpCode applies.
19097
19098         * cs-parser.jay : Fix some glaring errors I introduced.
19099
19100 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19101
19102         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19103         so that we can check for name clashes there too.
19104
19105         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19106         for interface indexers.
19107
19108         * interfaces.cs (Define): Emit the default member attribute.
19109
19110         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19111         variable was being referred to while setting the value ;-)
19112
19113 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19114
19115         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19116         byte-by-byte information when we know the data is zero.
19117
19118         Make the block always a multiple of 4, because
19119         DefineInitializedData has a bug.
19120
19121         * assign.cs: Fix, we should assign from the temporary, not from
19122         the source. 
19123
19124         * expression.cs (MakeByteBlob): Fix my incorrect code.
19125
19126 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19127
19128         * typemanager.cs (EnumToUnderlying): This function is used to get
19129         the underlying type from an enumeration, because it does not
19130         always work. 
19131
19132         * constant.cs: Use the I4_S form for values between -128 and 127.
19133
19134         * statement.cs (Block.LookupLabel): Looks up a label.
19135         (Block): Drop support for labeled blocks.
19136
19137         (LabeledStatement): New kind of statement that represents a label
19138         only.
19139
19140         (Goto): Finally implement this bad boy.
19141
19142         * cs-parser.jay: Update to reflect new mechanism to implement
19143         labels.
19144
19145 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19146
19147         * codegen.cs (EmitContext.This): a codegen property that keeps the
19148         a single instance of this instead of creating many different this
19149         instances. 
19150
19151         * delegate.cs (Delegate.DoResolve): Update to use the property;
19152
19153         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19154
19155         * expression.cs (BaseAccess.DoResolve): Ditto.
19156
19157 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19158
19159         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19160         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19161
19162         (InitCoreTypes): Update accordingly.
19163
19164         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19165         so we can quickly store the state.
19166
19167         (ApplyAttributes): Set the correct implementation flags
19168         for InternalCall methods.
19169
19170 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19171
19172         * expression.cs (EmitCall): if a method is not virtual, then do
19173         not use callvirt on it.
19174
19175         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19176         user defined stuff) requires the use of stobj, which takes an
19177         address on the stack instead of an array and an index.  So emit
19178         the Ldelema operation for it.
19179
19180         (EmitStoreOpcode): Use stobj for valuetypes.
19181
19182         (UnaryMutator.EmitCode): Use the right 1 value depending on
19183         whether we are dealing with int64/uint64, float or doubles.
19184
19185         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19186         constructors that I implemented last night.
19187
19188         (Constructor.IsDefault): Fix to work properly for static
19189         constructors.
19190
19191         * cs-parser.jay (CheckDef): report method signature errors.
19192         Update error number 103 to be 132.
19193
19194         * decl.cs: New AdditionResult enumeration value: MethodExists.
19195         Although we do this check for methods later on in the semantic
19196         analysis, catching repeated default constructors is so easy that
19197         we catch these here. 
19198
19199         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19200         promotions code.
19201
19202         (ParameterReference.EmitAssign, Emit): handle
19203         bools as bytes.
19204
19205         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19206         (ArrayAccess.EmitStoreOpcode): ditto.
19207
19208         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19209
19210         * expression.cs (MakeByteBlob): Complete all the missing types
19211         (uint, short, ushort, byte, sbyte)
19212
19213         * class.cs: Only init instance field initializers on instance
19214         constructors. 
19215
19216         Rename `constructors' to instance_constructors. 
19217
19218         (TypeContainer.AddConstructor): Only add constructors to the list
19219         if it is not static.
19220
19221         Make sure that we handle default_static_constructor independently
19222         everywhere where we handle instance_constructors
19223
19224 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19225
19226         * class.cs: Do not lookup or create a base initializer for a
19227         static constructor.
19228
19229         (ConstructorInitializer.Resolve): use the proper type to lookup
19230         for constructors.
19231
19232         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19233
19234         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19235         in DeclSpace. 
19236
19237         * decl.cs: CloseType is now an virtual method, the default
19238         implementation just closes this type.
19239
19240 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19241
19242         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19243         to PreserveSig by default. Also emit HideBySig on such methods.
19244
19245         Basically, set the defaults to standard values.
19246
19247         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19248         argument, if candidate is better, it can't be worse than the best !
19249
19250         (Invocation): Re-write bits to differentiate between methods being
19251         applicable in their expanded form and their normal form - for params
19252         methods of course.
19253
19254         Get rid of use_standard everywhere as only standard conversions are allowed
19255         in overload resolution. 
19256
19257         More spec conformance.
19258
19259 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19260
19261         * driver.cs: Add --timestamp, to see where the compiler spends
19262         most of its time.
19263
19264         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19265         `this' in static code.
19266
19267         (SimpleName.DoResolve): Implement in terms of a helper function
19268         that allows static-references to be passed upstream to
19269         MemberAccess.
19270
19271         (Expression.ResolveWithSimpleName): Resolve specially simple
19272         names when called by MemberAccess to implement the special
19273         semantics. 
19274
19275         (Expression.ImplicitReferenceConversion): Handle conversions from
19276         Null to reference types before others, as Null's type is
19277         System.Object. 
19278
19279         * expression.cs (Invocation.EmitCall): Handle the special case of
19280         calling methods declared on a reference type from a ValueType
19281         (Base classes System.Object and System.Enum)
19282
19283         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19284         the left hand side is a TypeExpr, not on every enumeration. 
19285
19286         (Binary.Resolve): If types are reference types, then do a cast to
19287         object on operators != and == of both arguments.
19288
19289         * typemanager.cs (FindMembers): Extract instance and static
19290         members if requested.
19291
19292         * interface.cs (PopulateProperty): Use void_type instead of null
19293         as the return type for the setter method.
19294
19295         (PopulateIndexer): ditto.
19296
19297 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19298
19299         * support.cs (ReflectionParameters): Fix minor bug where we
19300         were examining the wrong parameter for the ParamArray attribute.
19301
19302         Cope with requests for the type of the parameter at position
19303         greater than the params parameter's. We now return the element
19304         type of the params array as that makes more sense.
19305
19306         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19307         accordingly as we no longer have to extract the element type
19308         ourselves.
19309
19310         (Invocation.OverloadResolve): Update.
19311
19312 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19313
19314         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19315         against IEnumerator, test whether the return value is a descendant
19316         of the IEnumerator interface.
19317
19318         * class.cs (Indexer.Define): Use an auxiliary method to implement
19319         the other bits of the method definition.  Begin support for
19320         explicit interface implementation.
19321
19322         (Property.DefineMethod): Use TypeManager.void_type instead of null
19323         for an empty return value.
19324
19325 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19326
19327         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19328         dealing with a FieldExpr which is composed of a FieldBuilder, in
19329         the code path we did extract the constant, but we should have
19330         obtained the underlying value to be able to cast it (otherwise we
19331         end up in an infinite loop, this is what Ravi was running into).
19332
19333         (ArrayCreation.UpdateIndices): Arrays might be empty.
19334
19335         (MemberAccess.ResolveMemberAccess): Add support for section
19336         14.5.4.1 that deals with the special case of E.I when E is a type
19337         and something else, that I can be a reference to a static member.
19338
19339         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19340         handle a particular array type to create byte blobs, it is just
19341         something we dont generate byteblobs for.
19342
19343         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19344         arguments. 
19345
19346         * location.cs (Push): remove the key from the hashtable that we
19347         are about to add.   This happens for empty files.
19348
19349         * driver.cs: Dispose files after we have parsed them.
19350
19351         (tokenize): new function that only runs the tokenizer on its
19352         input, for speed testing.
19353
19354 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19355
19356         * class.cs (Event.Define): Define the private field only if there
19357         are no accessors defined.
19358
19359         * expression.cs (ResolveMemberAccess): If there is no associated
19360         field with the event, that means we have an event defined with its
19361         own accessors and we should flag error cs0070 since transforming
19362         ourselves into a field is not valid in that case.
19363
19364         * ecore.cs (SimpleName.DoResolve): Same as above.
19365
19366         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19367         and charset to sane values.
19368
19369 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19370
19371         * assign.cs (DoResolve): Perform check on events only if they 
19372         are being accessed outside the declaring type.
19373
19374         * cs-parser.jay (event_declarations): Update rules to correctly
19375         set the type of the implicit parameter etc.
19376
19377         (add_accessor, remove_accessor): Set current local parameters.
19378
19379         * expression.cs (Binary): For delegate addition and subtraction,
19380         cast the return value from the method into the appropriate delegate
19381         type.
19382
19383 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19384
19385         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19386         of these as the workaround is unnecessary.
19387
19388         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19389         delegate data - none of that is needed at all.
19390
19391         Re-write bits to extract the instance expression and the delegate method
19392         correctly.
19393
19394         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19395         on delegates too.
19396
19397         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19398         of attaching attributes instead of duplicating code everywhere.
19399
19400         * everywhere : Update code to do attribute emission using the above method.
19401
19402 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19403
19404         * expression.cs (IsParamsMethodApplicable): if there are not
19405         parameters, return immediately.
19406
19407         * ecore.cs: The 0 literal can be implicity converted to an enum
19408         type. 
19409
19410         (SimpleName.DoResolve): First lookup the type, then lookup the
19411         members. 
19412
19413         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19414         want to get its address.  If the InstanceExpression is not
19415         addressable, store the result in a temporary variable, then get
19416         the address of it.
19417
19418         * codegen.cs: Only display 219 errors on warning level or above. 
19419
19420         * expression.cs (ArrayAccess): Make it implement the
19421         IMemoryLocation interface.
19422
19423         (Binary.DoResolve): handle the operator == (object a, object b)
19424         and operator != (object a, object b) without incurring into a
19425         BoxedCast (because 5 != o should never be performed).
19426
19427         Handle binary enumerator operators.
19428
19429         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19430         value type, otherwise use Ldelem_ref.
19431
19432         Use precomputed names;
19433
19434         (AddressOf): Implement address of
19435
19436         * cs-parser.jay (labeled_statement): Fix recursive block
19437         addition by reworking the production.
19438
19439         * expression.cs (New.DoEmit): New has a special case:
19440                 
19441                  If we are dealing with a ValueType, we have a few
19442                  situations to deal with:
19443                 
19444                     * The target of New is a ValueType variable, that is
19445                       easy, we just pass this as the variable reference
19446                 
19447                     * The target of New is being passed as an argument,
19448                       to a boxing operation or a function that takes a
19449                       ValueType.
19450                 
19451                       In this case, we need to create a temporary variable
19452                       that is the argument of New.
19453
19454
19455 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19456
19457         * rootcontext.cs (LookupType): Check that current_type is not null before
19458         going about looking at nested types.
19459
19460         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19461         not implement the IAssignMethod interface any more.
19462
19463         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19464         where we tranform them into FieldExprs if they are being resolved from within
19465         the declaring type.
19466
19467         * ecore.cs (SimpleName.DoResolve): Do the same here.
19468
19469         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19470
19471         * ../errors/bug10.cs : Add.
19472
19473         * ../errors/cs0070.cs : Add.
19474
19475         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19476
19477         * assign.cs : Get rid of EventIsLocal everywhere.
19478
19479 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19480
19481         * ecore.cs (ConvertIntLiteral): finished the implementation.
19482
19483         * statement.cs (SwitchLabel): Convert the value we are using as a
19484         key before looking up the table.
19485
19486 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19487
19488         * codegen.cs (EmitTopBlock): Require a Location argument now.
19489
19490         * cs-parser.jay (constructor_declarator): We need to setup
19491         current_local_parameters before we parse the
19492         opt_constructor_initializer, to allow the variables to be bound
19493         to the constructor arguments.
19494
19495         * rootcontext.cs (LookupType): First lookup nested classes in our
19496         class and our parents before we go looking outside our class.
19497
19498         * expression.cs (ConstantFold): Extract/debox the values at the
19499         beginnning. 
19500
19501         * rootcontext.cs (EmitCode): Resolve the constants first before we
19502         resolve the types.  This is not really needed, but it helps debugging.
19503
19504         * statement.cs: report location.
19505
19506         * cs-parser.jay: pass location to throw statement.
19507
19508         * driver.cs: Small bug fix.
19509
19510         * report.cs: Updated format to be 4-zero filled digits.
19511
19512 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19513
19514         * expression.cs (CheckIndices): Fix minor bug where the wrong
19515         variable was being referred to ;-)
19516
19517         (DoEmit): Do not call EmitStaticInitializers when the 
19518         underlying type is System.Object.
19519
19520 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19521
19522         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19523         and do the usual workaround for SRE.
19524
19525         * class.cs (MyEventBuilder.EventType): New member to get at the type
19526         of the event, quickly.
19527
19528         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19529
19530         * assign.cs (Assign.DoResolve): Handle the case when the target
19531         is an EventExpr and perform the necessary checks.
19532
19533         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19534         interface.
19535
19536         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19537
19538         (EventExpr): Set the type in the constructor itself since we 
19539         are meant to be born fully resolved.
19540
19541         (EventExpr.Define): Revert code I wrote earlier.
19542                 
19543         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19544         instance expression is null. The instance expression is a This in that case
19545         or a null, depending on whether it is a static method or not.
19546
19547         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19548         refers to more than one method.
19549
19550         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19551         and accordingly flag errors.
19552
19553 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19554
19555         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19556
19557 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19558
19559         * location.cs (ToString): Provide useful rutine.
19560
19561 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19562
19563         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19564         objects, return the actual integral boxed.
19565
19566         * statement.cs (SwitchLabel): define an ILLabel for each
19567         SwitchLabel. 
19568
19569         (Switch.CheckSwitch): If the value is a Literal, extract
19570         the underlying literal.
19571
19572         Also in the unused hashtable we had, add the SwitchLabel so we can
19573         quickly look this value up.
19574
19575         * constant.cs: Implement a bunch of new constants.  Rewrite
19576         Literal based on this.  Made changes everywhere to adapt to this.
19577
19578         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19579         dereferencing array only once, and also copes with enumrations.
19580
19581         bytes are two bytes wide, not one.
19582
19583         (Cast): Perform constant conversions.
19584
19585         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19586         wrappers to the literals here.
19587
19588         * expression.cs (DoNumericPromotions): long literals can converted
19589         to ulong implicity (this is taken care of elsewhere, but I was
19590         missing this spot).
19591
19592         * ecore.cs (Expression.Literalize): Make the return type Literal,
19593         to improve type checking.
19594
19595         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19596
19597 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19598
19599         * literal.cs: Revert code from ravi that checked the bounds.  The
19600         bounds are sane by the definition of the type itself. 
19601
19602         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19603         need to actually look up in our parent hierarchy for interfaces
19604         implemented. 
19605
19606         * const.cs: Use the underlying type for enumerations
19607
19608         * delegate.cs: Compute the basename for the delegate creation,
19609         that should fix the delegate test case, and restore the correct
19610         Type Lookup semantics in rootcontext
19611
19612         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19613         referencing a nested type with the Reflection API is using the "+"
19614         sign. 
19615
19616         * cs-parser.jay: Do not require EOF token at the end.
19617
19618 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19619
19620         * rootcontext.cs (LookupType): Concatenate type names with
19621         a '.' instead of a '+' The test suite passes again.
19622
19623         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19624         field of the enumeration.
19625
19626         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19627         the case when the member is an EventExpr.
19628
19629         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19630         static has an associated instance expression.
19631
19632         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19633
19634         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19635
19636         * class.cs (Event.Define): Register event and perform appropriate checks
19637         for error #111.
19638
19639         We define the Add and Remove methods even if the use provides none because
19640         in that case, we provide default implementations ourselves.
19641
19642         Define a private field of the type of the event. This is done by the CSC compiler
19643         and we should be doing it too ;-)
19644
19645         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19646         More methods we use in code we generate.
19647
19648         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19649         is important.
19650
19651         (InitCoreTypes): Update accordingly for the above.
19652
19653         * class.cs (Event.Emit): Generate code for default accessors that we provide
19654
19655         (EmitDefaultMethod): Do the job in the above.
19656
19657         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19658         appropriate place.
19659
19660 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19661
19662         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19663         builders even if we were missing one.
19664
19665         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19666         pass the Basename as our class name instead of the Name.  The
19667         basename will be correctly composed for us.
19668
19669         * parameter.cs (Paramters): Now takes a Location argument.
19670
19671         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19672         make all the code call directly LookupType in RootContext and take
19673         this chance to pass the Location information everywhere.
19674
19675         * Everywhere: pass Location information.
19676
19677 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19678
19679         * class.cs (Constructor.Define): Updated way of detecting the
19680         length of the parameters.
19681
19682         (TypeContainer.DefineType): Use basename as the type name for
19683         nested types.
19684
19685         (TypeContainer.Define): Do not recursively define types here, as
19686         definition is taken care in order by the RootContext.
19687
19688         * tree.cs: Keep track of namespaces in a per-file basis.
19689
19690         * parameter.cs (Parameter.ComputeSignature): Update to use
19691         DeclSpace. 
19692
19693         (Parameters.GetSignature): ditto.
19694
19695         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19696         instead of a TypeContainer.
19697
19698         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19699         resolve names.  Because we need to be resolve in our context, not
19700         our parents.
19701
19702         * driver.cs: Implement response files.
19703
19704         * class.cs (TypeContainer.DefineType): If we are defined, do not
19705         redefine ourselves.
19706
19707         (Event.Emit): Emit the code for add/remove handlers.
19708         (Event.Define): Save the MethodBuilders for add/remove.
19709
19710         * typemanager.cs: Use pair here too.
19711
19712         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19713         DictionaryEntry requires the first argument to be non-null.  
19714
19715         (enum_declaration): Compute full name for registering the
19716         enumeration.
19717
19718         (delegate_declaration): Instead of using
19719         formal_parameter_list, use opt_formal_parameter_list as the list
19720         can be empty.
19721
19722         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19723         (EventParsing): New property that controls whether `add' and
19724         `remove' are returned as tokens or identifiers (for events);
19725
19726 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19727
19728         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19729         use MyEventBuilder only and let it wrap the real builder for us.
19730
19731         (MyEventBuilder): Revamp constructor etc.
19732
19733         Implement all operations that we perform on EventBuilder in precisely the same
19734         way here too.
19735
19736         (FindMembers): Update to use the EventBuilder member.
19737
19738         (Event.Emit): Update accordingly.
19739
19740 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19741
19742         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19743         by calling the appropriate methods.
19744
19745         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19746         useful.
19747
19748         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19749
19750 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19751
19752         * delegate.cs (Delegate.Populate): Check that the return type
19753         and various parameters types are indeed accessible.
19754
19755         * class.cs (Constructor.Define): Same here.
19756
19757         (Field.Define): Ditto.
19758
19759         (Event.Define): Ditto.
19760
19761         (Operator.Define): Check that the underlying Method defined itself
19762         correctly - so it's MethodBuilder should not be null.
19763
19764         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19765         expression happens to be null.
19766
19767         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19768         members but as of now we don't seem to be able to do anything really useful with it.
19769
19770         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19771         not the EventBuilder.
19772
19773 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19774
19775         * cs-tokenizer.cs: Add support for defines.
19776         Add support for #if, #elif, #else, #endif
19777
19778         (eval_var): evaluates a variable.
19779         (eval): stubbed for evaluating functions.
19780
19781         * cs-parser.jay: Pass the defines information
19782
19783         * driver.cs: Add --define command line option.
19784
19785         * decl.cs: Move MemberCore here.
19786
19787         Make it the base class for DeclSpace.  This allows us to catch and
19788         report 108 and 109 for everything now.
19789
19790         * class.cs (TypeContainer.Define): Extract all the members
19791         before populating and emit the warning 108 (new keyword required
19792         to override) instead of having each member implement this.
19793
19794         (MemberCore.Define): New abstract method, we will be using this in
19795         the warning reporting engine in Populate.
19796
19797         (Operator.Define): Adjust to new MemberCore protocol. 
19798
19799         * const.cs (Const): This does not derive from Expression, it is a
19800         temporary object we use to create fields, it is a MemberCore. 
19801
19802         * class.cs (Method.Define): Allow the entry point to be in a
19803         specific class.
19804
19805         * driver.cs: Rewrite the argument handler to clean it up a bit.
19806
19807         * rootcontext.cs: Made it just an auxiliary namespace feature by
19808         making everything static.
19809
19810         * driver.cs: Adapt code to use RootContext type name instead of
19811         instance variable.
19812
19813         * delegate.cs: Remove RootContext argument.
19814
19815         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19816         argument. 
19817
19818         * class.cs (Event.Define): The lookup can fail.
19819
19820         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19821
19822         * expression.cs: Resolve the this instance before invoking the code.
19823
19824 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19825
19826         * cs-parser.jay: Add a production in element_access that allows
19827         the thing to become a "type" reference.  This way we can parse
19828         things like "(string [])" as a type.
19829
19830         Note that this still does not handle the more complex rules of
19831         casts. 
19832
19833
19834         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19835
19836         * ecore.cs: (CopyNewMethods): new utility function used to
19837         assemble the list of methods from running FindMembers.
19838
19839         (MemberLookup): Rework FindMembers so that 
19840
19841 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19842
19843         * class.cs (TypeContainer): Remove Delegates who fail to be
19844         defined.
19845
19846         * delegate.cs (Populate): Verify that we dont get null return
19847         values.   TODO: Check for AsAccessible.
19848
19849         * cs-parser.jay: Use basename to emit error 574 (destructor should
19850         have the same name as container class), not the full name.
19851
19852         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19853         possible representation.  
19854
19855         Also implements integer type suffixes U and L.
19856
19857 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19858
19859         * expression.cs (ArrayCreation.DoResolve): We need to do the
19860         argument resolution *always*.
19861
19862         * decl.cs: Make this hold the namespace.  Hold the root context as
19863         well.
19864         (LookupType): Move here.
19865
19866         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19867
19868         * location.cs (Row, Name): Fixed the code, it was always returning
19869         references to the first file.
19870
19871         * interface.cs: Register properties defined through interfaces.
19872
19873         * driver.cs: Add support for globbing on the command line
19874
19875         * class.cs (Field): Make it derive from MemberCore as well.
19876         (Event): ditto.
19877
19878 2001-12-15  Ravi Pratap  <ravi@ximian.com>
19879
19880         * class.cs (Event::Define): Check that the type of the event is a delegate
19881         type else flag error #66.
19882
19883         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19884         same.
19885
19886         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19887         values of EntryPoint, CharSet etc etc.
19888
19889         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19890
19891         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19892         be null and we should ignore this. I am not sure if this is really clean. Apparently,
19893         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19894         which needs this to do its work.
19895
19896         * ../errors/cs0066.cs : Add.
19897
19898 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
19899
19900         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19901         helper functions.
19902
19903         * class.cs: (MethodSignature.MethodSignature): Removed hack that
19904         clears out the parameters field.
19905         (MemberSignatureCompare): Cleanup
19906
19907         (MemberCore): New base class used to share code between MethodCore
19908         and Property.
19909
19910         (RegisterRequiredImplementations) BindingFlags.Public requires
19911         either BindingFlags.Instace or Static.  Use instance here.
19912
19913         (Property): Refactored code to cope better with the full spec.
19914
19915         * parameter.cs (GetParameterInfo): Return an empty array instead
19916         of null on error.
19917
19918         * class.cs (Property): Abstract or extern properties have no bodies.
19919
19920         * parameter.cs (GetParameterInfo): return a zero-sized array.
19921
19922         * class.cs (TypeContainer.MethodModifiersValid): Move all the
19923         method modifier validation to the typecontainer so we can reuse
19924         this on properties.
19925
19926         (MethodCore.ParameterTypes): return an empty sized array of types.
19927
19928         (Property.Define): Test property modifier validity.
19929
19930         Add tests for sealed/override too.
19931
19932         (Method.Emit): abstract or extern methods have no bodies.
19933
19934 2001-12-14  Ravi Pratap  <ravi@ximian.com>
19935
19936         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19937         thing.
19938
19939         (Method::Define, ::Emit): Modify accordingly.
19940
19941         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19942
19943         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19944
19945         * makefile: Pass in /unsafe.
19946
19947 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
19948
19949         * class.cs (MakeKey): Kill routine.
19950
19951         * class.cs (TypeContainer.Define): Correctly define explicit
19952         method implementations (they require the full interface name plus
19953         the method name).
19954
19955         * typemanager.cs: Deply the PtrHashtable here and stop using the
19956         lame keys.  Things work so much better.
19957
19958         This of course broke everyone who depended on `RegisterMethod' to
19959         do the `test for existance' test.  This has to be done elsewhere.
19960
19961         * support.cs (PtrHashtable): A hashtable that avoid comparing with
19962         the object stupid Equals method (because, that like fails all over
19963         the place).  We still do not use it.
19964
19965         * class.cs (TypeContainer.SetRequiredInterface,
19966         TypeContainer.RequireMethods): Killed these two routines and moved
19967         all the functionality to RegisterRequiredImplementations.
19968
19969         (TypeContainer.RegisterRequiredImplementations): This routine now
19970         registers all the implementations required in an array for the
19971         interfaces and abstract methods.  We use an array of structures
19972         which can be computed ahead of time to reduce memory usage and we
19973         also assume that lookups are cheap as most classes will not
19974         implement too many interfaces.
19975
19976         We also avoid creating too many MethodSignatures.
19977
19978         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19979         clear the "pending" bit if we find that there are problems with
19980         the declaration.
19981
19982         (TypeContainer.VerifyPendingMethods): Update to report errors of
19983         methods that look like implementations but are not.
19984
19985         (TypeContainer.Define): Add support for explicit interface method
19986         implementation. 
19987
19988 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19989
19990         * typemanager.cs: Keep track of the parameters here instead of
19991         being a feature of the TypeContainer.
19992
19993         * class.cs: Drop the registration of parameters here, as
19994         InterfaceMethods are also interface declarations.
19995
19996         * delegate.cs: Register methods with the TypeManager not only with
19997         the TypeContainer.  This code was buggy.
19998
19999         * interface.cs: Full registation here.
20000
20001 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20002
20003         * expression.cs: Remove reducer for binary expressions, it can not
20004         be done this way.
20005
20006         * const.cs: Put here the code that used to go into constant.cs
20007
20008         * constant.cs: Put here the code for constants, this is a new base
20009         class for Literals.
20010
20011         * literal.cs: Make Literal derive from Constant.
20012
20013 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20014
20015         * statement.cs (Return.Emit): Report error 157 if the user
20016         attempts to return from a finally block.
20017
20018         (Return.Emit): Instead of emitting a return, jump to the end of
20019         the function.
20020
20021         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20022         LocalBuilder to store the result of the function.  ReturnLabel is
20023         the target where we jump.
20024
20025
20026 2001-12-09  Radek Doulik  <rodo@ximian.com>
20027
20028         * cs-parser.jay: remember alias in current namespace
20029
20030         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20031         namespaces
20032
20033         * class.cs (LookupAlias): lookup alias in my_namespace
20034
20035         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20036         aliases hashtable
20037         (LookupAlias): lookup alias in this and if needed in parent
20038         namespaces
20039
20040 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20041
20042         * support.cs: 
20043
20044         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20045         making things static.  I need this to avoid passing the
20046         TypeContainer when calling ParameterType.
20047
20048         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20049         that did string manipulation to compute the type and then call
20050         GetType.  Use Parameter.ParameterType instead.
20051
20052         * cs-tokenizer.cs: Consume the suffix for floating values.
20053
20054         * expression.cs (ParameterReference): figure out whether this is a
20055         reference parameter or not.  Kill an extra variable by computing
20056         the arg_idx during emission.
20057
20058         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20059         function that returns whether a parameter is an out/ref value or not.
20060
20061         (Parameter.ParameterType): The type of the parameter (base,
20062         without ref/out applied).
20063
20064         (Parameter.Resolve): Perform resolution here.
20065         (Parameter.ExternalType): The full type (with ref/out applied).
20066
20067         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20068         support for expressions on the using statement.
20069
20070 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20071
20072         * statement.cs (Using.EmitLocalVariableDecls): Split the
20073         localvariable handling of the using statement.
20074
20075         (Block.EmitMeta): Keep track of variable count across blocks.  We
20076         were reusing slots on separate branches of blocks.
20077
20078         (Try.Emit): Emit the general code block, we were not emitting it. 
20079
20080         Check the type of the declaration to be an IDisposable or
20081         something that can be implicity converted to it. 
20082
20083         Emit conversions if required.
20084
20085         * ecore.cs (EmptyExpression): New utility class.
20086         (Expression.ImplicitConversionExists): New utility function.
20087
20088 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20089
20090         * statement.cs (Using): Implement.
20091
20092         * expression.cs (LocalVariableReference): Support read only variables.
20093
20094         * statement.cs: Remove the explicit emit for the Leave opcode.
20095         (VariableInfo): Add a readonly field.
20096
20097 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20098
20099         * ecore.cs (ConvCast): new class used to encapsulate the various
20100         explicit integer conversions that works in both checked and
20101         unchecked contexts.
20102
20103         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20104         properly generate the overflow opcodes.
20105
20106 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20107
20108         * statement.cs: The correct type for the EmptyExpression is the
20109         element_type, not the variable type.  Ravi pointed this out.
20110
20111 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20112
20113         * class.cs (Method::Define): Handle PInvoke methods specially
20114         by using DefinePInvokeMethod instead of the usual one.
20115
20116         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20117         above to do the task of extracting information and defining the method.
20118
20119 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20120
20121         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20122         of the condition for string type.
20123
20124         (Emit): Move that here. 
20125
20126         (ArrayCreation::CheckIndices): Keep string literals in their expression
20127         form.
20128
20129         (EmitDynamicInitializers): Handle strings appropriately.
20130
20131 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20132
20133         * codegen.cs (EmitContext): Replace multiple variables with a
20134         single pointer to the current Switch statement.
20135
20136         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20137         EmitContext.
20138
20139 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20140
20141         * statement.cs 
20142
20143         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20144         default'.
20145
20146         (Foreach.Emit): Foreach on arrays was not setting
20147         up the loop variables (for break/continue).
20148
20149         (GotoCase): Semi-implented.
20150
20151 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20152
20153         * attribute.cs (CheckAttribute): Handle system attributes by using
20154         Attribute.GetAttributes to examine information we need.
20155
20156         (GetValidPlaces): Same here.
20157
20158         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20159
20160         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20161
20162         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20163
20164         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20165
20166         (Method::Emit): Handle the case when we are a PInvoke method.
20167
20168 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20169
20170         * expression.cs: Use ResolveWithSimpleName on compound names.
20171
20172 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20173
20174         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20175         before trying to reduce it.
20176
20177         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20178
20179         * constant.cs (LookupConstantValue): Implement.
20180
20181         (EmitConstant): Use the above in emitting the constant.
20182
20183         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20184         that are user-defined by doing a LookupConstantValue on them.
20185
20186         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20187         too, like above.
20188
20189 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20190
20191         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20192
20193         (BaseAccess.DoResolve): Implement.
20194
20195         (MemberAccess.DoResolve): Split this routine into a
20196         ResolveMemberAccess routine that can be used independently
20197
20198 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20199
20200         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20201         As that share bits of the implementation.  Is returns a boolean,
20202         while As returns the Type that is being probed.
20203
20204 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20205
20206         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20207         instead of a Literal - much easier.
20208
20209         (EnumInTransit): Remove - utterly useless :-)
20210
20211         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20212
20213         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20214
20215         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20216         chain when we have no associated expression.
20217
20218 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20219
20220         * constant.cs (Define): Use Location while reporting the errror.
20221
20222         Also emit a warning when 'new' is used and there is no inherited
20223         member to hide.
20224
20225         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20226         populated.
20227
20228         (LookupEnumValue): Implement to lookup an enum member's value and define it
20229         if necessary.
20230
20231         (Populate): Re-write accordingly to use the above routine.
20232
20233 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20234
20235         * expression.cs (This): Fix prototype for DoResolveLValue to
20236         override the base class DoResolveLValue.
20237
20238         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20239         declarations) 
20240
20241         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20242         (we need to load the address of the field here).  This fixes
20243         test-22. 
20244
20245         (FieldExpr.DoResolveLValue): Call the DoResolve
20246         function to initialize the Instance expression.
20247
20248         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20249         correctly the GetEnumerator operation on a value type.
20250
20251         * cs-parser.jay: Add more simple parsing error catches.
20252
20253         * statement.cs (Switch): Add support for string switches.
20254         Handle null specially.
20255
20256         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20257
20258 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20259
20260         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20261
20262         (declare_local_constant): New helper function.
20263
20264         * statement.cs (AddConstant): Keep a separate record of constants
20265
20266         (IsConstant): Implement to determine if a variable is a constant.
20267
20268         (GetConstantExpression): Implement.
20269
20270         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20271
20272         * statement.cs (IsVariableDefined): Re-write.
20273
20274 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20275
20276         * class.cs (TypeContainer::FindMembers): Look for constants
20277         in the case when we are looking for MemberTypes.Field
20278
20279         * expression.cs (MemberAccess::DoResolve): Check that in the
20280         case we are a FieldExpr and a Literal, we are not being accessed
20281         by an instance reference.
20282
20283         * cs-parser.jay (local_constant_declaration): Implement.
20284
20285         (declaration_statement): Implement for constant declarations.
20286
20287 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20288
20289         * statement.cs (Switch): Catch double defaults.
20290
20291         (Switch): More work on the switch() statement
20292         implementation.  It works for integral values now, need to finish
20293         string support.
20294
20295
20296 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20297
20298         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20299         integer literals into other integer literals.  To be used by
20300         switch. 
20301
20302 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20303
20304         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20305         some memory.
20306
20307         (EmitDynamicInitializers): Cope with the above since we extract data
20308         directly from ArrayData now.
20309
20310         (ExpectInitializers): Keep track of whether initializers are mandatory
20311         or not.
20312
20313         (Bounds): Make it a hashtable to prevent the same dimension being 
20314         recorded for every element in that dimension.
20315
20316         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20317         from being found.
20318
20319         Also fix bug which was causing the indices to be emitted in the reverse
20320         order.
20321
20322 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20323
20324         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20325         unfinished.  They do not work, because the underlying code is
20326         sloppy.
20327
20328 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20329
20330         * cs-parser.jay: Remove bogus fixme.
20331
20332         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20333         on Switch statement.
20334
20335 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20336
20337         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20338         the same. 
20339
20340         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20341         parameter. Apparently, any expression is allowed. 
20342
20343         (ValidateInitializers): Update accordingly.
20344
20345         (CheckIndices): Fix some tricky bugs thanks to recursion.
20346
20347         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20348         I was being completely brain-dead.
20349
20350         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20351         and re-write acordingly.
20352
20353         (DelegateInvocation): Re-write accordingly.
20354
20355         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20356
20357         (MakeByteBlob): Handle types more correctly.
20358
20359         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20360         initialization from expressions but it is incomplete because I am a complete
20361         Dodo :-|
20362
20363 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20364
20365         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20366         on If.  Basically, we have to return `true' (ie, we do return to
20367         our caller) only if both branches of the if return.
20368
20369         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20370         short-circuit operators, handle them as short circuit operators. 
20371
20372         (Cast.DoResolve): Resolve type.
20373         (Cast.Cast): Take an expression as the target type.
20374
20375         * cs-parser.jay (cast_expression): Remove old hack that only
20376         allowed a limited set of types to be handled.  Now we take a
20377         unary_expression and we resolve to a type during semantic
20378         analysis.
20379
20380         Use the grammar productions from Rhys to handle casts (this is
20381         not complete like Rhys syntax yet, we fail to handle that corner
20382         case that C# has regarding (-x), but we will get there.
20383
20384 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20385
20386         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20387         field which is an array type.
20388
20389         * cs-parser.jay (declare_local_variables): Support array initialization too.
20390
20391         * typemanager.cs (MakeKey): Implement.
20392
20393         (everywhere): Use the above appropriately.
20394
20395         * cs-parser.jay (for_statement): Update for array initialization while
20396         declaring variables.
20397
20398         * ecore.cs : The error message was correct, it's the variable's names that
20399         were misleading ;-) Make the code more readable.
20400
20401         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20402         the correct type etc.
20403
20404         (ConvertExplicit): Handle Enum types by examining the underlying type.
20405
20406 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20407
20408         * parameter.cs (GetCallingConvention): Always return
20409         CallingConventions.Standard for now.
20410
20411 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20412
20413         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20414         and `r' after calling DoNumericPromotions.
20415
20416         * ecore.cs: Fix error message (the types were in the wrong order).
20417
20418         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20419         BindingFlags.Instance as well 
20420
20421         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20422         implicit int literal conversion in an empty cast so that we
20423         propagate the right type upstream.
20424
20425         (UnboxCast): new class used to unbox value types.
20426         (Expression.ConvertExplicit): Add explicit type conversions done
20427         by unboxing.
20428
20429         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20430         the target type before applying the implicit LongLiterals to ULong
20431         literal cast.
20432
20433 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20434
20435         * cs-parser.jay (for_statement): Reworked the way For works: now
20436         we declare manually any variables that are introduced in
20437         for_initializer to solve the problem of having out-of-band code
20438         emition (that is what got for broken).
20439
20440         (declaration_statement): Perform the actual variable declaration
20441         that used to be done in local_variable_declaration here.
20442
20443         (local_variable_declaration): Do not declare anything, just pass
20444         the information on a DictionaryEntry
20445
20446 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20447
20448         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20449         re-write of the logic to now make it recursive.
20450
20451         (UpdateIndices): Re-write accordingly.
20452
20453         Store element data in a separate ArrayData list in the above methods.
20454
20455         (MakeByteBlob): Implement to dump the array data into a byte array.
20456
20457 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20458
20459         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20460         into CheckIndices.
20461
20462         * constant.cs (Define): Implement.
20463
20464         (EmitConstant): Re-write fully.
20465
20466         Pass in location info.
20467
20468         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20469         respectively.
20470
20471         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20472         DictionaryEntry since we need location info too.
20473
20474         (constant_declaration): Update accordingly.
20475
20476         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20477         code into another method : UpdateIndices.
20478
20479 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20480
20481         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20482         some type checking etc.
20483
20484 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20485
20486         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20487         bits to provide dimension info if the user skips doing that.
20488
20489         Update second constructor to store the rank correctly.
20490
20491 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20492
20493         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20494         and try to implement.
20495
20496         * ../errors/cs0150.cs : Add.
20497
20498         * ../errors/cs0178.cs : Add.
20499
20500 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20501
20502         * statement.cs: Implement foreach on multi-dimensional arrays. 
20503
20504         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20505         name of the params argument.
20506
20507         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20508         initializing the array.
20509
20510         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20511         we can use this elsewhere.
20512
20513         * statement.cs: Finish implementation of foreach for single
20514         dimension arrays.
20515
20516         * cs-parser.jay: Use an out-of-band stack to pass information
20517         around, I wonder why I need this.
20518
20519         foreach_block: Make the new foreach_block the current_block.
20520
20521         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20522         function used to return a static Parameters structure.  Used for
20523         empty parameters, as those are created very frequently.
20524
20525         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20526
20527 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20528
20529         * interface.cs : Default modifier is private, not public. The
20530         make verify test passes again.
20531
20532 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20533
20534         * support.cs (ReflectionParameters): Fix logic to determine
20535         whether the last parameter is a params one. Test 9 passes again.
20536
20537         * delegate.cs (Populate): Register the builders we define with
20538         RegisterParameterForBuilder. Test 19 passes again.
20539
20540         * cs-parser.jay (property_declaration): Reference $6 instead
20541         of $$ to get at the location.
20542
20543         (indexer_declaration): Similar stuff.
20544
20545         (attribute): Ditto.
20546
20547         * class.cs (Property): Register parameters for the Get and Set methods
20548         if they exist. Test 23 passes again.
20549
20550         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20551         call to EmitArguments as we are sure there aren't any params arguments. 
20552         Test 32 passes again.
20553
20554         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20555         IndexOutOfRangeException. 
20556
20557         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20558         Test 33 now passes again.
20559
20560 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20561
20562         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20563         broke a bunch of things.  Will have to come up with a better way
20564         of tracking locations.
20565
20566         * statement.cs: Implemented foreach for single dimension arrays.
20567
20568 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20569
20570         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20571         an error.  This removes the lookup from the critical path.
20572
20573         * cs-parser.jay: Removed use of temporary_loc, which is completely
20574         broken. 
20575
20576 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20577
20578         * support.cs (ReflectionParameters.ParameterModifier): Report
20579         whether the argument is a PARAMS argument or not.
20580
20581         * class.cs: Set the attribute `ParamArrayAttribute' on the
20582         parameter argument.
20583
20584         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20585         and cons_param_array_attribute (ConstructorInfo for
20586         ParamArrayAttribute)., 
20587
20588         * codegen.cs: Emit the return using the `Return' statement, that
20589         way we can report the error correctly for missing return values. 
20590
20591         * class.cs (Method.Emit): Clean up.
20592
20593         * expression.cs (Argument.Resolve): Take another argument: the
20594         location where this argument is used.  Notice that this is not
20595         part of the "Argument" class as to reduce the size of the
20596         structure (we know the approximate location anyways).
20597
20598         Test if the argument is a variable-reference, if not, then
20599         complain with a 206.
20600
20601         (Argument.Emit): Emit addresses of variables.
20602
20603         (Argument.FullDesc): Simplify.
20604
20605         (Invocation.DoResolve): Update for Argument.Resolve.
20606
20607         (ElementAccess.DoResolve): ditto.
20608
20609         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20610         method should be virtual, as this method is always virtual.
20611
20612         (NewDelegate.DoResolve): Update for Argument.Resolve.
20613
20614         * class.cs (ConstructorInitializer.DoResolve): ditto.
20615
20616         * attribute.cs (Attribute.Resolve): ditto.
20617
20618 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20619
20620         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20621
20622         * expression.cs (ParameterReference): Drop IStackStorage and implement
20623         IAssignMethod instead. 
20624
20625         (LocalVariableReference): ditto.
20626
20627         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20628         IAssignMethod instead. 
20629
20630 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20631
20632         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20633         enumerations that are used in heavily used structures derive from
20634         byte in a laughable and pathetic attempt to reduce memory usage.
20635         This is the kind of pre-optimzations that you should not do at
20636         home without adult supervision.
20637
20638         * expression.cs (UnaryMutator): New class, used to handle ++ and
20639         -- separatedly from the other unary operators.  Cleans up the
20640         code, and kills the ExpressionStatement dependency in Unary.
20641
20642         (Unary): Removed `method' and `Arguments' from this class, making
20643         it smaller, and moving it all to SimpleCall, so I can reuse this
20644         code in other locations and avoid creating a lot of transient data
20645         strucutres when not required.
20646
20647         * cs-parser.jay: Adjust for new changes.
20648
20649 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20650
20651         * enum.cs (Enum.Populate): If there is a failure during
20652         definition, return
20653
20654         * cs-parser.jay (opt_enum_base): we used to catch type errors
20655         here, but this is really incorrect.  The type error should be
20656         catched during semantic analysis.
20657
20658 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20659
20660         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20661         current_local_parameters as expected since I, in my stupidity, had forgotten
20662         to do this :-)
20663
20664         * attribute.cs (GetValidPlaces): Fix stupid bug.
20665
20666         * class.cs (Method::Emit): Perform check on applicability of attributes.
20667
20668         (Constructor::Emit): Ditto.
20669
20670         (Field::Emit): Ditto.
20671
20672         (Field.Location): Store location information.
20673
20674         (Property, Event, Indexer, Operator): Ditto.
20675
20676         * cs-parser.jay (field_declaration): Pass in location for each field.
20677
20678         * ../errors/cs0592.cs : Add.
20679
20680 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20681
20682         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20683
20684         (InitCoreTypes): Update accordingly.
20685
20686         (RegisterAttrType, LookupAttr): Implement.
20687
20688         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20689         info about the same.
20690
20691         (Resolve): Update to populate the above as necessary.
20692
20693         (Error592): Helper.
20694
20695         (GetValidPlaces): Helper to the above.
20696
20697         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20698
20699         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20700
20701 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20702
20703         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20704
20705         * ../errors/cs0617.cs : Add.
20706
20707 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20708
20709         * enum.cs (Emit): Rename to Populate to be more consistent with what
20710         we expect it to do and when exactly it is called.
20711
20712         * class.cs, rootcontext.cs : Update accordingly.
20713
20714         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20715         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20716
20717         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20718
20719         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20720         of a fieldinfo using the above, when dealing with a FieldBuilder.
20721
20722 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20723
20724         * ../errors/cs0031.cs : Add.
20725
20726         * ../errors/cs1008.cs : Add.
20727
20728         * ../errrors/cs0543.cs : Add.
20729
20730         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20731         enum type.
20732
20733         (FindMembers): Implement.
20734
20735         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20736         enums and delegates too.
20737
20738         (enum_types): Rename to builder_to_enum.
20739
20740         (delegate_types): Rename to builder_to_delegate.
20741
20742         * delegate.cs (FindMembers): Implement.
20743
20744 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20745
20746         * typemanager.cs (IsEnumType): Implement.
20747
20748         * enum.cs (Emit): Re-write parts to account for the underlying type
20749         better and perform checking etc.
20750
20751         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20752         of the underlying type.
20753
20754         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20755         value
20756
20757         * enum.cs (error31): Helper to report error #31.
20758
20759         * cs-parser.jay (enum_declaration): Store location of each member too.
20760
20761         * enum.cs (member_to_location): New hashtable. 
20762
20763         (AddEnumMember): Update location hashtable.
20764
20765         (Emit): Use the location of each member while reporting errors.
20766
20767 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20768
20769         * cs-parser.jay: A for_initializer if is a
20770         local_variable_declaration really ammount to have an implicit
20771         block with the variable declaration and no initializer for for.
20772
20773         * statement.cs (For.Emit): Cope with null initializers.
20774
20775         This fixes the infinite loop on for initializers.
20776
20777 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20778
20779         * enum.cs: More cleanup.
20780
20781         * ecore.cs: Remove dead code.
20782
20783         * class.cs (Property.Emit): More simplification.
20784         (Event.Emit): ditto.
20785
20786         Reworked to have less levels of indentation.
20787
20788 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20789
20790         * class.cs (Property): Emit attributes.
20791
20792         (Field): Ditto.
20793
20794         (Event): Ditto.
20795
20796         (Indexer): Ditto.
20797
20798         (Operator): Ditto.
20799
20800         * enum.cs (Emit): Ditto.
20801
20802         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20803         Enums too.
20804
20805         * class.cs (Field, Event, etc.): Move attribute generation into the
20806         Emit method everywhere.
20807
20808         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20809         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20810         as we had no way of defining nested enums !
20811
20812         * rootcontext.cs : Adjust code accordingly.
20813
20814         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20815
20816 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20817
20818         * expression.cs (EvalConstantExpression): Move into ecore.cs
20819
20820         * enum.cs (Enum): Rename some members and make them public and readonly
20821         according to our convention.
20822
20823         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20824         nothing else.
20825
20826         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20827
20828         (Enum::Emit): Write a simple version for now which doesn't try to compute
20829         expressions. I shall modify this to be more robust in just a while.
20830
20831         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20832
20833         (TypeContainer::CloseType): Create the Enum types too.
20834
20835         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20836
20837         * expression.cs (EvalConstantExpression): Get rid of completely.
20838
20839         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20840         user-defined values and other cases.
20841
20842         (IsValidEnumLiteral): Helper function.
20843
20844         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20845         out there in the case we had a literal FieldExpr.
20846
20847         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20848
20849         (Literalize): Revamp a bit to take two arguments.
20850
20851         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20852
20853 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20854
20855         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20856
20857         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20858
20859         (Resolve): Use the above to ensure we have proper initializers.
20860
20861 2001-11-05  Ravi Pratap  <ravi@ximian.com>
20862
20863         * expression.cs (Expression::EvalConstantExpression): New method to 
20864         evaluate constant expressions.
20865
20866         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20867
20868 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
20869
20870         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20871         in an array.
20872
20873         (Binary.ResolveOperator): Handle operator != (object a, object b)
20874         and operator == (object a, object b);
20875
20876         (Binary.DoNumericPromotions): Indicate whether the numeric
20877         promotion was possible.
20878
20879         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20880         Implement.  
20881
20882         Made the ArrayAccess implement interface IAssignMethod instead of
20883         IStackStore as the order in which arguments are passed reflects
20884         this.
20885
20886         * assign.cs: Instead of using expr.ExprClass to select the way of
20887         assinging, probe for the IStackStore/IAssignMethod interfaces.
20888
20889         * typemanager.cs: Load InitializeArray definition.
20890
20891         * rootcontext.cs (RootContext.MakeStaticData): Used to define
20892         static data that can be used to initialize arrays. 
20893
20894 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
20895
20896         * expression.cs: Handle operator== and operator!= for booleans.
20897
20898         (Conditioal.Reduce): Implement reducer for the ?: operator.
20899
20900         (Conditional.Resolve): Implement dead code elimination.
20901
20902         (Binary.Resolve): Catch string literals and return a new
20903         concatenated string.
20904
20905         (Unary.Reduce): Implement reduction of unary expressions.
20906
20907         * ecore.cs: Split out the expression core handling here.
20908
20909         (Expression.Reduce): New method used to perform constant folding
20910         and CSE.  This is needed to support constant-expressions. 
20911
20912         * statement.cs (Statement.EmitBoolExpression): Pass true and false
20913         targets, and optimize for !x.
20914
20915 2001-11-04  Ravi Pratap  <ravi@ximian.com>
20916
20917         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20918         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20919         set custom atttributes.
20920
20921         * literal.cs (Literal::GetValue): New abstract method to return the actual
20922         value of the literal, cast as an object.
20923
20924         (*Literal): Implement GetValue method.
20925
20926         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20927         expressions to the arraylist but objects of type Argument.
20928
20929         * class.cs (TypeContainer::Emit): Emit our attributes too.
20930
20931         (Method::Emit, Constructor::Emit): Ditto.
20932
20933         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20934         to be ignoring earlier.
20935
20936 2001-11-03  Ravi Pratap  <ravi@ximian.com>
20937
20938         * attribute.cs (AttributeSection::Define): Implement to do the business
20939         of constructing a CustomAttributeBuilder.
20940
20941         (Attribute): New trivial class. Increases readability of code.  
20942
20943         * cs-parser.jay : Update accordingly.
20944
20945         (positional_argument_list, named_argument_list, named_argument): New rules
20946
20947         (attribute_arguments): Use the above so that we are more correct.
20948
20949 2001-11-02  Ravi Pratap  <ravi@ximian.com>
20950
20951         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20952         to perform all checks for a method with a params parameter.
20953
20954         (Invocation::OverloadResolve): Update to use the above method and therefore
20955         cope correctly with params method invocations.
20956
20957         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
20958         params too.
20959
20960         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20961         constructors in our parent too because we can't afford to miss out on 
20962         protected ones ;-)
20963
20964         * attribute.cs (AttributeSection): New name for the class Attribute
20965
20966         Other trivial changes to improve readability.
20967
20968         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20969         use the new class names.
20970
20971 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20972
20973         * class.cs (Method::Define): Complete definition for params types too
20974
20975         (Indexer::Define): Ditto.
20976
20977         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20978         Cope everywhere with a request for info about the array parameter.
20979
20980 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20981
20982         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20983
20984         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20985         local_variable_type to extract the string corresponding to the type.
20986
20987         (local_variable_type): Fixup the action to use the new helper method.
20988
20989         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20990         go.
20991
20992         * expression.cs : Clean out code which uses the above.
20993
20994 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20995
20996         * typemanager.cs (RegisterMethod): Check if we already have an existing key
20997         and bale out if necessary by returning a false.
20998
20999         (RegisterProperty): Ditto.
21000
21001         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21002         and print out appropriate error messages.
21003
21004         * interface.cs (everywhere): Ditto.
21005
21006         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21007         location to constructor.
21008
21009         * class.cs (Property, Event, Indexer): Update accordingly.
21010
21011         * ../errors/cs111.cs : Added.
21012
21013         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21014         of a method, as laid down by the spec.
21015
21016         (Invocation::OverloadResolve): Use the above method.
21017
21018 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21019
21020         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21021         now take a TypeContainer and a Parameters object.
21022
21023         (ParameterData): Modify return type of ParameterModifier method to be 
21024         Parameter.Modifier and not a string.
21025
21026         (ReflectionParameters, InternalParameters): Update accordingly.
21027
21028         * expression.cs (Argument::GetParameterModifier): Same here.
21029
21030         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21031         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21032         symbol in it at all so maybe this is only for now.
21033
21034 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21035
21036         * support.cs (InternalParameters): Constructor now takes an extra argument 
21037         which is the actual Parameters class.
21038
21039         (ParameterDesc): Update to provide info on ref/out modifiers.
21040
21041         * class.cs (everywhere): Update call to InternalParameters to pass in
21042         the second argument too.
21043
21044         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21045         to return the modifier info [ref/out etc]
21046
21047         (InternalParameters, ReflectionParameters): Implement the above.
21048
21049         * expression.cs (Argument::ParameterModifier): Similar function to return
21050         info about the argument's modifiers.
21051
21052         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21053         too.
21054
21055         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21056         a new SetFormalParameters object which we pass to InternalParameters.
21057
21058 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21059
21060         * expression.cs (NewArray): Merge into the ArrayCreation class.
21061
21062 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21063
21064         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21065         NewUserdefinedArray into one as there wasn't much of a use in having
21066         two separate ones.
21067
21068         * expression.cs (Argument): Change field's name to ArgType from Type.
21069
21070         (Type): New readonly property which returns the proper type, taking into 
21071         account ref/out modifiers.
21072
21073         (everywhere): Adjust code accordingly for the above.
21074
21075         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21076         whether we are emitting for a ref or out parameter.
21077
21078         * expression.cs (Argument::Emit): Use the above field to set the state.
21079
21080         (LocalVariableReference::Emit): Update to honour the flag and emit the
21081         right stuff.
21082
21083         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21084
21085         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21086
21087         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21088
21089         (ReflectionParameters, InternalParameters): Implement the above method.
21090
21091         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21092         reporting errors.
21093
21094         (Invocation::FullMethodDesc): Ditto. 
21095
21096 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21097
21098         * cs-parser.jay: Add extra production for the second form of array
21099         creation. 
21100
21101         * expression.cs (ArrayCreation): Update to reflect the above
21102         change. 
21103
21104         * Small changes to prepare for Array initialization.
21105
21106 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21107
21108         * typemanager.cs (ImplementsInterface): interface might be null;
21109         Deal with this problem;
21110
21111         Also, we do store negative hits on the cache (null values), so use
21112         this instead of calling t.GetInterfaces on the type everytime.
21113
21114 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21115
21116         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21117
21118         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21119         split functionality out into different classes.
21120
21121         (New::FormArrayType): Move into NewBuiltinArray.
21122
21123         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21124         quite useless.
21125
21126         (NewBuiltinArray): New class to handle creation of built-in arrays.
21127
21128         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21129         account creation of one-dimensional arrays.
21130
21131         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21132
21133         (NewUserdefinedArray::DoResolve): Implement.
21134
21135         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21136
21137         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21138         we maintain inside the TypeManager. This is necessary to perform lookups on the
21139         module builder.
21140
21141         (LookupType): Update to perform GetType on the module builders too.     
21142
21143         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21144
21145         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21146
21147 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21148
21149         * expression.cs (New::DoResolve): Implement guts of array creation.
21150
21151         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21152
21153 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21154
21155         * expression.cs: Fix bug I introduced lsat night that broke
21156         Delegates. 
21157
21158         (Expression.Resolve): Report a 246 error (can not resolve name)
21159         if we find a SimpleName in the stream.
21160
21161         (Expression.ResolveLValue): Ditto.
21162
21163         (Expression.ResolveWithSimpleName): This function is a variant of
21164         ResolveName, this one allows SimpleNames to be returned without a
21165         warning.  The only consumer of SimpleNames is MemberAccess
21166
21167 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21168
21169         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21170         might arrive here.  I have my doubts that this is correct.
21171
21172         * statement.cs (Lock): Implement lock statement.
21173
21174         * cs-parser.jay: Small fixes to support `lock' and `using'
21175
21176         * cs-tokenizer.cs: Remove extra space
21177
21178         * driver.cs: New flag --checked, allows to turn on integer math
21179         checking. 
21180
21181         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21182         Threading.Monitor.Exit 
21183
21184 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21185
21186         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21187         Expression Class to be IndexerAccess.
21188
21189         Notice that Indexer::DoResolve sets the eclass to Value.
21190
21191 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21192
21193         * class.cs (TypeContainer::Emit): Emit code for indexers.
21194
21195         * assign.cs (IAssignMethod): New interface implemented by Indexers
21196         and Properties for handling assignment.
21197
21198         (Assign::Emit): Simplify and reuse code. 
21199
21200         * expression.cs (IndexerAccess, PropertyExpr): Implement
21201         IAssignMethod, clean up old code. 
21202
21203 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21204
21205         * typemanager.cs (ImplementsInterface): New method to determine if a type
21206         implements a given interface. Provides a nice cache too.
21207
21208         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21209         method.
21210
21211         (ConvertReferenceExplicit): Ditto.
21212
21213         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21214         various methods, with correct names etc.
21215
21216         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21217         Operator.UnaryNegation.
21218
21219         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21220         we have a unary plus or minus operator.
21221
21222         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21223         UnaryMinus.
21224
21225         * everywhere : update accordingly.
21226
21227         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21228         respectively.
21229
21230         * class.cs (Method::Define): For the case where we are implementing a method
21231         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21232         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21233
21234 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21235
21236         * interface.cs (FindMembers): Implement to work around S.R.E
21237         lameness.
21238
21239         * typemanager.cs (IsInterfaceType): Implement.
21240
21241         (FindMembers): Update to handle interface types too.
21242
21243         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21244         use IsAssignableFrom as that is not correct - it doesn't work.
21245
21246         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21247         and accordingly override EmitStatement.
21248
21249         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21250         using the correct logic :-)
21251
21252 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21253
21254         * ../errors/cs-11.cs : Add to demonstrate error -11 
21255
21256 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21257
21258         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21259         then pass this as a hint to ResolveLValue.
21260
21261         * expression.cs (FieldExpr): Add Location information
21262
21263         (FieldExpr::LValueResolve): Report assignment to readonly
21264         variable. 
21265
21266         (Expression::ExprClassFromMemberInfo): Pass location information.
21267
21268         (Expression::ResolveLValue): Add new method that resolves an
21269         LValue. 
21270
21271         (Expression::DoResolveLValue): Default invocation calls
21272         DoResolve. 
21273
21274         (Indexers): New class used to keep track of indexers in a given
21275         Type. 
21276
21277         (IStackStore): Renamed from LValue, as it did not really describe
21278         what this did.  Also ResolveLValue is gone from this interface and
21279         now is part of Expression.
21280
21281         (ElementAccess): Depending on the element access type
21282
21283         * typemanager.cs: Add `indexer_name_type' as a Core type
21284         (System.Runtime.CompilerServices.IndexerNameAttribute)
21285
21286         * statement.cs (Goto): Take a location.
21287
21288 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21289
21290         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21291         if two delegates are compatible.
21292
21293         (NewDelegate::DoResolve): Update to take care of the case when
21294         we instantiate a delegate from another delegate.
21295
21296         * typemanager.cs (FindMembers): Don't even try to look up members
21297         of Delegate types for now.
21298
21299 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21300
21301         * delegate.cs (NewDelegate): New class to take care of delegate
21302         instantiation.
21303
21304         * expression.cs (New): Split the delegate related code out into 
21305         the NewDelegate class.
21306
21307         * delegate.cs (DelegateInvocation): New class to handle delegate 
21308         invocation.
21309
21310         * expression.cs (Invocation): Split out delegate related code into
21311         the DelegateInvocation class.
21312
21313 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21314
21315         * expression.cs (New::DoResolve): Implement delegate creation fully
21316         and according to the spec.
21317
21318         (New::DoEmit): Update to handle delegates differently.
21319
21320         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21321         because of which we were printing out arguments in reverse order !
21322
21323         * delegate.cs (VerifyMethod): Implement to check if the given method
21324         matches the delegate.
21325
21326         (FullDelegateDesc): Implement.
21327
21328         (VerifyApplicability): Implement.
21329
21330         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21331         delegate invocations too.
21332
21333         (Invocation::Emit): Ditto.
21334
21335         * ../errors/cs1593.cs : Added.
21336
21337         * ../errors/cs1594.cs : Added.
21338
21339         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21340
21341 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21342
21343         * typemanager.cs (intptr_type): Core type for System.IntPtr
21344
21345         (InitCoreTypes): Update for the same.
21346
21347         (iasyncresult_type, asynccallback_type): Ditto.
21348
21349         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21350         correct.
21351
21352         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21353         too.
21354
21355         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21356         the builders for the 4 members of a delegate type :-)
21357
21358         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21359         type.
21360
21361         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21362
21363         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21364
21365 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21366
21367         * statement.cs (Break::Emit): Implement.   
21368         (Continue::Emit): Implement.
21369
21370         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21371         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21372         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21373         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21374         end loop
21375
21376         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21377         properties that track the label for the current loop (begin of the
21378         loop and end of the loop).
21379
21380 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21381
21382         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21383         use of emitting anything at all.
21384
21385         * class.cs, rootcontext.cs : Get rid of calls to the same.
21386
21387         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21388
21389         (Populate): Define the constructor correctly and set the implementation
21390         attributes.
21391
21392         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21393         have been defined.
21394
21395         (AddDelegateType): Implement.
21396
21397         (IsDelegateType): Implement helper method.
21398
21399         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21400
21401         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21402         and accordingly handle it.
21403
21404         * delegate.cs (Populate): Take TypeContainer argument.
21405         Implement bits to define the Invoke method. However, I still haven't figured out
21406         how to take care of the native int bit :-(
21407
21408         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21409         Qualify the name of the delegate, not its return type !
21410
21411         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21412         conversion.
21413
21414         (StandardConversionExists): Checking for array types turns out to be recursive.
21415
21416         (ConvertReferenceExplicit): Implement array conversion.
21417
21418         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21419
21420 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21421
21422         * cs-parser.jay (delegate_declaration): Store the fully qualified
21423         name as it is a type declaration.
21424
21425         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21426         readonly.
21427
21428         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21429         as TypeContainer::DefineType.
21430
21431         (Populate): Method in which all the definition of the various methods (Invoke)
21432         etc is done.
21433
21434         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21435         see.
21436
21437         (CloseDelegate): Finally creates the delegate.
21438
21439         * class.cs (TypeContainer::DefineType): Update to define delegates.
21440         (Populate, Emit and CloseType): Do the same thing here too.
21441
21442         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21443         delegates in all these operations.
21444
21445 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21446
21447         * expression.cs: LocalTemporary: a new expression used to
21448         reference a temporary that has been created.
21449
21450         * assign.cs: Handle PropertyAccess back here, so that we can
21451         provide the proper semantic access to properties.
21452
21453         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21454         a few more explicit conversions. 
21455
21456         * modifiers.cs: `NEW' modifier maps to HideBySig.
21457
21458         * expression.cs (PropertyExpr): Make this into an
21459         ExpressionStatement, and support the EmitStatement code path. 
21460
21461         Perform get/set error checking, clean up the interface.
21462
21463         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21464         them into toplevel access objects.
21465
21466 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21467
21468         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21469         SRE.
21470
21471         * typemanager.cs: Keep track here of our PropertyBuilders again to
21472         work around lameness in SRE.
21473
21474 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21475
21476         * expression.cs (LValue::LValueResolve): New method in the
21477         interface, used to perform a second resolution pass for LValues. 
21478
21479         (This::DoResolve): Catch the use of this in static methods.
21480
21481         (This::LValueResolve): Implement.
21482
21483         (This::Store): Remove warning, assigning to `this' in structures
21484         is 
21485
21486         (Invocation::Emit): Deal with invocation of
21487         methods on value types.  We need to pass the address to structure
21488         methods rather than the object itself.  (The equivalent code to
21489         emit "this" for structures leaves the entire structure on the
21490         stack instead of a pointer to it). 
21491
21492         (ParameterReference::DoResolve): Compute the real index for the
21493         argument based on whether the method takes or not a `this' pointer
21494         (ie, the method is static).
21495
21496         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21497         value types returned from functions when we need to invoke a
21498         method on the sturcture.
21499
21500
21501 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21502
21503         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21504         defining the type in the Modulebuilder or Typebuilder. This is to take
21505         care of nested types which need to be defined on the TypeBuilder using
21506         DefineNestedMethod.
21507
21508         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21509         methods in RootContext, only ported to be part of TypeContainer.
21510
21511         (TypeContainer::GetInterfaceOrClass): Ditto.
21512
21513         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21514
21515         * interface.cs (Interface::DefineInterface): New method. Does exactly
21516         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21517         too.
21518
21519         (Interface::GetInterfaces): Move from RootContext here and port.
21520
21521         (Interface::GetInterfaceByName): Same here.
21522
21523         * rootcontext.cs (ResolveTree): Re-write.
21524
21525         (PopulateTypes): Re-write.
21526
21527         * class.cs (TypeContainer::Populate): Populate nested types too.
21528         (TypeContainer::Emit): Emit nested members too.
21529
21530         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21531         instead just use the name argument passed in as it is already fully
21532         qualified.
21533
21534         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21535         to TypeContainer mapping to see if a type is user-defined.
21536
21537         * class.cs (TypeContainer::CloseType): Implement. 
21538
21539         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21540         the default constructor.
21541
21542         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21543         twice.
21544
21545         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21546
21547         * interface.cs (CloseType): Create the type here.
21548
21549         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21550         the hierarchy.
21551
21552         Remove all the methods which are now in TypeContainer.
21553
21554 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21555
21556         * delegate.cs (Define): Re-write bits to define the delegate
21557         correctly.
21558
21559 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21560
21561         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21562
21563         * expression.cs (ImplicitReferenceConversion): handle null as well
21564         as a source to convert to any reference type.
21565
21566         * statement.cs (Return): Perform any implicit conversions to
21567         expected return type.  
21568
21569         Validate use of return statement.  
21570
21571         * codegen.cs (EmitContext): Pass the expected return type here.
21572
21573         * class.cs (Method, Constructor, Property): Pass expected return
21574         type to EmitContext.
21575
21576 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21577
21578         * expression.cs: Make DoResolve take an EmitContext instead of a
21579         TypeContainer.
21580
21581         Replaced `l' and `location' for `loc', for consistency.
21582
21583         (Error, Warning): Remove unneeded Tc argument.
21584
21585         * assign.cs, literal.cs, constant.cs: Update to new calling
21586         convention. 
21587
21588         * codegen.cs: EmitContext now contains a flag indicating whether
21589         code is being generated in a static method or not.
21590
21591         * cs-parser.jay: DecomposeQI, new function that replaces the old
21592         QualifiedIdentifier.  Now we always decompose the assembled
21593         strings from qualified_identifier productions into a group of
21594         memberaccesses.
21595
21596 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21597
21598         * rootcontext.cs: Deal with field-less struct types correctly now
21599         by passing the size option to Define Type.
21600
21601         * class.cs: Removed hack that created one static field. 
21602
21603 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21604
21605         * statement.cs: Moved most of the code generation here. 
21606
21607 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21608
21609         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21610         seem very right.
21611
21612         (ElementAccess): Remove useless bits for now - keep checks as the spec
21613         says.
21614
21615 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21616
21617         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21618         and start performing checks according to the spec.
21619
21620 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21621
21622         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21623         rank_specifiers instead.
21624
21625         (rank_specifiers): Change the order in which the rank specifiers are stored
21626
21627         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21628
21629         * expression.cs (ElementAccess): Implement the LValue interface too.
21630
21631 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21632
21633         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21634         except that user defined conversions are not included.
21635
21636         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21637         perform the conversion of the return type, if necessary.
21638
21639         (New::DoResolve): Check whether we are creating an array or an object
21640         and accordingly do the needful.
21641
21642         (New::Emit): Same here.
21643
21644         (New::DoResolve): Implement guts of array creation.
21645
21646         (New::FormLookupType): Helper function.
21647
21648 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21649
21650         * codegen.cs: Removed most of the code generation here, and move the
21651         corresponding code generation bits to the statement classes. 
21652
21653         Added support for try/catch/finalize and throw.
21654
21655         * cs-parser.jay: Added support for try/catch/finalize.
21656
21657         * class.cs: Catch static methods having the flags override,
21658         virtual or abstract.
21659
21660         * expression.cs (UserCast): This user cast was not really doing
21661         what it was supposed to do.  Which is to be born in fully resolved
21662         state.  Parts of the resolution were being performed at Emit time! 
21663
21664         Fixed this code.
21665
21666 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21667
21668         * expression.cs: Implicity convert the result from UserCast.
21669
21670 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21671
21672         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21673         prevented it from working correctly. 
21674
21675         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21676         merely ConvertImplicit.
21677
21678 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21679
21680         * typemanager.cs: Make the LookupTypeContainer function static,
21681         and not per-instance.  
21682
21683         * class.cs: Make static FindMembers (the one that takes a Type
21684         argument). 
21685
21686         * codegen.cs: Add EmitForeach here.
21687
21688         * cs-parser.jay: Make foreach a toplevel object instead of the
21689         inline expansion, as we need to perform semantic analysis on it. 
21690
21691 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21692
21693         * expression.cs (Expression::ImplicitUserConversion): Rename to
21694         UserDefinedConversion.
21695
21696         (Expression::UserDefinedConversion): Take an extra argument specifying 
21697         whether we look for explicit user conversions too.
21698
21699         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21700
21701         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21702
21703         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21704         with the appropriate arguments.
21705
21706         * cs-parser.jay (cast_expression): Record location too.
21707
21708         * expression.cs (Cast): Record location info.
21709
21710         (Expression::ConvertExplicit): Take location argument.
21711
21712         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21713         to determine if we are doing explicit conversions.
21714
21715         (UserCast::Emit): Update accordingly.
21716
21717         (Expression::ConvertExplicit): Report an error if everything fails.
21718
21719         * ../errors/cs0030.cs : Add.
21720
21721 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21722
21723         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21724         virtual and newslot bits. 
21725
21726         * class.cs (TypeContainer::RegisterRequiredImplementations):
21727         Record methods we need.
21728
21729         (TypeContainer::MakeKey): Helper function to make keys for
21730         MethodBases, since the Methodbase key is useless.
21731
21732         (TypeContainer::Populate): Call RegisterRequiredImplementations
21733         before defining the methods.   
21734
21735         Create a mapping for method_builders_to_methods ahead of time
21736         instead of inside a tight loop.
21737
21738         (::RequireMethods):  Accept an object as the data to set into the
21739         hashtable so we can report interface vs abstract method mismatch.
21740
21741 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21742
21743         * report.cs: Make all of it static.
21744
21745         * rootcontext.cs: Drop object_type and value_type computations, as
21746         we have those in the TypeManager anyways.
21747
21748         Drop report instance variable too, now it is a global.
21749
21750         * driver.cs: Use try/catch on command line handling.
21751
21752         Add --probe option to debug the error reporting system with a test
21753         suite. 
21754
21755         * report.cs: Add support for exiting program when a probe
21756         condition is reached.
21757
21758 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21759
21760         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21761         we do a forcible conversion regardless of type, to check if 
21762         ForceConversion returns a null.
21763
21764         (Binary::error19): Use location to report error.
21765
21766         (Unary::error23): Use location here too.
21767
21768         * ../errors/cs0019.cs : Check in.
21769
21770         * ../errors/cs0023.cs : Check in.
21771
21772         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21773         case of a non-null MethodInfo object with a length of 0 !
21774
21775         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21776         an applicable member - according to the spec :-)
21777         Also fix logic to find members in base types.
21778
21779         (Unary::ResolveOperator): Same here.
21780
21781         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21782         as I was getting thoroughly confused between this and error19 :-)
21783
21784         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21785         (::FindMostEncompassedType): Implement.
21786         (::FindMostEncompassingType): Implement.
21787         (::StandardConversionExists): Implement.
21788
21789         (UserImplicitCast): Re-vamp. We now need info about most specific
21790         source and target types so that we can do the necessary conversions.
21791
21792         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21793         mathematical union with no duplicates.
21794
21795 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21796
21797         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21798         in order from base classes to child classes, so that we can in
21799         child classes look up in our parent for method names and
21800         attributes (required for handling abstract, virtual, new, override
21801         constructs: we need to instrospect our base class, and if we dont
21802         populate the classes in order, the introspection might be
21803         incorrect.  For example, a method could query its parent before
21804         the parent has any methods and would determine that the parent has
21805         no abstract methods (while it could have had them)).
21806
21807         (RootContext::CreateType): Record the order in which we define the
21808         classes.
21809
21810 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21811
21812         * class.cs (TypeContainer::Populate): Also method definitions can
21813         fail now, keep track of this.
21814
21815         (TypeContainer::FindMembers): Implement support for
21816         DeclaredOnly/noDeclaredOnly flag.
21817
21818         (Constructor::Emit) Return the ConstructorBuilder.
21819
21820         (Method::Emit) Return the MethodBuilder. 
21821         Check for abstract or virtual methods to be public.
21822
21823         * rootcontext.cs (RootContext::CreateType): Register all the
21824         abstract methods required for the class to be complete and the
21825         interface methods that must be implemented. 
21826
21827         * cs-parser.jay: Report error 501 (method requires body if it is
21828         not marked abstract or extern).
21829
21830         * expression.cs (TypeOf::Emit): Implement.
21831
21832         * typemanager.cs: runtime_handle_type, new global type.
21833
21834         * class.cs (Property::Emit): Generate code for properties.
21835
21836 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21837
21838         * expression.cs (Unary::ResolveOperator): Find operators on base type
21839         too - we now conform exactly to the spec.
21840
21841         (Binary::ResolveOperator): Same here.
21842
21843         * class.cs (Operator::Define): Fix minor quirk in the tests.
21844
21845         * ../errors/cs0215.cs : Added.
21846
21847         * ../errors/cs0556.cs : Added.
21848
21849         * ../errors/cs0555.cs : Added.
21850
21851 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21852
21853         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21854         single integer which is really efficient
21855
21856 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21857
21858         *  expression.cs (Expression::ImplicitUserConversion): Use location
21859         even in the case when we are examining True operators.
21860  
21861         * class.cs (Operator::Define): Perform extensive checks to conform
21862         with the rules for operator overloading in the spec.
21863
21864         * expression.cs (Expression::ImplicitReferenceConversion): Implement
21865         some of the other conversions mentioned in the spec.
21866
21867         * typemanager.cs (array_type): New static member for the System.Array built-in
21868         type.
21869
21870         (cloneable_interface): For System.ICloneable interface.
21871
21872         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21873         we start resolving the tree and populating types.
21874
21875         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21876  
21877 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21878
21879         * expression.cs (Expression::ExprClassFromMemberInfo,
21880         Expression::Literalize): Create literal expressions from
21881         FieldInfos which are literals.
21882
21883         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21884         type casts, because they were wrong.  The test suite in tests
21885         caught these ones.
21886
21887         (ImplicitNumericConversion): ushort to ulong requires a widening
21888         cast. 
21889
21890         Int32 constant to long requires widening cast as well.
21891
21892         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21893         for integers because the type on the stack is not i4.
21894
21895 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
21896
21897         * expression.cs (report118): require location argument. 
21898
21899         * parameter.cs: Do not dereference potential null value.
21900
21901         * class.cs: Catch methods that lack the `new' keyword when
21902         overriding a name.  Report warnings when `new' is used without
21903         anything being there to override.
21904
21905         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21906
21907         * class.cs: Only add constructor to hashtable if it is non-null
21908         (as now constructors can fail on define).
21909
21910         (TypeManager, Class, Struct): Take location arguments.
21911
21912         Catch field instance initialization in structs as errors.
21913
21914         accepting_filter: a new filter for FindMembers that is static so
21915         that we dont create an instance per invocation.
21916
21917         (Constructor::Define): Catch errors where a struct constructor is
21918         parameterless 
21919
21920         * cs-parser.jay: Pass location information for various new
21921         constructs. 
21922
21923         * delegate.cs (Delegate): take a location argument.
21924
21925         * driver.cs: Do not call EmitCode if there were problesm in the
21926         Definition of the types, as many Builders wont be there. 
21927
21928         * decl.cs (Decl::Decl): Require a location argument.
21929
21930         * cs-tokenizer.cs: Handle properly hex constants that can not fit
21931         into integers, and find the most appropiate integer for it.
21932
21933         * literal.cs: Implement ULongLiteral.
21934
21935         * rootcontext.cs: Provide better information about the location of
21936         failure when CreateType fails.
21937
21938 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
21939
21940         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21941         as well.
21942
21943         * expression.cs (Binary::CheckShiftArguments): Add missing type
21944         computation.
21945         (Binary::ResolveOperator): Add type to the logical and and logical
21946         or, Bitwise And/Or and Exclusive Or code paths, it was missing
21947         before.
21948
21949         (Binary::DoNumericPromotions): In the case where either argument
21950         is ulong (and most signed types combined with ulong cause an
21951         error) perform implicit integer constant conversions as well.
21952
21953 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21954
21955         * expression.cs (UserImplicitCast): Method should always be
21956         non-null. 
21957         (Invocation::BetterConversion): Simplified test for IntLiteral.
21958
21959         (Expression::ImplicitNumericConversion): Split this routine out.
21960         Put the code that performs implicit constant integer conversions
21961         here. 
21962
21963         (Expression::Resolve): Become a wrapper around DoResolve so we can
21964         check eclass and type being set after resolve.
21965
21966         (Invocation::Badness): Remove this dead function
21967
21968         (Binary::ResolveOperator): Do not compute the expensive argumnets
21969         unless we have a union for it.
21970
21971         (Probe::Emit): Is needs to do an isinst and then
21972         compare against null.
21973
21974         (::CanConvert): Added Location argument.  If the Location argument
21975         is null (Location.Null), then we do not report errors.  This is
21976         used by the `probe' mechanism of the Explicit conversion.  We do
21977         not want to generate an error for something that the user
21978         explicitly requested to be casted.  But the pipeline for an
21979         explicit cast first tests for potential implicit casts.
21980
21981         So for now, if the Location is null, it means `Probe only' to
21982         avoid adding another argument.   Might have to revise this
21983         strategy later.
21984
21985         (ClassCast): New class used to type cast objects into arbitrary
21986         classes (used in Explicit Reference Conversions).
21987
21988         Implement `as' as well.
21989
21990         Reverted all the patches from Ravi below: they were broken:
21991
21992                 * The use of `level' as a mechanism to stop recursive
21993                   invocations is wrong.  That was there just to catch the
21994                   bug with a strack trace but not as a way of addressing
21995                   the problem.
21996
21997                   To fix the problem we have to *understand* what is going
21998                   on and the interactions and come up with a plan, not
21999                   just get things going.
22000
22001                 * The use of the type conversion cache that I proposed
22002                   last night had an open topic: How does this work across
22003                   protection domains.  A user defined conversion might not
22004                   be public in the location where we are applying the
22005                   conversion, a different conversion might be selected
22006                   (ie, private A->B (better) but public B->A (worse),
22007                   inside A, A->B applies, but outside it, B->A will
22008                   apply).
22009
22010                 * On top of that (ie, even if the above is solved),
22011                   conversions in a cache need to be abstract.  Ie, `To
22012                   convert from an Int to a Short use an OpcodeCast', not
22013                   `To convert from an Int to a Short use the OpcodeCast on
22014                   the variable 5' (which is what this patch was doing).
22015
22016 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22017
22018         * expression.cs (Invocation::ConversionExists): Re-write to use
22019         the conversion cache
22020
22021         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22022         cache all conversions done, not just user-defined ones.
22023
22024         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22025         to determine if a conversion exists instead of acutually trying to 
22026         perform the conversion. It's faster too.
22027
22028         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22029         and only then attempt the implicit conversion.
22030
22031 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22032
22033         * expression.cs (ConvertImplicit): Use a cache for conversions
22034         already found. Check level of recursion and bail out if necessary.
22035
22036 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22037
22038         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22039         Export standard methods that we expect for string operations.
22040
22041         * statement.cs (Block::UsageWarning): Track usage of variables and
22042         report the errors for not used variables.
22043
22044         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22045         operator. 
22046
22047 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22048
22049         * codegen.cs: remove unnneded code 
22050
22051         * expression.cs: Removed BuiltinTypeAccess class
22052
22053         Fix the order in which implicit conversions are
22054         done.  
22055
22056         The previous fixed dropped support for boxed conversions (adding a
22057         test to the test suite now)
22058
22059         (UserImplicitCast::CanConvert): Remove test for source being null,
22060         that code is broken.  We should not feed a null to begin with, if
22061         we do, then we should track the bug where the problem originates
22062         and not try to cover it up here.
22063
22064         Return a resolved expression of type UserImplicitCast on success
22065         rather than true/false.  Ravi: this is what I was talking about,
22066         the pattern is to use a static method as a "constructor" for
22067         objects. 
22068
22069         Also, do not create arguments until the very last minute,
22070         otherwise we always create the arguments even for lookups that
22071         will never be performed. 
22072
22073         (UserImplicitCast::Resolve): Eliminate, objects of type
22074         UserImplicitCast are born in a fully resolved state. 
22075
22076         * typemanager.cs (InitCoreTypes): Init also value_type
22077         (System.ValueType). 
22078
22079         * expression.cs (Cast::Resolve): First resolve the child expression.
22080
22081         (LValue): Add new method AddressOf to be used by
22082         the `&' operator.  
22083
22084         Change the argument of Store to take an EmitContext instead of an
22085         ILGenerator, because things like FieldExpr need to be able to call
22086         their children expression to generate the instance code. 
22087
22088         (Expression::Error, Expression::Warning): Sugar functions for
22089         reporting errors.
22090
22091         (Expression::MemberLookup): Accept a TypeContainer instead of a
22092         Report as the first argument.
22093
22094         (Expression::ResolvePrimary): Killed.  I still want to improve
22095         this as currently the code is just not right.
22096
22097         (Expression::ResolveMemberAccess): Simplify, but it is still
22098         wrong. 
22099
22100         (Unary::Resolve): Catch errors in AddressOf operators.
22101
22102         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22103         index to a byte for the short-version, or the compiler will choose
22104         the wrong Emit call, which generates the wrong data.
22105
22106         (ParameterReference::Emit, ::Store): same.
22107
22108         (FieldExpr::AddressOf): Implement.
22109
22110         * typemanager.cs: TypeManager: made public variable instead of
22111         property.
22112
22113         * driver.cs: document --fatal.
22114
22115         * report.cs (ErrorMessage, WarningMessage): new names for the old
22116         Error and Warning classes.
22117
22118         * cs-parser.jay (member_access): Turn built-in access to types
22119         into a normal simplename
22120
22121 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22122
22123         * expression.cs (Invocation::BetterConversion): Fix to cope
22124         with q being null, since this was introducing a bug.
22125
22126         * expression.cs (ConvertImplicit): Do built-in conversions first.
22127
22128 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22129
22130         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22131
22132 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22133
22134         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22135         I had introduced long ago (what's new ?).
22136
22137         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22138         the work of all the checking. 
22139         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22140         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22141
22142         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22143         that is the right way. 
22144
22145         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22146         overloading resolution. Use everywhere instead of cutting and pasting code.
22147
22148         (Binary::ResolveOperator): Use MakeUnionSet.
22149
22150         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22151         we have to convert to bool types. Not complete yet.
22152
22153 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22154
22155         * typemanager.cs (TypeManager::CSharpName): support ushort.
22156
22157         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22158         to provide an expression that performsn an implicit constant int
22159         conversion (section 6.1.6).
22160         (Expression::ConvertImplicitRequired): Reworked to include
22161         implicit constant expression conversions.
22162
22163         (Expression::ConvertNumericExplicit): Finished.
22164
22165         (Invocation::Emit): If InstanceExpression is null, then it means
22166         that we perform a call on this.
22167
22168 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22169
22170         * expression.cs (Unary::Emit): Remove some dead code.
22171         (Probe): Implement Resolve and Emit for `is'.
22172         (Expression::ConvertImplicitRequired): Attempt to do constant
22173         expression conversions here.  Maybe should be moved to
22174         ConvertImplicit, but I am not sure.
22175         (Expression::ImplicitLongConstantConversionPossible,
22176         Expression::ImplicitIntConstantConversionPossible): New functions
22177         that tell whether is it possible to apply an implicit constant
22178         expression conversion.
22179
22180         (ConvertNumericExplicit): Started work on explicit numeric
22181         conversions.
22182
22183         * cs-parser.jay: Update operator constants.
22184
22185         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22186         (Parameters::GetSignature): Hook up VerifyArgs here.
22187         (Parameters::VerifyArgs): Verifies that no two arguments have the
22188         same name. 
22189
22190         * class.cs (Operator): Update the operator names to reflect the
22191         ones that the spec expects (as we are just stringizing the
22192         operator names).
22193
22194         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22195         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22196         previous usage did only work for our methods.
22197         (Expression::ConvertImplicit): Handle decimal implicit numeric
22198         conversions as well.
22199         (Expression::InternalTypeConstructor): Used to invoke constructors
22200         on internal types for default promotions.
22201
22202         (Unary::Emit): Implement special handling for the pre/post
22203         increment/decrement for overloaded operators, as they need to have
22204         the same semantics as the other operators.
22205
22206         (Binary::ResolveOperator): ditto.
22207         (Invocation::ConversionExists): ditto.
22208         (UserImplicitCast::Resolve): ditto.
22209
22210 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22211
22212         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22213         operator, return after emitting body. Regression tests pass again !
22214
22215         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22216         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22217         (Invocation::OverloadResolve): Ditto.
22218         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22219
22220         * everywhere : update calls to the above methods accordingly.
22221
22222 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22223
22224         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22225
22226         * expression.cs (ExpressionStatement): New base class used for
22227         expressions that can appear in statements, so that we can provide
22228         an alternate path to generate expression that do not leave a value
22229         on the stack.
22230
22231         (Expression::Emit, and all the derivatives): We no longer return
22232         whether a value is left on the stack or not.  Every expression
22233         after being emitted leaves a single value on the stack.
22234
22235         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22236         facilties of ExpressionStatement if possible.
22237
22238         * cs-parser.jay: Update statement_expression.
22239
22240 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22241
22242         * driver.cs: Change the wording of message
22243
22244 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22245
22246         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22247         the type of the expression to the return type of the method if
22248         we have an overloaded operator match ! The regression tests pass again !
22249         (Unary::ResolveOperator): Ditto.
22250
22251         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22252         to find "op_Implicit", not "implicit" ;-)
22253         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22254         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22255
22256         * everywhere : Correct calls to the above accordingly.
22257
22258         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22259         (ConvertImplicit): Do user-defined conversion if it exists.
22260
22261 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22262
22263         * assign.cs: track location.
22264         (Resolve): Use implicit conversions on assignment.
22265
22266         * literal.cs: Oops.  Not good, Emit of short access values should
22267         pass (Bytes) or the wrong argument will be selected.
22268
22269         * expression.cs (Unary::Emit): Emit code for -expr.
22270
22271         (Unary::ResolveOperator): Handle `Substract' for non-constants
22272         (substract from zero from the non-constants).
22273         Deal with Doubles as well. 
22274
22275         (Expression::ConvertImplicitRequired): New routine that reports an
22276         error if no implicit conversion exists. 
22277
22278         (Invocation::OverloadResolve): Store the converted implicit
22279         expressions if we make them
22280
22281 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22282
22283         * class.cs (ConstructorInitializer): Take a Location argument.
22284         (ConstructorBaseInitializer): Same here.
22285         (ConstructorThisInitializer): Same here.
22286
22287         * cs-parser.jay : Update all calls accordingly.
22288
22289         * expression.cs (Unary, Binary, New): Take location argument.
22290         Update accordingly everywhere.
22291
22292         * cs-parser.jay : Update all calls to the above to take a location
22293         argument.
22294
22295         * class.cs : Ditto.
22296
22297 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22298
22299         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22300         (Invocation::BetterConversion): Same here
22301         (Invocation::ConversionExists): Ditto.
22302
22303         (Invocation::ConversionExists): Implement.
22304
22305 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22306
22307         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22308         Also take an additional TypeContainer argument.
22309
22310         * All over : Pass in TypeContainer as argument to OverloadResolve.
22311
22312         * typemanager.cs (CSharpName): Update to check for the string type and return
22313         that too.
22314
22315         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22316         a given method.
22317
22318 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22319
22320         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22321         (Invocation::BetterFunction): Implement.
22322         (Invocation::BetterConversion): Implement.
22323         (Invocation::ConversionExists): Skeleton, no implementation yet.
22324
22325         Okay, things work fine !
22326
22327 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22328
22329         * typemanager.cs: declare and load enum_type, delegate_type and
22330         void_type. 
22331
22332         * expression.cs (Expression::Emit): Now emit returns a value that
22333         tells whether a value is left on the stack or not.  This strategy
22334         might be reveted tomorrow with a mechanism that would address
22335         multiple assignments.
22336         (Expression::report118): Utility routine to report mismatches on
22337         the ExprClass.
22338
22339         (Unary::Report23): Report impossible type/operator combination
22340         utility function.
22341
22342         (Unary::IsIncrementableNumber): Whether the type can be
22343         incremented or decremented with add.
22344         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22345         complemented. 
22346         (Unary::ResolveOperator): Implement ++, !, ~,
22347
22348         (Invocation::Emit): Deal with new Emit convetion.
22349
22350         * All Expression derivatives: Updated their Emit method to return
22351         whether they leave values on the stack or not.
22352
22353         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22354         stack for expressions that are statements. 
22355
22356 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22357
22358         * expression.cs (LValue): New interface.  Must be implemented by
22359         LValue objects.
22360         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22361         LValue interface.
22362
22363         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22364         interface for generating code, simplifies the code.
22365
22366 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22367
22368         * expression.cs (everywhere): Comment out return statements in ::Resolve
22369         methods to avoid the warnings.
22370
22371 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22372
22373         * driver.cs (parse): Report error 2001 if we can not open the
22374         source file.
22375
22376         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22377         not resolve it.
22378
22379         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22380         object. 
22381
22382         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22383         otherwise nested blocks end up with the same index.
22384
22385         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22386
22387         * expression.cs:  Instead of having FIXMEs in the Resolve
22388         functions, throw exceptions so it is obvious that we are facing a
22389         bug. 
22390
22391         * cs-parser.jay (invocation_expression): Pass Location information.
22392
22393         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22394         Use a basename for those routines because .NET does not like paths
22395         on them. 
22396
22397         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22398         already defined.
22399
22400 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22401
22402         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22403         are loading the correct data types (throws an exception if not).
22404         (TypeManager::InitCoreTypes): Use CoreLookupType
22405
22406         * expression.cs (Unary::ResolveOperator): return the child
22407         expression for expressions which are just +expr.
22408         (Unary::ResolveOperator): Return negative literals for -LITERAL
22409         expressions (otherwise they are Unary {Literal}).
22410         (Invocation::Badness): Take into account `Implicit constant
22411         expression conversions'.
22412
22413         * literal.cs (LongLiteral): Implement long literal class.
22414         (IntLiteral): export the `Value' of the intliteral. 
22415
22416 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22417
22418         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22419
22420         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22421         instead of 'Operator'
22422
22423         * expression.cs (Binary::ResolveOperator): Update accordingly.
22424         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22425         and 'Minus'
22426
22427         * cs-parser.jay (unary_expression): Update to use the new names.
22428
22429         * gen-treedump.cs (GetUnary): Same here.
22430
22431         * expression.cs (Unary::Resolve): Implement.
22432         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22433         operators are found instead of making noise ;-)
22434         (Unary::ResolveOperator): New method to do precisely the same thing which
22435         Binary::ResolveOperator does for Binary expressions.
22436         (Unary.method, .Arguments): Add.
22437         (Unary::OperName): Implement.   
22438         (Unary::ForceConversion): Copy and Paste !
22439
22440         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22441         a unary operator.
22442
22443         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22444         for the inbuilt operators. Only overloading works for now ;-)
22445
22446 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22447
22448         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22449         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22450
22451         * expression.cs (This::Emit): Implement. 
22452         (This::Resolve): Implement.
22453         (TypeOf:Resolve): Implement.
22454         (Expression::ResolveSimpleName): Add an implicit this to instance
22455         field references. 
22456         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22457         Bind instance variable to Field expressions.
22458         (FieldExpr::Instance): New field used to track the expression that
22459         represents the object instance.
22460         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22461         binding 
22462         (FieldExpr::Emit): Implement.
22463
22464         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22465         the last instruction contains a return opcode to avoid generating
22466         the last `ret' instruction (this generates correct code, and it is
22467         nice to pass the peverify output).
22468
22469         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22470         initializer for static and instance variables.
22471         (Constructor::Emit): Allow initializer to be null in the case of
22472         static constructors.  Only emit initializer for instance
22473         constructors. 
22474
22475         (TypeContainer::FindMembers): Return a null array if there are no
22476         matches.
22477
22478         Also fix the code for the MemberTypes.Method branch, as it was not
22479         scanning that for operators (or tried to access null variables before).
22480
22481         * assign.cs (Assign::Emit): Handle instance and static fields. 
22482
22483         * TODO: Updated.
22484
22485         * driver.cs: Stop compilation if there are parse errors.
22486
22487         * cs-parser.jay (constructor_declaration): Provide default base
22488         initializer for non-static constructors.
22489         (constructor_declarator): Do not provide a default base
22490         initializers if none was specified.
22491         Catch the fact that constructors should not have parameters.
22492
22493         * class.cs: Do not emit parent class initializers for static
22494         constructors, that should be flagged as an error.
22495
22496 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22497
22498         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22499         Move back code into TypeContainer::Populate.
22500
22501 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22502
22503         * class.cs (TypeContainer::AddConstructor): Fix the check to
22504         compare against Name, not Basename. 
22505         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22506
22507         * cs-parser.jay : Update accordingly.
22508
22509         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22510         for methods, don't forget to look into the operators too.
22511         (RegisterMethodBuilder): Helper method to take care of this for
22512         methods, constructors and operators.
22513         (Operator::Define): Completely revamp.
22514         (Operator.OperatorMethod, MethodName): New fields.
22515         (TypeContainer::Populate): Move the registering of builders into
22516         RegisterMethodBuilder.
22517         (Operator::Emit): Re-write.
22518
22519         * expression.cs (Binary::Emit): Comment out code path to emit method
22520         invocation stuff for the case when we have a user defined operator. I am
22521         just not able to get it right !
22522
22523 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22524
22525         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22526         argument. 
22527
22528         (Expression::MemberLookup): Provide a version that allows to
22529         specify the MemberTypes and BindingFlags. 
22530
22531         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22532         so it was not fetching variable information from outer blocks.
22533
22534         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22535         Beforefieldinit as it was buggy.
22536
22537         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22538         that Ravi put here.  
22539
22540         * class.cs (Constructor::Emit): Only emit if block is not null.
22541         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22542         deal with this by semantically definining it as if the user had
22543         done it.
22544
22545         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22546         constructors as we now "emit" them at a higher level.
22547
22548         (TypeContainer::DefineDefaultConstructor): Used to define the
22549         default constructors if none was provided.
22550
22551         (ConstructorInitializer): Add methods Resolve and Emit. 
22552
22553         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22554
22555 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22556
22557         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22558         the default constructor builder with our hashtable for methodbuilders
22559         to methodcores.
22560
22561         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22562         and argument_count is 0 in which case we have a match.
22563         (Binary::ResolveOperator): More null checking and miscellaneous coding
22564         style cleanup.
22565
22566 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22567
22568         * rootcontext.cs (IsNameSpace): Compare against null.
22569
22570         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22571
22572         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22573         and Unary::Operator.
22574
22575         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22576         accordingly.
22577
22578         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22579         we have overloaded operators.
22580         (Binary::ResolveOperator): Implement the part which does the operator overload
22581         resolution.
22582
22583         * class.cs (Operator::Emit): Implement.
22584         (TypeContainer::Emit): Emit the operators we have too.
22585
22586         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22587         the case when we have a user-defined operator.
22588
22589 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22590
22591         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22592
22593 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22594
22595         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22596         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22597         (Constructor::Emit): Implement.
22598         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22599         if we have no work to do. 
22600         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22601         Emit method.
22602
22603         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22604         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22605
22606         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22607         of parent.parent.
22608
22609 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22610
22611         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22612         in the source.
22613         (Tree::RecordNamespace): Method to do what the name says ;-)
22614         (Tree::Namespaces): Property to get at the namespaces hashtable.
22615
22616         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22617         keep track.
22618
22619         * rootcontext.cs (IsNamespace): Fixed it :-)
22620
22621 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22622
22623         * class.cs (TypeContainer::FindMembers): Add support for
22624         constructors. 
22625         (MethodCore): New class that encapsulates both the shared aspects
22626         of a Constructor and a Method.  
22627         (Method, Constructor): Factored pieces into MethodCore.
22628
22629         * driver.cs: Added --fatal which makes errors throw exceptions.
22630         Load System assembly as well as part of the standard library.
22631
22632         * report.cs: Allow throwing exceptions on errors for debugging.
22633
22634         * modifiers.cs: Do not use `parent', instead use the real type
22635         container to evaluate permission settings.
22636
22637         * class.cs: Put Ravi's patch back in.  He is right, and we will
22638         have to cope with the
22639
22640 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22641
22642         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22643         FamORAssem, not FamANDAssem.
22644
22645 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22646
22647         * driver.cs: Added --parse option that only parses its input files
22648         and terminates.
22649
22650         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22651         incorrect.  IsTopLevel is not used to tell whether an object is
22652         root_types or not (that can be achieved by testing this ==
22653         root_types).  But to see if this is a top-level *class* (not
22654         necessarly our "toplevel" container). 
22655
22656 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22657
22658         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22659         parent instead of a direct call to GetType.
22660
22661 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22662
22663         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22664         Modifiers.TypeAttr. This should just be a call to that method.
22665
22666         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22667         object so that we can determine if we are top-level or not.
22668
22669         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22670         TypeContainer too.
22671
22672         * enum.cs (Enum::Define): Ditto.
22673
22674         * modifiers.cs (FieldAttr): Re-write.
22675
22676         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22677         (TypeContainer::HaveStaticConstructor): New property to provide access
22678         to precisely that info.
22679
22680         * modifiers.cs (MethodAttr): Re-write.
22681         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22682
22683         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22684         of top-level types as claimed.
22685
22686 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22687
22688         * expression.cs (MemberLookup): Fruitless attempt to lookup
22689         constructors.  Maybe I need to emit default constructors?  That
22690         might be it (currently .NET emits this for me automatically).
22691         (Invocation::OverloadResolve): Cope with Arguments == null.
22692         (Invocation::EmitArguments): new function, shared by the new
22693         constructor and us.
22694         (Invocation::Emit): Handle static and instance methods.  Emit
22695         proper call instruction for virtual or non-virtual invocations.
22696         (New::Emit): Implement.
22697         (New::Resolve): Implement.
22698         (MemberAccess:Resolve): Implement.
22699         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22700         to track instances.
22701         (FieldExpr::Resolve): Set type.
22702
22703         * support.cs: Handle empty arguments.
22704                 
22705         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22706         SimpleLookup): Auxiliary routines to help parse a qualifier
22707         identifier.  
22708
22709         Update qualifier_identifier rule.
22710
22711         * codegen.cs: Removed debugging messages.
22712
22713         * class.cs: Make this a global thing, this acts just as a "key" to
22714         objects that we might have around.
22715
22716         (Populate): Only initialize method_builders_to_methods once.
22717
22718         * expression.cs (PropertyExpr): Initialize type from the
22719         PropertyType. 
22720
22721         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22722         Resolve pattern.  Attempt to implicitly convert value to boolean.
22723         Emit code.
22724
22725         * expression.cs: Set the type for the int32/int32 argument case.
22726         (Binary::ResolveOperator): Set the return type to boolean for
22727         comparission operators
22728
22729         * typemanager.cs: Remove debugging print code.
22730
22731         (Invocation::Resolve): resolve type.
22732
22733         * class.cs: Allocate a MemberInfo of the correct size, as the code
22734         elsewhere depends on the test to reflect the correct contents.
22735
22736         (Method::) Keep track of parameters, due to System.Reflection holes
22737
22738         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22739         mapping here.
22740
22741         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22742         of the exact size and return that.
22743
22744         (Class::LookupMethodByBuilder): New function that maps
22745         MethodBuilders to its methods.  Required to locate the information
22746         on methods because System.Reflection bit us again.
22747
22748         * support.cs: New file, contains an interface ParameterData and
22749         two implementations: ReflectionParameters and InternalParameters
22750         used to access Parameter information.  We will need to grow this
22751         as required.
22752
22753         * expression.cs (Invocation::GetParameterData): implement a cache
22754         and a wrapper around the ParameterData creation for methods. 
22755         (Invocation::OverloadResolve): Use new code.
22756
22757 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22758
22759         * class.cs (TypeContainer::EmitField): Remove and move into 
22760         (Field::Define): here and modify accordingly.
22761         (Field.FieldBuilder): New member.
22762         (TypeContainer::Populate): Update accordingly.
22763         (TypeContainer::FindMembers): Implement.
22764
22765 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22766
22767         * statement.cs: (VariableInfo::VariableType): New field to be
22768         initialized with the full type once it is resolved. 
22769
22770 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22771
22772         * parameter.cs (GetParameterInfo): Use a type cache to compute
22773         things only once, and to reuse this information
22774
22775         * expression.cs (LocalVariableReference::Emit): Implement.
22776         (OpcodeCast::Emit): fix.
22777
22778         (ParameterReference::Resolve): Implement.
22779         (ParameterReference::Emit): Implement.
22780
22781         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22782         that are expressions need to stay as Expressions.
22783
22784         * typemanager.cs (CSharpName): Returns the C# name of a type if
22785         possible. 
22786
22787         * expression.cs (Expression::ConvertImplicit): New function that
22788         implements implicit type conversions.
22789
22790         (Expression::ImplicitReferenceConversion): Implements implicit
22791         reference conversions.
22792
22793         (EmptyCast): New type for transparent casts.
22794
22795         (OpcodeCast): New type for casts of types that are performed with
22796         a sequence of bytecodes.
22797
22798         (BoxedCast): New type used for casting value types into reference
22799         types.  Emits a box opcode.
22800
22801         (Binary::DoNumericPromotions): Implements numeric promotions of
22802         and computation of the Binary::Type.
22803
22804         (Binary::EmitBranchable): Optimization.
22805
22806         (Binary::Emit): Implement code emission for expressions.
22807
22808         * typemanager.cs (TypeManager): Added two new core types: sbyte
22809         and byte.
22810
22811 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22812
22813         * class.cs (TypeContainer::FindMembers): Method which does exactly
22814         what Type.FindMembers does, only we don't have to use reflection. No
22815         implementation yet.
22816
22817         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22818         typecontainer objects as we need to get at them.
22819         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22820
22821         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22822         typecontainer object.
22823
22824         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22825         of just a Report object.
22826
22827 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22828
22829         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22830         "remove_"
22831         (TypeContainer::Populate): Now define the delegates of the type too.
22832         (TypeContainer.Delegates): Property to access the list of delegates defined
22833         in the type.
22834
22835         * delegates.cs (Delegate::Define): Implement partially.
22836
22837         * modifiers.cs (TypeAttr): Handle more flags.
22838
22839 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22840
22841         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22842         and not <=
22843         (Operator::Define): Re-write logic to get types by using the LookupType method
22844         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22845         (Indexer::Define): Ditto.
22846         (Event::Define): Ditto.
22847         (Property::Define): Ditto.
22848
22849 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22850
22851         * class.cs (TypeContainer::Populate): Now define operators too. 
22852         (TypeContainer.Operators): New property to access the list of operators
22853         in a type.
22854         (Operator.OperatorMethodBuilder): New member to hold the method builder
22855         for the operator we are defining.
22856         (Operator::Define): Implement.
22857
22858 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22859
22860         * class.cs (Event::Define): Make the prefixes of the accessor methods
22861         addOn_ and removeOn_ 
22862
22863         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22864         of the location being passed in too. Ideally, this should go later since all
22865         error reporting should be done through the Report object.
22866
22867         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22868         (Populate): Iterate thru the indexers we have and define them too.
22869         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22870         for the get and set accessors.
22871         (Indexer::Define): Implement.
22872
22873 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
22874
22875         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
22876         my previous implementation, did not work.
22877
22878         * typemanager.cs: Add a couple of missing types (the longs).
22879
22880         * literal.cs: Use TypeManager.bool_type instead of getting it.
22881
22882         * expression.cs (EventExpr): New kind of expressions.
22883         (Expressio::ExprClassFromMemberInfo): finish
22884
22885 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
22886
22887         * assign.cs: Emit stores to static fields differently.
22888
22889 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22890
22891         * Merge in changes and adjust code to tackle conflicts. Backed out my
22892         code in Assign::Resolve ;-) 
22893
22894 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22895
22896         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22897         instead Report.Error and also pass in the location.
22898         (CSharpParser::Lexer): New readonly property to return the reference
22899         to the Tokenizer object.
22900         (declare_local_variables): Use Report.Error with location instead of plain 
22901         old error.
22902         (CheckDef): Ditto.
22903
22904         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22905         (Operator.CheckBinaryOperator): Ditto.
22906
22907         * cs-parser.jay (operator_declarator): Update accordingly.
22908
22909         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22910         (CheckBinaryOperator): Same here.
22911
22912         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22913         on the name without any prefixes of namespace names etc. This is because we
22914         already might have something already fully qualified like 
22915         'System.Console.WriteLine'
22916
22917         * assign.cs (Resolve): Begin implementation. Stuck ;-)
22918
22919 2001-09-07  Ravi Pratap  <ravi@ximian.com>
22920
22921         * cs-tokenizer.cs (location): Return a string which also contains
22922         the file name.
22923
22924         * expression.cs (ElementAccess): New class for expressions of the
22925         type 'element access.'
22926         (BaseAccess): New class for expressions of the type 'base access.'
22927         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22928         respectively.
22929
22930         * cs-parser.jay (element_access): Implement action.
22931         (base_access): Implement actions.
22932         (checked_expression, unchecked_expression): Implement.
22933
22934         * cs-parser.jay (local_variable_type): Correct and implement.
22935         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22936
22937         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22938
22939         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22940         name and the specifiers.
22941
22942         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22943
22944         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
22945         making them all public ;-)
22946
22947         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22948         class anyways.
22949
22950 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
22951
22952         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22953         PropertyExprs.
22954         (FieldExpr, PropertyExprs): New resolved expressions.
22955         (SimpleName::MemberStaticCheck): Perform static checks for access
22956         to non-static fields on static methods. Maybe this should be
22957         generalized for MemberAccesses. 
22958         (SimpleName::ResolveSimpleName): More work on simple name
22959         resolution. 
22960
22961         * cs-parser.jay (primary_expression/qualified_identifier): track
22962         the parameter index.
22963
22964         * codegen.cs (CodeGen::Save): Catch save exception, report error.
22965         (EmitContext::EmitBoolExpression): Chain to expression generation
22966         instead of temporary hack.
22967         (::EmitStatementExpression): Put generic expression code generation.
22968
22969         * assign.cs (Assign::Emit): Implement variable assignments to
22970         local variables, parameters and fields.
22971
22972 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22973
22974         * statement.cs (Block::GetVariableInfo): New method, returns the
22975         VariableInfo for a variable name in a block.
22976         (Block::GetVariableType): Implement in terms of GetVariableInfo
22977
22978         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22979         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22980
22981 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22982
22983         * cs-parser.jay (operator_declaration): Continue on my quest : update
22984         to take attributes argument.
22985         (event_declaration): Ditto.
22986         (enum_declaration): Ditto.
22987         (indexer_declaration): Ditto.
22988
22989         * class.cs (Operator::Operator): Update constructor accordingly.
22990         (Event::Event): Ditto.
22991
22992         * delegate.cs (Delegate::Delegate): Same here.
22993
22994         * enum.cs (Enum::Enum): Same here.
22995
22996 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22997
22998         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22999
23000         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23001
23002         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23003         being passed around as an arraylist.
23004         (Attributes::AddAttribute): Method to add attribute sections.
23005
23006         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23007         (struct_declaration): Update accordingly.
23008         (constant_declaration): Update.
23009         (field_declaration): Update.
23010         (method_header): Update.
23011         (fixed_parameter): Update.
23012         (parameter_array): Ditto.
23013         (property_declaration): Ditto.
23014         (destructor_declaration): Ditto.
23015
23016         * class.cs (Struct::Struct): Update constructors accordingly.
23017         (Class::Class): Ditto.
23018         (Field::Field): Ditto.
23019         (Method::Method): Ditto.
23020         (Property::Property): Ditto.
23021         (TypeContainer::OptAttribute): update property's return type.
23022
23023         * interface.cs (Interface.opt_attributes): New member.
23024         (Interface::Interface): Update to take the extra Attributes argument.
23025
23026         * parameter.cs (Parameter::Parameter): Ditto.
23027
23028         * constant.cs (Constant::Constant): Ditto.
23029
23030         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23031         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23032         the attributes as a parameter.
23033         (InterfaceProperty): Update constructor call.
23034         (InterfaceEvent): Ditto.
23035         (InterfaceMethod): Ditto.
23036         (InterfaceIndexer): Ditto.
23037
23038         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23039         pass the attributes too.
23040         (interface_event_declaration): Ditto.
23041         (interface_property_declaration): Ditto.
23042         (interface_method_declaration): Ditto.
23043         (interface_declaration): Ditto.
23044
23045 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23046
23047         * class.cs (Method::Define): Track the "static Main" definition to
23048         create an entry point. 
23049
23050         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23051         EntryPoint if we find it. 
23052
23053         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23054         (EmitContext::ig): Make this variable public.
23055
23056         * driver.cs: Make the default output file be the first file name
23057         with the .exe extension.  
23058
23059         Detect empty compilations
23060
23061         Handle various kinds of output targets.  Handle --target and
23062         rename -t to --dumper.
23063
23064         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23065         methods inherited from Expression return now an Expression.  This
23066         will is used during the tree rewriting as we resolve them during
23067         semantic analysis.
23068
23069         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23070         the spec.  Missing entirely is the information about
23071         accessability of elements of it.
23072
23073         (Expression::ExprClassFromMemberInfo): New constructor for
23074         Expressions that creates a fully initialized Expression based on
23075         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23076         a Type.
23077
23078         (Invocation::Resolve): Begin implementing resolution of invocations.
23079
23080         * literal.cs (StringLiteral):  Implement Emit.
23081
23082 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23083
23084         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23085         member.
23086
23087 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23088
23089         * cs-parser.jay (attribute_arguments): Implement actions.
23090         (attribute): Fix bug in production. Implement action.
23091         (attribute_list): Implement.
23092         (attribute_target): Implement.
23093         (attribute_target_specifier, opt_target_specifier): Implement
23094         (CheckAttributeTarget): New method to check if the attribute target
23095         is valid.
23096         (attribute_section): Implement.
23097         (opt_attributes): Implement.
23098
23099         * attribute.cs : New file to handle attributes.
23100         (Attribute): Class to hold attribute info.
23101
23102         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23103         (attribute_section): Modify production to use 2 different rules to 
23104         achieve the same thing. 1 s/r conflict down !
23105         Clean out commented, useless, non-reducing dimension_separator rules.
23106
23107         * class.cs (TypeContainer.attributes): New member to hold list
23108         of attributes for a type.
23109         (Struct::Struct): Modify to take one more argument, the attribute list.
23110         (Class::Class): Ditto.
23111         (Field::Field): Ditto.
23112         (Method::Method): Ditto.
23113         (Property::Property): Ditto.
23114
23115         * cs-parser.jay (struct_declaration): Update constructor call to
23116         pass in the attributes too.
23117         (class_declaration): Ditto.
23118         (constant_declaration): Ditto.
23119         (field_declaration): Ditto.
23120         (method_header): Ditto.
23121         (fixed_parameter): Ditto.
23122         (parameter_array): Ditto.
23123         (property_declaration): Ditto.
23124
23125         * constant.cs (Constant::Constant): Update constructor similarly.
23126         Use System.Collections.
23127
23128         * parameter.cs (Parameter::Parameter): Update as above.
23129
23130 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23131
23132         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23133         (TypeContainer.delegates): New member to hold list of delegates.
23134
23135         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23136         this time as I seem to be on crack ;-)
23137
23138 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23139
23140         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23141         tell whether an identifier represents a namespace.
23142
23143         * expression.cs (NamespaceExpr): A namespace expression, used only
23144         temporarly during expression resolution.
23145         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23146         utility functions to resolve names on expressions.
23147
23148 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23149
23150         * codegen.cs: Add hook for StatementExpressions. 
23151
23152         * class.cs: Fix inverted test for static flag in methods.
23153
23154 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23155
23156         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23157         to make it coincide with MS' number.
23158         (Operator::CheckBinaryOperator): Ditto.
23159
23160         * ../errors/errors.txt : Remove error numbers added earlier.
23161
23162         * ../errors/cs1019.cs : Test case for error # 1019
23163
23164         * ../errros/cs1020.cs : Test case for error # 1020
23165
23166         * cs-parser.jay : Clean out commented cruft.
23167         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23168         used anywhere - non-reducing rule.
23169         (namespace_declarations): Non-reducing rule - comment out.
23170
23171         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23172         with TypeContainer::AddEnum.
23173
23174         * delegate.cs : New file for delegate handling classes.
23175         (Delegate): Class for declaring delegates.
23176
23177         * makefile : Update.
23178
23179         * cs-parser.jay (delegate_declaration): Implement.
23180
23181 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23182
23183         * class.cs (Event::Define): Implement.
23184         (Event.EventBuilder): New member.
23185
23186         * class.cs (TypeContainer::Populate): Update to define all enums and events
23187         we have.
23188         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23189         readonly fields for all these cases ?
23190
23191 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23192
23193         * class.cs (Property): Revamp to use the convention of making fields readonly.
23194         Accordingly modify code elsewhere.
23195
23196         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23197         the Define method of the Property class.
23198
23199         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23200         trivial bug.
23201         (TypeContainer::Populate): Update to define all the properties we have. Also
23202         define all enumerations.
23203
23204         * enum.cs (Define): Implement.
23205
23206 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23207
23208         * cs-parser.jay (overloadable_operator): The semantic value is an
23209         enum of the Operator class.
23210         (operator_declarator): Implement actions.
23211         (operator_declaration): Implement.
23212
23213         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23214         validity of definitions.
23215         (Operator::CheckBinaryOperator): Static method to check for binary operators
23216         (TypeContainer::AddOperator): New method to add an operator to a type.
23217
23218         * cs-parser.jay (indexer_declaration): Added line to actually call the
23219         AddIndexer method so it gets added ;-)
23220
23221         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23222         already taken care of by the MS compiler ?  
23223
23224 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23225
23226         * class.cs (Operator): New class for operator declarations.
23227         (Operator::OpType): Enum for the various operators.
23228
23229 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23230
23231         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23232         ostensibly handle this in semantic analysis.
23233
23234         * cs-parser.jay (general_catch_clause): Comment out
23235         (specific_catch_clauses, specific_catch_clause): Ditto.
23236         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23237         (catch_args, opt_catch_args): New productions.
23238         (catch_clause): Rewrite to use the new productions above
23239         (catch_clauses): Modify accordingly.
23240         (opt_catch_clauses): New production to use in try_statement
23241         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23242         and re-write the code in the actions to extract the specific and
23243         general catch clauses by being a little smart ;-)
23244
23245         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23246         Hooray, try and catch statements parse fine !
23247
23248 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23249
23250         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23251         string from the hashtable of variables.
23252
23253         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23254         I end up making that mistake ;-)
23255         (catch_clauses): Fixed gross error which made Key and Value of the 
23256         DictionaryEntry the same : $1 !!
23257
23258 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23259
23260         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23261
23262         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23263         when the add and remove accessors are specified. 
23264
23265 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23266
23267         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23268         information about indexer_declarator.
23269         (indexer_declarator): Implement actions.
23270         (parsing_indexer): New local boolean used to keep track of whether
23271         we are parsing indexers or properties. This is necessary because 
23272         implicit_parameters come into picture even for the get accessor in the 
23273         case of an indexer.
23274         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23275
23276         * class.cs (Indexer): New class for indexer declarations.
23277         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23278         (TypeContainer::indexers): New member to hold list of indexers for the
23279         type.
23280
23281 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23282
23283         * cs-parser.jay (add_accessor_declaration): Implement action.
23284         (remove_accessor_declaration): Implement action.
23285         (event_accessors_declaration): Implement
23286         (variable_declarators): swap statements for first rule - trivial.
23287
23288         * class.cs (Event): New class to hold information about event
23289         declarations.
23290         (TypeContainer::AddEvent): New method to add an event to a type
23291         (TypeContainer::events): New member to hold list of events.
23292
23293         * cs-parser.jay (event_declaration): Implement actions.
23294
23295 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23296
23297         * cs-parser.jay (dim_separators): Implement. Make it a string
23298         concatenating all the commas together, just as they appear.
23299         (opt_dim_separators): Modify accordingly
23300         (rank_specifiers): Update accordingly. Basically do the same
23301         thing - instead, collect the brackets here.
23302         (opt_rank_sepcifiers): Modify accordingly.
23303         (array_type): Modify to actually return the complete type string
23304         instead of ignoring the rank_specifiers.
23305         (expression_list): Implement to collect the expressions
23306         (variable_initializer): Implement. We make it a list of expressions
23307         essentially so that we can handle the array_initializer case neatly too.
23308         (variable_initializer_list): Implement.
23309         (array_initializer): Make it a list of variable_initializers
23310         (opt_array_initializer): Modify accordingly.
23311
23312         * expression.cs (New::NType): Add enumeration to help us
23313         keep track of whether we have an object/delegate creation
23314         or an array creation.
23315         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23316         members to hold data about array creation.
23317         (New:New): Modify to update NewType
23318         (New:New): New Overloaded contructor for the array creation
23319         case.
23320
23321         * cs-parser.jay (array_creation_expression): Implement to call
23322         the overloaded New constructor.
23323
23324 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23325
23326         * class.cs (TypeContainer::Constructors): Return member
23327         constructors instead of returning null.
23328
23329 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23330
23331         * typemanager.cs (InitCoreTypes): Initialize the various core
23332         types after we have populated the type manager with the user
23333         defined types (this distinction will be important later while
23334         compiling corlib.dll)
23335
23336         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23337         on Expression Classification.  Now all expressions have a method
23338         `Resolve' and a method `Emit'.
23339
23340         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23341         generation from working.     Also add some temporary debugging
23342         code. 
23343
23344 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23345
23346         * codegen.cs: Lots of code generation pieces.  This is only the
23347         beginning, will continue tomorrow with more touches of polish.  We
23348         handle the fundamentals of if, while, do, for, return.  Others are
23349         trickier and I need to start working on invocations soon.
23350
23351         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23352         s.InitStatement. 
23353
23354         * codegen.cs (EmitContext): New struct, used during code
23355         emission to keep a context.   Most of the code generation will be
23356         here. 
23357
23358         * cs-parser.jay: Add embedded blocks to the list of statements of
23359         this block.  So code generation proceeds in a top down fashion.
23360
23361 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23362
23363         * statement.cs: Add support for multiple child blocks.
23364
23365 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23366
23367         * codegen.cs (EmitCode): New function, will emit the code for a
23368         Block of code given a TypeContainer and its ILGenerator. 
23369
23370         * statement.cs (Block): Standard public readonly optimization.
23371         (Block::Block constructors): Link children. 
23372         (Block::Child): Child Linker.
23373         (Block::EmitVariables): Emits IL variable declarations.
23374
23375         * class.cs: Drop support for MethodGroups here, delay until
23376         Semantic Analysis.
23377         (Method::): Applied the same simplification that I did before, and
23378         move from Properties to public readonly fields.
23379         (Method::ParameterTypes): Returns the parameter types for the
23380         function, and implements a cache that will be useful later when I
23381         do error checking and the semantic analysis on the methods is
23382         performed.
23383         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23384         and made a method, optional argument tells whether this is a class
23385         or a structure to apply the `has-this' bit.
23386         (Method::GetCallingConvention): Implement, returns the calling
23387         convention. 
23388         (Method::Define): Defines the type, a second pass is performed
23389         later to populate the methods.
23390
23391         (Constructor::ParameterTypes): implement a cache similar to the
23392         one on Method::ParameterTypes, useful later when we do semantic
23393         analysis. 
23394
23395         (TypeContainer::EmitMethod):  New method.  Emits methods.
23396
23397         * expression.cs: Removed MethodGroup class from here.
23398
23399         * parameter.cs (Parameters::GetCallingConvention): new method.
23400
23401 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23402
23403         * class.cs (TypeContainer::Populate): Drop RootContext from the
23404         argument. 
23405
23406         (Constructor::CallingConvention): Returns the calling convention.
23407         (Constructor::ParameterTypes): Returns the constructor parameter
23408         types. 
23409
23410         (TypeContainer::AddConstructor): Keep track of default constructor
23411         and the default static constructor.
23412
23413         (Constructor::) Another class that starts using `public readonly'
23414         instead of properties. 
23415
23416         (Constructor::IsDefault): Whether this is a default constructor. 
23417
23418         (Field::) use readonly public fields instead of properties also.
23419
23420         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23421         track of static constructors;  If none is used, turn on
23422         BeforeFieldInit in the TypeAttributes. 
23423
23424         * cs-parser.jay (opt_argument_list): now the return can be null
23425         for the cases where there are no arguments. 
23426
23427         (constructor_declarator): If there is no implicit `base' or
23428         `this', then invoke the default parent constructor. 
23429
23430         * modifiers.cs (MethodAttr): New static function maps a set of
23431         modifiers flags into a MethodAttributes enum
23432         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23433         MethodAttr, TypeAttr to represent the various mappings where the
23434         modifiers are used.
23435         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23436
23437 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23438
23439         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23440         method arguments.
23441
23442         * interface.cs (PopulateIndexer): Implemented the code generator
23443         for interface indexers.
23444
23445 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23446
23447         * interface.cs (InterfaceMemberBase): Now we track the new status
23448         here.  
23449
23450         (PopulateProperty): Implement property population.  Woohoo!  Got
23451         Methods and Properties going today. 
23452
23453         Removed all the properties for interfaces, and replaced them with
23454         `public readonly' fields. 
23455
23456 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23457
23458         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23459         initialize their hashtables/arraylists only when they are needed
23460         instead of doing this always.
23461
23462         * parameter.cs: Handle refs and out parameters.
23463
23464         * cs-parser.jay: Use an ArrayList to construct the arguments
23465         instead of the ParameterCollection, and then cast that to a
23466         Parameter[] array.
23467
23468         * parameter.cs: Drop the use of ParameterCollection and use
23469         instead arrays of Parameters.
23470
23471         (GetParameterInfo): Use the Type, not the Name when resolving
23472         types. 
23473
23474 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23475
23476         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23477         and instead use public readonly fields.
23478
23479         * class.cs: Put back walking code for type containers.
23480
23481 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23482
23483         * class.cs (MakeConstant): Code to define constants.
23484
23485         * rootcontext.cs (LookupType): New function.  Used to locate types 
23486
23487
23488 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23489
23490         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23491         this System.Reflection code is.  Kudos to Microsoft
23492
23493         * typemanager.cs: Implement a type cache and avoid loading all
23494         types at boot time.  Wrap in LookupType the internals.  This made
23495         the compiler so much faster.  Wow.  I rule!
23496
23497         * driver.cs: Make sure we always load mscorlib first (for
23498         debugging purposes, nothing really important).
23499
23500         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23501         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23502
23503         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23504         on namespaces that have been imported using the `using' keyword.
23505
23506         * class.cs (TypeContainer::TypeAttr): Virtualize.
23507         (Class::TypeAttr): Return attributes suitable for this bad boy.
23508         (Struct::TypeAttr): ditto.
23509         Handle nested classes.
23510         (TypeContainer::) Remove all the type visiting code, it is now
23511         replaced with the rootcontext.cs code
23512
23513         * rootcontext.cs (GetClassBases): Added support for structs. 
23514
23515 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23516
23517         * interface.cs, statement.cs, class.cs, parameter.cs,
23518         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23519         Drop use of TypeRefs, and use strings instead.
23520
23521 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23522
23523         * rootcontext.cs: 
23524
23525         * class.cs (Struct::Struct): set the SEALED flags after
23526         checking the modifiers.
23527         (TypeContainer::TypeAttr): new property, returns the
23528         TypeAttributes for a class.  
23529
23530         * cs-parser.jay (type_list): Oops, list production was creating a
23531         new list of base types.
23532
23533         * rootcontext.cs (StdLib): New property.
23534         (GetInterfaceTypeByName): returns an interface by type name, and
23535         encapsulates error handling here.
23536         (GetInterfaces): simplified.
23537         (ResolveTree): Encapsulated all the tree resolution here.
23538         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23539         types. 
23540
23541         * driver.cs: Add support for --nostdlib, to avoid loading the
23542         default assemblies.
23543         (Main): Do not put tree resolution here. 
23544
23545         * rootcontext.cs: Beginning of the class resolution.
23546
23547 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23548
23549         * rootcontext.cs: Provide better error reporting. 
23550
23551         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23552
23553         * rootcontext.cs (CreateInterface): Handle the case where there
23554         are no parent interfaces.
23555
23556         (CloseTypes): Routine to flush types at the end.
23557         (CreateInterface): Track types.
23558         (GetInterfaces): Returns an array of Types from the list of
23559         defined interfaces.
23560
23561         * typemanager.c (AddUserType): Mechanism to track user types (puts
23562         the type on the global type hash, and allows us to close it at the
23563         end). 
23564
23565 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23566
23567         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23568         RecordInterface instead.
23569
23570         * cs-parser.jay: Updated to reflect changes above.
23571
23572         * decl.cs (Definition): Keep track of the TypeBuilder type that
23573         represents this type here.  Not sure we will use it in the long
23574         run, but wont hurt for now.
23575
23576         * driver.cs: Smaller changes to accomodate the new code.
23577
23578         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23579         when done. 
23580
23581         * rootcontext.cs (CreateInterface):  New method, used to create
23582         the System.TypeBuilder type for interfaces.
23583         (ResolveInterfaces): new entry point to resolve the interface
23584         hierarchy. 
23585         (CodeGen): Property, used to keep track of the code generator.
23586
23587 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23588
23589         * cs-parser.jay: Add a second production for delegate_declaration
23590         with `VOID'.
23591
23592         (enum_body): Put an opt_comma here instead of putting it on
23593         enum_body or enum_member_declarations so we can handle trailing
23594         commas on enumeration members.  Gets rid of a shift/reduce.
23595
23596         (type_list): Need a COMMA in the middle.
23597
23598         (indexer_declaration): Tell tokenizer to recognize get/set
23599
23600         * Remove old targets.
23601
23602         * Re-add the parser target.
23603
23604 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23605
23606         * cs-parser.jay: Add precendence rules for a number of operators
23607         ot reduce the number of shift/reduce conflicts in the grammar.
23608
23609 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23610
23611         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23612         and put it here.
23613
23614         Get rid of old crufty code.
23615
23616         * rootcontext.cs: Use this to keep track of the parsed
23617         representation and the defined types available to the program. 
23618
23619         * gen-treedump.cs: adjust for new convention.
23620
23621         * type.cs: Split out the type manager, and the assembly builder
23622         from here. 
23623
23624         * typemanager.cs: the type manager will live here now.
23625
23626         * cil-codegen.cs: And the code generator here. 
23627
23628 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23629
23630         * makefile: Fixed up for easy making.
23631
23632 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23633
23634         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23635         the 
23636
23637         (unary_expression): Expand pre_increment_expression and
23638         post_decrement_expression to reduce a shift/reduce.
23639
23640 2001-07-11  Simon Cozens
23641
23642         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23643
23644         Improve allow_keyword_as_indent name.
23645
23646 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23647
23648         * Adjustments for Beta2. 
23649
23650 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23651
23652         * decl.cs: Added `Define' abstract method.
23653         (InTransit): new property, used to catch recursive definitions. 
23654
23655         * interface.cs: Implement `Define'. 
23656
23657         * modifiers.cs: Map Modifiers.constants to
23658         System.Reflection.TypeAttribute flags.
23659
23660         * class.cs: Keep track of types and user-defined types.
23661         (BuilderInit): New method for creating an assembly
23662         (ResolveType): New function to launch the resolution process, only
23663         used by interfaces for now.
23664
23665         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23666         that are inserted into the name space. 
23667
23668 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23669
23670         * ARGH.  I have screwed up my tree so many times due to the use of
23671         rsync rather than using CVS.  Going to fix this at once. 
23672
23673         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23674         load types.
23675
23676 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23677
23678         * Experiment successful: Use System.Type rather that our own
23679         version of Type.  
23680
23681 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23682
23683         * cs-parser.jay: Removed nsAliases from here.
23684
23685         Use new namespaces, handle `using XXX;' 
23686
23687         * namespace.cs: Reimplemented namespace handling, use a recursive
23688         definition of the class.  Now we can keep track of using clauses
23689         and catch invalid using clauses.
23690
23691 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23692
23693         * gen-treedump.cs: Adapted for all the renaming.
23694
23695         * expression.cs (Expression): this class now has a Type property
23696         which returns an expression Type.
23697
23698         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23699         `Type', as this has a different meaning now in the base
23700
23701 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23702
23703         * interface.cs, class.cs: Removed from all the sources the
23704         references to signature computation, as we can not do method
23705         signature computation during the parsing time, as we are not
23706         trying to solve at that point distinguishing:
23707
23708         class X {
23709                 void a (Blah x) {}
23710                 void a (NS.Blah x) {}
23711         }
23712
23713         Which depending on the context might be valid or not, as we do not
23714         know if Blah is the same thing as NS.Blah at that point.
23715
23716         * Redid everything so the code uses TypeRefs now instead of
23717         Types.  TypeRefs are just temporary type placeholders, that need
23718         to be resolved.  They initially have a pointer to a string and the
23719         current scope in which they are used.  This is used later by the
23720         compiler to resolve the reference to an actual Type. 
23721
23722         * DeclSpace is no longer a CIR.Type, and neither are
23723         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23724         are all DeclSpaces, but no Types. 
23725
23726         * type.cs (TypeRefManager): This implements the TypeRef manager,
23727         which keeps track of all the types that need to be resolved after
23728         the parsing has finished. 
23729
23730 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23731
23732         * ARGH.  We are going to have to store `foreach' as a class rather
23733         than resolving it, as we need to verify error 1579 after name
23734         resolution.   *OR* we could keep a flag that says `This request to
23735         IEnumerator comes from a foreach statement' which we can then use
23736         to generate the error.
23737
23738 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23739
23740         * class.cs (TypeContainer.AddMethod): we now add methods to the
23741         MethodGroup instead of the method hashtable.  
23742
23743         * expression.cs: Add MethodGroup abstraction, which gets us one
23744         step closer to the specification in the way we handle method
23745         declarations.  
23746
23747         * cs-parser.jay (primary_expression): qualified_identifier now
23748         tried to match up an identifier to a local variable reference or
23749         to a parameter reference.
23750
23751         current_local_parameters is now a parser global variable that
23752         points to the current parameters for the block, used during name
23753         lookup.
23754
23755         (property_declaration): Now creates an implicit `value' argument to
23756         the set accessor.
23757
23758 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23759
23760         * parameter.cs: Do not use `param' arguments as part of the
23761         signature, per the spec.
23762
23763 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23764
23765         * decl.cs: Base class for classes, structs and interfaces.  This
23766         is the "Declaration Space" 
23767
23768         * cs-parser.jay: Use CheckDef for checking declaration errors
23769         instead of having one on each function.
23770
23771         * class.cs: Factor out some code for handling error handling in
23772         accordance to the "Declarations" section in the "Basic Concepts"
23773         chapter in the ECMA C# spec.
23774
23775         * interface.cs: Make all interface member classes derive from
23776         InterfaceMemberBase.
23777
23778 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23779
23780         * Many things: all interfaces are parsed and generated in
23781         gen-treedump.  Support for member variables, constructors,
23782         destructors, properties, constants is there.
23783
23784         Beginning of the IL backend, but very little done, just there for
23785         testing purposes. 
23786
23787 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23788
23789         * cs-parser.jay: Fix labeled statement.
23790
23791         * cs-tokenizer.cs (escape): Escape " and ' always.
23792         ref_line, ref_name: keep track of the line/filename as instructed
23793         by #line by the compiler.
23794         Parse #line.
23795
23796 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23797
23798         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23799         to match the values in System.CodeDOM.
23800
23801         Divid renamed to Divide.
23802
23803         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23804         statements. 
23805         (Statements.set): remove.
23806
23807         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23808         statements. 
23809
23810         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23811         falseStatements always have valid values. 
23812
23813         * cs-parser.jay: Use System.CodeDOM now.
23814