a9bfffca55b22545fbe4d659afd3cff34d234a25
[mono.git] / mcs / mcs / ChangeLog
1 2006-09-19  Martin Baulig  <martin@ximian.com>
2
3         * expression.cs: Completely merged with the gmcs version.
4
5 2006-09-19  Martin Baulig  <martin@ximian.com>
6
7         * expression.cs (Invocation): Merged with the gmcs version.
8         (ArrayAccess.GetStoreOpcode): Likewise.
9
10 2006-09-19  Martin Baulig  <martin@ximian.com>
11
12         * typemanager.cs
13         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
14         (TypeManager.IsGenericMethodDefinition): Likewise.
15
16 2006-09-19  Martin Baulig  <martin@ximian.com>
17
18         * typemanager.cs
19         (TypeManager.IsEqual): Moved the gmcs implementation here.
20         (TypeManager.DropGenericTypeArguments): Likewise.
21         (TypeManager.DropGenericMethodArguments): Likewise.
22         (TypeManager.GetTypeArguments): Moved here from gmcs.
23         (TypeManager.HasGenericArguments): Likewise.
24
25 2006-09-19  Martin Baulig  <martin@ximian.com>
26
27         * expression.cs (Binary): Merged with the gmcs version.
28
29 2006-09-19  Martin Baulig  <martin@ximian.com>
30
31         * expression.cs (Probe, As, Is): Merged with the gmcs version.
32
33 2006-09-19  Martin Baulig  <martin@ximian.com>
34
35         * typemanager.cs: Merged with the gmcs version.
36
37 2006-09-16  Raja R Harinath  <rharinath@novell.com>
38
39         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
40         * driver.cs: Likewise.
41
42 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
43
44         A fix for #79401
45         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
46         only if parent type is class.
47         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
48         update.
49
50 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
51
52         * cs-parser.jay,
53         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
54         keywords are used.
55         * typemanager.cs(CSharpName): Converts NullType to null.
56
57 2006-09-15  Martin Baulig  <martin@ximian.com>
58
59         * typemanager.cs
60         (TypeManager.GetMethodName): Added mcs implementation.
61         (TypeManager.IsEqual): Likewise.
62
63         * ecore.cs
64         (SimpleName.RemoveGenericArity): Added dummy implementation.
65
66         * pending.cs: Merged with the gmcs version.     
67
68 2006-09-15  Martin Baulig  <martin@ximian.com>
69
70         * statement.cs: Merge with the gmcs version.
71
72 2006-09-15  Martin Baulig  <martin@ximian.com>
73
74         * statement.cs (Switch): Merge with the gmcs implementation
75         (without nullables), which is newer.
76
77 2006-09-15  Martin Baulig  <martin@ximian.com>
78
79         * statement.cs (Block.Variables): Make this public.
80         (ToplevelBlock.Parameters): Make this a property.
81         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
82
83 2006-09-15  Martin Baulig  <martin@ximian.com>
84
85         * namespace.cs: Merge with the gmcs version.
86
87 2006-09-15  Martin Baulig  <martin@ximian.com>
88
89         * decl.cs (MemberName): Minor code cleanups.
90
91 2006-09-15  Martin Baulig  <martin@ximian.com>
92
93         * parameter.cs: Merge with the gmcs version.
94
95 2006-09-15  Martin Baulig  <martin@ximian.com>
96
97         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
98         and an error in mcs.
99
100 2006-09-15  Martin Baulig  <martin@ximian.com>
101
102         * flowanalysis.cs: Merged from GMCS; added the generics code into
103         a `GMCS_SOURCE' conditional so we can share this file.
104
105 2006-09-08  Martin Baulig  <martin@ximian.com>
106
107         * typemanager.cs (TypeManager.interlocked_type): New public field.
108         (TypeManager.int_interlocked_compare-exchange): New public field.
109         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
110         enumerator types here and call InitGenericCoreTypes().
111         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
112         after calling InitEnumUnderlyingTypes().
113
114         * rootcontext.cs
115         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
116         `classes_second_stage'. 
117
118 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
119
120         * assign.cs, ecore.cs, expression.cs: Share error message text.
121         * class.cs (FieldMember.Define): Check for varible of static type.
122         * driver.cs (LoadAssembly): Uses error output for errors.
123         * statement.cs: Updated.
124
125 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
126
127         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
128         type instance.
129
130 2006-09-07  Martin Baulig  <martin@ximian.com>
131
132         * driver.cs
133         (MainDriver): Revert r62663 from Marek; see #70506 for details.
134
135 2006-08-29  Miguel de Icaza  <miguel@novell.com>
136
137         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
138         
139 2006-08-17  Miguel de Icaza  <miguel@novell.com>
140
141         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
142         #52019 and #79064, the use of the \uXXXX sequence in source code
143         to represent unicode characters.
144
145 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
146
147         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
148         support.
149         * class.cs, ecore.cs, statement.cs: Merged to one error message.
150
151 2006-08-13  Miguel de Icaza  <miguel@novell.com>
152
153         * assign.cs: Catch attempts to assign to a method groups in += and
154         report as 1656
155
156 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
157
158         A fix for #79056
159         * cs-parser.jay: Don't destroy current array type by typeof of array's.
160
161 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
162
163         * class.cs (Method.Define): Issue a warning when generic method looks like
164         an entry point.
165         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
166         as well.
167
168 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
169  
170         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
171         looking for ctor.
172         * decl.cs (MemberCache.FindMembers): When container is interface we need to
173         search all base interfaces as a member can be ambiguous.
174         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
175         Constructor member type filter. 
176         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
177         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
178         reporting for returned memberinfos.
179         * report.cs: Updated.
180         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
181         version to work on all runtimes.
182         (TypeManager.RealMemberLookup): Removed members filtering.
183
184 2006-08-08  Raja R Harinath  <rharinath@novell.com>
185
186         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
187         (PropertyExpr.EmitAssign): Likewise.
188         * expression.cs (Indirection.EmitAssign): Likewise.
189         (LocalVariableReference.EmitAssign): Likewise.
190         (ParameterReference.EmitAssign): Likewise.
191         (Invocation.EmitArguments): Likewise.
192         (ArrayAccess.EmitAssign): Likewise.
193         (IndexerAccess.EmitAssign): Likewise.
194         (This.EmitAssign): Likewise.
195         (ConditionalLogicalOperator.Emit): Likewise.
196
197         Fix #79026
198         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
199         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
200         leave it in after returning it.
201         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
202
203 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
204
205         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
206         message.
207
208 2006-08-03  Raja R Harinath  <rharinath@novell.com>
209
210         Fix cs0146-3.cs and cs0146-4.cs.
211         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
212         enclosing types don't depend on the current type.
213
214 2006-08-02  Raja R Harinath  <rharinath@novell.com>
215
216         Fix #77963
217         * class.cs (TypeContainer.DoDefineMembers): Use
218         FindBaseMemberWithSameName on Parent, since we're interested in
219         whether we hide inherited members or not.
220         (FindBaseMemberWithSameName): Make slightly more robust.
221
222         Fix the non-generic testcase from #77396
223         * decl.cs (DeclSpace.DeclContainer): Remove override.
224
225         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
226         declspaces for doppelgangers too.
227         (UsingEntry): Implement IResolveContext.
228         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
229         'this' as the resolve context.
230         (LocalAliasEntry): Likewise.
231
232         Implement parts of #77403
233         * roottypes.cs (RootDeclSpace): New.  Used to represent the
234         toplevel declaration space.  Each namespace declaration introduces
235         a "partial" root declaretion space.
236         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
237         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
238         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
239         from 'current_namespace.SlaveDeclSpace'.
240         (namespace_declaration): Likewise.
241         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
242         check.  It can't happen now.
243         * decl.cs (DeclSpace.LookupType): Likewise.
244         * driver.cs (MainDriver): Sanity check.
245
246 2006-08-01  Raja R Harinath  <rharinath@novell.com>
247
248         * decl.cs (DeclSpace.FindNestedType): Remove.
249         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
250         LookupTypeContainer to get the container of the nested type.
251         * class.cs (TypeContainer.FindNestedType): Make non-override.
252
253 2006-07-31  Raja R Harinath  <rharinath@novell.com>
254
255         * decl.cs (DeclSpace.PartialContainer): Move field from ...
256         * class.cs (TypeContainer.PartialContainer): ... here.
257         (TypeContainer.AddBasesForPart): New helper.
258         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
259         instead.
260         * cs-parser.jay (current_class): Convert to DeclSpace.
261         (struct_declaration, interface_declaration, class_declaration):
262         Use AddBasesForPart instead of .Bases directly.
263         * const.cs, iterators.cs: Update to changes.
264
265 2006-07-28  Raja R Harinath  <rharinath@novell.com>
266
267         * class.cs (TypeContainer.AddMemberType): Rename from
268         AddToTypeContainer.
269         (TypeContainer.AddMember): Rename from AddToMemberContainer.
270         (AddTypeContainer): New.  Combine AddClassOrStruct and
271         AddInterface.
272         (AddPartial): Update.  Add 'is_partial' argument.
273         * roottypes.cs: Update to changes.
274         * cs-parser.jay (push_current_class): New helper for handling
275         current_container and current_class.
276         (struct_declaration, interface_declaration, class_declaration):
277         Use it.
278
279 2006-07-26  Raja R Harinath  <rharinath@novell.com>
280
281         * roottypes.cs: Rename from tree.cs.
282
283         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
284         * tree.cs (Tree, ITreeDump): Remove types.
285         * rootcontext.cs (tree, Tree): Remove fields.
286         (root, ToplevelTypes): New.
287         * *.cs: Update to rename.
288
289         * tree.cs (Tree.RecordDecl): Remove.
290         (RootTypes.AddToTypeContainer): Record the toplevel type in its
291         namespace here.
292         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
293
294 2006-07-23  Raja R Harinath  <harinath@gmail.com>
295
296         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
297         DoFlowAnalysis and OmitStructFlowAnalysis here.
298         (ec.With): Rename from WithUnsafe and generalize.
299         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
300         (ec.WithFlowAnalyis): New.
301         * ecore.cs, expression.cs, statement.cs: Update.
302
303 2006-07-22  Raja R Harinath  <harinath@gmail.com>
304
305         * statement.cs (Block.ResolveMeta): Simplify slightly.
306
307         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
308         multiple boolean fields.  Convert InUnsafe, constant_check_state,
309         check_state to flags.
310         (CheckState, ConstantCheckState): Update.
311         (InUnsafe): New read-only property.
312         (FlagsHandle): Rename from CheckStateHandle and convert to handle
313         arbitrary flags.
314         (WithUnsafe): New helper similar to WithCheckState.
315         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
316         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
317
318 2006-07-21  Raja R Harinath  <rharinath@novell.com>
319
320         Make comparisons use the same IL irrespective of whether they're
321         in a 'checked' or 'unchecked' context: one of the issues in #78899
322         * codegen.cs (EmitContext.CheckState): Make read-only property.
323         (EmitContext.ConstantCheckState): Likewise.
324         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
325         helper that implement a save/restore stack for CheckState
326         values.  This is the only way to change check-state.
327         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
328         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
329         (CheckedExpr.EmitBranchable): New forwarding method.
330         (UnCheckedExpr): Likewise.
331         * statement.cs (Block.ResolveMeta): Use WithCheckState.
332         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
333         (Checked.Resolve, checked.DoEmit): Likewise.
334
335 2006-07-20  Miguel de Icaza  <miguel@novell.com>
336
337         * anonymous.cs: Cache the resolved anonymous delegate, and return
338         this so that the ResolveTopBlock is only triggered once, not
339         twice.
340
341         Currently we trigger ResolvetopBlock twice due to a first pass of
342         argument check compatibility, and a second pass that does the
343         actual resolution.   
344         
345 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
346
347         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
348         modifiers.
349         * rootcontext.cs (Reset): Add helper_classes.
350
351 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
352
353         A fix for #78860
354         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
355         correctly.
356
357 2006-07-13  Miguel de Icaza  <miguel@novell.com>
358
359         * statement.cs (Lock): Handle expressions of type
360         TypeManager.null_type specially.  Fixes #78770
361
362 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
363
364         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
365         to an event.
366
367 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
368
369         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
370         for accessors as well.
371         * ecore.cs (EventExpr): Add AccessorTable.
372
373 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
374
375         A fix for #78738
376         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
377         for CS0122 where appropriate.
378         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
379         level attributes.
380         (Filter): Assembly can be null in the case of top level attributes.
381
382 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
383
384         A fix for #78690
385
386         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
387         is done at global level.
388
389 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
390
391         A fix for #77002, Implemented TypeForwarder support.
392
393         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
394         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
395         * typemanager.cs (): Add type_forwarder_attr_type.
396
397 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
398
399         * report.cs: Add CS0469 warning.
400
401 2006-06-21  Martin Baulig  <martin@ximian.com>
402
403         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
404         the `try'-block, so we also report CS0016 etc. there.
405
406 2006-06-21  Martin Baulig  <martin@ximian.com>
407
408         * delegate.cs
409         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
410
411 2006-06-21  Martin Baulig  <martin@ximian.com>
412
413         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
414         also report CS1686 for parameters.
415
416 2006-06-21  Martin Baulig  <martin@ximian.com>
417
418         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
419         instead of an error if the value is not implicitly convertible to
420         the switch types; fixes #77964.
421
422 2006-06-21  Raja R Harinath  <rharinath@novell.com>
423
424         Fix #78673
425         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
426         FieldBuilder is null.
427
428         Fix #78662
429         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
430         'left' and 'right' before error-checking.
431
432 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
433
434         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
435         Fixed bug #78601.
436         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
437         (FieldExpr.DoResolve): likewise.
438         (PropertyExpr.InstanceResolve): likewise.
439         (EventExpr.InstanceResolve): likewise. 
440
441 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
442
443         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
444         attribute applicable tests for attribute argument.
445
446 2006-06-02  Raja R Harinath  <rharinath@novell.com>
447
448         Fix #78079
449         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
450         (Binary.OverloadResolve_PredefinedIntegral): New.
451         (Binary.OverloadResolve_PredefinedFloating): New.
452         (Binary.OverloadResolve_PredefinedString): New.
453         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
454         Follow the standard more closely, and treat numeric promotions in
455         terms of overload resolution.
456         (Binary.CheckShiftArguments): Simplify.
457
458 2006-06-01  Raja R Harinath  <rharinath@novell.com>
459
460         * flowanalysis.cs (MyBitVector): Simplify representation.
461         (MyBitVector.Clone): Avoid allocating BitArray.
462         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
463         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
464         (*): Update.  Change all references to MyBitVector.And and
465         MyBitVector.Or to &= and |=.
466
467 2006-05-29  Raja R Harinath  <rharinath@novell.com>
468
469         Fix cs0231-[34].cs.
470         * cs-parser.jay (formal_parameter_list): Extend the pattern below
471         to param arguments too.
472
473 2006-05-26  Miguel de Icaza  <miguel@novell.com>
474
475         * cs-parser.jay: Catch another parsing form for arglist being
476         followed by other arguments.  Fixes #78313.
477
478 2006-05-24  Raja R Harinath  <rharinath@novell.com>
479
480         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
481         checking of out parameters to ...
482         (FlowBranchingToplevel.Merge): ... here.
483         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
484         set, propagate the origin upward, and only complain if there was
485         no other error.
486         (FlowBranchingException.AddContinueOrigin): Likewise.
487         (FlowBranchingException.AddReturnOrigin): Likewise.
488         (FlowBranchingException.AddGotoOrigin): Likewise.       
489
490 2006-05-23  Raja R Harinath  <rharinath@novell.com>
491
492         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
493         unreachable, skip it.
494         (FlowBranchingException.Merge): Always propagate jumps, even if
495         the finally block renders subsequent code unreachable.
496
497 2006-05-18  Raja R Harinath  <rharinath@novell.com>
498
499         Fix #77601
500         * statement.cs (Goto.Resolve): Move responsibility for resolving
501         'goto' to FlowBranching.AddGotoOrigin.
502         (Goto.SetResolvedTarget): New.  Callback to set the
503         LabeledStatement that's the target of the goto.
504         (Goto.DoEmit): Use Leave instead of Br when crossing an
505         unwind-protect boundary.
506         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
507         LookupLabel and adjust to new semantics.
508         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
509         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
510         Goto.SetResolvedTarget to update target.
511         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
512         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
513         AddBreakOrigin & co.  Delay propagation until ...
514         (FlowBranchingException.Merge): ... this.
515
516         * statement.cs (Block.Resolve): Always depend on flow-branching to
517         determine unreachability.  Kill workaround that originally emitted
518         only one statement after an "unreachable" label (see infloop in
519         test-515.cs).
520
521         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
522         This is still "wrong", but anything better would probably need a
523         multi-pass algorithm.
524         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
525         usage vector.  Force current usage vector to be reachable, to
526         optimistically signify backward jumps.
527         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
528         detected.
529         (FlowBranchingLabeled.Merge): New.  If no backward jump was
530         detected, return the original salted-away usage vector instead,
531         updated with appropriate changes.  Print unreachable warning if
532         necessary.
533         * statement.cs (Block.Resolve): Don't print unreachable warning on
534         a labeled statement.
535
536 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
537
538         * driver.cs: Pass filename without path to AssemblyBuilder's 
539         AddResourceFile. Fixes bug #78407.
540
541 2006-05-17  Raja R Harinath  <rharinath@novell.com>
542
543         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
544         * flowanalysis.cs (FlowBranchingLabeled): ... here.
545         (FlowBranching.MergeChild): Overwrite
546         reachability information from Labeled branchings too.
547
548 2006-05-16  Raja R Harinath  <rharinath@novell.com>
549
550         * statement.cs (Goto.Resolve): Merge jump origins here ...
551         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
552
553         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
554         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
555         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
556         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
557         here, ...
558         * statement.cs (Goto.Resolve): ... not here.
559         (Goto.Emit): Remove CS1632 check.
560
561 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
562
563         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
564         error message.
565
566 2006-05-11  Raja R Harinath  <rharinath@novell.com>
567
568         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
569         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
570         (FlowBranchingException.Label): Likewise.
571
572         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
573         given value.
574         (MyBitVector.Or): Use it to avoid losing information (Count).
575         (FlowBranching.MergeOrigins): Likewise.
576
577         * flowanalysis.cs (UsageVector.IsDirty): Remove.
578         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
579         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
580         (UsageVector.ToString): Simplify.
581         (UsageVector.MergeSiblings): Move here from ...
582         (FlowBranching.Merge): ... here.
583         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
584         not a MyBitVector.
585
586 2006-05-10  Raja R Harinath  <rharinath@novell.com>
587
588         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
589         null bitvector is treated as all-true.
590
591         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
592         (MyBitVector): Rationalize invariants.  'vector != null' implies
593         that we have our own copy of the bitvector.  Otherwise,
594         'InheritsFrom == null' implies all inherited bits are true.
595
596 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
597
598         * statement.cs (LocalInfo): Add IsConstant.
599         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
600         local variable for constants.
601
602 2006-05-09  Raja R Harinath  <rharinath@novell.com>
603
604         * flowanalysis.cs (MyBitVector.Empty): New.
605         (MyBitVector): Don't allow InheritedFrom to be null.
606         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
607         (UsageVector, FlowBranching): Update to changes.
608
609         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
610         recursion.  The 'Parent == null' condition isn't sufficient for
611         anonymous methods.
612         (FlowBranching.AddBreakOrigin): Likewise.
613         (FlowBranching.AddContinueOrigin): Likewise.
614         (FlowBranching.AddReturnOrigin): Likewise.
615         (FlowBranching.StealFinallyClauses): Likewise.
616         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
617         (FlowBranching.CheckOutParameters): Likewise.
618         (FlowBranchingToplevel): Terminate all the above recursions here.
619         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
620         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
621
622         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
623         toplevel block.
624         (FlowBranchingToplevel): New.  Empty for now.
625         (FlowBranching.MergeTopBlock): Update.
626         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
627         branching for the anonymous delegate.
628         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
629
630         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
631         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
632         information at the start of the merge.  Reorganize.
633
634 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
635
636         * class.cs (MethodData.Define): Method cannot implement interface accessor.
637
638 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
639
640         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
641         to newly introduced ctor.
642
643         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
644         message to one place.
645         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
646         global namespace.
647
648 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
649
650         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
651
652         * ecore.cs (Expression.ResolveAsConstant): Updated.
653
654         * statement.cs (ResolveMeta): Updated.
655
656 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
657
658         * cs-parser.jay: __arglist cannot be used in initializer.
659
660 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
661
662         A fix for #77879
663         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
664         private types.
665
666 2006-05-05  Raja R Harinath  <rharinath@novell.com>
667
668         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
669         (LabeledStatement): Add 'name' parameter.
670         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
671         (Block.AddLabel): Update to changes.
672         * cs-parser.jay (labeled_statement): Likewise.
673
674         * flowanalysis.cs (BranchingType.Labeled): New.
675         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
676         (FlowBranchingLabeled): New.  Does nothing for now, but will
677         eventually handle 'goto' flows.
678         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
679         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
680         that's terminated ...
681         (Block.Resolve): ... here.
682
683         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
684         (UsageVector.MergeFinallyOrigins): Likewise.
685         (FlowBranching.InTryOrCatch): Likewise.
686         (FlowBranching.AddFinallyVector): Likewise.
687         (FlowBranchingException): Update to changes.
688
689         Fix #78290
690         * statement.cs (Return.Resolve): Move error checking to ...
691         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
692         (FlowBranchingException): Handle return origins like break and
693         continue origins.
694         (FlowBranching.UsageVector.CheckOutParameters): Remove.
695
696 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
697
698         A fix for #76122
699         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
700         filter.
701
702 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
703
704         A fix for #77543
705         * class.cs (MethodData.Define): Do public accessor check only when method
706         implements an interface.
707
708 2006-05-04  Raja R Harinath  <rharinath@novell.com>
709
710         Remove special handling of 'break'
711         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
712         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
713         (UsageVector.Break): Remove.
714         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
715         reachability.
716         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
717
718         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
719         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
720
721 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
722
723         A fix for #75726
724         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
725         be the interface member.
726
727 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
728
729         A fix for #60069
730         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
731         for emitting small (int) values.
732
733 2006-05-03  Raja R Harinath  <rharinath@novell.com>
734
735         Fix #59427
736         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
737         control-flow passes through the 'finally' after merging-in all the
738         control-flows from 'try' and the 'catch' clauses.
739
740         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
741         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
742         always true at the only non-recursive entry point.
743         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
744         FlowBranchingBreakable.
745         (FlowBranchingLoop): Remove.
746         * statement.cs (Return.DoResolve): Update to changes.
747
748         Fix #76471, #76665
749         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
750         (FlowBranching.CreateBranching): Handle it: create a
751         FlowBranchingContinuable.
752         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
753         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
754         except that it handles the 'continue' command.
755         (FlowBranching.UsageVector.MergeOrigins): Rename from
756         MergeBreakOrigins.
757         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
758         except that it overrides AddContinueOrigin.
759         (FlowBranchingException): Override AddContinueOrigin, similar to
760         AddBreakOrigin.
761         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
762         Create a new branching around the embedded statement.
763         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
764         control flow after the embedded statement.
765         (Continue.Resolve): Move all error checking to AddContinueOrigin.
766
767         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
768         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
769         FlowBranchingBreakable.
770         (FlowBranchingSwitch): Remove.
771
772         Fix test-503.cs
773         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
774         error reporting to ...
775         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
776         Rename from 'AddBreakVector'.  Add new location argument.  Return
777         a bool indicating whether the 'break' crosses an unwind-protect.
778         (FlowBranchingException.AddBreakOrigin): Add.
779         (FlowBranchingException.Merge): Propagate 'break's to surrounding
780         flowbranching after updating with the effects of the 'finally'
781         clause.
782         (FlowBranchingBreakable): New common base class for
783         FlowBranchingLoop and FlowBranchingSwitch.
784
785         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
786         embedded statement.
787         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
788
789 2006-05-02  Raja R Harinath  <rharinath@novell.com>
790
791         * statement.cs (Do.Resolve): If the loop is infinite, set the
792         barrier.
793         (While.Resolve, For.Resolve): Set a barrier after the embedded
794         statement.  There's no direct control flow that goes from the end
795         of the embedded statement to the end of the loop.
796         * flowanalysis.cs (FlowBranching.Infinite): Remove.
797         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
798         above ensure that the reachability is correctly computed.
799
800         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
801         (UsageVector.MergeBreakOrigins): If the current path is
802         unreachable, treat it as if all parameters/locals are initialized.
803         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
804         infinite loops before merging-in break origins.
805
806         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
807         (Reachability.Reachable): Split part into ...
808         (Reachability.Unreachable): ... this.  Simplify.
809         (Reachability.IsUnreachable): Use 'Unreachable' instead.
810
811         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
812         (Reachability.SetThrowsSometimes): Likewise.
813         (FlowBranchingBlock.MergeTopBlock): Don't compare against
814         TriState.Always, use corresponding property.
815         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
816         (Block.Resolve): Likewise.  Remove some redundant checks.
817
818 2006-05-02  Raja R Harinath  <harinath@gmail.com>
819
820         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
821         (Reachability.Meet): Don't bother checking AlwaysThrows --
822         barrier is always set.
823         (FlowBranchingBlock.Merge): Likewise.
824
825 2006-05-01  Raja R Harinath  <harinath@gmail.com>
826
827         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
828         checks for unreachable.
829
830 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
831
832         A fix for #77980
833         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
834
835         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
836         whether field is really assigned.
837
838 2006-04-30  Raja R Harinath  <harinath@gmail.com>
839
840         * flowanalysis.cs (Reachability): Make 4-argument constructor
841         private.
842         (Reachability.Meet): Rename from 'And'.  Remove static variant.
843         (Reachability.Always): Rename from the highly misleading
844         'Reachability.Never'.
845         (FlowBranching.Merge): Update to changes.  Mark an impossible
846         situation with a 'throw'.
847         (*): Update to changes.
848
849 2006-04-29  Raja R Harinath  <harinath@gmail.com>
850
851         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
852         Remove 'Undefined'.
853         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
854         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
855         (*): Update to changes.
856         * statement.cs: Update to changes.
857
858 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
859
860         A fix for #78049
861         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
862
863 2006-04-28  Raja R Harinath  <harinath@gmail.com>
864
865         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
866         dummy UsageVector.
867
868         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
869         argument to two arguments: an usage-vector and a bool.  Move call
870         to FlowBranching.Merge () ...
871         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
872
873         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
874         handling of loop and switch reachability to ...
875         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
876
877 2006-04-27  Raja R Harinath  <harinath@gmail.com>
878
879         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
880         handling to FlowBranchingLoop.InLoop.
881         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
882
883 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
884
885         A fix for #78115
886         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
887         anonymous method is allowed from AnonymousContainer here.
888
889         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
890
891 2006-04-24  Raja R Harinath  <rharinath@novell.com>
892
893         Fix #78156
894         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
895
896 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
897
898         A fix for #49011.
899         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
900         (DoubleConstant.Reduce): Ditto.
901
902 2006-04-23  Raja R Harinath  <rharinath@novell.com>
903
904         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
905         Remove 'lvalue_right_side' argument.  Move parts to ...
906         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
907         (LocalVariable.DoResolveLValue): ... these.
908
909 2006-04-21  Raja R Harinath  <rharinath@novell.com>
910
911         Fix cs1655.cs
912         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
913         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
914         (LocalVariableReference.DoResolveBase): Use it to implement new
915         CS1655 check.
916         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
917         (Argument.Resolve): Simplify.  Move CS1510 check ...
918         * ecore.cs (Expression.ResolveLValue): ... here.
919         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
920         (PropertyExpr.DoResolveLValue): Likewise.
921         (FieldExpr.Report_AssignToReadonly): Likewise.
922         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
923         LValueMemberAccess or LValueMemberOutAccess on instance depending
924         on it.
925         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
926         DoResolve as appropriate.
927
928 2006-04-20  Raja R Harinath  <rharinath@novell.com>
929
930         Fix #75800
931         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
932         implicit conversions on 'out' and 'ref' arguments.
933
934         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
935         improve clarity.  Remove dead code.
936
937         Fix #66031
938         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
939         (Catch.Resolve): Resolve VarBlock if it exists.
940
941 2006-04-19  Miguel de Icaza  <miguel@novell.com>
942
943         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
944         twice, this was some residual code, the enumerator was emitted
945         properly in the two branche of if later.
946
947 2006-04-19  Raja R Harinath  <rharinath@novell.com>
948
949         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
950         cast is never an lvalue.
951         (Cast.DoResolve, Cast.ResolveRest): Combine.
952         (Argument.Emit): Simplify slightly.  Move 'Expr is
953         IMemoryLocation' check ...
954         (Argument.Resolve): ... here.
955         (Argument.Error_LValueRequired): Remove.  Inline into only user.
956
957         Simplifications.  Fix cs0191-2.cs
958         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
959         CS1649 and CS1651 to ...
960         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
961         the actual selection of the error code and message to a lookup
962         table.  Add a dummy return value to simplify callsites.
963         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
964         readonly fields of other instances of the same type.  Move CS0197
965         warning from ...
966         * expression.cs (Argument.Resolve): ... here.  Simplify code.
967         Ensure that ec.InRefOutArgumentResolving is only set during LValue
968         resolution of an out or ref argument.  The code simplification
969         above uses this invariant.
970
971 2006-04-18  Raja R Harinath  <rharinath@novell.com>
972
973         Possibly fix #77752.  Fix cs1690-[4-7].cs.
974         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
975         CheckMarshallByRefAccess.  Drop parameter.
976         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
977         warning.
978         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
979         InstanceExpression.
980         * report.cs (AllWarnings): Add CS1690.
981         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
982         for ref access too.
983         (LocalVariableReference.DoResolveBase): Update.
984
985 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
986
987         * class.cs (MethodOrOperator): Moved common parts from method class.
988         detect obsolete attributes.
989         (Method.Define): Simplified as it reuses code from base.
990         (Constructor.ValidAttributeTargets): Fixed issue found during
991         refactoring.
992         (Destructor.ValidAttributeTargets): Fixed issue found during
993         refactoring.
994         (Operator): Finished refactoring set off by #78020. Operator class is now
995         ordinary method class.
996
997         * anonymous.cs: Updated.
998
999         * decl.cs (DeclSpace): Add IsGeneric
1000
1001 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1002
1003         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1004
1005 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1006
1007         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1008         detect obsolete attributes.
1009         (Method.CreateEmitContext): Moved to MethodOrOperator.
1010
1011 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1012
1013         A fix for #78048.
1014         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1015         customized exception to make crash detection easier.
1016         (MethodOrOperator): Started to work on new base class for methods and
1017         operators.
1018         (Method): Derives from MethodOrOperator.
1019         (Constructor.Emit): Emits its own attributes.
1020         (AbstractPropertyEventMethod.Emit): Ditto.
1021         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1022         patch.
1023         (Operator.Emit): It's temporary more tricky than should be.
1024         
1025         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1026
1027         * report.cs (InternalErrorException): Add ctor with inner exception.
1028
1029 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1030
1031         A fix for #76744.
1032         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1033         only not visible.
1034
1035 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1036
1037         A fix for #77916.
1038         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1039         array.
1040
1041 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1042
1043         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1044         attribute is present and Guid not.
1045         (Interface.ApplyAttributeBuilder): Ditto.
1046
1047         * attribute.cs: Add error message.
1048
1049 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1050
1051         A fix for #78020.
1052
1053         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1054         sources (it's composite) so hold them in extra array as they are used in
1055         Emit phase only. It worked in the previous versions by mistake.
1056         (Attribute.Emit): Emit attribute for more owners when exist.
1057
1058         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1059         it has now different behaviour.
1060
1061 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1062
1063         * constant.cs (Constant.IsDefaultInitializer): New method.
1064
1065         * class.cs: Updated.
1066
1067         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1068         re-initialize default values. It saves KBs almost for every assembly.
1069         Thanks Zoltan for the idea.
1070         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1071         (ArrayCreation.DoResolve): Resolve only once.
1072         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1073         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1074
1075 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1076
1077         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1078         From #77961.
1079
1080 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1081
1082         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1083         in an embedded statement too.
1084
1085 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1086
1087         Fix #77958
1088         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1089
1090 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1091
1092         A fix for #77966.
1093
1094         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1095         was not specified.
1096
1097         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1098
1099 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1100
1101         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1102         phase.
1103
1104         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1105         LocalTemporary change.
1106
1107         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1108         TypeContainer.
1109         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1110         initializers optimization.
1111         (ClassOrStruct.TypeAttr): Moved from modifiers.
1112         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1113         (FieldBase.ResolveInitializer): Resolves initializer.
1114         (FieldBase.HasDefaultInitializer): New property.
1115
1116         * cs-parser.jay: Removed message.
1117
1118         * expression.cs (CompilerGeneratedThis): New specialization.
1119
1120         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1121
1122 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1123
1124         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1125
1126 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1127
1128         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1129         be now EnumConstants only.
1130
1131 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1132
1133         * attribute.cs, driver.cs: Reset more caches.
1134
1135 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1136
1137         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1138
1139 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1140
1141         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1142         for easier reuse. Updated all overrides.
1143         (IntegralConstant): New base class for all integral constants.
1144         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1145         of the constant range, report custom error.
1146         (UIntConstant.Reduce): Fixed uint conversion.
1147
1148         * ecore.cs, literal.cs: Reduce updates.
1149
1150 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1151
1152         A fix for #75813.
1153
1154         * class.cs (Constructor.Define): Removed extra if for default ctors.
1155         A patch from Atsushi Enomoto.
1156
1157 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1158
1159         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1160         GetAttributableValue.
1161
1162         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1163         when required.
1164
1165         * convert.cs (ImplicitConversionRequired): Error message moved to
1166         DoubleLiteral.
1167
1168         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1169         automatic implicit conversion of an output value.
1170         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1171
1172         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1173         conversion.
1174         (TypeOf.GetAttributableValue): Add extra handling for object type.
1175
1176         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1177         special error message.
1178
1179 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1180
1181         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1182         InternalCall.
1183         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1184         compatible with MS runtime.
1185
1186 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1187
1188         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1189         attribute arguments here.
1190
1191         * class.cs (Indexer.Define): The check was moved to attribute class.
1192
1193 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
1194
1195         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1196         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1197         easier.
1198
1199 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1200
1201         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1202         mcs to keep code differences small.
1203         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1204         * typemanager.cs (parameter_default_value_attribute_type): New.
1205         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1206         CS1908 check.
1207
1208 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1209
1210         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1211
1212 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1213
1214         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1215
1216         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1217         the blocks too.
1218
1219 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1220
1221         * doc-bootstrap.cs : fix build.
1222
1223 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1224
1225         * expression.cs (StringConcat.Append): Issue a warning when empty string
1226         is going to append.
1227
1228 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1229
1230         * assign.cs (CompoundAssign.ResolveSource): Removed.
1231
1232         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1233         clean up.
1234
1235         * class.cs (TypeContainer.FindMethods): Removed.
1236         (TypeContainer.CheckMemberUsage): Made static.
1237
1238         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1239
1240         * constant.cs (CheckRange): Removed unused type argument.
1241         (CheckUnsigned): Removed unused type argument.
1242
1243         * cs-parser.jay: Updated after MemberAccess clean up.
1244         Uses Length for empty string test.
1245
1246         * cs-tokenizer.cs: Uses Length for empty string test.
1247         (IsCastToken): Made static.
1248         (is_hex): Made static.
1249         (real_type_suffix): Made static.
1250
1251         * decl.cs (SetupCache): Made static.
1252         (OnGenerateDocComment): Removed unused ds argument.
1253
1254         * delegate.cs (VerifyDelegate): Removed unused argument.
1255
1256         * doc.cs: Uses Length for empty string test.
1257
1258         * driver.cs: Uses Length for empty string test.
1259
1260         * enum.cs (IsValidEnumType): Made static
1261
1262         * expression.cs (EnumLiftUp): Removed unused argument.
1263         (ResolveMethodGroup): Ditto.
1264         (BetterConversion): Ditto.
1265         (GetVarargsTypes): Ditto.
1266         (UpdateIndices): Ditto.
1267         (ValidateInitializers): Ditto.
1268         (MemberAccess.ctor): Ditto.
1269         (GetIndexersForType): Ditto.
1270
1271         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1272
1273         * iterators.cs: Updated after MemberAccess clean up.
1274
1275         * location.cs: Uses Length for empty string test.
1276
1277         * namespace.cs: Uses Length for empty string test.
1278
1279          * report.cs (CheckWarningCode): Made static.
1280
1281         * statement.cs (LabeledStatement): Removed unused argument.
1282
1283         * typemanager.cs (FilterNone): Removed.
1284
1285 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1286
1287         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1288         obsolete.
1289
1290         * class.cs: Updated.
1291
1292 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1293
1294         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1295
1296 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1297
1298         A fix for #77822.
1299
1300         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1301         reporting, it's more tricky than I thought.
1302
1303 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1304
1305         A fix for #77816.
1306
1307         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1308         host container.
1309         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1310         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1311         Add more error reporting; Fixed issue with params.
1312
1313         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1314
1315         * cs-parser.jay: AnonymousMethod requires host container.
1316
1317         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1318
1319 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1320
1321         * class.cs: Change 'TypeContainer ds' constructor argument to
1322         'DeclSpace parent'.  Some classes were missed below due to
1323         different naming convention.
1324
1325         * class.cs (MemberCore.Parent): Delete.  This makes the
1326         ParentContainer changes below enforceable by the compiler.
1327
1328         Treat pointers to enclosing declaration space as 'DeclSpace', not
1329         'TypeContainer'.
1330         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1331         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1332
1333         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1334         of TypeContainer.
1335         (Block.AddThisVariable): Likewise.
1336         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1337         (AbstractPropertyEventMethod.Emit): Likewise.
1338         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1339         (GetMethod.Define, SetMethod.Define): Likewise.
1340         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1341         (DelegateMethod.EmitMethod): Likewise.
1342
1343         Fix regression test-partial-13.cs.
1344         Rationalize use of PartialContainer.  Ensure that the partial
1345         class semantics can be tied to type-correctness, i.e., any
1346         violation will cause a compile error.
1347         * class.cs, const.cs: Access all fields that belong to class
1348         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1349         Resolve()-like functions still use 'Parent'.
1350
1351         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1352         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1353         (PropertyMethod.CheckModifiers): Remove unused argument.
1354         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1355         DeclSpace.
1356
1357 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1358
1359         Make semantics of PartialContainer simpler.
1360         * decl.cs (DeclSpace.IsPartial): Remove.
1361         * class.cs (TypeContainer.IsPartial): Likewise.
1362         (TypeContainer..ctor): Set PartialContainer to point to self.
1363         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1364         (TypeContainer.FindNestedType): Likewise.
1365         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1366
1367 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1368
1369         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1370
1371 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1372
1373         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1374         classes.
1375
1376 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1377
1378         * class.cs (Operator.Define): An error for base conversion was not
1379         reported correctly.
1380
1381 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1382
1383         * iterator.cs : yield break is allowed in try statement which has
1384           catch clauses. Fixed bug #77767.
1385
1386 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1387
1388         A fix for #77593, #77574.
1389
1390         * class.cs (MethodCore.CheckBase): Another if for operator.
1391
1392 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1393
1394         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1395         were not resolved
1396
1397         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1398         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1399         conversion test.
1400         
1401         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1402         not needed.
1403
1404         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1405         Updated after another emitcontext usage was clean up. It should help us to
1406         synchronize with gmcs easier.
1407
1408 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1409
1410         A fix for #77353.
1411
1412         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1413         (Event.Define): ditto
1414         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1415
1416         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1417         Removed redundant code and set NewSlot for Invoke method too.
1418
1419         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1420         (Parameters.MergeGenerated): New method. Use this method when you merge
1421         compiler generated argument with user arguments.
1422
1423 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1424
1425         * attribute.cs (ResolveAsTypeTerminal): Removed.
1426
1427         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1428         specialization for predefined types; 30% speed up.
1429         Finally placed obsolete check to right place.
1430         (Expression.ResolveType): Removed.
1431
1432         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1433         Updated after ResolveType was removed.
1434
1435         * expression.cs (Cast.ctor): Check void cast.
1436         (Binary.ResolveAsTypeTerminal): Is never type.
1437         (Conditional.ResolveAsTypeTerminal): Is never type.
1438
1439         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1440
1441 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1442
1443         Fix #77679.
1444         * expression.cs (ParameterReference.DoResolveBase): Change return
1445         type to bool.
1446         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1447         Update.
1448
1449         Fix #77628.
1450         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1451
1452         Fix #77642.
1453         * typemanager.cs (GetFullNameSignature): Don't nullref on
1454         protected accessors.
1455
1456 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1457
1458         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1459         these two separated members to simplify the code.
1460         (Attribute.Resolve): Refactored to use new fields and methods.
1461         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1462         implemented obsolete attribute checking.
1463         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1464         implemented obsolete checking again. It look line never ending quest ;-)
1465         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1466
1467         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1468
1469         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1470
1471         *class.cs (Property.Define): Add RegisterProperty call.
1472
1473         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1474         argument groups (only 2).
1475
1476         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1477         encoding expression to arguments.
1478         (Expression.ExprClassToResolveFlags): Just turned to property.
1479
1480         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1481         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1482         optimized as well as implemented support for zero-length attributes.
1483
1484         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1485         Add caching of PropertyInfo's.
1486
1487 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1488
1489         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1490         error multiple times.
1491
1492 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1493
1494         New partial class implementation.
1495         A fix for #77027, #77029, #77403
1496
1497         * attribute.cs (Attributable): Made attributes protected.
1498
1499         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1500         the replacements of ClassPart and PartialContainer.
1501         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1502         (TypeContainer.AddInterface): Ditto.
1503         (TypeContainer.AddPartial): The main method for partial classes. It checks
1504         for errors and merges ModFlags and attributes. At the end class is added to
1505         partial_parts list.
1506         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1507         required here.
1508         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1509         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1510         from the rest of partial classes.
1511         (TypeContainer.GetClassBases): Simplified.
1512         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1513         DefineType.
1514         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1515         (TypeContainer.HasExplicitLayout): Uses Flags now.
1516         (PartialContainer): Removed.
1517         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1518         (StaticClass): Was merged with Class.
1519         (Class.GetClassBases): class and static class bases are verified here.
1520         (Class.TypeAttr): Added static attributes when class is static.
1521         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1522         (MemberBase): In some cases we need to call parent container for partial
1523         class. It should be eliminated but it's not easy now.
1524
1525         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1526
1527         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1528         partial classed to accumulate class comments.
1529         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1530
1531         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1532
1533         * driver.cs (MainDriver): Tree.GetDecl was removed.
1534
1535         * modifiers.cs (Modifiers): Add partial modifier.
1536
1537         * tree.cs (Tree.decl): Removed.
1538         (RootTypes): Started to use this class more often for root types
1539         specializations.
1540
1541 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1542
1543         A fix for #77615
1544
1545         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1546         external interface does not have an attribute.
1547
1548 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1549
1550         Another prerequisites for new partial classs implementation.
1551         
1552         * attribute.cs (Attribute.Equal): Implemented.
1553         (Attribute.Emit): Changed as attributes can be applied more than twice.
1554         (Attributes.Emit): Check for duplicate attributes here.
1555
1556         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1557         as a parameter, clean-up.
1558
1559 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1560
1561         A fix for #77485
1562
1563         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1564         contains obsolete attribute check which can in some cases look for base
1565         type of current class which is not initialized yet.
1566         (TypeContainer.BaseType): Replacement of ptype.
1567
1568         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1569
1570 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1571
1572         First of prerequisites for new partial classs implemention.
1573         
1574         * attribute.cs (Attributable): Extended by ResolveContext;
1575         Attributes finally have correct context for resolving in all cases.
1576         (AttachTo): Attribute owner is assigned here.
1577
1578         * codegen.cs (IResolveContext): Introduce new interface to hold
1579         all information needed in resolving phase.
1580         (EmitContext): Implements IResolveContext; more clean-up needed here.
1581         
1582         * decl.cs (MemberCore): Implemented IResolveContext.
1583
1584         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1585         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1586         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1587         Refactored to use new IResolveContext instead of EmitContext; cleanup
1588
1589 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1590
1591         * codegen.cs (EmitScopeInitFromBlock): check here the
1592         capture_context, there is no need to make two calls to the
1593         EmitContext. 
1594
1595         * anonymous.cs: Add some debugging messages that might help me
1596         track other instances of this problem in the future (the
1597         regression of test 467).
1598
1599         * cs-parser.jay: track the variable block, as we need to initalize
1600         any captured variables declared in this block for the "catch"
1601         portion of the "Try" statement.
1602
1603         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1604         scope initialization for captured variables. 
1605
1606         Also, move the emit for the variables after the block location has
1607         been marked.
1608
1609 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1610
1611         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1612
1613 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1614
1615         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1616         commit yesterday, the initialization for the roots is necessary.
1617         What is not necessary is the scope activation.
1618
1619 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1620
1621         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1622         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1623         CS0206 checks.
1624         (Argument.Resolve): Remove CS0206 checks.
1625
1626 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1627
1628         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1629         scopes for all the roots, the scopes will now be emitted when the
1630         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
1631
1632         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1633         code.  This reduces a lot of existing cruft.
1634         
1635         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1636         that the ScopeInfo is generated as we enter the scope, not at the
1637         time of use, which is what we used to do before.
1638
1639         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1640         every time a Block is about to be emitted if we have a
1641         CaptureContext. 
1642
1643 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1644
1645         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1646         (Reset): Update.
1647         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1648
1649         * typemanager.cs (cons_param_array_attribute): Make private.
1650         (Reset): Set it to null.
1651         (InitCoreHelpers): Don't initialize it.
1652         (ConsParamArrayAttribute): New.  Initialize it as needed.
1653         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1654
1655 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1656
1657         * expression.cs: There might be errors reported during the
1658         selection of applicable methods.  If there are errors, do not
1659         continue execution as it will lead the compiler to crash.
1660
1661 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1662
1663         * expression.cs: Member access is not allowed on anonymous
1664         methods.  Fixes #77402.
1665
1666 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1667
1668         Fix #77401
1669         * cs-parser.jay (VariableDeclaration): Don't set
1670         current_array_type to null.
1671         (field_declaration, event_declaration, declaration_statement):
1672         Set it to null here.
1673
1674 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1675
1676         * typemanager.cs (GenericParameterPosition): New.
1677         * doc.cs: Use it.
1678
1679 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1680
1681         * doc.cs : To process "include" elements, first we should create
1682           another list than XmlNodeList, because it could result in node
1683           removal, which could result in that the XmlNodeList gives up
1684           yielding next node.
1685
1686           (Also made code identical to gmcs again.)
1687
1688 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1689
1690         * ecore.cs: Introduce an error report that we were not catching
1691         before, if not silent, we must report the error.  Gonzalo ran into
1692         it.
1693
1694 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1695
1696         A fix for bug: #76957
1697         
1698         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1699         ComputeMethodHost before creating the method, this is a new
1700         requirement. 
1701
1702         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1703         that this method references (RegisterScope).  The actual scope
1704         where the method is hosted is computed with the ComputeMethodHost
1705         before we create the method.
1706
1707         Moved the Deepest routine here.
1708
1709         (AnonymousContainer.ComputeMethodHost): New routine used to
1710         compute the proper ScopeInfo that will host the anonymous method.
1711
1712         (ScopeInfo): Deal with multiple roots.  The problem was that we
1713         did not have a unique root where all ScopeInfos could be hanged
1714         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1715         of roots.  
1716
1717         Remove AdjustMethodScope which is now computed at the end.  Remove
1718         LinkScope which did a partial link, instead link all ScopeInfos
1719         before code generation from the new "LinkScopes" routine. 
1720
1721         Simplify all the Add* routines as they no longer need to maintain
1722         the tree, they just need to record that they are using variables
1723         from a ScopeInfo.
1724
1725         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1726         routines to produce the forest of ScopeInfo trees.
1727
1728         * class.cs (TypeContainer.AppendMethod): This is just like
1729         AddMethod, but ensures that an interface implementation method
1730         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1731         methods, but at the end.
1732
1733         We use this functionality to ensure that the generated MoveNext
1734         method in the iterator class is resolved/emitted before the
1735         enumerator methods created.   
1736
1737         This is required because the MoveNext method computes the right
1738         ScopeInfo for the method.  And the other methods will eventually
1739         need to resolve and fetch information computed from the anonymous
1740         method. 
1741
1742 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1743             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1744
1745         Fix rest of #76995.
1746         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1747         the 'aliases' hash.
1748         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1749         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1750
1751 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1752
1753         Fix #76656, cs0231-2.cs.
1754         * cs-parser.jay (formal_parameter_list): Make error case catch
1755         more issues.
1756         (parenthesized_expression_0): Add CS1026 check.
1757         (invocation_expression): Remove unused { $$ = lexer.Location }.
1758
1759 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1760
1761         Fix #76824.
1762         * cs-parser.jay (statement_expression): Don't list out the
1763         individual statement-expressions.  Convert syntax error into
1764         CS0201 check.
1765
1766 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1767
1768         Fix #76874.
1769         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1770         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1771         CheckIntermediateModification.
1772         (FieldExpr.DoResolve): Add new two-argument version that
1773         allows us to resolve the InstanceExpression as an lvalue.
1774         The one-argument variant is now just a wrapper.
1775         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1776         Resolve the lhs as an lvalue if the it has a value type.
1777         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1778         from Assign.DoResolve.
1779         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1780         resolved as an lvalue.
1781         (PropertyExpr.DoResolve): Update.
1782         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1783         has a value type.  Move CS1612 check here from
1784         CheckIntermediateModification.
1785         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1786         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1787         'right_side' of a ResolveLValue on an 'out' argument.
1788         (EmptyExpression.LValueMemberAccess): New.  Used as the
1789         'right_side' of a propagated ResolveLValue on a value type.
1790         (LocalVariableReference.DoResolveBase): Recognize
1791         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1792         Add CS1654 check.
1793         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1794         EmptyExpression.Null.
1795
1796 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1797
1798         * typemanager.cs : added IsGenericParameter(). In mcs it always
1799           return false.
1800         * doc.cs : for generic parameters, use GenericParameterPosition,
1801           not FullName.
1802
1803 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1804
1805         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1806
1807 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1808
1809         This fixes the problem where we used ldfld instead of ldflda to
1810         load the "THIS" pointer on captured parameters, when THIS is a
1811         value type.  See bug #77205.
1812         
1813         * iterators.cs (CapturedThisReference.Emit): Pass false to
1814         EmitThis (we do not need the address).
1815
1816         * codegen.cs (EmitThis): it needs to know whether we need the
1817         address of `this' or not.  This is used by value types.  
1818
1819         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1820         every other call passes false.
1821
1822 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1823
1824         Fix #77221.
1825         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1826         GetOverride.
1827         * expression.cs (Invocation.OverloadResolve): Update.
1828         (Invocation.DoResolve): Avoid double resolution of invocation.
1829
1830 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1831
1832         Fix #77180.
1833         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1834         unary negation of floating point types as 0-expr; negation cannot
1835         overflow in floating point types.
1836
1837         Fix #77204.
1838         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1839         on operands of 'void' type.
1840
1841         Fix #77200.
1842         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1843         and ExclusiveOr for boolean constants too.
1844
1845 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1846
1847         Fix #75636.
1848         * expression.cs (Invocation.OverloadResolve): Replace reflected
1849         override methods with their base virtual methods, rather than
1850         skipping over them.
1851         * typemanager.cs (TypeManager.GetOverride): New.
1852
1853 2006-01-05  Jb Evain  <jbevain@gmail.com>
1854
1855         * class.cs (Property.Define, Indexer.Define): do not tag the
1856         properties as SpecialName | RTSpecialName.
1857
1858 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1859
1860         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1861         doing a low-level comparission of parameter types.  It was lacking
1862         a check for __argslist. 
1863
1864 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1865
1866         * expression.cs (ParameterReference.DoResolveBase): Allow
1867         reference parameters if they are local to this block. 
1868
1869         This allows the ref and out parameters of a delegate to be used in
1870         an anonymous method, for example:
1871
1872         delegate void set (out int x);
1873
1874         set s = delegate (out int x){
1875                 x = 0;
1876         };
1877
1878         This is used by functionality introduced late in the C# language.
1879         
1880         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1881         method that take ref and out parameters. 
1882
1883         Fixes #77119 which was a late change in the spec.
1884
1885 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1886
1887         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1888         parent if its the same scope.  Fixes #77060.
1889
1890 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1891
1892         * driver.cs: Report the case of no source files and no -out:
1893         argument provided.
1894
1895 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1896
1897         Fix #77035.
1898         * expression.cs (ComposedCast.GetSignatureForError): Define.
1899
1900 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1901
1902         Fix #76995
1903
1904         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1905         ListDictionary, to contain the ExternAliasEntry entries (in
1906         addition to the NamespaceEntry.aliases hashtable). This field is
1907         shared between the original entry and its doppelganger (bodyless 
1908         copy of it).
1909         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1910         extern_aliases field.
1911         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1912         lookup in extern_aliases.
1913
1914 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1915
1916         Fix #77006.
1917         * class.cs (TypeContainer.Mark_HasEquals): New.
1918         (TypeContainer.Mark_HasGetHashCode): New.
1919         (ClassPart): Override them.
1920         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1921
1922         Fix #77008.
1923         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1924         'parent' argument to the base constructor.
1925
1926         Remove all mention of TypeContainer from decl.cs.
1927         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1928         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1929         (DeclSpace.DeclSpace): Likewise.
1930         (DeclSpace.DefineMembers): Remove unused argument.
1931         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1932         debugging check -- we don't care if the debug code throws an
1933         InvalidCastException instead of an InternalErrorException.
1934         * class.cs (TypeContainer.DefineMembers): Update to changes.
1935         (TypeContainer.DoDefineMembers): Likewise.
1936         (TypeContainer.GetMethods): Likewise.
1937         (PropertyMember.Define): Likewise.
1938         (MemberBase.Parent): New property that forwards to
1939         MemberCore.Parent, but ensures that we get a TypeContainer.
1940         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1941         (RootContext.PopulateTypes): Likewise.  Remove special case code
1942         for !RootContext.StdLib: DefineMembers is idempotent.
1943
1944 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1945
1946         * convert.cs (ExplicitConversionCore): Check the return value from
1947         ExplicitConversionCore which can return null on failure.  Fixes #76914
1948
1949 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1950
1951         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1952
1953 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1954
1955         * doc.cs : The search for referenced namespace was insufficient to
1956           get global one as it used to do. Fixed bug #76965.
1957
1958 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1959
1960         * doc.cs : check name in cref in the last phase that whether it is
1961           namespace or not.
1962
1963 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1964
1965         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1966           Mono.C5.
1967
1968 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1969
1970         * doc.cs : so it turned out that we cannot skip override check for 
1971           interface members. Fixed bug #76954.
1972
1973 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1974
1975         * cs-tokenizer.cs : fixed bug #75984:
1976           - #warning and #error should not be handled when the source line
1977             is disabled.
1978           - #line is not checked strictly when the source line is disabled.
1979           - #define and #undef is on the other hand checked strictly at any
1980             state.
1981
1982 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1983
1984         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1985           CS1027 report.
1986
1987 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1988
1989         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1990
1991         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1992         event initializers.
1993         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1994         (FieldBase.Initializer): Initializer is now optional.
1995         (EventField.Define): Only event field can have initializer.
1996
1997         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1998
1999         * const.cs (Const): Reuse initializer.
2000
2001         * cs-parser.jay: Updated after FieldBase changes.
2002         Added current_array_type to simplify array initializers.
2003
2004         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2005
2006         * expression.cs, iterators.cs: Updated.
2007
2008         * namespace.cs (NamespaceEntry): Made UsingFound private.
2009
2010 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2011
2012         * parameterCollection.cs: Obsolete, removed.
2013         * parser.cs: Obsolete, removed.
2014
2015 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2016
2017         Fix #76849.
2018         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2019
2020         * enum.cs (Enum.Define): Set obsolete context here.
2021
2022 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2023
2024         * doc.cs :
2025           - FindDocumentedMember() now expects 1) paramList as null
2026             when "we don't have to check the number of parameters" and
2027             2) Type.EmptyTypes when "there is no arguments".
2028           - Introduced FoundMember struct to hold the exact type which was
2029             used to find the documented member (the above change broke
2030             test-xml-044; it might be better just to use DeclaringType than
2031             what MS does, like this change does, but it depends on usage.)
2032
2033 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2034
2035         * doc.cs : documented member might be from DeclaringType for nested
2036           types. Fixed bug #76782.
2037
2038 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2039
2040         * anonymous.cs: Have the param code handle leaving copies on the
2041         stack etc. Allows anonymous params to take part in the assignment
2042         code (++, +=, etc). Fixes bug #76550
2043
2044         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2045         it down to the anon code.
2046
2047         * iterators.cs: Use dummy var here
2048
2049         * codegen.cs: Handle new vars
2050
2051 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2052
2053         Fix #76849.
2054         * class.cs (MethodData.Define): Set proper Obsolete context.
2055
2056         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2057         obsolete context.
2058         (FieldExpr.DoResolve): Ditto.
2059
2060 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2061
2062         Fix #76849.
2063         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2064         parent is not obsolete.
2065
2066 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2067
2068         * doc.cs : (FindDocumentedMember) find parameterless members first
2069           and get CS0419 in the early stage. Fixed first case of bug #76727.
2070
2071 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2072
2073         Fix #76859.
2074         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2075         no error was reported.
2076
2077         *expression.cs (Binary.DoResolve): left can be null.
2078
2079 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2080
2081         Fix #76783.
2082         * class.cs (MethodData.Emit): Parameters should be labeled first.
2083
2084 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2085
2086         Fix #76761.
2087         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2088
2089 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2090
2091         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2092
2093         * class.cs (MethodCore): Parameter clean up.
2094         (IMethodData): Added ParameterInfo.
2095         (MethodData): Parameter clean up.
2096         (Indexer.Define): Parameter clean up.
2097
2098         * anonymous.cs,
2099         * codegen.cs,
2100         * cs-parser.jay,
2101         * decl.cs,
2102         * doc.cs,
2103         * ecore.cs,
2104         * flowanalysis.cs,
2105         * iterators.cs,
2106         * pending.cs,
2107         * statement.cs,
2108         * typemanager.cs: Parameter clean up.
2109
2110         * delegate.cs (Define): Get rid of duplicated code.
2111
2112         * expression.cs (ParameterReference): Removed useless parameters
2113         and simplified.
2114         (Invocation): Ditto.
2115
2116         * parameter.cs (ParamsParameter): New class, params specialization.
2117         (ArglistParameter): Attemp to separate arglist.
2118         (Parameter): Refactored to be reusable and faster.
2119         (Parameter.Modifier): Made understandable.
2120         (Parameters): Changed to be used as a class for `this' assembly
2121         parameters. Refactored to use new specialized classes.
2122
2123         * support.cs (ParameterData): Added Types property.
2124         (InternalParameters): Deleted.
2125
2126 2005-08-20  Martin Baulig  <martin@ximian.com>
2127
2128         Merging this patch from GMCS to fix #75867.
2129
2130         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2131         scope if we don't already have it.
2132
2133 2005-11-17  Martin Baulig  <martin@ximian.com>
2134
2135         * anonymous.cs
2136         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2137         inherit the scope from our parent.  Fixes #76653.
2138
2139 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2140
2141         * doc.cs : the previous patch does not actually fix the bug.
2142           PropertyInfo override check is now implemented and really fixed it.
2143         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2144
2145 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2146
2147         * doc.cs : apply "override filter" also to properties.
2148           Fixed bug #76730.
2149
2150 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2151
2152         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2153           no need to check overrides. For classes, omit those results from 
2154           interfaces since they must exist in the class. Fixed bug #76726.
2155
2156 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2157
2158         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2159           with different parameters. Fixed the second problem in #76685.
2160
2161 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2162
2163         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2164           get expected 'protected' access in CheckValidFamilyAccess()).
2165           Fixed bug #76692.
2166
2167 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2168
2169         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2170           Fixed bug #76705.  CS1569 was incorrectly commented out.
2171
2172 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2173
2174         * doc.cs : use Invocation.IsOverride() to do real override check.
2175         * expression.cs : made Invocation.IsOverride() internal.
2176
2177 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2178
2179         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2180           TypeBuilder.FindMembers() and filter overriden base members out.
2181           Fixed bug #76990.
2182
2183 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2184
2185         * doc.cs : ref/out parameters are represented as '@' (instead of
2186           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2187
2188 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2189
2190         * doc.cs : when there was no '.' in cref to methods in doc comment,
2191           then parameters were missing in the output. Fixed bug #76691.
2192
2193 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2194
2195         * driver.cs : don't output docs when there is an error.
2196           Fixed bug #76693.
2197
2198 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2199
2200         * doc.cs :
2201           Now it should detect indexers. Fixed primary concern in bug #76685.
2202           Fixed CS0419 message to not show the identical member signature in
2203           the message.
2204
2205 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2206
2207         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2208           instead of Type.FindMembers() since it does not handle events.
2209           Fixed bug #71604.
2210
2211 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2212
2213         * codegen.cs: Fixed typo (speficied -> specified).
2214
2215 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2216
2217         Fix #76369.
2218         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2219
2220 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2221
2222         * attribute.cs: Changed error message.
2223
2224         * cs-tokenizer.cs: One more check.
2225
2226 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2227
2228         * statement.cs (Block.Resolve): Ignore empty statement.
2229
2230 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2231
2232         * report.cs: Made error/warning methods more strict to avoid
2233         their misuse.
2234
2235         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2236         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2237         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2238         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2239
2240 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2241
2242         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2243         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2244
2245         * class.cs (TypeContainer.IsComImport): New property.
2246         (Constructor.Define): Create proper ctor for ComImport types.
2247
2248         * expression.cs (New.CheckComImport): Fixed.
2249
2250 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2251
2252         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2253         that a parameter has been captured does not mean that we do not
2254         have to do the rest of the processing.  This fixes the second part
2255         of #76592.  If there was another anonymous method capturing
2256         values in the past, the Scope would never be set for the second
2257         method that captured the same parameter.
2258
2259         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2260         properly manipulate the stack.   Second part of fix for #76592.
2261
2262         * expression.cs (New): Add support for invoking "new" on
2263         interfaces that have been flagged with the ComImport attribute and
2264         the CoClass.  Fixes #76637 
2265
2266         * statement.cs (Try.DoEmit): When a variable is captured, do not
2267         try to emit the vi.LocalBuilder variable as it has been captured.
2268         Create a temporary variable and store the results on the
2269         FieldBuilder.  Fixes #76642
2270
2271 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2272
2273         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2274
2275         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2276
2277         * expression.cs (Binary.DoResolve): Added && optimalization.
2278     
2279         * typemanager.cs (AddUserType): Removed useless argument.
2280
2281 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2282
2283         * statement.cs (Block.variables): Uses ListDictionary.
2284
2285 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2286
2287         Fix #75969.
2288         * class.cs (PartialContainer.EmitType): Customized to emit
2289         security attributes.
2290         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2291         for partial classes.
2292
2293 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2294
2295         Fix #76599.
2296         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2297         access has to be fixed.
2298         
2299         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2300
2301 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2302
2303         Fix #76590.
2304         * ecore.cs (NullCast.Reduce): Implemented.
2305
2306         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2307         constant type.
2308         
2309         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2310         properly.
2311         (Foreach.Resolve): Catch null properly.
2312
2313 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2314  
2315         * cs-tokenizer.cs: Warning text fix.
2316
2317         * driver.cs: AllWarningNumbers exposed on public interface.
2318
2319         * report.cs (): Reviewed warning numbers.
2320         (IsValidWarning): Use binary search.
2321
2322 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2323  
2324         * driver.cs: Implemeted resource visibility.
2325         (Resources): New class for code sharing between /res: and
2326         /linkres:
2327  
2328 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2329
2330         Fix #76568.
2331         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2332         folding.
2333         
2334         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2335         contants only.
2336         
2337         * ecore.cs (NullCast): Child is contant only.
2338         
2339         * literal.cs (NullLiteral.Reduce): null can be converted to any
2340         reference type.
2341
2342 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2343
2344         * driver.cs: Use Encoding.Default as default code page instead
2345           of ISO-28591.
2346
2347 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2348
2349         Fix #76085.
2350         * expression.cs (Invocation.Error_InvalidArguments): Handle
2351         __arglist parameters.
2352         (Invocation.VerifyArgumentsCompat): Likewise.
2353         * support.cs (ReflectionParameters.GetSignatureForError): Print
2354         __arglist parameters.
2355         (InternalParamters.GetSignatureForError): Likewise.
2356         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2357
2358 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2359
2360         * attribute.cs (GetPropertyValue): Made public.
2361
2362         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2363         Resolve.
2364         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2365         attribute.
2366         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2367         is not defined.
2368         
2369         * driver.cs: Reflect method name change.
2370         
2371         * statement.cs (Try.Resolve): Warn when try has both general
2372         exception handlers.
2373         
2374         * typemanager.cs: runtime_compatibility_attr_type new predefined
2375         type.
2376
2377 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2378
2379         Fix #76419.
2380         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2381         treat it as an empty parameter list.
2382
2383 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2384
2385         Fix #76271.     
2386         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2387         ResolveAsTypeStep silent.
2388         * statement.cs (Block.AddConstant): Mark block as used.
2389         (Block.ResolveMeta): Avoid piling on error messages
2390         if a constant initializer resolution fails.
2391
2392 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2393
2394         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2395         Remove.
2396         (NamespaceEntry.VerifyAllUsing): New.
2397         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2398         behaviour.  Delegates actual resolution of alias to ...
2399         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2400         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2401         Update.
2402         * driver.cs (Driver.MainDriver): Update.
2403         
2404         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2405         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2406         property.
2407         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2408         Remove.
2409         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2410         RootNamespace.DefineNamespacesForAll.
2411
2412 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2413
2414         * typemanager.cs (assemblies, external_aliases, modules)
2415         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2416         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2417         overhead.  Move resposibility ...
2418         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2419         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2420
2421 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2422
2423         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2424         cached_namespaces.  Improve usage.
2425         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2426         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2427         Move from GlobalRootNamespace and simplify.
2428         (RootNamespace.Global): Make instance variable.
2429         (RootNamespace.RootNamespace): Add "alias name" parameter.
2430         (GlobalRootNamespace): Simplify drastically.
2431         (Namespace.Lookup): Don't use GetNamespace.
2432         * typemanager.cs (GetRootNamespace): Rename from
2433         ComputeNamespaceForAlias.
2434         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2435
2436 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2437
2438         * anonymous.cs (AnonymousContainer): Don't crash when container
2439         doesn't exist.
2440
2441 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2442
2443         * expression.cs (Binary.DoResolve): Warn when comparing same
2444         values.
2445
2446 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2447
2448         Fix #76486.
2449         * expression.cs (Binary.DoResolve): It looks like there are no
2450         convetsion rules in enum context.
2451
2452 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2453
2454         Add support for extern alias qualifiers.
2455         * typemanager.cs: Move some LookupTypeReflection code
2456         to namespace.cs, to have cleaner code. Added some methods
2457         to help us keep track of the extern aliased references.
2458         * driver.cs: Add suport for extern alias assemblies on command
2459         line and check for their warnings/errors. Also keep track of the
2460         extern aliased assemblies.
2461         * namespace.cs: Move the global functionality of Namespace
2462         to GlobalRootNamespace/RootNamespace. Now the global namespace
2463         is GlobalRootNamespace.Globa. Also the code moved from 
2464         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2465         Finally added LocalAliasEntry (AliasEntry before) and
2466         ExternAliasEntry, to handle alias statements.
2467         * cs-parser.jay: Add support in the grammar for extern alias
2468         statement.
2469         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2470         Update callings to Namespace (now in GlobalRootNamespace).
2471
2472 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2473
2474         Fix #76371.
2475         * class.cs (TypeContainer.DefineType): Move updating of
2476         topological sort earlier in the code.
2477         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2478
2479 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2480
2481         Fix #76273.
2482         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2483         
2484         * constant.cs (Constant.TryReduce): Moved from Cast class.
2485         (Reduce): Made little bit more OO and fixed missing conversions.
2486         
2487         * ecore.cs (Reduce): Implemented.
2488         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2489         
2490         * literal.cs (Reduce): Implemented.
2491         
2492         * class.cs: Reverted Miguel's wrong commit.
2493
2494 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2495
2496         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2497
2498 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2499
2500         * cs-parser.jay, expression.cs : CS0214 was missing error location
2501           for constants. Fixed bug #76404.
2502
2503 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2504
2505         Fix #76370.
2506         * convert.cs (ExplicitConversionCore): Fixed object->enum
2507         conversion.
2508
2509 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2510
2511         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2512         InstanceExpression.
2513         (PropertyExpr.EmitCall): Likewise.
2514         * expression.cs (Invocation.EmitArguments): Handle case where
2515         arguments == null.
2516         (Invocation.EmitCall): Avoid allocating temporary variable if
2517         there are no arguments.
2518
2519 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2520
2521         Fix #76323.
2522         * convert.cs (ImplicitConversionStandard): Move conversion of
2523         void* to arbitrary pointer types ...
2524         (ExplicitConversionStandard): .. here.
2525         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2526         error to always print typenames.
2527
2528 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2529
2530         * convert.cs (GetConversionOperator): Rename from
2531         GetConversionOperators.  Move operator selection code from ...
2532         (UserDefinedConversion): ... here.
2533
2534 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2535
2536         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2537         conversion.
2538
2539 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2540
2541         * assign.cs (Assign.DoResolve): Error method changed.
2542
2543         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2544         
2545         * const.cs (ResolveValue): Reset in_transit immediately.
2546         
2547         * constant.cs: Error method changed.
2548         
2549         * convert.cs: Removed useless location parameter.
2550         (ExplicitNumericConversion): Don't do double enum check.
2551         (ExplicitConversionCore): Renamed from ExplicitConversion.
2552         (ExplicitUnsafe): Extracted from ExplicitConversion.
2553         (ExplicitConversion): Uses for error reporting.
2554         
2555         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2556         error messages.
2557         (ResolveBoolean): Uses common error method.
2558         (CastToDecimal): Get rid of ec.
2559         (CastFromDecimal): Optimized.
2560         (ConvCast): Get rid of ec.
2561         
2562         * enum.cs (ResolveValue): Reset in_transit immediately.
2563         (Emit): Return after first error.
2564         
2565         * expression.cs: Convert changes.
2566         
2567         * literal.cs: Error method changed.
2568         
2569         * statement.cs: Error method changed.
2570
2571 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2572
2573         * support.cs (SeekableStreamReader.Position): Don't error out when
2574         the requested position is just beyond the end of the current
2575         buffered data.
2576
2577 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2578
2579         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2580         try to keep in sync with the byte count of the underlying Stream.
2581         However, this limits us to a window size of 2048 characters: i.e.,
2582         the maximum lookahead of our lexer/parser can be 2048 characters.
2583
2584 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2585
2586         Fix #76255.
2587         * driver.cs: Fix compilation files with full root path.
2588
2589 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2590
2591         * report.cs (SymbolRelatedToPreviousError): Format the output so
2592         it does not use an open parenthesis that is never closed. 
2593
2594         * driver.cs: Follow coding guidelines
2595
2596 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2597
2598         Fix #72930.
2599         * const.cs (Const.ResolveValue): Check for assigning non-null
2600         value to reference type.
2601
2602 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2603
2604         * anonymous.cs: Implemented ExprClassName.
2605         
2606         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2607         delegate.
2608         
2609         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2610         check.
2611         
2612         * class.cs (StaticClass.DefineContainerMembers): Report protected
2613         members as error.
2614         
2615         * codegen.cs: if(ed) PRODUCTION.
2616         
2617         * convert.cs (Error_CannotImplicitConversion): Better error
2618         distinction.
2619         
2620         * cs-parser.jay: More error checks.
2621         
2622         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2623         
2624         * driver.cs (CSCParseOption): Enabled wrong option check.
2625         
2626         * ecore.cs (Expression.ExprClassName): Turned to property.
2627         (MemberExpr.CheckIntermediateModification): For checking boxed
2628         value types     modification.
2629         
2630         * statement.cs (Fixed.Resolve): Expression type must be
2631         convertible to fixed type.
2632         (CollectionForeach.GetEnumeratorFilter,TryType):
2633         Small refactoring for easier error checking.
2634
2635 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2636
2637         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2638         attributes.
2639         
2640         * class.cs (GeneratedBaseInitializer): New class for customization
2641         compiler generated initializers.
2642         (MemberBase.DoDefine): Check Obsolete attribute here.
2643         (FieldMember.DoDefine): Ditto.
2644         
2645         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2646         constants.
2647         
2648         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2649         (MemberCore.GetObsoleteAttribute): Removed argument.
2650         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2651         (MemberCore.CheckObsoleteType): New helper.
2652         
2653         * delegate.cs,
2654         * enum.cs,
2655         * statement.cs: Updates after MemberCore changes.
2656         
2657         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2658         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2659         
2660         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2661         obsolete attribute for compiler construct.
2662         (As.DoResolve): Cache result.
2663         
2664         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2665
2666 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2667
2668         Fix #76133.
2669         * expression.cs (This.VerifyFixed): In a value type T, the type of
2670         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2671         value type R, 'this' is treated as a value parameter.
2672
2673 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2674
2675         * statement.cs (Lock): Use the TemporaryVariable class instead of
2676         manually using local variables as those do not work when variables
2677         are captured.
2678
2679         * ecore.cs: Moved the TemporaryVariable class from being a nested
2680         class inside Foreach to be a public class that can be employed in
2681         other places. 
2682
2683 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2684
2685         * cs-parser.jay: interface_accessors replaced by
2686         accessor_declarations.
2687
2688         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2689         location.
2690         
2691         * statement.cs (GotoCase.Resolve): Convert null constant to
2692         null case.
2693         (SwitchLabel.ResolveAndReduce): Ditto.
2694         (SwitchLabel.NullStringCase): Custom null stamp.
2695         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2696         
2697         typemanager.cs (CSharpSignature): Don't skip first argument
2698         for full names.
2699
2700 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2701
2702         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2703
2704         * location.cs (InEmacs): in this mode, do not report column
2705         location as it confuses Emacs.
2706
2707 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2708
2709         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2710         expression.cs, iterators.cs, literal.cs: Store constants and
2711         literals location.
2712         
2713         * class.cs (MemberBase.ShortName): Pass location.
2714         
2715         * cs-parser.jay: Some location fixes.
2716         
2717         * ecore.cs (Expression.Location): Made virtual.
2718
2719 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2720
2721         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2722         if the underlying types are the same, otherwise we need to produce
2723         code that will do the proper cast.
2724
2725         This was exposed by Marek's constant rewrite which produced
2726         invalid code for the call site:
2727
2728         enum X : long { a }
2729         void Method (X v) {}
2730
2731         Method ((X) 5)
2732
2733         This fixes test-49.cs
2734
2735 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2736
2737         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2738           Type/Object should be allowed as well. Fixed bug #75968.
2739
2740 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2741
2742         * expression.cs : (Binary.DoResolve): when one is enum constant and
2743           another is constant 0, then return enum one *as enum type*.
2744           Fixed bug 74846.
2745
2746 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2747
2748         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2749         internal.
2750
2751         Fix #75941.
2752         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2753         flow-branching for LocalVariableReferences in case we were invoked
2754         from a MemberAccess.
2755         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2756         Carved out of ...
2757         (LocalVariableReference.DoResolveBase): ... this.
2758         (MemberAccess.Resolve): Do the check that was disabled during
2759         SimpleNameResolve.
2760
2761 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2762
2763         * class.cs :
2764           (PartialContainer.Create): check abstract/sealed/static strictly
2765           but abstract/sealed can exist only at one side. Fixed bug #75883.
2766
2767 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2768
2769         Fix #75945.
2770         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2771         specified, don't default to UnmanagedType.I4.
2772
2773 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2774
2775         * expression.cs : conditional operator should check possibly
2776           incorrect assign expression. Fixed bug #75946.
2777
2778 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2779
2780         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2781           Reverting the change. gmcs is much complex than mcs on this matter.
2782
2783 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2784
2785         * cs-tokenizer.cs : To read another token ahead of the actual 
2786           consumption, use new SavedToken and cache token instead of moving
2787           back the stream with SeekableStreamReader (it seemed problematic).
2788         * cs-parser.jay,
2789           driver.cs : Thus use StreamReader directly.
2790         * support.cs : Thus removed SeekableStreamReader.
2791
2792 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2793
2794         Fix #75934.
2795         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2796         (ScopeInfo.EmitScopeType): Use it to construct field names from
2797         names of captured locals.
2798
2799         Fix #75929.
2800         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2801         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2802         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2803         (ExplicitConversion): Remove enum cases already handled by
2804         implicit conversion.  Move implicit conversion check to the beginning.
2805         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2806         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2807         Don't treat System.Enum as a struct.
2808
2809 2005-08-30  Jb Evain  <jbevain@gmail.com>
2810
2811         * attribute.cs: handles as expression in parameters.
2812
2813 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2814
2815         Fix #75802.
2816         * class.cs (TypeContainer.VerifyClsName): Don't use a
2817         PartialContainer when verifying CLS compliance.
2818         (AbstractPropertyEventMethod): Set Parent here, ...
2819         (PropertyMethod): ... not here.
2820
2821 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2822
2823         * attribute.cs : escaped attribute name should not be allowed to be
2824           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2825
2826 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2827
2828         Fix #75927.
2829         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2830         when converting a long constant to unsigned long.
2831         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2832         detect where IsApplicable and VerifyArgumentsCompat disagree.
2833
2834 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2835         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2836
2837         Fix #75848.
2838         * class.cs (TypeContainer.CanElideInitializer): New helper.
2839         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2840         can safely emitting the initializer of a field.
2841
2842 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2843
2844         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2845           allowed inside a switch (without loop). Fixed bug #75433.
2846
2847 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2848
2849         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2850         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2851
2852 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2853
2854         * driver.cs : kinda reverting the default encoding changes (not exact 
2855           revert since I noticed that "codepage:reset" might not work fine).
2856
2857 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2858
2859         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2860           Location. Now getter and setter store location correctly.
2861           (errors/cs0111-12.cs now reports the expected location.)
2862
2863 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2864
2865         * driver.cs : Use default encoding on the environment.
2866           Removed (now that) extra parameter for SeekableStreamReader.
2867         * support.cs : (SeekableStreamReader) third .ctor() argument for
2868           StreamReader is not required (always true). preamble size could
2869           be acquired in simpler and safe way.
2870
2871 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2872
2873         * cs-parser.jay: report CS0642 at warning level 3
2874           and report CS0642 for an if else statement also
2875           fixes bug #74745. Patch by John Luke (and a bit
2876           modified by me).
2877           Removed extra CS0642 warning check for "while",
2878           "for" and "fixed".
2879         * statement.cs: In Block.Resolve(), CS0642 check
2880           is reimplemented to check a sequence of an empty
2881           statement and a block.
2882
2883           Both fix bug #66777.
2884
2885 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2886
2887         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2888         detection until I fix it.
2889         
2890         * cs-tokenizer.cs: Changed error message.
2891         
2892         * cs-parser.jay: Fixed 2 error locations.
2893         
2894         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2895         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2896         properties.
2897         
2898         * enum.cs (GetSignatureForError): Fixed.
2899         
2900         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2901         method detection.
2902         
2903         * class.cs,
2904         * typemanager.cs (RegisterProperty): Removed.
2905         
2906         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2907
2908 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2909
2910         Fix #75874.
2911         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2912         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2913
2914 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2915
2916         * expression.cs : tiny fix is required for not warning positive ulong.
2917           See test-441.cs.
2918
2919 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2920
2921         * expression.cs : add CS0652 check for constant and integral
2922           expression. Fixed bug #53974.
2923
2924 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2925
2926         * expression.cs : in DoNumericPromotions(), check if there is implicit
2927           conversion overload for string (to check CS0034). Fixed bug #52492.
2928
2929 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2930
2931         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2932
2933 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2934
2935         * ecore.cs : report location when it is *not* Null.
2936
2937 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2938
2939         * codegen.cs,
2940           ecore.cs,
2941           flowanalysis.cs,
2942           expression.cs:
2943           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2944           correctly. Fixed bug #75721.
2945
2946 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2947
2948         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2949         loop that performs 'min (pos, char_count)'.
2950
2951         Fix #75862.
2952         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2953         converted value in Operator.OnesComplement.
2954
2955 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2956
2957         * anonymous.cs: If the anon method is pulled into a helper class,
2958         it needs to be `internal' not `private'. Fixes runtime behavior on
2959         msft. bug #75704
2960
2961 2005-08-20  Martin Baulig  <martin@ximian.com>
2962
2963         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2964         scope if we don't already have it.
2965
2966         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2967         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2968         fixes #75867.
2969
2970 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2971
2972         Fix #75803
2973         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2974         is a partial class.
2975
2976 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2977
2978         The big constants rewrite
2979         Fix #75746, #75685 and more
2980         As a side effect saved 1MB for MWF ;-)
2981         
2982         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2983         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2984         enum based for corlib compilation.
2985         
2986         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2987         subtractions.
2988         
2989         * class.cs (FixedField.Define): Use ResolveAsConstant.
2990         
2991         * const.cs (IConstant): Interface constants and enums.
2992         (Const.ResolveValue): New method for constant resolvning.
2993         (ExternalConstant): Constants from imported assemblies.
2994         
2995         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2996         conversion; like enums.
2997         (Constant.ToType): Converts this constant to different type.
2998         (Constant.Increment): Adds 1.
2999         
3000         * convert.cs (ImplicitConversionRequired): Simplified.
3001         
3002         * cs-parser.jay: Create EnumMember directly.
3003         
3004         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3005         
3006         * doc.cs (GenerateEnumDocComment): Removed.
3007         
3008         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3009         (ConvertIntLiteral): Removed.
3010         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3011         
3012         * enum.cs (EnumMember): Implement IConstant.
3013         (Enum.IsValidEnumConstant): Removed.
3014         (Enum.GetNextDefaultValue): Removed.
3015         (Enum.FindMembers): Updated.
3016         (Enum.GenerateDocComment): Iterate enum members.
3017         
3018         * expression.cs (Cast.TryReduce): Handle enums correctly.
3019         (New.Constantify): Made public.
3020         (MemberAccess.DoResolve): Removed contant specific if(s).
3021         
3022         * literal.cs (NullLiteral): Implement new abstract methods.
3023         
3024         * statement.cs (GotoCase.Resolve): Use new constant methods.
3025         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3026         
3027         * typemanager.cs (LookupEnum): Removed.
3028         (IsEnumType): Fixed to work with corlib.
3029         (RegisterConstant): Removed.
3030         (LookupConstant): Removed.
3031         (GetConstant): Changed to work with IConstant.
3032
3033 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3034
3035         * location.cs : Fixed overflown (>255) column number.
3036
3037 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3038
3039         First cut of the qualified-alias-member feature.
3040         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3041         token.
3042         * cs-parser.jay (DOUBLE_COLON): New token.
3043         (namespace_or_type_name): Add rule for recognizing
3044         qualified-alias-members.
3045         (primary_expression): Likewise.
3046         (element_access): Allow QualifiedAliasMember as a possible
3047         type-bearing expression.
3048         (local_variable_type, local_variable_pointer_type): Likewise.
3049         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3050         aliases in the current and enclosing namespace declarations.
3051         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3052         * decl.cs (MemberName.is_double_colon): New.
3053         (MemberName.MemberName): Add new constructor for alias-member.
3054         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3055         * expression.cs (QualifiedAliasMember): New expression type.
3056
3057 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3058
3059         * location.cs : it borked when no argument was specified.
3060
3061 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3062
3063         * location.cs : tiny ToString() format fix.
3064
3065 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3066
3067         * statement.cs : oops, it was missing.
3068
3069 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3070
3071         A set of fixes for precise line/column location.
3072
3073         * location.cs :
3074           "token" field now holds a file/line "delta", a line number offset 
3075           from the segment, and a column number. See also:
3076           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3077           December/009508.html
3078           Removed static IsNull. Use instance IsNull property instead.
3079         * cs-tokenizer.cs :
3080           For some tokens it stores Location. For Identifier it stores
3081           LocatedToken which is a pair of string name and location.
3082           Column numbers are adjusted only at getChar().
3083         * report.cs :
3084           Use Location.ToString() for reporting (it now contains column).
3085         * cs-parser.jay :
3086           Largely modified to use LocatedToken instead of
3087           string (IDENTIFIER), and to acquire Location from some tokens.
3088         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3089           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3090           codegen.cs :
3091           Now MemberName holds Location. DeclSpace.ctor() receives Location
3092           as a parameter. Removed extra parameters to all derived classes.
3093           Replaced Location.IsNull() with instance property.
3094         * assign.cs, expression.cs :
3095           Added .ctor() overload that omits Location.
3096         * attribute.cs :
3097           Added "nameEscaped" flag that indicates the identifier was escaped
3098           in the source file. This fixes bug #57047.
3099
3100 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3101
3102         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3103         New method, looking for lo-case imported cls type.
3104
3105         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3106         here.
3107
3108         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3109
3110         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3111
3112         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3113         all_imported_types.
3114         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3115
3116         Optimized to save 3.5 MB for SWF compilation.
3117
3118 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3119
3120         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3121         (PartialContainer.Create): Moved logic AddToContainer.
3122         (PartialContainer.MarkForDuplicationCheck): Shares name.
3123         
3124         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3125         place.
3126         
3127         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3128         initialization.
3129         (Namespace.GetSignatureForError): New method.
3130         
3131         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3132         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3133
3134 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3135
3136         Fix #75669.
3137         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3138         member lookup rather than qualifier_type, since qualifier_type can
3139         be null.
3140
3141 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3142
3143         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3144         enum member.
3145
3146 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3147
3148         * statement.cs: Copy the local exception into the exception
3149         captured local.  Fixes 75674
3150
3151 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3152
3153         Fix #75658.
3154         * expression.cs (Invocation.OverloadResolve): Don't report error
3155         CS1501 if error CS1502 has been reported.
3156         (New.DoResolve): Delegate CS1501 reporting to
3157         Invocation.OverloadResolve.
3158
3159         Fix #75656.
3160         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3161         invariant-meaning-in-block property in an enclosing block if
3162         necessary.
3163
3164 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3165
3166         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3167         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3168         (Switch.CheckSwitch): Just save 50kb for SWF.
3169
3170 2005-07-27  Martin Baulig  <martin@ximian.com>
3171
3172         * anonymous.cs (CaptureContext.AddField): Added
3173         `AnonymousContainer am' argument; compute its toplevel scope if
3174         it's not already computed.  Fixes #75649.
3175
3176 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3177
3178         Fix #75628.
3179         * class.cs (Constructor.Emit): Reset block to null if the block
3180         resolve fails.
3181
3182 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3183
3184         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3185
3186 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3187
3188         * class.cs (MethodData.Define): Check whether accessor implementing
3189         interface is public.
3190
3191         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3192
3193 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3194
3195         Fix #57245
3196         * namespace.cs (LookupType): Moved same type check to...
3197         
3198         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3199         with the same name.
3200
3201 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3202
3203         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3204         already found a typebuilder.
3205         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3206         MemberNames, not strings.
3207
3208         * const.cs (Error_ExpressionMustBeConst): 
3209         Rename from Error_EpressionMustBeConst.
3210         * const.cs, class.cs, statement.cd: Update.
3211
3212 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3213
3214         Fix #65573
3215
3216         * const.cs (Const.LookupConstantValue): Report missing contant expression
3217         everytime.
3218         (Error_EpressionMustBeConstant): Only one error method.
3219
3220         * class.cs, statement.c: Updated.
3221
3222 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3223
3224         * statement.cs (Block.Flags): Add back HasVarargs.
3225         (Block.flags): Make protected.
3226         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3227
3228         * typemanager.cs (types, typecontainers, user_types): Remove.
3229         (UserTypes, TypeContainers): Likewise.
3230         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3231         (CleanUp, Reset): Update.
3232         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3233         (GetNestedType): Use Type.GetNestedType.
3234         (CoreLookupType): Take two arguments, the namespace and the
3235         basename of the type.  Update to use the Namespace.Lookup
3236         mechanism.
3237         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3238         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3239         string concatenation and substring matches.
3240         * class.cs, enum.cs, delegate.cs: Update to changes.
3241
3242 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3243
3244         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3245         Expression and made virtual.
3246
3247         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3248         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3249
3250         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3251
3252         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3253         error message.
3254
3255         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3256         change.
3257
3258 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3259
3260         Fix #57707
3261         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3262         AssemblyCultureAttribute is not used on executable.
3263
3264         * rootcontext.cs,
3265         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3266
3267 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3268
3269         Fix #60638.
3270         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3271         New.  Reports CS0252/CS0253.
3272         Mostly taken from preliminary patch by Duncak Mak.
3273         (Binary.DoResolveOperator): Store results of operator lookup.
3274         Use them to detect if we need to warn about unintended reference
3275         comparisons.
3276
3277 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3278
3279         Fix #72969.
3280         * namespace.cs (Namespace.Lookup): Add back location parameter.
3281         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3282         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3283
3284         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3285         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3286         (Namespace.LookupType): ... this.
3287         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3288         of namespaces.
3289         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3290         purported to handle pointers.
3291         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3292         CoreLookupType.
3293
3294 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3295
3296         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3297         type as namespace.
3298
3299 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3300
3301         * namespace.cs (Namespace.Lookup): Drop location parameter.
3302         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3303         (NamespaceEntry.Lookup): ... this.
3304         (NamespaceEntry.Error_AmbiguousTypeReference):
3305         Move here from DeclSpace.
3306         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3307         names ...
3308         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3309         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3310         Move to NamespaceEntry.
3311         * delegate.cs, expression.cs: Update to changes.
3312
3313 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3314
3315         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3316         CheckAttributeType and refactored.
3317         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3318         ResolveAsTypeTerminal error handling.
3319         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3320         handling.
3321         (GetSignatureForError): Print errors in same way.
3322
3323         * class.cs,
3324         * codegen.cs: Reflect attribute GetSignatureForError change.
3325
3326         * ecore.cs,
3327         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3328
3329         * namespace.cs (UsingEntry): Refactored to make fields private.
3330
3331         * assign.cs,
3332         statement.cs: Error_UnexpectedKind has extra parameter.
3333
3334 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3335
3336         * ecore.cs (IAlias): Remove.
3337         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3338         that implement the interface.
3339         * namespace.cs (Namespace): Likewise.
3340         (Namespace.declspaces): Renamed from 'defined_names'.
3341         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3342         DeclSpace instead of an IAlias.
3343         * tree.cs (Tree.AddDecl): Update.
3344
3345 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3346
3347         * statement.cs (Block.Flags); Remove HasVarargs.
3348         (Block.HasVarargs): Move to ToplevelBlock.
3349         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3350         (Block.Variables): Make protected.  Initialize variable hashtable
3351         if necessary.
3352         (Block.AddVariable): Update.
3353         (Block.Resolve): Update to changes.
3354         (ToplevelBlock.HasVarargs): New boolean.
3355         (ToplevelBlock.ThisVariable): Move here from Block.
3356         (ToplevelBlock.AddThisVariable): Likewise.
3357         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3358         * expression.cs (This.ResolveBase): Update to changes.
3359         (ArglistAccess.DoResolve): Likewise.
3360
3361 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3362
3363         Fix #75321
3364         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3365
3366         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3367         not used and not used & assigned.
3368         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3369
3370 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3371
3372         Fix #75053
3373         * expression.cs (Is.DoResolve): null is never provided type.
3374
3375 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3376
3377         Fix #52496
3378         * cs-parser.jay: Less strict event error rule to catch more errors.
3379
3380 2005-07-08  Martin Baulig  <martin@ximian.com>
3381
3382         Fix test-iter-10.cs - distinguish whether we `yield' in a property
3383         gettter (allowed) or setter (not allowed).
3384
3385         * class.cs (Accessor): Implement IIteratorContainer.
3386         (Accessor.Yields): New public field.
3387         (PropertyBase.PropertyMethod.Define): Handle iterators on a
3388         per-accessor basis.
3389
3390         * cs-parser.jay
3391         (get_accessor_declaration, set_accessor_declaration): Set the
3392         `yields' flag on the accessor, not the property.
3393         (property_declaration): Do the iterators check on a per-accessor
3394         basis and not for the whole property.
3395
3396 2005-07-08  Martin Baulig  <martin@ximian.com>
3397
3398         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3399         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3400
3401 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3402
3403         Fix #74975
3404         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3405         (ExtractSecurityPermissionSet): Cope with self referencing security
3406         attributes properly.
3407
3408         * driver.cs (SetOutputFile): Made public property OutputFile.
3409
3410 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3411
3412         Fix #75486.
3413         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3414         has_nonstatic_fields.  Make into a FieldBase pointer.
3415         (TypeContainer.AddField): Add CS0282 check.
3416         (TypeContainer.EmitType): Update.
3417
3418 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3419
3420         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3421         compare if they start with __.
3422
3423 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3424
3425         * statement.cs (Switch.SwitchGoverningType): Only look at
3426         UserCasts that don't need implicit standard conversions to one of
3427         the allowed switch types (Fixes test-322.cs).
3428         (LocalInfo.Resolve): Re-enable sanity-test.
3429
3430 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3431
3432         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3433         
3434         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3435         
3436         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3437
3438 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3439
3440         Fix #75472.
3441         * ecore.cs (SimpleName.GetSignatureForError): Add.
3442         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3443         (MemberAccess.GetSignatureForError): Add.
3444
3445 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3446  
3447         The big error and warning messages review.
3448         
3449         * anonymous.cs,
3450         * assign.cs,
3451         * attribute.cs,
3452         * class.cs,
3453         * codegen.cs,
3454         * convert.cs,
3455         * cs-parser.jay,
3456         * cs-tokenizer.cs,
3457         * decl.cs,
3458         * delegate.cs,
3459         * doc.cs,
3460         * driver.cs,
3461         * ecore.cs,
3462         * enum.cs,
3463         * expression.cs,
3464         * flowanalysis.cs,
3465         * iterators.cs,
3466         * literal.cs,
3467         * location.cs,
3468         * modifiers.cs,
3469         * namespace.cs,
3470         * parameter.cs,
3471         * pending.cs,
3472         * report.cs,
3473         * rootcontext.cs,
3474         * statement.cs,
3475         * support.cs,
3476         * tree.cs,
3477         * typemanager.cs: Updated.
3478         
3479         * class.cs: (MethodCore.SetYields): Moved here to share.
3480         (PropertyMethod.Define): Moved iterator setup here.
3481         
3482         * iterators.cs: Add orig_method to have full access to parent
3483         container.
3484
3485 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3486
3487         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3488         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3489         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3490         variable of struct type.
3491         * expression.cs (Unary.ResolveOperator): Update to change.
3492         (Indirection.VerifyFixed): Likewise.
3493         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3494         (ParameterReference.VerifyFixed): Value parameters are fixed.
3495         (This.VerifyFixed): Treat 'this' as a value parameter.
3496         * statement.cs (LocalInfo.IsFixed): Remove.
3497
3498 2005-07-01  Martin Baulig  <martin@ximian.com>
3499
3500         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3501         `ec.EmitThis ()' to get the correct scope.
3502
3503 2005-07-01  Martin Baulig  <martin@ximian.com>
3504
3505         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3506         instance is a ParameterReference; fixes #75299.
3507
3508 2005-07-01  Martin Baulig  <martin@ximian.com>
3509
3510         Reverted Marek's latest patch (r46725):
3511         - it contains structural changes which are neither mentioned in
3512           the ChangeLog nor explained anywhere; for example the additional
3513           argument of EmitContext's and Iterator's .ctor's and the
3514           TypeContainer.DefineMembers() change.
3515         - structural changes like this should go in in seperate patches
3516           and not be hidden in a huge patch which just seems to affect
3517           warnings and errors.
3518           a big and hard to understand patch.
3519         - it breaks iterators and causes regressions, for instance in
3520           test-iter-03.cs.      
3521
3522 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3523
3524         Fix #75412.
3525         * expression.cs (Indexers.map): Remove.
3526         (Indexers.Append): Filter out inaccessible setters and getters.
3527         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3528
3529         Fix #75283.
3530         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3531         Refactored from ...
3532         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3533         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3534         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3535         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3536
3537 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3538
3539         Fix #75322
3540         * class.cs (FieldBase.GetInitializerExpression): One more field
3541         for backup.
3542
3543 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3544
3545         * pending.cs: Do not define a proxy if the base method is virtual,
3546         it will be picked up by the runtime (bug 75270).
3547
3548 2005-06-08  Martin Baulig  <martin@ximian.com>
3549
3550         The big Iterators rewrite :-)
3551
3552         * iterators.cs: Rewrite this to use the anonymous methods framework.
3553
3554         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3555         before the TypeContainers; see 2test-21.cs.
3556
3557         * class.cs
3558         (TypeContainer.DefineType): Don't create a new EmitContext if we
3559         already have one (this only happens if we're an Iterator).
3560         (TypeContainer.Define): Also call Define() on all our iterators.
3561         (Method.CreateEmitContext): Added support for iterators.
3562
3563         * anonymous.cs
3564         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3565         (AnonymousContainer.CreateMethodHost): Moved here from
3566         AnonymousMethod and made abstract.
3567         (AnonymousContainer.CreateScopeType): New abstract method.
3568         (AnonymousContainer.IsIterator): New public property.
3569         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3570         get the ScopeTypeBuilder rather than manually defining it here. 
3571         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3572         iterators here.
3573
3574         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3575         before RootContext.DefineTypes().
3576
3577         * codegen.cs (EmitContext.RemapToProxy): Removed.
3578         (EmitContext.CurrentAnonymousMethod): Changed type from
3579         AnonymousMethod -> AnonymousContainer.
3580         (EmitContext.ResolveTopBlock): Protect from being called twice.
3581         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3582         (EmitContext.EmitThis): Removed the iterators hacks; use the
3583         anonymous methods framework for that.
3584
3585         * statement.cs
3586         (ToplevelBlock.Container): Make this a property, not a field.
3587         (ToplevelBlock.ReParent): New public method; move the
3588         ToplevelBlock into a new container.
3589         (Foreach.TemporaryVariable): Simplify.
3590
3591 2005-06-05  Martin Baulig  <martin@ximian.com>
3592
3593         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3594         (Block.AddTemporaryVariable): New public method; creates a new
3595         `LocalInfo' for a temporary variable.
3596         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3597         variables here.
3598         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3599         non-iterator variables.
3600
3601 2005-06-05  Martin Baulig  <martin@ximian.com>
3602
3603         * statement.cs (Foreach.TemporaryVariable): Create the
3604         LocalBuilder in the Emit phase and not in Resolve since in some
3605         situations, we don't have an ILGenerator during Resolve; see
3606         2test-19.cs for an example.
3607
3608 2005-06-04  Martin Baulig  <martin@ximian.com>
3609
3610         **** Merged r45395 from GCS ****
3611
3612         The big Foreach rewrite - Part II.
3613
3614         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3615         with `PropertyInfo ienumerator_getcurrent'.
3616
3617         * codegen.cs (VariableStorage): Removed.
3618
3619         * statement.cs
3620         (Foreach): Derive from Statement, not ExceptionStatement.
3621         (Foreach.CollectionForeach): New nested class.  Moved all the code
3622         dealing with collection foreach here.
3623         (Foreach.ForeachHelperMethods): Removed.
3624         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3625
3626 2005-05-23  Martin Baulig  <martin@ximian.com>
3627
3628         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3629         don't need to.  Fix #75014.
3630
3631 2005-05-20  Martin Baulig  <martin@ximian.com>
3632
3633         Merged r44808 from GMCS.
3634
3635         * class.cs (TypeContainer.CircularDepException): Removed.
3636         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3637         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3638         (CS0146) and interface (CS0529) dependencies here.
3639
3640 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3641
3642         * expression.cs (Invocation.EmitCall): Fix initialization
3643         'this_call' to reflect current behaviour.  Fix indentation.
3644
3645         * convert.cs (FindMostEncompassedType): Add two trivial special
3646         cases (number_of_types == 0 || number_of_types == 1).
3647         (FindMostEncompasingType): Likewise.
3648
3649 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3650
3651         Some cleanups preparing for the fix of #75283.
3652         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3653         error testing.
3654         (EventExpr.InstanceResolve): Likewise.
3655         (EventExpr.DoResolve): Remove redundant checks.
3656
3657 2005-06-10  Duncan Mak  <duncan@novell.com>
3658
3659         * cs-tokenizer.cs (process_directives): New flag for controlling
3660         the processing of preprocessor directives.
3661         (x_token): After seeing a '#', return Token.NONE instead of going
3662         to handle_preprocessing_directive() when not processing
3663         directives. This avoids unnecessary processing during the token peek in
3664         is_punct().
3665
3666         This fixes #74939.
3667
3668         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3669         the existing error reporting methods instead of Report.Error.
3670
3671         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3672         after Raja's rewrite.
3673
3674 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3675
3676         * class.cs: Small fix.
3677
3678 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3679
3680         Fix #75160.
3681         * class.cs (GetPartialBases): Fix return value check of
3682         part.GetClassBases.
3683
3684 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3685
3686         Ensure that partial classes are registered in their enclosing
3687         namespace.  Initial part of fix of #75160.
3688         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3689         Register declspace with namespace here, not in
3690         DeclSpace.RecordDecl.
3691         * cs-parser.jay: Pass namespace to RecordDecl.
3692         * class.cs (PartialContainer.Create): Likewise.
3693         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3694         called.
3695         * decl.cs (Declspace.RecordDecl): Remove.
3696         * namespace.cs (NamespaceEntry.DefineName): Remove.
3697
3698 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3699
3700         * rootcontext.cs: Reset TargetExt as well.
3701
3702 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3703
3704         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3705         -langversion:ISO-1.
3706
3707 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3708
3709         Fix #75080, cs0119.cs.
3710         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3711         of ...
3712         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3713         allowing ExprClass.Type and ExprClass.Namespace for
3714         ResolveFlags.VariableOrValue.
3715         (Expression.Resolve) [1-argument variant]: Change default resolve
3716         flags based on language version.
3717         (Expression.Error_UnexpectedKind): Use a simple string array
3718         rather than an ArrayList.
3719         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3720         not ExprClass.Type.
3721         (TypeOfVoid.DoResolve): Likewise.
3722         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3723         flags argument -- it always has the same value.
3724
3725 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3726
3727         Fix #75081.
3728         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3729         Use it in the error message.
3730         * assign.cs, expression.cs, statement.cs: Update.
3731
3732 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3733
3734         Fix #75088.
3735         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3736         the "almostMatchedMember" case too.
3737         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3738         that failed the accessibility checks to 'almost_match'.
3739
3740 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3741
3742         * attribute.cs: Use internal MethodBuilder methods to set
3743         ExactSpelling and SetLastError on PInvoke methods, instead
3744         of passing them via charset.  Fixes #75060.
3745
3746 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3747
3748         * parameter.cs (Parameter): Remove TODO comment.
3749         (Parameter.DefineParameter): Remove Location parameter.
3750         (Parameters.LabelParameters): Likewise.
3751         * class.cs (Constructor.Emit): Update to change.
3752         (MethodData.Emit): Likewise.
3753         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3754         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3755
3756 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3757
3758         * parameter.cs,
3759           Removed Parameters.Location and added Parameter.Location instead.
3760           Removed Location parameter from Emit() and GetSignature().
3761         * anonymous.cs,
3762           class.cs,
3763           cs-parser.jay,
3764           delegate.cs,
3765           iterators.cs,
3766           statement.cs :
3767           Modified all related calls.
3768
3769 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3770
3771         Improve user-defined conversion handling.
3772         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3773         applicable operators.
3774         (AddConversionOperators): New.  Helper for GetConversionOperators.
3775         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3776         there is only one most encompassed/encompassing type.
3777         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3778         "applicable operator" handling.
3779         (UserConversion): Move cache here from GetConversionOperators.
3780         Directly cache the chosen operator, rather than the whole
3781         MethodGroup.
3782         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3783         case.  Allow conversion of decimal to sbyte and byte too.
3784         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3785         New static methods.  Used to avoid allocating EmptyExpressions in
3786         convert.cs.
3787
3788 2005-05-24  Duncan Mak  <duncan@novell.com>
3789
3790         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3791         another class, used in Convert.ExplicitNumericConversion.
3792         (CastToDecimal): New class, similar to above, but casts to
3793         System.Decimal, used in Convert.ImplicitNumericConversion and also
3794         in explicit convesion from double/float to decimal.
3795
3796         * convert.cs (ImplicitNumericConversion): Handle implicit
3797         conversions to System.Decimal.
3798         (ExplicitNumericConversion): handle explicit conversions to
3799         System.Decimal.
3800
3801         This fixes #68711.
3802         
3803 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3804
3805         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3806         know the type at this stage, just break through.   Fixes #75008 
3807
3808 2005-05-19  Martin Baulig  <martin@ximian.com>
3809
3810         * delegate.cs
3811         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3812         to disable error reporting.
3813
3814         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3815         here since we don't want to report an error; see the new test-336.cs.
3816
3817 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3818
3819         * statement.cs (ToplevelBlock.GetParameterReference)
3820         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3821         Move here from class Block.
3822         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3823         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3824
3825 2005-05-18  Martin Baulig  <martin@ximian.com>
3826
3827         Fix #74978.
3828
3829         * flowanalysis.cs
3830         (FlowBranching.Reachability): Add non-static public And() and Or()
3831         methods.
3832         (FlowBranchingSwitch): New class; do the `break_origins' thing
3833         like in FlowBranchingLoop.
3834         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3835         reachability, not just locals and parameters.
3836         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3837         switch; MergeBreakOrigins() now takes care of that.
3838
3839 2005-05-18  Martin Baulig  <martin@ximian.com>
3840
3841         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3842         a loop and may leave it, reset the barrier; fixes #74974.
3843
3844 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3845         
3846         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3847         is back.
3848         
3849         * cs-parser.jay: Catch more lexical errors.
3850         
3851         * report.cs: Add one more Error method.
3852         
3853         * rootcontext.cs,
3854         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3855
3856 2005-05-17  Martin Baulig  <martin@ximian.com>
3857
3858         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3859         #70970. 
3860
3861 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3862
3863         Fix test-382.cs.  Emit values of decimal constants.
3864         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3865         Carved out of ...
3866         (TypeContainer.AddField): ... this.
3867         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3868         with initializers to include 'Const's.
3869         (ClassPart.RegisterFieldForInitialization): Forward to
3870         PartialContainer.
3871         * const.cs (Const.Const): Pass initializer to base class.
3872         (Const.Define): In case of decimal constants, register them for
3873         initialization in a static constructor.
3874
3875 2005-05-14  Martin Baulig  <martin@ximian.com>
3876
3877         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3878         do not call ResolveUnreachable() on unreachable statements in
3879         here, see the comment in the source code.
3880
3881 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3882
3883         Fix #74934.
3884         * expression.cs (BinaryResolveOperator): If one of the operands of
3885         an equality comparison is 'null' and the other is a pointer type,
3886         convert the null to a NullPointer.
3887         * convert.cs (ImplicitReferenceConversion): If the expression is a
3888         NullLiteral and the target type is a pointer type, return a
3889         NullPointer instead.
3890         (ImplicitConversionStandard): Likewise.
3891
3892 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3893         
3894         * cs-parser.jay: Set readonly context based on special constructs.
3895         
3896         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3897         readonly variable error handling.
3898         
3899         * rootcontext.cs (EmitCode): Don't verify members when error
3900         occurred.
3901         
3902         * statement.cs (LocalInfo): Add reaodnly context information.
3903         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3904
3905 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3906
3907         * statement.cs (Block.Resolve): Revert change below.  Modify fix
3908         for #74041 to initialize 'resolved' to false only for explicit
3909         blocks.  Fixes #74873.
3910
3911 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3912
3913         Fix #74920.
3914         * typemanager.cs (unmanaged_enclosing_types): New.
3915         (IsUnmanagedType): Avoid infloops by using
3916         'unmanaged_enclosing_types' to talk with recursive invocations.
3917
3918 2005-05-13  Martin Baulig  <martin@ximian.com>
3919
3920         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3921         instance variable, not a local.  Fix #74873.
3922         (Block.ResolveUnreachable): Set it to true here.
3923
3924 2005-05-11  Duncan Mak  <duncan@novell.com>
3925
3926         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3927         continuing to process for 'arg'.
3928         (handle_preprocessing_directive): Check the argument of the #endif
3929         directive and report error CS1025 if there are any trailing
3930         characters.
3931
3932         According to the C# spec, having even whitespace after the #endif
3933         directive is illegal; however, because we call arg.TrimEnd ()
3934         beforehand, we have the same behavior as csc, allowing whitespace
3935         after the directive.
3936
3937         Fixes #74892.
3938
3939 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3940
3941         Fix #74863.
3942         
3943         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3944         (Constructor.GetObsoleteAttribute): Implemented correctly.
3945
3946 2005-05-10  Martin Baulig  <martin@ximian.com>
3947
3948         * support.cs (ReflectionParameters.ParameterModifier): Use
3949         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3950         and `ParameterAttributes.In'.  Fixes #74884.
3951
3952 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3953
3954         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3955         
3956         * expression.cs (Argument.GetParameterModifier): Turned to property.
3957         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3958         
3959         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3960         its C# equivalent.
3961         
3962 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3963
3964         Fix #74852.
3965         * decl.cs (MemberCache.AddMethods): Register override methods,
3966         rather than non-override methods.
3967         * typemanager.cs (RegisterOverride): New.
3968         (IsOverride): Update.
3969
3970 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3971
3972         Fix #73105.
3973         
3974         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3975         recursive declaration.
3976         
3977         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3978         
3979 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3980
3981         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3982         
3983         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3984
3985 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3986
3987         Fix #74797.
3988         * decl.cs (DeclSpace.FamilyAccessible): 
3989         Use TypeManager.IsNestedFamilyAccessible.
3990
3991         Fix reopened #64812.
3992         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3993         internal'.
3994
3995 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3996             Abin Thomas  <projectmonokochi@rediffmail.com>
3997             Anoob V E  <projectmonokochi@rediffmail.com>
3998             Harilal P R  <projectmonokochi@rediffmail.com>
3999
4000         Fix #64812.
4001         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4002         allow access to all static members.
4003
4004 2005-05-04  Martin Baulig  <martin@ximian.com>
4005
4006         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4007
4008 2005-05-04  Martin Baulig  <martin@ximian.com>
4009
4010         Fix #74655.
4011
4012         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4013         section at the end; make things work if `default' is not the last
4014         section.        
4015
4016 2005-05-04  Martin Baulig  <martin@ximian.com>
4017
4018         Fix #70400.
4019
4020         * statement.cs (Switch): Replaced the `got_default' field with a
4021         `default_section' one.
4022         (Switch.CheckSwitch): Set `default_section' here.
4023         (Switch.Resolve): If we're a constant switch and the constant is
4024         not found, use the default section.
4025
4026 2005-05-03  Martin Baulig  <martin@ximian.com>
4027
4028         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4029
4030         * statement.cs (Foreach.ArrayForeach): New nested class.
4031         (Foreach.TemporaryVariable): New nested class.
4032         (Foreach.EmitArrayForeach): Removed; this is now in the new
4033         ArrayForeach class.
4034
4035 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4036
4037         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4038         more conservative.
4039         (VerifyPendingMethods): Revert change below.
4040
4041         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4042         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4043         that used to trigger warning -28.  Remove warning -28.
4044         * expression.cs (Invocation.OverloadResolve): Use
4045         TypeManager.IsOverride to distinguish override methods.
4046
4047         Fix #74773.
4048         * pending.cs (VerifyPendingMethods): If a base type implements the
4049         requested interface, don't bother checking individual methods of
4050         the base type.  As a side-effect, this prevents the creation of
4051         unnecessary proxies.
4052
4053 2005-05-02  Martin Baulig  <martin@ximian.com>
4054
4055         Fix #70182.
4056
4057         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4058         Also `And' the locals if the old vector is null.
4059         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4060         null; in this case we basically reset all the variables.        
4061
4062 2005-05-02  Martin Baulig  <martin@ximian.com>
4063
4064         Fix #74529.
4065
4066         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4067         Added `FlowBranching branching' argument; always `and' the
4068         variables instead of `or'ing them unless we're an infinite loop.
4069
4070         * statement.cs (While.Resolve): Create a new sibling unless we're
4071         infinite.       
4072
4073 2005-05-02  Martin Baulig  <martin@ximian.com>
4074
4075         Fix #70140.
4076
4077         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4078         arguments; use it instead of creating a new TopLevelBlock.
4079         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4080         our ConstructorInitializer.
4081
4082         * statement.cs
4083         (TopLevelBlock.TopLevelBranching): New public property.
4084         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4085         and create our `TopLevelBranching'.
4086
4087         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4088         anonymous method host, use `block.TopLevelBranching' rather than
4089         creating a new branching.
4090
4091 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4092
4093         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4094         a ScopeInfo, if any of the current children is a child of the new
4095         entry, move those children there.
4096
4097 2005-04-30  Martin Baulig  <martin@ximian.com>
4098
4099         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4100         at the beginning of a SwitchSection.  Fix #73335.
4101
4102 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4103
4104         Fix #74378
4105         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4106         
4107         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4108         (FieldExpr.DoResolve): Obsolete members are ignored for field
4109         initializers.
4110         
4111 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4112
4113         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4114         of arrays detection.
4115
4116         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4117         verification.
4118         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4119
4120         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4121         arrays report.
4122
4123 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4124
4125         * cs-parser.jay: Use the prefered version of -unsafe in error
4126         message.
4127
4128 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4129
4130         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4131         circumstances.
4132
4133 2005-04-20  John Luke  <john.luke@gmail.com>
4134
4135         * driver.cs: fix typo in error message, --outout to --output
4136
4137 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4138
4139         * codegen.cs (InRefOutArgumentResolving): New field.
4140         
4141         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4142         fields outside contructor.
4143         
4144         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4145         
4146 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4147
4148         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4149         parameter code was not completed ever, so it was not as up-to-date
4150         as local variables.  Must finish it.
4151
4152         The bug fix was to compare the Toplevel of the block, not the
4153         current block.  Thanks for Ben for pointing this out. 
4154
4155 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4156
4157         * decl.cs (AddMethods): Use the declaring type of the problem
4158         method to determine if we want to squash a warning.
4159
4160 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4161
4162         * attribute.cs: Removed debug output.
4163
4164         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4165         
4166         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4167         Report.Stderr.
4168         
4169 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4170
4171         Fix #74481.
4172         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4173         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4174         all null comparisons against reference types.
4175
4176 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4177
4178         Fix# 74565
4179         * class.cs (TypeContainer.CircularDepException) New nested
4180         exception class.
4181         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4182         (TypeContainer.DefineType): Removed error, reset InTransit before
4183         exit.
4184         (Class.DefineType): Throw exception when is in Transit.
4185         Catch exception and report error.
4186         (Struct.DefineType): Throw exception when is in Transit.
4187         Catch exception and report error.
4188         (Interface.DefineType): Throw exception when is in Transit.
4189         Catch exception and report error.
4190
4191         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4192         handle nested exception handlers.
4193
4194         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4195         a catch.
4196
4197         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4198         InFinally and InCatch storage.
4199
4200         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4201         (Catch.Resolve): Set and Restore ec.InCatch.
4202         (Try.Resolve): Set and Restore ec.InFinally.
4203         (Try.HasCatch): True when try has catch.
4204
4205 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4206
4207         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4208           for the same event member, so exclude such cases from warning 419.
4209           Fixed bug #74633.
4210
4211 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4212
4213         * expression.cs (Binary.ResolveOperator): Apply patch from John
4214         Luke to fix bug 59864: operators &, | and ^ on enumerations
4215         require that the same enum type on both sides.
4216
4217         * driver.cs: Add warnings to old flag usage, this is to assist
4218         people who produce Makefiles and hope that the Makefiles will be
4219         used on Windows.
4220
4221         * class.cs (TypeContainer.EmitType): Moved the definition of the
4222         special $PRIVATE$ field from the resolve phase to the Emit phase.
4223         During resolve we do not know if we are a struct with
4224         HasExplicitLayout, we know this only after the attributes for the
4225         type are emitted.
4226
4227         Set the FieldOffset to zero on the dummy field that we create for
4228         the class.   Fixes 74590.
4229
4230 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4231
4232         Fix #73834.
4233         * ecore.cs (PropertyExpr.resolved): New.
4234         (DoResolve): Use it to handle a case of double resolution here.
4235         Handle a case of identical-name-and-type-name.
4236         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4237         resolution by storing the results of expression resolution back
4238         into the "probes" array.
4239
4240 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4241
4242         Fix cs0208-7.cs and cs0208-8.cs.
4243         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4244         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4245         error reporting to point out the reason a struct is not unmanaged.
4246
4247 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4248
4249         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4250           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4251
4252 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4253
4254         Fix #74528.
4255         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4256         IdenticalNameAndTypeName here.
4257         (EventExpr.InstanceResolve): Likewise.
4258
4259 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4260
4261         C# 2.0 DefaultCharSetAttribute implementation
4262         
4263         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4264         which allows us to set GlobalNamespace for every resolve.
4265         (Attribute.ResolveArguments): Cut from Resolve.
4266         (Attribute.GetCharSetValue): Returns CharSet named argument.
4267         (Attribute.DefinePInvokeMethod): Gets default charset from
4268         module settings.
4269         (GlobalAttribute.ResolveAsTypeStep): Override.
4270         (GlobalAttribute.ResolveArguments): Override.
4271         
4272         * class.cs (TypeAttr): Is protected.
4273         
4274         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4275         (ModuleClass.DefaultCharSetType): New memeber.
4276         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4277         
4278         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4279         charset from module.
4280         
4281         * delegate.cs (TypeAttr): Override.
4282         (Delegate.DefineType): Use this TypeAttr.
4283         
4284         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4285         at very early stage (before types are defined) to resolve model
4286         module attributes. It will probably not work with corlib but it
4287         should be ok.
4288         
4289         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4290         charset from module.
4291         
4292         * typemanager.cs (default_charset_type): New type.
4293
4294 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4295
4296         * decl.cs (MemberCache.AddMethods): Don't warn if
4297         System.Object.Finalize has buggy MethodAttributes.
4298
4299         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4300         removed below.
4301
4302 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4303
4304         * doc.cs : detect ambiguous reference to overloaded members.
4305           Fixed bug #71603. MS 1.1 csc does not detect it.
4306
4307 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4308
4309         * doc.cs : delegates must not be referenced with parameters.
4310           Fixed bug #71605.
4311
4312 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4313
4314         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4315
4316 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4317
4318         * driver.cs (MainDriver): Stop processing if the CLS stage found
4319         errors. 
4320
4321         (CompilerCallableEntryPoint.InvokeCompiler): Always
4322         reset after execution;   Take a TextWriter argument for the
4323         output.
4324
4325         * report.cs: Use the error stream instead of hardcoding stderr. 
4326
4327 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4328
4329         * class.cs: Reduce code paths to test, too small of an
4330         optimization to make it worth the extra testing.  Always perform
4331         it. 
4332
4333 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4334
4335         Fix #74510.
4336         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4337         operators that had errors reported on them.
4338
4339 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4340
4341         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4342         argument types.
4343         (Attribute.Resolve): Add named argument type checking.
4344         
4345         * class.cs (FixedField.Define): Use IsPrimitiveType
4346         
4347         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4348         
4349         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4350         unsafe parameter types.
4351         
4352         * statement.cs (Using.ResolveExpression): Add better error description.
4353         
4354         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4355         
4356 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4357
4358         Fix #74484.
4359         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4360         AttributeUsageAttribute in the emitcontext of the attribute class,
4361         not in the emitcontext of the attributable entity it was attached to.
4362         * cs-parser.jay: Use 'current_class', not 'current_container',
4363         when creating a GlobalAttribute.
4364
4365 2005-04-08  Alp Toker  <alp@atoker.com>
4366
4367         * pending.cs: The fix to #58413 failed to compile methods implementing
4368         interfaces with/without params modifiers and vice versa, even though
4369         params modifiers aren't part of the signature. Make the modifier check
4370         less strict as in csc.
4371
4372 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4373             Anoob V E  <projectmonokochi@rediffmail.com>
4374             Harilal P R  <projectmonokochi@rediffmail.com>
4375
4376         Fix #58413.
4377         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4378         modifiers of pending methods.
4379         (PendingImplementation.PendingImplementation): Initialize it.
4380         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4381         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4382         with ParameterData.  Add check for modifiers.
4383         * class.cs (MethodData.Define): Update to changes.
4384
4385 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4386
4387         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4388
4389 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4390
4391         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4392         property.
4393         
4394         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4395         
4396         * rootcontext.cs,
4397         * typemanager.cs: Registered RequiredAttributeAttribute.
4398         
4399 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4400
4401         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4402         Warning CS0169 is back at level 3.
4403         (IMethodData.SetMemberIsUsed): New method.
4404         
4405         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4406         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4407         
4408         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4409
4410         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4411         contants.
4412         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4413         is used.
4414         
4415         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4416         is used.
4417         
4418         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4419         to avoid the problems with nested types.
4420
4421 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4422             Anoob V.E  <projectmonokochi@rediffmail.com>
4423             Harilal P.R  <projectmonokochi@rediffmail.com>
4424             Raja R Harinath  <rharinath@novell.com>
4425
4426         Fix #73820.
4427         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4428         attribute.
4429         * typemanager (GetConstructor): Make public.
4430
4431 2005-04-05  John Luke  <john.luke@gmail.com>
4432             Raja R Harinath  <rharinath@novell.com>
4433
4434         Fix #62232.
4435         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4436         struct too.  Return false quicker in a few cases.
4437         (VerifyUnManaged): Use it.
4438
4439 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4440
4441         Fix #74041.
4442         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4443         not 'unreachable_seen'.
4444
4445 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4446
4447         * attribute.cs (Attribute.GetValue): Removed unused.
4448         
4449         * codegen.cs (CodeGen.TrimExt): Removed unused.
4450         
4451         * cs-parser.jay (output): Removed unused.
4452         
4453         * cs-tokenizer.cs (hex_digits): Removed unused.
4454         
4455         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4456         
4457         * expression.cs (Indirection.LoadExprValue): Removed unused.
4458         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4459         
4460         * iterators.cs (Iterator.param_types): Removed unused.
4461         
4462         * statement.cs (Goto.block): Removed unused.
4463         (ToplevelBlock.did): Removed unused.
4464         (Switch.ResolveConstantSwitch): Removed unused.
4465
4466 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4467
4468         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4469         resetting thingy.
4470
4471 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4472
4473         Fix #74232 and cs0208-3.cs.
4474         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4475         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4476         unmanaged type.  Don't use FieldBuilders when 't' is a
4477         TypeBuilder.  Use ModFlags and MemberType fields.
4478         * class.cs (MemberBase.member_type): Rename from MemberType.
4479         (MemberBase.MemberType): New property.  Determines member_type on
4480         demand.
4481         (MemberBase.DoDefine): Don't initialize MemberType here.
4482         (FieldMember.Define): Likewise.
4483
4484 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4485
4486         Fix #74241
4487         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4488         Attributes are emitted there.
4489         
4490 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4491
4492         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4493         keyword in 'partial enum' too.
4494         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4495         is not allowed).
4496         Report from Kamil Skalski <nazgul@omega.pl>.
4497
4498         Fix #74309.
4499         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4500         have partial containers too.
4501
4502         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4503         in block' checks to Block.CheckInvariantMeaningInBlock.
4504         * statement.cs (Block.GetKnownVariableInfo): Make private.
4505         (Block.IsVariableUsedInChildBlock): Remove.
4506         (Block.IsVariableUsedInBlock): Likewise.
4507         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4508         conflicting declaration.
4509         (Block.AddVariable): Make error messages less long-winded and more
4510         specific.  Show location of conflicting declaration.
4511         * parameter.cs (Parameters.Location): New readonly property.
4512
4513 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4514
4515         Clean up semantics of invoking ResolveMemberAccess.
4516         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4517         can have an instance, ensure that we pass in a non-TypeExpression
4518         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4519         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4520         argument.  Update to changes and simplify.
4521         (FieldExpr.Emitinstance): Remove CS0120 check.
4522         (PropertyExpr.EmitInstance): Likewise.
4523         * expression.cs (Argument.Resolve): Likewise.
4524         (Invocation.DoResolve): Update to changes in semantics of
4525         InstanceExpression.
4526
4527 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4528
4529         Fix #74241
4530         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4531         customization.
4532         
4533         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4534
4535 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4536
4537         Fix difference in behaviour with commandline invocation.
4538         * driver.cs (Driver.Reset): New.
4539         (CompilerCallableEntryPoint): Call it.
4540
4541         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4542         variable" warnings if the boolean expression failed to resolve.
4543
4544 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4545
4546         * attribute.cs: Fix the union of several permissions when some of them
4547         are unrestricted (so the result isn't an unrestricted permission set).
4548         Fix #74036.
4549
4550 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4551
4552         * ecore.cs (MemberExpr): New class.  Convert from interface
4553         IMemberExpr.
4554         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4555         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4556         error checks.
4557         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4558         (MethodGroupExpr.IsExplicitImpl): Remove.
4559         (Expression.GetFieldFromEvent): Remove.
4560         (SimpleName.MemberStaticCheck): Remove.
4561         (SimpleName.DoSimpleNameResolve): Update to changes.
4562         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4563         (MemberAccess.IdenticalNameAndTypeName): Remove.
4564         (MemberAccess.error176): Move to MemberExpr.
4565         (MemberAccess.DoResolve): Update to changes.
4566         (BaseAccess.DoResolve): Likewise.
4567
4568 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4569
4570         C# 2.0 Conditional attribute class implementation
4571         
4572         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4573         Analyzes class whether it has attribute which has ConditionalAttribute
4574         and its condition is not defined.
4575         
4576         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4577         (Class.IsExcluded): New method. Search for at least one defined
4578         condition in ConditionalAttribute of attribute class.
4579
4580 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4581
4582         * ecore.cs (PropertyExpr): Derive from Expression, not
4583         ExpressionStatement.
4584         (PropertyExpr.EmitStatement): Remove.
4585
4586 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4587
4588         Fix #74060.
4589         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4590         internal field "value__" of an enum be private.  The examples for
4591         "value__" that I found on MSDN all used FieldAttributes.Private.
4592
4593         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4594         Don't mention IL method attribute names.
4595
4596         Fix #47991.  Remove a TODO.
4597         * statement.cs (Block.Toplevel): Make into a field.
4598         (Block.Parameters): Move into ToplevelBlock.
4599         (Block.known_variables): Rename from child_variable_names.
4600         (Block.Block): Remove variants that take Parameters.  Initialize
4601         'Toplevel' with the immediately surrounding toplevel block.
4602         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4603         LocalInfo parameter.
4604         (Block.GetKnownVariableInfo): New.
4605         (Block.IsVariableNameUsedInChildBlock): Update.
4606         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4607         the block, even though it may not be in scope.
4608         (Block.AddVariable): Remove Parameters parameter.  Use
4609         Toplevel.Parameters instead.
4610         (Block.AddConstant): Remove Parameters parameter.
4611         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4612         (Block.IsParamaterReference): Likewise.
4613         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4614         (ToplevelBlock.Parameters): New.  Moved from Block.
4615         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4616         initialize Parameters to a non-null value.
4617         * cs-parser.jay: Update to changes.
4618         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4619         simple names that mean different things in the same block.  Use
4620         Block.IsVariableNameUsedInBlock.
4621
4622 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4623
4624         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4625         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4626         GetTypeHandle.  It is possible for a reflected type to derive from
4627         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4628         System.Array during mscorlib compilation).
4629         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4630         contain a method_hash, don't create one either.  Don't create a
4631         deep copy of the base cache's method_hash.
4632         (MemberCache.SetupCache): Rename back from DeepCopy.
4633         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4634         already initialized.  If we see an override function, add its
4635         underlying base virtual function to the member_hash too.
4636
4637         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4638
4639 2005-03-26  Raja R Harinath  <harinath@acm.org>
4640
4641         Fix #73038.
4642         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4643         fails to resolve, ensure that the LHS is still resolved as an
4644         lvalue.
4645
4646 2005-03-25  Raja R Harinath  <harinath@acm.org>
4647
4648         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4649         ec.ContainerType.
4650         (Enum.current_ec): Remove.
4651         (Enum.LookupEnumValue): Remove EmitContext argument.
4652         Just uses the one created during DefineType.
4653         (Enum.FindMembers): Update.
4654         * expression.cs (MemberAccess.DoResolve): Update.
4655
4656 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4657
4658         * assign.cs (Assign.DoResolve): Check for CS1717 when
4659         source and target are same (uses Equals).
4660
4661         * expression.cs (LocalVariableReference, ParameterReference,
4662         This): Implemented Equals, GetHashCode.
4663
4664         * statement.cs (Block.GetParameterReference): Removed useless
4665         local variable.
4666
4667 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4668
4669         Fix cs0128.cs
4670         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4671         blocks before deciding whether the error is cs0136 or cs0128.
4672
4673         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4674         (using_alias_directive, using_namespace_directive): Pass
4675         MemberName, not an expression to Namespace.UsingAlias and
4676         Namespace.Using.
4677         (MakeName): Use the MemberName of the namespace.
4678         * namespace.cs (Namespace.MemberName): New.
4679         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4680         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4681         Likewise.
4682         * decl.cs (MemberName.Name): Make readonly.
4683         (MemberName.FromDotted): New "constructor".
4684         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4685         (MemberCore.Name): Compute from MemberName on demand.
4686         (MemberCore.SetMemberName): Provide a way to change the
4687         MemberName.
4688         (MemberCore.AddToContainer): Don't take a fullname parameter.
4689         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4690         fully qualified name of the container to the member name.
4691         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4692         only if the type is a member of the root container.
4693         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4694         MemberName.Left rather than searching for an embedded ".".
4695         (PartialContainer.CreatePart): Update to changes in RootContext.
4696         (MemberBase.ShortName): Turn into a property.  Use
4697         MemberCore.SetMemberName.
4698         (MemberBase.ExplicitInterfaceName): Remove.
4699         (MemberBase.UpdateMemberName): Remove.
4700         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4701         (PropertyBase.SetMemberName): New override.
4702         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4703         (Tree.GetDecl): New.
4704         (Tree.AllDecls): Rename from Decls.
4705         * attribute.cs, enum.cs, report.cs: Update to changes.
4706         * driver.cs (MainDriver): Use MemberName.FromDotted on
4707         RootContext.MainClass.
4708
4709 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4710
4711         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4712         checks.
4713
4714         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4715
4716 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4717
4718         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4719         property accessor modifiers.
4720
4721         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4722         fixed buffer attribute (CS1716).
4723         (PropertyMethod.HasCustomAccessModifier): When property accessor
4724         has custom modifier.
4725
4726         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4727         modifiers.
4728         (PropertyExpr.DoResolveLValue): Add CS0272.
4729
4730 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4731
4732         * convert.cs: When converting to a pointer, use the proper Conv.U
4733         or Conv.I depending on the source data type.
4734
4735         * cs-tokenizer.cs: Make the size for large decimal constants,
4736         fixes #72957.
4737
4738 2005-03-17  Martin Baulig  <martin@ximian.com>
4739
4740         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4741         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4742
4743 2005-03-17  Martin Baulig  <martin@ximian.com>
4744
4745         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4746         to bool so we can return an error condition.
4747         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4748         returned an error.
4749
4750 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4751
4752         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4753         attributes.
4754
4755 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4756
4757         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4758         Refactor to avoid traversing the list of assemblies, and to avoid
4759         string concatenation.
4760         * typemanager.cs (guid_attr_type): Remove.
4761         (negative_hits, pointers, references): Remove hashes.
4762         (type_hash): New.
4763         (GetConstructedType): New.  Uses type_hash to handle constructed
4764         types (arrays, references, pointers).
4765         (GetReferenceType, GetPointerType): Use it.
4766         (GetNestedType): New.  Uses type_hash to handle nested types of
4767         reflected types.
4768         (LookupType, LookupTypeDirect): Remove.
4769         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4770         'types' hash and LookupTypeReflection directly.
4771         (params_string, params_object): Use GetConstructedType.
4772         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4773         top-level types.
4774         (Namespace.Lookup): Use cached_types.
4775         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4776         provided by old TypeManager.LookupType.
4777         * rootcontext.cs (MakeFQN): Remove.
4778         * decl.cs (DeclSpace.MakeFQN): Likewise.
4779         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4780         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4781         TypeManager.GetConstructedType.
4782         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4783
4784 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4785
4786         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4787         indexers.
4788
4789         * cs-parser.jay: Reports CS1527 for any namespace element.
4790
4791         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4792         Added CS0407.
4793
4794         * expression.cs (ParameterReference.IsAssigned): Changed error to
4795         CS0269.
4796         (Error_WrongNumArguments): Moved CS0245 detection here.
4797
4798         * statement.cs (Return.Resolve): Add CS1622 report.
4799
4800 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4801
4802         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4803
4804 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4805
4806         * attribute.cs expression.cs: Get rid of some allocations.
4807
4808 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4809
4810         * doc.cs : just eliminate the latest change.
4811
4812 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4813
4814         * doc.cs : commented out the latest change. It breaks xml-030.cs
4815
4816 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4817
4818         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4819           fail. So invoke CreateType() in FindDocumentedType().
4820
4821 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4822
4823         * cs-tokenizer.cs : added IsKeyword().
4824         * doc.cs : Detect keyword incorrectly used as identifier.
4825           Allow identifiers prefixed by @.
4826
4827 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4828
4829         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4830         It caused exception in namespace resolving (again!).
4831         
4832         * class.cs (Class.ctor): Removed exit.
4833         (PropertyMethod.ctor): ditto.
4834         
4835         * codegen.cs (Codegen.Reset): Reset static data.
4836         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4837         
4838         * cs-tokenizer.cs (Cleanup): Removed.
4839         
4840         * driver.cs (GetSystemDir): Rewrote to one line command.
4841         It caused problem with unloaded dynamic modules.
4842         (UnixParseOption): Removed Exit.
4843         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4844         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4845         Now can be mcs used as library.
4846         
4847         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4848         empty location.
4849         
4850         * location.cs (Reset): Reset static data.
4851         
4852         * namespace.cs (Reset): Reset static data.
4853         
4854         * report.cs (Report.Reset): Reset static data.
4855         
4856         * rootcontext.cs (RootContext.Reset): Reset static data.
4857         
4858         * tree.cs (RootTypes.ctor): Use Location.Null
4859         
4860         * typemanager.cs (TypeManager.Reset): Reset static data.
4861         (CoreLookupType): Removed Exit.
4862         (TypeHandle.Reset): Reset static data.
4863         
4864 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4865
4866         Fix #73516.
4867         * typemanager.cs (ComputeNamespaces): Import namespaces from
4868         referenced modules too.
4869
4870 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4871
4872         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4873         than '.'.
4874
4875 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4876
4877         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4878         enclosing DeclSpace.  This ensures that a name-lookup populates
4879         more caches and there are fewer 'TypeExpression's.  Carve out
4880         nested type lookup into ...
4881         (LookupNestedTypeInHierarchy): ... this.
4882
4883 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4884
4885         Clean up a few partial-class semantics.  
4886         Fixes test-357.cs and cs1618-2.cs.
4887         * cs-parser.jay (struct_declaration): Use 'current_class' as
4888         parent of newly-created struct.  Remove call to Register ().
4889         Use 'pop_current_class' to complete handing the current struct.
4890         (interface_declaration): Likewise.
4891         (class_declaration): Likewise.
4892         (enum_declaration): Use 'current_class' as parent of newly created
4893         enum.
4894         (delegate_declaration): Likewise.
4895         (pop_current_class): New function.  This is used to handle closing
4896         up the 'current_class' and 'current_container', and pointing them
4897         to the enclosing class/container.
4898         (CSharpParser): Initialize 'current_class' too.
4899         * decl.cs (MemberCore): Add check for invariant: a partial
4900         container is not a parsed entity, and thus does not enclose any
4901         parsed members.
4902         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4903         (DeclSpace.BaseTypeExpr): Use it.
4904         (DeclSpace.LookupType): Add check for invariant.
4905         * class.cs (TypeContainer): Add check for invariant: a nested
4906         class should have the same NamespaceEntry as its enclosing class.
4907         (TypeContainer.EmitFieldInitializers): Make virtual.
4908         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4909         MemberCore.
4910         (TypeContainer.Register): Remove.
4911         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4912         null.  Use TypeResolveEmitContext for resolving base types and
4913         interfaces.  Move initialization of Parts.TypeBuilder here from
4914         ...
4915         (TypeContainer.DefineNestedTypes): ... here.
4916         (PartialContainer): Take a Namespace not a NamespaceEntry.
4917         (PartialContainer.Create): Don't use Register.  Call the
4918         appropriate Add... function directly.
4919         (ClassPart): Take both the PartialContainer and the enclosing
4920         class as constructor arguments.
4921         (ClassPart.EmitFieldInitializers): Override.
4922         (ClassPart.PartFindNestedTypes): Remove.
4923         (FieldBase.GetInitializerExpression): Resolve the initializer
4924         expression in the emit context of the enclosing class.
4925         * tree.cs (RootTypes): Remove Register ().
4926         
4927 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4928
4929         * cs-parser.jay: Removed CS0134.
4930         
4931         * driver.cs: Removed CS1901.
4932         
4933         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4934         for predefined types.
4935
4936 2005-03-07  Duncan Mak  <duncan@novell.com>
4937
4938         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4939         well. Fixes bug #73454.
4940
4941 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4942
4943         * cs-tokenizer.cs (xtoken): Add CS1035.
4944         
4945         * class.cs (MethodData.Define): Add CS0683.
4946         (FieldMember.ctor): Add CS0681.
4947
4948 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4949
4950         * ecore.cs (SimpleName.DoResolve): Rename from
4951         SimpleName.DoResolveAllowStatic.
4952         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4953         Pass 'intermediate' flag to MemberStaticCheck.
4954         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4955         of "intermediate" lookups via MemberAccess.
4956         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4957         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4958
4959 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4960
4961         Fix #73394.
4962         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4963         slipped in because of variable names that are identical to a
4964         builtin type's BCL equivalent ('string String;', 'int Int32;').
4965         (PropertyExpr.EmitInstance): Likewise.
4966
4967 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4968
4969         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4970         
4971         * report.cs (warning_ignore_table): Made public.
4972
4973 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4974
4975         Fix #73282.
4976         * class.cs (MethodData.Emit): Pass 'container' to
4977         container.GetObsoleteAttribute instead of 'container.Parent'.
4978
4979 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4980
4981         * cs-parser.jay: Add 1534 error test.
4982
4983         * iterators.cs (Yield.CheckContext): Add error 1629.
4984         (Iterator.ctor): Save unsafe modifier.
4985         (MoveNextMethod.DoEmit): Restore unsafe context.
4986
4987         * namespace.cs (UsingAlias): Better error message.
4988
4989 2005-03-03  Dan Winship  <danw@novell.com>
4990
4991         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4992         the warning message [#73219]
4993
4994 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4995
4996         Fix compile with MCS 1.0.0.0.
4997         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4998         w_restore to not depend on string constant folding.
4999
5000 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5001
5002         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5003         CS0246 check to users who passed 'silent = false'.
5004         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5005         check.
5006         (SimpleName.SimpleNameResolve): Update.
5007         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5008         (MemberAccess.IdenticalNameAndTypeName): Update.
5009         * doc.cs (FindDocumentedTypeNonArray): Update.
5010
5011 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5012
5013         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5014         * parameters.cs (ComputeAndDefineParameters): Remove.
5015         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5016         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5017         Use GetParameterInfo.
5018
5019 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5020
5021         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5022
5023 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5024
5025         Unify DeclSpace.LookupType and DeclSpace.FindType.
5026         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5027         is in charge of defining nested types on demand.
5028         (DeclSpace.LookupType): Use it when the current_type is a
5029         TypeBuilder.  Use LookupTypeDirect for reflected types.
5030         (DeclSpace.FindType): Remove.
5031         (DeclSpace.LookupInterfaceOrClass): Likewise.
5032         (DeclSpace.DefineTypeAndParents): Likewise.
5033         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5034         DeclSpace.LookupType.
5035         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5036         * typemanager.cs (LookupType): Simplify.
5037         (AddUserType): Remove type from negative_hits.
5038         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5039         * class.cs (TypeContainer.FindMembers): Move handling of nested
5040         types ...
5041         (TypeContainer.FindMembers_NestedTypes): ... here.
5042         (TypeContainer.FindNestedType): Implement override.
5043         (ClassPart.FindNestedType): Delegate to PartialContainer.
5044         (ClassPart.PartFindNestedType): Looks up the nested types of the
5045         part alone.
5046
5047 2005-03-02  Martin Baulig  <martin@ximian.com>
5048
5049         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5050         static constructor in static classes.
5051
5052 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5053
5054         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5055         sizeParamIndex is not specified.
5056
5057 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5058
5059         Fix #73117
5060         * report.cs (WarningMessage.IsEnabled): Missing null check.
5061
5062 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5063
5064         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5065         in the fields and not in the properties.
5066
5067 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5068
5069         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5070         fields as well.
5071
5072 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5073
5074         * attribute.cs: Small refactoring (improved robustness).
5075         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5076         (ValidateGuid): Removed.
5077         (Resolve): Removed referenced to above mentioned.
5078         (GetAttributeUsage): Made private and changed to work without
5079         class assistance.
5080         (GetIndexerAttributeValue): Don't crash.
5081         (GetConditionalAttributeValue): Ditto.
5082         (GetClsCompliantAttributeValue): Ditto.
5083         (ExtractSecurityPermissionSet): All attributes exceptions are
5084         error 648.
5085         (GetPropertyValue): New helper.
5086         (GetMethodImplOptions): New method.
5087         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5088         some missing properties.
5089         
5090         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5091         (Method.ApplyAttributeBuilder): Updated.
5092         
5093         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5094         exception.
5095
5096 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5097
5098         Fix #73052.
5099         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5100         non-simple types (array, pointer, reference).
5101
5102 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5103
5104         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5105
5106         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5107         for operators.
5108         (Method.CheckBase): Catch wrong destructor here.
5109         (MethodData.Define): Add errors 550, 668.
5110
5111         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5112
5113         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5114
5115         * pending.cs (VerifyPendingMethods): Add error 551.
5116
5117         * typemanager.cs (CSharpName): Next error report helper.
5118
5119 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5120
5121         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5122         attributes. Removed useless attribute double check.
5123         It saves almost 2MBs for corlib.
5124
5125 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5126
5127         Fix #72924.
5128         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5129         called twice in case of error.
5130
5131 2005-02-23  Chris Toshok  <toshok@ximian.com>
5132
5133         Fix compiler portions of #72827.
5134         * statement.cs (Block.Emit): call Begin/EndScope on the
5135         EmitContext instead of the ILGenerator.
5136
5137         * codegen.cs (EmitContext.BeginScope): new method, call
5138         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5139         we have one.)
5140         (EmitContext.BeginScope): same, but EndScope and CloseScope
5141
5142         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5143         offset and call the superclass's OpenScope(int) with it.
5144         (SymbolWriter.CloseScope): get the current il
5145         offset and call superclass's CloseScope(int) with it.
5146
5147 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5148
5149         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5150         CS1677 for out and ref as well.
5151
5152         * class.cs (Method.Define): Add error CS1599 detection.
5153         
5154         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5155         
5156         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5157         
5158         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5159         
5160         * support.cs.cs (ModifierDesc): New helper method.
5161
5162 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5163             Abin Thomas  <projectmonokochi@rediffmail.com>
5164             Anoob V E  <projectmonokochi@rediffmail.com>
5165             Harilal P R  <projectmonokochi@rediffmail.com>
5166
5167         Fix #57851, #72718.
5168         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5169         MemberLookup (used for error reporting) actually returns a result.
5170         Fix error report number (122, not 112).
5171
5172 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5173             Anoob V E  <projectmonokochi@rediffmail.com>
5174             Harilal P R  <projectmonokochi@rediffmail.com>
5175
5176         Fix #71134.
5177         * pending.cs (PendingImplementation.GetAbstractMethods):
5178         Find NonPublic members too.
5179
5180 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5181
5182         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5183         Fixed error 217.
5184         
5185         * class.cs (MethodCore.CheckMethodAgainstBase):
5186         Add error 239 report.
5187
5188 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5189
5190         Fix #68955.
5191         * expression.cs (Invocation.IsApplicable): Make public.
5192         (Invocation.IsParamsMethodApplicable): Likewise.
5193         * delegate.cs (Delegate.VerifyApplicability): Don't use
5194         Invocation.VerifyArgumentCompat for parameter applicability
5195         testing.  Use Invocation.IsApplicable and
5196         Invocation.IsParamsMethodApplicable.
5197
5198 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5199
5200         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5201         
5202         * class.cs (Operator.Define): Add error 217 report.
5203         
5204 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5205
5206         * namespace.cs (UsingEntry.Resolve): Undo change below.
5207
5208 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5209
5210         Fix #72756.
5211         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5212         disable the error message when the extended MemberLookup also
5213         fails.
5214         (Expression.MemberLookupFinal): Update.
5215         (SimpleName.DoSimpleNameResolve): Update.
5216         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5217         Don't use MemberLookupFinal.
5218         (New.DoResolve): Update.
5219         (BaseAccess.CommonResolve): Update.
5220
5221 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5222
5223         Fix #72732.
5224         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5225         occured previously, don't resolve again.
5226
5227 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5228
5229         Fix #69949
5230         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5231         argument. Call ResolveAttributeUsage for unresolved.
5232         when types doesn't match ctor arguments.
5233         
5234         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5235         for nested attribute classes.
5236         (Class.attribute_usage): Removed.
5237         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5238         for attribute class.
5239         
5240         * ecore.cs (IsAttribute): Removed.
5241         
5242         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5243         
5244         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5245         now normal types.
5246         (attribute_types): Removed.
5247         (EmitCode): Global attributes are emited as the latest.
5248
5249 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5250
5251         * class.cs (EmitFieldInitializers): Don't emit field initializer
5252         for default values when optimilization is on.
5253         
5254         * constant.cs (Constant.IsDefaultValue): New property.
5255         
5256         * driver.cs: Add /optimize handling.
5257         
5258         * constant.cs,
5259         * ecore.cs,
5260         * literal.cs: Implement new IsDefaultValue property.
5261         
5262         * rootcontext.cs (Optimize): New field, holds /optimize option.
5263
5264 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5265
5266         Fix crasher in re-opened #72347.
5267         * namespace.cs (Namespace.Lookup): Return null if
5268         DeclSpace.DefineType returns null.
5269
5270         Fix #72678.
5271         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5272
5273 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5274
5275         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5276         now returns null if it cannot resolve to an lvalue.
5277         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5278         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5279         returned null.  Remove check for SimpleName.
5280         (EventExpr.DoResolveLValue): New.
5281         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5282         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5283         error from ...
5284         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5285         avoid CS0131 error.
5286         (Unary.ResolveOperator): Move CS0211 check ...
5287         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5288         CS0131 error.
5289         (Unary.DoResolveLValue): Simplify.
5290         (AddressOf.DoResolveLValue): New.
5291         (ArrayAccess.DoResolveLValue): New.
5292
5293 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5294
5295         * attribute.cs (Attribute.Resolve): Add arguments casting for
5296         when types doesn't match ctor arguments.
5297
5298 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5299
5300         Fix parts of #63202.
5301         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5302         lookup of operator in base type.  Ensure that all checks happen
5303         when the operator resolves to an "op_..." method.
5304
5305 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5306
5307         Fix #71992.
5308         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5309         'ignore_cs0104' parameter.  Pass it to ...
5310         (NamespaceEntry.Lookup): ... this.
5311         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5312         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5313         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5314         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5315         Update.  Request that cs0104 errors be ignored.
5316         (ComposedCast.ResolveAsTypeStep): Update.
5317
5318 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5319
5320         Fix #59209.
5321         * expression.cs (Invocation.BetterFunction): Remove support for
5322         comparing virtual functions and their overrides.
5323         (Invocation.IsOverride): New.
5324         (Invocation.OverloadResolve): Don't consider 'override' functions
5325         during candidate selection.  Store them in a lookaside list.
5326         If the selected method is a 'virtual' function, use the list to
5327         find any overrides that are closer to the LHS type.
5328
5329 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5330
5331         * expression.cs (New.DoResolve): Add complex core type reduction.
5332         (New.Constantify): Converts complex core type syntax like 'new int ()'
5333         to simple constant.
5334         
5335 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5336
5337         * decl.cs (EntryType.EntryType): New constructor to create an
5338         updated copy of a cache entry.
5339         (MemberCache.AddMethods): Use it.
5340         (MemberCache.ClearDeclaredOnly): Remove.
5341         (MemberCache.MemberCache): Update.
5342
5343 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5344
5345         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5346         variable.  This one is represents the actual low-level declaration
5347         of the method, as opposed to the semantic level `IsStatic'.   
5348
5349         An anonymous method which is hosted into a static method might be
5350         actually an instance method.  IsStatic would reflect the
5351         container, while MethodIsStatic represents the actual code
5352         generated.
5353
5354         * expression.cs (ParameterReference): Use the new MethodIsStatic
5355         instead of IsStatic.
5356
5357         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5358         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5359         set on the current EmitContext. 
5360
5361         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5362         resolve our casted expression as an LValue.  This triggers the
5363         proper LValue processing that is later required by Assign.
5364
5365         This fixes 72347.
5366
5367         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5368
5369 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5370
5371         C# 2.0 Fixed buffer implementation
5372
5373         * anonymous.cs: Update after RegisterHelperClass renaming.
5374
5375         * attribute.cs (AttributeTester.fixed_buffer_cache):
5376         Cache of external fixed buffers.
5377         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5378         implementation if field is fixed buffer else null.
5379
5380         * class.cs
5381         (TypeContainer.AddField): Accept FieldMember instead of Field.
5382         (FieldBase.IsFieldClsCompliant): Extracted code from
5383         VerifyClsCompliance descendant customization.
5384         (FixedField): New class handles fixed buffer fields.
5385         (FixedFieldExternal): Keeps information about imported fixed
5386         buffer.
5387         (IFixedField): Make access to internal or external fixed buffer
5388         same.
5389
5390         * cs-parser.jay: Add fixed buffer parsing.
5391
5392         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5393         buffer.
5394
5395         * expression.cs (Indirection): Extended implementation to accept
5396         fixed buffer field.
5397         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5398         (ElementAccess.MakePointerAccess): Get type as parameter.
5399         (DoResolve): Add fixed buffer field expression conversion.
5400         (DoResolveLValue): Ditto.
5401         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5402         (ArrayPtr): Derives from FixedBufferPtr.
5403         (ArrayPtr.Emit): Add extra emit for array elements.
5404
5405         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5406
5407         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5408         for compiler generated types.
5409         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5410
5411         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5412         and consume less memory.
5413         (Fixed.Resolve): Add fixed buffer case.
5414
5415         * typemanager.cs (compiler_generated_attr_ctor,
5416         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5417         (HasElementType): Add our own implementation to work on every
5418         runtime.
5419
5420 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5421
5422         * anonymous.cs (CaptureContext): Track whether `this' has been
5423         referenced.   
5424
5425         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5426         only captured `this' if it was implicitly done (instance
5427         methods/variables were used). 
5428
5429         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5430         `this' must be captured.
5431
5432 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5433  
5434         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5435         is null it means that there has been no need to capture anything,
5436         so we just create a sibling.
5437
5438         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5439
5440         Just a partial fix.  The other half is fairly elusive.
5441         
5442 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5443
5444         Fix #52586, cs0121-4.cs.
5445         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5446         and return a hashtable.
5447         (MemberCache.ClearDeclaredOnly): New.
5448         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5449         the method_hash of a base type too.
5450         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5451         type methods.  Overwrite entries with the same MethodHandle so
5452         that the ReflectedType is correct.  The process leaves in base
5453         virtual functions and their overrides as distinct entries.
5454         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5455         matters since it was boxed in a ArrayList before.
5456         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5457         modifier.
5458         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5459         case of a virtual function and its override (choose the overload
5460         as better).
5461         (Invocation.OverloadResolve): Avoid 'override' members during
5462         'applicable_type' calculation.
5463
5464 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5465
5466         Combine two near-redundant caches.
5467         * typemanager.cs (method_params): Rename from method_internal_params.
5468         (TypeManager.GetParameterData): New.  Replace
5469         Invocation.GetParameterData.
5470         (TypeManager.LookupParametersByBuilder): Remove.
5471         * expression.cs (Invocation.method_parameter_cache): Remove.
5472         (Invocation.GetParameterData): Remove.
5473         Update to changes.
5474         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5475         Update to changes.
5476
5477 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5478
5479         Fix #72015.
5480         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5481         TypeManager.multicast_delegate_type is null, resolve it by looking
5482         up "System.MulticastDelegate".
5483         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5484
5485 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5486             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5487             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5488
5489         Fix cs0164.cs.
5490         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5491         (LabeledStatement.AddReference): New.  Set 'referenced'.
5492         (Goto.Resolve): Use it.
5493
5494 2005-02-05  John Luke  <john.luke@gmail.com>
5495
5496         * driver.cs: remove duplicate -doc line in Usage ()
5497
5498 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5499
5500         * location.cs (Location.AddFile): Fix CS2002 error report.
5501
5502 2005-02-02  Martin Baulig  <martin@ximian.com>
5503
5504         * delegate.cs (Delegate.DefineType): Report an internal error if
5505         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5506         details.        
5507
5508 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5509
5510         Fix a crasher in a variant of #31984.
5511         * const.cs (Constant.CheckBase): New override that defers the
5512         new-or-override check in case the base type hasn't been populated
5513         yet.
5514         (Constant.Define): Ensure the new-or-override check is performed.
5515
5516 2005-02-01  Duncan Mak  <duncan@ximian.com>
5517
5518         * const.cs (LookupConstantValue): Check that `ce' is not null
5519         before calling GetValue ().
5520
5521 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5522
5523         Fix test-334.cs (#69519).
5524         * cs-parser.jay (using_alias_directive): Pass in an expression to
5525         NamespaceEntry.UsingAlias.
5526         (using_namespace_directive): Pass in an expression to
5527         NamespaceEntry.Using.
5528         (namespace_name): Don't flatten to a string.
5529         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5530         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5531         ResolveAsTypeStep.
5532         (NamespaceEntry.UsingEntry): Likewise.
5533         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5534         changes.
5535         (NamespaceEntry.LookupForUsing): Remove.
5536         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5537         names.
5538         (NamespaceEntry.Lookup): Remove support for dotted names.
5539
5540 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5541
5542         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5543         split into two.
5544         (NamespaceEntry.ImplicitParent): Compute on demand.
5545         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5546         parallels the current.
5547         (NamespaceEntry.LookupForUsing): Use it.
5548         (NamespaceEntry.Lookup): If the current namespace-entry is
5549         implicit, don't search aliases and using tables.
5550
5551 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5552
5553         Fix #31984.
5554         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5555         BaseCache here.
5556         (TypeContainer.BaseCache): Compute on demand.
5557         (TypeContainer.FindMembers): Define constants and types if they're
5558         not already created.
5559         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5560         check.
5561         * const.cs (Constant.Define): Make idempotent.
5562
5563 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5564
5565         * pending.cs: Produce better code (no nops produced by using Ldarg
5566         + value).
5567         
5568         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5569         i - 1' it should be arg + 1.
5570
5571         Fixes bug #71819.
5572
5573 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5574
5575         * attribute.cs (Attribute.CheckAttributeType): Make private
5576         non-virtual.
5577         (Attribute.ResolveType): Make virtual.
5578         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5579         handling of RootContext.Tree.Types.
5580
5581 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5582
5583         Update attribute-handling to use the SimpleName/MemberAccess
5584         mechanisms.
5585         * cs-parser.jay (attribute): Pass in an expression to the
5586         constructors of Attribute and GlobalAttribute.
5587         * attribute.cs (Attribute): Take an expression for the name.
5588         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5589         passed in attribute name expression.
5590         (Attribute.CheckAttributeType): Use it.
5591         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5592         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5593         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5594         argument to prevent error messages if the lookup fails.
5595
5596 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5597
5598         * expression.cs (Indirection): Implemented IVariable interface
5599         to support indirection in AddressOf operator.
5600         (PointerArithmetic.Emit): Add optimalization for case where
5601         result can be precomputed.
5602
5603 2005-01-26  Martin Baulig  <martin@ximian.com>
5604
5605         * class.cs (TypeContainer.AttributeTargets): Return the correct
5606         AttributeTargets depending on our `Kind' instead of throwing an
5607         exception; fixes #71632.
5608
5609 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5610
5611         Fix #71257
5612         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5613         constant members.
5614
5615 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5616
5617         Fix #71602.
5618         * expression.cs (MemberAccess.DoResolve): Don't complain with
5619         cs0572 when the LHS of a member access has identical name and type
5620         name.
5621
5622 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5623
5624         Fix #71651, #71675
5625         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5626         CreatePermission.
5627         Create custom PermissionSet only for PermissionSetAttribute.
5628
5629 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5630
5631         Fix #71649
5632         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5633         delegates in static class.
5634
5635 2005-01-24  Martin Baulig  <martin@ximian.com>
5636
5637         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5638         merging an implicit block, just use its reachability.
5639
5640         * statement.cs (Block.Resolve): Make the unreachable code check
5641         work wrt. implicit blocks; see test-337 from #63842.
5642
5643 2005-01-21  Alp Toker  <alp@atoker.com>
5644  
5645         * cs-parser.jay: destructor_declaration's container is PartialContainer
5646         not Class when partial types are used, so use Kind prop instead of
5647         'is'.
5648         
5649 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5650
5651         * cs-parser.jay: Improve error reporting when an interface
5652         declares new types.
5653
5654 2005-01-20  Dick Porter  <dick@ximian.com>
5655
5656         * support.cs: SeekableStreamReader fix from Sandor Dobos
5657         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5658         chars are read.  Fixes bug 70369.
5659
5660 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5661
5662         * cs-parser.jay (catch_clause): Simplify current_block handling
5663         somewhat.
5664
5665 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5666
5667         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5668         code with ImplicitStandardConversion to handle the implicit
5669         conversion of method groups into valid delegate invocations. 
5670
5671         The problem is that in parameter handling we were using this code
5672         path.  Fixes bug #64698
5673
5674 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5675
5676         * cs-parser.jay: Fix several infelicities.
5677         - Avoid assigning to the parser value stack.  Code like 
5678           '$3 = null' is unclean.  Synthesize a value for the code block
5679           instead. 
5680         - Avoid using oob_stack for storing location information.  Use ...
5681         (_mark_): ... this.  New (empty) rule.  Saves the current location
5682         in $$.
5683         (foreach_statement): Avoid using oob_stack for current_block
5684         handling.  Use technique used in for_statement and
5685         using_statement.  Synthesize a value for the code block to store
5686         additional intermediate information.
5687
5688 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5689
5690         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5691         of a different type is only allowed to private fields of a
5692         containing type, not on fields of a base class.
5693
5694         See test-174.cs and error cs0122-9.cs
5695
5696 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5697
5698         Fix test-335.cs (bug #58126).
5699         * cs-parser.jay (argument): Split out non-expression parts of the
5700         rule into 'non_simple_argument'.
5701         (invocation_expression): Support parenthesized invocations with
5702         multiple arguments, and with single non-simple arguments.
5703
5704 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5705
5706         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5707         places.
5708
5709 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5710
5711         Fix cs0038-1.cs, cs1640-6.cs.
5712         * ecore.cs (Expression.Resolve): Remove special-case for
5713         SimpleName in error-handling.
5714         (Expression.almostMatchedMembers): Relax access permission to
5715         protected.
5716         (Expression.MemberLookupFailed): Handle duplicates in
5717         almostMatchedMembers list.
5718         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5719         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5720         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5721         overload if the passed in MemberInfo is a MethodBase.
5722
5723 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5724
5725         Fix #70749
5726         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5727         for non-CAS & merge permission sets properly.
5728
5729 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5730
5731         Improve standard-compliance of simple name and member access 
5732         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5733         * ecore.cs (FullNamedExpression): New abstract base class 
5734         for Namespaces and TypeExpressions.
5735         (ResolveFlags.SimpleName): Remove.
5736         (SimpleName): Remove support for dotted names.
5737         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5738         DeclSpace.FindType and DeclSpace.LookupType.
5739         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5740         (Expression.ExprClassName): Make member function.
5741         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5742         a namespace.  Remove creation of dotted "SimpleName"s.
5743         (MemberAccess.DoResolve): Likewise.
5744         * decl.cs (DeclSpace.Cache): Make private.
5745         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5746         (DeclSpace.FindType): Update.
5747         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5748         FullNamedExpression.
5749         * namespace.cs (Namespace): Derive from FullNamedExpression
5750         so that it can be part of expression resolution.
5751         (Namespace.Lookup): Return an FullNamedExpression.
5752         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5753         namespace.
5754         * rootcontext.cs (NamespaceLookup): Remove.
5755         (LookupType): Move to DeclSpace.
5756         * attribute.cs (CheckAttributeType): Update.
5757         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5758         (FindDocumentedTypeNonArray): Likewise.
5759
5760 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5761
5762         Fix cs0509.cs, cs1632.cs.
5763         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5764         is the same as IsInterface.
5765         (TypeContainer.GetClassBases): Likewise.
5766         * statement.cs (LabeledStatement.ig): New field.
5767         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5768         label.
5769         (LabeledStatement.DoEmit): Check that the label was created with
5770         the same ILGenerator.
5771
5772 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5773
5774         Fix #71058
5775         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5776         accessors to its properties.
5777
5778         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5779         from accessors to property.
5780         
5781 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5782
5783         Fix #70722
5784         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5785         only for overrides.
5786         
5787 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5788
5789         * attribute.cs: Check for null and empty strings.  
5790
5791         I have lost another battle to Paolo.
5792
5793 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5794
5795         Fix #70942
5796         * class.cs (PropertyMethod): Set Parent field in ctors.
5797         (SetMethod.InternalParameters): Add unsafe switch hack.
5798         Override MarkForDuplicationCheck where it is appropriate.
5799
5800         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5801         It says whether container allows members with the same name.
5802         Base default is no.
5803         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5804         Removed is_method parameter.
5805
5806 2005-01-06  Duncan Mak  <duncan@ximian.com>
5807
5808         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5809         because the previous change led to incorrect reporting of CS1032
5810         ("Cannot define/undefine preprocessor symbols after first token in
5811         file"). Instead of using `tokens_seen' as the only flag that
5812         triggers CS1040, introduce `comments_seen'. This new flag is used
5813         to signify having seen comments on the current line, so it is
5814         unset after a newline.
5815
5816 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5817
5818         * doc.cs : When searching for a type, find nested type too.
5819           This fixes bug #71040.
5820
5821 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5822
5823         * doc.cs :
5824           - Warn missing member comment on those classes which also does not
5825             have doc comments. Fixed bug #71041.
5826           - Don't warn missing doc comment on default constructor.
5827             Fixed bug #71042.
5828
5829 2005-01-06  Duncan Mak  <duncan@ximian.com>
5830
5831         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5832         comments, set `tokens_seen' to true. This allows us to detect
5833         misplaced preprocessor directives (i.e. not at the beginning of
5834         the a line, nor after whitespaces). In that case, report error
5835         CS1040. This fixes bug #56460.
5836
5837         * cs-parser.jay (interface_member_declaration): Add checks for
5838         IsExplicitImpl, and report CS0541 error if an interface member is
5839         defined as an explicit interface declaration.
5840
5841 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5842
5843         Fix #70817
5844         * class.cs (PropertyMethod): Set Parent field in ctors.
5845         (SetMethod.InternalParameters): Add unsafe switch hack.
5846         
5847         * decl.cs (MemberCore.Parent): Cannot be readonly.
5848
5849 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5850
5851         * decl.cs (DeclSpace.ResolveType): Remove.
5852         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5853         Merge in code from ...
5854         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5855         * class.cs, enum.cs: Update to changes.
5856
5857 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5858
5859         * anonymous.cs: Ensure that we init the scope of our parent if it
5860         has not been initialized yet.
5861
5862 2004-12-30  Duncan Mak  <duncan@ximian.com>
5863
5864         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5865         if field.FieldBuilder is null. Fixes #70758.
5866
5867         * convert.cs: Fixed some typos and updated some of the comments.
5868         (ImplicitStandardConversionExists):
5869         (TryImplicitIntConversion): If `target_type' is an interface and
5870         the type of `ic' implements this interface, return true or a new
5871         BoxedCast instead of null. This fixes #70468.
5872
5873 2004-12-29  Duncan Mak  <duncan@ximian.com>
5874
5875         * expression.cs (Argument.Emit): Check that Expr is
5876         IMemoryLocation before casting to it, and report CS1510 otherwise.
5877
5878         This fixes #70402.
5879
5880 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5881
5882         * statement.cs (Block.ThisVariable): remove the recursion here, to
5883         make the --profile more sane.
5884
5885 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5886
5887         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5888         assembly, by JB Evain.
5889
5890 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5891
5892         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5893           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5894         "parent" refers to enclosing type/class.  "base" refers to superclass.
5895
5896 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5897
5898         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5899         Ensure that we only have GlobalAttributes.
5900         * attribute.cs (Attribute.Emit): Make non-virtual.
5901         (GlobalAttribute.Emit): Remove.
5902         (Attribute.Resolve): Make virtual.
5903         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5904         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5905         the argument. Don't create one.
5906         (Attribute.GetObsoleteAttribute): Likewise.
5907         (Attribute.GetClsCompliantAttributeValue): Likewise.
5908         * class.cs, decl.cs: Update to changes.
5909
5910 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5911
5912         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5913         
5914         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5915         
5916         * statement.cs (Foreach.Resolve): Add error 186 report.
5917
5918 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5919
5920         * expression.cs (Conditional.DoResolve): Add warning 429.
5921         
5922         * statement.cs (If.Resolve): Add warning 665.
5923
5924 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5925
5926         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5927         except when in the parser, and in GlobalAttribute.
5928         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5929         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5930         RootContext.Tree.Types.NamespaceEntry once work is done.
5931         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5932         and resets RootContext.Tree.Types.NamespaceEntry.
5933
5934 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5935
5936         * cs-parser.jay: Don't create a block for every variable.
5937
5938 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5939
5940         * location.cs: Provide extra information.
5941
5942         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5943         variables from the captured environment, it is the ldarg_0.
5944
5945 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5946
5947         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5948         find a conclusion.
5949         
5950         * class.cs: Changed warning level for 169 to avoid developer
5951         displeasure from warning flooding. It will be changed back when they
5952         fix most of current BCL warnings.
5953         
5954         * RootContext.cs: Pushed default WarningLevel to 3.
5955         
5956         * statement.cs: Removed unused variable.
5957
5958 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5959
5960         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5961         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5962         Add error 502 report.
5963         (StaticClass.DefineType): Add error 441 report.
5964         (Class.AllowedModifiersProp): New virtual property as temporary
5965         extension to AllowedModifiers.
5966         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5967         to share implementation with StaticClass and don't call virtual
5968         methods from ctor.
5969         
5970         * driver.cs (MainDriver): Add error 1558 test.
5971
5972         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5973         report. Moved error 36 test here.
5974
5975         * statement.cs (Throw.Resolve): Add error 724 report.
5976
5977         * typemanager.cs: Add out_attribute_type core type.
5978         
5979 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5980
5981         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5982         3018 report.
5983         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5984
5985         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5986         3017 report.
5987         
5988         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5989
5990         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5991         Add error 3023 report.
5992         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5993
5994         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5995         implementation.
5996
5997 2004-12-12  John Luke  <john.luke@gmail.com>
5998
5999         * driver.cs (AddArgs): take -- into account when
6000         adding arguments, fixes bug 65710 
6001
6002 2004-12-12  Martin Baulig  <martin@ximian.com>
6003
6004         * expression.cs (Unary.TryReduceNegative): Added support for
6005         SByteConstant and ByteConstant.
6006         (Unary.Reduce): Check error values from TryReduceNegative().
6007
6008 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6009
6010         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6011         and report exception as error 182.
6012
6013 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6014
6015         * driver.cs (Main): Fix message when there are warnings.
6016
6017 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6018
6019         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6020
6021 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6022
6023         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6024         Reduced number of warnings.
6025         
6026         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6027
6028 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6029
6030         * driver.cs: Removed message.
6031
6032         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6033
6034 2004-12-08    <vargaz@freemail.hu>
6035
6036         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6037
6038 2004-12-08  Martin Baulig  <martin@ximian.com>
6039
6040         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6041         instead of a CS3002 for properties and indexer.
6042
6043 2004-12-08  Martin Baulig  <martin@ximian.com>
6044
6045         * decl.cs (MemberName.ToString): Make this work again.
6046
6047 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6048
6049         * attribute.cs (Resolve): Add error 591 detection.
6050
6051         * class.cs (FieldMember.Define): Add error 1547 detection.
6052         (Indexer.Define): Add error 620 detection.
6053         (Operator.Define): Add error 590 detection.
6054
6055         * ecore.cs: Missing argument for error 79.
6056
6057         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6058         detection.
6059
6060 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6061
6062         Fix #70106
6063         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6064         only.
6065
6066 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6067
6068         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6069           Some operator comments were suppressed.
6070         * doc.cs : Implicit/explicit operator name in doc comments are like
6071           "op_Explicit(type)~returnType", so added suffix handling.
6072
6073 2004-12-07  Martin Baulig  <martin@ximian.com>
6074
6075         * decl.cs
6076         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6077         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6078         (DeclSpace.ec): New protected field; store the EmitContext here.
6079         (DeclSpace.EmitContext): New public property; moved here from
6080         `TypeContainer'.
6081         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6082         EmitContext.
6083
6084         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6085         (Enum.Emit): Don't create a new EmitContext.
6086
6087         * delegate.cs (Delegate.DefineType): Always create the
6088         EmitContext.
6089
6090         * iterators.cs (Iterators.DefineIterator): Create a new
6091         EmitContext and store it in `ec'.
6092
6093 2004-08-24  Martin Baulig  <martin@ximian.com>
6094
6095         * typemanager.cs
6096         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6097         this for accessibility checks.
6098         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6099         IsNestedFamilyAccessible.
6100         (TypeManager.IsSubclassOf): New method, do what the name actually
6101         says.   
6102
6103 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6104
6105         Fix crash on cs0657-17.cs.
6106         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6107         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6108         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6109         the case where the NamespaceEntry gets overwritten.
6110
6111 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6112
6113         Fixed #69195, #56821
6114         * ecore.cs (ResolveBoolean): Tiny refactoring.
6115
6116         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6117         of right expression resolving when left is false constant and
6118         operator is LogicalAnd OR true constant and operator is LogicalOr.
6119
6120         * statement.cs (ResolveUnreachable): Always reports warning.
6121
6122 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6123
6124         * class.cs: Distinguish between 1721 and 1722 (just a little help
6125         for the programmer).
6126
6127 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6128
6129         * delegate.cs: Only allow this on new versions of the language. 
6130
6131 2004-12-02  Duncan Mak  <duncan@ximian.com>
6132
6133         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6134         Expression class.
6135         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6136         here as a static method. Take an additional bool out parameter
6137         `must_do_cs1540_check' for signaling to InstanceResolve.
6138         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6139         member field from PropertyExpr class and made it an argument of
6140         the method instead.
6141         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6142         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6143         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6144         and `remove_accessor' as well as InstanceResolve: report CS0122
6145         where applicable.
6146
6147         Fixes #70129.
6148
6149 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6150
6151         Fix test-327.cs, test-328.cs, and put in early infrastructure
6152         for eventually fixing #52697.
6153         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6154         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6155         from other methods.
6156         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6157         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6158         (VerifyUsing, error246): Update.
6159         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6160         'NamespaceEntry.LookupNamespaceOrType'.
6161
6162 2004-12-03  Martin Baulig  <martin@ximian.com>
6163
6164         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6165         method as our child, call AnonymousMethod.Compatible() on it.
6166
6167 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6168
6169         Disable XML documentation support in 'basic' profile.
6170         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6171         Redirect XmlElement to System.Object.
6172         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6173         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6174         * mcs.exe.sources: Add doc-bootstrap.cs.
6175         * doc-bootstrap.cs: New file.  Contains empty stub implementation
6176         of doc.cs.
6177
6178 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6179
6180         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6181           comments are allowed.
6182
6183 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6184
6185         * delegate.cs: Add checks for subtypes in paramaters and return values
6186         in VerifyMethod () to add support for Covariance/Contravariance
6187         in delegates.
6188         
6189 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6190
6191         * report.cs: Remove extra closing parenthesis.
6192
6193         * convert.cs (Error_CannotImplicitConversion): If the name of the
6194         types are the same, provide some extra information.
6195
6196         * class.cs (FieldBase): Use an unused bit field from the field to
6197         encode the `has_offset' property from the FieldMember.  This saves
6198         a couple of Ks on bootstrap compilation.
6199
6200         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6201         method as our child, return the AnonymousMethod resolved
6202         expression.
6203
6204         * expression.cs (New.DoResolve): Allow return values from
6205         NewDelegate to also include AnonymousMethods.
6206
6207         Fixes #70150.
6208
6209 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6210
6211         Fix bug #70102
6212         * attribute.cs (Resolve): Improved implementation of params
6213         attribute arguments.
6214
6215         * support.cs (ParameterData): Add HasParams to be faster.
6216
6217 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6218
6219         all things are for /doc support:
6220
6221         * doc.cs: new file that supports XML documentation generation.
6222         * mcs.exe.sources: added doc.cs.
6223         * driver.cs:
6224           Handle /doc command line option.
6225           Report error 2006 instead of 5 for missing file name for /doc.
6226           Generate XML documentation when required, after type resolution.
6227         * cs-tokenizer.cs:
6228           Added support for picking up documentation (/// and /** ... */),
6229           including a new XmlCommentState enumeration.
6230         * cs-parser.jay:
6231           Added lines to fill Documentation element for field, constant,
6232           property, indexer, method, constructor, destructor, operator, event
6233           and class, struct, interface, delegate, enum.
6234           Added lines to warn incorrect comment.
6235         * rootcontext.cs :
6236           Added Documentation field (passed only when /doc was specified).
6237         * decl.cs:
6238           Added DocComment, DocCommentHeader, GenerateDocComment() and
6239           OnGenerateDocComment() and some supporting private members for
6240           /doc feature to MemberCore.
6241         * class.cs:
6242           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6243         * delegate.cs:
6244           Added overriden DocCommentHeader.
6245         * enum.cs:
6246           Added overriden DocCommentHeader and GenerateDocComment().
6247
6248 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6249
6250         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6251         unwrapping the enumeration values, chain to
6252         DoConstantNumericPromotions again, so we can promote things to the
6253         fundamental types (takes care of enums that are bytes, sbytes).
6254
6255         Fixes bug #62054.
6256
6257 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6258
6259         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6260         Fix long-standing bug in type-lookup.  Use FindType instead of
6261         LookupType when ec.ResolvingTypeTree.
6262         (Attribute.ResolveType, Attribute.Resolve)
6263         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6264         Update to changes.
6265         (Attributes.Search): Remove internal version.  Update.
6266         (Attributes.SearchMulti): Update.
6267         (Attributes.GetClsCompliantAttribute): Remove.
6268         (Attributes.GetIndexerNameAttribute): Remove.
6269         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6270         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6271         * class.cs (Indexer.Define): Likewise.
6272
6273 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6274
6275         Fix bug #68790
6276         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6277         MarshallByReference members access.
6278
6279         * expression.cs: Use CheckMarshallByRefAccess;
6280         Better error CS0197 message.
6281
6282         * report.cs: Print whole related error message.
6283
6284 2004-11-30  Raja R Harinath  <rharinath@novell.com>
6285
6286         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6287         the current directory to help debugging.
6288
6289 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6290
6291         * class (GetClassBases): Better error 60 report.
6292         (EventProperty): Disabled warning 67 detection.
6293
6294 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6295
6296         Fix bug #60324
6297         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6298
6299         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6300         precise values.
6301
6302 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6303
6304         Fix bug #49488
6305         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6306
6307         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6308
6309 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6310
6311         * attribute.cs (Attribute.Resolve): Refine error reporting and
6312         report a cs0117 if the identifier does not exist, to distinguish
6313         from 0617 which is a miss-use of the actual identifier.
6314
6315         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6316         between cs0070 and cs0079.
6317
6318         * class.cs (MemberBase.DoDefine): When reporting a wrong
6319         accessibility level, we use MethodCore to compare instead of
6320         Method (this was a regression in some refactoring effort).
6321
6322         So now we correctly report cs0056 again.
6323
6324         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6325         testing the target_type (which was known to be object_type) and
6326         not the source type (which is anonymous_method).
6327
6328         Fixed reporting of error cs1660.
6329
6330         * expression.cs (UserCast.Source): Expose the underlying cast.
6331
6332         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6333         allowed types to find a match to int32 first (most common).
6334
6335         In addition, it ignores any ImplicitUserConversions that did an
6336         internal implicit conversion (as the switch statement allows only
6337         one integral conversion to exist).
6338
6339         * class.cs (PartialContainer.Create): rename `name' to
6340         `member_name' for clarity.  Then replace the string calls with a
6341         call to MemberName.GetPartialName, as now using
6342         MemberName.ToString is an error (this is due to the side effects
6343         it had, that were fixed in the past).
6344
6345         This will restore the error reporting on a number of partial class
6346         errors that were missusing this (and getting an exception as a
6347         results, which is now just a plain textual warning, because
6348         yyparse debug output would crash otherwise).
6349
6350 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6351
6352         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6353
6354 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6355
6356         * rootcontext.cs (LookupType): Make sure to cache lookups that
6357         don't give us a negative result. This saves about 5% of corlib
6358         compilation time.
6359
6360 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6361
6362         * report.cs (AbstractMessage.Print): messages are sent to stderr
6363
6364         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6365         non-interface in the list of interfaces (at this point, either
6366         parent was properly set, or a base class is being listed in the
6367         interfaces section).
6368
6369         This flags error 1722, and resolves the crash from bug 69259.
6370
6371 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6372
6373         * statement.cs (Using.EmitExpressionFinally): make this work right
6374         for valuetypes. Fixes 69926.
6375
6376 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6377
6378         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6379         converted to an enum" here, before we try to change the underlying
6380         type.  This code exists, but it is a different code path than the
6381         one used while encoding constants.
6382
6383         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6384         old bug: when converting from the null literal to a pointer,
6385         return an EmptyCast, not the NullLiteral.
6386
6387         This fixes #69921, the recent null_type changes probably made this
6388         bug more prominent.
6389
6390         (ImplicitReferenceConversionExists): In addition, resynchronized
6391         the code here, so it matches the same code in
6392         ImplicitReferenceConversionExists for the `from any class-type S
6393         to any interface-type T'.
6394         
6395
6396 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6397
6398         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6399
6400 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6401
6402         * cs-parser.jay: Use verbosity accordingly. 
6403
6404 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6405
6406         * expression.cs (Unary.ResolveOperator): Do not report warning;
6407         AddressOf reads from variable.
6408         
6409         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6410
6411 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6412
6413         Fix bug #69462
6414
6415         * attribute.cs (Attributable): Removed CheckTargets.
6416         (Attributes.Emit): Explicit attribute targets are tested here.
6417
6418         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6419         not enabled for interfaces.
6420
6421         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6422         (GetAssemblyName): Ouch next bug there.
6423
6424 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6425
6426         * expression.cs: Error 275 added.
6427         
6428 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6429
6430         Fix bug #69177 (Implemented decimal constant support)
6431
6432         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6433         (BinaryFold): Add DecimalConstant.
6434
6435         * const.cs (Define): Decimal constant 
6436         (is not constant.
6437         (ChangeType): Add decimal type handling.
6438         (LookupConstantValue): Don't set value for decimal type but
6439         emit DecimalConstantAttribute. Needed for constant optimization.
6440
6441         * constant.cs (ToDecimal): New method.
6442         (ConvertToDecimal): New method.
6443         (IntConstant): Implemented ConvertToDecimal.
6444         (DecimalConstant.Emit): Emit optimized version for decimals in
6445         int range.
6446
6447         * expression.cs (ResolveOperator): Changed order of constant
6448         reduction to work correctly with native types which have
6449         overloaded operators.
6450         (ResolveMemberAccess): Extract constant value from attribute
6451         for decimal type.
6452
6453         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6454
6455         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6456         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6457         (ChangeType): Decimal is special.
6458         (TypeToCoreType): Add decimal type.
6459
6460 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6461
6462         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6463         decimal types.
6464
6465 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6466
6467         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6468         test cs1667-5.cs.
6469
6470 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6471
6472         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6473
6474         * pending.cs (PendingImplementation): Grab only interfaces.
6475
6476 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6477
6478         * statement.cs (ForeachHelperMethods): Add location member and
6479         error 202 detection.
6480
6481 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6482
6483         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
6484         automatically handled by executable.make.
6485         (PROGRAM): Make profile-specific.
6486
6487 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6488
6489         * expression.cs (DoResolveBase): Fixed wrong warning for out
6490         variables.
6491
6492 2004-11-18  Martin Baulig  <martin@ximian.com>
6493
6494         Merged latest changes into gmcs.  Please keep this comment in
6495         here, it makes it easier for me to see what changed in MCS since
6496         the last time I merged.
6497
6498 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6499
6500         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6501         (TypeHandle.GetMemberCache): New.
6502         (TypeHandle.TypeHandle): Update.
6503         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6504         (TypeManager.LookupParentInterfacesCache):
6505         Rename from LookupInterfaceCache.  Optimize slightly.
6506         (TypeManager.MemberLookup_FindMembers): Update.
6507         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6508         multi-type variant.
6509         (AddCacheContents): Rename from AddHashtable.
6510         * class.cs (TypeContainer.parent_container): Remove.
6511         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6512         (TypeContainer.DoDefineMembers): Don't initialize it.
6513         Update to name changes.
6514         
6515 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6516
6517         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6518         that factors the code to check access modifiers on override.  
6519
6520         (PropertyBase): Use the code here.
6521
6522         Patch from Lluis S'anchez, fixes bug #69361.
6523
6524 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6525
6526         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6527         routine that is used to report the use of a captured variable
6528         whose address has been taken.
6529
6530         There are two checks: one when variables are being captured and
6531         the other check is when the address of a variable is taken. 
6532         
6533         (because an anonymous methods might be resolved before *or* after
6534         the address has been taken) and 
6535
6536         * expression.cs (Conditional.DoResolve): Remove the special
6537         casing that Martin added to trueExpr and falseExpr being both
6538         NullLiteral.  We get the right behavior now just by introducing
6539         the null_type into the compiler. 
6540
6541         * convert.cs (ExplicitConversion): Change the code to use
6542         null_type instead of testing `expr is NullLiteral'.
6543         (ImplicitConversionStandard): use null_type too.
6544         (ImplicitReferenceConversionExists): use null_type too.
6545         (ImplicitReferenceConversion): use null_type too.
6546
6547         * literal.cs: The type of `NullLiteral' is now null_type instead
6548         of object_type. 
6549         (Resolve): Set the type here.
6550
6551         * typemanager.cs: Introduce null_type.
6552
6553 2004-11-17  Martin Baulig  <martin@ximian.com>
6554
6555         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6556         direction, like FindMembers() does.  Fixes #69546, testcase is in
6557         test-315.cs.    
6558
6559 2004-11-16  Martin Baulig  <martin@ximian.com>
6560
6561         This is based on a patch from Marek Safar, see bug #69082.
6562         Fixes bugs #63705 and #67130.
6563
6564         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6565         method; create a MemberCache for an interface type and cache the
6566         result.
6567
6568         * decl.cs (IMemberContainer.ParentContainer): Removed.
6569         (IMemberContainer.ParentCache): New property.
6570         (MemberCache.SetupCacheForInterface): Removed.
6571         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6572         to create a cache for an interface's "parent".
6573
6574         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6575         interfaces too.
6576
6577 2004-11-16  Martin Baulig  <martin@ximian.com>
6578
6579         Merged back from gmcs; these changes already went into gmcs a
6580         couple of weeks ago.
6581
6582         * typemanager.cs
6583         (TypeManager.AddUserType): Removed the `ifaces' argument.
6584         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6585         `TypeExpr []'.
6586         (TypeManager.AddUserInterface): Removed.
6587         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6588         `TypeExpr []'.
6589         (TypeManager.GetInterfaces): Likewise.
6590         (TypeManager.GetExplicitInterfaces): Likewise.
6591
6592         * ecore.cs (TypeExpr.GetInterfaces): Removed.
6593
6594         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6595         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6596
6597 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6598
6599         * statement.cs: Avoid adding bools to a hashtable.
6600
6601 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6602
6603         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6604         calling an unsafe method from a safe location.
6605
6606 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6607
6608         Fix #69167
6609         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6610
6611 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6612
6613         * namespace.cs (VerifyUsing): use GetPartialName instead of
6614         ToString. 
6615
6616 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6617
6618         * statement.cs (Return.Resolve): Fix regression in typo: if
6619         `in_exc', we have to request a NeedReturnLabel, this was a typo
6620         introduced in the anonymous method check-in.  Fixes #69131.
6621
6622         * Indexers were using the ShortName when defining themselves,
6623         causing a regression in the compiler bootstrap when applying the
6624         patch from 2004-11-02 (first part), now they use their full name
6625         and the bug is gone.
6626
6627 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6628
6629         * driver.cs: Strip the path from the names of embedded resources. Fixes
6630         #68519.
6631
6632 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6633
6634         Fix error message regression: cs0104-2.cs.
6635         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6636         (AliasEntry.Resolve): Update.
6637         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6638         'silent' flag.
6639         (RootContext.LookupType): Update.
6640
6641 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6642
6643         * cs-parser.jay: Add support for handling accessor modifiers
6644         * class: Add support port accessor modifiers and error checking,
6645         define PropertyMethod.Define as virtual (not abstract anymore)
6646         * ecore.cs: Add checking for proeprties access with access modifiers
6647         * iterators.cs: Modify Accessor constructor call based in the modified
6648         constructor
6649 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6650
6651         * expression.cs (StringConcat): Handle being called twice,
6652         as when we have a concat in a field init with more than two
6653         ctors in the class
6654
6655 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6656
6657         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6658         special case explicit implementations, we should always produce
6659         the .property or .event declaration.
6660         
6661         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6662         since it will not return correct data if people use this
6663         unresolved in the presence of using statements (see test-313).
6664
6665         * class.cs (MethodData.Define): If we are an explicit interface
6666         implementation, set the method name to the full name of the
6667         interface plus the name of the method.  
6668
6669         Notice that using the method.MethodName.GetFullName() does not
6670         work, as it will only contain the name as declared on the source
6671         file (it can be a shorthand in the presence of using statements)
6672         and not the fully qualifed type name, for example:
6673
6674         using System;
6675
6676         class D : ICloneable {
6677                 object ICloneable.Clone ()  {
6678                 }
6679         }
6680
6681         Would produce a method called `ICloneable.Clone' instead of
6682         `System.ICloneable.Clone'.
6683
6684         * namespace.cs (Alias.Resolve): Use GetPartialName.
6685         
6686 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6687
6688         * cs-parser.jay: Add error 1055 report.
6689
6690 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6691
6692         * assign.cs (Assign.DoResolve): Only do the transform of
6693         assignment into a New if the types are compatible, if not, fall
6694         through and let the implicit code deal with the errors and with
6695         the necessary conversions. 
6696
6697 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6698
6699         * cs-parser.jay: Add error 1031 report.
6700
6701         * cs-tokenizer.cs: Add location for error 1038.
6702
6703 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6704
6705         * cs-parser.jay: Add error 1016 report.
6706
6707 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6708
6709         * cs-parser.jay: Add errors 1575,1611 report.
6710
6711 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6712
6713         * cs-parser.jay: Add error 1001 report.
6714
6715 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6716
6717         Fix #68850
6718         * attribute.cs (GetMarshal): Add method argument for
6719         caller identification.
6720
6721         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6722         agument for GetMarshal and RuntimeMissingSupport.
6723
6724 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6725
6726         * attribute.cs (ExtractSecurityPermissionSet): Removed
6727         TypeManager.code_access_permission_type.
6728
6729         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6730
6731 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6732
6733         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6734         for obsolete use of a variable here.   Fixes regression on errors
6735         cs0619-25 and cs0619-26.
6736
6737 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6738
6739         Fix #62358, implemented security attribute encoding.
6740
6741         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6742         Tests permitted SecurityAction for assembly or other types.
6743         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6744         data from SecurityPermissionAttribute to PermisionSet class.
6745
6746         * class.cs (ApplyAttributeBuilder): Added special handling
6747         for System.Security.Permissions.SecurityAttribute based types.
6748
6749         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6750         special handling for System.Security.Permissions.SecurityAttribute
6751         based types.
6752
6753         * enum.cs (ApplyAttributeBuilder): Added special handling
6754         for System.Security.Permissions.SecurityAttribute based types.
6755
6756         * parameter.cs (ApplyAttributeBuilder): Added special handling
6757         for System.Security.Permissions.SecurityAttribute based types.
6758
6759         * rootcontext.cs: Next 2 core types.
6760
6761         * typemanager.cs (TypeManager.security_permission_attr_type):
6762         Built in type for the SecurityPermission Attribute.
6763         (code_access_permission_type): Build in type.
6764
6765 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6766
6767         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6768         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6769         all of this information into
6770         EmitContext.EmitCapturedVariableInstance.
6771         
6772         * codegen.cs (EmitCapturedVariableInstance): move here the
6773         funcionality of emitting an ldarg.0 in the presence of a
6774         remapping.   This centralizes the instance emit code.
6775
6776         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6777         then emit a load of this: it means that we have reached the
6778         topmost ScopeInfo: the one that contains the pointer to the
6779         instance of the class hosting the anonymous method.
6780
6781         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6782         captures to the topmost CaptureContext.
6783
6784 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6785
6786         * expression.cs (LocalVariableReference): Move the knowledge about
6787         the iterators into codegen's EmitCapturedVariableInstance.
6788
6789 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6790
6791         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6792         all code paths return a value from an anonymous method (it is the
6793         same as the 161 error, but for anonymous methods).
6794
6795 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6796
6797         The introduction of anonymous methods in the compiler changed
6798         various ways of doing things in the compiler.  The most
6799         significant one is the hard split between the resolution phase
6800         and the emission phases of the compiler.
6801
6802         For instance, routines that referenced local variables no
6803         longer can safely create temporary variables during the
6804         resolution phase: they must do so from the emission phase,
6805         since the variable might have been "captured", hence access to
6806         it can not be done with the local-variable operations from the runtime.
6807         
6808         * statement.cs 
6809
6810         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6811         is a toplevel block.
6812
6813         (ToplevelBlock): A new kind of Block, these are the blocks that
6814         are created by the parser for all toplevel method bodies.  These
6815         include methods, accessors and anonymous methods.
6816
6817         These contain some extra information not found in regular blocks:
6818         A pointer to an optional CaptureContext (for tracking captured
6819         local variables and parameters).  A pointer to the parent
6820         ToplevelBlock.
6821         
6822         (Return.Resolve): Catch missmatches when returning a value from an
6823         anonymous method (error 1662).
6824         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6825         phase.
6826
6827         (Break.Resolve): ditto.
6828
6829         (SwitchLabel): instead of defining the labels during the
6830         resolution phase, we now turned the public ILLabel and ILLabelCode
6831         labels into methods called GetILLabelCode() and GetILLabel() that
6832         only define the label during the Emit phase.
6833
6834         (GotoCase): Track the SwitchLabel instead of the computed label
6835         (its contained therein).  Emit the code by using
6836         SwitchLabel.GetILLabelCode ().
6837
6838         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6839         whether the Local has been captured or not.
6840
6841         (LocalInfo.IsCaptured): New property, used to tell whether the
6842         local has been captured.
6843         
6844         * anonymous.cs: Vastly updated to contain the anonymous method
6845         support.
6846
6847         The main classes here are: CaptureContext which tracks any
6848         captured information for a toplevel block and ScopeInfo used to
6849         track the activation frames for various local variables.   
6850
6851         Each toplevel block has an optional capture context associated
6852         with it.  When a method contains an anonymous method both the
6853         toplevel method and the anonymous method will create a capture
6854         context.   When variables or parameters are captured, they are
6855         recorded on the CaptureContext that owns them, for example:
6856
6857         void Demo () {
6858              int a;
6859              MyDelegate d = delegate {
6860                  a = 1;
6861              }
6862         }
6863
6864         Here `a' will be recorded as captured on the toplevel
6865         CapturedContext, the inner captured context will not have anything
6866         (it will only have data if local variables or parameters from it
6867         are captured in a nested anonymous method.
6868
6869         The ScopeInfo is used to track the activation frames for local
6870         variables, for example:
6871
6872         for (int i = 0; i < 10; i++)
6873                 for (int j = 0; j < 10; j++){
6874                    MyDelegate d = delegate {
6875                         call (i, j);
6876                    }
6877                 }
6878
6879         At runtime this captures a single captured variable `i', but it
6880         captures 10 different versions of the variable `j'.  The variable
6881         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6882         recorded on a child.  
6883
6884         The toplevel ScopeInfo will also track information like the `this'
6885         pointer if instance variables were referenced (this is necessary
6886         as the anonymous method lives inside a nested class in the host
6887         type of the method). 
6888
6889         (AnonymousMethod): Expanded to track the Toplevel, implement
6890         `AnonymousMethod.Compatible' to tell whether an anonymous method
6891         can be converted to a target delegate type. 
6892
6893         The routine now also produces the anonymous method content
6894
6895         (AnonymousDelegate): A helper class that derives from
6896         DelegateCreation, this is used to generate the code necessary to
6897         produce the delegate for the anonymous method that was created. 
6898
6899         * assign.cs: API adjustments for new changes in
6900         Convert.ImplicitStandardConversionExists.
6901
6902         * class.cs: Adjustments to cope with the fact that now toplevel
6903         blocks are of type `ToplevelBlock'. 
6904
6905         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6906         insteda of standard blocks.
6907
6908         Flag errors if params arguments are passed to anonymous methods.
6909
6910         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6911         `CurrentAnonymousMethod' which points to the current Anonymous
6912         Method.  The variable points to the AnonymousMethod class that
6913         holds the code being compiled.  It is set in the new EmitContext
6914         created for the anonymous method.
6915
6916         (EmitContext.Phase): Introduce a variable and an enumeration to
6917         assist in enforcing some rules about when and where we are allowed
6918         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6919         only one that enfonces this right now).
6920
6921         (EmitContext.HaveCaptureInfo): new helper method that returns
6922         whether we have a CapturedContext initialized.
6923
6924         (EmitContext.CaptureVariable): New method used to register that a
6925         LocalInfo must be flagged for capturing. 
6926
6927         (EmitContext.CapturedParameter): New method used to register that a
6928         parameters must be flagged for capturing. 
6929         
6930         (EmitContext.CapturedField): New method used to register that a
6931         field must be flagged for capturing. 
6932
6933         (EmitContext.HaveCapturedVariables,
6934         EmitContext.HaveCapturedFields): Return whether there are captured
6935         variables or fields. 
6936
6937         (EmitContext.EmitMethodHostInstance): This is used to emit the
6938         instance for the anonymous method.  The instance might be null
6939         (static methods), this (for anonymous methods that capture nothing
6940         and happen to live side-by-side with the current method body) or a
6941         more complicated expression if the method has a CaptureContext.
6942
6943         (EmitContext.EmitTopBlock): Routine that drives the emission of
6944         code: it will first resolve the top block, then emit any metadata
6945         and then emit the code.  The split is done so that we can extract
6946         any anonymous methods and flag any captured variables/parameters.
6947         
6948         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6949         during this phase, the ILGenerator should not be used as labels
6950         and local variables declared here might not be accessible to any
6951         code that is part of an anonymous method.  
6952
6953         Exceptions to this include the temporary variables that are
6954         created by some statements internally for holding temporary
6955         variables. 
6956         
6957         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6958         metadata for a cb
6959
6960         (EmitContext.TemporaryReturn): This method is typically called
6961         from the Emit phase, and its the only place where we allow the
6962         ReturnLabel to be defined other than the EmitMeta.  The reason is
6963         that otherwise we would have to duplicate a lot of logic in the
6964         Resolve phases of various methods that today is on the Emit
6965         phase. 
6966
6967         (EmitContext.NeedReturnLabel): This no longer creates the label,
6968         as the ILGenerator is not valid during the resolve phase.
6969
6970         (EmitContext.EmitThis): Extended the knowledge in this class to
6971         work in anonymous methods in addition to iterators. 
6972
6973         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6974         code is necessary on the stack to access the instance to a local
6975         variable (the variable will be accessed as a field).
6976
6977         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6978         EmitContext.EmitAddressOfParameter): Routines to support
6979         parameters (not completed at this point). 
6980         
6981         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6982         will also remove the parameters.
6983
6984         * convert.cs (Convert): Define a `ConstantEC' which points to a
6985         null.  This is just to prefity some code that uses
6986         ImplicitStandardConversion code and do not have an EmitContext
6987         handy.
6988
6989         The idea is to flag explicitly that at that point in time, it is
6990         known that the conversion will not trigger the delegate checking
6991         code in implicit conversions (which requires a valid
6992         EmitContext). 
6993
6994         Everywhere: pass new EmitContext parameter since
6995         ImplicitStandardConversionExists now requires it to check for
6996         anonymous method conversions. 
6997
6998         (Convert.ImplicitStandardConversionExists): If the type of an
6999         expression is the anonymous_method_type, and the type is a
7000         delegate, we invoke the AnonymousMethod.Compatible method to check
7001         whether an implicit conversion is possible. 
7002
7003         (Convert.ImplicitConversionStandard): Only do implicit method
7004         group conversions if the language level is not ISO_1.
7005
7006         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7007         MethodInfo for the Invoke method.  used by Delegate and
7008         AnonymousDelegate.
7009
7010         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7011         method conversions if the target type is a delegate.
7012
7013         Removed extra debugging nops.
7014
7015         (LocalVariableReference): Turn the `local_info' into a public
7016         field. 
7017
7018         Add `prepared' field, the same hack used for FieldExprs to cope
7019         with composed assignments, as Local variables do not necessarily
7020         operate purely on the stack as they used to: they can be captured
7021         fields. 
7022
7023         Add `temp' for a temporary result, like fields.
7024
7025         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7026
7027         It now copes with Local variables that are captured and emits the
7028         proper instance variable to load it from a field in the captured
7029         case. 
7030
7031         (ParameterReference.DoResolveBase): During the resolve phase,
7032         capture parameters if we are in an anonymous method.
7033
7034         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7035         anonymous method, use the EmitContext helper routines to emit the
7036         parameter reference.
7037
7038         * iterators.cs: Set RemapToProxy to true/false during the
7039         EmitDispose class.
7040
7041         * parameters.cs (GetParameterByName): New helper method. 
7042
7043         * typemanager.cs (anonymous_method_type) a new type that
7044         represents an anonyous method.  This is always an internal type,
7045         used as a fencepost to test against the anonymous-methodness of an
7046         expression. 
7047         
7048 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7049
7050         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7051         561 report.
7052         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7053
7054 2004-10-18  Martin Baulig  <martin@ximian.com>
7055
7056         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7057         `Type' directly, but call ResolveType() on it.
7058         (Catch.Resolve): Likewise.
7059         (Foreach.Resolve): Likewise.
7060
7061 2004-10-18  Martin Baulig  <martin@ximian.com>
7062
7063         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7064         `Type' directly, but call ResolveType() on it.
7065         (Probe.DoResolve): Likewise.
7066         (ArrayCreation.LookupType): Likewise.
7067         (TypeOf.DoResolve): Likewise.
7068         (SizeOf.DoResolve): Likewise.
7069
7070 2004-10-18  Martin Baulig  <martin@ximian.com>
7071
7072         * expression.cs (Invocation.BetterFunction): Put back
7073         TypeManager.TypeToCoreType().
7074
7075 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7076
7077         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7078         the ResolveType.
7079
7080 2004-10-18  Martin Baulig  <martin@ximian.com>
7081
7082         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
7083         `Type' directly, but call ResolveType() on it.
7084
7085 2004-10-18  Martin Baulig  <martin@ximian.com>
7086
7087         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7088         `Type' directly, but call ResolveType() on it.
7089         (MemberBase.DoDefine): Likewise.
7090
7091         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7092         `Type' directly, but call ResolveType() on it.
7093         (ComposedCast.DoResolveAsTypeStep): Likewise.
7094
7095         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7096         `Type' directly, but call ResolveType() on it.
7097
7098 2004-10-17  John Luke  <john.luke@gmail.com>
7099
7100         * class.cs (Operator.GetSignatureForError): use CSharpName
7101
7102         * parameter.cs (Parameter.GetSignatureForError): Returns
7103         correct name even if was not defined.
7104
7105 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7106
7107         Fix #65816.
7108         * class.cs (TypeContainer.EmitContext): New property.
7109         (DefineNestedTypes): Create an emitcontext for each part.
7110         (MethodCore.DoDefineParameters): Use container's emitcontext.
7111         Pass type array to InternalParameters.
7112         (MemberBase.DoDefine): Use container's emitcontext.
7113         (FieldMember.Define): Likewise.
7114         (Event.Define): Likewise.
7115         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7116         Pass type array to InternalParameters.
7117         (SetIndexerMethod.GetParameterInfo): Likewise.
7118         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7119         * delegate.cs (Define): Pass emitcontext to
7120         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7121         array to InternalParameters.
7122         * expression.cs (ParameterReference.DoResolveBase): Pass
7123         emitcontext to GetParameterInfo.
7124         (ComposedCast.DoResolveAsTypeStep): Remove check on
7125         ec.ResolvingTypeTree.
7126         * parameter.cs (Parameter.Resolve): Change argument to
7127         EmitContext.  Use ResolveAsTypeTerminal.
7128         (Parameter.GetSignature): Change argument to EmitContext.
7129         (Parameters.ComputeSignature): Likewise.
7130         (Parameters.ComputeParameterTypes): Likewise.
7131         (Parameters.GetParameterInfo): Likewise.
7132         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7133         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7134         * support.cs (InternalParameters..ctor): Remove variant that takes
7135         a DeclSpace.
7136         * typemanager.cs (system_intptr_expr): New.
7137         (InitExpressionTypes): Initialize it.
7138
7139 2004-10-12  Chris Toshok  <toshok@ximian.com>
7140
7141         * cs-parser.jay: fix location for try_statement and catch_clause.
7142
7143 2004-10-11  Martin Baulig  <martin@ximian.com>
7144
7145         * report.cs: Don't make --fatal abort on warnings, we have
7146         -warnaserror for that.
7147
7148 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7149
7150         More DeclSpace.ResolveType avoidance.
7151         * decl.cs (MemberCore.InUnsafe): New property.
7152         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7153         with newly created EmitContext.
7154         (FieldMember.Define): Likewise.
7155         * delegate.cs (Delegate.Define): Likewise.
7156         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7157         only if normal name-lookup fails.
7158         (TypeExpr.DoResolve): Enable error-checking.
7159         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7160         (SizeOf.DoResolve): Likewise.
7161         (ComposedCast.DoResolveAsTypeStep): Likewise.
7162         (StackAlloc.DoResolve): Likewise.
7163         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7164         (Block.Unsafe): New property.
7165         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7166         (Unsafe): Set 'unsafe' flag of contained block.
7167         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7168         (Fixed.Resolve): Likewise.
7169         (Catch.Resolve): Likewise.
7170         (Using.ResolveLocalVariableDecls): Likewise.
7171         (Foreach.Resolve): Likewise.
7172
7173 2004-10-05  John Luke <john.luke@gmail.com>
7174
7175         * cs-parser.jay: add location to error CS0175
7176
7177 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7178
7179         * ecore.cs (Expression.Constantity): Add support for turning null
7180         into a constant.
7181
7182         * const.cs (Const.Define): Allow constants to be reference types
7183         as long as the value is Null.
7184
7185 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7186
7187         * namespace.cs (NamespaceEntry.Using): No matter which warning
7188         level is set, check if this namespace name has already been added.
7189
7190 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7191
7192         * expression.cs: reftype [!=]= null should always use br[true,false].
7193         # 67410
7194
7195 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7196
7197         Fix #67108
7198         * attribute.cs: Enum conversion moved to 
7199         GetAttributeArgumentExpression to be applied to the all
7200         expressions.
7201
7202 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7203
7204         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7205         * class.c (TypeContainer.DefineType): Flag error if
7206         base types aren't accessible due to access permissions.
7207         * decl.cs (DeclSpace.ResolveType): Move logic to
7208         Expression.ResolveAsTypeTerminal.
7209         (DeclSpace.ResolveTypeExpr): Thin layer over
7210         Expression.ResolveAsTypeTerminal.
7211         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7212         Refactor code into NestedAccess.  Use it.
7213         (DeclSpace.NestedAccess): New.
7214         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7215         argument to silence errors.  Check access permissions.
7216         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7217         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7218         (Cast.DoResolve): Likewise.
7219         (New.DoResolve): Likewise.
7220         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7221         (TypeOf.DoResolve): Likewise.
7222
7223         * expression.cs (Invocation.BetterConversion): Return the Type of
7224         the better conversion.  Implement section 14.4.2.3 more faithfully.
7225         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7226         section 14.4.2.2 explicit.
7227         (Invocation.OverloadResolve): Update.
7228         (Invocation): Remove is_base field.
7229         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7230         (Invocation.Emit): Likewise.
7231
7232 2004-09-27  Raja R Harinath  <rharinath@novell.com>
7233
7234         * README: Update to changes.
7235
7236 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7237
7238         * cs-parser.jay: Reverted 642 warning fix.
7239
7240 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7241
7242         Fix bug #66615
7243         * decl.cs (FindMemberWithSameName): Indexer can have more than
7244         1 argument.
7245
7246 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7247
7248         * expression.cs (LocalVariableReference.DoResolveLValue):
7249         Do not report warning 219 for out values.
7250         (EmptyExpression.Null): New member to avoid extra allocations.
7251
7252 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7253
7254         * cs-parser.jay: Fix wrong warning 642 report.
7255
7256         * cs-tokenizer.cs (CheckNextToken): New helper;
7257         Inspect next character if is same as expected.
7258
7259 2004-09-23  Martin Baulig  <martin@ximian.com>
7260
7261         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7262         (Convert.ImplicitReferenceConversionExists): Likewise.
7263
7264 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7265
7266         * class.cs (Operator.Define): Add error 448 and 559 report.
7267
7268 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7269
7270         * class.cs (MemberBase.IsTypePermitted): New protected
7271         method for checking error CS0610.
7272
7273 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7274
7275         * class.cs (TypeContainer.HasExplicitLayout): New property
7276         Returns whether container has StructLayout attribute set Explicit.
7277         (FieldMember): New abstract class for consts and fields.
7278         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7279         (Field): Reuse FieldMember.
7280
7281         * const.cs (Const): Reuse FieldMember.
7282
7283         * rootcontext.cs: EmitConstants call moved to class.
7284
7285 2004-09-22  Martin Baulig  <martin@ximian.com>
7286
7287         Thanks to Peter Sestoft for this bug report.
7288
7289         * expression.cs (Conditional): If both the `trueExpr' and the
7290         `falseExpr' is a NullLiteral, return a NullLiteral.
7291
7292 2004-09-22  Martin Baulig  <martin@ximian.com>
7293
7294         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7295         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7296         for the "get_Current" call.
7297
7298 2004-09-22  Martin Baulig  <martin@ximian.com>
7299
7300         Marek and me just fixed one of our oldest bugs: #28562 :-)
7301
7302         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7303
7304         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7305         we're an EnumConstant, just return that.
7306         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7307         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7308         to get the value which'll actually be written into the attribute.
7309         However, we have to use GetValue() to access the attribute's value
7310         in the compiler.        
7311
7312 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7313
7314         * constant.cs (Constant.IsNegative): New abstract property
7315         IsNegative.
7316
7317         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7318         (StackAlloc.DoResolve): Reused IsNegative.
7319
7320 2004-09-21  Martin Baulig  <martin@ximian.com>
7321
7322         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7323         if we're used in an iterator, we may be called from different
7324         methods.
7325
7326         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7327         we actually have an exception block.
7328
7329 2004-09-20  John Luke <jluke@cfl.rr.com>
7330
7331         * class.cs, cs-parser.jay: Improve the error report for 1520:
7332         report the actual line where the error happens, not where the
7333         class was declared.
7334
7335         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7336         Pass location information that was available elsewhere.
7337
7338 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
7339
7340         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7341         runtime to delay sign assemblies.
7342
7343 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7344
7345         * cs-parser.jay: Do not report the stack trace, this is barely
7346         used nowadays.
7347
7348 2004-08-22  John Luke  <john.luke@gmail.com>
7349  
7350         * driver.cs : check that a resource id is not already used
7351         before adding it, report CS1508 if it is, bug #63637
7352
7353 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7354
7355         * ecore.cs: Removed dead code.
7356
7357 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
7358
7359         * class.cs: Do not report warning CS0067 on the interfaces.
7360
7361 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7362
7363         * cs-parser.jay: Add error 504 report.
7364
7365 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7366
7367         * rootcontext.cs: WarningLevel is 4 by default now.
7368
7369         * statement.cs (Fixed.Resolve): Do not null
7370         VariableInfo.
7371
7372 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7373
7374         Fixed bug #55780
7375         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7376         deep search when property is not virtual.
7377         (PropertyExpr.ResolveAccessors): Make one call for both
7378         accessors.
7379
7380 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7381
7382         Fixed bug #65766
7383         * statement.cs: Error 152 report constains also location.
7384
7385 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7386
7387         Fixed bug #65766
7388         * const.cs: Explicitly set constant as static.
7389
7390 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7391
7392         Fixed bug #64226
7393         * cs-parser.jay: Add error 1017 report.
7394
7395 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7396
7397         Fixed bug #59980, #64224
7398         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7399
7400         * typemanager.cs (IsSpecialMethod): Simplified
7401
7402 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7403
7404         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7405         condition with better params.
7406
7407 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7408
7409         Fixed bug #65238
7410         * attribute.cs (Resolve): Property has to have both
7411         accessors.
7412
7413 2004-09-14  Martin Baulig  <martin@ximian.com>
7414
7415         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7416
7417 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7418
7419         Fixed bug #61902
7420         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7421         called and is obsolete then this member suppress message
7422         when call is inside next [Obsolete] method or type.
7423
7424         * expression.cs: Use TestObsoleteMethodUsage member.
7425
7426 2004-09-14  Martin Baulig  <martin@ximian.com>
7427
7428         * cs-parser.jay: Sync a bit with the GMCS version.
7429
7430 2004-09-14  Martin Baulig  <martin@ximian.com>
7431
7432         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7433         (CSharpParser.yacc_verbose_flag): New public field.
7434
7435         * genericparser.cs: Removed.
7436
7437 2004-09-14  Raja R Harinath  <rharinath@novell.com>
7438
7439         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7440
7441 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7442
7443         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7444
7445 2004-09-10  Martin Baulig  <martin@ximian.com>
7446
7447         Backported my MemberName changes from GMCS into MCS.
7448
7449         - we are now using a special `MemberName' class instead of using
7450         strings; in GMCS, the `MemberName' also contains the type
7451         arguments.
7452
7453         - changed the grammar rules a bit:
7454           * the old `member_name' is now a `namespace_or_type_name':
7455             The rule is that we use `namespace_or_type_name' everywhere
7456             where we expect either a "member name" (GetEnumerator) or a
7457             "member name" with an explicit interface name
7458             (IEnumerable.GetEnumerator).
7459             In GMCS, the explicit interface name may include type arguments
7460             (IEnumerable<T>.GetEnumerator).
7461           * we use `member_name' instead of just `IDENTIFIER' for
7462             "member names":
7463             The rule is that we use `member_name' wherever a member may
7464             have type parameters in GMCS.       
7465
7466         * decl.cs (MemberName): New public class.
7467         (MemberCore.MemberName): New public readonly field.
7468         (MemberCore.ctor): Take a `MemberName' argument, not a string.
7469         (DeclSpace): Likewise.
7470
7471         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7472         * enum.cs (Enum.ctor): Likewise.
7473
7474         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7475         MemberName.     
7476         (AliasEntry.ctor): Take a MemberName, not an Expression.
7477         (AliasEntry.UsingAlias): Likewise.
7478
7479         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7480         (IMethodData.MemberName): Changed type from string to MemberName.
7481         (MemberBase.ExplicitInterfaceName): Likewise.
7482         (AbstractPropertyEventMethod.SetupName): Make this private.
7483         (AbstractPropertyEventMethod.ctor): Added `string prefix'
7484         argument; compute the member name here.
7485         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7486         on the `member.MemberName' and the `prefix'.
7487
7488         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7489         not `type_name'.
7490         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7491         thus, we get a `MemberName' instead of a `string'.  These
7492         declarations may have type parameters in GMCS.
7493         (interface_method_declaration, delegate_declaration): Likewise.
7494         (class_declaration, interface_declaration): Likewise.
7495         (method_header): Use `namespace_or_type_name' instead of
7496         `member_name'.  We may be an explicit interface implementation.
7497         (property_declaration, event_declaration): Likewise.
7498         (member_name): This is now just an `IDENTIFIER', not a
7499         `namespace_or_type_name'.
7500         (type_name, interface_type): Removed.
7501         (namespace_or_type_name): Return a MemberName, not an Expression.
7502         (primary_expression): Use `member_name' instead of `IDENTIFIER';
7503         call GetTypeExpression() on the MemberName to get an expression.
7504         (IndexerDeclaration.interface_type): Changed type from string to
7505         MemberName.
7506         (MakeName): Operate on MemberName's instead of string's.
7507
7508 2004-09-13  Raja R Harinath  <rharinath@novell.com>
7509
7510         Fix bug #55770.
7511         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7512         (NamespaceEntry.Lookup): Add new argument to flag if we want the
7513         lookup to avoid symbols introduced by 'using'.
7514         * rootcontext.cs (NamespaceLookup): Update.
7515
7516 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7517
7518         * class.cs (TypeContainer.DoDefineMembers): Do not call
7519         DefineDefaultConstructor for static classes.
7520
7521 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7522
7523         * attribute.cs (Attribute.Resolve): Add error 653 report.
7524
7525         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7526         report.
7527         (Method.ApplyAttributeBuilder): Add error 685 report.
7528         (Operator.Define): Add error 564 report.
7529
7530         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7531
7532         * expression.cs (Invocation.DoResolve): Add error
7533         245 and 250 report.
7534
7535         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7536         error 674 report.
7537
7538 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7539
7540         * class.cs (ConstructorInitializer.Resolve):
7541         Wrong error number (515->516).
7542
7543 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7544
7545         * class.cs (Indexer.Define): Add error 631 report.
7546
7547 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7548
7549         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7550
7551 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7552
7553         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7554
7555 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7556
7557         * cs-parser.jay: Added error CS0241 report.
7558
7559 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7560
7561         * cs-parser.jay (fixed_statement): Introduce a scope for the
7562         declaration in the 'fixed' statement.
7563
7564 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7565
7566         * cs-parser.jay: Added CS0230 error report.
7567
7568 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7569
7570         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7571
7572 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7573
7574         * expression.cs (Argument.Resolve): Added error CS0192 and
7575         CS0199 report.
7576
7577 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7578
7579         C# 2.0 #pragma warning feature
7580
7581         * cs-tokenizer.cs (PreProcessPragma): New method; 
7582         Handles #pragma directive.
7583
7584         * report.cs (WarningRegions): New class; Support
7585         class for #pragma warning directive. It tests whether
7586         warning is enabled for a given line.
7587
7588 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7589
7590         * const.cs: Add more descriptive error report, tahnks to
7591         Sebastien. 
7592
7593 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7594
7595         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7596
7597 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7598
7599         * expression.cs: Apply patch from Ben: Remove dead code from
7600         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7601         as that code just threw an exception anwyays.
7602
7603         * const.cs: Remove the call to the turnintoconstant, for details
7604         see bug: #63144
7605         
7606         * literal.cs: The type of the null-literal is the null type;  So
7607         we use a placeholder type (literal.cs:System.Null, defined here)
7608         for it.
7609
7610         * expression.cs (Conditional.DoResolve): Remove some old code that
7611         is no longer needed, conversions have been fixed.
7612
7613         (ArrayCreationExpression.DoResolve): Return false if we fail to
7614         resolve the inner expression.
7615
7616 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7617
7618         Fix test-290.cs.
7619         * cs-parser.jay (delegate_declaration): Record a delegate
7620         declaration as a type declaration.
7621         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7622
7623 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7624
7625         * parameter.cs: Do not crash if the type can not be resolved. 
7626
7627         * expression.cs: Report errors with unsafe pointers, fixes #64896
7628
7629 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7630
7631         * expression.cs: Pointer arith always needs to do a conv.i
7632         if the operand is a long. fix 65320
7633
7634 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7635
7636         Fixed cs0619-37.cs, cs0619-38.cs
7637
7638         * enum.cs (GetObsoleteAttribute): Removed.
7639
7640         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7641         on Enum member is double staged. The first is tested member
7642         and then enum.
7643
7644 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7645
7646         Fixed #56986, #63631, #65231
7647
7648         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7649         adds member to name container.
7650         (TypeContainer.AddToTypeContainer): New method, adds type to
7651         name container.
7652         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7653         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7654         AddOperator): Simplified by reusing AddToMemberContainer.
7655         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7656         instead of field.
7657         (Method.CheckForDuplications): Fixed implementation to test all
7658         possibilities.
7659         (MemberBase): Detection whether member is explicit interface
7660         implementation is now in constructor.
7661         (MemberBase.UpdateMemberName): Handles IndexerName.
7662         (Accessor): Changed to keep also location information.
7663         (AbstractPropertyEventMethod): Is derived from MemberCore.
7664         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7665         will be emited or not.
7666         (PropertyBase.AreAccessorsDuplicateImplementation):
7667         Tests whether accessors are not in collision with some method.
7668         (Operator): Is derived from MethodCore to simplify common
7669         operations.
7670
7671         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7672         must be performed.
7673         (DeclSpace.AddToContainer): Adds the member to defined_names
7674         table. It tests for duplications and enclosing name conflicts.
7675
7676         * enum.cs (EnumMember): Clean up to reuse the base structures
7677
7678 2004-09-03  Martin Baulig  <martin@ximian.com>
7679
7680         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7681         into TypeContainer, to make partial classes work again.
7682
7683 2004-09-03  Martin Baulig  <martin@ximian.com>
7684
7685         * rootcontext.cs (RootContext.V2): Removed.
7686
7687 2004-03-23  Martin Baulig  <martin@ximian.com>
7688
7689         * expression.cs (Invocation.OverloadResolve): Added `bool
7690         may_fail' argument and use it instead of the Location.IsNull() hack.
7691
7692 2004-09-03  Martin Baulig  <martin@ximian.com>
7693
7694         Merged latest changes into gmcs.  Please keep this comment in
7695         here, it makes it easier for me to see what changed in MCS since
7696         the last time I merged.
7697
7698 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7699
7700         Fix #61128.
7701         * expression.cs (BetterConversion): Don't allow either conversion 
7702         to be null.  Remove redundant implicit conversion test when 'q ==
7703         null' -- when this function is invoked, we already know that the
7704         implicit conversion exists.
7705         (BetterFunction): Assume that 'best' is non-null.  Remove
7706         redundant reimplementation of IsApplicable when 'best' is null.
7707         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7708         number of arguments.
7709         (IsAncestralType): Extract from OverloadResolve.
7710         (OverloadResolve): Make robust to the MethodGroupExpr being
7711         unsorted.  Implement all the logic of Section 14.5.5.1, and
7712         support overloading of methods from multiple applicable types.
7713         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7714
7715         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7716         (RealError, Warning): Append type of report to related symbol.
7717
7718 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7719
7720         * enum.cs: Fixed CLS-Compliance checks for enum members.
7721         Error tests cs3008-8.cs, cs3014-8.cs
7722
7723 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7724
7725         Fixed bug #62342, #63102
7726         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7727         like ImplementMethod.
7728
7729 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7730
7731         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7732         Fixed bug #65170.
7733
7734 2004-09-02  Martin Baulig  <martin@ximian.com>
7735
7736         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7737         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7738         on the MethodBase.
7739
7740 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7741
7742         C# 2.0 Static classes implemented
7743
7744         * class.cs (TypeContainer): instance_constructors,
7745         initialized_fields, initialized_static_fields,
7746         default_constructor, base_inteface_types are protected to be
7747         accessible from StaticClass.
7748         (TypeContainer.DefineDefaultConstructor): New virtual method
7749         for custom default constructor generating
7750         (StaticClass): New class to handle "Static classes" feature.
7751
7752         * cs-parser.jay: Handle static keyword on class like instance
7753         of StaticClass.
7754
7755         * driver.cs: Added "/langversion" command line switch with two
7756         options (iso-1, default).
7757
7758 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7759
7760         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7761
7762 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7763
7764         * delegate.cs: Style.
7765
7766 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7767
7768         * delegate.cs: Add seperate instance expr field for miguel.
7769
7770 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7771
7772         * PointerArithmetic (Resolve): make sure we are not doing
7773         pointer arith on void*. Also, make sure we are resolved
7774         by not setting eclass until resolve.
7775
7776         All callers: Make sure that PointerArithmetic gets resolved.
7777
7778 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7779
7780         * ArrayCreation (LookupType): If the type does not resolve 
7781         to an array, give an error.
7782
7783 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7784
7785         * statement.cs (Try.Resolve): Fixed bug #64222
7786
7787 2004-08-27  Martin Baulig  <martin@ximian.com>
7788
7789         * class.cs
7790         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7791         crash here.     
7792
7793 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7794
7795         * ecore.cs (Constantify): Get underlying type via
7796         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7797         Windows in special cases.
7798
7799 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7800
7801         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7802         for obtaining also private methods.
7803         (GetRemoveMethod): Used GetRemoveMethod (true)
7804         for obtaining also private methods.
7805
7806 2004-08-24  Martin Baulig  <martin@ximian.com>
7807
7808         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7809         MethodAttributes.HideBySig for operators.
7810
7811 2004-08-23  Martin Baulig  <martin@ximian.com>
7812
7813         Back to the old error reporting system :-)
7814
7815         * report.cs (Message): Removed.
7816         (Report.MessageData, ErrorData, WarningData): Removed.
7817         (Report.Error, Warning): Back to the old system.
7818
7819 2004-08-23  Martin Baulig  <martin@ximian.com>
7820
7821         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7822
7823         * class.cs (TypeContainer.ParentContainer): New public virtual
7824         method; replaces the explicit interface implementation.
7825         (ClassPart.ParentContainer): Override.
7826
7827 2004-08-23  Martin Baulig  <martin@ximian.com>
7828
7829         * statement.cs (Switch): Added support for constant switches; see
7830         #59428 or test-285.cs.
7831
7832 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7833
7834         Fixed bug #62740.
7835         * statement.cs (GetEnumeratorFilter): Removed useless
7836         logic because C# specs is strict. GetEnumerator must be
7837         public.
7838
7839 2004-08-22  Martin Baulig  <martin@ximian.com>
7840
7841         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7842         a switch and may break, reset the barrier.  Fixes #59867.
7843
7844 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7845
7846         CLS-Compliance speed up (~5% for corlib)
7847
7848         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7849         New method. Tests container for CLS-Compliant names
7850
7851         * class.cs (TypeContainer.VerifyClsName): New method.
7852         Checks whether container name is CLS Compliant.
7853         (Constructor): Implements IMethodData.
7854
7855         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7856         low-case table for CLS Compliance test.
7857         (MemberCache.VerifyClsParameterConflict): New method.
7858         Checks method parameters for CS3006 error.
7859
7860         * enum.cs (EnumMember): Is derived from MemberCore.
7861         (Enum.VerifyClsName): Optimized for better performance.
7862
7863 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7864
7865         * report.cs: Renamed Error_T to Error and changed all
7866         references.
7867
7868 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7869
7870         * class.cs (TypeContainer.IndexerArrayList): New inner class
7871         container for indexers.
7872         (TypeContainer.DefaultIndexerName): New constant for default
7873         indexer name. Replaced all "Item" with this constant.
7874         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7875
7876         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7877         DefaultMemberAttribute constructor.
7878
7879 2004-08-05  Martin Baulig  <martin@ximian.com>
7880
7881         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7882         Fix bug #59429.
7883
7884 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7885
7886         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7887         multi platforms problem.
7888
7889         * compiler.csproj: Included shared files.
7890
7891 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7892
7893         Fix bug 60333, 55971 in the more general way
7894         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7895         Added arg_type argument for constant conversion.
7896         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7897
7898 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7899
7900         Fix bug #59760
7901         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7902         OperatorArrayList, MethodCoreArrayList for typecontainer
7903         containers. Changed class member types to these new types.
7904         (MethodArrayList.DefineMembers): Added test for CS0659.
7905
7906 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7907
7908         * cfold.cs: Synchronize the folding with the code in expression.cs
7909         Binary.DoNumericPromotions for uint operands.
7910
7911         * attribute.cs: Revert patch from Raja, it introduced a regression
7912         while building Blam-1.2.1 (hard to isolate a test case).
7913
7914 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7915
7916         Fix for #55382
7917         * class.cs:
7918         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7919         name collision.
7920         (MethodCore.parent_method): New member. The method we're overriding
7921         if this is an override method.
7922         (MethodCore.CheckBase): Moved from Method class and made common.
7923         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7924         private.
7925         (MethodCore.CheckForDuplications): New abstract method. For custom
7926         member duplication search in a container
7927         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7928         method and its return type.
7929         (Event.conflict_symbol): New member. Symbol with same name in the
7930         parent class.
7931
7932         * decl.cs:
7933         (MemberCache.FindMemberWithSameName): New method. The method
7934         is looking for conflict with inherited symbols.
7935
7936 2004-08-04  Martin Baulig  <martin@ximian.com>
7937
7938         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7939
7940         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7941
7942 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7943
7944         * report.cs (Message): New enum for better error, warning reference in
7945         the code.
7946         (MessageData): New inner abstract class. It generally handles printing of
7947         error and warning messages.
7948         Removed unused Error, Warning, Message methods.
7949
7950 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7951
7952         Fix for cs0592-8.cs test
7953         * attribute.cs
7954         (Attributable.ValidAttributeTargets): Made public.
7955         (Attribute.ExplicitTarget): New member for explicit target value.
7956         (Attribute.CheckTargets): Now we translate explicit attribute
7957         target to Target here.
7958
7959 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7960
7961         * ecore.cs (MethodGroupExpr): new IsBase property.
7962
7963         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7964
7965         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7966         rather than an instance expr.
7967
7968         (DelegateCreation.Emit): Use the method group rather than
7969         the instance expression. Also, if you have base.Foo as the
7970         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7971
7972         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7973
7974         (NewDelegate.DoResolve): Only check for the existance of Invoke
7975         if the method is going to be needed. Use MethodGroupExpr.
7976
7977         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
7978
7979         * expression.cs: For pointer arith., make sure to use
7980         the size of the type, not the size of the pointer to
7981         the type.
7982
7983 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7984
7985         Fix for #60722
7986         * class.cs (Class): Added error CS0502 test.
7987
7988 2004-08-03  John Luke  <jluke@cfl.rr.com>
7989             Raja R Harinath  <rharinath@novell.com>
7990
7991         Fix for #60997.
7992         * attribute.cs (Attribute.complained_before): New flag.
7993         (Attribute.ResolveType, Attribute.Resolve),
7994         (Attribute.DefinePInvokeMethod): Set it.
7995         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7996         
7997 2004-08-03  Martin Baulig  <martin@ximian.com>
7998
7999         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8000         use a user-defined operator; we still need to do numeric
8001         promotions in case one argument is a builtin type and the other
8002         one has an implicit conversion to that type.  Fixes #62322.
8003
8004 2004-08-02  Martin Baulig  <martin@ximian.com>
8005
8006         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8007         (LocalInfo.IsThis): New public property.
8008         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8009
8010 2004-08-01  Martin Baulig  <martin@ximian.com>
8011
8012         * class.cs (TypeContainer.GetClassBases): Don't set the default
8013         here since we may get called from GetPartialBases().
8014         (TypeContainer.DefineType): If GetClassBases() didn't return a
8015         parent, use the default one.
8016
8017 2004-07-30  Duncan Mak  <duncan@ximian.com>
8018
8019         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8020
8021 2004-07-30  Martin Baulig  <martin@ximian.com>
8022
8023         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8024
8025         * class.cs (SourceMethod): New public class, derive from the
8026         symbol writer's ISourceMethod.
8027         (Method): Use the new symbol writer API.
8028
8029         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8030         as argument and use the new symbol writer.
8031
8032         * location.cs
8033         (SourceFile): Implement the symbol writer's ISourceFile.
8034         (Location.SymbolDocument): Removed.
8035         (Location.SourceFile): New public property.
8036
8037         * symbolwriter.cs: Use the new symbol writer API.
8038
8039 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8040
8041         * Makefile (install-local): Remove.  Functionality moved to
8042         executable.make.
8043
8044 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8045
8046         * Makefile: Install mcs.exe.config file together with mcs.exe.
8047         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8048         correct runtime version.
8049         
8050 2004-07-25  Martin Baulig  <martin@ximian.com>
8051
8052         * class.cs
8053         (TypeContainer.RegisterOrder): Removed, this was unused.
8054         (TypeContainer, interface_order): Removed.
8055         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8056         TypeContainer as argument since we can also be called with a
8057         `PartialContainer' for a partial class/struct/interface.
8058         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8059         of checking whether we're an `Interface' - we could be a
8060         `PartialContainer'.
8061         (PartialContainer.Register): Override; call
8062         AddClass()/AddStruct()/AddInterface() on our parent.
8063
8064         * cs-parser.jay (interface_member_declaration): Add things to the
8065         `current_container', not the `current_class'.
8066
8067         * rootcontext.cs (RegisterOrder): The overloaded version which
8068         takes an `Interface' was unused, removed.
8069
8070         * typemanager.cs (TypeManager.LookupInterface): Return a
8071         `TypeContainer', not an `Interface'.
8072         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8073         contain a `PartialContainer' for an interface, so check it's
8074         `Kind' to figure out what it is.
8075
8076 2004-07-25  Martin Baulig  <martin@ximian.com>
8077
8078         * class.cs (Class.DefaultTypeAttributes): New public constant.
8079         (Struct.DefaultTypeAttributes): Likewise.
8080         (Interface.DefaultTypeAttributes): Likewise.
8081         (PartialContainer.TypeAttr): Override this and add the
8082         DefaultTypeAttributes.
8083
8084 2004-07-25  Martin Baulig  <martin@ximian.com>
8085
8086         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8087         we can just use the `Parent' field instead.
8088
8089 2004-07-25  Martin Baulig  <martin@ximian.com>
8090
8091         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8092
8093 2004-07-25  Martin Baulig  <martin@ximian.com>
8094
8095         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8096         our parts before defining any methods.
8097         (TypeContainer.VerifyImplements): Make this virtual.
8098         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8099         on our PartialContainer.
8100
8101 2004-07-25  Martin Baulig  <martin@ximian.com>
8102
8103         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8104
8105         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8106         argument, we can just use the `Parent' field instead.
8107
8108         * class.cs
8109         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8110         (MemberBase.DoDefine): Likewise.
8111
8112 2004-07-24  Martin Baulig  <martin@ximian.com>
8113
8114         * decl.cs (MemberCore.Parent): New public field.
8115         (DeclSpace.Parent): Moved to MemberCore.
8116
8117         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8118         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8119         parent's .ctor.
8120         (FieldBase, Field, Operator): Likewise.
8121         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8122         (EventField, Event): Likewise.
8123
8124 2004-07-23  Martin Baulig  <martin@ximian.com>
8125
8126         * class.cs (PartialContainer): New public class.
8127         (ClassPart): New public class.
8128         (TypeContainer): Added support for partial classes.
8129         (TypeContainer.GetClassBases): Splitted some of the functionality
8130         out into GetNormalBases() and GetPartialBases().
8131
8132         * cs-tokenizer.cs (Token.PARTIAL): New token.
8133         (Tokenizer.consume_identifier): Added some hacks to recognize
8134         `partial', but only if it's immediately followed by `class',
8135         `struct' or `interface'.
8136
8137         * cs-parser.jay: Added support for partial clases.
8138
8139 2004-07-23  Martin Baulig  <martin@ximian.com>
8140
8141         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8142         a `DeclSpace' and also made it readonly.
8143         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8144         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8145         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8146
8147         * cs-parser.jay: Pass the `current_class', not the
8148         `current_container' (at the moment, this is still the same thing)
8149         to a new Method, Property, Event, Indexer or Constructor.
8150
8151 2004-07-23  Martin Baulig  <martin@ximian.com>
8152
8153         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8154         and removed the `current_interface' one.
8155         (struct_declaration, class_declaration, interface_declaration):
8156         Set `current_class' to the newly created class/struct/interface;
8157         set their `Bases' and call Register() before parsing their body.
8158
8159 2004-07-23  Martin Baulig  <martin@ximian.com>
8160
8161         * class.cs (Kind): New public enum.
8162         (TypeContainer): Made this class abstract.
8163         (TypeContainer.Kind): New public readonly field.
8164         (TypeContainer.CheckDef): New public method; moved here from
8165         cs-parser.jay.
8166         (TypeContainer.Register): New public abstract method.
8167         (TypeContainer.GetPendingImplementations): New public abstract
8168         method.
8169         (TypeContainer.GetClassBases): Removed the `is_class' and
8170         `is_iface' parameters.
8171         (TypeContainer.DefineNestedTypes): Formerly known as
8172         DoDefineType().
8173         (ClassOrStruct): Made this class abstract.
8174
8175         * tree.cs (RootTypes): New public type. 
8176
8177 2004-07-20  Martin Baulig  <martin@ximian.com>
8178
8179         * tree.cs (Tree.RecordNamespace): Removed.
8180         (Tree.Namespaces): Removed.
8181
8182         * rootcontext.cs (RootContext.IsNamespace): Removed.
8183
8184         * cs-parser.jay (namespace_declaration): Just create a new
8185         NamespaceEntry here.
8186
8187 2004-07-20  Martin Baulig  <martin@ximian.com>
8188
8189         * statement.cs (ExceptionStatement): New abstract class.  This is
8190         now used as a base class for everyone who's using `finally'.
8191         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8192         our local variables before using them.
8193
8194         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8195         virtual method.  This is used by Yield.Resolve() to "steal" an
8196         outer block's `finally' clauses.
8197         (FlowBranchingException): The .ctor now takes an ExceptionStatement
8198         argument.
8199
8200         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8201         version which takes an ExceptionStatement.  This version must be
8202         used to create exception branchings.
8203
8204         * iterator.cs
8205         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8206         (Iterator.EmitMoveNext): Added exception support; protect the
8207         block with a `fault' clause, properly handle 'finally' clauses.
8208         (Iterator.EmitDispose): Run all the `finally' clauses here.
8209
8210 2004-07-20  Martin Baulig  <martin@ximian.com>
8211
8212         * iterator.cs: This is the first of a set of changes in the
8213         iterator code.  Match the spec more closely: if we're an
8214         IEnumerable, then GetEnumerator() must be called.  The first time
8215         GetEnumerator() is called, it returns the current instance; all
8216         subsequent invocations (if any) must create a copy.
8217
8218 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
8219
8220         * expression.cs: Resolve the constant expression before returning
8221         it. 
8222
8223 2004-07-19  Martin Baulig  <martin@ximian.com>
8224
8225         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8226         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8227         the return type of the new EmitContext.
8228
8229 2004-07-18  Martin Baulig  <martin@ximian.com>
8230
8231         * class.cs (Property.Define): Fix iterators.
8232
8233         * iterators.cs (Iterator.Define): Moved the
8234         `container.AddInterator (this)' call here from the .ctor; only do
8235         it if we resolved successfully.
8236
8237 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
8238
8239         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8240         `true' for preprocessing directives that we parse.  The return
8241         value indicates whether we should return to regular tokenizing or
8242         not, not whether it was parsed successfully.
8243
8244         In the past if we were in: #if false ... #line #endif, we would
8245         resume parsing after `#line'.  See bug 61604.
8246
8247         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8248         building: IsEnumType should return true only for enums, not for
8249         enums or System.Enum itself.  This fixes #61593.
8250
8251         Likely what happened is that corlib was wrong: mcs depended on
8252         this bug in some places.  The bug got fixed, we had to add the
8253         hack, which caused bug 61593.
8254
8255         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8256         that was a workaround for the older conditions.
8257
8258 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
8259
8260         * assign.cs: IAssignMethod has a new interface, as documented
8261         inline. All assignment code now uses this new api.
8262
8263         * ecore.cs, expression.cs: All classes which implement
8264         IAssignMethod now use the new interface.
8265
8266         * expression.cs (Invocation): add a hack to EmitCall so that
8267         IndexerAccess can be the target of a compound assignment without
8268         evaluating its arguments twice.
8269
8270         * statement.cs: Handle changes in Invocation api.
8271
8272 2004-07-16  Martin Baulig  <martin@ximian.com>
8273
8274         * iterators.cs: Rewrote this.  We're now using one single Proxy
8275         class for both the IEnumerable and the IEnumerator interface and
8276         `Iterator' derives from Class so we can use the high-level API.
8277
8278         * class.cs (TypeContainer.AddIterator): New method.
8279         (TypeContainer.DoDefineType): New protected virtual method, which
8280         is called from DefineType().
8281         (TypeContainer.DoDefineMembers): Call DefineType() and
8282         DefineMembers() on all our iterators.
8283         (TypeContainer.Emit): Call Emit() on all our iterators.
8284         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8285
8286         * codegen.cs (EmitContext.CurrentIterator): New public field.
8287
8288 2004-07-15  Martin Baulig  <martin@ximian.com>
8289
8290         * typemanager.cs
8291         (TypeManager.not_supported_exception_type): New type.   
8292
8293 2004-07-14  Martin Baulig  <martin@ximian.com>
8294
8295         * iterators.cs: Use real error numbers.
8296
8297 2004-07-14  Martin Baulig  <martin@ximian.com>
8298
8299         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8300         requires this to be a System.Collection.IEnumerable and not a
8301         class implementing that interface.
8302         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8303
8304 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8305
8306         * class.cs: Fixed previous fix, it broke some error tests.
8307
8308 2004-07-12  Martin Baulig  <martin@ximian.com>
8309
8310         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8311         Fixes #61293.
8312
8313 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8314
8315         * assign.cs (LocalTemporary): Add new argument: is_address,If
8316         `is_address' is true, then the value that we store is the address
8317         to the real value, and not the value itself.
8318         
8319         * ecore.cs (PropertyExpr): use the new local temporary
8320         stuff to allow us to handle X.Y += z (where X is a struct)
8321
8322 2004-07-08  Martin Baulig  <martin@ximian.com>
8323
8324         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8325         not always return, just like we're doing in Using.Resolve().
8326
8327 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8328
8329         * cs-parser.jay (fixed_statement): flag this as Pinned.
8330
8331 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8332
8333         * typemanager.cs (TypeManager): Removed MakePinned method, this
8334         mechanism is replaced with the .NET 2.x compatible mechanism of
8335         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8336
8337         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8338         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8339         `IsFixed' property which has a different meaning.
8340
8341 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8342
8343         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8344         visible from inside a nested class, not just the names of the
8345         immediately enclosing class.
8346         Fix for bug #60730.
8347
8348 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8349
8350         * expression.cs (BetterConversion): Remove buggy special-case
8351         handling of "implicit constant expression conversions".  At this
8352         point, we already know that the conversion is possible -- we're
8353         only checking to see which is better.
8354
8355 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8356
8357         * cs-parser.jay: Added error CS0210 test.
8358
8359 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8360
8361         * cs-parser.jay: Added error CS0134 test.
8362
8363 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8364
8365         Fix bug #52507
8366         * cs-parser.jay: Added error CS0145 test.
8367
8368 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8369
8370         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8371
8372 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8373         
8374         * expression.cs (StackAlloc.Resolve): The argument may not
8375         be a constant; deal with this case.
8376         
8377 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8378
8379         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8380         GetIndexerAttributeValue.
8381         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8382
8383         * class.cs (Indexer.Define): Added error tests for CS0415,
8384         CS0609.
8385
8386 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8387
8388         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8389         property code.
8390
8391 2004-06-23  Martin Baulig  <martin@ximian.com>
8392
8393         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8394         neither return nor throw, reset the barrier as well.  Fixes #60457.
8395
8396 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8397
8398         * class.cs : EventAttributes is now set to None by default.
8399           This fixes bug #60459.
8400
8401 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8402
8403         Fix bug #60219
8404         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8405         Don't throw exception but return null (it's sufficient now).
8406
8407 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8408
8409         * typemanager.cs (GetArgumentTypes): Faster implementation.
8410
8411 2004-06-18  Martin Baulig  <martin@ximian.com>
8412
8413         * attribute.cs (Attribute.Resolve): Check whether we're an
8414         EmptyCast which a Constant child.  Fixes #60333.
8415
8416 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8417
8418         * statement.cs (EmitCollectionForeach): Account for the fact that
8419         not all valuetypes are in areas which we can take the address of.
8420         For these variables, we store to a temporary variable. Also, make
8421         sure that we dont emit a `callvirt' on a valuetype method.
8422
8423 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8424
8425         * expression.cs (StackAlloc.DoReSolve): Added test for
8426         negative parameter (CS0247).
8427
8428 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8429
8430         Fix bug #59792
8431         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8432
8433 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8434
8435         Fix bug #59781
8436         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8437         ulong.
8438
8439 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8440
8441         Fix bug #58254 & cs1555.cs, cs1556.cs
8442         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8443
8444 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8445
8446         * cs-parser.jay: Added error CS1669 test for indexers.
8447
8448 2004-06-11  Martin Baulig  <martin@ximian.com>
8449
8450         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8451         call this twice: for params and varargs methods.
8452
8453 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8454
8455         * class.cs:
8456         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8457
8458 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8459
8460         * attribute.cs (Attribute.GetValidTargets): Made public.
8461
8462         * class.cs: 
8463         (AbstractPropertyEventMethod): New class for better code sharing.
8464         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8465         CS1667 report.
8466         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8467
8468 2004-06-11  Raja R Harinath  <rharinath@novell.com>
8469
8470         Fix bug #59477.
8471         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8472         that the call to Resolve is part of a MemberAccess.
8473         (Expression.Resolve): Use it for SimpleName resolution.
8474         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8475         Add 'intermediate' boolean argument.
8476         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
8477         error message when the SimpleName can be resolved ambiguously
8478         between an expression and a type.
8479         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8480         public.
8481         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8482         call on the left-side.
8483
8484 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8485
8486         * class.cs:
8487         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8488
8489 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8490
8491         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8492
8493 2004-06-11  Martin Baulig  <martin@ximian.com>
8494
8495         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8496         varargs methods if applicable.
8497
8498 2004-06-11  Martin Baulig  <martin@ximian.com>
8499
8500         * expression.cs (Invocation.EmitCall): Don't use
8501         `method.CallingConvention == CallingConventions.VarArgs' since the
8502         method could also have `CallingConventions.HasThis'.
8503
8504 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8505
8506         * class.cs (Event.GetSignatureForError): Implemented.
8507         Fixed crash in error test cs3010.cs
8508
8509 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
8510
8511         * cs-tokenizer.cs: Change the way we track __arglist to be
8512         consistent with the other keywords.
8513
8514 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
8515
8516         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8517         tomorrow.
8518
8519 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
8520
8521         * codegen.cs: Check that all referenced assemblies have a strongname
8522         before strongnaming the compiled assembly. If not report error CS1577.
8523         Fix bug #56563. Patch by Jackson Harper.
8524         * typemanager.cs: Added a method to return all referenced assemblies.
8525         Fix bug #56563. Patch by Jackson Harper.
8526
8527 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8528
8529         * class.cs:
8530         (Method.ApplyAttributeBuilder): Moved and added conditional
8531         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8532
8533         * delegate.cs:
8534         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8535
8536 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8537
8538         Fixed #59640
8539         * class.cs: (EventField.attribute_targets): Changed default target.
8540
8541 2004-06-08  Martin Baulig  <martin@ximian.com>
8542
8543         * expression.cs (Invocation.EmitCall): Enable varargs methods.
8544
8545 2004-06-08  Martin Baulig  <martin@ximian.com>
8546
8547         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8548
8549 2004-06-07  Martin Baulig  <martin@ximian.com>
8550
8551         Added support for varargs methods.
8552
8553         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8554         keyword.
8555
8556         * cs-parser.jay: Added support for `__arglist'.
8557
8558         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8559
8560         * expression.cs (Argument.AType): Added `ArgList'.
8561         (Invocation): Added support for varargs methods.
8562         (ArglistAccess): New public class.
8563         (Arglist): New public class.
8564
8565         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8566
8567         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
8568         a method's top-level block if the method has varargs.
8569
8570         * support.cs (ReflectionParameters, InternalParameters): Added
8571         support for varargs methods.    
8572
8573 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
8574
8575         * class.cs: Provide location in indexer error report.
8576
8577         * driver.cs: Use standard names.
8578
8579         * namespace.cs: Catch the use of using after a namespace has been
8580         declared also on using aliases.
8581
8582 2004-06-03  Raja R Harinath  <rharinath@novell.com>
8583
8584         Bug #50820.
8585         * typemanager.cs (closure_private_ok, closure_invocation_type)
8586         (closure_qualifier_type, closure_invocation_assembly)
8587         (FilterWithClosure): Move to ...
8588         (Closure): New internal nested class.
8589         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8590         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8591         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8592         (MemberLookup, MemberLookupFailed): Use it.
8593         * expression.cs (New.DoResolve): Treat the lookup for the
8594         constructor as being qualified by the 'new'ed type.
8595         (Indexers.GetIndexersForTypeOrInterface): Update.
8596
8597 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
8598
8599         * attribute.cs
8600         (GetConditionalAttributeValue): New method. Returns
8601         condition of ConditionalAttribute.
8602         (SearchMulti): New method.  Returns all attributes of type 't'.
8603         Use it when attribute is AllowMultiple = true.
8604         (IsConditionalMethodExcluded): New method.
8605
8606         * class.cs
8607         (Method.IsExcluded): Implemented. Returns true if method has conditional
8608         attribute and the conditions is not defined (method is excluded).
8609         (IMethodData): Extended interface for ConditionalAttribute support.
8610         (PropertyMethod.IsExcluded): Implemented.
8611
8612         * decl.cs
8613         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8614
8615         * expression.cs
8616         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8617         on the method.
8618
8619 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8620
8621         * expression.cs (ArrayCreationExpression): Make this just an
8622         `expression'. It can't be a statement, so the code here was
8623         dead.
8624
8625 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8626
8627         Fixed #59072
8628         * typemanager.cs (GetFullNameSignature): New method for
8629         MethodBase types.
8630
8631 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8632
8633         Fixed #56452
8634         * class.cs (MemberBase.GetSignatureForError): New virtual method.
8635         Use this method when MethodBuilder is null.
8636         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8637         Added test for error CS0626 (MONO reports error for this situation).
8638         (IMethodData.GetSignatureForError): Extended interface.
8639
8640 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8641
8642         * attribute.cs
8643         (AttributeTester.GetObsoleteAttribute): Returns instance of
8644         ObsoleteAttribute when type is obsolete.
8645
8646         * class.cs
8647         (TypeContainer.VerifyObsoleteAttribute): Override.
8648         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8649         (MethodCode.VerifyObsoleteAttribute): Override.
8650         (MemberBase.VerifyObsoleteAttribute): Override.
8651
8652         * decl.cs
8653         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8654         and report proper error.
8655
8656         *delegate.cs
8657         Delegate.VerifyObsoleteAttribute): Override.
8658
8659         * ecore.cs
8660         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8661         and report proper error.
8662         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8663
8664         * enum.cs
8665         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8666         and enum member.
8667
8668         * expression.cs
8669         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8670         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8671         Added test for ObsoleteAttribute.
8672
8673         * statement.cs
8674         (Catch): Derived from Statement.
8675
8676 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8677  
8678         Fixed bug #59071 & cs0160.cs
8679  
8680         * statement.cs (Try.Resolve): Check here whether order of catch
8681         clauses matches their dependencies.
8682
8683 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
8684
8685         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
8686         caused a regression: #59343.  Referencing nested classes from an
8687         assembly stopped working.
8688
8689 2004-05-31  Martin Baulig  <martin@ximian.com>
8690
8691         MCS is now frozen for beta 2.
8692
8693 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8694
8695         * convert.cs: add a trivial cache for overload operator resolution.
8696
8697 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8698
8699         * decl.cs: If possible, use lookuptypedirect here. We can only do
8700         this if there is no `.' after the namespace. Avoids using
8701         LookupType, which does lots of slow processing.
8702         (FindNestedType) New method, does what it says :-).
8703         * namespace.cs: use LookupTypeDirect.
8704         * rootcontext.cs: use membercache, if possible.
8705         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8706
8707 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8708
8709         * expression.cs:
8710         According to the spec, 
8711
8712         In a member access of the form E.I, if E is a single identifier,
8713         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8714         field, property, localvariable, or parameter with the same type as
8715         the meaning of E as a type-name (§3.8), then both possible
8716         meanings of E are permitted.
8717
8718         We did not check that E as a simple-name had the same type as E as
8719         a type name.
8720
8721         This trivial check gives us 5-7% on bootstrap time.
8722
8723 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8724
8725         * expression.cs (Invocation.OverloadResolve): Avoid the
8726         use of hashtables and boxing here by allocating on demand.
8727
8728 2004-05-30  Martin Baulig  <martin@ximian.com>
8729
8730         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8731         we're doing a silent lookup.  Don't try to lookup nested types in
8732         TypeManager.object_type (thanks to Ben Maurer).
8733
8734 2004-05-30  Martin Baulig  <martin@ximian.com>
8735
8736         Committing a patch from Ben Maurer.
8737
8738         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8739
8740 2004-05-29  Martin Baulig  <martin@ximian.com>
8741
8742         * class.cs (IMethodData.ShouldIgnore): New method.
8743
8744         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8745         `Location' argument, we don't need it anywhere.  Use
8746         `IMethodData.ShouldIgnore ()' instead of
8747         `MethodData.GetMethodFlags ()'.
8748         (TypeManager.AddMethod): Removed.
8749         (TypeManager.AddMethod2): Renamed to AddMethod.
8750
8751 2004-05-29  Martin Baulig  <martin@ximian.com>
8752
8753         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8754
8755         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8756         converting from a class type S to an interface type and we already
8757         have an object on the stack, don't box it again.  Fixes #52578.
8758
8759 2004-05-29  Martin Baulig  <martin@ximian.com>
8760
8761         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8762         Added support for `params' parameters.  Fixes #59267.
8763
8764 2004-05-29  Martin Baulig  <martin@ximian.com>
8765
8766         * literal.cs (NullPointer): Provide a private .ctor which sets
8767         `type' to TypeManager.object_type.  Fixes #59048.
8768
8769 2004-05-29  Martin Baulig  <martin@ximian.com>
8770
8771         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8772         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8773
8774         * ecore.cs (EventExpr.instance_expr): Make the field private.
8775
8776 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8777
8778         Fixed bug #50080 & cs0214-2.cs
8779         * expression.cs (Cast.DoResolve): Check unsafe context here.
8780         
8781         * statement.cs (Resolve.DoResolve): Likewise.
8782
8783 2004-05-26  Martin Baulig  <martin@ximian.com>
8784
8785         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8786
8787         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8788         (RootContext.LookupType): Pass down the `silent' flag.
8789
8790 2004-05-25  Martin Baulig  <martin@ximian.com>
8791
8792         * expression.cs
8793         (MethodGroupExpr.IdenticalTypeName): New public property.
8794         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8795         expression actually refers to a type.
8796
8797 2004-05-25  Martin Baulig  <martin@ximian.com>
8798
8799         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8800         for #56176 and made it actually work.
8801
8802 2004-05-25  Martin Baulig  <martin@ximian.com>
8803
8804         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8805         (FieldExpr, PropertyExpr): Override and implement
8806         CacheTemporaries.  Fixes #52279.
8807
8808 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8809
8810         * location.cs: In the new compiler listing a file twice is a
8811         warning, not an error.
8812
8813 2004-05-24  Martin Baulig  <martin@ximian.com>
8814
8815         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8816         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8817
8818 2004-05-24  Martin Baulig  <martin@ximian.com>
8819
8820         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8821         walking the `using' list.  Fixes #53921.
8822
8823 2004-05-24  Martin Baulig  <martin@ximian.com>
8824
8825         * const.cs (Const.LookupConstantValue): Added support for
8826         EmptyCast's; fixes #55251.
8827
8828 2004-05-24  Martin Baulig  <martin@ximian.com>
8829
8830         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8831         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8832         which does the CS0135 check.  The reason is that we first need to
8833         check whether the variable actually exists.
8834
8835 2004-05-24  Martin Baulig  <martin@ximian.com>
8836
8837         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8838         than RootContext.LookupType() to find the explicit interface
8839         type.  Fixes #58584.
8840
8841 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8842
8843         * Makefile: Simplify.  Use executable.make.
8844         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8845
8846 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8847
8848         * decl.cs:
8849         * enum.cs:
8850         Use the invariant culture when doing String.Compare for CLS case
8851         sensitivity.
8852         
8853 2004-05-23  Martin Baulig  <martin@ximian.com>
8854
8855         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8856         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8857
8858         * namespace.cs (NamespaceEntry.Lookup): Likewise.
8859         
8860 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8861
8862         * class.cs (MemberBase.Define): Reuse MemberType member for 
8863         resolved type. Other methods can use it too.
8864
8865 2004-05-23  Martin Baulig  <martin@ximian.com>
8866
8867         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8868         the variable also exists in the current block (otherwise, we need
8869         to report a CS0103).  Fixes #58670.
8870
8871 2004-05-23  Martin Baulig  <martin@ximian.com>
8872
8873         * flowanalysis.cs (Reachability.Reachable): Compute this
8874         on-the-fly rather than storing it as a field.
8875
8876 2004-05-23  Martin Baulig  <martin@ximian.com>
8877
8878         * flowanalysis.cs (Reachability.And): Manually compute the
8879         resulting `barrier' from the reachability.      
8880        
8881 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8882
8883         Fix bug #57835
8884         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8885         instance of ObsoleteAttribute when symbol is obsolete.
8886
8887         * class.cs
8888         (IMethodData): Extended interface for ObsoleteAttribute support.
8889
8890 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8891
8892         * attribute.cs: Fix bug #55970
8893
8894 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8895
8896         Fix bug #52705
8897         * attribute.cs
8898         (GetObsoleteAttribute): New method. Creates the instance of
8899         ObsoleteAttribute.
8900         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8901         ObsoleteAttribute when member is obsolete.
8902         (AttributeTester.Report_ObsoleteMessage): Common method for
8903         Obsolete error/warning reporting.
8904
8905         * class.cs
8906         (TypeContainer.base_classs_type): New member for storing parent type.
8907
8908         * decl.cs
8909         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8910         for this MemberCore.
8911
8912 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8913
8914         * attribute.cs, const.cs: Fix bug #58590
8915
8916 2004-05-21  Martin Baulig  <martin@ximian.com>
8917
8918         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8919         out parameters if the end of the method is unreachable.  Fixes
8920         #58098. 
8921
8922 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8923
8924         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8925         Hari was right, why extra method.
8926
8927 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8928
8929         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8930
8931 2004-05-20  Martin Baulig  <martin@ximian.com>
8932
8933         Merged this back from gmcs to keep the differences to a minumum.
8934
8935         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8936         instead of a Declspace.
8937         (Attribute.ResolveType): Likewise.
8938         (Attributes.Search): Likewise.
8939         (Attributes.Contains): Likewise.
8940         (Attributes.GetClsCompliantAttribute): Likewise.
8941
8942         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8943         argument.
8944         (MethodData.ApplyAttributes): Take an EmitContext instead of a
8945         DeclSpace.
8946
8947 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8948
8949         Fix bug #58688 (MCS does not report error when the same attribute
8950         is assigned twice)
8951
8952         * attribute.cs (Attribute.Emit): Distinction between null and default.
8953
8954 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8955
8956         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8957         of a top-level attribute without an attribute target.
8958         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8959         Make non-static.
8960         (Attribute.Conditional_GetConditionName), 
8961         (Attribute.Obsolete_GetObsoleteMessage): Update.
8962         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8963         part of ScanForIndexerName.
8964         (Attribute.CanIgnoreInvalidAttribute): New function.
8965         (Attribute.ScanForIndexerName): Move to ...
8966         (Attributes.ScanForIndexerName): ... here.
8967         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8968         (Attributes.Search): New internal variant that can choose not to
8969         complain if types aren't resolved.  The original signature now
8970         complains.
8971         (Attributes.GetClsCompliantAttribute): Use internal variant, with
8972         complaints suppressed.
8973         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8974         only if it not useful.
8975         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8976         top-level for attributes that are shared between the assembly
8977         and a top-level class.
8978         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8979         * class.cs: Update to reflect changes.
8980         (DefineIndexers): Fuse loops.
8981         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
8982         a couple more variants of attribute names.
8983
8984 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
8985
8986         Fix bug #52585 (Implemented explicit attribute declaration)
8987
8988         * attribute.cs:
8989         (Attributable.ValidAttributeTargets): New abstract method. It gets
8990         list of valid attribute targets for explicit target declaration.
8991         (Attribute.Target): It holds target itself.
8992         (AttributeSection): Removed.
8993         (Attribute.CheckTargets): New method. It checks whether attribute
8994         target is valid for the current element.
8995
8996         * class.cs:
8997         (EventProperty): New class. For events that are declared like
8998         property (with add and remove accessors).
8999         (EventField): New class. For events that are declared like field.
9000         class.cs
9001
9002         * cs-parser.jay: Implemented explicit attribute target declaration.
9003
9004         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9005         Override ValidAttributeTargets.
9006
9007         * parameter.cs:
9008         (ReturnParameter): Class for applying custom attributes on 
9009         the return type.
9010         (ParameterAtribute): New class. Class for applying custom
9011         attributes on the parameter type.
9012
9013 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9014
9015         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9016         definitions. 
9017
9018         (Method): Allow UNSAFE here.
9019
9020         * modifiers.cs: Support unsafe reporting.
9021
9022 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9023
9024         * decl.cs: Fix bug #58478.
9025
9026 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9027
9028         * statement.cs: When checking for unreachable code on an EmptyStatement,
9029         set the location. Fixes bug #58488.
9030
9031 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9032
9033         * driver.cs: Add -pkg handling.
9034
9035         From Gonzalo: UseShelLExecute=false
9036
9037 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9038
9039         * attribute.cs:
9040         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9041         for attribute.
9042         (Attribute.IsClsCompliaceRequired): Moved to base for better
9043         accesibility.
9044         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9045         when attribute is AttributeUsageAttribute.
9046         (Attribute.GetValidTargets): Simplified.
9047         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9048         attribute for this type.
9049         (Attribute.ApplyAttributes): Method renamed to Emit and make
9050         non-static.
9051         (GlobalAttributeSection): New class for special handling of global
9052         attributes (assembly, module).
9053         (AttributeSection.Emit): New method.
9054
9055         * class.cs: Implemented Attributable abstract methods.
9056         (MethodCore.LabelParameters): Moved to Parameter class.
9057         (Accessor): Is back simple class.
9058         (PropertyMethod): Implemented Attributable abstract class.
9059         (DelegateMethod): Implemented Attributable abstract class.
9060         (Event): New constructor for disctintion between normal Event
9061         and Event with accessors.
9062
9063         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9064
9065         * codegen.cs, const.cs, decl.cs, delegate.cs:
9066         (CommonAssemblyModulClass): Implemented Attributable abstract class
9067         and simplified.
9068
9069         * enum.cs: Implement IAttributeSupport interface.
9070         (EnumMember): New class for emum members. Implemented Attributable
9071         abstract class
9072
9073         * parameter.cs:
9074         (ParameterBase): Is abstract.
9075         (ReturnParameter): New class for easier [return:] attribute handling.
9076
9077         * typemanager.cs: Removed builder_to_attr.
9078
9079 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9080
9081         Fix bug #57151.
9082         * attribute.cs (Attribute.GetPositionalValue): New function.
9083         * class.cs (TypeContainer.VerifyMembers): New function.
9084         (TypeContainer.Emit): Use it.
9085         (ClassOrStruct): New base class for Class and Struct.
9086         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9087         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9088         class.
9089         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9090         then each non-static field should have a FieldOffset attribute.
9091         Otherwise, none of the fields should have a FieldOffset attribute.
9092         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9093         and FieldOffset attributes.
9094         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9095         (TypeManager.field_offset_attribute_type): New core types.
9096         (TypeManager.InitCoreTypes): Initialize them.
9097
9098 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9099
9100         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9101         Return correct type.
9102         From bug #58270.
9103
9104 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9105
9106         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9107         be implicitly converted to ulong.
9108         
9109         * expression.cs: The logic for allowing operator &, | and ^ worked
9110         was wrong, it worked before because we did not report an error in
9111         an else branch.  Fixes 57895.
9112
9113         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9114         allow volatile fields to be reference types.
9115
9116 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9117
9118         * driver.cs: Add support for /debug-
9119
9120 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9121
9122         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9123         Add a 'complain' parameter to silence errors.
9124         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9125         silently overlooked type-resolutions.
9126         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9127         to reflect changes.
9128         (Attributes.Search): New function.
9129         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9130         (Attributes.GetAttributeFullName): Remove hack.
9131         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9132         Update to reflect changes.
9133         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9134         Use Attributes.Search instead of nested loops.
9135
9136 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9137
9138         * decl.cs:
9139         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9140         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9141         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9142
9143         * report.cs: (Report.Warning): Renamed to Warning_T because of
9144         parameter collision.
9145
9146 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9147
9148         * expression.cs (MemberAccess.ResolveMemberAccess):
9149         Exit with non-zero status after Report.Error.
9150         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9151         Likewise.
9152         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9153
9154 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9155
9156         * support.cs: Don't hang when the file is empty.
9157
9158 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9159
9160         * support.cs: In SeekableStreamReader, compute the preamble size of the
9161           underlying stream. Position changes should take into account that initial
9162           count of bytes.
9163
9164 2004-05-03  Todd Berman  <tberman@sevenl.net>
9165
9166         * driver.cs: remove unused GetSysVersion function.
9167
9168 2004-05-03  Todd Berman  <tberman@sevenl.net>
9169
9170         * driver.cs: Remove the hack from saturday, as well as the hack
9171         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9172         link_paths to get that bit proper.
9173
9174 2004-05-01  Todd Berman  <tberman@sevenl.net>
9175
9176         * driver.cs: Try a LoadFrom before a Load, this checks the current
9177         path. This is currently a bug in mono that is be fixed, however, this
9178         provides a workaround for now. This will be removed when the bug
9179         is fixed.
9180
9181 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9182
9183         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9184         incomplete key pairs (#57941).
9185
9186 2004-05-01  Todd Berman  <tberman@sevenl.net>
9187
9188         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9189         from the GAC
9190
9191 2004-04-30  Jackson Harper  <jackson@ximian.com>
9192
9193         * codegen.cs: Open keys readonly.
9194         
9195 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9196
9197         * typemanager.cs: don't report cyclic struct layout when a struct
9198         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9199         which has 2 Pango.Rectangle fields.
9200
9201 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9202
9203         * expression.cs: Handle IntPtr comparisons with IL code
9204         rather than a method call.
9205
9206 2004-04-29  Martin Baulig  <martin@ximian.com>
9207
9208         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9209         the list of PropertyInfo's in class hierarchy and find the
9210         accessor.  Fixes #56013.
9211
9212 2004-04-29  Martin Baulig  <martin@ximian.com>
9213
9214         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9215
9216 2004-04-29  Martin Baulig  <martin@ximian.com>
9217
9218         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9219
9220         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9221
9222 2004-04-29  Martin Baulig  <martin@ximian.com>
9223
9224         * class.cs (ConstructorInitializer.Resolve): Check whether the
9225         parent .ctor is accessible.  Fixes #52146.
9226
9227 2004-04-29  Martin Baulig  <martin@ximian.com>
9228
9229         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9230
9231         * statement.cs (Using.EmitLocalVariableDecls): Use
9232         TypeManager.idisposable_type, not typeof (IDisposable).
9233         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9234
9235 2004-04-29  Martin Baulig  <martin@ximian.com>
9236
9237         * class.cs (Event.Define): Don't emit the field and don't set
9238         RTSpecialName and SpecialName for events on interfaces.  Fixes
9239         #57703. 
9240
9241 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9242
9243         Refactor Attribute.ApplyAttributes.
9244         * attribute.cs (Attributable): New base class for objects that can
9245         have Attributes applied on them.
9246         (Attribute): Make AttributeUsage fields public.
9247         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9248         (Attribute.IsInternalCall): New property.
9249         (Attribute.UsageAttr): Convert to a public read-only property.
9250         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9251         (Attribute.ResolveType, Attribute.Resolve)
9252         (Attribute.ScanForIndexerName): Update to reflect changes.
9253         (Attribute.CheckAttributeTarget): Re-format.
9254         (Attribute.ApplyAttributes): Refactor, to various
9255         Attributable.ApplyAttributeBuilder methods.
9256         * decl.cs (MemberCore): Make Attributable.
9257         * class.cs (Accessor): Make Attributable.
9258         (MethodData.ApplyAttributes): Use proper attribute types, not
9259         attribute names.
9260         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9261         (TypeContainer.ApplyAttributeBuilder)
9262         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9263         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9264         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9265         (Operator.ApplyAttributeBuilder): New factored-out methods.
9266         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9267         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9268         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9269         * parameter.cs (ParameterBase): New Attributable base class
9270         that can also represent Return types.
9271         (Parameter): Update to the changes.
9272
9273 2004-04-29  Jackson Harper  <jackson@ximian.com>
9274
9275         * driver.cs: Prefer the corlib system version when looking for
9276         assemblies in the GAC. This is still a hack, but its a better hack
9277         now.
9278         
9279 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9280
9281         * decl.cs, enum.cs: Improved error 3005 reporting.
9282   
9283         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9284         (related_symbols): New private member for list of symbols
9285         related to reported error/warning.
9286         
9287         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9288
9289 2004-04-29  Martin Baulig  <martin@ximian.com>
9290
9291         * ecore.cs (Expression.Constantify): If we're an enum and
9292         TypeManager.TypeToCoreType() doesn't give us another type, use
9293         t.UnderlyingSystemType.  Fixes #56178.  
9294
9295 2004-04-29  Martin Baulig  <martin@ximian.com>
9296
9297         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9298         interfaces and for each interface, only add members directly
9299         declared in that interface.  Fixes #53255.
9300
9301 2004-04-28  Martin Baulig  <martin@ximian.com>
9302
9303         * expression.cs (ConditionalLogicalOperator): Use a temporary
9304         variable for `left' to avoid that we evaluate it more than once;
9305         bug #52588.
9306
9307 2004-04-28  Martin Baulig  <martin@ximian.com>
9308
9309         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9310         `void[]' (CS1547).
9311
9312 2004-04-28  Martin Baulig  <martin@ximian.com>
9313
9314         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9315         void (CS1547).
9316
9317         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9318         whether the type is not void (CS1547).
9319
9320 2004-04-28  Martin Baulig  <martin@ximian.com>
9321
9322         * expression.cs (Unary.DoResolveLValue): Override this and report
9323         CS0131 for anything but Operator.Indirection.
9324
9325 2004-04-28  Martin Baulig  <martin@ximian.com>
9326
9327         Committing a patch from Ben Maurer; see bug #50820.
9328
9329         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9330         check for classes.
9331
9332         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9333         classes.        
9334
9335 2004-04-28  Martin Baulig  <martin@ximian.com>
9336
9337         Committing a patch from Ben Maurer; see bug #50820.
9338
9339         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9340         check for classes.
9341
9342         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9343         classes.        
9344
9345 2004-04-28  Martin Baulig  <martin@ximian.com>
9346
9347         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9348         (Block.AddLabel): Call DoLookupLabel() to only search in the
9349         current block.
9350
9351 2004-04-28  Martin Baulig  <martin@ximian.com>
9352
9353         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9354         comparing StringConstants and NullLiterals in Equality and Inequality.
9355
9356 2004-04-28  Jackson Harper  <jackson@ximian.com>
9357
9358         * driver.cs: Attempt to load referenced assemblies from the
9359         GAC. This is the quick and dirty version of this method that
9360         doesnt take into account versions and just takes the first
9361         canidate found. Will be good enough for now as we will not have more
9362         then one version installed into the GAC until I update this method.
9363
9364 2004-04-28  Martin Baulig  <martin@ximian.com>
9365
9366         * typemanager.cs (TypeManager.CheckStructCycles): New public
9367         static method to check for cycles in the struct layout.
9368
9369         * rootcontext.cs (RootContext.PopulateTypes): Call
9370         TypeManager.CheckStructCycles() for each TypeContainer.
9371         [Note: We only need to visit each type once.]
9372
9373 2004-04-28  Martin Baulig  <martin@ximian.com>
9374
9375         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9376
9377         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9378         success and added `out object value'.  Use a `bool resolved' field
9379         to check whether we've already been called rather than
9380         `ConstantValue != null' since this breaks for NullLiterals.
9381
9382 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9383
9384         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9385         setting of this flag, since the 'set' method may be non-public.
9386
9387 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9388
9389         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9390         check on current_vector.Block.
9391
9392 2004-04-27  Martin Baulig  <martin@ximian.com>
9393
9394         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9395         a field initializer.  Fixes #56459.
9396
9397 2004-04-27  Martin Baulig  <martin@ximian.com>
9398
9399         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9400         we're not attempting to use an indexer.  Fixes #52154.
9401
9402 2004-04-27  Martin Baulig  <martin@ximian.com>
9403
9404         * statement.cs (Return): Don't create a return label if we don't
9405         need it; reverts my change from January 20th.  Thanks to Ben
9406         Maurer for this.
9407
9408 2004-04-27  Martin Baulig  <martin@ximian.com>
9409
9410         According to the spec, `goto' can only leave a nested scope, but
9411         never enter it.
9412
9413         * statement.cs (Block.LookupLabel): Only lookup in the current
9414         block, don't recurse into parent or child blocks.
9415         (Block.AddLabel): Check in parent and child blocks, report
9416         CS0140/CS0158 if we find a duplicate.
9417         (Block): Removed this indexer for label lookups.
9418         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9419         this already does the error reporting for us.
9420
9421         * flowanalysis.cs
9422         (FlowBranching.UsageVector.Block): New public variable; may be null.
9423         (FlowBranching.CreateSibling): Added `Block' argument.
9424         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9425         label for the target of a `goto' and check whether we're not
9426         leaving a `finally'.
9427
9428 2004-04-27  Martin Baulig  <martin@ximian.com>
9429
9430         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9431         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9432         just for returns).
9433
9434 2004-04-27  Martin Baulig  <martin@ximian.com>
9435
9436         * statement.cs (Block.AddLabel): Also check for implicit blocks
9437         and added a CS0158 check.
9438
9439 2004-04-27  Martin Baulig  <martin@ximian.com>
9440
9441         * flowanalysis.cs (FlowBranchingLoop): New class.
9442         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9443         UsageVector's instead of an ArrayList.
9444         (FlowBranching.Label): Likewise.
9445         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9446         (FlowBranching.AddBreakVector): New method.
9447
9448 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9449
9450         * attribute.cs: Small regression fix: only convert the type if we
9451         the type is different, fixes System.Drawing build.
9452
9453 2004-04-27  Martin Baulig  <martin@ximian.com>
9454
9455         * attribute.cs (Attribute.Resolve): If we have a constant value
9456         for a named field or property, implicity convert it to the correct
9457         type.
9458
9459 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9460
9461         * statement.cs (Block.Block): Implicit blocks share
9462         'child_variable_names' fields with parent blocks.
9463         (Block.AddChildVariableNames): Remove.
9464         (Block.AddVariable): Mark variable as "used by a child block" in
9465         every surrounding block.
9466         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9467         been used in a child block, complain about violation of "Invariant
9468         meaning in blocks" rule.
9469         * cs-parser.jay (declare_local_variables): Don't use
9470         AddChildVariableNames.
9471         (foreach_statement): Don't create an implicit block: 'foreach'
9472         introduces a scope.
9473
9474 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9475
9476         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9477         converting from 0L to ulong.  Fixes 57522.
9478
9479 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9480
9481         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9482         derived class hides via 'new' keyword field from base class (test-242.cs).
9483         TODO: Handle this in the more general way.
9484         
9485         * class.cs (CheckBase): Ditto.
9486
9487 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9488
9489         * decl.cs (caching_flags): New member for storing cached values
9490         as bit flags.
9491         (MemberCore.Flags): New enum where bit flags for caching_flags
9492         are defined.
9493         (MemberCore.cls_compliance): Moved to caching_flags.
9494         (DeclSpace.Created): Moved to caching_flags.
9495
9496         * class.cs: Use caching_flags instead of DeclSpace.Created
9497         
9498 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9499
9500         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9501         if we are only a derived class, not a nested class.
9502
9503         * typemanager.cs: Same as above, but do this at the MemberLookup
9504         level (used by field and methods, properties are handled in
9505         PropertyExpr).   Allow for the qualified access if we are a nested
9506         method. 
9507
9508 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9509
9510         * class.cs: Refactoring.
9511         (IMethodData): New inteface; Holds links to parent members
9512         to avoid member duplication (reduced memory allocation).
9513         (Method): Implemented IMethodData interface.
9514         (PropertyBase): New inner classes for get/set methods.
9515         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9516         (Event): New inner classes for add/remove methods.
9517         (Event.DelegateMethod): Implemented IMethodData interface.
9518
9519         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9520         EmitContext (related to class.cs refactoring).
9521
9522 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9523
9524         * delegate.cs (Delegate.VerifyApplicability): If the number of
9525         arguments are the same as the number of parameters, first try to
9526         verify applicability ignoring  any 'params' modifier on the last
9527         parameter.
9528         Fixes #56442.
9529
9530 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9531
9532         * class.cs (TypeContainer.AddIndexer): Use
9533         'ExplicitInterfaceName' to determine if interface name was
9534         explicitly specified.  'InterfaceType' is not initialized at this time.
9535         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9536         Indexers array is already in the required order.  Initialize
9537         'IndexerName' only if there are normal indexers.
9538         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9539         (TypeContainer.Emit): Emit DefaultMember attribute only if
9540         IndexerName is initialized.
9541         Fixes #56300.
9542
9543 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9544
9545         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9546         Fixes #57007
9547
9548 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9549
9550         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9551         attributes.
9552         Fix for #56456.
9553
9554         * attribute.cs (Attribute.Resolve): Check for duplicate named
9555         attributes.
9556         Fix for #56463.
9557
9558 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9559
9560         * iterators.cs (MarkYield): track whether we are in an exception,
9561         and generate code accordingly.  Use a temporary value to store the
9562         result for our state.
9563
9564         I had ignored a bit the interaction of try/catch with iterators
9565         since their behavior was not entirely obvious, but now it is
9566         possible to verify that our behavior is the same as MS .NET 2.0
9567
9568         Fixes 54814
9569
9570 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9571
9572         * iterators.cs: Avoid creating temporaries if there is no work to
9573         do. 
9574
9575         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9576         Enumerations, use TypeManager.EnumToUnderlying and call
9577         recursively. 
9578
9579         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9580         bug #57013
9581
9582         (This.Emit): Use EmitContext.EmitThis to emit our
9583         instance variable.
9584
9585         (This.EmitAssign): Ditto.
9586
9587         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9588         codepaths, we will move all the functionality into
9589         Mono.CSharp.This 
9590
9591         (FieldExpr.EmitAssign): Ditto.
9592
9593         This fixes several hidden bugs that I uncovered while doing a code
9594         review of this today.
9595
9596         * codegen.cs (EmitThis): reworked so the semantics are more clear
9597         and also support value types "this" instances.
9598
9599         * iterators.cs: Changed so that for iterators in value types, we
9600         do not pass the value type as a parameter.  
9601
9602         Initialization of the enumerator helpers is now done in the caller
9603         instead of passing the parameters to the constructors and having
9604         the constructor set the fields.
9605
9606         The fields have now `assembly' visibility instead of private.
9607
9608 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9609
9610         * expression.cs (Argument.Resolve): Check if fields passed as ref
9611         or out are contained in a MarshalByRefObject.
9612
9613         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9614         another compiler type.
9615
9616 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9617
9618         * class.cs (Indexer.Define): use the new name checking method.
9619         Also, return false on an error.
9620         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9621         (is_identifier_[start/part]_character): make static.
9622
9623 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9624
9625         * expression.cs (Binary.ResolveOperator): Do no append strings
9626         twice: since we can be invoked more than once (array evaluation)
9627         on the same concatenation, take care of this here.  Based on a fix
9628         from Ben (bug #56454)
9629
9630 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9631
9632         * codegen.cs: Fix another case where CS1548 must be reported (when 
9633         delay-sign isn't specified and no private is available #56564). Fix
9634         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9635         error when MCS is used on the MS runtime and we need to delay-sign 
9636         (which seems unsupported by AssemblyBuilder - see #56621).
9637
9638 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9639
9640         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9641         (TypeManager.ComputeNamespaces): Faster implementation for
9642         Microsoft runtime.
9643
9644         * compiler.csproj: Updated AssemblyName to mcs.
9645
9646 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9647
9648         * rootcontext.cs: Add new types to the boot resolution.
9649
9650         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9651         MulticastDelegate is not allowed.
9652
9653         * typemanager.cs: Add new types to lookup: System.TypedReference
9654         and ArgIterator.
9655
9656         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9657         check for TypedReference or ArgIterator, they are not allowed. 
9658
9659         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9660         makes us properly catch 1510 in some conditions (see bug 56016 for
9661         details). 
9662
9663 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9664
9665         * CryptoConvert.cs: update from corlib version
9666         with endian fixes.
9667
9668 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9669
9670         * class.cs (Indexer.Define): Check indexername declaration
9671
9672 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9673
9674         * attribute.cs (IsClsCompliant): Fixed problem with handling
9675         all three states (compliant, not-compliant, undetected).
9676
9677 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9678
9679         * attribute.cs (Attribute): Location is now public.
9680         (Resolve): Store resolved arguments (pos_values) in attribute class.
9681         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9682         (GetClsCompliantAttributeValue): New method that gets
9683         CLSCompliantAttribute value.
9684         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9685         if exists else null.
9686         (AttributeTester): New class for CLS-Compliant verification routines.
9687
9688         * class.cs (Emit): Add CLS-Compliant verification.
9689         (Method.GetSignatureForError): Implemented.
9690         (Constructor.GetSignatureForError): Implemented
9691         (Constructor.HasCompliantArgs): Returns if constructor has
9692         CLS-Compliant arguments.
9693         (Constructor.Emit): Override.
9694         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9695         is needed to test only parameters.
9696         (FieldBase.GetSignatureForError): Implemented.
9697         (TypeContainer): New member for storing base interfaces.
9698         (TypeContainer.FindMembers): Search in base interfaces too.
9699
9700         * codegen.cs (GetClsComplianceAttribute): New method that gets
9701         assembly or module CLSCompliantAttribute value.
9702         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9703         for assembly.
9704         (ModuleClass.Emit): Add error 3012 test.
9705
9706         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9707
9708         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9709         state for all decl types.
9710         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9711         if CLS-Compliant tests are required.
9712         (IsClsCompliaceRequired): New method. Analyze whether code
9713         must be CLS-Compliant.
9714         (IsExposedFromAssembly): New method. Returns true when MemberCore
9715         is exposed from assembly.
9716         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9717         value or gets cached value.
9718         (HasClsCompliantAttribute): New method. Returns true if MemberCore
9719         is explicitly marked with CLSCompliantAttribute.
9720         (IsIdentifierClsCompliant): New abstract method. This method is
9721         used to testing error 3005.
9722         (IsIdentifierAndParamClsCompliant): New method. Common helper method
9723         for identifier and parameters CLS-Compliant testing.
9724         (VerifyClsCompliance): New method. The main virtual method for
9725         CLS-Compliant verifications.
9726         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9727         null. I don't know why is null (too many public members !).
9728         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9729         and get value of first CLSCompliantAttribute that found.
9730
9731         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9732         (VerifyClsCompliance): Override and add extra tests.
9733
9734         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9735         clscheck- disable CLS-Compliant verification event if assembly is has
9736         CLSCompliantAttribute(true).
9737
9738         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9739         ApllyAttribute is now called in emit section as in the other cases.
9740         Possible future Emit integration.
9741         (IsIdentifierClsCompliant): New override.
9742         (VerifyClsCompliance): New override.
9743         (GetEnumeratorName): Returns full enum name.
9744
9745         * parameter.cs (GetSignatureForError): Implemented.
9746
9747         * report.cs (WarningData): New struct for Warning message information.
9748         (LocationOfPreviousError): New method.
9749         (Warning): New method. Reports warning based on the warning table.
9750         (Error_T): New method. Reports error based on the error table.
9751
9752         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9753         verifications are done here.
9754
9755         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9756
9757         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9758         CLSCompliantAttribute.
9759         (all_imported_types): New member holds all imported types from other
9760         assemblies.
9761         (LoadAllImportedTypes): New method fills static table with exported types
9762         from all referenced assemblies.
9763         (Modules): New property returns all assembly modules.
9764
9765 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
9766
9767         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9768         throwing a parser error.
9769
9770         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9771         which removes the hardcoded get_/set_ prefixes for properties, as
9772         IL allows for the properties to be named something else.  
9773
9774         Bug #56013
9775
9776         * expression.cs: Do not override operand before we know if it is
9777         non-null.  Fix 56207
9778
9779 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9780
9781         * typemanager.cs: support for pinned variables.
9782
9783 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9784
9785         * decl.cs, typemanager.cs: Avoid using an arraylist
9786         as a buffer if there is only one result set.
9787
9788 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9789
9790         * expression.cs: Make sure you cant call a static method
9791         with an instance expression, bug #56174.
9792
9793 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
9794
9795         * class.cs (IsDuplicateImplementation): Improve error reporting to
9796         flag 663 (method only differs in parameter modifier).
9797
9798         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9799         in preprocessor directives.
9800
9801         * location.cs (LookupFile): Allow for the empty path.
9802
9803         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
9804         better approach for some of that patch, but its failing with the
9805         CharSet enumeration.  For now try/catch will do.
9806
9807         * typemanager.cs: Do not crash if a struct does not have fields.
9808         Fixes 56150.
9809
9810 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9811
9812         * expression.cs: cs0213, cant fix a fixed expression.
9813         fixes 50231.
9814
9815 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9816
9817         * cs-parser.jay: detect invalid embeded statements gracefully.
9818         bug #51113.
9819
9820 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9821
9822         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9823         As a regex:
9824         s/
9825         the invocation type may not be a subclass of the tye of the item/
9826         The type of the item must be a subclass of the invocation item.
9827         /g
9828
9829         Fixes bug #50820.
9830
9831 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
9832
9833         * attribute.cs: Added methods to get a string and a bool from an
9834         attribute. Required to information from AssemblyKeyFileAttribute,
9835         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9836         * codegen.cs: Modified AssemblyName creation to include support for
9837         strongnames. Catch additional exceptions to report them as CS1548.
9838         * compiler.csproj: Updated include CryptoConvert.cs.
9839         * compiler.csproj.user: Removed file - user specific configuration.
9840         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
9841         Mono.Security assembly. The original class is maintained and tested in
9842         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9843         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9844         like CSC 8.0 (C# v2) supports.
9845         * Makefile: Added CryptoConvert.cs to mcs sources.
9846         * rootcontext.cs: Added new options for strongnames.
9847
9848 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
9849
9850         * driver.cs: For --expect-error, report error code `2'
9851         if the program compiled with no errors, error code `1' if
9852         it compiled with an error other than the one expected.
9853
9854 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
9855
9856         * compiler.csproj: Updated for Visual Studio .NET 2003.
9857         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9858         * compiler.sln: Updated for Visual Studio .NET 2003.
9859
9860 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
9861
9862         * expression.cs: Fix bug #47234. We basically need to apply the
9863         rule that we prefer the conversion of null to a reference type
9864         when faced with a conversion to 'object' (csc behaviour).
9865
9866 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9867
9868         * statement.cs: Shorter form for foreach, eliminates
9869         a local variable. r=Martin.
9870
9871 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9872
9873         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9874         checks if we can use brtrue/brfalse to test for 0.
9875         * expression.cs: use the above in the test for using brtrue/brfalse.
9876         cleanup code a bit.
9877
9878 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9879
9880         * expression.cs: Rewrite string concat stuff. Benefits:
9881
9882         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9883         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9884         rather than a concat chain.
9885
9886         * typemanager.cs: Add lookups for more concat overloads.
9887
9888 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9889
9890         * expression.cs: Emit shorter il code for array init.
9891
9892         newarr
9893         dup
9894         // set 1
9895
9896         // set 2
9897
9898         newarr
9899         stloc.x
9900
9901         ldloc.x
9902         // set 1
9903
9904         ldloc.x
9905         // set 2
9906
9907 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
9908
9909         * statement.cs: Before, two switch blocks would be merged if the
9910         total size of the blocks (end_item - begin_item + 1) was less than
9911         two times the combined sizes of the blocks.
9912
9913         Now, it will only merge if after the merge at least half of the
9914         slots are filled.
9915
9916         fixes 55885.
9917
9918 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
9919
9920         * class.cs : csc build fix for GetMethods(). See bug #52503.
9921
9922 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
9923
9924         * expression.cs: Make sure fp comparisons work with NaN.
9925         This fixes bug #54303. Mig approved this patch a long
9926         time ago, but we were not able to test b/c the runtime
9927         had a related bug.
9928
9929 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
9930
9931         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
9932
9933 2004-03-19  Martin Baulig  <martin@ximian.com>
9934
9935         * class.cs (MemberCore.IsDuplicateImplementation): Report the
9936         error here and not in our caller.
9937
9938 2004-03-19  Martin Baulig  <martin@ximian.com>
9939
9940         * interface.cs: Completely killed this file.
9941         (Interface): We're now a TypeContainer and live in class.cs.
9942
9943         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9944         argument; we're now also called for interfaces.
9945         (TypeContainer.DefineMembers): Allow this method being called
9946         multiple times.
9947         (TypeContainer.GetMethods): New public method; formerly known as
9948         Interface.GetMethod().  This is used by PendingImplementation.
9949         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9950         it's now private and non-static.
9951         (Interface): Moved this here; it's now implemented similar to
9952         Class and Struct.
9953         (Method, Property, Event, Indexer): Added `bool is_interface'
9954         argument to their .ctor's.
9955         (MemberBase.IsInterface): New public field.
9956
9957         * cs-parser.jay: Create normal Method, Property, Event, Indexer
9958         instances instead of InterfaceMethod, InterfaceProperty, etc.
9959         (opt_interface_base): Removed; we now use `opt_class_base' instead.
9960         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9961
9962 2004-03-19  Martin Baulig  <martin@ximian.com>
9963
9964         * class.cs (MethodCore.IsDuplicateImplementation): New private
9965         method which does the CS0111 checking.
9966         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9967         Use IsDuplicateImplementation().
9968
9969 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9970
9971         * decl.cs (FindMemberToOverride): New method to find the correct
9972         method or property to override in the base class.
9973         * class.cs
9974             - Make Method/Property use the above method to find the
9975               version in the base class.
9976             - Remove the InheritableMemberSignatureCompare as it is now
9977               dead code.
9978
9979         This patch makes large code bases much faster to compile, as it is
9980         O(n) rather than O(n^2) to do this validation.
9981
9982         Also, it fixes bug 52458 which is that nested classes are not
9983         taken into account when finding the base class member.
9984
9985         Reviewed/Approved by Martin.
9986
9987 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
9988
9989         * interface.cs: In all interface classes removed redundant
9990         member initialization.
9991
9992 2004-03-16  Martin Baulig  <martin@ximian.com>
9993
9994         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9995
9996 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9997
9998         * decl.cs (DefineTypeAndParents): New helper method to define a
9999         type's containers before the type itself is defined;  This is a
10000         bug exposed by the recent changes to Windows.Forms when an
10001         implemented interface was defined inside a class that had not been
10002         built yet.   
10003
10004         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10005
10006         (Check): Loop correctly to report errors modifiers
10007         (UNSAFE was not in the loop, since it was the same as TOP).
10008
10009         * interface.cs: Every interface member now takes a ModFlags,
10010         instead of a "is_new" bool, which we set on the base MemberCore. 
10011
10012         Every place where we called "UnsafeOk" in the interface, now we
10013         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10014         the unsafe settings from the member declaration instead of the
10015         container interface. 
10016
10017         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10018
10019         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10020         `set_indexer_name' to the pending bits (one per type).
10021
10022         We fixed a bug today that was picking the wrong method to
10023         override, since for properties the existing InterfaceMethod code
10024         basically ignored the method name.  Now we make sure that the
10025         method name is one of the valid indexer names.
10026
10027 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10028  
10029         * support.cs (SeekableStreamReader): Keep track of stream byte
10030         positions and don't mix them with character offsets to the buffer.
10031
10032         Patch from Gustavo Giráldez
10033
10034 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10035
10036         * interface.cs (InterfaceSetGetBase): Removed double member
10037         initialization, base class does it as well.
10038
10039 2004-03-13  Martin Baulig  <martin@ximian.com>
10040
10041         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10042         when compiling corlib.
10043
10044 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10045
10046         * convert.cs (ExplicitConversion): We were reporting an error on
10047         certain conversions (object_type source to a value type, when the
10048         expression was `null') before we had a chance to pass it through
10049         the user defined conversions.
10050
10051         * driver.cs: Replace / and \ in resource specifications to dots.
10052         Fixes 50752
10053
10054         * class.cs: Add check for duplicate operators.  Fixes 52477
10055
10056 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10057
10058         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10059         that are in the middle of the statements, not only at the end.
10060         Fixes #54987
10061
10062         * class.cs (TypeContainer.AddField): No longer set the
10063         `HaveStaticConstructor' flag, now we call it
10064         `UserDefineStaticConstructor' to diferentiate the slightly
10065         semantic difference.
10066
10067         The situation is that we were not adding BeforeFieldInit (from
10068         Modifiers.TypeAttr) to classes that could have it.
10069         BeforeFieldInit should be set to classes that have no static
10070         constructor. 
10071
10072         See:
10073
10074         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10075
10076         And most importantly Zoltan's comment:
10077
10078         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10079
10080         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10081          before its static fields are used', i.e. initialization does not need
10082          to be triggered by the first access to the type. Setting this flag
10083          helps the JIT to compile better code, since it can run the static
10084          constructor at JIT time, and does not need to generate code to call it
10085          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10086          this flag for lots of classes like String. 
10087          
10088          csc sets this flag if the type does not have an explicit static 
10089          constructor. The reasoning seems to be that if there are only static
10090          initalizers for a type, and no static constructor, then the programmer
10091          does not care when this initialization happens, so beforefieldinit
10092          can be used.
10093          
10094          This bug prevents the AOT compiler from being usable, since it 
10095          generates so many calls to mono_runtime_class_init that the AOT code
10096          is much slower than the JITted code. The JITted code is faster, 
10097          because it does not generate these calls if the vtable is type is
10098          already initialized, which is true in the majority of cases. But the
10099          AOT compiler can't do this."
10100
10101 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10102
10103         * class.cs (MethodData.Emit): Refactor the code so symbolic
10104         information is generated for destructors;  For some reasons we
10105         were taking a code path that did not generate symbolic information
10106         before. 
10107
10108 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10109
10110         * class.cs: Create a Constructor.CheckBase method that
10111         takes care of all validation type code. The method
10112         contains some code that was moved from Define.
10113
10114         It also includes new code that checks for duplicate ctors.
10115         This fixes bug #55148.
10116
10117 2004-03-09  Joshua Tauberer <tauberer@for.net>
10118
10119         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10120         a { ... }-style array creation invokes EmitStaticInitializers
10121         which is not good for reference-type arrays.  String, decimal
10122         and now null constants (NullCast) are not counted toward
10123         static initializers.
10124
10125 2004-03-05  Martin Baulig  <martin@ximian.com>
10126
10127         * location.cs (SourceFile.HasLineDirective): New public field;
10128         specifies whether the file contains or is referenced by a "#line"
10129         directive.
10130         (Location.DefineSymbolDocuments): Ignore source files which
10131         either contain or are referenced by a "#line" directive.        
10132
10133 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10134
10135         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10136         direct access to our parent, so check the method inline there.
10137
10138 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10139
10140         * expression.cs (Invocation.EmitCall): Miguel's last commit
10141         caused a regression. If you had:
10142
10143             T t = null;
10144             t.Foo ();
10145
10146         In Foo the implict this would be null.
10147
10148 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10149
10150         * expression.cs (Invocation.EmitCall): If the method is not
10151         virtual, do not emit a CallVirt to it, use Call.
10152
10153         * typemanager.cs (GetFullNameSignature): Improve the method to
10154         cope with ".ctor" and replace it with the type name.
10155
10156         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10157         as an argument the ConstructorBuilder where it is being defined,
10158         to catch the recursive constructor invocations.
10159
10160 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10161
10162         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10163         routines to check if a type is an enumerable/enumerator allow
10164         classes that implement the IEnumerable or IEnumerator interfaces.
10165
10166         * class.cs (Property, Operator): Implement IIteratorContainer, and
10167         implement SetYields.
10168
10169         (Property.Define): Do the block swapping for get_methods in the
10170         context of iterators.   We need to check if Properties also
10171         include indexers or not.
10172
10173         (Operator): Assign the Block before invoking the
10174         OperatorMethod.Define, so we can trigger the Iterator code
10175         replacement. 
10176
10177         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10178         Property and Operator classes are not created when we parse the
10179         declarator but until we have the block completed, so we use a
10180         singleton SimpleIteratorContainer.Simple to flag whether the
10181         SetYields has been invoked.
10182
10183         We propagate this setting then to the Property or the Operator to
10184         allow the `yield' to function.
10185
10186 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10187
10188         * codegen.cs: Implemented attribute support for modules.
10189         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10190         Assembly/Module functionality.
10191
10192         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10193         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10194         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10195
10196 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10197
10198         * interface.cs (FindMembers): The operation is performed on all base
10199         interfaces and not only on the first. It is required for future CLS Compliance patch.
10200
10201 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10202
10203         * statement.cs, codegen.cs:
10204         This patch deals with patterns such as:
10205
10206         public class List : IEnumerable {
10207
10208                 public MyEnumerator GetEnumerator () {
10209                         return new MyEnumerator(this);
10210                 }
10211
10212                 IEnumerator IEnumerable.GetEnumerator () {
10213                         ...
10214                 }
10215                 
10216                 public struct MyEnumerator : IEnumerator {
10217                         ...
10218                 }
10219         }
10220
10221         Before, there were a few things we did wrong:
10222         1) we would emit callvirt on a struct, which is illegal
10223         2) we emited ldarg when we needed to emit ldarga
10224         3) we would mistakenly call the interface methods on an enumerator
10225         type that derived from IEnumerator and was in another assembly. For example:
10226
10227         public class MyEnumerator : IEnumerator
10228
10229         Would have the interface methods called, even if there were public impls of the
10230         method. In a struct, this lead to invalid IL code.
10231
10232 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10233
10234         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10235           renamed to Emit.
10236
10237         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10238
10239 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10240
10241         * cs-parser.jay: Fix small regression: we were not testing V2
10242         compiler features correctly.
10243
10244         * interface.cs: If the emit context is null, then create one
10245
10246 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10247
10248         * decl.cs (GetSignatureForError): New virtual method to get full name
10249           for error messages.
10250
10251         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10252           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10253
10254         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10255           Duplicated members and code in these classes has been removed.
10256           Better encapsulation in these classes.
10257
10258 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10259
10260         * assign.cs (Assign.DoResolve): When dealing with compound
10261         assignments, there is a new rule in ECMA C# 2.4 (might have been
10262         there before, but it is documented here) that states that in:
10263
10264         a op= b;
10265
10266         If b is of type int, and the `op' is a shift-operator, then the
10267         above is evaluated as:
10268
10269         a = (int) a op b 
10270
10271         * expression.cs (Binary.ResolveOperator): Instead of testing for
10272         int/uint/long/ulong, try to implicitly convert to any of those
10273         types and use that in pointer arithmetic.
10274
10275         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10276         method to print information for from the type, not from the
10277         null-method we were given.
10278
10279 2004-02-01  Duncan Mak  <duncan@ximian.com>
10280
10281         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10282         parsing for cmd, fixes bug #53694.
10283
10284 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10285
10286         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10287         in the member name duplication tests. Property and operator name duplication
10288         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10289
10290 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10291
10292         * interface.cs (PopulateMethod): Fixed crash when interface method
10293         returns not existing type (error test cs0246-3.cs).
10294
10295 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10296
10297         * cs-parser.jay (interface_accessors): Re-write actions to also
10298         store attributes attached to get and set methods. Fix spelling
10299         while at it.
10300
10301         (inteface_property_declaration): Modify accordingly.
10302
10303         (InterfaceAccessorInfo): New helper class to store information to pass
10304         around between rules that use interface_accessors.
10305
10306         * interface.cs (Emit): Apply attributes on the get and set
10307         accessors of properties and indexers too.
10308
10309         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10310         right MethodBuilder when applying attributes to the get and set accessors.
10311
10312 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10313
10314         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10315
10316 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10317
10318         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10319
10320 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10321
10322         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10323         changes that treat `yield' specially when present before `break'
10324         or `return' tokens.
10325
10326         * cs-tokenizer.cs: yield is no longer a keyword.
10327
10328 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10329
10330         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10331         setting for default constructors.
10332         For default constructors are almost every time set wrong Modifier. The
10333         generated IL code has been alright. But inside mcs this values was
10334         wrong and this was reason why several of my CLS Compliance tests
10335         failed.
10336
10337 2004-01-22  Martin Baulig  <martin@ximian.com>
10338
10339         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10340         not a QualifiedIdentifier.  This is what `type_name_expression'
10341         was previously doing.
10342         (type_name_expression): Removed; the code is now in
10343         `namespace_or_type_name'.
10344         (qualified_identifier): Removed, use `namespace_or_type_name'
10345         instead.
10346         (QualifiedIdentifier): Removed this class.      
10347
10348 2004-01-22  Martin Baulig  <martin@ximian.com>
10349
10350         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10351         not a string as alias name.
10352
10353 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10354
10355         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10356         #52730 bug, and instead compute correctly the need to use a
10357         temporary variable when requesting an address based on the
10358         static/instace modified of the field and the constructor.
10359  
10360 2004-01-21  Martin Baulig  <martin@ximian.com>
10361
10362         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10363         class and namespace before looking up aliases.  Fixes #52517.
10364
10365 2004-01-21  Martin Baulig  <martin@ximian.com>
10366
10367         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10368         assinged in a 'try'; fixes exception4.cs.
10369
10370 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10371         * class.cs : Implemented parameter-less constructor for TypeContainer
10372
10373         * decl.cs: Attributes are now stored here. New property OptAttributes
10374
10375         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10376
10377         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10378
10379 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10380
10381         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10382           (CSharpSignature): New method for indexer and property signature.
10383
10384 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10385
10386         * pending.cs (IsVirtualFilter): Faster implementation.
10387
10388 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10389
10390         * typemanager.cs: Avoid inclusion of same assembly more than once.
10391
10392 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10393
10394         * cs-parser.jay: Fixed problem where the last assembly attribute
10395           has been applied also to following declaration (class, struct, etc.)
10396           
10397 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10398
10399         * class.cs: Added error CS0538, CS0539 reporting.
10400         Fixed crash on Microsoft runtime when field type is void.
10401
10402         * cs-parser.jay: Added error CS0537 reporting.
10403
10404         * pending.cs: Added error CS0535 reporting.
10405         Improved error report for errors CS0536, CS0534.
10406
10407 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10408
10409         Merge a few bits from the Anonymous Method MCS tree.
10410
10411         * statement.cs (ToplevelBlock): New class for toplevel methods,
10412         will hold anonymous methods, lifted variables.
10413
10414         * cs-parser.jay: Create toplevel blocks for delegates and for
10415         regular blocks of code. 
10416
10417 2004-01-20  Martin Baulig  <martin@ximian.com>
10418
10419         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10420         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10421         and `NeedExplicitReturn'; added `IsLastStatement'.
10422         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10423         have a `ReturnLabel' or we're not unreachable.
10424
10425         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10426         child's reachability; don't just override ours with it.  Fixes
10427         #58058 (lluis's example).
10428         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10429         InFinally(), InLoop(), InSwitch() and
10430         BreakCrossesTryCatchBoundary() methods.
10431
10432         * statement.cs (Return): Do all error checking in Resolve().
10433         Unless we are the last statement in a top-level block, always
10434         create a return label and jump to it.
10435         (Break, Continue): Do all error checking in Resolve(); also make
10436         sure we aren't leaving a `finally'.
10437         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10438         statement in a top-level block.
10439         (Block.Flags): Added `IsDestructor'.
10440         (Block.IsDestructor): New public property.
10441
10442 2004-01-20  Martin Baulig  <martin@ximian.com>
10443
10444         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10445
10446 2004-01-20  Martin Baulig  <martin@ximian.com>
10447
10448         * statement.cs (Statement.ResolveUnreachable): New public method.
10449         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10450         (Block.Resolve): Resolve unreachable statements.
10451
10452 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10453
10454         * expression.cs: We need to fix the case where we do
10455         not have a temp variable here.
10456
10457         * assign.cs: Only expression compound assignments need
10458         temporary variables.
10459
10460 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10461
10462         * flowanalysis.cs: Reduce memory allocation in a few ways:
10463           - A block with no variables should not allocate a bit
10464             vector for itself.
10465           - A method with no out parameters does not need any tracking
10466             for assignment of the parameters, so we need not allocate
10467             any data for it.
10468           - The arrays:
10469                 public readonly Type[] VariableTypes;
10470                 public readonly string[] VariableNames;
10471             Are redundant. The data is already stored in the variable
10472             map, so we need not allocate another array for it.
10473           - We need to add alot of checks for if (params | locals) == null
10474             due to the first two changes.
10475
10476 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10477
10478         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10479         implement IMemoryLocation, we store a copy on a local variable and
10480         take the address of it.  Patch from Benjamin Jemlich
10481
10482         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10483         to use a special "type_name_expression" rule which reduces the
10484         number of "QualifiedIdentifier" classes created, and instead
10485         directly creates MemberAccess expressions.
10486
10487 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
10488
10489         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10490         that fixes #52853.  Null literal assignment to ValueType
10491
10492         * class.cs (MethodData.Emit): Instead of checking the name of the
10493         method to determine if its a destructor, create a new derived
10494         class from Method called Destructor, and test for that.  
10495
10496         * cs-parser.jay: Create a Destructor object instead of a Method.  
10497
10498         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10499
10500         Fixes: 52933
10501
10502 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
10503
10504         * expression.cs (Binary.ResolveOperator): Perform an implicit
10505         conversion from MethodGroups to their delegate types on the
10506         Addition operation.
10507
10508         * delegate.cs: Introduce a new class DelegateCreation that is the
10509         base class for `NewDelegate' and `ImplicitDelegateCreation',
10510         factor some code in here.
10511
10512         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10513         conversion from MethodGroups to compatible delegate types. 
10514
10515         * ecore.cs (Expression.Resolve): Do not flag error 654
10516         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10517         we allow conversions from MethodGroups to delegate types now.
10518
10519         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10520         assignments in v2 either.
10521
10522 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
10523
10524         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10525         static read-only fields in ctors.
10526
10527         Applied patch from Benjamin Jemlich 
10528
10529         * expression.cs (UnaryMutator): Avoid leaking local variables. 
10530
10531 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
10532
10533         * cs-tokenizer.cs (IsCastToken): Allow the various native types
10534         here to return true, as they can be used like this:
10535
10536                 (XXX) int.MEMBER ()
10537
10538         Fixed 49836 and all the other dups
10539
10540 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
10541
10542         * driver.cs: Implement /win32res and /win32icon.
10543
10544 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
10545
10546         * cs-parser.jay: Add a rule to improve error handling for the
10547         common mistake of placing modifiers after the type.
10548
10549 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
10550
10551         * cs-parser.jay (interface_event_declaration): Catch
10552         initialization of events on interfaces, and report cs0068
10553
10554         * cs-parser.jay (interface_event_declaration): Catch
10555         initialization of events. 
10556
10557         * ecore.cs: Better report missing constructors.
10558
10559         * expression.cs (Binary.ResolveOperator): My previous bug fix had
10560         the error reporting done in the wrong place.  Fix.
10561
10562         * expression.cs (Binary.ResolveOperator): Catch the 
10563         operator + (E x, E y) error earlier, and later allow for implicit
10564         conversions in operator +/- (E e, U x) from U to the underlying
10565         type of E.
10566
10567         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10568         52596, if the container class is abstract, the default constructor
10569         is protected otherwise its public (before, we were always public).
10570
10571         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10572         fixed statement.
10573
10574         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10575         Jemlich that fixes bug #52597, MCS was generating invalid code for
10576         idisposable structs.   Thanks to Ben for following up with this
10577         bug as well.
10578
10579 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
10580
10581         * driver.cs: Allow assemblies without code to be generated, fixes
10582         52230.
10583
10584 2004-01-07  Nick Drochak <ndrochak@gol.com>
10585
10586         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10587
10588 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
10589
10590         * cs-parser.jay: Add rules to improve error reporting if fields or
10591         methods are declared at the namespace level (error 116)
10592
10593         * Add rules to catch event add/remove
10594
10595 2004-01-04  David Sheldon <dave-mono@earth.li>
10596
10597   * expression.cs: Added matching ")" to error message for 
10598   CS0077
10599
10600 2004-01-03 Todd Berman <tberman@gentoo.org>
10601
10602         * ecore.cs, attribute.cs:
10603         Applying fix from #52429.
10604
10605 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10606
10607         * ecore.cs, expression.cs, statement.cs:
10608         Total rewrite of how we handle branching. We
10609         now handle complex boolean expressions with fewer
10610         jumps. As well if (x == 0) no longer emits a ceq.
10611
10612         if (x is Foo) is much faster now, because we generate
10613         better code.
10614
10615         Overall, we get a pretty big improvement on our benchmark
10616         tests. The code we generate is smaller and more readable.
10617
10618         I did a full two-stage bootstrap. The patch was reviewed
10619         by Martin and Miguel.
10620
10621 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10622
10623         * cs-parser.jay: Make primary_expression not take a QI.
10624         we dont need this because the member_access rule covers
10625         us here. So we replace the rule with just IDENTIFIER.
10626
10627         This has two good effects. First, we remove a s/r conflict.
10628         Second, we allocate many fewer QualifiedIdentifier objects.
10629
10630 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10631
10632         * attribute.cs: Handle MarshalAs attributes as pseudo, and
10633         set the correct information via SRE. This prevents
10634         hanging on the MS runtime. Fixes #29374.
10635
10636 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10637
10638         * convert.cs: correctly handle conversions to value types
10639         from Enum and ValueType as unboxing conversions.
10640
10641         Fixes bug #52569. Patch by Benjamin Jemlich.
10642
10643 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10644
10645         * expression.cs (BetterConversion): Prefer int -> uint
10646         over int -> ulong (csc's behaviour). This fixed bug #52046.
10647
10648 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10649
10650         * decl.cs (MemberCache.FindMembers): now returns a
10651         MemberInfo [].
10652
10653         * typemanager.cs: In general, go with with ^^.
10654         (CopyNewMethods): take an IList.
10655         (RealMemberLookup): Only allocate an arraylist
10656         if we copy from two sets of methods.
10657
10658         This change basically does two things:
10659         1) Fewer array lists allocated due to CopyNewMethods.
10660         2) the explicit cast in MemberList costed ALOT.
10661
10662 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10663
10664         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10665         a hashtable to avoid needless string allocations when an identifier is
10666         used more than once (the common case).
10667
10668 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10669
10670         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10671         is broken, it will not return anything. So, we
10672         have to use the information we have in mcs to
10673         do the task.
10674
10675         * typemanager.cs: Add a cache for GetInterfaces,
10676         since this will now be used more often (due to ^^)
10677
10678         (GetExplicitInterfaces) New method that gets the
10679         declared, not effective, interfaces on a type
10680         builder (eg, if you have interface IFoo, interface
10681         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10682         { IBar }.
10683
10684         This patch makes MCS able to bootstrap itself on
10685         Windows again.
10686
10687 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10688
10689         * expression.cs: Remove the Nop's that Miguel put
10690         in by mistake.
10691
10692 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10693
10694         * report.cs, codegen.cs: Give the real stack trace to
10695         the error when an exception is thrown.
10696
10697 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10698
10699         * decl.cs: only allocate hashtables for ifaces if 
10700         it is an iface!
10701
10702 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10703
10704         * expression.cs: fix the error from cs0121-2.cs
10705         (a parent interface has two child interfaces that
10706         have a function with the same name and 0 params
10707         and the function is called through the parent).
10708
10709 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10710
10711         * class.cs, rootcontext.cs, typmanager.cs: do not
10712         leak pointers.
10713
10714 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10715
10716         * codegen.cs: remove stack for the ec flow branching.
10717         It is already a linked list, so no need.
10718
10719 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10720
10721         * Makefile: Allow custom profiler here.
10722
10723 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10724
10725         * typemanager.cs (LookupType):
10726           - Use a static char [], because split takes
10727             a param array for args, so it was allocating
10728             every time.
10729           - Do not store true in a hashtable, it boxes.
10730
10731 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10732
10733         * flowanalysis.cs: bytify common enums.
10734
10735 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10736
10737         * modifiers.cs: Add a new set of flags for the
10738         flags allowed on explicit interface impls.
10739         * cs-parser.jay: catch the use of modifiers in
10740         interfaces correctly.
10741         * class.cs: catch private void IFoo.Blah ().
10742
10743         All related to bug #50572.
10744
10745 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10746
10747         * decl.cs: Rewrite the consistant accessability checking.
10748         Accessability is not linear, it must be implemented in
10749         a tableish way. Fixes #49704.
10750
10751 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10752
10753         * expression.cs: Handle negation in a checked context.
10754         We must use subtraction from zero. Fixes #38674.
10755
10756 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10757
10758         * class.cs: Ignore static void main in DLLs.
10759         * rootcontext.cs: Handle the target type here,
10760         since we are have to access it from class.cs
10761         * driver.cs: account for the above.
10762
10763 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10764
10765         * report.cs: Give line numbers and files if available.
10766
10767 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10768
10769         * driver.cs: Implement /addmodule.
10770
10771         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10772         ModuleBuilders.
10773
10774 2003-12-20  Martin Baulig  <martin@ximian.com>
10775
10776         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10777         (FieldBase.IsAssigned): Removed this field.
10778         (FieldBase.SetAssigned): New public method.
10779         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10780
10781 2003-12-20  Martin Baulig  <martin@ximian.com>
10782
10783         * expression.cs (LocalVariableReference.DoResolve): Don't set
10784         `vi.Used' if we're called from DoResolveLValue().
10785
10786         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10787         returns the usage vector it just merged into the current one -
10788         pass this one to UsageWarning().
10789         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10790         of the `EmitContext', don't call this recursively on our children.
10791
10792 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
10793
10794         * driver.cs: Implement /target:module.
10795
10796 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10797
10798         * support.cs (CharArrayHashtable): New helper class.
10799
10800         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
10801         char arrays, not strings, so we can avoid creating a string in
10802         consume_identifier if the identifier is a keyword.
10803
10804 2003-12-16  Martin Baulig  <martin@ximian.com>
10805
10806         * statement.cs (LocalInfo.Assigned): Removed this property.
10807         (LocalInfo.Flags): Removed `Assigned'.
10808         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10809         and uses flow analysis.
10810         (Block.UsageWarning): Made this method private.
10811         (Block.Resolve): Call UsageWarning() if appropriate.
10812
10813         * expression.cs (LocalVariableReference.DoResolve): Always set
10814         LocalInfo.Used here.
10815
10816 2003-12-13  Martin Baulig  <martin@ximian.com>
10817
10818         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10819         any value here; we're now using flow analysis to figure out
10820         whether a statement/block returns a value.
10821
10822 2003-12-13  Martin Baulig  <martin@ximian.com>
10823
10824         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10825         working again.
10826         (FlowBranching.MergeFinally): Don't call
10827         `branching.CheckOutParameters()' here, this is called in
10828         MergeTopBlock().
10829         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10830         when adding the `finally' vector.       
10831
10832 2003-12-13  Martin Baulig  <martin@ximian.com>
10833
10834         * flowanalysis.cs
10835         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10836         actually work and also fix #48962.
10837
10838 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10839
10840         * decl.cs: Do not check System.Object for nested types,
10841         since we know it does not have any. Big bang for buck:
10842
10843         BEFORE:
10844            Run 1:   8.35 seconds
10845            Run 2:   8.32 seconds
10846            corlib:  17.99 seconds
10847         AFTER:
10848            Run 1:   8.17 seconds
10849            Run 2:   8.17 seconds
10850            corlib:  17.39 seconds
10851
10852 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10853
10854         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10855         time we are returning 0 members, so we save alot here.
10856
10857 2003-12-11  Martin Baulig  <martin@ximian.com>
10858
10859         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10860         `MergeChild()', also just take the `FlowBranching' as argument;
10861         call Merge() on it and return the result.
10862         (FlowBranching.Merge): We don't need to do anything if we just
10863         have one sibling.
10864
10865 2003-12-11  Martin Baulig  <martin@ximian.com>
10866
10867         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10868         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10869         Maurer for this idea.
10870
10871 2003-12-11  Martin Baulig  <martin@ximian.com>
10872
10873         * flowanalysis.cs (MergeResult): This class is now gone; we now
10874         use the `UsageVector' for this.  The reason for this is that if a
10875         branching just has one sibling, we don't need to "merge" them at
10876         all - that's the next step to do.
10877         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10878         `MergeResult'.
10879
10880 2003-12-11  Martin Baulig  <martin@ximian.com>
10881
10882         Reworked flow analyis and made it more precise and bug-free.  The
10883         most important change is that we're now using a special `Reachability'
10884         class instead of having "magic" meanings of `FlowReturns'.  I'll
10885         do some more cleanups and optimizations and also add some more
10886         documentation this week.
10887
10888         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10889         largely reworked this class.
10890         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10891         the new `Reachability' class instead of having "magic" values here.
10892         (FlowBranching): We're now using an instance of `Reachability'
10893         instead of having separate `Returns', `Breaks' etc. fields.
10894
10895         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10896         based on flow analysis; ignore the return value of block.Emit ().
10897
10898 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10899
10900         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10901         if they are private.
10902
10903 2003-12-09  Martin Baulig  <martin@ximian.com>
10904
10905         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10906         call them directly on the UsageVector.
10907
10908 2003-12-09  Martin Baulig  <martin@ximian.com>
10909
10910         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10911         Changed return type from `FlowReturns' to `Reachability'.
10912
10913 2003-12-09  Martin Baulig  <martin@ximian.com>
10914
10915         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10916         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10917         `Reachable' fields with a single `Reachability' one.
10918
10919 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10920
10921         * class.cs (FindMembers): Remove foreach's.
10922
10923         Bootstrap times:
10924
10925         BEFORE
10926                 Run 1:   8.74 seconds
10927                 Run 2:   8.71 seconds
10928
10929         AFTER
10930                 Run 1:   8.64 seconds
10931                 Run 2:   8.58 seconds
10932
10933
10934 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10935
10936         * cs-parser.jay:
10937         * gen-treedump.cs:
10938         * statement.cs:
10939         This patch does a few things:
10940                 1. EmptyStatement is now a singleton, so it is never reallocated.
10941                 2. All blah is EmptyStatement constructs have been changed to
10942                    blah == EmptyStatement.Value, which is much faster and valid
10943                    now that EmptyStatement is a singleton.
10944                 3. When resolving a block, rather than allocating a new array for
10945                    the non-empty statements, empty statements are replaced with
10946                    EmptyStatement.Value
10947                 4. Some recursive functions have been made non-recursive.
10948         Mainly the performance impact is from (3), however (1) and (2) are needed for
10949         this to work. (4) does not make a big difference in normal situations, however
10950         it makes the profile look saner.
10951
10952         Bootstrap times:
10953
10954         BEFORE
10955         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10956         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10957         Total memory allocated: 56397 KB
10958
10959         AFTER
10960         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10961         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10962         Total memory allocated: 55666 KB
10963
10964 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10965
10966         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10967         than the hashtable in a hashtable version
10968
10969         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10970         we always end up concating a string. This results in a huge perf
10971         loss, because many strings have to be tracked by the GC. In this
10972         patch, we first use a hashtable that works with two keys, so that
10973         the strings do not need to be concat'ed.
10974
10975         Bootstrap times:
10976         BEFORE
10977                 Run 1:   8.74 seconds
10978                 Run 2:   8.71 seconds
10979
10980         AFTER
10981                 Run 1:   8.65 seconds
10982                 Run 2:   8.56 seconds
10983
10984 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10985
10986         * Makefile: Add a new target `do-time' that does a quick and simple
10987         profile, leaving easy to parse output.
10988
10989 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10990
10991         * codegen.cs (Init): Create the dynamic assembly with 
10992         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10993
10994 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10995
10996         * support.cs: Make the PtrHashtable use only one
10997         instance of its comparer.
10998
10999 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11000
11001         * typemanager.cs: Fix lookup of GetNamespaces.
11002
11003 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11004
11005         * expression.cs: Removed redundant line.
11006
11007         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11008         ArrayLists, use for loops with bounds.  
11009
11010         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11011         arraylist.
11012
11013         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11014         arraylists, use for loop with bounds.
11015
11016         The above three changes give us a 0.071 second performance
11017         improvement out of 3.294 seconds down to 3.223.  On my machine
11018         the above changes reduced the memory usage by 1,387 KB during
11019         compiler bootstrap.
11020
11021         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11022         QualifiedIdentifiers.  Before we created a new string through
11023         concatenation, and mostly later on, the result would be
11024         manipulated by DecomposeQI through string manipulation.
11025
11026         This reduced the compiler memory usage for bootstrapping from
11027         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11028         compile times in 0.05 seconds.
11029
11030 2003-11-28  Dick Porter  <dick@ximian.com>
11031
11032         * support.cs: Do string compares with the Invariant culture.
11033
11034         * rootcontext.cs: 
11035         * gen-treedump.cs: 
11036         * expression.cs: 
11037         * driver.cs: 
11038         * decl.cs: 
11039         * codegen.cs: 
11040         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11041         the comparison is done with the Invariant culture.
11042
11043 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11044
11045         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11046         GetEnumerator method.
11047
11048         (ProbeCollectionType): Iterate starting at the most specific type
11049         upwards looking for a GetEnumerator
11050
11051         * expression.cs: Shift count can be up to 31 for int/uint and 63
11052         for long/ulong.
11053
11054 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11055
11056         * statement.cs (Block.LookupLabel): Also look for the label on the
11057         children blocks.  Use a hash table to keep track of visited
11058         nodes. 
11059
11060         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11061         we actually did transform the other operand, otherwise fall back
11062         to the common codepath that casts to long.
11063
11064         * cs-tokenizer.cs: Use the same code pattern as the int case.
11065         Maybe I should do the parsing myself, and avoid depending on the
11066         Parse routines to get this done.
11067
11068 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11069
11070         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11071         which fixes bug 51347.  This time test it.
11072
11073         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11074         attributes for example can not tell the difference between these.
11075         The difference was only a syntax feature of the language. 
11076
11077         * attribute.cs: Apply attributes to delegates.
11078
11079         * delegate.cs: Call the apply attributes method.
11080
11081 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11082
11083         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11084         comparing 0 vs Byte.MinValue, not the value
11085
11086         (ImplicitConversionRequired): When reporting a conversion error,
11087         use error 31 to print out the constant error instead of the
11088         simpler 29.
11089
11090         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11091         which fixes bug 51347.
11092
11093 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11094
11095         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11096         which fixes the -warnaserror command line option.
11097
11098 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11099
11100         * cfold.cs (DoNumericPromotions): During constant folding of
11101         additions on UIntConstant, special case intconstants with
11102         IntConstants like we do on the expression binary operator. 
11103
11104 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11105
11106         * convert.cs (ImplicitReferenceConversion): We were missing a case
11107         (System.Enum are not value types or class types, so we need to
11108         classify them separatedly).
11109
11110         * driver.cs: We do not support error 2007.
11111
11112 2003-11-12 Jackson Harper <jackson@ximian.com>
11113
11114         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11115         system directory. Also use the full file name so users can
11116         libraries names mscorlib-o-tron.dll in a non system dir.
11117
11118 2003-11-10  Martin Baulig  <martin@ximian.com>
11119
11120         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11121         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11122         calling `ResolveType()' on them, directly assign their `Type'.
11123
11124 2003-11-08  Martin Baulig  <martin@ximian.com>
11125
11126         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11127         return value and the `out parent' parameter.
11128         (TypeContainer.DefineType): Moved the CS0644 check into
11129         GetClassBases().  Don't pass the interface types to the
11130         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11131         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11132
11133         * ecore.cs (TypeExpr.IsAttribute): New property.
11134         (TypeExpr.GetInterfaces): New method.
11135
11136         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11137         TypeExpr instead of a Type.
11138         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11139         (Interface.DefineType): Don't pass the interface types to the
11140         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11141         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11142
11143         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11144         instead of a `Type[]'.
11145         (TypeManager.RegisterBuilder): Likewise.
11146         (TypeManager.AddUserInterface): Likewise.
11147         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11148         `Type[]' and also return a `TypeExpr[]'.
11149         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11150
11151 2003-11-08  Martin Baulig  <martin@ximian.com>
11152
11153         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11154         Expression.     
11155
11156 2003-11-08  Martin Baulig  <martin@ximian.com>
11157
11158         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11159         TypeManager.ResolveExpressionTypes().
11160
11161         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11162         instead of an Expression.
11163         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11164         (TypeExpression): New public class; formerly known as `TypeExpr'.
11165
11166         * expression.cs (ComposedCast): Derive from TypeExpr.
11167
11168         * typemanager.cs (TypeManager.system_*_expr): These are now
11169         TypExpr's instead of Expression's.
11170         (TypeManager.ResolveExpressionTypes): New public static function;
11171         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11172         of them.        
11173
11174 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11175
11176         * expression.cs (New.DoResolve): Do not dereference value that
11177         might be a null return.
11178
11179         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11180         sure that the constant value has the right type.  Fixes an
11181         unreported bug, similar to 50425.
11182
11183         * const.cs (Const.LookupConstantValue): Call
11184         ImplicitStandardConversionExists before doing a conversion to
11185         avoid havng the TypeManager.ChangeType do conversions.
11186
11187         Reduced the number of casts used
11188
11189         (Const.ChangeType): New routine to enable reuse of the constant
11190         type changing code from statement.
11191
11192         * typemanager.cs (ChangeType): Move common initialization to
11193         static global variables.
11194
11195         Fixes #50425.
11196
11197         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11198         every value type to go through, even if it was void.  Fix that. 
11199
11200         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11201         character of the define, and the is_identifier_part_character for
11202         the rest of the string.
11203
11204 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11205
11206         * expression.cs (UnaryMutator.EmitCode): When I updated
11207         LocalVariableReference.DoResolve, I overdid it, and dropped an
11208         optimization done on local variable references.
11209
11210 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11211
11212         * ecore.cs: Convert the return from Ldlen into an int.
11213
11214 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11215
11216         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11217         the accessibility, this is a special case for toplevel non-public
11218         classes (internal for instance).
11219
11220 2003-10-20  Nick Drochak <ndrochak@gol.com>
11221
11222         * ecore.cs: Fix typo and build.  Needed another right paren.
11223
11224 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11225
11226         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11227         `internal' case regular and protected, but not allowing protected
11228         to be evaluated later.  Bug 49840
11229
11230 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11231
11232         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11233         to kb.Nlast, and not the kb.nFirst to isolate the switch
11234         statement.
11235
11236         Extract the underlying type, so enumerations of long/ulong are
11237         treated like long/ulong.
11238
11239 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11240
11241         * expression.cs (New): Overload the meaning of RequestedType to
11242         track the possible creation of the NewDelegate type, since
11243         DoResolve is invoked more than once for new constructors on field
11244         initialization.
11245
11246         See bugs: #48800 and #37014
11247
11248         * cs-parser.jay (declare_local_constants): Take an arraylist
11249         instead of a single constant.
11250
11251         (local_constant_declaration): It should take a
11252         constant_declarators, not a constant_declarator.  Fixes 49487
11253
11254         * convert.cs: Fix error report.
11255
11256 2003-10-13 Jackson Harper <jackson@ximian.com>
11257
11258         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11259         bug #49611
11260
11261 2003-10-09  Martin Baulig  <martin@ximian.com>
11262
11263         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11264         to the .ctor.
11265         (MethodCore.DoDefineParameters): Removed the TypeContainer
11266         argument; use the DeclSpace which was passed to the .ctor instead.
11267         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11268         TypeContainer; we only need a DeclSpace here.
11269
11270 2003-10-09  Martin Baulig  <martin@ximian.com>
11271
11272         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11273         to the .ctor.
11274         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11275         EmitContext's .ctor.    
11276
11277 2003-10-09  Martin Baulig  <martin@ximian.com>
11278
11279         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11280         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11281         AsAccessible(), moved them as well.
11282
11283         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11284
11285 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11286
11287         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11288
11289 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11290
11291         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11292         generation for >=, as spotted by Paolo, bug 48679.  
11293         Patch from David Waite.
11294
11295         * cs-tokenizer.cs: Add handling for #pragma.
11296
11297         * cs-parser.jay: Allow for both yield and yield return in the
11298         syntax.  The anti-cobolization of C# fight will go on!
11299
11300         * class.cs (TypeBuilder.DefineType): Catch error condition here
11301         (Parent.DefineType erroring out and returning null).
11302
11303         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11304         coping with enumerations variables, we were mistakenly processing
11305         them as a regular value type instead of built-in types.  Fixes the
11306         bug #48063
11307
11308         * typemanager.cs (IsBuiltinOrEnum): New method.
11309
11310 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
11311
11312         * cs-parser.jay: Upgrade: yield now needs the return clause.
11313
11314 2003-09-19  Martin Baulig  <martin@ximian.com>
11315
11316         * decl.cs (MemberCache.SetupCacheForInterface): Take a
11317         `MemberCache parent' argument.  Normally, an interface doesn't
11318         have a parent type except System.Object, but we use this in gmcs
11319         for generic type parameters.
11320
11321 2003-09-18  Martin Baulig  <martin@ximian.com>
11322
11323         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11324         on `type.IsInterface'; don't check whether the type has a parent
11325         to determine whether it's an interface.
11326
11327 2003-09-15  Martin Baulig  <martin@ximian.com>
11328
11329         * class.cs (TypeContainer.DefineType): Added an error flag to
11330         avoid reporting duplicate CS0146's ("class definition is
11331         circular.").
11332
11333         * driver.cs (Driver.MainDriver): Abort if
11334         RootContext.ResolveTree() reported any errors.
11335
11336 2003-09-07  Martin Baulig  <martin@ximian.com>
11337
11338         * report.cs (Error, Warning): Added overloaded versions which take
11339         a `params object[] args' and call String.Format().
11340
11341 2003-09-07  Martin Baulig  <martin@ximian.com>
11342
11343         * decl.cs (DeclSpace..ctor): Don't call
11344         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11345         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11346         (DeclSpace.RecordDecl): New method.
11347
11348         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11349
11350 2003-09-02  Ravi Pratap  <ravi@ximian.com>
11351
11352         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11353         value attributes to be applied to ParameterBuilders.
11354
11355         * class.cs (MethodCore.LabelParameters): Make static and more
11356         generic so that it can be used from other places - like interface
11357         methods, for instance.
11358
11359         * interface.cs (Interface.Emit): Call LabelParameters before
11360         emitting attributes on the InterfaceMethod.
11361
11362 2003-08-26  Martin Baulig  <martin@ximian.com>
11363
11364         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11365         resolving aliases; fixes #47927.
11366
11367 2003-08-26  Martin Baulig  <martin@ximian.com>
11368
11369         * statement.cs (Using.DoResolve): This is internally emitting a
11370         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11371         do not always return.  Fixes #47681.
11372
11373 2003-08-26  Martin Baulig  <martin@ximian.com>
11374
11375         * decl.cs (MemberCore): Moved WarningNotHiding(),
11376         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11377         into MemberBase.
11378         (AdditionResult): Make this nested in DeclSpace.
11379         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11380         argument; call NamespaceEntry.Define() unless we're nested in a
11381         class or struct.
11382
11383         * namespace.cs (Namespace.DefineName): New public function.  This
11384         is called from DeclSpace's .ctor to add 
11385         (Namespace.Lookup): Include DeclSpaces in the lookup.
11386
11387         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11388
11389         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11390
11391 2003-08-25  Martin Baulig  <martin@ximian.com>
11392
11393         * convert.cs (Convert.ExplicitReferenceConversion): When
11394         converting from an interface type to a class, unbox if the target
11395         type is a struct type.  Fixes #47822.
11396
11397 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11398
11399         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11400         #47854.
11401
11402 2003-08-22  Martin Baulig  <martin@ximian.com>
11403
11404         * class.cs (TypeManager.DefineType): When defining a nested type,
11405         call DefineType() on our parent; fixes #47801.
11406
11407 2003-08-22  Martin Baulig  <martin@ximian.com>
11408
11409         * class.cs (MethodData.Define): While checking if a method is an
11410         interface implementation, improve the test a bit more to fix #47654.
11411
11412 2003-08-22  Martin Baulig  <martin@ximian.com>
11413
11414         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11415         correctly; fixes #47722.
11416
11417 2003-08-22  Martin Baulig  <martin@ximian.com>
11418
11419         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11420         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11421
11422         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11423
11424 2003-08-22  Martin Baulig  <martin@ximian.com>
11425
11426         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11427         can only be assigned in static constructors.  Fixes #47161.
11428
11429 2003-08-22  Martin Baulig  <martin@ximian.com>
11430
11431         Rewrote and improved the flow analysis code.
11432
11433         * flowbranching.cs (FlowBranching): Make this class abstract.
11434         (FlowBranching.CreateBranching): New static function to create a
11435         new flow branching.
11436         (FlowBranchingBlock, FlowBranchingException): New classes.
11437         (FlowBranching.UsageVector.Type): New public readonly field.
11438         (FlowBranching.UsageVector.Breaks): Removed the setter.
11439         (FlowBranching.UsageVector.Returns): Removed the setter.
11440         (FlowBranching.UsageVector): Added Break(), Return(),
11441         NeverReachable() and Throw() methods to modify the reachability.
11442         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11443         done by FlowBranching.Merge().
11444         (FlowBranching.UsageVector.MergeChild): New method; merges the
11445         merge result into the current vector.
11446         (FlowBranching.Merge): New abstract method to merge a branching.
11447
11448 2003-08-12  Martin Baulig  <martin@ximian.com>
11449
11450         * expression.cs (Indirection.CacheTemporaries): Create the
11451         LocalTemporary with the pointer type, not its element type.
11452
11453 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11454
11455         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11456         token was a keyword or not.
11457
11458         Add `error' options where an IDENTIFIER was expected;  Provide
11459         CheckToken and CheckIdentifierToken convenience error reporting
11460         functions. 
11461
11462         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11463
11464         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11465         NameSpaceEntry NameSpaceEntry.
11466
11467         (LookupInterfaceOrClass): Avoid creating a full qualified name
11468         from namespace and name: avoid doing lookups when we know the
11469         namespace is non-existant.   Use new Tree.LookupByNamespace which
11470         looks up DeclSpaces based on their namespace, name pair.
11471
11472         * driver.cs: Provide a new `parser verbose' to display the
11473         exception thrown during parsing.  This is turned off by default
11474         now, so the output of a failure from mcs is more graceful.
11475
11476         * namespace.cs: Track all the namespaces defined in a hashtable
11477         for quick lookup.
11478
11479         (IsNamespace): New method
11480
11481 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11482
11483         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11484         we know that we need to concatenate (full typename can never be
11485         null). 
11486
11487         * class.cs: ditto.
11488
11489         * statement.cs: Use a bitfield;  Do not initialize to null things
11490         which are done by the constructor by default.
11491
11492         * cs-parser.jay: bug fix, parameter was 4, not 3.
11493
11494         * expression.cs: Just use the property;
11495
11496         * statement.cs: No need for GetVariableInfo method.
11497
11498 2003-08-08  Martin Baulig  <martin@ximian.com>
11499
11500         * flowanalysis.cs (FlowReturns): This is now nested in the
11501         `FlowBranching' class.
11502         (MyBitVector): Moved this here from statement.cs.
11503         (FlowBranching.SiblingType): New enum type.
11504         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11505
11506 2003-08-07  Martin Baulig  <martin@ximian.com>
11507
11508         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11509         `FlowBranching' class and called `BranchingType'.
11510
11511 2003-08-07  Martin Baulig  <martin@ximian.com>
11512
11513         * flowanalysis.cs: Moved all the control flow analysis code into
11514         its own file.
11515
11516 2003-08-07  Martin Baulig  <martin@ximian.com>
11517
11518         * assign.cs (Assign.DoResolve): `target' must either be an
11519         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11520         #37319.
11521
11522 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11523
11524         * expression.cs (BinaryMethod): This kind of expression is created by the
11525         Binary class if it determines that the operator has to be handled
11526         by a method.
11527
11528         (BinaryDelegate): This kind of expression is created if we are
11529         dealing with a + or - operator on delegates.
11530
11531         (Binary): remove method, argumetns, and DelegateOperator: when
11532         dealing with methods, 
11533
11534         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11535
11536         * statement.cs (Block): use bitfields for the three extra booleans
11537         we had in use.   Remove unused topblock parameter.
11538
11539         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11540
11541         * assign.cs: Drop extra unneeded tests.
11542
11543 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11544
11545         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11546
11547         * statement.cs (Foreach): Use VariableStorage instead of
11548         LocalBuilders.   
11549
11550         * codegen.cs (VariableStorage): New class used by clients that
11551         require a variable stored: locals or fields for variables that
11552         need to live across yield.
11553
11554         Maybe provide a convenience api for EmitThis+EmitLoad?
11555
11556         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11557         these bad boys.
11558
11559 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11560
11561         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11562         RemapParameterLValue): New methods that are used to turn a
11563         precomputed FieldInfo into an expression like this:
11564
11565                 instance.FieldInfo
11566
11567         The idea is to use this instead of making LocalVariableReference
11568         have more than one meaning.
11569
11570         * cs-parser.jay: Add error production to BASE.
11571
11572         * ecore.cs: Deal with TypeManager.GetField returning null, which
11573         is now a valid return value.
11574
11575         (FieldExprNoAddress): New expression for Fields whose address can
11576         not be taken.
11577
11578         * expression.cs (LocalVariableReference): During the resolve
11579         phases, create new expressions if we are in a remapping context.
11580         Remove code that dealt with remapping here.
11581
11582         (ParameterReference): same.
11583
11584         (ProxyInstance): New expression, like the `This' expression, but
11585         it is born fully resolved.  We know what we are doing, so remove
11586         the errors that are targeted to user-provided uses of `this'.
11587
11588         * statement.cs (Foreach): our variable is now stored as an
11589         Expression;  During resolution, follow the protocol, dont just
11590         assume it will return this.
11591
11592 2003-08-06  Martin Baulig  <martin@ximian.com>
11593
11594         * support.cs (SeekableStreamReader.cs): New public class.
11595
11596         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11597         SeekableStreamReader instead of the normal StreamReader.
11598
11599 2003-08-04  Martin Baulig  <martin@ximian.com>
11600
11601         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11602         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11603         deambiguate casts and delegate invocations.
11604         (parenthesized_expression): Use the new tokens to ensure this is
11605         not a cast of method invocation.
11606
11607         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11608         when reading a `)' and Deambiguate_CloseParens () was previously
11609         called.
11610
11611         * expression.cs (ParenthesizedExpression): New class.  This is
11612         just used for the CS0075 test.
11613         (Binary.DoResolve): Check for CS0075.   
11614
11615 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11616
11617         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11618         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11619         reference comparison.
11620
11621         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11622         examine the ReturnType for equality - this is necessary in the
11623         cases of implicit and explicit operators whose signature also
11624         includes the return type.
11625
11626 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11627
11628         * namespace.cs: Cache the result of the namespace computation,
11629         instead of computing it every time.
11630
11631 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11632
11633         * decl.cs: Use a global arraylist that we reuse over invocations
11634         to avoid excesive memory consumption.  Reduces memory usage on an
11635         mcs compile by one meg (45 average).
11636
11637         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11638         private, work around that.
11639
11640 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11641
11642         * literal.cs (IntLiteral): Define Zero and One static literals. 
11643
11644         * cs-parser.jay (integer_literal): use static literals to reduce
11645         memory usage for the most used literals (0, 1 and -1).  211kb
11646         reduced in memory usage.
11647
11648         Replace all calls to `new ArrayList' with `new
11649         ArrayList(4)' which is a good average number for most allocations,
11650         and also requires only 16 bytes of memory for its buffer by
11651         default. 
11652
11653         This reduced MCS memory usage in seven megabytes for the RSS after
11654         bootstrapping.
11655
11656 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11657
11658         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11659         handle params methods the correct way by forming only one
11660         applicable set with params and normal methods in them. Earlier we
11661         were looking at params methods only if we found no normal methods
11662         which was not the correct thing to do.
11663
11664         (Invocation.BetterFunction): Take separate arguments indicating
11665         when candidate and the best method are params methods in their
11666         expanded form.
11667
11668         This fixes bugs #43367 and #46199.
11669
11670         * attribute.cs: Documentation updates.
11671
11672         (CheckAttribute): Rename to CheckAttributeTarget.
11673         (GetValidPlaces): Rename to GetValidTargets.
11674
11675         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11676         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11677
11678         Fixes bug #44468.
11679
11680 2003-07-28  Martin Baulig  <martin@ximian.com>
11681
11682         * class.cs (TypeContainer.DefineMembers): Use the base type's full
11683         name when looking up the base class of a nested class.  Fixes #46977.
11684
11685 2003-07-26  Martin Baulig  <martin@ximian.com>
11686
11687         * expression.cs (Indexers.Indexer): New nested struct; contains
11688         getter, setter and the indexer's type.
11689         (Indexers.Properties): This is now an ArrayList of
11690         Indexers.Indexer's.
11691         (IndexerAccess.DoResolveLValue): Correctly set the type if the
11692         indexer doesn't have any getters.
11693
11694         * assign.cs (Assign.DoResolve): Also do the implicit conversions
11695         for embedded property and indexer assignments.
11696
11697 2003-07-26  Martin Baulig  <martin@ximian.com>
11698
11699         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11700         preprocessor directive is not the first non-whitespace character
11701         on a line.
11702
11703 2003-07-26  Martin Baulig  <martin@ximian.com>
11704
11705         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11706         namespace parsing, follow the spec more closely.
11707
11708         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11709         NamespaceEntry.Lookup().
11710
11711 2003-07-25  Martin Baulig  <martin@ximian.com>
11712
11713         * MethodCore.cs (OverridesSomething): New public field; it's set
11714         from TypeContainer.DefineMembers if this method overrides
11715         something (which doesn't need to be a method).  Fix #39462.
11716
11717 2003-07-25  Ravi Pratap  <ravi@ximian.com>
11718
11719         * typemanager.cs (GetMembers): Ensure that the list of members is
11720         reversed. This keeps things in sync.
11721
11722         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11723         find an AttributeUsage attribute.
11724
11725         * expression.cs (Invocation.OverloadResolve): Perform the check
11726         which disallows Invoke to be directly called on a Delegate.
11727
11728         (Error_InvokeOnDelegate): Report error cs1533.
11729
11730 2003-07-25  Martin Baulig  <martin@ximian.com>
11731
11732         * expression.cs (Indexers.GetIndexersForType): Only look in the
11733         interface hierarchy if the requested type is already an
11734         interface.  Fixes #46788 while keeping #46502 fixed.
11735
11736 2003-07-25  Martin Baulig  <martin@ximian.com>
11737
11738         * class.cs (TypeContainer.DefineMembers): Check whether all
11739         readonly fields have been assigned and report warning CS0649 if
11740         not.
11741
11742         * statement.cs (LocalInfo.IsFixed): Always return true if this is
11743         a valuetype.
11744
11745 2003-07-24  Ravi Pratap  <ravi@ximian.com>
11746
11747         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11748         returned from GetMethods to make things consistent with the
11749         assumptions MCS makes about ordering of methods.
11750
11751         This should comprehensively fix bug #45127 and it does :-)
11752
11753         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11754         ordering is actually reverse.
11755
11756         * Clean up some debug messages I left lying around.
11757
11758         * interface.cs (Populate*): Get rid of code which emits attributes
11759         since the stage in which we emit attributes is the 'Emit' stage,
11760         not the define stage.
11761
11762         (Emit): Move attribute emission for interface members here.
11763
11764 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11765
11766         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11767         closely: we eliminate methods in base types when we have an
11768         applicable method in a top-level type.
11769
11770         Please see section 14.5.5.1 for an exact description of what goes
11771         on. 
11772
11773         This fixes bug #45127 and a host of other related to corlib compilation.
11774
11775         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11776         array is the method corresponding to the top-level type (this is
11777         because of the changes made to icall.c) so we change this
11778         accordingly.
11779
11780         (MethodGroupExpr.Name): This too.
11781
11782         * typemanager.cs (GetElementType): New method which does the right
11783         thing when compiling corlib. 
11784
11785         * everywhere: Make use of the above in the relevant places.
11786
11787 2003-07-22  Martin Baulig  <martin@ximian.com>
11788
11789         * cs-parser.jay (invocation_expression): Moved
11790         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11791         `cast_expression', but create a InvocationOrCast which later
11792         resolves to either an Invocation or a Cast.
11793
11794         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11795         method; call this before EmitStatement() to make sure that this
11796         expression can be used as a statement.
11797
11798         * expression.cs (InvocationOrCast): New class; resolves to either
11799         an Invocation or a Cast.
11800
11801         * statement.cs (StatementExpression): Call ResolveStatement() on
11802         the ExpressionStatement before emitting it.
11803
11804 2003-07-21  Martin Baulig  <martin@ximian.com>
11805
11806         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11807         `ref' and `out' attributes match; fixes #46220.
11808         (MemberAccess.ResolveMemberAccess): You can't reference a type
11809         through an expression; fixes #33180.
11810         (Indexers.GetIndexersForType): Don't return the indexers from
11811         interfaces the class implements; fixes #46502.
11812
11813 2003-07-21  Martin Baulig  <martin@ximian.com>
11814
11815         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11816         CS0661 checks; fixes bug #30442.
11817
11818 2003-07-21  Martin Baulig  <martin@ximian.com>
11819
11820         * decl.cs (AdditionResult): Added `Error'.
11821
11822         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11823
11824         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11825         makes cs0031.cs actually work.
11826
11827 2003-07-20  Martin Baulig  <martin@ximian.com>
11828
11829         * namespace.cs: Fixed that bug which caused a crash when compiling
11830         the debugger's GUI.
11831
11832 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11833
11834         * typemanager.cs (LookupTypeReflection): Never expose types which
11835         are NotPublic, NestedPrivate, NestedAssembly, or
11836         NestedFamANDAssem.  We used to return these, and later do a check
11837         that would report a meaningful error, but the problem is that we
11838         would not get the real match, if there was a name override.
11839
11840 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11841
11842         * namespace.cs (Namespace, Name): Do not compute the namespace
11843         name dynamically, compute it in the constructor.  This reduced
11844         memory usage by 1697 KB.
11845
11846         * driver.cs: Use --pause to pause at the end.
11847
11848 2003-07-17  Peter Williams  <peter@newton.cx>
11849
11850         * Makefile: Change the name of the test target so that it doesn't
11851         conflict with the recursive test target.
11852
11853 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11854
11855         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11856         AddressOf): Do not use EmitThis, that was wrong, use the actual
11857         this pointer.
11858
11859 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11860
11861         * class.cs (MethodData.Define): While checking if a method is an
11862         interface implementation, improve the test: If we are not public
11863         (use new test here: use the computed MethodAttributes directly,
11864         instead of the parsed modifier flags) check if the `implementing'
11865         method comes from an interface or not.
11866
11867         * pending.cs (VerifyPendingMethods): Slightly better error
11868         message.
11869
11870         * makefile: add test target that does the mcs bootstrap.
11871
11872 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11873
11874         * interface.cs (Define): Do nothing here since there are no
11875         members to populate etc. Move the attribute emission out of here
11876         since this was just totally the wrong place to put it. Attribute
11877         application happens during the 'Emit' phase, not in the 'Define'
11878         phase.
11879
11880         (Emit): Add this method and move the attribute emission here
11881
11882         * rootcontext.cs (EmitCode): Call the Emit method on interface
11883         types too.
11884
11885 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11886
11887         * expression.cs (OverloadResolve): Report error only if Location
11888         is not 'Null' which means that there was a probe going on.
11889
11890 2003-07-14  Martin Baulig  <martin@ximian.com>
11891
11892         * expression.cs (ConditionalLogicalOperator): New public class to
11893         implement user defined conditional logical operators.
11894         This is section 14.11.2 in the spec and bug #40505.
11895
11896 2003-07-14  Martin Baulig  <martin@ximian.com>
11897
11898         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11899
11900 2003-07-14  Martin Baulig  <martin@ximian.com>
11901
11902         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11903
11904         * ecore.cs (IVariable.VerifyFixed): New interface method.
11905
11906         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11907         operator, check whether the variable is actually fixed.  Fixes bug
11908         #36055.  Set a variable definitely assigned when taking its
11909         address as required by the spec.
11910
11911         * statement.cs (LocalInfo.IsFixed): New field.
11912         (LocalInfo.MakePinned): Set `IsFixed' to true.
11913
11914 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11915
11916         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11917         for .ctors, ensure that we only ask for members declared in the
11918         attribute type (BindingFlags.DeclaredOnly).
11919
11920         Fixes bug #43632.
11921
11922         * expression.cs (Error_WrongNumArguments): Report error 1501
11923         correctly the way CSC does.
11924
11925 2003-07-13  Martin Baulig  <martin@ximian.com>
11926
11927         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11928         lookup on the fully qualified name, to make things like "X.X" work
11929         where "X.X" is a fully qualified type name, but we also have a
11930         namespace "X" in the using list.  Fixes #41975.
11931
11932 2003-07-13  Martin Baulig  <martin@ximian.com>
11933
11934         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11935         function. If we're a CompoundAssign, we need to create an embedded
11936         CompoundAssign, not an embedded Assign.
11937         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11938         Fixes #45854.
11939
11940 2003-07-13  Martin Baulig  <martin@ximian.com>
11941
11942         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11943         work to fix bug #46088.
11944
11945 2003-07-13  Ravi Pratap <ravi@ximian.com>
11946
11947         * class.cs (Operator.Emit): Do not emit attributes here - it is
11948         taken care of by the Method class that we delegate too. This takes
11949         care of bug #45876.
11950
11951 2003-07-10  Martin Baulig  <martin@ximian.com>
11952
11953         * expression.cs (TypeOfVoid): New class.
11954         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11955
11956 2003-07-10  Martin Baulig  <martin@ximian.com>
11957
11958         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11959         bug #35957.
11960
11961 2003-07-10  Martin Baulig  <martin@ximian.com>
11962
11963         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11964         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11965
11966         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11967
11968         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11969
11970 2003-07-10  Martin Baulig  <martin@ximian.com>
11971
11972         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11973         of decimal.  Fixes #42850.
11974
11975         NOTE: I also fixed the created byte blob, but this doesn't work on
11976         the MS runtime and csc never produces any byte blobs for decimal
11977         arrays.
11978
11979 2003-07-10  Martin Baulig  <martin@ximian.com>
11980
11981         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11982         structs; fixes #32068.
11983         (Block.AddChildVariableNames): Fixed #44302.
11984
11985 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11986
11987         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11988
11989 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11990
11991         * attribute.cs: And this test is onger needed.
11992
11993 2003-07-08  Martin Baulig  <martin@ximian.com>
11994
11995         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11996         inaccessible types.  Fixes #36313.
11997
11998         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11999
12000         * namespace.cs (NamespaceEntry): Create implicit entries for all
12001         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12002         implicit entries for N1.N2 and N1.
12003
12004 2003-07-08  Martin Baulig  <martin@ximian.com>
12005
12006         Rewrote the handling of namespaces to fix a lot of the issues
12007         wrt. `using' aliases etc.
12008
12009         * namespace.cs (Namespace): Splitted this class into a
12010         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12011
12012         * typemanager.cs (TypeManager.IsNamespace): Removed.
12013         (TypeManager.ComputeNamespaces): Only compute namespaces from
12014         loaded assemblies here, not the namespaces from the assembly we're
12015         currently compiling.
12016
12017 2003-07-08  Martin Baulig  <martin@ximian.com>
12018
12019         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12020
12021 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12022
12023         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12024         already fixed it.  
12025
12026         I thought about the memory savings here, but LookupTypeReflection
12027         is used under already very constrained scenarios.  Compiling
12028         corlib or mcs only exposes one hit, so it would not really reduce
12029         any memory consumption.
12030
12031 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12032
12033         * typemanager.cs: fixes bug #45889 by only adding public types from
12034         other assemblies to the list of known types.
12035
12036 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12037
12038         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12039         on the type we resolved.
12040
12041 2003-07-05  Martin Baulig  <martin@ximian.com>
12042
12043         * pending.cs (PendingImplementation.ParentImplements): Don't
12044         create the proxy if the parent is abstract.
12045
12046         * class.cs (TypeContainer.DefineIndexers): Process explicit
12047         interface implementations first.  Fixes #37714.
12048
12049 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12050
12051         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12052         defined recursively;  but since we modify the input parameters
12053         (left is set to `this' temporarily), we reset this value if the
12054         left_is_explicit is false, which gives the original semantics to
12055         the code.  
12056
12057         * literal.cs (NullPointer): new class used to represent a null
12058         literal in a pointer context.
12059
12060         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12061         type is a pointer, use a NullPointer object instead of a
12062         NullLiteral.   Closes 43687
12063
12064         (ExplicitConversion): Convert pointer values using
12065         the conv opcode to the proper type.
12066
12067         * ecore.cs (New): change ValueTypeVariable property into a method,
12068         that returns whether the valuetype is suitable for being used.
12069
12070         * expression.cs (Binary.DoNumericPromotions): Only return if we
12071         the int constant was a valid uint, and we can return both left and
12072         right as uints.  If not, we continue processing, to trigger the
12073         type conversion.  This fixes 39018.
12074
12075         * statement.cs (Block.EmitMeta): During constant resolution, set
12076         the CurrentBlock property on the emitcontext, so that we resolve
12077         constants propertly.
12078
12079 2003-07-02  Martin Baulig  <martin@ximian.com>
12080
12081         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12082         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12083
12084         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12085         than emitting it here.
12086
12087         * statement.cs: Fixed some more flow analysis bugs.
12088
12089 2003-07-02  Martin Baulig  <martin@ximian.com>
12090
12091         * class.cs (MethodData.Define): When implementing interface
12092         methods, set Final unless we're Virtual.
12093
12094         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12095         check work for interface methods.
12096
12097 2003-07-01  Martin Baulig  <martin@ximian.com>
12098
12099         * ecore.cs (EmitContext.This): Replaced this property with a
12100         GetThis() method which takes a Location argument.  This ensures
12101         that we get the correct error location for a CS0188.
12102
12103 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12104
12105         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12106         ImplicitStandardConversion.
12107
12108         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12109
12110 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
12111
12112         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12113         optimization.
12114
12115 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
12116
12117         * class.cs (Constructor.Define): Turn off initlocals for unsafe
12118         constructors.
12119
12120         (MethodData.Define): Turn off initlocals for unsafe methods.
12121
12122 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
12123
12124         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12125         complete;  Fixes #37521.
12126
12127         * delegate.cs: Use Modifiers.TypeAttr to compute the
12128         TypeAttributes, instead of rolling our own.  This makes the flags
12129         correct for the delegates.
12130
12131 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12132
12133         * class.cs (Constructor.Define): Set the private flag for static
12134         constructors as well.
12135
12136         * cs-parser.jay (statement_expression): Set the return value to
12137         null, to avoid a crash when we catch an error.
12138
12139 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12140
12141         * cs-parser.jay: Applied patch from Jackson that adds support for
12142         extern and unsafe modifiers to destructor declarations.
12143
12144         * expression.cs: Report error 21 if the user is trying to index a
12145         System.Array.
12146
12147         * driver.cs: Add an error message, suggested by the bug report.
12148
12149         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12150         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12151
12152 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12153
12154         * namespace.cs: Add some information to reduce FAQs.
12155
12156 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12157
12158         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12159         underlying enumeration types.  Fixes #43915.
12160
12161         * expression.cs: Treat ushort/short as legal values to be used in
12162         bitwise operations.
12163
12164 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12165
12166         * delegate.cs: transfer custom attributes for paramenters from
12167         the delegate declaration to Invoke and BeginInvoke.
12168
12169 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12170
12171         * attribute.cs: handle custom marshalers and emit marshal info
12172         for fields, too.
12173
12174 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12175
12176         * makefile.gnu: Added anonymous.cs to the compiler sources.
12177
12178 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12179
12180         * iterators.cs: Change the name of the proxy class to include two
12181         underscores.
12182
12183         * cs-parser.jay: Update grammar to include anonymous methods.
12184
12185         * anonymous.cs: new file.
12186
12187 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12188
12189         * class.cs (Field.Define): Add missing test for pointers and
12190         safety. 
12191
12192 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12193
12194         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12195         we use the stobj opcode.
12196
12197         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12198         since it wasn't the correct fix. 
12199
12200         It still is puzzling that we are required to use stobj for IntPtr
12201         which seems to be a ValueType.
12202
12203 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12204
12205         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12206         during regular simple name resolution.   Now, the trick is that
12207         instead of returning for processing the simplename, we do a
12208         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12209         contextual lookup type).   If a match is found, return that, if
12210         not, return for further composition.
12211
12212         This fixes long-standing 30485.
12213
12214         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12215         using the address to initialize an object, do an Stobj instead of
12216         using the regular Stelem.
12217
12218         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12219         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12220         Because if we are a BaseIndexerAccess that value will be true.
12221         Fixes 43643.
12222
12223         * statement.cs (GotoCase.Resolve): Return after reporting an
12224         error, do not attempt to continue. 
12225
12226         * expression.cs (PointerArithmetic.Emit): If our operand is a
12227         long, convert our constants to match the operand before
12228         multiplying.  Convert to I type before adding.   Fixes 43670.
12229
12230 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12231
12232         * enum.cs (ImplicitConversionExists) : Rename to
12233         ImplicitEnumConversionExists to remove ambiguity. 
12234
12235         * ecore.cs (NullCast): New type of cast expression class which
12236         basically is very similar to EmptyCast with the difference being
12237         it still is a constant since it is used only to cast a null to
12238         something else
12239         (eg. (string) null)
12240
12241         * convert.cs (ImplicitReferenceConversion): When casting a null
12242         literal, we return a NullCast.
12243
12244         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12245         should be around anymore.
12246
12247         The renaming (reported was slightly wrong). Corrections:
12248
12249         ConvertImplicitStandard -> ImplicitConversionStandard
12250         ConvertExplicitStandard -> ExplicitConversionStandard
12251
12252         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12253         before passing them in !
12254
12255         * convert.cs (ImplicitConversionStandard): When comparing for
12256         equal expr and target types, ensure that expr is not a
12257         NullLiteral.
12258
12259         In general, we must not be checking (expr_type ==
12260         target_type) in the top level conversion methods
12261         (ImplicitConversion, ExplicitConversion etc). This checking is
12262         done in the methods that they delegate to.
12263
12264 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12265
12266         * convert.cs: Move Error_CannotConvertType,
12267         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12268         ImplicitNumericConversion, ImplicitConversionExists,
12269         ImplicitUserConversionExists, StandardConversionExists,
12270         FindMostEncompassedType, FindMostSpecificSource,
12271         FindMostSpecificTarget, ImplicitUserConversion,
12272         ExplicitUserConversion, GetConversionOperators,
12273         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12274         TryImplicitIntConversion, Error_CannotConvertImplicit,
12275         ConvertImplicitRequired, ConvertNumericExplicit,
12276         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12277         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12278         its own file.
12279
12280         Perform the following renames:
12281
12282         StandardConversionExists -> ImplicitStandardConversionExists
12283         ConvertImplicit -> ImplicitConversion
12284         ConvertImplicitStandard -> ImplicitStandardConversion
12285         TryImplicitIntConversion -> ImplicitIntConversion
12286         ConvertImplicitRequired -> ImplicitConversionRequired
12287         ConvertNumericExplicit -> ExplicitNumericConversion
12288         ConvertReferenceExplicit -> ExplicitReferenceConversion
12289         ConvertExplicit -> ExplicitConversion
12290         ConvertExplicitStandard -> ExplicitStandardConversion
12291
12292 2003-05-19  Martin Baulig  <martin@ximian.com>
12293
12294         * statement.cs (TypeInfo.StructInfo): Made this type protected.
12295         (TypeInfo): Added support for structs having structs as fields.
12296
12297         * ecore.cs (FieldExpr): Implement IVariable.
12298         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12299         VariableInfo for the field.
12300
12301 2003-05-18  Martin Baulig  <martin@ximian.com>
12302
12303         * expression.cs (This.DoResolve): Report a CS0027 if we're
12304         emitting a field initializer.
12305
12306 2003-05-18  Martin Baulig  <martin@ximian.com>
12307
12308         * expression.cs (This.ResolveBase): New public function.
12309         (This.DoResolve): Check for CS0188.
12310
12311         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12312         This.Resolve().
12313
12314         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12315         `instance_expression' to null if we don't have any non-static
12316         methods.
12317
12318 2003-05-18  Martin Baulig  <martin@ximian.com>
12319
12320         Reworked the way how local variables and parameters are handled by
12321         the flow analysis code.
12322
12323         * statement.cs (TypeInfo, VariableMap): New public classes.
12324         (VariableInfo): New public class.  This is now responsible for
12325         checking whether a variable has been assigned.  It is used for
12326         parameters and local variables.
12327         (Block.EmitMeta): Take the InternalParameters as argument; compute
12328         the layout of the flow vectors here.
12329         (Block.LocalMap, Block.ParameterMap): New public properties.
12330         (FlowBranching): The .ctor doesn't get the InternalParameters
12331         anymore since Block.EmitMeta() now computes the layout of the flow
12332         vector.
12333         (MyStructInfo): This class is now known as `StructInfo' and nested
12334         in `TypeInfo'; we don't access this directly anymore.
12335
12336         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12337         property and removed IsAssigned(), IsFieldAssigned(),
12338         SetAssigned() and SetFieldAssigned(); we now call them on the
12339         VariableInfo so we don't need to duplicate this code everywhere.
12340
12341         * expression.cs (ParameterReference): Added `Block block' argument
12342         to the .ctor.
12343         (LocalVariableReference, ParameterReference, This): The new
12344         VariableInfo class is now responsible for all the definite
12345         assignment stuff.
12346
12347         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12348         IsParameterAssigned, SetParameterAssigned): Removed.
12349
12350 2003-05-18  Martin Baulig  <martin@ximian.com>
12351
12352         * typemanager.cs (InitCoreTypes): Try calling
12353         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12354         the 3-args-version.  Corlib now also needs our `void_type'.
12355         (GetMethod): Added overloaded version which takes an optional
12356         `bool report_errors' to allow lookups of optional methods.
12357
12358 2003-05-12  Martin Baulig  <martin@ximian.com>
12359
12360         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12361         only used for locals and not for parameters.
12362
12363 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12364
12365         * support.cs (InternalParameters.ParameterType): Return the
12366         ExternalType of the parameter.
12367
12368         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12369         they were unused.
12370
12371 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12372
12373         * class.cs (MethodData.Define): Do not set the `newslot' on
12374         interface members, if they are also flagged as "override".
12375
12376         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12377         better code for ++i and i++.  This only works for static fields
12378         and local variables.
12379
12380         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12381         want to pull the DeclSpace out of the builder_to_declspace instead
12382         of the TypeBuilder (like in TypeContainer.FindMembers).
12383
12384         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12385         instead of LookupTypeContainer.  Fixes the crash on .NET for
12386         looking up interface members.
12387
12388         * const.cs: Create our own emit context during the Definition
12389         stage, so that constants are evaluated in the proper context, when
12390         a recursive definition happens.
12391
12392 2003-05-11  Martin Baulig  <martin@ximian.com>
12393
12394         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12395         new block for a switch section.
12396         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12397         the adding/lookup in the switch block.  Fixes #39828.
12398
12399 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12400
12401         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12402         functionality: I needed to convert the data after I had performed
12403         the add/sub operation into the operands type size.
12404
12405         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12406         pass the type for the box operation, otherwise the resulting
12407         object would have been of type object.
12408
12409         (BoxedCast): Add constructor to specify the type to box as.
12410
12411 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12412
12413         * iterators.cs: I was reusing the `count' variable inadvertently,
12414         take steps to not allow this to happen.
12415
12416 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12417
12418         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12419         by creating an array at the point where the params starts and
12420         putting all those arguments there, then adjusting the size of the
12421         array.
12422
12423 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12424
12425         * expression.cs (New.AddressOf): Implement interface
12426         IMemoryLocation.  This is used when the `new' operator is used in
12427         the context of an invocation to a method on a value type.
12428
12429         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12430         example. 
12431
12432         * namespace.cs: Also check the using aliases here.
12433
12434         * driver.cs: Move the test for using validity after the types have
12435         been entered, so we do a single pass that also includes the using
12436         aliases. 
12437
12438         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12439         in the regular case.   CreateSiblingForFinally is doing extra
12440         error checking.
12441
12442         * attribute.cs (GetAttributeArgumentExpression): Store the result
12443         on an out value, and use the return value to indicate failure
12444         instead of using null (which is a valid return for Constant.GetValue).
12445
12446         * statement.cs: Perform the analysis flow for the increment
12447         portion after the statement, because this will be the real flow of
12448         execution.  Fixes #42385
12449
12450         * codegen.cs (EmitContext.EmitArgument,
12451         EmitContext.EmitStoreArgument): New helper functions when the
12452         RemapToProxy flag is set.
12453
12454         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12455         function.
12456
12457         Add support for remapping parameters. 
12458
12459         * iterators.cs: Propagate parameter values;  Store parameter
12460         values in the proxy classes.
12461
12462 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12463
12464         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12465         need a proxy reference;  I do not know what I was thinking
12466
12467         * cs-parser.jay (constructor_initializer): catch another error,
12468         and display nice message.
12469
12470         (field_declaration): catch void field declaration
12471         to flag a better error. 
12472
12473         * class.cs (MemberBase.CheckBase): Report an error instead of a
12474         warning if a new protected member is declared in a struct. 
12475         (Field.Define): catch the error of readonly/volatile.
12476
12477         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12478
12479         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12480         volatile variable is taken
12481
12482 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12483
12484         * statement.cs (Fixed.Resolve): Report an error if we are not in
12485         an unsafe context.
12486
12487 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12488
12489         * typemanager.cs: reuse the code that handles type clashes for
12490         delegates and enumerations.
12491
12492         * class.cs (Report28): Always report.
12493
12494         * expression.cs (EncodeAsAttribute): Allow nulls here.
12495
12496 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12497
12498         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12499         the functionality for testing whether an expression is valid for
12500         an attribute here.  Also handle the case of arrays of elements
12501         being stored. 
12502
12503         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12504         encoding a linear array into an array of objects that are suitable
12505         to be passed to an CustomAttributeBuilder.
12506
12507         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12508
12509         * ecore.cs: (FieldExpr): Handle field remapping here.
12510
12511         * iteratators.cs: Pass the instance variable (if the method is an
12512         instance method) to the constructors, so we can access the field
12513         variables on the class.
12514
12515         TODO: Test this with structs.  I think the THIS variable on
12516         structs might have to be a pointer, and not a refenrece
12517
12518 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12519
12520         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12521         local variables to fields in a proxy class.
12522
12523         * iterators.cs (PopulateProxy): Rename our internal fields to
12524         <XXX>.  
12525         Create a <THIS> field if we are an instance method, so we can
12526         reference our parent container variables.
12527         (MapVariable): Called back from the EmitContext code to enter a
12528         new variable to field mapping into the proxy class (we just create
12529         a FieldBuilder).
12530
12531         * expression.cs
12532         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12533         for using the remapped locals to fields.
12534
12535         I placed the code here, because that gives the same semantics to
12536         local variables, and only changes the Emit code.
12537
12538         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12539         statements inside iterators.
12540         (VariableInfo): Add a FieldBuilder for the cases when we are
12541         remapping local variables to fields in a proxy class
12542
12543         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12544         current_block != null.
12545
12546         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12547         not cope with strings, as it has been moved to the
12548         TableSwitchEmit.  Fixed bug in switch generation.
12549
12550         * expression.cs (New.DoResolve): Provide more context for the user
12551         when reporting an error.
12552
12553         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12554         pointers. 
12555
12556         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12557         check the permissions for it.  Note than in a type-resolution
12558         context the check was already present in DeclSpace.ResolveType,
12559         but was missing from the MemberAccess.
12560
12561         (ArrayCreation.CheckIndices): warn if the user has
12562         more nested levels of expressions, but there are no more
12563         dimensions specified.  Avoids crash on bug 41906.
12564
12565 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12566
12567         * statement.cs (Block): replace Implicit bool, for a generic
12568         flags.   
12569         New flag: `Unchecked'.  This is used during the EmitMeta phase
12570         (which is out-of-line with the regular Resolve/Emit process for a
12571         statement, as this is done ahead of time, but still gets a chance
12572         to call constant resolve).
12573
12574         (Block.Flags): new enum for adding a new flag.
12575
12576         (Block.EmitMeta): track the state of unchecked.
12577
12578         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12579         to enable constant resolution to work there as well.
12580
12581 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12582
12583         * typemanager.cs (ienumerable_type): Also look up
12584         System.Collections.IEnumerable. 
12585
12586 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12587
12588         TODO: Test more than one conditional per method.
12589
12590         * class.cs (Indexer.Define): Report the location where the user is
12591         referencing the unsupported feature.
12592
12593         (MethodData): Overload the use of `conditionals' to
12594         minimize the creation of needless ArrayLists.   This saves roughly
12595         212kb on my machine.
12596
12597         (Method): Implement the new IIteratorContainer interface.
12598         (Method.SetYields): Implement the method by setting the ModFlags
12599         to contain METHOD_YIELDS.
12600
12601         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12602         which just got set to null.
12603
12604         * iterators.cs: New file.
12605
12606         (Yield, YieldBreak): New statements.
12607
12608         * statement.cs (Return.Resolve): Flag an error if we are used in
12609         an iterator method.
12610
12611         * codegen.cs (InIterator): New flag set if the code is being
12612         compiled in an iterator method.
12613
12614         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12615         internal modifier, and we just use it to avoid adding extra
12616         fields, as this is seldom used.  
12617
12618         * cs-parser.jay: Add yield_statement (yield and yield break).
12619
12620         * driver.cs: New flag -v2 to turn on version 2 features. 
12621
12622         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12623         hashtable when v2 is enabled.
12624
12625 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12626
12627         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12628         there is already a namespace defined with this name.
12629
12630         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12631         people upgraded their corlibs.
12632
12633         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12634         always use fully qualified types, no need to use the compiler
12635         front end.
12636
12637         (TypeManager.IsNamespace): Use binarysearch.
12638
12639         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12640         AddDelegate): I did not quite use the new IsValid API properly: I
12641         have to pass the short-name and the fullname.  I was passing only
12642         the basename instead of the fullname sometimes. 
12643
12644         (TypeContainer.DefineType): call NamespaceClash.
12645
12646         * interface.cs (Interface.DefineType): use NamespaceClash before
12647         defining the type.
12648
12649         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12650         defining the type.
12651
12652         * enum.cs: (Enum.DefineType): use NamespaceClash before
12653         defining the type.
12654
12655         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12656         speed increase.  First, use the negative_hits cache when we get a
12657         negative.  Second, add the type with its full original name
12658         instead of the new . and + encoded name (reflection uses + to
12659         separate type from a nested type).  Use LookupTypeReflection
12660         directly which bypasses the type->name hashtable (that we already
12661         know does not contain the type.
12662
12663         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12664         location/container type. 
12665
12666         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12667
12668 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12669
12670         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12671
12672         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12673         method is being referenced in the method group from a static
12674         context, and report error 120 if so.
12675
12676         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12677         Error118. 
12678
12679         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12680         is created, we create the A namespace).
12681
12682         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12683         Fixes #41591
12684
12685 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12686
12687         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12688         invocation to ModuleBuilder.GetType with the same values will
12689         return a new type instance, so we need to cache its return
12690         values. 
12691
12692         * expression.cs (Binary.ResolveOperator): Only allow the compare
12693         operators on enums if they are of the same type.
12694
12695         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12696         types of ValueType on their own case.  Before we were giving them
12697         the same treatment as objects.
12698
12699         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12700         fullname.  Short name is used to compare against container name.
12701         Fullname is used to check against defined namespace names.
12702
12703         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12704         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12705
12706         (Method.CheckBase): Call parent.
12707         (MemberBase.CheckBase): Check for protected members on sealed
12708         classes.
12709         (PropertyBase.CheckBase): Call parent.
12710         (Field.Define): Call parent.
12711
12712         * report.cs: Negative error codes are now mapped to 8000 - code,
12713         so that the display is render more nicely.
12714
12715         * typemanager.cs: Do not use try/catch, instead report a regular
12716         error. 
12717
12718         (GetPointerType, GetReferenceType): These methods provide
12719         mechanisms to obtain the T* and T& from a T.  We had the code
12720         previously scattered around the code base, and it also used
12721         TypeManager.LookupType that would go through plenty of caches.
12722         This one goes directly to the type source.
12723
12724         In some places we did the Type.GetType followed by
12725         ModuleBuilder.GetType, but not in others, so this unifies the
12726         processing as well.
12727
12728         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12729         statements now that we have namespace information.
12730
12731         * typemanager.cs (IsNamespace): New method, returns whether the
12732         string presented is a namespace or not.
12733
12734         (ComputeNamespaces): New public entry point, computes the list of
12735         available namespaces, using the GetNamespaces API call in Mono, or
12736         the slower version in MS.NET.   
12737
12738         Now before we start the semantic analysis phase, we have a
12739         complete list of namespaces including everything that the user has
12740         provided.
12741
12742         Deleted old code to cache namespaces in .nsc files.
12743
12744 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12745
12746         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12747         class/struct location definition Location for the implicit
12748         constructor location.
12749
12750         (Operator.Define): Use the location of the operator for the
12751         implicit Method definition.
12752
12753         (Constructor.Emit): use the constructor location for the implicit
12754         base initializer constructor.
12755
12756         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12757         and the Expression class now contains two new methods:
12758
12759         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12760         isolate type lookup from the rest of the resolution process.
12761
12762         Since we use Expressions to hold type definitions due to the way
12763         we parse the input we have historically overloaded Resolve to
12764         perform the Type lookups if a special flag is passed.  Now this is
12765         eliminated and two methods take their place. 
12766
12767         The differences in the two methods between xStep and xTerminal is
12768         that xStep is involved in our current lookup system that uses
12769         SimpleNames to compose a name, while xTerminal is used just to
12770         catch the case where the simplename lookup failed.
12771
12772 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12773
12774         * expression.cs (ResolveMemberAccess): Remove redundant code.
12775         TypeExpr expressions are always born fully resolved.
12776
12777         * interface.cs (PopulateMethod): Do not lookup the types twice.
12778         We were doing it once during SemanticAnalysis and once during
12779         PopulateMethod.
12780
12781         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12782         in local variable type definitions, were being returned as a
12783         SimpleName (we decomposed everything into a string), that is
12784         because primary_expression was being used instead of a type in the
12785         grammar (reduce/reduce conflicts).
12786
12787         The part that was wrong is that we converted the expression into a
12788         string (an oversimplification in one hand, compounded with primary
12789         expressions doing string concatenation).
12790
12791         So things like:
12792
12793         A.B.C [] x;
12794
12795         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12796         using clauses from working on this particular context.  And a type
12797         was being matched directly against "A.B.C[]".
12798
12799         We now use the correct approach, and allow for ComposedCast to be
12800         part of the unary expression.  So the "A.B.C []" become a composed
12801         cast of "A.B.C" (as a nested group of MemberAccess with a
12802         SimpleName at the end) plus the rank composition "[]". 
12803
12804         Also fixes 35567
12805
12806 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12807
12808         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12809         for the access level checking.
12810
12811         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12812         `TypeContainer container', because I kept getting confused when I
12813         was debugging this code.
12814
12815         * expression.cs (Indexers): Instead of tracking getters/setters,
12816         we now track them in parallel.  We create one arraylist less, but
12817         most importantly it is possible now for the LValue code to find a
12818         matching get for a set.
12819
12820         (IndexerAccess.DoResolveLValue): Update the code.
12821         GetIndexersForType has been modified already to extract all the
12822         indexers from a type.  The code assumed it did not.
12823
12824         Also make the code set the correct return type for the indexer.
12825         This was fixed a long time ago for properties, but was missing for
12826         indexers.  It used to be void_type.
12827
12828         (Binary.Emit): Test first for doubles instead of
12829         floats, as they are more common.
12830
12831         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12832         when dealing with floats and the <=, >= operators.  This fixes bug
12833         #39314 
12834
12835         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12836         to load the array value by emitting a load on the foreach variable
12837         type.  This was incorrect.  
12838
12839         We now emit the code to load an element using the the array
12840         variable type, and then we emit the conversion operator.
12841
12842         Fixed #40176
12843
12844 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12845
12846         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12847
12848 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12849
12850         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12851         test for protection before we test for signatures. 
12852
12853         (MethodSignature.ToString): implement.
12854
12855         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12856         to the case where we reduced into a LongConstant.
12857
12858         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12859         depend on whether the information is acurrate, because the
12860         Microsoft runtime will always claim that the array type is public,
12861         regardless of the real state.
12862
12863         If the type is a pointer, another problem happens: the type is
12864         reported as non-public in Microsoft.  
12865
12866         In both cases we have to call CheckAccessLevel recursively with
12867         the underlying type as the argument to be tested.
12868
12869 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12870
12871         * assign.cs (Assign.Emit): If we are dealing with a compound
12872         assignment expression, we should use the code path that stores the
12873         intermediate result in a temporary value.  This fixes #40903.
12874
12875         *expression.cs (Indirection.ToString): Provide ToString method for
12876         debugging. 
12877
12878 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12879
12880         * class.cs: Null out fields holding references to Block objects so
12881         they can be garbage collected.
12882
12883         * expression.cs (OverloadResolve): Remove unused local.
12884
12885 2003-04-07  Martin Baulig  <martin@ximian.com>
12886
12887         * codegen.cs (EmitContext.CurrentFile): New public field.
12888         (EmitContext.Mark): Use the CurrentFile to check whether the
12889         location is in the correct file.
12890         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12891
12892 2003-04-07  Martin Baulig  <martin@ximian.com>
12893
12894         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12895
12896         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12897         location.  [FIXME: The location argument which gets passed to this
12898         method is sometimes wrong!]
12899
12900 2003-04-07  Nick Drochak <ndrochak@gol.com>
12901
12902         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12903
12904 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12905
12906         * expression.cs (Indirection.EmitAssign): We were using the
12907         temporary, but returning immediately instead of continuing the
12908         EmitAssing flow.
12909
12910 2003-04-06  Martin Baulig  <martin@ximian.com>
12911
12912         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12913         if it's a nested child, but also deriving from the outer class.
12914         See test 190.cs.
12915
12916         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12917         nested child, but also deriving from the outer class.  See
12918         test-190.cs.
12919         (FilterWithClosure): We may access private members of the outer
12920         class if we're a nested child and deriving from the outer class.
12921         (RealMemberLookup): Only set `closure_private_ok' if the
12922         `original_bf' contained BindingFlags.NonPublic.
12923
12924 2003-04-05  Martin Baulig  <martin@ximian.com>
12925
12926         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12927
12928 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12929
12930         * class.cs (Event.Define): Do not allow abstract events to have
12931         initializers. 
12932
12933 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12934
12935         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12936         block in event declarations.
12937
12938         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12939         value type, get its address.
12940
12941         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12942         leaving a class on the stack instead of a boolean value (int
12943         0/1).  Change the code so we compare against null, and then the
12944         result against zero.
12945
12946         * class.cs (TypeContainer.GetClassBases): We were checking for the
12947         parent class being sealed too late.
12948
12949         * expression.cs (Binary.Emit): For <= and >= when dealing with
12950         floating point values, use cgt.un and clt.un instead of cgt and
12951         clt alone.
12952
12953 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12954
12955         * statement.cs: Apply the same optimization as MS: skip the 
12956         GetEnumerator returning an IEnumerator, and use the one returning a 
12957         CharEnumerator instead. This allows us to avoid the try-finally block 
12958         and the boxing.
12959
12960 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12961
12962         * cs-parser.jay: Attributes cannot be applied to
12963                          namespaces. Fixes #40473
12964
12965 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12966
12967         * class.cs:
12968         (Add*): check if the name is valid using the full name for constants,
12969         fields, properties and events.
12970
12971 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12972
12973         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12974         char constants to be part of the enumeration.
12975
12976         * expression.cs (Conditional.DoResolve): Add support for operator
12977         true. Implements the missing functionality from 14.12
12978
12979         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12980         operator true/false as required by the spec.
12981
12982         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12983         implicit conversion to boolean.
12984
12985         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12986         also one where the type implements `operator true'. 
12987
12988         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12989         get an expression that will invoke operator true based on an
12990         expression.  
12991
12992         (GetConversionOperators): Removed the hack that called op_True
12993         here.  
12994
12995         (Expression.ResolveBoolean): Move this from Statement.
12996
12997 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12998
12999         * ecore.cs (FieldExpr): do not allow initialization of initonly
13000         fields on derived classes
13001
13002 2003-03-13  Martin Baulig  <martin@ximian.com>
13003
13004         * statement.cs (Block.Emit): Call ig.BeginScope() and
13005         ig.EndScope() when compiling with debugging info; call
13006         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13007
13008 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13009
13010         * expression.cs (Indexers): Do not construct immediately, allow
13011         for new members to be appended as we go.  Fixes 38143
13012
13013 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13014
13015         * expression.cs: save/restore context when resolving an unchecked
13016         expression.
13017
13018 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13019
13020         * cfold.cs: Catch division by zero in modulus operator during
13021         constant folding.
13022
13023 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13024
13025         * interface.cs (Interface.DefineMembers): Avoid defining members
13026         twice. 
13027
13028 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13029
13030         * driver.cs: handle the +/- options for -noconfig
13031
13032         * statement.cs (Unckeched.Resolve): Also track the state of
13033         unchecked in the Resolve phase.
13034
13035 2003-02-27  Martin Baulig  <martin@ximian.com>
13036
13037         * ecore.cs (Expression.MemberLookup): Don't create a
13038         MethodGroupExpr for something which is not a method.  Fixes #38291.
13039
13040 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13041
13042         * class.cs (MemberBase.CheckParameters): Also check that the type
13043         is unmanaged if it is a pointer.
13044
13045         * expression.cs (SizeOf.Resolve): Add location information.
13046
13047         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13048         a managed type is declared.
13049
13050         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13051         parameter modifiers as well.  Fixes bug 38606
13052
13053         * class.cs: Very sad.  Am backing out the speed up changes
13054         introduced by the ArrayList -> Array in the TypeContainer, as they
13055         were not actually that much faster, and introduced a bug (no error
13056         reports on duplicated methods).
13057
13058         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13059         source first, this will guarantee that we have a valid expression
13060         before calling in lower levels functions that will require a
13061         resolved object.  Then use this original_source in the
13062         target.ResolveLValue instead of the original source that was
13063         passed to us.
13064
13065         Another change.  Use target.Resolve instead of LValueResolve.
13066         Although we are resolving for LValues, we will let the Assign code
13067         take care of that (it will be called again from Resolve).  This
13068         basically allows code like this:
13069
13070         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13071         class Y { void A (X x) { x [0] += o; }
13072
13073         The problem was that the indexer was trying to resolve for
13074         set_Item (idx, object o) and never finding one.  The real set_Item
13075         was set_Item (idx, X).  By delaying the process we get the right
13076         semantics. 
13077
13078         Fixes bug 36505
13079
13080 2003-02-23  Martin Baulig  <martin@ximian.com>
13081
13082         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13083         while calling DoEmit ().
13084
13085         * codegen.cs (EmitContext.Mark): Don't mark locations in other
13086         source files; if you use the #line directive inside a method, the
13087         compiler stops emitting line numbers for the debugger until it
13088         reaches the end of the method or another #line directive which
13089         restores the original file.
13090
13091 2003-02-23  Martin Baulig  <martin@ximian.com>
13092
13093         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13094
13095 2003-02-23  Martin Baulig  <martin@ximian.com>
13096
13097         * statement.cs (Block.AddChildVariableNames): We need to call this
13098         recursively, not just for our immediate children.
13099
13100 2003-02-23  Martin Baulig  <martin@ximian.com>
13101
13102         * class.cs (Event.Define): Always make the field private, like csc does.
13103
13104         * typemanager.cs (TypeManager.RealMemberLookup): Make events
13105         actually work, fixes bug #37521.
13106
13107 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
13108
13109         * delegate.cs: When creating the various temporary "Parameters"
13110         classes, make sure that we call the ComputeAndDefineParameterTypes
13111         on those new parameters (just like we do with the formal ones), to
13112         allow them to be resolved in the context of the DeclSpace.
13113
13114         This fixes the bug that Dick observed in Bugzilla #38530.
13115
13116 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
13117
13118         * expression.cs (ResolveMemberAccess): When resolving a constant,
13119         do not attempt to pull a constant if the value was not able to
13120         generate a valid constant.
13121
13122         * const.cs (LookupConstantValue): Do not report more errors than required.
13123
13124 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13125
13126         * expression.cs: fixes bug #38328.
13127
13128 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13129
13130         * class.cs: Changed all the various members that can be part of a
13131         class from being an ArrayList to be an Array of the right type.
13132         During the DefineType type_list, interface_list, delegate_list and
13133         enum_list are turned into types, interfaces, delegates and enums
13134         arrays.  
13135
13136         And during the member population, indexer_list, event_list,
13137         constant_list, field_list, instance_constructor_list, method_list,
13138         operator_list and property_list are turned into their real arrays.
13139
13140         Although we could probably perform this operation earlier, for
13141         good error reporting we need to keep the lists and remove the
13142         lists for longer than required.
13143
13144         This optimization was triggered by Paolo profiling the compiler
13145         speed on the output of `gen-sample-program.pl' perl script. 
13146
13147         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13148         not crash in methods like MemberLookupFailed that use this field.  
13149
13150         This problem arises when the compiler fails to resolve a type
13151         during interface type definition for example.
13152
13153 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13154
13155         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13156         inherit from System.Object, so we have to stop at null, not only
13157         when reaching System.Object.
13158
13159 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13160
13161         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13162         DeclaredOnly because the parent indexer might have had a different
13163         name, but did not loop until the top of the hierarchy was reached.
13164
13165         The problem this one fixes is 35492: when a class implemented an
13166         indexer from an interface, we were getting the interface method
13167         (which was abstract) and we were flagging an error (can not invoke
13168         abstract method).
13169
13170         This also keeps bug 33089 functioning, and test-148 functioning.
13171
13172         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13173         out if a method is special is to see if it is declared in a
13174         property or event, or whether it is one of the predefined operator
13175         names.   This should fix correctly #36804.
13176
13177 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13178
13179         The goal here is to remove the dependency on EmptyCast.Peel ().
13180         Killing it completely.
13181
13182         The problem is that currently in a number of places where
13183         constants are expected, we have to "probe" for an EmptyCast, and
13184         Peel, which is not the correct thing to do, as this will be
13185         repetitive and will likely lead to errors. 
13186
13187         The idea is to remove any EmptyCasts that are used in casts that
13188         can be reduced to constants, so we only have to cope with
13189         constants. 
13190
13191         This bug hunt was triggered by Bug 37363 and the desire to remove
13192         the duplicate pattern where we were "peeling" emptycasts to check
13193         whether they were constants.  Now constants will always be
13194         constants.
13195
13196         * ecore.cs: Use an enumconstant here instead of wrapping with
13197         EmptyCast.  
13198
13199         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13200         throwing me off.  By handling this we can get rid of a few hacks.
13201
13202         * statement.cs (Switch): Removed Peel() code.
13203
13204 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13205
13206         * class.cs: Location information for error 508
13207
13208         * expression.cs (New.DoResolve): Add a guard against double
13209         resolution of an expression.  
13210
13211         The New DoResolve might be called twice when initializing field
13212         expressions (see EmitFieldInitializers, the call to
13213         GetInitializerExpression will perform a resolve on the expression,
13214         and later the assign will trigger another resolution
13215
13216         This leads to bugs (#37014)
13217
13218         * delegate.cs: The signature for EndInvoke should contain any ref
13219         or out parameters as well.  We were not doing this in the past. 
13220
13221         * class.cs (Field.Define): Do not overwrite the type definition
13222         inside the `volatile' group.  Turns out that volatile enumerations
13223         were changing the type here to perform a validity test, which
13224         broke conversions. 
13225
13226 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13227
13228         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13229         and structs, we do not want to load the instance variable
13230
13231         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13232         enum_type has to be handled like an object reference (implicit
13233         conversions exists from this to object), but the regular IsClass
13234         and IsValueType tests will never return true for this one.
13235
13236         Also we use TypeManager.IsValueType instead of type.IsValueType,
13237         just for consistency with the rest of the code (this is only
13238         needed if we ever use the construct exposed by test-180.cs inside
13239         corlib, which we dont today).
13240
13241 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13242
13243         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13244         just InternalCall.
13245
13246 2003-02-09  Martin Baulig  <martin@ximian.com>
13247
13248         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13249         (Namespace.DefineNamespaces): New static public method; this is
13250         called when we're compiling with debugging to add all namespaces
13251         to the symbol file.
13252
13253         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13254         pass it to the Namespace's .ctor.
13255
13256         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13257         and MethodBase arguments; pass the namespace ID to the symwriter;
13258         pass the MethodBase instead of the token to the symwriter.
13259         (SymbolWriter.DefineNamespace): New method to add a namespace to
13260         the symbol file.
13261
13262 2003-02-09  Martin Baulig  <martin@ximian.com>
13263
13264         * symbolwriter.cs: New file.  This is a wrapper around
13265         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13266         methods here in near future.
13267
13268 2003-02-09  Martin Baulig  <martin@ximian.com>
13269
13270         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13271         ILGenerator.MarkSequencePoint() which are actually used by the
13272         symbol writer.
13273
13274 2003-02-09  Martin Baulig  <martin@ximian.com>
13275
13276         * location.cs (SourceFile): New public sealed class.  This
13277         contains the name and an index which is used in the location's token.
13278         (Location): Reserve an appropriate number of bits in the token for
13279         the source file instead of walking over that list, this gives us a
13280         really huge performance improvement when compiling with debugging.
13281
13282         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13283         `SourceFile' argument instead of a string.
13284         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13285         but don't parse/tokenize here, we need to generate the list of all
13286         source files before we do that.
13287         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13288         the files.
13289
13290         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13291         instead of a string.
13292
13293         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13294         of a string.
13295
13296 2003-02-09  Martin Baulig  <martin@ximian.com>
13297
13298         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13299         filename on `#line default'.
13300
13301 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13302
13303         * statement.cs: don't clear the pinned var when the fixed statement
13304         returns from the method (fixes bug#37752).
13305
13306 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13307
13308         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13309         to IsValueType.
13310
13311 2003-02-07  Martin Baulig  <martin@ximian.com>
13312
13313         * driver.cs: Removed the `--debug-args' command line argument.
13314
13315         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13316         automatically by the AsssemblyBuilder.
13317         (CodeGen.InitializeSymbolWriter): We don't need to call any
13318         initialization function on the symbol writer anymore.  This method
13319         doesn't take any arguments.
13320
13321 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13322
13323         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13324         from referenced assemblies as well.
13325
13326 2003-02-02  Martin Baulig  <martin@ximian.com>
13327
13328         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13329
13330 2003-02-02  Martin Baulig  <martin@ximian.com>
13331
13332         * class.cs (Constructor.Emit): Open the symbol writer before
13333         emitting the constructor initializer.
13334         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13335         single-stepping through constructor initializers.
13336
13337 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13338
13339         * class.cs: Handle error 549: do not allow virtual methods in
13340         sealed classes. 
13341
13342 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13343
13344         * decl.cs: Check access levels when resolving types
13345
13346 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13347
13348         * statement.cs: Add parameters and locals set in catch blocks that might 
13349         return to set vector
13350
13351 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13352
13353         * class.cs (Operator): Set the SpecialName flags for operators.
13354
13355         * expression.cs (Invocation.DoResolve): Only block calls to
13356         accessors and operators on SpecialName methods.
13357
13358         (Cast.TryReduce): Handle conversions from char constants.
13359
13360
13361 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13362
13363         * statement.cs: small memory and time optimization in FlowBranching.
13364
13365 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13366
13367         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13368         problem that the last fix but in the other sid (Set).
13369
13370         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13371         access when there is no indexer in the hierarchy.
13372
13373 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13374
13375         * class.cs: Combine some if statements.
13376
13377 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13378
13379         * driver.cs: fixed bug #37187.
13380
13381 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13382
13383         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13384         any indexer, it's needed to build a list with all the indexers in the
13385         hierarchy (AllGetters), else we have problems. Fixes #35653.
13386
13387 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13388
13389         * class.cs (MethodData.Define): It is wrong for an interface
13390         implementation to be static in both cases: explicit and implicit.
13391         We were only handling this in one case.
13392
13393         Improve the if situation there to not have negations.
13394
13395         * class.cs (Field.Define): Turns out that we do not need to check
13396         the unsafe bit on field definition, only on usage.  Remove the test.
13397
13398 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13399
13400         * driver.cs: use assembly.Location instead of Codebase (the latest
13401         patch made mcs fail when using MS assemblies).
13402
13403 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13404
13405         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13406         get the path to *corlib.dll.
13407
13408 2003-01-21  Nick Drochak <ndrochak@gol.com>
13409
13410         * cs-tokenizer.cs:
13411         * pending.cs:
13412         * typemanager.cs: Remove compiler warnings
13413
13414 2003-01-20  Duncan Mak  <duncan@ximian.com>
13415
13416         * AssemblyInfo.cs: Bump the version number to 0.19.
13417
13418 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13419
13420         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13421
13422 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13423
13424         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13425
13426 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13427
13428         * cs-parser.jay: Small fix: we were not comparing the constructor
13429         name correctly.   Thanks to Zoltan for the initial pointer.
13430
13431 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13432
13433         * cs-tokenizer.cs: Set file name when specified with #line
13434
13435 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13436
13437         * cs-parser.jay: Only perform the constructor checks here if we
13438         are named like the class;  This will help provider a better
13439         error.  The constructor path is taken when a type definition is
13440         not found, but most likely the user forgot to add the type, so
13441         report that rather than the constructor error.
13442
13443 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13444
13445         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13446         allocations.
13447
13448 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13449
13450         * cs-parser.jay: Add cleanup call.
13451
13452 2003-01-13  Duncan Mak  <duncan@ximian.com>
13453
13454         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13455         consistent with other methods.
13456
13457 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13458
13459         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13460
13461 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13462
13463         * attribute.cs: only set GuidAttr to true when we have a
13464         GuidAttribute.
13465
13466 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13467
13468         * ecore.cs:
13469         * expression.cs:
13470         * typemanager.cs: fixes to allow mcs compile corlib with the new
13471         Type.IsSubclassOf fix.
13472
13473 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13474
13475         * expression.cs (LocalVariableReference.DoResolve): Classify a
13476         constant as a value, not as a variable.   Also, set the type for
13477         the variable.
13478
13479         * cs-parser.jay (fixed_statement): take a type instead of a
13480         pointer_type, so we can produce a better error message later.
13481
13482         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13483         as an error.  
13484
13485         (For.DoEmit): Make inifinite loops have a
13486         non-conditional branch back.
13487
13488         (Fixed.DoEmit): First populate the pinned variables, then emit the
13489         statement, then clear the variables.  Before I was emitting the
13490         code once for each fixed piece.
13491
13492
13493 2003-01-08  Martin Baulig  <martin@ximian.com>
13494
13495         * statement.cs (FlowBranching.MergeChild): A break in a
13496         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13497
13498 2003-01-08  Martin Baulig  <martin@ximian.com>
13499
13500         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13501         lives in the same number space than `param_map'.  Fixes #36154.
13502
13503 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13504
13505         * cs-parser.jay (constructor_declaration): Set the
13506         Constructor.ModFlags before probing for it.  This makes the
13507         compiler report 514, 515 and 132 (the code was there, but got
13508         broken). 
13509
13510         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13511         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13512         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13513
13514 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13515
13516         * enum.cs: create the enum static fields using the enum type.
13517
13518 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13519
13520         * class.cs: don't try to create the ParamBuilder for the return
13521         type if it's not needed (and handle it breaking for the ms runtime
13522         anyway).
13523
13524 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13525
13526         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13527
13528 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13529
13530         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13531         the command.   This showed up while compiling the JANET source
13532         code, which used \r as its only newline separator.
13533
13534 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13535
13536         * class.cs (Method.Define): If we are an operator (because it
13537         reuses our code), then set the SpecialName and HideBySig.  #36128
13538
13539 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13540
13541         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13542         exception, report error 120 `object reference required'.
13543
13544         * driver.cs: Add --pause option, used during to measure the size
13545         of the process as it goes with --timestamp.
13546
13547         * expression.cs (Invocation.DoResolve): Do not allow methods with
13548         SpecialName to be invoked.
13549
13550 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13551
13552         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13553         number before adding it.
13554
13555 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13556
13557         * ecore.cs (StandardImplicitConversion): When in an unsafe
13558         context, we allow conversion between void * to any other pointer
13559         type. This fixes bug #35973.
13560
13561 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13562
13563         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13564         is not thrown when extensionless outputs are used 
13565
13566 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13567
13568         * rootcontext.cs: fixed compilation of corlib.
13569
13570 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13571
13572         * attribute.cs (Attributes.Contains): Add new method.
13573
13574         * class.cs (MethodCore.LabelParameters): if the parameter is an
13575         `out' parameter, check that no attribute `[In]' has been passed.
13576
13577         * enum.cs: Handle the `value__' name in an enumeration.
13578
13579 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13580
13581         * decl.cs: Added special case to allow overrides on "protected
13582         internal" methods
13583
13584 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13585
13586         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13587         since it makes much more sense.
13588
13589         (Attributes.ctor): Don't require a Location parameter.
13590
13591         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13592
13593         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13594         since we already have that information per attribute.
13595
13596         * everywhere : make appropriate changes.
13597
13598         * class.cs (LabelParameters): Write the code which actually
13599         applies attributes to the return type. We can't do this on the MS
13600         .NET runtime so we flag a warning in the case an exception is
13601         thrown.
13602
13603 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13604
13605         * const.cs: Handle implicit null conversions here too.
13606
13607 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13608
13609         * class.cs (MethodCore.LabelParameters): Remove the extra
13610         Type [] parameter since it is completely unnecessary. Instead
13611         pass in the method's attributes so that we can extract
13612         the "return" attribute.
13613
13614 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13615
13616         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13617         of ignoring it and letting the compile continue.
13618
13619         * typemanager.cs (ChangeType): use an extra argument to return an
13620         error condition instead of throwing an exception.
13621
13622 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13623
13624         * expression.cs (Unary.TryReduce): mimic the code for the regular
13625         code path.  Perform an implicit cast in the cases where we can
13626         implicitly convert to one of the integral types, and then reduce
13627         based on that constant.   This fixes bug #35483.
13628
13629 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13630
13631         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13632
13633 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13634
13635         * namespace.cs: fixed bug #35489.
13636
13637 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13638
13639         * class.cs: Remove some dead code.
13640
13641         * cs-parser.jay: Estimate the number of methods needed
13642         (RootContext.MethodCount);
13643
13644         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13645         numbers instead of StringBuilders.
13646
13647         * support.cs (PtrHashtable): Add constructor with initial size;
13648         We can now reduce reallocations of the method table.
13649
13650 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13651
13652         * attribute.cs (ApplyAttributes): Keep track of the emitted
13653         attributes on a per-target basis. This fixes bug #35413.
13654
13655 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13656
13657         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13658         default to the Windows 1252 encoding.
13659
13660         (UnixParseOption): Support version, thanks to Alp for the missing
13661         pointer. 
13662
13663         * AssemblyInfo.cs: Add nice assembly information.
13664
13665         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13666         (bug 35169).
13667
13668         * cs-parser.jay: Allow a trailing comma before the close bracked
13669         in the attribute_section production.
13670
13671         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13672         address of the instance was being taken, I will take this out,
13673         because we take the address of the object immediately here.
13674
13675 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13676
13677         * typemanager.cs (AreMultipleAllowed): Take care of the most
13678         obvious case where attribute type is not in the current assembly -
13679         stupid me ;-)
13680
13681 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13682
13683         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13684         definitions, instead of doing that afterwards.  
13685
13686         Also we use a nice little hack, depending on the constructor, we
13687         know if we are a "composed" name or a simple name.  Hence, we
13688         avoid the IndexOf test, and we avoid 
13689
13690         * codegen.cs: Add code to assist in a bug reporter to track down
13691         the source of a compiler crash. 
13692
13693 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13694
13695         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13696         types have been emitted for a given element and flag an error
13697         if something which does not have AllowMultiple set is used more
13698         than once.
13699
13700         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13701         attribute types and their corresponding AllowMultiple properties
13702
13703         (AreMultipleAllowed): Check the property for a given type.
13704
13705         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13706         property in the case we have a TypeContainer.
13707
13708         (Attributes.AddAttribute): Detect duplicates and just skip on
13709         adding them. This trivial fix catches a pretty gross error in our
13710         attribute emission - global attributes were being emitted twice!
13711
13712         Bugzilla bug #33187 is now fixed.
13713
13714 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13715
13716         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13717         instead of pp_and).
13718
13719         * expression.cs (Binary.ResolveOperator): I can only use the
13720         Concat (string, string, string) and Concat (string, string,
13721         string, string) if the child is actually a concatenation of
13722         strings. 
13723
13724 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13725
13726         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13727         context where we need a 2-character lookahead.
13728
13729         * pending.cs (PendingImplementation): Rework so we can keep track
13730         of interface types all the time, and flag those which were
13731         implemented by parents as optional.
13732
13733 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13734
13735         * expression.cs (Binary.ResolveOperator): Use
13736         String.Concat(string,string,string) or
13737         String.Concat(string,string,string,string) when possible. 
13738
13739         * typemanager: More helper methods.
13740
13741
13742 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13743
13744         * pending.cs: remove the bogus return from GetMissingInterfaces()
13745         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13746
13747 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13748
13749         * namespace.cs: avoid duplicated 'using xxx' being added to
13750         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13751         when we get more than one 'using' statement for the same namespace.
13752         Report a CS0105 warning for it.
13753
13754 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13755
13756         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13757         of calling getChar/putback, uses internal knowledge of it.    
13758
13759         (xtoken): Reorder tokenizer so most common patterns are checked
13760         first.  This reduces the compilation time in another 5% (from 8.11s
13761         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13762
13763         The parsing time is 22% of the compilation in mcs, and from that
13764         64% is spent on the tokenization process.  
13765
13766         I tried using a binary search for keywords, but this is slower
13767         than the hashtable.  Another option would be to do a couple of
13768         things:
13769
13770                 * Not use a StringBuilder, instead use an array of chars,
13771                   with a set value.  Notice that this way we could catch
13772                   the 645 error without having to do it *afterwards*.
13773
13774                 * We could write a hand-parser to avoid the hashtable
13775                   compares altogether.
13776
13777         The identifier consumption process takes 37% of the tokenization
13778         time.  Another 15% is spent on is_number.  56% of the time spent
13779         on is_number is spent on Int64.Parse:
13780
13781                 * We could probably choose based on the string length to
13782                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13783                   computations. 
13784
13785         Another 3% is spend on wrapping `xtoken' in the `token' function.
13786
13787         Handle 0xa0 as whitespace (#34752)
13788
13789 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13790
13791         * typemanager.cs (IsCLRType): New routine to tell whether a type
13792         is one of the builtin types.  
13793
13794         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13795         typecode in more places instead of doing pointer comparissions.
13796         We could leverage some knowledge about the way the typecodes are
13797         laid out.
13798
13799         New code to cache namespaces in assemblies, it is currently not
13800         invoked, to be used soon.
13801
13802         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13803
13804         * expression.cs (Binary.ResolveOperator): specially handle
13805         strings, and do not perform user-defined operator overloading for
13806         built-in types.
13807
13808 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13809
13810         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13811         internalcall as it is a pretty simple operation;  Avoid whenever
13812         possible to call Char.IsLetter.
13813
13814         (consume_identifier): Cut by half the number of
13815         hashtable calls by merging the is_keyword and GetKeyword behavior.
13816
13817         Do not short-circuit, because if we do, we
13818         report errors (ie, #if false && true would produce an invalid
13819         directive error);
13820
13821
13822 2002-11-24  Martin Baulig  <martin@ximian.com>
13823
13824         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13825         check constant ranges and report a CS0221.  Fixes #33186.
13826
13827 2002-11-24  Martin Baulig  <martin@ximian.com>
13828
13829         * cs-parser.jay: Make this work for uninitialized variable
13830         declarations in the `for' initializer.  Fixes #32416.
13831
13832 2002-11-24  Martin Baulig  <martin@ximian.com>
13833
13834         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13835         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13836
13837 2002-11-24  Martin Baulig  <martin@ximian.com>
13838
13839         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13840         argument; if true, we also check for user-defined conversions.
13841         This is only needed if both arguments are of a user-defined type.
13842         Fixes #30443, added test-175.cs.
13843         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13844
13845         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13846
13847 2002-11-24  Martin Baulig  <martin@ximian.com>
13848
13849         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13850         function to get the store opcode.
13851         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13852         only emit the Ldelema if the store opcode is Stobj.  You must run
13853         both test-34 and test-167 to test this.  Fixes #34529.
13854
13855 2002-11-23  Martin Baulig  <martin@ximian.com>
13856
13857         * ecore.cs (Expression.MemberLookup): Added additional
13858         `qualifier_type' argument which is used when we're being called
13859         from MemberAccess.DoResolve() and null if we're called from a
13860         SimpleName lookup.
13861         (Expression.MemberLookupFailed): New method to report errors; this
13862         does the CS1540 check and reports the correct error message.
13863
13864         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13865         argument for the CS1540 check and redone the way how we're dealing
13866         with private members.  See the comment in the source code for details.
13867         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13868         `closure_start_type' to `closure_qualifier_type' and check whether
13869         it's not null.  It was not this filter being broken, it was just
13870         being called with the wrong arguments.
13871
13872         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13873         and pass it the correct `qualifier_type'; this also does the error
13874         handling for us.
13875
13876 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13877
13878         * expression.cs (Invocation.EmitParams): If the we are dealing
13879         with a non-built-in value type, load its address as well.
13880
13881         (ArrayCreation): Use a a pretty constant instead
13882         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13883         static initializers.  
13884
13885         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13886         because they are not really value types, just glorified integers. 
13887
13888         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13889
13890         * ecore.cs: Remove redundant code for enumerations, make them use
13891         the same code path as everything else, fixes the casting issue
13892         with enumerations in Windows.Forms.
13893
13894         * attribute.cs: Do only cast to string if it is a string, the
13895         validation happens later.
13896
13897         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13898         people upgrade their corlibs.
13899
13900         * ecore.cs: Oops, enumerations were not following the entire code path
13901
13902 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13903
13904         * typemanager.cs (FilterWithClosure): Commented out the test for
13905         1540 in typemanager.cs, as it has problems when accessing
13906         protected methods from a parent class (see test-174.cs). 
13907
13908         * attribute.cs (Attribute.ValidateGuid): new method.
13909         (Attribute.Resolve): Use above.
13910
13911 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13912
13913         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13914
13915         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13916         handling for enumerations, as we only needed the TypeContainer
13917         functionality to begin with (this is required for the fix below to
13918         work for enums that reference constants in a container class for
13919         example). 
13920
13921         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13922
13923         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13924         a valid TypeBuilder to perform lookups on.o
13925
13926         * class.cs (InheritableMemberSignatureCompare): Use true in the
13927         call to GetGetMethod and GetSetMethod, because we are comparing
13928         the signature, and we need to get the methods *even* if they are
13929         private. 
13930
13931         (PropertyBase.CheckBase): ditto.
13932
13933         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13934         GotoCase.Resolve): Use Peel on EmpytCasts.
13935
13936         * ecore.cs (EmptyCast): drop child, add Peel method.
13937
13938 2002-11-17  Martin Baulig  <martin@ximian.com>
13939
13940         * ecore.cs (EmptyCast.Child): New public property.
13941
13942         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13943         label resolved to an EmptyCast.  Fixes #34162.
13944         (GotoCase.Resolve): Likewise.
13945         (Block.EmitMeta): Likewise.
13946
13947 2002-11-17  Martin Baulig  <martin@ximian.com>
13948
13949         * expression.cs (Invocation.BetterConversion): Prefer int over
13950         uint; short over ushort; long over ulong for integer literals.
13951         Use ImplicitConversionExists instead of StandardConversionExists
13952         since we also need to check for user-defined implicit conversions.
13953         Fixes #34165.  Added test-173.cs.
13954
13955 2002-11-16  Martin Baulig  <martin@ximian.com>
13956
13957         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13958         with the `true' and `false' literals.  Fixes #33151.
13959
13960 2002-11-16  Martin Baulig  <martin@ximian.com>
13961
13962         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13963         October 22nd; don't do the cs1540 check for static members.
13964
13965         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13966         now using our own filter here and doing the cs1540 check again.
13967
13968 2002-11-16  Martin Baulig  <martin@ximian.com>
13969
13970         * support.cs (InternalParameters): Don't crash if we don't have
13971         any fixed parameters.  Fixes #33532.
13972
13973 2002-11-16  Martin Baulig  <martin@ximian.com>
13974
13975         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13976         when looking up static methods to make this work on Windows.
13977         Fixes #33773.
13978
13979 2002-11-16  Martin Baulig  <martin@ximian.com>
13980
13981         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13982         a setter rather than using PropertyInfo.CanWrite.
13983
13984 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13985
13986         * class.cs: Allow acces to block member by subclasses. Fixes build
13987         breaker.
13988
13989 2002-11-14  Martin Baulig  <martin@ximian.com>
13990
13991         * class.cs (Constructor.Emit): Added the extern/block check.
13992         Fixes bug #33678.
13993
13994 2002-11-14  Martin Baulig  <martin@ximian.com>
13995
13996         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13997         iteration while looking for indexers, this is needed because the
13998         indexer may have a different name in our base classes.  Fixed the
13999         error reporting (no indexers at all, not get accessor, no
14000         overloaded match).  Fixes bug #33089.
14001         (IndexerAccess.DoResolveLValue): Likewise.
14002
14003 2002-11-14  Martin Baulig  <martin@ximian.com>
14004
14005         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14006         indexers.  Fixes the first part of bug #33089.
14007         (MethodSignature.InheritableMemberSignatureCompare): Added support
14008         for properties.
14009
14010 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14011
14012         * attribute.cs (Attribute.Resolve): Catch the
14013         NullReferenceException and report it since it isn't supposed to
14014         happen. 
14015
14016 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14017
14018         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14019         LogicalOr and LogicalAnd that can benefit from recursively
14020         handling EmitBranchable.  The code now should be nice for Paolo.
14021
14022 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14023
14024         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14025         the Type lookups, as we perform quite a number of lookups on
14026         non-Types.  This can be removed once we can deterministically tell
14027         whether we have a type or a namespace in advance.
14028
14029         But this might require special hacks from our corlib.
14030
14031         * TODO: updated.
14032
14033         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14034         and double which avoids a conversion from an integer to a double.
14035
14036         * expression.cs: tiny optimization, avoid calling IsConstant,
14037         because it effectively performs the lookup twice.
14038
14039 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14040
14041         But a bogus return here to keep the semantics of the old code
14042         until the Mono runtime is fixed.
14043
14044         * pending.cs (GetMissingInterfaces): New method used to remove all
14045         the interfaces that are already implemented by our parent
14046         classes from the list of pending methods. 
14047
14048         * interface.cs: Add checks for calls after ResolveTypeExpr.
14049
14050 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14051
14052         * class.cs (Class.Emit): Report warning 67: event not used if the
14053         warning level is beyond 3.
14054
14055         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14056         being a NullLiteral.
14057
14058         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14059         specifiers. 
14060
14061         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14062         path that might fail if a type can not be resolved.
14063
14064         * expression.cs (Binary.Emit): Emit unsigned versions of the
14065         operators. 
14066
14067         * driver.cs: use error 5.
14068
14069 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14070
14071         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14072
14073 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14074
14075         * cs-parser.jay (switch_section): A beautiful patch from Martin
14076         Baulig that fixed 33094.
14077
14078 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14079
14080         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14081         Check whether the base is abstract and report an error if so.
14082
14083         * expression.cs (IndexerAccess.DoResolveLValue,
14084         IndexerAccess.DoResolve): ditto. 
14085
14086         (Invocation.DoResolve): ditto.
14087
14088         (Invocation.FullMethodDesc): Improve the report string.
14089
14090         * statement.cs (Block): Eliminate IsVariableDefined as it is
14091         basically just a wrapper for GetVariableInfo.
14092
14093         * ecore.cs (SimpleName): Use new 
14094
14095         * support.cs (ReflectionParamter.ParameterType): We unwrap the
14096         type, as we return the actual parameter ref/unref state on a
14097         different call.
14098
14099 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
14100
14101         * support.cs: Return proper flags REF/OUT fixing the previous
14102         commit.  
14103
14104         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
14105         not used to mean `ref' but `ref or out' in ParameterReference
14106
14107         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14108         full type signature instead of calling TypeManger.CSharpName
14109         ourselves. 
14110
14111         * support.cs (InternalParameters.ParameterDesc): Do not compare
14112         directly to the modflags, because REF/OUT will actually be bitsets
14113         if set. 
14114
14115         * delegate.cs (VerifyMethod): Check also the modifiers.
14116
14117         * cs-tokenizer.cs: Fix bug where floating point values with an
14118         exponent where a sign was missing was ignored.
14119
14120         * driver.cs: Allow multiple assemblies to be specified in a single
14121         /r: argument
14122
14123 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
14124
14125         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
14126         because identifiers after a parenthesis would end up in this kind
14127         of production, and we needed to desamiguate it for having casts
14128         like:
14129
14130                 (UserDefinedType *) xxx
14131
14132 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14133
14134         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14135         we should set on the Bindingflags.NonPublic, but not turn on
14136         private_ok.  private_ok controls whether a Private member is
14137         returned (this is chekced on the filter routine), while the
14138         BindingFlags.NonPublic just controls whether private/protected
14139         will be allowed.   This fixes the problem part of the problem of
14140         private properties being allowed to be used in derived classes.
14141
14142         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14143         so we can call the children DoResolveLValue method (this will
14144         properly signal errors on lvalue assignments to base properties)
14145
14146         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14147         getter are null, and we have a property info, we know that this
14148         happened because the lookup failed, so we report an error 122 for
14149         protection level violation.
14150
14151         We also silently return if setter and getter are null in the
14152         resolve functions, this condition only happens if we have flagged
14153         the error before.  This is the other half of the problem. 
14154
14155         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14156         not have accessibility information, that is why we were returning
14157         true in the filter function in typemanager.cs.
14158
14159         To properly report 122 (property is inaccessible because of its
14160         protection level) correctly, we report this error in ResolveAccess
14161         by failing if both the setter and the getter are lacking (ie, the
14162         lookup failed). 
14163
14164         DoResolve and DoLResolve have been modified to check for both
14165         setter/getter being null and returning silently, the reason being
14166         that I did not want to put the knowledge about this error in upper
14167         layers, like:
14168
14169         int old = Report.Errors;
14170         x = new PropertyExpr (...);
14171         if (old != Report.Errors)
14172                 return null;
14173         else
14174                 return x;
14175
14176         So the property expr is returned, but it is invalid, so the error
14177         will be flagged during the resolve process. 
14178
14179         * class.cs: Remove InheritablePropertySignatureCompare from the
14180         class, as we no longer depend on the property signature to compute
14181         whether it is possible to implement a method or not.
14182
14183         The reason is that calling PropertyInfo.GetGetMethod will return
14184         null (in .NET, in Mono it works, and we should change this), in
14185         cases where the Get Method does not exist in that particular
14186         class.
14187
14188         So this code:
14189
14190         class X { public virtual int A { get { return 1; } } }
14191         class Y : X { }
14192         class Z : Y { public override int A { get { return 2; } } }
14193
14194         Would fail in Z because the parent (Y) would not have the property
14195         defined.  So we avoid this completely now (because the alternative
14196         fix was ugly and slow), and we now depend exclusively on the
14197         method names.
14198
14199         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14200         reference method, instead of using the property.
14201
14202         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14203         routines are gone now.
14204
14205         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14206         names, they were incorrectly named.
14207
14208         * cs-tokenizer.cs: Return are more gentle token on failure. 
14209
14210         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14211         had an out-of-sync index variable, which caused it to remove from
14212         the list of pending methods the wrong method sometimes.
14213
14214 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14215
14216         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14217         CanWrite, because those refer to this particular instance of the
14218         property, and do not take into account the fact that we can
14219         override single members of a property.
14220
14221         Constructor requires an EmitContext.  The resolution process does
14222         not happen here, but we need to compute the accessors before,
14223         because the resolution does not always happen for properties.
14224
14225         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14226         subclass, before we did not update this flag, but we did update
14227         bindingflags. 
14228
14229         (GetAccessors): Drop this routine, as it did not work in the
14230         presence of partially overwritten set/get methods. 
14231
14232         Notice that this broke the cs1540 detection, but that will require
14233         more thinking. 
14234
14235 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14236
14237         * class.cs:
14238         * codegen.cs:
14239         * driver.cs: issue a warning instead of an error if we don't support
14240         debugging for the platform. Also ignore a couple of errors that may
14241         arise when trying to write the symbols. Undo my previous patch.
14242
14243 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14244
14245         * driver.cs: ignore /debug switch except for Unix platforms.
14246
14247 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14248
14249         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14250
14251 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14252
14253         * driver.cs: Do not make mcs-debug conditional, so we do not break
14254         builds that use it.
14255
14256         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14257         review this patch.  But basically after all the children variables
14258         have been merged, the value of "Breaks" was not being set to
14259         new_breaks for Switch blocks.  I think that it should be set after
14260         it has executed.  Currently I set this to the value of new_breaks,
14261         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14262         conservative, but I do not understand this code very well.
14263
14264         I did not break anything in the build, so that is good ;-)
14265
14266         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14267
14268 2002-10-20  Mark Crichton  <crichton@gimp.org>
14269
14270         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14271
14272 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14273
14274         * cfold.cs: Fixed compile blocker.
14275
14276 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14277
14278         * driver.cs: I was chekcing the key, not the file.
14279
14280 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14281
14282         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14283         message that we were generating - we just need to silently return
14284         a null.
14285
14286 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14287
14288         * class.cs (Event.Define): Change my previous commit, as this
14289         breaks the debugger.  This is a temporary hack, as it seems like
14290         the compiler is generating events incorrectly to begin with.
14291
14292         * expression.cs (Binary.ResolveOperator): Added support for 
14293         "U operator - (E x, E y)"
14294
14295         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14296         y)".
14297
14298         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14299         init-only variables, but this path did not take into account that
14300         there might be also instance readonly variables.  Correct this
14301         problem. 
14302
14303         This fixes bug 32253
14304
14305         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14306         delegates as well.
14307
14308         * driver.cs: Change the extension for modules to `netmodule'
14309
14310         * cs-parser.jay: Improved slightly the location tracking for
14311         the debugger symbols.
14312
14313         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14314         modifiers that were specified instead of the hardcoded value
14315         (FamAndAssem).  This was basically ignoring the static modifier,
14316         and others.  Fixes 32429.
14317
14318         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14319         fixed a bug in the process (32476)
14320
14321         * expression.cs (ArrayAccess.EmitAssign): Patch from
14322         hwang_rob@yahoo.ca that fixes bug 31834.3
14323
14324 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14325
14326         * driver.cs: Make the module extension .netmodule.
14327
14328 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14329
14330         * driver.cs: Report an error if the resource file is not found
14331         instead of crashing.
14332
14333         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14334         false, like Emit does.
14335
14336 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14337
14338         * typemanager.cs: Remove unused private member.  Also reported mcs
14339         bug to report this as a warning like csc.
14340
14341 2002-10-15  Martin Baulig  <martin@gnome.org>
14342
14343         * statement.cs (Statement.Emit): Made this a virtual method; emits
14344         the line number info and calls DoEmit().
14345         (Statement.DoEmit): New protected abstract method, formerly knows
14346         as Statement.Emit().
14347
14348         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14349
14350 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14351
14352         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14353         have fixed a remaining problem: not every AddXXXX was adding a
14354         fully qualified name.  
14355
14356         Now everyone registers a fully qualified name in the DeclSpace as
14357         being defined instead of the partial name.  
14358
14359         Downsides: we are slower than we need to be due to the excess
14360         copies and the names being registered this way.  
14361
14362         The reason for this is that we currently depend (on the corlib
14363         bootstrap for instance) that types are fully qualified, because
14364         we dump all the types in the namespace, and we should really have
14365         types inserted into the proper namespace, so we can only store the
14366         basenames in the defined_names array.
14367
14368 2002-10-10  Martin Baulig  <martin@gnome.org>
14369
14370         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14371         from bug #31834, see the bug report for a testcase which is
14372         miscompiled.
14373
14374 2002-10-10  Martin Baulig  <martin@gnome.org>
14375
14376         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14377         flow analysis code for this.
14378
14379         * statement.cs (Do, While, For): Tell the flow analysis code about
14380         infinite loops.
14381         (FlowBranching.UsageVector): Added support for infinite loops.
14382         (Block.Resolve): Moved the dead code elimination here and use flow
14383         analysis to do it.
14384
14385 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14386
14387         * class.cs (Field.Define): Catch cycles on struct type
14388         definitions. 
14389
14390         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14391         fields if the fields are static.  We only need to check instance
14392         fields. 
14393
14394         * expression.cs (As.DoResolve): Test for reference type.
14395
14396         * statement.cs (Using.ResolveExpression): Use
14397         ConvertImplicitRequired, not ConvertImplicit which reports an
14398         error on failture
14399         (Using.ResolveLocalVariableDecls): ditto.
14400
14401         * expression.cs (Binary.ResolveOperator): Report errors in a few
14402         places where we had to.
14403
14404         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14405
14406 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14407
14408         * expression.cs: Use StoreFromPtr instead of extracting the type
14409         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14410
14411         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14412         an enumeration value to a System.Enum, but System.Enum is not a
14413         value type, but an class type, so we need to box.
14414
14415         (Expression.ConvertExplicit): One codepath could return
14416         errors but not flag them.  Fix this.  Fixes #31853
14417
14418         * parameter.cs (Resolve): Do not allow void as a parameter type.
14419
14420 2002-10-06  Martin Baulig  <martin@gnome.org>
14421
14422         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14423         if it's a class type and not a struct.  Fixes #31815.
14424
14425 2002-10-06  Martin Baulig  <martin@gnome.org>
14426
14427         * statement.cs: Reworked the flow analysis code a bit to make it
14428         usable for dead code elimination.
14429
14430 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14431
14432         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14433
14434 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14435
14436         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14437         to fix the test 165, will investigate deeper.
14438
14439 2002-10-04  Martin Baulig  <martin@gnome.org>
14440
14441         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14442         finally blocks actually work.
14443         (Try.Resolve): We don't need to create a sibling for `finally' if
14444         there is no finally block.
14445
14446 2002-10-04  Martin Baulig  <martin@gnome.org>
14447
14448         * class.cs (Constructor.Define): The default accessibility for a
14449         non-default constructor is private, not public.
14450
14451 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14452
14453         * class.cs (Constructor): Make AllowedModifiers public, add
14454         EXTERN.
14455
14456         * cs-parser.jay: Perform the modifiers test here, as the
14457         constructor for the Constructor class usually receives a zero
14458         because of the way we create it (first we create, later we
14459         customize, and we were never checking the modifiers).
14460
14461         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14462         is a version of LookupTypeReflection that includes the type-name
14463         cache.  This can be used as a fast path for functions that know
14464         the fully qualified name and are only calling into *.GetType() to
14465         obtain a composed type.
14466
14467         This is also used by TypeManager.LookupType during its type
14468         composition.
14469
14470         (LookupType): We now also track the real type name, as sometimes
14471         we can get a quey for the real type name from things like
14472         ComposedCast.  This fixes bug 31422.
14473
14474         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14475         complete type fullname, it does not have to go through the type
14476         resolution system to obtain the composed version of the type (for
14477         obtaining arrays or pointers).
14478
14479         (Conditional.Emit): Use the EmitBoolExpression to
14480         generate nicer code, as requested by Paolo.
14481
14482         (ArrayCreation.CheckIndices): Use the patch from
14483         hwang_rob@yahoo.ca to validate the array initializers. 
14484
14485 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14486
14487         * class.cs (ConstructorInitializer.Emit): simplify code by using
14488         Invocation.EmitCall, and at the same time, fix the bugs in calling
14489         parent constructors that took variable arguments. 
14490
14491         * ecore.cs (Expression.ConvertNumericExplicit,
14492         Expression.ImplicitNumericConversion): Remove the code that
14493         manually wrapped decimal (InternalTypeConstructor call is now gone
14494         as well).
14495
14496         * expression.cs (Cast.TryReduce): Also handle decimal types when
14497         trying to perform a constant fold on the type.
14498
14499         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14500
14501         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14502         that only turned off an error report, and did nothing else. 
14503
14504 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14505
14506         * driver.cs: Handle and ignore /fullpaths
14507
14508 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14509
14510         * expression.cs (Binary.ResolveOperator): Catch the case where
14511         DoNumericPromotions returns true, 
14512
14513         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14514
14515 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14516
14517         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14518         report error 70.
14519
14520 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14521
14522         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14523         conversion exists, but it is also required that the conversion be
14524         performed.  This manifested in "(Type64Enum) 2".  
14525
14526         * class.cs (TypeManager.AddMethod): The fix is not to change
14527         AddEnum, because that one was using a fully qualified name (every
14528         DeclSpace derivative does), but to change the AddMethod routine
14529         that was using an un-namespaced name.  This now correctly reports
14530         the duplicated name.
14531
14532         Revert patch until I can properly fix it.  The issue
14533         is that we have a shared Type space across all namespaces
14534         currently, which is wrong.
14535
14536         Options include making the Namespace a DeclSpace, and merge
14537         current_namespace/current_container in the parser.
14538
14539 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14540
14541         * cs-parser.jay: Improve error reporting when we get a different
14542         kind of expression in local_variable_type and
14543         local_variable_pointer_type. 
14544
14545         Propagate this to avoid missleading errors being reported.
14546
14547         * ecore.cs (ImplicitReferenceConversion): treat
14548         TypeManager.value_type as a target just like object_type.   As
14549         code like this:
14550
14551         ValueType v = 1;
14552
14553         Is valid, and needs to result in the int 1 being boxed before it
14554         is assigned to the value type v.
14555
14556         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14557         to validate the enumeration name.
14558
14559         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14560         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14561         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14562
14563         * ecore.cs (TryImplicitIntConversion): When doing an
14564         implicit-enumeration-conversion, check if the type is 64-bits and
14565         perform a conversion before passing to EnumConstant.
14566
14567 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14568
14569         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14570         report ambiguous type references.  Unlike the MS version, we
14571         report what the ambiguity is.   Innovation at work ;-)
14572
14573         (DeclSpace.FindType): Require a location argument to
14574         display when we display an ambiguous error.
14575
14576         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14577
14578         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14579
14580         * expression.cs (EmitDynamicInitializers): Apply patch from
14581         hwang_rob@yahoo.ca that fixes the order in which we emit our
14582         initializers. 
14583
14584 2002-09-21  Martin Baulig  <martin@gnome.org>
14585
14586         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14587         delegate takes no arguments.
14588
14589 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14590
14591         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14592         from integers.
14593
14594         * expression.cs: Extract the underlying type.
14595
14596         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14597
14598         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14599
14600 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14601
14602         * class.cs (TypeContainer.DefineType): We can not use the nice
14603         PackingSize with the size set to 1 DefineType method, because it
14604         will not allow us to define the interfaces that the struct
14605         implements.
14606
14607         This completes the fixing of bug 27287
14608
14609         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14610         means also structs.  This fixes part of the problem. 
14611         (Expresion.ImplicitReferenceConversionExists): ditto.
14612
14613         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14614         error if there were no errors reported during the type lookup
14615         process, to avoid duplicates or redundant errors.  Without this
14616         you would get an ambiguous errors plus a type not found.  We have
14617         beaten the user enough with the first error.  
14618
14619         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14620         reference. 
14621
14622         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14623         during the resolution process, stop the lookup, this avoids
14624         repeated error reports (same error twice).
14625
14626         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14627
14628         * typemanager.cs (LookupType): Redo the type lookup code to match
14629         the needs of System.Reflection.  
14630
14631         The issue is that System.Reflection requires references to nested
14632         types to begin with a "+" sign instead of a dot.  So toplevel
14633         types look like: "NameSpace.TopLevelClass", and nested ones look
14634         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14635         levels. 
14636
14637 2002-09-19  Martin Baulig  <martin@gnome.org>
14638
14639         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14640         says that a method always returns or always throws an exception,
14641         don't report the CS0161.
14642
14643         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14644         set `Returns = new_returns'.
14645
14646 2002-09-19  Martin Baulig  <martin@gnome.org>
14647
14648         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14649         to an enum constant, check for a CS0176.
14650
14651 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14652
14653         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14654         for operators that must be in pairs and report errors.
14655
14656         * ecore.cs (SimpleName.DoResolveType): During the initial type
14657         resolution process, when we define types recursively, we must
14658         check first for types in our current scope before we perform
14659         lookups in the enclosing scopes.
14660
14661         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14662
14663         (Invocation.VerifyArgumentsCompat): Call
14664         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14665         I thought we were supposed to always call this, but there are a
14666         few places in the code where we dont do it.
14667
14668 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14669
14670         * driver.cs: Add support in -linkres and -resource to specify the
14671         name of the identifier.
14672
14673 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14674
14675         * ecore.cs (StandardConversionExists): Sync with the conversion
14676         code: allow anything-* to void* conversions.
14677
14678         (FindMostSpecificSource): Use an Expression argument
14679         instead of a Type, because we might be handed over a Literal which
14680         gets a few more implicit conversions that plain types do not.  So
14681         this information was being lost.
14682
14683         Also, we drop the temporary type-holder expression when not
14684         required.
14685
14686 2002-09-17  Martin Baulig  <martin@gnome.org>
14687
14688         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14689         this is an explicit interface implementation.
14690
14691 2002-09-17  Martin Baulig  <martin@gnome.org>
14692
14693         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14694         different `IndexerName' attributes.
14695
14696         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14697         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14698         virtual CommonResolve().
14699
14700 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14701
14702         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14703         and convert that to the UnderlyingType.
14704
14705         * statement.cs (Foreach.Resolve): Indexers are just like variables
14706         or PropertyAccesses.
14707
14708         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14709         inside quoted strings, we were not doing this before.
14710
14711 2002-09-16  Martin Baulig  <martin@gnome.org>
14712
14713         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14714         resolve it.  This is needed for the definite assignment check of the
14715         instance expression, fixes bug #29846.
14716         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14717
14718 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14719
14720         * parameter.cs: Fix compile error.  Cannot reference static member
14721         from an instance object.  Is this an mcs bug?
14722
14723 2002-09-14  Martin Baulig  <martin@gnome.org>
14724
14725         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14726         multiple times.  Fixes bug #30295, added test-166.cs.
14727
14728 2002-09-14  Martin Baulig  <martin@gnome.org>
14729
14730         * statement.cs (Block.Emit): Don't emit unreachable code.
14731         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14732         `break' statements.
14733         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14734
14735 2002-09-14  Martin Baulig  <martin@gnome.org>
14736
14737         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14738         is set.
14739
14740 2002-09-14  Martin Baulig  <martin@gnome.org>
14741
14742         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14743         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14744         be false on the ms runtime.
14745
14746 2002-09-13  Martin Baulig  <martin@gnome.org>
14747
14748         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14749         the CS0038 error message.
14750
14751 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14752
14753         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14754         constant inside, return it.
14755
14756 2002-09-12  Martin Baulig  <martin@gnome.org>
14757
14758         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14759         implicit conversion can be done between enum types.
14760
14761         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14762         check whether an implicit conversion to the current enum's UnderlyingType
14763         exists and report an error if not.
14764
14765         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14766         without debugging support.
14767
14768         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14769         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14770
14771 2002-09-12  Martin Baulig  <martin@gnome.org>
14772
14773         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14774
14775         * ecore.cs (IMemberExpr.DeclaringType): New property.
14776         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14777         nonstatic member of an outer type (CS0038).
14778
14779 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14780
14781         * driver.cs: Activate the using-error detector at warning level
14782         4 (at least for MS-compatible APIs).
14783
14784         * namespace.cs (VerifyUsing): Small buglett fix.
14785
14786         * pending.cs (PendingImplementation): pass the container pointer. 
14787
14788         * interface.cs (GetMethods): Allow for recursive definition.  Long
14789         term, I would like to move every type to support recursive
14790         definitions, not the current ordering mechanism that we have right
14791         now.
14792
14793         The situation is this: Attributes are handled before interfaces,
14794         so we can apply attributes to interfaces.  But some attributes
14795         implement interfaces, we will now handle the simple cases
14796         (recursive definitions will just get an error).  
14797
14798         * parameter.cs: Only invalidate types at the end if we fail to
14799         lookup all types.  
14800
14801 2002-09-09  Martin Baulig  <martin@gnome.org>
14802
14803         * ecore.cs (PropertyExpr.Emit): Also check for
14804         TypeManager.system_int_array_get_length so this'll also work when
14805         compiling corlib.  Fixes #30003.
14806
14807 2002-09-09  Martin Baulig  <martin@gnome.org>
14808
14809         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14810         and throw an exception if we can't get the type's size.  Fixed #30040,
14811         added test-165.cs.
14812
14813 2002-09-09  Martin Baulig  <martin@gnome.org>
14814
14815         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14816
14817         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14818         context.  Fixes bug #30027.
14819
14820         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14821         virtual functions.  Fixes bug #30043, added test-164.cs.
14822
14823 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14824
14825         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14826
14827 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14828
14829         * driver.cs: Use an object to get the windows codepage since it's not a
14830         static property.
14831
14832 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14833
14834         * statement.cs (For.Emit): for infinite loops (test == null)
14835         return whether there is a break inside, not always "true".
14836
14837         * namespace.cs (UsingEntry): New struct to hold the name of the
14838         using definition, the location where it is defined, and whether it
14839         has been used in a successful type lookup.
14840
14841         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14842         strings.
14843
14844         * decl.cs: ditto.
14845
14846 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14847
14848         * attribute.cs : Fix incorrect code which relied on catching
14849         a NullReferenceException to detect a null being passed in
14850         where an object was expected.
14851
14852 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14853
14854         * statement.cs (Try): flag the catch variable as assigned
14855
14856         * expression.cs (Cast): Simplified by using ResolveType instead of
14857         manually resolving.
14858
14859         * statement.cs (Catch): Fix bug by using ResolveType.
14860
14861 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14862
14863         * expression.cs (BetterConversion): Special case for when we have
14864         a NullLiteral as the argument and we have to choose between string
14865         and object types - we choose string the way csc does.
14866
14867         * attribute.cs (Attribute.Resolve): Catch the
14868         NullReferenceException and report error #182 since the Mono
14869         runtime no more has the bug and having this exception raised means
14870         we tried to select a constructor which takes an object and is
14871         passed a null.
14872
14873 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14874
14875         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14876         message (1502, 1503) when we can't locate a method after overload
14877         resolution. This is much more informative and closes the bug
14878         Miguel reported.
14879
14880         * interface.cs (PopulateMethod): Return if there are no argument
14881         types. Fixes a NullReferenceException bug.
14882
14883         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14884         expressions too. Previously we were checking only in one place for
14885         positional arguments leaving out named arguments.
14886
14887         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14888         type to the enum type is not allowed. Remove code corresponding to
14889         that.
14890
14891         (ConvertNumericExplicit): Allow explicit conversions from
14892         the underlying type to enum type. This precisely follows the spec
14893         and closes a bug filed by Gonzalo.
14894
14895 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14896
14897         * compiler.csproj:
14898         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14899
14900 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14901
14902         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14903         it was important that we stored the right value after the
14904         reduction in `converted'.
14905
14906 2002-09-04  Martin Baulig  <martin@gnome.org>
14907
14908         * location.cs (Location.SymbolDocument): Use full pathnames for the
14909         source files.
14910
14911 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14912
14913         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14914         of the expression resolve mechanism, because that will catch the
14915         SimpleName error failures.
14916
14917         (Conditional): If we can not resolve the
14918         expression, return, do not crash.
14919
14920 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14921
14922         * cs-tokenizer.cs:
14923         (location): display token name instead of its number.
14924
14925 2002-08-28  Martin Baulig  <martin@gnome.org>
14926
14927         * expression.cs (Binary.ResolveOperator): Don't silently return
14928         but return an error if an operator cannot be applied between two
14929         enum types.
14930
14931 2002-08-28  Martin Baulig  <martin@gnome.org>
14932
14933         * class.cs (Constructor.Define): Set the permission attributes
14934         correctly instead of making all constructors public.
14935
14936 2002-08-28  Martin Baulig  <martin@gnome.org>
14937
14938         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14939         for private members before reporting a CS0103; if we find anything,
14940         it's a CS0122.
14941
14942 2002-08-28  Martin Baulig  <martin@gnome.org>
14943
14944         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14945         to check whether `closure_start_type == closure_invocation_type',
14946         we also need to check whether `m.DeclaringType == closure_invocation_type'
14947         before bypassing the permission checks.  We might be accessing
14948         protected/private members from the base class.
14949         (TypeManager.RealMemberLookup): Only set private_ok if private
14950         members were requested via BindingFlags.NonPublic.
14951
14952         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14953
14954         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14955         MethodGroupExpr.IsExplicitImpl if appropriate.
14956         (Invocation.DoResolve): Don't report the CS0120 for explicit
14957         interface implementations.
14958
14959 2002-08-27  Martin Baulig  <martin@gnome.org>
14960
14961         * expression.cs (Invocation.DoResolve): If this is a static
14962         method and we don't have an InstanceExpression, we must report
14963         a CS0120.
14964
14965 2002-08-25  Martin Baulig  <martin@gnome.org>
14966
14967         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14968         `==' between a valuetype and an object.
14969
14970 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14971
14972         * ecore.cs (TypeExpr): Provide a ToString method.
14973
14974 2002-08-24  Martin Baulig  <martin@gnome.org>
14975
14976         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14977         now called proggie.dbg and it's a binary file.
14978
14979 2002-08-23  Martin Baulig  <martin@gnome.org>
14980
14981         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14982
14983 2002-08-23  Martin Baulig  <martin@gnome.org>
14984
14985         * struct.cs (MyStructInfo.ctor): Make this work with empty
14986         structs; it's not allowed to use foreach() on null.
14987
14988 2002-08-23  Martin Baulig  <martin@gnome.org>
14989
14990         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14991         writer the full pathname of the generated assembly.
14992
14993 2002-08-23  Martin Baulig  <martin@gnome.org>
14994
14995         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14996         A `finally' block never returns or breaks; improved handling of
14997         unreachable code.
14998
14999 2002-08-23  Martin Baulig  <martin@gnome.org>
15000
15001         * statement.cs (Throw.Resolve): Allow `throw null'.
15002
15003 2002-08-23  Martin Baulig  <martin@gnome.org>
15004
15005         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15006         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15007         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15008         MemberLookup would return a wrong event if this is an explicit
15009         interface implementation and the class has an event with the same
15010         name.
15011
15012 2002-08-23  Martin Baulig  <martin@gnome.org>
15013
15014         * statement.cs (Block.AddChildVariableNames): New public method.
15015         (Block.AddChildVariableName): Likewise.
15016         (Block.IsVariableNameUsedInChildBlock): Likewise.
15017         (Block.AddVariable): Check whether a variable name has already
15018         been used in a child block.
15019
15020         * cs-parser.jay (declare_local_variables): Mark all variable names
15021         from the current block as being used in a child block in the
15022         implicit block.
15023
15024 2002-08-23  Martin Baulig  <martin@gnome.org>
15025
15026         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15027         find the symbol writer.
15028
15029         * driver.cs: csc also allows the arguments to /define being
15030         separated by commas, not only by semicolons.
15031
15032 2002-08-23  Martin Baulig  <martin@gnome.org>
15033
15034         * interface.cs (Interface.GetMembers): Added static check for events.
15035
15036 2002-08-15  Martin Baulig  <martin@gnome.org>
15037
15038         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15039         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15040
15041         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15042         why the MethodData.EmitDestructor() change was necessary.
15043
15044 2002-08-20  Martin Baulig  <martin@gnome.org>
15045
15046         * class.cs (TypeContainer.FindMembers): Added static check for events.
15047
15048         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15049
15050         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15051         use Type.GetEvents(), not Type.FindMembers().
15052
15053 2002-08-20  Martin Baulig  <martin@gnome.org>
15054
15055         * decl.cs (MemberCache): Added a special method cache which will
15056         be used for method-only searched.  This ensures that a method
15057         search will return a MethodInfo with the correct ReflectedType for
15058         inherited methods.      
15059
15060 2002-08-20  Martin Baulig  <martin@gnome.org>
15061
15062         * decl.cs (DeclSpace.FindMembers): Made this public.
15063
15064 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15065
15066         * delegate.cs: fixed build on windows.
15067         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15068
15069 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15070
15071         * ecore.cs (StandardConversionExists): Return a false
15072         if we are trying to convert the void type to anything else
15073         since that is not allowed.
15074
15075         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15076         we flag error 70 in the event an event is trying to be accessed
15077         directly from outside the declaring type.
15078
15079 2002-08-20  Martin Baulig  <martin@gnome.org>
15080
15081         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15082         MemberCache from typemanager.cs to decl.cs.
15083
15084 2002-08-19  Martin Baulig  <martin@gnome.org>
15085
15086         * class.cs (TypeContainer): Implement IMemberContainer.
15087         (TypeContainer.DefineMembers): Create the MemberCache.
15088         (TypeContainer.FindMembers): Do better BindingFlags checking; only
15089         return public members if BindingFlags.Public was given, check
15090         whether members are static.
15091
15092 2002-08-16  Martin Baulig  <martin@gnome.org>
15093
15094         * decl.cs (DeclSpace.Define): Splitted this in Define and
15095         DefineMembers.  DefineMembers is called first and initializes the
15096         MemberCache.
15097
15098         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
15099         DefineMembers() on all our DeclSpaces.
15100
15101         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15102         but call DefineMembers() on all nested interfaces.  We call their
15103         Define() in our new Define() function.
15104
15105         * interface.cs (Interface): Implement IMemberContainer.
15106         (Interface.Define): Moved all code except the attribute stuf to
15107         DefineMembers().
15108         (Interface.DefineMembers): Initialize the member cache.
15109
15110         * typemanager.cs (IMemberFinder): Removed this interface, we don't
15111         need this anymore since we can use MemberCache.FindMembers directly.
15112
15113 2002-08-19  Martin Baulig  <martin@gnome.org>
15114
15115         * typemanager.cs (MemberCache): When creating the cache for an
15116         interface type, add all inherited members.
15117         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15118         to `out bool used_cache' and documented it.
15119         (TypeManager.MemberLookup): If we already used the cache in the first
15120         iteration, we don't need to do the interfaces check.
15121
15122 2002-08-19  Martin Baulig  <martin@gnome.org>
15123
15124         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
15125         here from IMemberFinder and don't implement this interface anymore.
15126         (DeclSpace.MemberCache): Moved here from IMemberFinder.
15127
15128         * typemanager.cs (IMemberFinder): This interface is now only used by
15129         classes which actually support the member cache.
15130         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15131         since we only put DeclSpaces into this Hashtable.
15132         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15133         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15134
15135 2002-08-16  Martin Baulig  <martin@gnome.org>
15136
15137         * typemanager.cs (ICachingMemberFinder): Removed.
15138         (IMemberFinder.MemberCache): New property.
15139         (TypeManager.FindMembers): Merged this with RealFindMembers().
15140         This function will never be called from TypeManager.MemberLookup()
15141         so we can't use the cache here, just the IMemberFinder.
15142         (TypeManager.MemberLookup_FindMembers): Check whether the
15143         IMemberFinder has a MemberCache and call the cache's FindMembers
15144         function.
15145         (MemberCache): Rewrote larger parts of this yet another time and
15146         cleaned it up a bit.
15147
15148 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15149
15150         * driver.cs (LoadArgs): Support quoting.
15151
15152         (Usage): Show the CSC-like command line arguments.
15153
15154         Improved a few error messages.
15155
15156 2002-08-15  Martin Baulig  <martin@gnome.org>
15157
15158         * typemanager.cs (IMemberContainer.Type): New property.
15159         (IMemberContainer.IsInterface): New property.
15160
15161         The following changes are conditional to BROKEN_RUNTIME, which is
15162         defined at the top of the file.
15163
15164         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15165         class'es members, but add all members from TypeHandle.ObjectType
15166         if we're an interface.
15167         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15168         is the current type.
15169         (MemberCache.CacheEntry.Container): Removed this field.
15170         (TypeHandle.GetMembers): Include inherited members.
15171
15172 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15173
15174         * typemanager.cs: fixed compilation and added a comment on a field that
15175         is never used.
15176
15177 2002-08-15  Martin Baulig  <martin@gnome.org>
15178
15179         * class.cs (ConstructorInitializer.Resolve): In the
15180         Expression.MemberLookup call, use the queried_type as
15181         invocation_type.
15182
15183         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15184         declared' attribute, it's always true.
15185         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15186         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15187         temporary wrapper for FindMembers which tells MemberLookup whether
15188         members from the base classes are included in the return value.
15189         This will go away soon.
15190         (TypeManager.MemberLookup): Use this temporary hack here; once the
15191         new MemberCache is completed, we don't need to do the DeclaredOnly
15192         looping here anymore since the MemberCache will take care of this.
15193         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15194         (MemberCache): When creating the MemberCache for a class, get
15195         members from the current class and all its base classes.
15196         (MemberCache.CacheEntry.Container): New field.  This is a
15197         temporary hack until the Mono runtime is fixed to distinguish
15198         between ReflectedType and DeclaringType.  It allows us to use MCS
15199         with both the MS runtime and the unfixed Mono runtime without
15200         problems and without accecting performance.
15201         (MemberCache.SearchMembers): The DeclaredOnly looping from
15202         TypeManager.MemberLookup is now done here.      
15203
15204 2002-08-14  Martin Baulig  <martin@gnome.org>
15205
15206         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15207         Type.GetFields on dynamic types but get the fields from the
15208         corresponding TypeContainer.
15209         (MyStructInfo.GetStructInfo): Added check for enum types.
15210
15211         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15212         (MemberList.SyncRoot): Implemented.
15213         (TypeManager.FilterWithClosure): No need to check permissions if
15214         closure_start_type == closure_invocation_type, don't crash if
15215         closure_invocation_type is null.
15216
15217 2002-08-13  Martin Baulig  <martin@gnome.org>
15218
15219         Rewrote TypeContainer.FindMembers to use a member cache.  This
15220         gives us a speed increase of about 35% for the self-hosting MCS
15221         build and of about 15-20% for the class libs (both on GNU/Linux).
15222
15223         * report.cs (Timer): New class to get enhanced profiling.  This
15224         whole class is "TIMER" conditional since it remarkably slows down
15225         compilation speed.
15226
15227         * class.cs (MemberList): New class.  This is an IList wrapper
15228         which we're now using instead of passing MemberInfo[]'s around to
15229         avoid copying this array unnecessarily.
15230         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15231         (ICachingMemberFinder, IMemberContainer): New interface.
15232         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15233         has already been checked, otherwise use it for the name comparision.
15234         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15235         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15236         if possible.  Returns a MemberList, not a MemberInfo [].
15237         (TypeHandle): New class, implements IMemberContainer.  We create
15238         one instance of this class per type, it contains a MemberCache
15239         which is used to do the member lookups.
15240         (MemberCache): New class.  Each instance of this class contains
15241         all members of a type and a name-based hash table.
15242         (MemberCache.FindMembers): This is our new member lookup
15243         function.  First, it looks up all members of the requested name in
15244         the hash table.  Then, it walks this list and sorts out all
15245         applicable members and returns them.
15246
15247 2002-08-13  Martin Baulig  <martin@gnome.org>
15248
15249         In addition to a nice code cleanup, this gives us a performance
15250         increase of about 1.4% on GNU/Linux - not much, but it's already
15251         half a second for the self-hosting MCS compilation.
15252
15253         * typemanager.cs (IMemberFinder): New interface.  It is used by
15254         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15255         Enum, Delegate or Interface.
15256         (TypeManager.finder_to_member_finder): New PtrHashtable.
15257         (TypeManager.finder_to_container): Removed.
15258         (TypeManager.finder_to_delegate): Removed.
15259         (TypeManager.finder_to_interface): Removed.
15260         (TypeManager.finder_to_enum): Removed.
15261
15262         * interface.cs (Interface): Implement IMemberFinder.
15263
15264         * delegate.cs (Delegate): Implement IMemberFinder.
15265
15266         * enum.cs (Enum): Implement IMemberFinder.
15267
15268         * class.cs (TypeContainer): Implement IMemberFinder.
15269
15270 2002-08-12  Martin Baulig  <martin@gnome.org>
15271
15272         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15273
15274 2002-08-12  Martin Baulig  <martin@gnome.org>
15275
15276         * ecore.cs (ITypeExpression): New interface for expressions which
15277         resolve to a type.
15278         (TypeExpression): Renamed to TypeLookupExpression.
15279         (Expression.DoResolve): If we're doing a types-only lookup, the
15280         expression must implement the ITypeExpression interface and we
15281         call DoResolveType() on it.
15282         (SimpleName): Implement the new ITypeExpression interface.
15283         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15284         hack, the situation that we're only looking up types can't happen
15285         anymore when this method is called.  Moved the type lookup code to
15286         DoResolveType() and call it.
15287         (SimpleName.DoResolveType): This ITypeExpression interface method
15288         is now doing the types-only lookup.
15289         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15290         (ResolveFlags): Added MaskExprClass.
15291
15292         * expression.cs (MemberAccess): Implement the ITypeExpression
15293         interface.
15294         (MemberAccess.DoResolve): Added support for a types-only lookup
15295         when we're called via ITypeExpression.DoResolveType().
15296         (ComposedCast): Implement the ITypeExpression interface.
15297
15298         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15299         Expression.Resolve() with ResolveFlags.Type instead.
15300
15301 2002-08-12  Martin Baulig  <martin@gnome.org>
15302
15303         * interface.cs (Interface.Define): Apply attributes.
15304
15305         * attribute.cs (Attribute.ApplyAttributes): Added support for
15306         interface attributes.
15307
15308 2002-08-11  Martin Baulig  <martin@gnome.org>
15309
15310         * statement.cs (Block.Emit): Only check the "this" variable if we
15311         do not always throw an exception.
15312
15313         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15314         whether the property has a set accessor.
15315
15316 2002-08-11  Martin Baulig  <martin@gnome.org>
15317
15318         Added control flow analysis support for structs.
15319
15320         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15321         with control flow analysis turned off.
15322         (IVariable): New interface.
15323         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15324         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15325         (FieldExpr.DoResolve): Resolve the instance expression with flow
15326         analysis turned off and do the definite assignment check after the
15327         resolving when we know what the expression will resolve to.
15328
15329         * expression.cs (LocalVariableReference, ParameterReference):
15330         Implement the new IVariable interface, only call the flow analysis
15331         code if ec.DoFlowAnalysis is true.
15332         (This): Added constructor which takes a Block argument.  Implement
15333         the new IVariable interface.
15334         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15335         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15336         This does the definite assignment checks for struct members.
15337
15338         * class.cs (Constructor.Emit): If this is a non-static `struct'
15339         constructor which doesn't have any initializer, call
15340         Block.AddThisVariable() to tell the flow analysis code that all
15341         struct elements must be initialized before control returns from
15342         the constructor.
15343
15344         * statement.cs (MyStructInfo): New public class.
15345         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15346         argument to this indexer.  If non-zero, check an individual struct
15347         member, not the whole struct.
15348         (FlowBranching.CheckOutParameters): Check struct members.
15349         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15350         overloaded versions of these methods which take an additional
15351         `int field_idx' argument to check struct members.
15352         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15353         overloaded versions of these methods which take an additional
15354         `string field_name' argument to check struct member.s
15355         (VariableInfo): Implement the IVariable interface.
15356         (VariableInfo.StructInfo): New public property.  Returns the
15357         MyStructInfo instance of the variable if it's a struct or null.
15358         (Block.AddThisVariable): New public method.  This is called from
15359         Constructor.Emit() for non-static `struct' constructor which do
15360         not have any initializer.  It creates a special variable for the
15361         "this" instance variable which will be checked by the flow
15362         analysis code to ensure that all of the struct's fields are
15363         initialized before control returns from the constructor.
15364         (UsageVector): Added support for struct members.  If a
15365         variable/parameter is a struct with N members, we reserve a slot
15366         in the usage vector for each member.  A struct is considered fully
15367         initialized if either the struct itself (slot 0) or all its
15368         members are initialized.
15369
15370 2002-08-08  Martin Baulig  <martin@gnome.org>
15371
15372         * driver.cs (Driver.MainDriver): Only report an error CS5001
15373         if there were no compilation errors.
15374
15375         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15376         `UnsafeContext' property to determine whether the parent is in
15377         unsafe context rather than checking the parent's ModFlags:
15378         classes nested in an unsafe class are unsafe as well.
15379
15380 2002-08-08  Martin Baulig  <martin@gnome.org>
15381
15382         * statement.cs (UsageVector.MergeChildren): Distinguish between
15383         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15384         we return.  Added test17() and test18() to test-154.cs.
15385
15386 2002-08-08  Martin Baulig  <martin@gnome.org>
15387
15388         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15389         Family access, make sure the invoking type isn't a subclass of the
15390         queried type (that'd be a CS1540).
15391
15392         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15393         this method which takes an additional `Type invocation_type'.
15394
15395         * expression.cs (BaseAccess.DoResolve): Use the base type as
15396         invocation and query type.
15397         (MemberAccess.DoResolve): If the lookup failed and we're about to
15398         report a CS0122, try a lookup with the ec.ContainerType - if this
15399         succeeds, we must report a CS1540.
15400
15401 2002-08-08  Martin Baulig  <martin@gnome.org>
15402
15403         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15404         (MethodGroupExpr): Implement the IMemberExpr interface.
15405
15406         * expression (MemberAccess.ResolveMemberAccess): No need to have
15407         any special code for MethodGroupExprs anymore, they're now
15408         IMemberExprs.   
15409
15410 2002-08-08  Martin Baulig  <martin@gnome.org>
15411
15412         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15413         Family, FamANDAssem and FamORAssem permissions.
15414         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15415
15416 2002-08-08  Martin Baulig  <martin@gnome.org>
15417
15418         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15419         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15420         or loop block.
15421
15422 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15423
15424         * driver.cs: implemented /resource option to embed managed resources.
15425
15426 2002-08-07  Martin Baulig  <martin@gnome.org>
15427
15428         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15429         (FieldBase.HasFieldInitializer): New public property.
15430         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15431         returns the field initializer and makes sure it is only resolved once.
15432         (TypeContainer.EmitFieldInitializers): Call
15433         FieldBase.GetInitializerExpression to get the initializer, this ensures
15434         that it isn't resolved multiple times.
15435
15436         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15437         the resolving process (SimpleName/MemberLookup) that we're currently
15438         emitting a field initializer (which must not access any instance members,
15439         this is an error CS0236).
15440
15441         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15442         argument, if the `IsFieldInitializer' flag is set, we must report and
15443         error CS0236 and not an error CS0120.   
15444
15445 2002-08-07  Martin Baulig  <martin@gnome.org>
15446
15447         * ecore.cs (IMemberExpr): New public interface.
15448         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15449         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15450         if the expression is an IMemberExpr.
15451
15452         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15453         to be null, implicitly default to `this' if we're non-static in
15454         this case.  Simplified the code a lot by using the new IMemberExpr
15455         interface.  Also fixed bug #28176 here.
15456
15457 2002-08-06  Martin Baulig  <martin@gnome.org>
15458
15459         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15460         ParameterReferences during semantic analysis so that we can do a
15461         type-only search when resolving Cast, TypeOf and SizeOf.
15462         (block): Pass the `current_local_parameters' to the Block's
15463         constructor.
15464
15465         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15466         argument to the constructor.
15467         (ConstructorInitializer.Resolve): Create a temporary implicit
15468         block with the parameters.
15469
15470         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15471         references here if we aren't doing a type-only search.
15472
15473         * statement.cs (Block): Added constructor which takes a
15474         `Parameters parameters' argument.
15475         (Block.Parameters): New public property.
15476
15477         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15478         to `Parameters' and made it public readonly.
15479
15480 2002-08-06  Martin Baulig  <martin@gnome.org>
15481
15482         * ecore.cs (Expression.Warning): Made this public as well.
15483
15484         * report.cs (Report.Debug): Print the contents of collections.
15485
15486 2002-08-06  Martin Baulig  <martin@gnome.org>
15487
15488         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15489         used to tell Resolve() which kinds of expressions it may return.
15490         (Expression.Resolve): Added overloaded version of this method which
15491         takes a `ResolveFlags flags' argument.  This can be used to tell
15492         Resolve() which kinds of expressions it may return.  Reports a
15493         CS0118 on error.
15494         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15495         ResolveFlags.SimpleName.
15496         (Expression.Error118): Added overloaded version of this method which
15497         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15498         which kinds of expressions are allowed.
15499
15500         * expression.cs (Argument.ResolveMethodGroup): New public method.
15501         Resolves an argument, but allows a MethodGroup to be returned.
15502         This is used when invoking a delegate.
15503
15504         * TODO: Updated a bit.
15505
15506 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15507
15508         Fixed compilation with csc.
15509
15510         * ecore.cs: Expression.Error made public. Is this correct? Should
15511         Warning be made public too?
15512
15513         * expression.cs: use ea.Location instead of ea.loc.
15514         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15515
15516 2002-08-06  Martin Baulig  <martin@gnome.org>
15517
15518         * ecore.cs (Expression.loc): Moved the location here instead of
15519         duplicating it in all derived classes.
15520         (Expression.Location): New public property.
15521         (Expression.Error, Expression.Warning): Made them non-static and
15522         removed the location argument.
15523         (Expression.Warning): Added overloaded version which takes an
15524         `int level' argument.
15525         (Expression.Error118): Make this non-static and removed the
15526         expression and location arguments.
15527         (TypeExpr): Added location argument to the constructor.
15528
15529         * expression.cs (StaticCallExpr): Added location argument to
15530         the constructor.
15531         (Indirection, PointerArithmetic): Likewise.
15532         (CheckedExpr, UnCheckedExpr): Likewise.
15533         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15534         (StringPtr): Likewise.
15535
15536
15537 2002-08-05  Martin Baulig  <martin@gnome.org>
15538
15539         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15540
15541         * assign.cs (Assign.DoResolve): Check whether the source
15542         expression is a value or variable.
15543
15544         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15545         while resolving the corresponding blocks.
15546
15547         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15548         an error, don't silently return null.
15549
15550         * statement.cs (Block.AddVariable): Do the error reporting here
15551         and distinguish between CS0128 and CS0136.
15552         (Block.DoResolve): Report all unused labels (warning CS0164).
15553         (LabeledStatement): Pass the location to the constructor.
15554         (LabeledStatement.HasBeenReferenced): New property.
15555         (LabeledStatement.Resolve): Set it to true here.
15556
15557         * statement.cs (Return.Emit): Return success even after reporting
15558         a type mismatch error (CS0126 or CS0127), this is what csc does and
15559         it avoids confusing the users with any consecutive errors.
15560
15561 2002-08-05  Martin Baulig  <martin@gnome.org>
15562
15563         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15564
15565         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15566
15567         * expression.cs (MemberAccess.DoResolve): Silently return if an
15568         error has already been reported.
15569
15570         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15571         error has already been reported.
15572
15573 2002-08-05  Martin Baulig  <martin@gnome.org>
15574
15575         * statement.cs (UsageVector): Only initialize the `parameters'
15576         vector if we actually have any "out" parameters.
15577
15578 2002-08-05  Martin Baulig  <martin@gnome.org>
15579
15580         * expression.cs (Binary.ResolveOperator): When combining delegates,
15581         they must have the same type.
15582
15583 2002-08-05  Martin Baulig  <martin@gnome.org>
15584
15585         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15586         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15587         work with the ms runtime and we also don't need it: if we're a
15588         PropertyBuilder and not in the `indexer_arguments' hash, then we
15589         are a property and not an indexer.
15590
15591         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15592         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15593         since the latter one doesn't work with the ms runtime.
15594
15595 2002-08-03  Martin Baulig  <martin@gnome.org>
15596
15597         Fixed bugs #27998 and #22735.
15598
15599         * class.cs (Method.IsOperator): New public field.
15600         (Method.CheckBase): Report CS0111 if there's already a method
15601         with the same parameters in the current class.  Report CS0508 when
15602         attempting to change the return type of an inherited method.
15603         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15604         and it's not marked abstract or extern.
15605         (PropertyBase): New abstract base class for Property and Indexer.
15606         (PropertyBase.CheckBase): Moved here from Property and made it work
15607         for indexers.
15608         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15609         the same so we can reuse it there.
15610         (Property, Indexer): Derive from PropertyBase.
15611         (MethodSignature.inheritable_property_signature_filter): New delegate
15612         to find properties and indexers.
15613
15614         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15615         argument and improved error reporting.
15616
15617         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15618         EmptyReadOnlyParameters and made it a property.
15619
15620         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15621         version of this method which takes a `PropertyInfo indexer'.
15622         (TypeManager.RegisterIndexer): New method.
15623
15624         * class.cs: Added myself as author of this file :-)
15625
15626 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15627
15628         * class.cs: fixed compilation on windoze.
15629
15630 2002-08-03  Martin Baulig  <martin@gnome.org>
15631
15632         * interface.cs (Interface.GetInterfaceBases): Check whether all
15633         base interfaces are at least as accessible than the current one.
15634
15635         * class.cs (TypeContainer.GetClassBases): Check whether base types
15636         are at least as accessible than the current type.
15637         (TypeContainer.AsAccessible): Implemented and made non-static.
15638         (MemberBase.CheckParameters): Report errors if the accessibility
15639         checks fail.
15640
15641         * delegate.cs (Delegate.Delegate): The default visibility is
15642         internal for top-level types and private for nested types.
15643         (Delegate.Define): Report errors if the accessibility checks fail.
15644
15645         * enum.cs (Enum.Enum): The default visibility is internal for
15646         top-level types and private for nested types.
15647         (Enum.DefineType): Compute the correct visibility.
15648
15649         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15650         function which takes a `bool is_toplevel' instead of a TypeContainer.
15651
15652         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15653         builtin type.
15654
15655 2002-08-02  Martin Baulig  <martin@gnome.org>
15656
15657         * expression.cs (LocalVariableReferenc): Added constructor which
15658         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15659         (LocalVariableReference.IsReadOnly): New property.
15660         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15661         variable is readonly, use our own readonly flag to do this; you can
15662         use the new constructor to get a writable reference to a read-only
15663         variable.
15664
15665         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15666         reference to the local variable.
15667
15668 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15669
15670         * rootcontext.cs (ResolveCore): Also include System.Exception
15671
15672         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15673         we reach an EmptyStatement.
15674
15675         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15676         is also fine.
15677
15678         * expression.cs (Binary.ResolveOperator): Check error result in
15679         two places.
15680
15681         use brtrue/brfalse directly and avoid compares to null.
15682
15683 2002-08-02  Martin Baulig  <martin@gnome.org>
15684
15685         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15686         Fixes bug #28407, added test-155.cs.
15687
15688 2002-08-01  Martin Baulig  <martin@gnome.org>
15689
15690         * class.cs (Event.EmitDefaultMethod): Make this work with static
15691         events.  Fixes #28311, added verify-3.cs.
15692
15693 2002-08-01  Martin Baulig  <martin@gnome.org>
15694
15695         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15696         `is_disposable' fields.
15697         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15698         `hm.is_disposable' if we're using the collection pattern.
15699         (Foreach.EmitCollectionForeach): Use the correct type for the
15700         enumerator's local variable, only emit the try/finally block if
15701         necessary (fixes #27713).
15702
15703 2002-08-01  Martin Baulig  <martin@gnome.org>
15704
15705         * ecore.cs (Expression.report118): Renamed to Error118 and made
15706         it public static.
15707
15708         * statement.cs (Throw.Resolve): Check whether the expression is of
15709         the correct type (CS0118) and whether the type derives from
15710         System.Exception (CS0155).
15711         (Catch.Resolve): New method.  Do the type lookup here and check
15712         whether it derives from System.Exception (CS0155).
15713         (Catch.CatchType, Catch.IsGeneral): New public properties.
15714
15715         * typemanager.cs (TypeManager.exception_type): Added.
15716
15717 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15718
15719         * driver.cs: Updated About function.
15720
15721 2002-07-31  Martin Baulig  <martin@gnome.org>
15722
15723         Implemented Control Flow Analysis.
15724
15725         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15726         (EmitContext.CurrentBranching): Added.
15727         (EmitContext.StartFlowBranching): Added.
15728         (EmitContext.EndFlowBranching): Added.
15729         (EmitContext.KillFlowBranching): Added.
15730         (EmitContext.IsVariableAssigned): Added.
15731         (EmitContext.SetVariableAssigned): Added.
15732         (EmitContext.IsParameterAssigned): Added.
15733         (EmitContext.SetParameterAssigned): Added.
15734         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15735         Added control flow analysis stuff here.
15736
15737         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15738         resolve the expression as lvalue.
15739         (LocalVariableReference.DoResolve): Check whether the variable has
15740         already been assigned.
15741         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15742         the parameter as assigned here.
15743         (ParameterReference.DoResolve): Check whether the parameter has already
15744         been assigned.
15745         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15746         expression as lvalue.
15747
15748         * statement.cs (FlowBranching): New class for the flow analysis code.
15749         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15750         (LabeledStatement.IsDefined): New public property.
15751         (LabeledStatement.AddUsageVector): New public method to tell flow
15752         analyis that the label may be reached via a forward jump.
15753         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15754         flow analysis.
15755         (VariableInfo.Number): New public field.  This is used by flow analysis
15756         to number all locals of a block.
15757         (Block.CountVariables): New public property.  This is the number of
15758         local variables in this block (including the locals from all parent
15759         blocks).
15760         (Block.EmitMeta): Number all the variables.
15761
15762         * statement.cs: Added flow analysis support to all classes.
15763
15764 2002-07-31  Martin Baulig  <martin@gnome.org>
15765
15766         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15767         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15768         then use this argument.
15769
15770         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15771
15772         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15773         use this to specify /define options.
15774
15775 2002-07-29  Martin Baulig  <martin@gnome.org>
15776
15777         * statement.cs (Fixed): Moved all code that does variable lookups
15778         and resolvings from Emit to Resolve.
15779
15780         * statement.cs (For): Moved all code that does variable lookups
15781         and resolvings from Emit to Resolve.
15782
15783         * statement.cs (Using): Moved all code that does variable lookups
15784         and resolvings from Emit to Resolve.
15785
15786 2002-07-29  Martin Baulig  <martin@gnome.org>
15787
15788         * attribute.cs (Attribute.Resolve): Explicitly catch a
15789         System.NullReferenceException when creating the
15790         CustromAttributeBuilder and report a different warning message.
15791
15792 2002-07-29  Martin Baulig  <martin@gnome.org>
15793
15794         * support.cs (ParameterData.ParameterName): Added method to
15795         get the name of a parameter.
15796
15797         * typemanager.cs (TypeManager.IsValueType): New public method.
15798
15799 2002-07-29  Martin Baulig  <martin@gnome.org>
15800
15801         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15802         is a flag which specifies that it's either ref or out.
15803         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15804         the out parameter to `out Parameter.Modifier mod', also set the
15805         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15806
15807         * support.cs (InternalParameters.ParameterModifier): Distinguish
15808         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15809         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15810
15811         * expression.cs (Argument.GetParameterModifier): Distinguish
15812         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15813         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15814
15815 2002-07-29  Martin Baulig  <martin@gnome.org>
15816
15817         * expression.cs (ParameterReference.ParameterReference): Added
15818         `Location loc' argument to the constructor.
15819
15820         * cs-parser.jay: Pass location to ParameterReference.
15821
15822 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15823
15824         * statement.cs (Try): Initialize the location.
15825
15826         * cs-parser.jay: pass location to Try.
15827
15828         * expression.cs (Unary.Reduce): Change the prototype to return
15829         whether a constant fold could be performed or not.  The result is
15830         returned in an out parameters.  In the case of Indirection and
15831         AddressOf, we want to perform the full tests.
15832
15833 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15834
15835         * statement.cs (Statement.Emit): Flag dead code.
15836
15837 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15838
15839         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15840
15841 2002-07-27  Martin Baulig  <martin@gnome.org>
15842
15843         * class.cs (MethodData.Define): Put back call to
15844         TypeManager.AddMethod(), accidentally commented this out.
15845
15846         * report.cs (Debug): New public method to print debugging information,
15847         this is `[Conditional ("DEBUG")]'.
15848
15849 2002-07-26  Martin Baulig  <martin@gnome.org>
15850
15851         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15852         (switch_statement): Push the current_block to the switch_stack and
15853         pop it again when we're done with the switch.
15854         (switch_section): The new block is a child of the current_block.
15855         Fixes bug #24007, added test-152.cs.
15856
15857 2002-07-27  Martin Baulig  <martin@gnome.org>
15858
15859         * expression.cs (Invocation.EmitArguments): When calling a varargs
15860         function with only its fixed arguments, we need to pass an empty
15861         array.
15862
15863 2002-07-27  Martin Baulig  <martin@gnome.org>
15864
15865         Mono 0.13 has been released.
15866
15867 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15868
15869         * driver.cs: Rename --resource to --linkres, because that is what
15870         we do currently, we dont support --resource yet.
15871
15872         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15873
15874 2002-07-25  Martin Baulig  <martin@gnome.org>
15875
15876         * class.cs (MethodData): New public class.  This is a `method builder'
15877         class for a method or one accessor of a Property/Indexer/Event.
15878         (MethodData.GetMethodFlags): Moved here from MemberBase.
15879         (MethodData.ApplyAttributes): Likewise.
15880         (MethodData.ApplyObsoleteAttribute): Likewise.
15881         (MethodData.ApplyConditionalAttribute): Likewise.
15882         (MethodData.ApplyDllImportAttribute): Likewise.
15883         (MethodData.CheckAbstractAndExternal): Likewise.
15884         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15885         (MethodData.Emit): Formerly known as Method.Emit().
15886         (MemberBase): Moved everything which was specific to a single
15887         accessor/method to MethodData.
15888         (Method): Create a new MethodData and call Define() and Emit() on it.
15889         (Property, Indexer, Event): Create a new MethodData objects for each
15890         accessor and call Define() and Emit() on them.
15891
15892 2002-07-25  Martin Baulig  <martin@gnome.org>
15893
15894         Made MethodCore derive from MemberBase to reuse the code from there.
15895         MemberBase now also checks for attributes.
15896
15897         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15898         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15899         as virtual.
15900         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15901         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15902         (MemberBase.ApplyAttributes): New virtual method; applies the
15903         attributes to a method or accessor.
15904         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15905         (MemberBase.ApplyConditionalAttribute): Likewise.
15906         (MemberBase.ApplyDllImportAttribute): Likewise.
15907         (MemberBase.CheckAbstractAndExternal): Likewise.
15908         (MethodCore.ParameterTypes): This is now a property instead of a
15909         method, it's initialized from DoDefineParameters().
15910         (MethodCore.ParameterInfo): Removed the set accessor.
15911         (MethodCore.DoDefineParameters): New protected virtual method to
15912         initialize ParameterTypes and ParameterInfo.
15913         (Method.GetReturnType): We can now simply return the MemberType.
15914         (Method.GetMethodFlags): Override the MemberBase version and add
15915         the conditional flags.
15916         (Method.CheckBase): Moved some code from Define() here, call
15917         DoDefineParameters() here.
15918         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15919         here to avoid some larger code duplication.
15920         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15921         ensure that abstract and external accessors don't declare a body.
15922
15923         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15924         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15925         lookup in the attribute's parent classes, so we need to abort as soon
15926         as we found the first match.
15927         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15928         the attribute has no arguments.
15929
15930         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15931         of a Method.
15932
15933 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15934
15935         * cs-parser.jay: reverted previous patch.
15936
15937 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15938
15939         * cs-parser.jay: fixed bug #22119.
15940
15941 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15942
15943         * attribute.cs: fixed compilation. The error was:
15944         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15945         be assigned to before control leaves the current method."
15946         [FIXME:  Filed as bug #28186: MCS must report this error.]
15947
15948 2002-07-25  Martin Baulig  <martin@gnome.org>
15949
15950         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15951         method to pull the condition name ouf of a Conditional attribute.
15952         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15953         the obsolete message and error flag out of an Obsolete attribute.
15954
15955         * class.cs (Method.GetMethodFlags): New public method to get the
15956         TypeManager.MethodFlags for this method.
15957         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15958         private methods.
15959         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15960         if we're overriding a virtual function, set the new private variable
15961         `parent_method'; call the new TypeManager.AddMethod().
15962
15963         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15964         the MethodBuilder and the Method in a PtrHashtable.
15965         (TypeManager.builder_to_method): Added for this purpose.
15966         (TypeManager.MethodFlags): Added IsObsoleteError.
15967         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15968         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15969         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15970         the message from the attribute.
15971
15972 2002-07-24  Martin Baulig  <martin@gnome.org>
15973
15974         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15975         preprocessor directives, ensure that the argument to #define/#undef is
15976         exactly one identifier and that it's actually an identifier.
15977
15978         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15979         did not work ....
15980
15981 2002-07-24  Martin Baulig  <martin@gnome.org>
15982
15983         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15984         initialize it to TypeManager.object_type in the constructor.
15985         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15986         of the `hm.get_current' method if we're using the collection pattern.
15987         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15988         for the explicit conversion to make it work when we're using the collection
15989         pattern and the `Current' property has a different return type than `object'.
15990         Fixes #27713.
15991
15992 2002-07-24  Martin Baulig  <martin@gnome.org>
15993
15994         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15995         does not match, but don't report any errors.  This method is called in
15996         order for all methods in a MethodGroupExpr until a matching method is
15997         found, so we don't want to bail out if the first method doesn't match.
15998         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15999         matches, report the 123.  Fixes #28070.
16000
16001 2002-07-24  Martin Baulig  <martin@gnome.org>
16002
16003         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16004         TypeManager.TypeToCoreType() to the top of the method so the
16005         following equality checks will work.  Fixes #28107.
16006
16007 2002-07-24  Martin Baulig  <martin@gnome.org>
16008
16009         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16010         operand is of type uint, and the other operand is of type sbyte,
16011         short or int, the operands are converted to type long." -
16012         Actually do what this comment already told us.  Fixes bug #28106,
16013         added test-150.cs.
16014
16015 2002-07-24  Martin Baulig  <martin@gnome.org>
16016
16017         * class.cs (MethodBase): New abstract class.  This is now a base
16018         class for Property, Indexer and Event to avoid some code duplication
16019         in their Define() and DefineMethods() methods.
16020         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16021         generic methods for Define() and DefineMethods().
16022         (FieldBase): Derive from MemberBase, not MemberCore.
16023         (Property): Derive from MemberBase, not MemberCore.
16024         (Property.DefineMethod): Moved all the code from this method to the
16025         new MethodBase.DefineAccessor(), just call it with appropriate
16026         argumetnts.
16027         (Property.Define): Call the new Property.DoDefine(), this does some
16028         sanity checks and we don't need to duplicate the code everywhere.
16029         (Event): Derive from MemberBase, not MemberCore.
16030         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16031         accessors, this will also make them work with interface events.
16032         (Indexer): Derive from MemberBase, not MemberCore.
16033         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16034         (Indexer.Define): Use the new MethodBase functions.
16035
16036         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16037         argument to the constructor.
16038         (Interface.FindMembers): Added support for interface events.
16039         (Interface.PopluateEvent): Implemented.
16040
16041         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16042
16043 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16044
16045         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16046         but this is required to check for a method name being the same as
16047         the containing class.  
16048
16049         Handle this now.
16050
16051 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16052
16053         * interface.cs: initialize variable.
16054
16055 2002-07-23  Martin Baulig  <martin@gnome.org>
16056
16057         Implemented the IndexerName attribute in interfaces.
16058
16059         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16060         name if this is an explicit interface implementation.
16061         (Indexer.InterfaceIndexerName): New public variable.  If we're
16062         implementing an interface indexer, this is the IndexerName in that
16063         interface.  Otherwise, it's the IndexerName.
16064         (Indexer.DefineMethod): If we're implementing interface indexer,
16065         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16066         and Pending.ImplementIndexer methods.
16067         (Indexer.Define): Also define the PropertyBuilder if we're
16068         implementing an interface indexer and this is neither an explicit
16069         interface implementation nor do the IndexerName match the one in
16070         the interface.
16071
16072         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16073         If a method is defined here, then we always need to create a proxy
16074         for it.  This is used when implementing interface indexers.
16075         (Pending.IsInterfaceIndexer): New public method.
16076         (Pending.ImplementIndexer): New public method.
16077         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16078         This is used when implementing interface indexers to define a proxy
16079         if necessary.
16080         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16081         define a proxy if necessary.
16082
16083         * interface.cs (Interface.IndexerName): New public variable.
16084         (Interface.PopulateIndexer): Set the IndexerName.
16085         (Interface.DefineIndexers): New private method.  Populate all the
16086         indexers and make sure their IndexerNames match.
16087
16088         * typemanager.cs (IndexerPropertyName): Added support for interface
16089         indexers.
16090
16091 2002-07-22  Martin Baulig  <martin@gnome.org>
16092
16093         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16094         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16095         ret if HasReturnLabel.
16096         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16097         variables.
16098
16099         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16100         and set the ec.LoopBeginTryCatchLevel.
16101         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16102         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16103         the current ec.TryCatchLevel, the branch goes out of an exception
16104         block.  In this case, we need to use Leave and not Br.
16105
16106 2002-07-22  Martin Baulig  <martin@gnome.org>
16107
16108         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16109         block unless the block does not always return or it is contained in
16110         another try { ... } catch { ... } block.  Fixes bug #26506.
16111         Added verify-1.cs to the test suite.
16112
16113 2002-07-22  Martin Baulig  <martin@gnome.org>
16114
16115         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16116         then we do not always return.  Fixes bug #24985.
16117
16118 2002-07-22  Martin Baulig  <martin@gnome.org>
16119
16120         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16121         lookup on a per-class level; ie. walk up the class hierarchy until we
16122         found at least one applicable method, then choose the best among them.
16123         Fixes bug #24463 and test-29.cs.
16124
16125 2002-07-22  Martin Baulig  <martin@gnome.org>
16126
16127         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16128         return types of the methods.  The return type is not part of the
16129         signature and we must not check it to make the `new' modifier work.
16130         Fixes bug #27999, also added test-147.cs.
16131         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16132
16133         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16134         on the method's return type.
16135
16136 2002-07-21  Martin Baulig  <martin@gnome.org>
16137
16138         * assign.cs: Make this work if the rightmost source is a constant and
16139         we need to do an implicit type conversion.  Also adding a few more tests
16140         to test-38.cs which should have caught this.
16141
16142         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16143         target in the makefile for this.  The makefile.gnu is primarily intended
16144         for end-users who don't want to debug the compiler.
16145
16146 2002-07-21  Martin Baulig  <martin@gnome.org>
16147
16148         * assign.cs: Improved the Assign class so it can now handle embedded
16149         assignments (X = Y = Z = something).  As a side-effect this'll now also
16150         consume less local variables.  test-38.cs now passes with MCS, added
16151         a few new test cases to that test.
16152
16153 2002-07-20  Martin Baulig  <martin@gnome.org>
16154
16155         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16156         instructions.  Fixes bug #27977, also added test-146.cs.
16157
16158 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16159
16160         * cs-tokenizer.cs: fixed getHex ().
16161
16162 2002-07-19  Martin Baulig  <martin@gnome.org>
16163
16164         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16165         not Type.GetType() to lookup the array type.  This is needed when
16166         we're constructing an array of a user-defined type.
16167         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16168         single-dimensional arrays, but also for single-dimensial arrays of
16169         type decimal.
16170
16171 2002-07-19  Martin Baulig  <martin@gnome.org>
16172
16173         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16174         this function is called, it's not allowed to share LocalBuilders
16175         among ILGenerators.
16176
16177 2002-07-19  Martin Baulig  <martin@gnome.org>
16178
16179         * expression.cs (Argument.Resolve): Report an error 118 when trying
16180         to pass a type as argument.
16181
16182 2002-07-18  Martin Baulig  <martin@gnome.org>
16183
16184         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16185         Conv_R_Un for the signed `long' type.
16186
16187 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16188
16189         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16190         `expr' for the temporary result, as that will fail if we do
16191         multiple resolves on the same expression.
16192
16193 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16194
16195         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16196         ec.TypeContainer for looking up aliases. 
16197
16198         * class.cs (TypeContainer): Remove LookupAlias from here.
16199
16200         * decl.cs (DeclSpace); Move here.
16201
16202 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16203
16204         * class.cs (FindMembers): Only call filter if the constructor
16205         bulider is not null.
16206
16207         Also handle delegates in `NestedTypes' now.  Now we will perform
16208         type lookups using the standard resolution process.  This also
16209         fixes a bug.
16210
16211         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16212         This uses Expressions (the limited kind that can be parsed by the
16213         tree) instead of strings.
16214
16215         * expression.cs (ComposedCast.ToString): Implement, used to flag
16216         errors since now we have to render expressions.
16217
16218         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16219         FormArrayType. 
16220
16221         * ecore.cs (SimpleName.ToString): ditto.
16222
16223         * cs-parser.jay: Instead of using strings to assemble types, use
16224         Expressions to assemble the type (using SimpleName, ComposedCast,
16225         MemberAccess).  This should fix the type lookups in declarations,
16226         because we were using a different code path for this.
16227
16228         * statement.cs (Block.Resolve): Continue processing statements
16229         even when there is an error.
16230
16231 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16232
16233         * class.cs (Event.Define): Also remove the `remove' method from
16234         the list of pending items.
16235
16236         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16237         generate more compact code. 
16238
16239 2002-07-17  Martin Baulig  <martin@gnome.org>
16240
16241         * const.cs (Const.LookupConstantValue): Add support for constant
16242         `unchecked' and `checked' expressions.
16243         Also adding test case test-140.cs for this.
16244
16245 2002-07-17  Martin Baulig  <martin@gnome.org>
16246
16247         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16248         check whether mi.ReturnType implements the IEnumerator interface; the
16249         `==' and the IsAssignableFrom() will fail in this situation.
16250
16251 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16252
16253         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16254         here too.
16255
16256 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16257
16258         * expression.cs: fixed bug #27811.
16259
16260 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16261
16262         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16263         Molaro: when we are a ref, the value already contains a pointer
16264         value, do not take the address of it.
16265
16266 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16267         * removed mb-parser.jay and mb-tokenizer.cs
16268
16269 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16270
16271         * expression.cs: check against the building corlib void type.
16272
16273 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16274
16275         * ecore.cs: fix for valuetype static readonly fields: when 
16276         initializing them, we need their address, not the address of a copy.
16277
16278 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16279
16280         * typemanager.cs: register also enum_type in corlib.
16281
16282 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16283
16284         * class.cs: allow calling this (but not base) initializers in structs.
16285
16286 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16287
16288         * ecore.cs: make sure we compare against the building base types
16289         in GetTypeSize ().
16290
16291 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16292
16293         * typemanager.cs: fix TypeToCoreType() to handle void and object
16294         (corlib gets no more typerefs after this change).
16295
16296 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16297
16298         * expression.cs (ArrayCreation.EmitArrayArguments): use
16299         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16300
16301         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16302         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16303         array indexes, the runtime actually forbids them.
16304
16305         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16306         for array arguments here.
16307
16308         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16309         instead of the default for ValueTypes.
16310
16311         (New.DoEmit): Use IsValueType instead of
16312         IsSubclassOf (value_type)
16313         (New.DoResolve): ditto.
16314         (Invocation.EmitCall): ditto.
16315
16316         * assign.cs (Assign): ditto.
16317
16318         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16319         Statements *are* currently doing part of their resolution during
16320         Emit.  
16321
16322         Expressions do always resolve during resolve, but statements are
16323         only required to propagate resolution to their children.
16324
16325 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16326
16327         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16328
16329         (LoadAssembly): Do not add the dll if it is already specified
16330
16331         (MainDriver): Add the System directory to the link path at the end,
16332         after all the other -L arguments. 
16333
16334         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16335         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16336         ldelem.u1) and using the opposite for sbytes.
16337
16338         This fixes Digger, and we can finally run it.
16339
16340         * driver.cs (UnixParseOption): Move the option parsing here.  
16341         (CSCParseOption): Implement CSC-like parsing of options.
16342
16343         We now support both modes of operation, the old Unix way, and the
16344         new CSC-like way.  This should help those who wanted to make cross
16345         platform makefiles.
16346
16347         The only thing broken is that /r:, /reference: and /lib: are not
16348         implemented, because I want to make those have the same semantics
16349         as the CSC compiler has, and kill once and for all the confussion
16350         around this.   Will be doing this tomorrow.
16351
16352         * statement.cs (Unsafe.Resolve): The state is checked during
16353         resolve, not emit, so we have to set the flags for IsUnsfe here.
16354
16355 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16356
16357         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16358         not catch the Error_ObjectRefRequired in SimpleName (as it is
16359         possible to have a class/instance variable name that later gets
16360         deambiguated), we have to check this here.      
16361
16362 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16363
16364         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16365         make static and put into Expression.
16366
16367         (Event.Define): Register the private field of the event with the 
16368         TypeManager so that GetFieldFromEvent can get at it.
16369
16370         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16371         keep track of the private field associated with an event which
16372         has no accessors.
16373
16374         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16375         private field.
16376
16377         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16378
16379 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16380
16381         * expression.cs (Binary.EmitBranchable): this routine emits the
16382         Binary expression in a branchable context.  This basically means:
16383         we need to branch somewhere, not just get the value on the stack.
16384
16385         This works together with Statement.EmitBoolExpression.
16386
16387         * statement.cs (Statement.EmitBoolExpression): Use
16388         EmitBranchable. 
16389
16390 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16391
16392         * statement.cs (For): Reduce the number of jumps in loops.
16393
16394         (For): Implement loop inversion for the For statement.
16395
16396         (Break): We can be breaking out of a Try/Catch controlled section
16397         (foreach might have an implicit try/catch clause), so we need to
16398         use Leave instead of Br.
16399
16400         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16401         now).  If the instace expression supports IMemoryLocation, we use
16402         the AddressOf method from the IMemoryLocation to extract the
16403         address instead of emitting the instance.
16404
16405         This showed up with `This', as we were emitting the instance
16406         always (Emit) instead of the Address of This.  Particularly
16407         interesting when This is a value type, as we dont want the Emit
16408         effect (which was to load the object).
16409
16410 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16411
16412         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16413
16414         * statement.cs (Checked): Set the CheckedState during the resolve
16415         process too, as the ConvCast operations track the checked state on
16416         the resolve process, and not emit.
16417
16418         * cs-parser.jay (namespace_member_declaration): Flag that we have
16419         found a declaration when we do.  This is used to flag error 1529
16420
16421         * driver.cs: Report ok when we display the help only.
16422
16423 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16424
16425         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16426
16427 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16428
16429         * cs-tokenizer.cs (define): We also have to track locally the
16430         defines.  AllDefines is just used for the Conditional Attribute,
16431         but we also need the local defines for the current source code. 
16432
16433 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16434
16435         * statement.cs (While, For, Do): These loops can exit through a
16436         Break statement, use this information to tell whether the
16437         statement is the last piece of code.
16438
16439         (Break): Flag that we break.
16440
16441         * codegen.cs (EmitContexts): New `Breaks' state variable.
16442
16443 2002-07-03  Martin Baulig  <martin@gnome.org>
16444
16445         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16446         modifiers in method declarations in structs.  Otherwise, you won't
16447         be able to override things like Object.Equals().
16448
16449 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16450
16451         * class.cs (Method, Property, Indexer): Do not allow the public
16452         modifier to be used in explicit interface implementations.
16453
16454         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16455         override modifiers in method declarations in structs
16456
16457 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16458
16459         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16460         integer or real overflow, report an error
16461
16462 2002-07-02  Martin Baulig  <martin@gnome.org>
16463
16464         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16465         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16466         to tell the runtime about our newly created System.Object and
16467         System.ValueType types.
16468
16469 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16470
16471         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16472         struct instead of Ldarg/Starg.
16473
16474 2002-07-02  Martin Baulig  <martin@gnome.org>
16475
16476         * expression.cs (Indirection.Indirection): Call
16477         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16478
16479 2002-07-02  Martin Baulig  <martin@gnome.org>
16480
16481         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16482         ValueType, call TypeManager.TypeToCoreType() on it.
16483         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16484         the OpCodes.Newarr argument.
16485
16486 2002-07-02  Martin Baulig  <martin@gnome.org>
16487
16488         * expression.cs (Invocation.EmitCall): When compiling corlib,
16489         replace all calls to the system's System.Array type to calls to
16490         the newly created one.
16491
16492         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16493         System.Array methods.
16494         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16495         from the system's System.Array type which must be replaced.
16496
16497 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16498
16499         * typemanager.cs: load unverifiable_code_ctor so we can build
16500         corlib using the correct type. Avoid using GetTypeCode() with
16501         TypeBuilders.
16502         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16503         TypeManager.object_type to allow building corlib.
16504
16505 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16506
16507         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16508
16509 2002-07-01  Martin Baulig  <martin@gnome.org>
16510
16511         * class.cs: Make the last change actually work, we need to check
16512         whether `ifaces != null' to avoid a crash.
16513
16514 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16515
16516         * class.cs: when we build structs without fields that implement
16517         interfaces, we need to add the interfaces separately, since there is
16518         no API to both set the size and add the interfaces at type creation
16519         time.
16520
16521 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16522
16523         * expression.cs: the dimension arguments to the array constructors
16524         need to be converted if they are a long.
16525
16526 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16527
16528         * class.cs: don't emit ldarg.0 if there is no parent constructor
16529         (fixes showstopper for corlib).
16530
16531 2002-06-29  Martin Baulig  <martin@gnome.org>
16532
16533         MCS now compiles corlib on GNU/Linux :-)
16534
16535         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16536         ie. check for MethodImplOptions.InternalCall.
16537
16538         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16539         and TypeManager.attribute_type are null, so we must explicitly check
16540         whether parent is not null to find out whether it's an attribute type.
16541         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16542         and SetBuilder, not only if the property is neither abstract nor external.
16543         This is necessary to set the MethodImplOptions on the accessor methods.
16544         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16545         SetBuilder, see Property.Emit().
16546
16547         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16548         populate "System.Object", "System.ValueType" and "System.Attribute" since
16549         they've already been populated from BootCorlib_PopulateCoreTypes().
16550
16551 2002-06-29  Martin Baulig  <martin@gnome.org>
16552
16553         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16554         is the NullLiteral, we also need to make sure that target_type is not
16555         an enum type.   
16556
16557 2002-06-29  Martin Baulig  <martin@gnome.org>
16558
16559         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16560         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16561         before calling BootstrapCorlib_ResolveDelegate ().
16562
16563 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16564
16565         * statement.cs: fixed build-breaker. All tests passed ok.
16566
16567 2002-06-27  Martin Baulig  <martin@gnome.org>
16568
16569         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16570         for System.Decimal when compiling corlib.
16571
16572 2002-06-27  Martin Baulig  <martin@gnome.org>
16573
16574         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16575         switch blocks which contain nothing but a default clause.
16576
16577 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16578
16579        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16580
16581 2002-06-27  Martin Baulig  <martin@gnome.org>
16582
16583         * ecore.cs (PropertyExpr.PropertyExpr): Call
16584         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16585
16586         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16587         is already a TypeBuilder.
16588
16589 2002-06-27  Martin Baulig  <martin@gnome.org>
16590
16591         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16592         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16593         the "from an array-type to System.Array" case.  This makes it work
16594         when compiling corlib.
16595
16596 2002-06-27  Martin Baulig  <martin@gnome.org>
16597
16598         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16599         non-static PropertyExpr, set its InstanceExpression.  This makes
16600         the `ICollection.Count' property work in System/Array.cs.
16601
16602 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16603
16604         * driver.cs: Made error handling more consistent.  Errors now
16605         tracked by Report class, so many methods which used to return int
16606         now return void.  Main() now prints success/failure and 
16607         errors/warnings message.
16608
16609         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16610         the magic number return values (123 and 124).  Now, if the
16611         expected error occurs, the compiler exits with success (exit value
16612         0).  If the compilation completes without seeing that particular
16613         error, the compiler exits with failure (exit value 1).  The
16614         makefile in mcs/errors has been changed to handle the new behaviour.
16615
16616         * report.cs: Made 'expected error' number a property and renamed
16617         it from 'Probe' to 'ExpectedError'.
16618
16619         * genericparser.cs: Removed error handling support, since it is
16620         now all done by Report class.
16621
16622         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16623         class, so parse() no longer returns an int.
16624
16625         * namespace.cs: Use Report.Error instead of GenericParser.error
16626
16627 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16628
16629         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16630         TypeContainer.AddOperator): At the front of the list put the
16631         explicit implementations, so they get resolved/defined first. 
16632
16633 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16634
16635         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16636         interface type is implemented by this TypeContainer.  Used during
16637         explicit interface implementation.
16638
16639         (Property.Define, Indexer.Define, Method.Define): Validate that
16640         the given interface in the explicit implementation is one of the
16641         base classes for the containing type.
16642
16643         Also if we are explicitly implementing an interface, but there is
16644         no match in the pending implementation table, report an error.
16645
16646         (Property.Define): Only define the property if we are
16647         not explicitly implementing a property from an interface.  Use the
16648         correct name also for those properties (the same CSC uses,
16649         although that is really not needed).
16650
16651         (Property.Emit): Do not emit attributes for explicitly implemented
16652         properties, as there is no TypeBuilder.
16653
16654         (Indexer.Emit): ditto.
16655
16656         Hiding then means that we do not really *implement* a pending
16657         implementation, which makes code fail.
16658
16659 2002-06-22  Martin Baulig  <martin@gnome.org>
16660
16661         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16662         the return value of Object.GetType().  [FIXME: we need to do this whenever
16663         we get a type back from the reflection library].
16664
16665 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16666
16667         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16668
16669 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16670
16671         * attribute.cs: Return null if we can not look up the type.
16672
16673         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16674         the interface types found.
16675
16676         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16677         interface types found.
16678
16679         * typemanager.cs (GetInterfaces): Make this routine returns alll
16680         the interfaces and work around the lame differences between
16681         System.Type and System.Reflection.Emit.TypeBuilder in the results
16682         result for GetInterfaces.
16683
16684         (ExpandInterfaces): Given an array of interface types, expand and
16685         eliminate repeated ocurrences of an interface.  This expands in
16686         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16687         be IA, IB, IC.
16688
16689 2002-06-21  Martin Baulig  <martin@gnome.org>
16690
16691         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16692         on System.Enum.
16693
16694 2002-06-21  Martin Baulig  <martin@gnome.org>
16695
16696         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16697         and called with one of the core types, return the corresponding typebuilder for
16698         that type.
16699
16700         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16701         element type.
16702
16703 2002-06-21  Martin Baulig  <martin@gnome.org>
16704
16705         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16706         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16707         (Expression.ConvertReferenceExplicit): Likewise.
16708
16709         * expression.cs (ElementAccess.DoResolve): Likewise.
16710         (ElementAccess.DoResolveLValue): Likewise.
16711
16712 2002-06-10  Martin Baulig  <martin@gnome.org>
16713
16714         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16715         add the "value" parameter to the parameter list.
16716
16717         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16718         to our caller.
16719
16720 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16721
16722         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16723         the argument to an int, uint, long or ulong, per the spec.  Also
16724         catch negative constants in array creation.
16725
16726 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16727
16728         * class.cs: do not allow the same interface to appear twice in
16729         the definition list.
16730
16731 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16732
16733         * ecore.cs: don't use ldlen with System.Array.
16734
16735 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16736
16737         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16738
16739 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16740
16741         * modifiers.cs: produce correct field attributes for protected
16742         internal. Easy fix so miguel can work on ther harder stuff:-)
16743
16744 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16745
16746         * pending.cs: New file.  Move the code from class.cs here.
16747         Support clearning the pending flag for all methods (when not doing
16748         explicit interface implementation).
16749
16750 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16751
16752         * rootcontext.cs: added a couple more types needed to bootstrap.
16753
16754 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16755
16756         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16757         constructor in the type, instead of any constructor in the type
16758         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16759         a bug in the Mono runtime when applying the params attribute). 
16760
16761 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16762         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16763
16764 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16765
16766         * expression.cs (Unary.ResolveOperator): Use TypeManager
16767         to resolve the type.
16768
16769 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16770
16771         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16772         attached.
16773
16774         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16775         with each member too.
16776
16777         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16778         field builders too - this takes care of the enum member case.
16779
16780 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16781
16782         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16783         address-of operator on both value types and pointers.
16784
16785 2002-06-10  Martin Baulig  <martin@gnome.org>
16786
16787         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16788         PropertyBuilder to the `property_builders' list.
16789
16790         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16791         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16792         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16793         find any indexers which are inherited from an interface.
16794
16795 2002-06-09  Martin Baulig  <martin@gnome.org>
16796
16797         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16798         the same type as the constant if necessary.  There's also a test-130.cs
16799         for this.
16800
16801         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16802
16803         * typemanager.cs (TypeManager.ChangeType): Previously known as
16804         Enum.ChangeEnumType().
16805
16806 2002-06-09  Martin Baulig  <martin@gnome.org>
16807
16808         * expression.cs (Cast.TryReduce): Added support for consts.
16809
16810 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16811
16812         * class.cs (Accessor): Hold attributes information so we can pass
16813         it along.
16814
16815         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16816         Modify to pass in attributes attached to the methods.
16817
16818         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16819
16820         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16821         to handle the Accessor kind :-)
16822
16823         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16824
16825 2002-06-08  Martin Baulig  <martin@gnome.org>
16826
16827         * expression.cs (Unary.TryReduceNegative): Added support for
16828         ULongConstants.
16829
16830 2002-06-08  Martin Baulig  <martin@gnome.org>
16831
16832         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16833         name can't be found in the `defined_names' - the caller will do a
16834         MemberLookup in this case and thus find methods in System.Enum
16835         such as Enum.IsDefined().
16836
16837 2002-06-08  Martin Baulig  <martin@gnome.org>
16838
16839         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16840         Convert.ChangeType() which works with TypeBuilder created types.
16841         (Enum.LookupEnumValue, Enum.Define): Use it here.
16842
16843         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16844         `TypeBuilder.BaseType != null' check.
16845         (TypeContainer.FindMembers): Only lookup parent members if we
16846         actually have a parent.
16847         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16848         (ConstructorInitializer.Resolve): Likewise.
16849
16850         * interface.cs (Interface.FindMembers): Added
16851         `TypeBuilder.BaseType != null' check.
16852
16853         * rootcontext.cs (RootContext.ResolveCore): Added
16854         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16855         classes_second_stage.
16856
16857         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16858         debug_type and trace_type when compiling with --nostdlib.       
16859
16860 2002-06-07  Martin Baulig  <martin@gnome.org>
16861
16862         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16863         (AddField): Set it to true when adding a non-static field.
16864         (DefineType): Use `have_nonstatic_fields' to find out whether we
16865         have non-static fields, not `Fields != null'.
16866
16867 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16868
16869         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16870         dereferencing a null on the static-field code path)
16871
16872 2002-05-30  Martin Baulig  <martin@gnome.org>
16873
16874         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16875         to take command line arguments.  Use reflection to call the new
16876         custom `Initialize' function on the symbol writer and pass it the
16877         command line arguments.
16878
16879         * driver.cs (--debug-args): New command line argument to pass command
16880         line arguments to the symbol writer.
16881
16882 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16883
16884         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16885         the target type for indexers and properties.  Thanks to Joe for
16886         catching this.
16887
16888 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16889
16890         * typemanager.cs (MethodFlags): returns the method flags
16891         (Obsolete/ShouldIgnore) that control warning emission and whether
16892         the invocation should be made, or ignored. 
16893
16894         * expression.cs (Invocation.Emit): Remove previous hack, we should
16895         not do this on matching a base type, we should do this based on an attribute
16896
16897         Only emit calls to System.Diagnostics.Debug and
16898         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16899         on the command line.
16900
16901         * rootcontext.cs: Global settings for tracing and debugging.
16902
16903         * cs-tokenizer.cs (define): New utility function to track
16904         defines.   Set the global settings for TRACE and DEBUG if found.
16905
16906 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16907
16908         * interface.cs (Populate*): Pass in the TypeContainer as well as
16909         the DeclSpace as parameters so that we can create EmitContexts and
16910         then use that to apply attributes etc.
16911
16912         (PopulateMethod, PopulateEvent, PopulateProperty)
16913         (PopulateIndexer): Apply attributes everywhere.
16914
16915         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16916         etc.
16917
16918         (ApplyAttributes): Update accordingly.
16919
16920         We now apply interface attributes for all members too.
16921
16922 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16923
16924         * class.cs (Indexer.Define); Correctly check if we are explicit
16925         implementation (instead of checking the Name for a ".", we
16926         directly look up if the InterfaceType was specified).
16927
16928         Delay the creation of the PropertyBuilder.
16929
16930         Only create the PropertyBuilder if we are not an explicit
16931         interface implementation.   This means that explicit interface
16932         implementation members do not participate in regular function
16933         lookups, and hence fixes another major ambiguity problem in
16934         overload resolution (that was the visible effect).
16935
16936         (DefineMethod): Return whether we are doing an interface
16937         implementation. 
16938
16939         * typemanager.cs: Temporary hack until we get attributes in
16940         interfaces (Ravi is working on that) and we get IndexerName
16941         support in interfaces.
16942
16943         * interface.cs: Register the indexers as properties.
16944
16945         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16946         warning, I have verified that this is a bug in the .NET runtime
16947         (JavaScript suffers of the same problem).
16948
16949         * typemanager.cs (MemberLookup): When looking up members for
16950         interfaces, the parent of an interface is the implicit
16951         System.Object (so we succeed in searches of Object methods in an
16952         interface method invocation.  Example:  IEnumerable x;  x.ToString
16953         ()) 
16954
16955 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16956
16957         * class.cs (Event): Events should also register if they do
16958         implement the methods that an interface requires.
16959
16960         * typemanager.cs (MemberLookup); use the new GetInterfaces
16961         method. 
16962
16963         (GetInterfaces): The code used to lookup interfaces for a type is
16964         used in more than one place, factor it here. 
16965
16966         * driver.cs: Track the errors at the bottom of the file, we kept
16967         on going.
16968
16969         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16970         instance if the method we are calling is static!
16971
16972 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16973
16974         * attribute.cs (ApplyAttributes): Make this function filter out
16975         the IndexerName attribute (as that attribute in reality is never
16976         applied) and return the string constant for the IndexerName
16977         attribute. 
16978
16979         * class.cs (TypeContainer.Emit): Validate that all the indexers
16980         have the same IndexerName attribute, and if so, set the
16981         DefaultName attribute on the class. 
16982
16983         * typemanager.cs: The return value might contain other stuff (not
16984         only methods).  For instance, consider a method with an "Item"
16985         property and an Item method.
16986
16987         * class.cs: If there is a problem with the parameter types,
16988         return. 
16989
16990 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16991
16992         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16993         looks at user defined conversion after making a call to 
16994         StandardConversionExists - we need this for overload resolution.
16995
16996         * expression.cs : Update accordingly the various method calls.
16997
16998         This fixes 2 bugs filed against implicit user defined conversions 
16999
17000 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17001
17002         * statement.cs: Track the result of the assignment.
17003
17004 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17005
17006         * expression.cs (MemberAccess): Improved error reporting for
17007         inaccessible members.
17008
17009 2002-05-22  Martin Baulig  <martin@gnome.org>
17010
17011         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17012         itself with debugging support.
17013
17014 2002-05-22  Martin Baulig  <martin@gnome.org>
17015
17016         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17017         Removed, this isn't needed anymore.
17018
17019 2002-05-20  Martin Baulig  <martin@gnome.org>
17020
17021         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17022         be underlying type for an enum.
17023
17024 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17025
17026         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17027         that splits out the loading of just the core types.
17028
17029         * rootcontext.cs (ResolveCore): Split the struct resolution in
17030         two, so we can load the enumeration underlying types before any
17031         enums are used.
17032
17033         * expression.cs (Is): Bandaid until we fix properly Switch (see
17034         bug #24985 for details).
17035
17036         * typemanager.cs (ImplementsInterface): The hashtable will contain
17037         a null if there are no interfaces implemented.
17038
17039 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17040
17041         * cs-parser.jay (indexer_declarator): It is fine to have array
17042         parameters
17043
17044 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17045
17046         * typemanager.cs: (RegisterBuilder): New function used to register
17047         TypeBuilders that implement interfaces.  Since
17048         TypeBuilder.GetInterfaces (as usual) does not work with lame
17049         Reflection.Emit. 
17050         (AddUserType): register interfaces.
17051
17052         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17053         dealing with TypeBuilder.  Also, arrays are showing up as
17054         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17055         methods can not be invoked on them!
17056
17057         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17058         (ImplicitReferenceConversionExists): Split out from
17059         StandardConversionExists. 
17060
17061         * expression.cs (As): We were only implementing one of the three
17062         cases for the as operator.  We now implement them all.
17063         (Is): Implement the various other cases for Is as well.
17064
17065         * typemanager.cs (CACHE): New define used to control if we want or
17066         not the FindMembers cache.  Seems to have a negative impact on
17067         performance currently
17068
17069         (MemberLookup): Nested types have full acess to
17070         enclosing type members
17071
17072         Remove code that coped with instance/static returns for events, we
17073         now catch this in RealFindMembers.
17074
17075         (RealFindMembers): only perform static lookup if the instance
17076         lookup did not return a type or an event.  
17077
17078 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17079
17080         * assign.cs (CompoundAssign): We pass more semantic information
17081         now to Compound Assignments than we did before: now we have all
17082         the information at hand, and now we resolve the target *before* we
17083         do the expression expansion, which allows the "CacheValue" method
17084         to have the effect we intended (before, a [x] += 1 would generate
17085         two differen ArrayAccess expressions from the ElementAccess,
17086         during the resolution process).
17087
17088         (CompoundAssign.DoResolve): Resolve target and original_source here.
17089
17090 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
17091
17092         * expression.cs (ArrayAccess): dropped debugging information. 
17093
17094         * typemanager.cs: Small bug fix: I was always returning i_members,
17095         instead of one of i_members or s_members (depending on which had
17096         the content).
17097
17098         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
17099         method is invoked before any code generation takes place, and it
17100         is a mechanism to inform that the expression will be invoked more
17101         than once, and that the method should use temporary values to
17102         avoid having side effects
17103
17104         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17105
17106         * ecore.cs (Expression.CacheTemporaries): Provide empty default
17107         implementation.
17108
17109         * expression.cs (Indirection, ArrayAccess): Add support for
17110         CacheTemporaries in these two bad boys. 
17111
17112         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17113         ldobj or ldind_ref.  
17114         (StoreFromPtr): Handle stobj as well.
17115
17116         * expression.cs (UnaryMutator): Share more code.
17117
17118         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17119         down: I was not tracking the Filter function as well, which
17120         was affecting the results of the cache.
17121
17122 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
17123
17124         * attribute.cs: Remove the hack to handle the CharSet property on
17125         StructLayouts. 
17126
17127 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * attribute.cs (DoResolve): More uglyness, we now only try to
17130         resolve the attribute partially, to extract the CharSet
17131         information (only if we are a StructLayout attribute).  Otherwise 
17132
17133         (GetExtraTypeInfo): Add some code to conditionally kill in the
17134         future this.   I am more and more convinced that the .NET
17135         framework has special code to handle the attribute setting on
17136         certain elements.
17137
17138         * expression.cs (IsParamsMethodApplicable): Revert my previous
17139         foreach change here, it was wrong.
17140
17141 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17142
17143         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17144         (pp_expr): do not abort on unknown input, just return.
17145         (eval): abort if there are pending chars.
17146
17147         * attribute.cs (Attribute.Resolve): Positional parameters are
17148         optional.  Deal with that case.
17149
17150         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17151         the Ansi/Unicode/Auto information for the type.
17152
17153         (TypeContainer.DefineType): instantiate the EmitContext here, as
17154         we will be using it during the type definition (to resolve
17155         attributes) and during the emit phase.
17156
17157         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17158         to pull type information out of the attributes
17159
17160         (Attribute.Resolve): track the constructor builder, and allow for
17161         multiple invocations (structs and classes will use this).
17162
17163         * ecore.cs (MemberLookupFinal): new version with all the
17164         parameters customizable.
17165
17166         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17167         constructors.  Return if the result value is null (as the error
17168         would have been flagged already by MemberLookupFinal)
17169
17170         Do not allow instances of abstract classes or interfaces to be
17171         created.
17172
17173         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17174         We have to compare the assembly property here when dealing with
17175         FamANDAssem and Assembly access modifiers, because we might be
17176         creating an assembly from *modules* (that means that we are not
17177         getting TypeBuilders for types defined in other modules that are
17178         part of this assembly).
17179
17180         (Method.Emit): If the method is marked abstract and has a body,
17181         emit an error. 
17182
17183         (TypeContainer.DefineMembers): If both the defined member and the
17184         parent name match are methods, then do not emit any warnings: let
17185         the Method.Define routine take care of flagging warnings.  But if
17186         there is a mismatch (method overrides something else, or method is
17187         overriwritten by something, then emit warning).
17188
17189         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17190         set to null, this means `do not check for the return type on the
17191         signature'. 
17192
17193         (Method.Define): set the return type for the method signature to
17194         null, so that we get methods with the same name and parameters and
17195         different return types.  This is used to flag warning 114 (you are
17196         hiding a method, and you probably want to use the new/override
17197         keywords instead).
17198
17199         * typemanager.cs (MemberLookup): Implemented proper access
17200         control, closing a long standing set of bug reports.  The problem
17201         was that the Framework only has two bits: Public and NonPublic,
17202         and NonPublic includes private and protected methods, but we need
17203         to enforce the FamANDAssem, FamOrAssem and Family. 
17204
17205 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17206
17207         * statement.cs (GotoCase): Return true: Ammounts to giving up
17208         knowledge on whether we return or not, and letting the other case
17209         be responsible for it.
17210
17211 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17212
17213         * driver.cs: Do not load directories for each file processed, only
17214         do it if there is a pattern.
17215
17216         * ecore.cs: Report readonly assigns here as well, as we might have
17217         been resolved only by MemberAccess.
17218
17219         (SimpleName.SimpleNameResolve): Also be useful for LValue
17220         resolution.   We need this to propagate assign to local readonly variables
17221
17222         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17223         do not want to reuse potential criteria memory.
17224
17225         * class.cs (MyEventBuilder): Set reflected_type;
17226
17227         * ecore.cs (Constantify): Added support for constifying bools.
17228
17229         (RootContext.LookupType): Added a cache for values looked up in
17230         the declaration space.
17231
17232         * typemanager.cs (FindMembers): Now is a front-end to
17233         RealFindMembers, and provides a two-level hashtable-based cache to
17234         the request.  
17235
17236         15% performance improvement: from 22.5 to 19.2 seconds.
17237
17238         * expression.cs (IsParamsMethodApplicable): use foreach.
17239         (Invocation.DoResolve): ditto.
17240         (New.DoResolve): ditto.
17241         (ArrayCreation.DoResolve): ditto.
17242
17243         * ecore.cs (FindMostEncompassingType): use foreach.
17244
17245         * delegate.cs (NewDelegate.DoResolve): Use foreach
17246
17247         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17248         (RemoveMethods): use foreach.
17249
17250         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17251         nested foreach statements instead of for, and also break out of
17252         the inner loop once a match is found.
17253
17254         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17255
17256 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17257
17258         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17259         we actually unwrap the expression to allow for extra information
17260         to be extracted. 
17261
17262         * expression.cs: Use Shr_Un on unsigned operations. 
17263
17264 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17265
17266         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17267         applicable operators was not being considered correctly. This closes
17268         the bug Miguel reported.
17269
17270 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17271
17272         * attribute.cs: check that the type derives from System.Attribute
17273         and report the correct error in that case (moved the duplicate code to
17274         its own method, too).
17275
17276 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17277
17278         * attribute.cs: lookup attribute type name as the spec says: first the
17279         bare attribute name and then name + "Attribute" (nant compiles with
17280         mcs after this fix).
17281
17282 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17283
17284         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17285         Because of the way we parse things, we should try to see if a
17286         UIntConstant can fit in an integer.
17287
17288 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17289
17290         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17291         when we are in an explicit context.
17292
17293         (ConvertReferenceExplicit): When converting from Iface type S to Class
17294         T make sure the rules are implemented as an OR.
17295
17296         * parameter.cs (ParameterType): Make it a property for now although the
17297         purpose really isn't anything immediate.
17298
17299         * expression.cs (Is*Applicable): Do better checking on the parameter type
17300         of a ref/out parameter. The ones from the system assemblies are already 
17301         marked with the correct type so we don't need to do any correction.
17302
17303         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17304         the object type is standard too so include that.
17305
17306 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17307
17308         * ecore.cs (StandardConversionExists): Augment with missing code:
17309         deal with IntConstant, LongConstants and Enumerations.
17310
17311         * assign.cs: Report the error, instead of failing silently
17312
17313         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17314         typecontainer that they are declared, because the
17315         typecontainer/namespace will have the list of using clauses that
17316         need to be applied.
17317
17318         Assembly Attributes were escaping the normal registration
17319         mechanism. 
17320
17321         (EmitCode): Apply attributes within an EmitContext that represents
17322         the container they were declared on.
17323
17324         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17325
17326 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17327
17328         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17329         Revamp completely - make much cleaner as we now operate only
17330         on a set of Types.
17331
17332         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17333         to implement the logic detailed in the spec more correctly.
17334
17335         (UserDefinedConversion): Update accordingly.
17336
17337 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17338
17339         * statement.cs: Return flow analysis information up.
17340
17341         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17342         and the default.
17343
17344         (token): Do not consume an extra character before calling
17345         decimal_digits.
17346
17347 2002-05-06  Piers Haken <piersh@friskit.com>
17348
17349         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17350
17351 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17352
17353         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17354         EmitContext during the instance constructor initializer
17355         resolution, to stop access to instance variables.
17356
17357         This is mandated by the spec, last paragraph of the `constructor
17358         initializers' section. 
17359
17360 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17361
17362         * cs-parser.jay, class.cs (Accessor): new class used to represent
17363         an accessor (get or set).  In the past we used `null' to represent
17364         a missing accessor.  But this is ambiguous because there was no
17365         way to tell in abstract indexers/properties if one of them was
17366         specified.
17367
17368         Now there is a way of addressing that.
17369
17370         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17371         instead of FindMembers.
17372
17373         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17374         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17375
17376         * attribute.cs: Treat indexers and properties as the same in terms
17377         of applying attributes
17378
17379         * ecore.cs (FindMostEncompassedType): Use statically initialized
17380         EmptyExpressions()s like we do elsewhere to avoid creating useless
17381         objects (and we take this out of the tight loop).
17382
17383         (GetConversionOperators): Move the code to extract the actual
17384         operators to a separate routine to clean things up.
17385
17386 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17387
17388         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17389         events are always registered FieldBuilders.
17390
17391         * class.cs (FieldBase): New class shared by Fields 
17392
17393         * delegate.cs: If we are a toplevel delegate, use our full name.
17394         If we are a nested delegate, then only use our tail name.
17395
17396 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17397
17398         * expression.cs (IsApplicable): Ensure that we add the "&" to
17399         ref/out types before comparing it with the type of the argument.
17400
17401         (IsParamsMethodApplicable): Ditto.
17402
17403         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17404         silly me ;-)
17405
17406         * delegate.cs : Handle the case when we have more than one applicable
17407         method. Flag an error only when we finish checking all.
17408
17409 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17410
17411         * expression.cs: Add support for boolean static initializers.
17412
17413 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17414
17415         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17416
17417         * parameter.cs (ComputeParameterTypes,
17418         ComputeAndDefineParameterTypes): Better error handling: now we
17419         clear the `types' cache if we fail during any of the type lookups.
17420         We also return the status code correctly to our caller
17421
17422         * delegate.cs: If we fail to define a delegate, abort the extra
17423         steps. 
17424
17425         * expression.cs (Binary.ResolveOperator): for
17426         operator==(object,object) and operator !=(object, object) we also
17427         have to verify that there is an implicit conversion from one to
17428         the other.
17429
17430         (ArrayAccess.DoResolve): Array Access can operate on
17431         non-variables. 
17432
17433 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17434
17435         * assign.cs (CompoundAssign): A new class used as a "flag" that
17436         the assignment actually is happening as part of a compound
17437         assignment operator.
17438
17439         During compound assignment, a few new rules exist to enable things
17440         like:
17441
17442         byte b |= 1 + 2
17443
17444         From the spec:
17445
17446         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17447         to the type of x) if y is implicitly convertible to the type of x,
17448         and the operator is a builtin operator and the return type of the
17449         operator is explicitly convertible to the type of x. 
17450
17451         * rootcontext.cs: Reset warning level to 2.  4 catches various
17452         "interesting" features in mcs, we must clean this up at some
17453         point, but currently am trying to kill other bugs ;-)
17454
17455         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17456         in container classes as well.  
17457
17458         * expression.cs (Binary.ResolveOperator): Handle string case
17459         before anything else (as operator overloading does emit an error
17460         before doing anything else).
17461
17462         This code could go away when we move to a table driven model, but
17463         i could not come up with a good plan last night.
17464
17465 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17466
17467         * typemanager.cs (CSharpName): reimplementation using regex.
17468         * class.cs: added null check for fields in Emit
17469         * rootcontext.cs: set warninglevel to 4
17470
17471 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17472
17473         * typemanager.cs (CSharpName): reimplemented with Lupus
17474         suggestion.
17475
17476 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17477
17478         * statement.cs (If): correclty implement Resolve, because we were
17479         not catching sem errors in there.  The same process is needed
17480         everywhere else. 
17481         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17482
17483
17484         (Statement.Warning_DeadCodeFound): Factorize code.
17485         (While): Report dead code here too.
17486
17487         (Statement): Added Resolve virtual method to allow
17488         for resolution split from the emit code.
17489
17490 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17491
17492         * statement.cs (EmitBoolExpression): No longer try to resolve the
17493         expression here.    
17494         (MakeBoolean): New utility function that resolve, implicitly
17495         converts to boolean and tags the expression. 
17496
17497
17498         (If, Do): Implement dead code elimination.
17499         (While): Implement loop inversion
17500
17501         (Do, While, For, If): Resolve the expression prior to calling our
17502         code generation.
17503
17504 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17505
17506         * class.cs:
17507           - added method Report28 (warning: program has more than one entry point)
17508           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17509           - modified method Method.Define, the part at the end of the method
17510
17511         * rootcontext.cs: added static public Location EntryPointLocation;
17512           
17513         * ../errors/cs0028.cs : Add test case for the above warning.              
17514
17515         * typemanager.cs:
17516           - modified method CSharpName to allow arrays of primitive type to
17517             be printed nicely (e.g. instead of System.Int32[][] it now prints
17518             int[][])
17519           - added method CSharpSignature: returns the signature of a method
17520             in string format to be used in reporting errors, warnings, etc.
17521
17522         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17523         with String.Empty.
17524
17525 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17526
17527         * delegate.cs (Define): Fix extremely silly bug where I was
17528         setting the type of the 'object' parameter of the BeginInvoke
17529         method to System.IAsyncResult instead of System.Object ;-)
17530
17531 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17532
17533         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17534         here. 
17535
17536         (Constructor.Emit): return if we fail to initialize the
17537         constructor.  Another door closed!  
17538
17539         * expression.cs (New.DoResolve): Improve error message (from -6 to
17540         1501).  Use DeclaredOnly lookup to find the exact constructor.
17541
17542         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17543         loop.  This is useful.
17544
17545         * cs-parser.jay: Adjust the default parameters so that destructors
17546         have the proper signature.
17547
17548 2002-04-26  Martin Baulig  <martin@gnome.org>
17549
17550         * driver.cs (LoadAssembly): If `assembly' contains any characters
17551         which are only valid in path names and not in assembly names
17552         (currently slash, backslash and point), use Assembly.LoadFrom ()
17553         instead of Assembly.Load () on the `assembly' (before iteration
17554         over the link_paths).
17555
17556 2002-04-26  Martin Baulig  <martin@gnome.org>
17557
17558         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17559
17560 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17561
17562         * class.cs (Property): use the new typemanager.MemberLookup
17563
17564         (TypeContainer.MemberLookup): Implement using the
17565         TypeManager.MemberLookup now. 
17566
17567         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17568         and return MemberInfos, so that these can be used without an
17569         EmitContext (what we had before).
17570
17571 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17572
17573         * expression.cs: Fix the case where the argument to params if the
17574         type of the params.  I omitted handling this before.   Fixed
17575
17576 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17577
17578         * driver.cs: Call BootCorlib_PopulateCoreType
17579
17580         * class.cs (Property.CheckBase): Check for properties only, not
17581         for all members. 
17582
17583         * interface.cs: Temporary hack: try/catch around the
17584         CustomAttributeBuilder, because I am getting an exception that I
17585         do not understand.
17586
17587         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17588         types whose definitions are required to be there (attributes are
17589         defined before standard types).
17590
17591         Compute definitions as we boot the various types, as they are used
17592         immediately (value_type class will need object_type, but if we do
17593         not initialize object_type, we will pass a null, which will let
17594         the runtime pick the System.Object from the existing corlib, which
17595         is not what we want).
17596
17597 2002-04-22  Patrik Torstensson <totte@labs2.com>
17598
17599         * cs-tokenizer.cs: fixed a number of trim() issues.
17600
17601 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17602
17603         * expression.cs (Argument.Type): Ensure that we return the correct
17604         type when we have out or ref parameters [in which case we 
17605         append a "&"].
17606
17607 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17608
17609         * class.cs (Property, Indexer): Allow extern modifier in there. 
17610
17611         * typemanager.cs (InitBaseTypes): Initializes object_type and
17612         value_type, since those will be used early on during the bootstrap
17613         process to compile corlib.
17614
17615         (InitCoreTypes): Move code from here to InitBaseTypes.
17616
17617 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17618
17619         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17620         single-dimension arrays as using the ldlen opcode.  
17621
17622         Daniel Lewis discovered this optimization.  
17623
17624         * typemanager.cs: Add signature for System.Array::get_Length
17625
17626 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17627
17628         * statement.cs: report the error when the foreach does not apply to an
17629         array nor a collection.
17630
17631 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17632
17633         * expression.cs: Add implicit conversions to the operator ~.
17634
17635         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17636
17637         * typemanager.cs: Locate the decimal constructor.
17638
17639 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17640
17641         * attribute.cs: use the new property of TypeOf.
17642         * expression.cs: added 'get' property around typearg.
17643
17644         These changes fix a build breaker reported by NickD. Is this the
17645         correct way to fix?  If not, please, revert my changes and make it
17646         work :-).
17647
17648 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17649
17650         * attribute.cs: Add support for typeof in attribute invocations.
17651         I am not sure that this is right though.
17652
17653 2002-04-14  Duncan Mak  <duncan@ximian.com>
17654
17655         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17656         Binary.Operator.Division case.
17657
17658 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17659
17660         * class.cs (DefineType): Ensure that we do a proper check on
17661         attribute types and also register it with the TypeManager.
17662
17663         (TypeContainer.Targets): The default for attribute types is
17664         AttributeTargets.All.
17665
17666         * attribute.cs (ApplyAttributes): Registering the attribute type
17667         is done elsewhere, not when we discover we have a Usage attribute.
17668
17669 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17670
17671         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17672         and get rid of is_delegate parameter.
17673
17674         * everywhere : update.
17675
17676 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17677
17678         * cs-parser.jay (compilation_unit): Revamp completely to use
17679         some new ideas that I got from Rhys' grammar to solve the problems
17680         with assembly level attributes.
17681
17682         (outer_declaration): New grammar production.
17683
17684         (attribute_sections): Add.
17685
17686         (opt_attributes): Base on attribute_sections
17687
17688         (namespace_declaration): Allow opt_attributes to tackle the case
17689         when we have assembly level attributes - we are clever in this
17690         regard now ;-)
17691
17692         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17693         attributes in the non-global context.
17694
17695         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17696         instead of SetGlobalAttributes.
17697
17698         * class.cs, rootcontext.cs : Ensure we define and generate 
17699         attribute types before anything else.
17700
17701         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17702         and flag the new error -20 for the case when the attribute type
17703         does not have valid targets specified. csc does not catch this.
17704
17705         * ../errors/errors.txt : update for error # -20
17706
17707 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17708
17709         * support.cs (InternalParameters.ParameterModifier): Do some null
17710         checking and return sane values.
17711
17712         * class.cs (Method.Define): If we are a PInvoke method, ensure
17713         that we are static and extern. Report error # 601
17714
17715         * ../errors/cs0601.cs : Add test case for the above error.
17716
17717 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17718
17719         * rootcontext.cs (attribute_types): We need to keep type of
17720         all attribute types separately and emit code for them first.
17721
17722         (RegisterAttribute) : Implement.
17723
17724         * class.cs (DefineType): Check if the current Type is a custom
17725         attribute type and register it accordingly.
17726
17727         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17728         adding the first attribute twice and rename to
17729
17730         (SetGlobalAttributes): this.
17731
17732         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17733         lookups.
17734
17735         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17736         if we are processing global arguments. Hmm, I am unsure of this.
17737
17738 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17739
17740         * expression.cs: added static array of strings to avoid calling
17741         Enum.ToString () for Operator in Binary. Significant recover of
17742         performance.
17743
17744 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17745
17746         * class.cs (FindMembers): Allow the Builders of the various
17747         members to be null.  If they are skip them.  This only happens
17748         during the PInvoke declaration.
17749
17750 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17751
17752         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17753         failure, so we do not keep going afterwards.
17754
17755         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17756         wanted to pass `false' as the `is_delegate' argument.  If this is
17757         the case, why not use delegate_type == null to mean `is_delegate =
17758         false' and anything else as is_delegate = true.
17759
17760 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17761
17762         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17763         code for the section, not the beginning of the tests.
17764
17765 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17766
17767         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17768
17769         * expression.cs (Binary): same.  Warn about errors where we have
17770         Enum/Enum in operator + as well.
17771
17772 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17773
17774         * statement.cs:
17775                 - added support for switch(bool)
17776                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17777                 - add TableSwitchEmit() to handle table-based switch statements
17778
17779 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17780
17781         * expression.cs (Invocation.OverloadResolve): Factor out code which
17782         does parameter compatibility checking with arguments so that we can 
17783         re-use the code even from Delegate.VerifyApplicability
17784
17785         (VerifyArgumentsCompat): Move above code here.
17786
17787         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17788         and instead make a call to the above method.
17789
17790 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17791
17792         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17793         We use it to keep track of classes which are attribute types.
17794
17795 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17796
17797         * delegate.cs (Delegate.Define): Correctly define the types in the
17798         presence of fixed and array parameters.
17799
17800         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17801         doing FindMembers.
17802
17803         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17804         include NonPublic after the first iteration.
17805
17806         * class.cs (Indexer.CheckBase): Only check if both parents are
17807         non-null. 
17808
17809         * cs-parser.jay (accessor_body): If empty, set to null.
17810
17811         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17812         same code path here to resolve constants names that we did have in
17813         MemberAccess.DoResolve.  There is too much code duplicated here.
17814
17815 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17816
17817         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17818
17819         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17820         to MakeUnionSet.
17821
17822         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17823         tokens, numbers and strings.
17824
17825         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17826         parenthesis.
17827
17828         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17829         asyncronous parameters and the regular parameters.  
17830
17831         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17832         specify the target directory.
17833
17834         * expression.cs: (This.DoResolve): Simplify
17835         (As.Emit): Optimize, do not generate IsInst if the expression is
17836         always of the given type.
17837
17838         (Is.DoResolve): Bug fix, we were reporting both always/never for
17839         the is expression.
17840
17841         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17842         creating too many unnecessary arrays.
17843
17844 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17845
17846         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17847         fields instead of rolling our own initializer.   Takes care of all
17848         implicit conversions, and drops unnecessary static checks/argument.
17849
17850 2002-03-31  Dick Porter  <dick@ximian.com>
17851
17852         * driver.cs: use the GetDirectories() return values properly, and
17853         use "/" as path separator.
17854
17855 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17856
17857         * expression.cs (Unary): Optimize - - expr into expr.
17858         (Binary): Optimize a + (-b) into a -b.
17859
17860         * codegen.cs (CodeGen): Made all methods static.
17861
17862 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17863
17864         * rootcontext.cs: 
17865
17866         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17867         TypeBuilder property.
17868
17869         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17870         instead. 
17871
17872         * tree.cs: Removed the various RecordXXXX, and replaced with a
17873         single RecordDecl.  Removed all the accessor methods, and just
17874         left a single access point Type 
17875
17876         * enum.cs: Rename DefineEnum to DefineType.
17877
17878         * decl.cs: New abstract method `DefineType' used to unify the
17879         Defines for Enumerations, Interfaces, TypeContainers and
17880         Delegates.
17881
17882         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17883         LookupBaseClasses method that used to live in class.cs and
17884         interface.cs here, and renamed to FindType.
17885
17886         * delegate.cs: Implement DefineType.  Take advantage of the
17887         refactored pattern for locating the parent builder without taking
17888         the parent_builder argument (which we know does not work if we are
17889         nested, and triggering a toplevel definition).
17890
17891 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17892
17893         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17894         accessibility of a member has changed during override and report
17895         an error if so.
17896
17897         * class.cs (Method.Define, Property.Define): Only complain on
17898         overrides if the method is private, any other accessibility is
17899         fine (and since we just checked the permission is the same, we are
17900         good to go).
17901
17902         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17903         and elif are processed always.  The other pre-processing
17904         directives are only processed if we are "taking" the path
17905
17906 2002-03-29  Martin Baulig  <martin@gnome.org>
17907
17908         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17909         current location is not Null.
17910
17911         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17912         a separate method so we can profile it.
17913
17914         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17915         `span.Seconds' are just seconds, but no minutes or hours.
17916         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17917
17918 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17919
17920         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17921         Remove the gratuitous set of Final:
17922
17923                                 // If an interface implementation, then we can set Final.
17924                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17925                                     implementing.DeclaringType.IsInterface)
17926                                         flags |= MethodAttributes.Final;
17927
17928         I do not know what I was smoking when I used that.
17929
17930
17931         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17932         step into fixing the name resolution issues for delegates and
17933         unifying the toplevel name resolution.
17934
17935 2002-03-28  Martin Baulig  <martin@gnome.org>
17936
17937         * class.cs (Method.Emit): If we have a symbol writer, call its
17938         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17939         tell it about the current method.
17940
17941         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17942         writer that we're going to emit the first byte of IL code for a new
17943         statement (a new source line).
17944         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17945         EmitContext.Mark() before emitting any code.
17946
17947         * location.cs (SymbolDocument): Return null when we're Null.
17948
17949         * statement.cs (Statement): Moved the `Location loc' variable here.
17950         (Statement.EmitBoolExpression): If we have a symbol writer, call
17951         ec.Mark() before emitting any code to tell it that we're at the
17952         beginning of a new statement.
17953         (StatementExpression): Added `Location' argument to the constructor.
17954         (Block): Added public readonly variable `StartLocation' and public
17955         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17956         (Block): Added constructor which takes a start and end location.
17957         (Block.SetEndLocation): New method. This sets the end location.
17958         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17959         local variables we create.
17960         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17961         each statement and do also mark the begin and end of the block.
17962
17963         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17964         tell it the current lexer.Location, use Location.Null for the end of the
17965         block.
17966         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17967         current block, set its end location using SetEndLocation().
17968         (statement_expression): StatementExpression constructor now takes the
17969         lexer.Location as additional argument.
17970         (for_statement, declare_local_variables): Likewise.
17971         (declare_local_variables): When creating a new implicit block, use the
17972         new Block constructor and pass it the lexer.Location.
17973
17974 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17975
17976         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17977         members also on the parent interfaces recursively.
17978
17979 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17980
17981         * report.cs: Use new formats, since Gonzalo finished the missing
17982         bits. 
17983
17984         * expression.cs (Binary.ResolveOperator): added missing operator|
17985         operator& and operator^ for bool/bool.
17986
17987         * cs-parser.jay: CheckDef now takes a Location argument that is
17988         used to report errors more precisly (instead of reporting the end
17989         of a definition, we try to track something which is a lot closer
17990         to the source of the problem).
17991
17992         * cs-tokenizer.cs: Track global token use, so we can properly flag
17993         the use of #define/#undef after the first token has been seen.
17994
17995         Also, rename the reportXXXX to Error_DescriptiveName
17996
17997         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17998         TypeContainer, so that Enum and Interface can use this too.
17999
18000         * class.cs (TypeContainer.LookupInterfaceOrClass,
18001         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18002         `builder' argument.  Typically this was used to pass the parent
18003         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18004         the definition).  
18005
18006         The problem is that a nested class could trigger the definition of
18007         a toplevel class, and the builder would be obviously wrong in that
18008         case. 
18009
18010         So we drop this argument, and we compute dynamically the
18011         TypeBuilder/ModuleBuilder (the correct information was available
18012         to us anyways from DeclSpace.Parent)
18013
18014         * interface.cs (Interface.DefineInterface): Drop builder
18015         parameter cleanup like class.cs
18016
18017         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18018         like class.cs
18019
18020         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18021         values. 
18022
18023         (Try.Emit): Propagate the returns value from the statement.
18024
18025         (Return.Emit): Even if we are leavning 
18026
18027         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18028
18029         * modifiers.cs: Fix the computation of MethodAttributes flags.
18030
18031 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18032
18033         * driver.cs: allow compilation of files that start with '/'.
18034         Add a default case when checking the argument of --target.
18035
18036 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18037
18038         * interface.cs: Implement the same search algorithm for types in
18039         the interface code.
18040
18041         * delegate.cs: Do not allow multiple definition.
18042
18043         * Recovered ChangeLog that got accidentally amputated
18044
18045         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18046
18047         * rootcontext.cs: Load manually enum to allow core classes to
18048         contain enumerations.
18049
18050         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18051         Update to new static methods in TypeManager.
18052
18053         * typemanager.cs (GetMethod, GetConstructor): Use our
18054         implementation of FindMembers to find the members, since during
18055         corlib compilation, the types are TypeBuilders and GetMethod and
18056         GetConstructor do not work.
18057
18058         Make all methods in TypeManager static.
18059
18060         (InitCodeHelpers): Split the functionality from
18061         the InitCodeTypes function.
18062
18063         * driver.cs: Call InitCodeHelpers after we have populated the
18064         types. 
18065
18066         * cs-parser.jay (delegate_declaration): we did not used to compute
18067         the delegate name correctly for void delegates.
18068
18069 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18070
18071         * rootcontext.cs (RootContext): Init the interface_resolve_order
18072         and type_container_resolve_order always.
18073
18074         (ResolveCore, BootstrapCorlib_ResolveClass,
18075         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18076         compiler when compiling with --nostdlib
18077
18078         * class.cs (TypeContainer.DefineType): Check that our parent is
18079         not null.  This test is most important when we are bootstraping
18080         the core types.
18081
18082         * codegen.cs: Split out the symbol writing code.
18083
18084 2002-03-25  Martin Baulig  <martin@gnome.org>
18085
18086         * driver.cs (-g): Made -g an alias for --debug.
18087
18088 2002-03-24  Martin Baulig  <martin@gnome.org>
18089
18090         * codegen.cs (SymbolWriter): New public variable. Returns the
18091         current symbol writer.
18092         (CodeGen): Added `bool want_debugging_support' argument to the
18093          constructor. If true, tell the ModuleBuild that we want debugging
18094         support and ask it for the ISymbolWriter.
18095         (Save): If we have a symbol writer, call it's Close() method after
18096         saving the assembly.
18097
18098         * driver.c (--debug): New command line argument to create a
18099         debugger information file.
18100
18101         * location.cs (SymbolDocument): New public property. Returns an
18102         ISymbolDocumentWriter object for the current source file or null
18103         if we don't have a symbol writer.
18104
18105 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
18106
18107         * driver.cs (LoadAssembly): Correctly return when all the paths
18108         have been tried and not before.
18109
18110         * statement.cs (Switch.Emit): return the actual coverage for this
18111         statement (returns/not-returns)
18112
18113         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18114         switch of the statement if we are the last switch section.  That
18115         kills two problems: try/catch problems (we used to emit an empty
18116         nop at the end) and switch statements where all branches would
18117         return. 
18118
18119 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
18120
18121         * driver.cs: Add default assemblies (the equivalent to the
18122         Microsoft CSC.RSP file)
18123
18124         * cs-tokenizer.cs: When updating `cols and setting it to zero,
18125         also update tokens_seen and set it to false.
18126
18127         * driver.cs: Implement --recurse for Mike.
18128
18129         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18130         correctly splitting out the paths.
18131
18132 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18133
18134         * interface.cs (Interface.PopulateProperty): Instead of using
18135         `parent' as the declaration space for the set parameters, use
18136         `this' 
18137
18138         * support.cs (InternalParameters): InternalParameters constructor
18139         takes a DeclSpace instead of a TypeContainer.
18140
18141         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18142         types are being initialized, load the address of it before calling
18143         the function.  
18144
18145         (New): Provide a mechanism to disable the generation of local
18146         value type temporaries when the caller will be providing us with
18147         an address to store it.
18148
18149         (ArrayCreation.EmitDynamicInitializers): Use it.
18150
18151 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18152
18153         * expression.cs (Invocation.EmitArguments): Only probe for array
18154         property if there is more than one argument.  Sorry about that.
18155
18156         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18157         empty param arrays.
18158
18159         * class.cs (Method.LabelParameters): Fix incorrect code path that
18160         prevented the `ParamArrayAttribute' from being applied to the
18161         params attribute.
18162
18163 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18164
18165         * support.cs (ReflectionParameters): Correctly compute whether the
18166         last argument is a params array.  Fixes the problem with
18167         string.Split ('a')
18168
18169         * typemanager.cs: Make the assemblies array always be non-null
18170         (empty, but non-null)
18171
18172         * tree.cs (RecordDecl): New function that abstracts the recording
18173         of names.  This reports error 101, and provides a pointer to the
18174         previous declaration.  Fixes a crash in the compiler.
18175
18176         * cs-parser.jay (constructor_declaration): Update to new grammar,
18177         and provide a constructor_body that can be empty.
18178
18179 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18180
18181         * driver.cs: Add support for --resources.
18182
18183         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18184         Make all types for the various array helper methods be integer.
18185
18186         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18187         CheckState to ConvCast.
18188
18189         (ConvCast): Now it takes a `checked' state argument, to avoid
18190         depending on the emit context for the conversion, and just using
18191         the resolve time setting.
18192
18193         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18194         instead of Invocation.EmitArguments.  We do not emit the original
18195         arguments, instead we emit those which have been converted to
18196         unsigned int expressions.
18197
18198         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18199
18200         * codegen.cs: ditto.
18201
18202         * expression.cs (LocalVariableReference): Drop the use of the
18203         Store function that depended on the variable index.
18204
18205         * statement.cs (VariableInfo): Drop the `Idx' property from this
18206         class, as this is not taking into account the indexes for
18207         temporaries tat we generate during the execution, getting the
18208         indexes wrong.
18209
18210         * class.cs: First emit class initializers, then call the parent
18211         constructor. 
18212
18213         * expression.cs (Binary): Fix opcode emision.
18214         (UnaryMutator.EmitCode): Support checked code generation
18215
18216         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18217         matches for events for both the Static and Instance scans,
18218         pointing to the same element.   Fix that.
18219
18220 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18221
18222         * rootcontext.cs (ResolveTree): Always set the
18223         interface_resolve_order, because nested interfaces will be calling
18224         into us.
18225
18226         * class.cs (GetInterfaceOrClass): Track the same resolution
18227         process used by TypeManager.LookupType.  This fixes the nested
18228         type lookups in class declarations (separate path from
18229         LookupType). 
18230
18231         (TypeContainer.DefineType): Also define nested interfaces.
18232         (TypeContainer.RegisterOrder): New public function used to
18233         register the order in which child interfaces need to be closed.
18234
18235         Nested interfaces need to be closed after their parents have been
18236         created. 
18237
18238         * interface.cs (InterfaceAttr): Put all the logic for computing
18239         the interface attribute here. 
18240
18241         (DefineInterface): Register our interface order with the
18242         RootContext or with the TypeContainer depending on the case.
18243
18244 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18245
18246         * cs-parser.jay: rework foreach statement to work with the new
18247         changes to the policy on SimpleNames.
18248
18249         * report.cs: support Stacktrace on warnings as well.
18250
18251         * makefile: drop --unsafe and /unsafe from the compile.
18252
18253 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18254
18255         * ecore.cs (StandardConversionExists): Modify to take an Expression
18256         as the first parameter. Ensure we do null -> reference type conversion
18257         checking.
18258
18259         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18260         temporary Expression objects.
18261
18262 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18263
18264         * interface.cs: workaround bug in method overloading resolution
18265         (there is already a bugzilla bug for it).
18266
18267 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18268
18269         We could also solve this problem by having a separate path for
18270         performing type lookups, instead of DoResolve, we could have a
18271         ResolveType entry point, and only participating pieces of the
18272         production (simplename, deref, array) would implement this. 
18273
18274         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18275         signal SimpleName to only resolve type names and not attempt to
18276         resolve anything else.
18277
18278         * expression.cs (Cast): Set the flag.
18279
18280         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18281
18282         * class.cs: Only report 108 if there is no `new' modifier.
18283
18284         * cs-parser.jay: rework foreach statement to work with the new
18285         changes to the policy on SimpleNames.
18286
18287         * report.cs: support Stacktrace on warnings as well.
18288
18289         * makefile: drop --unsafe and /unsafe from the compile.
18290
18291 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18292
18293         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18294         lookups here, instead of doing that at parse time.  This means
18295         that our grammar will not introduce `LocalVariableReferences' as
18296         expressions at this point.  That solves the problem of code like
18297         this:
18298
18299         class X {
18300            static void Main ()
18301            { int X = 1;
18302             { X x = null }}}
18303
18304         This is only half the fix.  The full fix requires parameters to
18305         also be handled in this way.
18306
18307         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18308         makes the use more obvious of the DeclSpace.  The
18309         ec.TypeContainer.TypeBuilder is now only used to pull the
18310         TypeBuilder for it.
18311
18312         My theory is that I can get rid of the TypeBuilder completely from
18313         the EmitContext, and have typecasts where it is used (from
18314         DeclSpace to where it matters).  
18315
18316         The only pending problem is that the code that implements Aliases
18317         is on TypeContainer, and probably should go in DeclSpace.
18318
18319         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18320         lookups here, instead of doing that at parse time.  This means
18321         that our grammar will not introduce `LocalVariableReferences' as
18322         expressions at this point.  That solves the problem of code like
18323         this:
18324
18325         class X {
18326            static void Main ()
18327            { int X = 1;
18328             { X x = null }}}
18329
18330         This is only half the fix.  The full fix requires parameters to
18331         also be handled in this way.
18332
18333         * class.cs (Property.DefineMethod): When implementing an interface
18334         method, set newslot, when implementing an abstract method, do not
18335         set the flag (before we tried never setting it, or always setting
18336         it, which is the difference).
18337         (Indexer.DefineMethod): same.
18338         (Method.DefineMethod): same.
18339
18340         * ecore.cs: Only set the status used flag if we get back a Field.
18341
18342         * attribute.cs: Temporary hack, so Paolo can keep working.
18343
18344 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18345
18346         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18347         the unmanaged type in the case we have a MarshalAs attribute.
18348
18349         (Resolve): Handle the case when we are parsing the special MarshalAs
18350         attribute [we need to store the unmanaged type to use later]
18351
18352         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18353         MarshalAs Attribute.
18354
18355         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18356         on parameters and accordingly set the marshalling info.
18357
18358 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18359
18360         * class.cs: Optimizing slightly by removing redundant code after
18361         we switched to the `NoTypes' return value.
18362         (Property.DefineMethod): use NoTypes here too.
18363
18364         This fixes the bug I introduced in my last batch of changes.
18365
18366 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18367
18368         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18369
18370         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18371         Enums since those are types too. 
18372
18373         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18374
18375         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18376         thanks to a call during the lookup process.
18377
18378 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18379
18380         * statement.cs (Foreach): Lots of work to accomodate a particular
18381         kind of foreach statement that I had not kept in mind.  It is
18382         possible to have foreachs on classes that provide a GetEnumerator
18383         method that return objects that implement the "pattern" for using
18384         a foreach, there is no need to support GetEnumerator
18385         specifically. 
18386
18387         This is needed to compile nant.
18388
18389         * decl.cs: Only report 114 if the member is not `Finalize' and if
18390         the warning level is at least 2.
18391
18392         * class.cs: Moved the compare function from Method to
18393         MethodSignature. 
18394
18395         (MethodSignature.InheritableMemberSignatureCompare): Add new
18396         filter function that is used to extract inheritable methods from a
18397         class. 
18398
18399         (Method.Define): Use the new `inheritable_method_signature_filter'
18400         delegate
18401
18402         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18403         command. 
18404
18405 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18406
18407         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18408
18409         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18410
18411         * expression.cs: Pass location information to
18412         ConvertImplicitStandard. 
18413
18414         * class.cs: Added debugging code to track return values from
18415         interfaces. 
18416
18417 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18418
18419         * expression.cs (Is.DoResolve): If either side of the `is' is an
18420         interface, do not flag the warning.
18421
18422         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18423         for interfaces
18424
18425         * report.cs: Allow for --fatal to be used with --probe.
18426
18427         * typemanager.cs (NoTypes): Move the definition for the empty Type
18428         array here. 
18429
18430         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18431         properties. 
18432         (TypeContainer.DefineProxy): New function used to proxy to parent
18433         implementations when implementing interfaces.
18434         (TypeContainer.ParentImplements): used to lookup if our parent
18435         implements a public function that is required by an interface.
18436         (TypeContainer.VerifyPendingMethods): Hook this up.
18437
18438         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18439         `modules' and `assemblies' arraylists into arrays.  We only grow
18440         these are the very early start up of the program, so this improves
18441         the speedof LookupType (nicely measured).
18442
18443         * expression.cs (MakeByteBlob): Replaced unsafe code with
18444         BitConverter, as suggested by Paolo.
18445
18446         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18447         folding of string concatenation, but if either side is a string,
18448         and the other is not, then return null, and let the runtime use
18449         the concatenation on the string plus the object (using
18450         `Object.ToString'). 
18451
18452 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18453
18454         Constant Folding has been implemented now.
18455
18456         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18457         the error instead on types that are not supported in one's
18458         complement. 
18459
18460         * constant.cs (Constant and all children): New set of functions to
18461         perform implict and explicit conversions.
18462
18463         * ecore.cs (EnumConstant): Implement the new functions to perform
18464         conversion by proxying to the child expression.
18465
18466         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18467         own separate setting that can not be turned off from the command
18468         line using --unchecked or --checked and is only controlled using
18469         the checked/unchecked statements and expressions.  This setting is
18470         used by the constant folder to flag errors.
18471
18472         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18473         ConstantCheckState as well.   
18474
18475         During Resolve, they also have to flag the state, because the
18476         constant folder runs completely in the Resolve phase.
18477
18478         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18479         well.
18480
18481 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18482
18483         * cfold.cs: New file, this file contains the constant folder.
18484
18485         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18486         argument to track whether we are using the resulting address to
18487         load or store a value and provide better error messages. 
18488
18489         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18490         new AddressOf arguments.
18491
18492         * statement.cs (Foreach.EmitCollectionForeach): Update
18493
18494         * expression.cs (Argument.Emit): Call AddressOf with proper
18495         arguments to track usage.
18496
18497         (New.DoEmit): Call AddressOf with new arguments.
18498
18499         (Unary.Emit): Adjust AddressOf call.
18500
18501 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18502
18503         * cs-parser.jay (member_access): Change the case for pre-defined types
18504         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18505         this suggestion.
18506
18507         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18508         a method body.
18509
18510         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18511         essentially like methods and apply attributes like MethodImplOptions to them too.
18512
18513         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18514         not being null.
18515
18516         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18517         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18518         is the DeclSpace.
18519
18520         * Update code everywhere accordingly.
18521
18522         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18523
18524         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18525
18526 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18527
18528         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18529         try performing lookups against those instead of jumping straight into using
18530         the 'using' clauses.
18531
18532         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18533
18534         (LookupType): Perform lookups in implicit parents too.
18535
18536         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18537         sequence as RootContext.LookupType. 
18538
18539         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18540         the various cases of namespace lookups into this method.
18541
18542 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18543
18544         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18545         in positional arguments)
18546
18547         * class.cs (Operator): Update the AllowedModifiers to contain
18548         extern. 
18549
18550         * cs-parser.jay: Update operator declaration to allow for the
18551         operator body to be empty.
18552
18553         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18554         values. 
18555
18556 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18557
18558         * class.cs (Method.Emit): Label parameters.
18559
18560         * driver.cs: Return 1 or 0 as the program exit code.
18561
18562 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18563
18564         * expression.cs: Special case the `null' object when trying to
18565         auto-compute the type, as anything can be explicitly converted to
18566         that. 
18567
18568         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18569         spotting this Paolo.
18570
18571         (Expression.ImplicitNumericConversion): Perform comparissions of
18572         the type using the underlying type in the case of an enumeration
18573         rather than using the enumeration type for the compare.
18574
18575         Cope with the underlying == type case, which is not possible to
18576         catch before. 
18577
18578         (Expression.ConvertNumericExplicit): Perform comparissions of
18579         the type using the underlying type in the case of an enumeration
18580         rather than using the enumeration type for the compare.
18581
18582         * driver.cs: If the user does not supply an extension, assume .exe
18583
18584         * cs-parser.jay (if_statement): Rewrote so that we can track the
18585         location for the if statement.
18586
18587         * expression.cs (Binary.ConstantFold): Only concat strings when
18588         the operation is "+", not everything ;-)
18589
18590         * statement.cs (Statement.EmitBoolExpression): Take a location
18591         argument. 
18592         (If, While, Do): Track location.
18593
18594         * expression.cs (Binary.ResolveOperator): In the object + string
18595         case, I was missing a call to ConvertImplicit
18596
18597 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18598
18599         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18600         Location arguments. Ensure we use RootContext.LookupType to do our work
18601         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18602
18603         * interface.cs (PopulateMethod): Handle the type of the parameter being
18604         null gracefully.
18605
18606         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18607         have a params method with no fixed arguments and a call is made with no
18608         arguments.
18609
18610 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18611
18612         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18613         the verbatim-string-literal
18614
18615         * support.cs (InternalParameters.ParameterModifier): handle null
18616         fixed parameters.
18617         (InternalParameters.ParameterType): ditto.
18618
18619         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18620         duplicating the name of the variable parameter.
18621         (GetParameterByName): Fix bug where we were not looking up array
18622         paramters if they were the only present (thanks Paolo!).
18623         (GetParameterInfo): We only have an empty set of types if both
18624         fixed and array are set to null.
18625         (GetParameterInfo-idx): Handle FixedParameter == null
18626
18627         * cs-parser.jay: Handle the case where there is no catch
18628         statements (missing null test).
18629
18630 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18631
18632         * driver.cs (MainDriver): Be conservative on our command line
18633         handling.
18634
18635         Catch DirectoryNotFoundException when calling GetFiles.
18636
18637         (SplitPathAndPattern): Used to split the input specification into
18638         a path and a pattern that we can feed to Directory.GetFiles.
18639
18640 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18641
18642         * statement.cs (Fixed): Implement the last case of the Fixed
18643         statement (string handling).
18644
18645         * expression.cs (StringPtr): New class used to return a char * to
18646         a string;  Used by the Fixed statement.
18647
18648         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18649
18650         * expression.cs (Binary.ResolveOperator): Remove redundant
18651         MemberLookup pn parent type.
18652         Optimize union call, we do not need a union if the types are the same.
18653         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18654         type.
18655
18656         Specialize the use of MemberLookup everywhere, instead of using
18657         the default settings. 
18658
18659         (StackAlloc): Implement stackalloc keyword.
18660
18661         * cs-parser.jay: Add rule to parse stackalloc.
18662
18663         * driver.cs: Handle /h, /help, /?
18664
18665         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18666         before we supported unsafe code.
18667
18668         * makefile: add --unsafe to the self compilation of mcs.
18669
18670 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18671
18672         * expression.cs (PointerArithmetic): New class that is used to
18673         perform pointer arithmetic.
18674         (Binary.Resolve): Handle pointer arithmetic
18675         Handle pointer comparission.
18676         (ArrayPtr): Utility expression class that is used to take the
18677         address of an array.
18678
18679         (ElementAccess): Implement array access for pointers
18680
18681         * statement.cs (Fixed): Implement fixed statement for arrays, we
18682         are missing one more case before we are done.
18683
18684         * expression.cs (Indirection): Implement EmitAssign and set the
18685         ExprClass to Variable.  This allows pointer dereferences to be
18686         treated as variables, and to have values assigned to them.
18687
18688         * ecore.cs (Expression.StoreFromPtr): New utility function to
18689         store values dereferencing.
18690
18691 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18692
18693         * expression.cs (Binary.ResolveOperator): Ensure that we are
18694         not trying to operate on a void type - this fixes the reported
18695         bug.
18696
18697         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18698         the parent implementation is sealed.
18699
18700         * ../errors/cs0239.cs : Add.
18701
18702         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18703
18704         * typemanager.cs (unverifiable_code_type): Corresponds to 
18705         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18706         which have unsafe code in them.
18707
18708         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18709         unsafe context.
18710
18711 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18712
18713         * cs-tokenizer.cs: Add support for @"litreal strings"
18714
18715         Make tokenizer accept pre-processor directives
18716         on any column (remove the old C-like limitation). 
18717
18718         * rootcontext.cs (EmitCode): Emit any global attributes.
18719         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18720
18721         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18722
18723         * cs-parser.jay: Add support for global attributes.  
18724
18725 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18726
18727         * expression.cs (Indirection): New helper class.  Unary will
18728         create Indirection classes to be able to implement the
18729         IMemoryLocation interface on it.
18730
18731 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18732
18733         * cs-parser.jay (fixed_statement): reference the right statement.
18734
18735         * statement.cs (Fixed.Emit): Finish implementing the fixed
18736         statement for the &x case.
18737
18738 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18739
18740         * class.cs (Property.Define, Method.Define): Remove newslot when
18741         `implementing'.  
18742
18743         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18744         wrong.  NewSlot should only be used if the `new' keyword is present.
18745
18746         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18747         locating our system dir.  Sorry about this.
18748
18749 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18750
18751         * driver.cs (GetSystemDir): Compute correctly the location of our
18752         system assemblies.  I was using the compiler directory instead of
18753         the library directory.
18754
18755 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18756
18757         * expression.cs (BetterFunction): Put back in what Miguel commented out
18758         since it is the correct fix. The problem is elsewhere ;-)
18759
18760         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18761         parameters of the parms method are themselves compatible or not !
18762
18763         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18764         to check that a class implements an interface before saying that an implicit
18765         conversion was allowed. Use ImplementsInterface to do the checking.
18766
18767 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18768
18769         * class.cs (Method.Define): Track whether we are an explicit
18770         implementation or not.  And only call DefineMethodOverride if we
18771         are an explicit implementation.
18772
18773         (Property.DefineMethod): Ditto.
18774
18775 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18776
18777         * expression.cs (BetterFunction): Catch hideous bug which was
18778          preventing us from detecting ambiguous calls due to implicit casts i.e
18779         cs0121.
18780
18781 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18782
18783         * support.cs (Pair): Remove un-needed method.  I figured why I was
18784         getting the error in cs-parser.jay, the variable in a foreach loop
18785         is readonly, and the compiler does not really treat this as a variable.
18786
18787         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18788         instead of EQUALS in grammar.  
18789
18790         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18791
18792         * expression.cs (Unary.DoResolve): Check whether the argument is
18793         managed or not.
18794
18795 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18796
18797         * support.cs: Api for Pair to set a value.  Despite the fact that
18798         the variables are public the MS C# compiler refuses to compile
18799         code that accesses the field if the variable is part of a foreach
18800         statement. 
18801
18802         * statement.cs (Fixed): Begin implementation of the fixed
18803         statement.
18804
18805         (Block.AddVariable): Return the VariableInfo on success and null
18806         on failure instead of true/false. 
18807
18808         * cs-parser.jay (foreach): Catch errors on variables already
18809         defined (we were ignoring this value before) and properly unwind
18810         the block hierarchy
18811
18812         (fixed_statement): grammar for the fixed statement.
18813
18814 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18815
18816         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18817         pointer types to be incretemented.
18818
18819         (SizeOf): Implement.
18820
18821         * cs-parser.jay (pointer_member_access): Implement
18822         expr->IDENTIFIER production.
18823
18824         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18825         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18826         on safe contexts.
18827
18828         (Unary): Implement indirection.
18829
18830         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18831         use in non-unsafe context).
18832
18833         (SimpleName.DoResolve): Check for pointers in field access on safe
18834         contexts. 
18835
18836         (Expression.LoadFromPtr): Factor the load-indirect code in this
18837         function.  This was duplicated in UnboxCast and ParameterReference
18838
18839 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18840
18841         * expression.cs (ComposedCast): report an error if a pointer cast
18842         is used in a safe region.
18843
18844         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18845         pointer type casts in unsafe context.
18846
18847         * codegen.cs (EmitContext): Set up IsUnsafe.
18848
18849         * cs-parser.jay (non_expression_type): Add productions for pointer
18850         casts. 
18851
18852         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18853         code.  We should not use force into static mode if the method is
18854         not virtual.  Fixes bug in MIS
18855
18856         * statement.cs (Do.Emit, While.Emit, For.Emit,
18857         Statement.EmitBoolExpression): Add support to Do and While to
18858         propagate infinite loop as `I do return' semantics.
18859
18860         Improve the For case to also test for boolean constants.
18861
18862         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18863         to the list of attributes we can add.
18864
18865         Remove `EmitContext' argument.
18866
18867         * class.cs (Method.Define): Apply parameter attributes.
18868         (Constructor.Define): Apply parameter attributes.
18869         (MethodCore.LabelParameters): Move here the core of labeling
18870         parameters. 
18871
18872         * support.cs (ReflectionParameters.ParameterModifier,
18873         InternalParameters.ParameterModifier): Use IsByRef on the type and
18874         only return the OUT bit for these parameters instead of in/out/ref
18875         flags.
18876
18877         This is because I miss-understood things.  The ParameterInfo.IsIn
18878         and IsOut represent whether the parameter has the [In] and [Out]
18879         attributes set.  
18880
18881 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18882
18883         * ecore.cs (FieldExpr.Emit): Release temporaries.
18884
18885         * assign.cs (LocalTemporary.Release): new function.
18886
18887         * codegen.cs (EmitContext.GetTemporaryStorage,
18888         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18889         temporary storage.  Now we can "put back" localbuilders when we
18890         are done with them
18891
18892 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18893
18894         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18895         need to make a copy of the variable to generate verifiable code.
18896
18897 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18898
18899         * driver.cs: Compute dynamically the system directory.
18900
18901         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18902         Slower, but more generally useful.  Used by the abstract
18903         registering implementation. 
18904
18905         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18906         the rules for the special rule on Type/instances.  First check if
18907         we have the same name, and if so, try that special static path
18908         rather than the instance path.
18909
18910 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18911
18912         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18913         for, while and if.
18914
18915         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18916         Enum, ValueType, Delegate or Array for non-corlib compiles.
18917
18918         * cs-tokenizer.cs: Catch long identifiers (645)
18919
18920         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18921         piece of code.
18922
18923         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18924         fix, we were returning too early, so we were not registering
18925         pending methods from abstract classes.
18926
18927         Do not register pending methods if the class is abstract.
18928
18929         * expression.cs (Conditional.DoResolve): Report circular implicit
18930         conversions when we neecd to compute it for conditional
18931         expressions. 
18932
18933         (Is.DoResolve): If the expression is always of the provided type,
18934         flag warning 183.  If the expression can not ever be of the
18935         provided type flag warning 184.
18936
18937         * class.cs: Catch 169 as well.
18938
18939         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18940         read. 
18941
18942 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18943
18944         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18945
18946 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18947
18948         * interface.cs: (PopulateMethod): Check for pointers being defined
18949         only if the unsafe context is active.
18950         (PopulateProperty): ditto.
18951         (PopulateIndexer): ditto.
18952
18953         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18954         specified.  If pointers are present, make sure that they are
18955         present in an unsafe context.
18956         (Constructor, Constructor.Define): ditto.
18957         (Field, Field.Define): ditto.
18958         (Property, Property.Define): ditto.
18959         (Event, Event.Define): ditto.
18960
18961         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18962         hashtable if there are classes or structs defined.
18963
18964         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18965         code, as the constant resolution moved.
18966
18967         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18968         the metadata, so we can flag error 133. 
18969
18970         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18971         pointer is being declared in an unsafe context.
18972
18973 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18974
18975         * modifiers.cs (Modifiers.Check): Require a Location argument.
18976         Report error 227 for Unsafe use.
18977
18978         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18979
18980         * statement.cs (For.Emit): If the test is null, then report that
18981         we do `return', as we wont reach anything afterwards.
18982
18983         (Switch.SwitchGoverningType): Track the expression that matched
18984         the conversion.
18985
18986         * driver.cs: Allow negative numbers as an error code to flag.
18987
18988         * cs-parser.jay: Handle 1551.
18989
18990         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18991
18992 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18993
18994         * cs-parser.jay: Report 1518 (type declaration can only contain
18995         class, struct, interface, enum or delegate)
18996
18997         (switch_label): Report 1523 (keywords `case' or `default' must
18998         preced code)
18999
19000         (opt_switch_sections): Report 1522 (empty switch)
19001
19002         * driver.cs: Report 1515 (response file specified multiple times)
19003         Report 1516 (Source file specified multiple times).
19004
19005         * expression.cs (Argument.Resolve): Signal 1510
19006
19007         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19008         access not allowed in static code)
19009
19010 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19011
19012         * typemanager.cs (IsPointerType): Utility method which we are going
19013         to need a lot.
19014
19015         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19016         the object type, so we take care of that.
19017
19018         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19019
19020         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19021         added to non-params parameters :-)
19022
19023         * typemanager.cs (CSharpName): Include 'void' type too. 
19024
19025         (void_ptr_type): Include in the set of core types.
19026
19027         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19028         duplicating code.
19029
19030         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19031         an unsafe context.
19032
19033         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19034         completely forgotten about it.
19035
19036 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19037
19038         * cs-parser.jay (pointer_type): Add. This begins our implementation
19039         of parsing rules for unsafe code.
19040
19041         (unsafe_statement): Implement.
19042
19043         (embedded_statement): Modify to include the above.
19044
19045         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19046
19047         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19048         if the current context is an unsafe one.
19049
19050         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19051         are handled differently, we need separate rules for them.
19052
19053         (local_variable_declaration): Update to use local_variable_pointer_type
19054         to allow variable declarations of unmanaged pointer types.
19055
19056         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19057         in unsafe contexts.
19058
19059         * ../errors/cs0214.cs : Add.
19060
19061 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19062
19063         * makefile: remove 'response' file when cleaning.
19064
19065 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19066
19067         * cs-parser.jay: Report 1524.
19068
19069 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19070
19071         * typemanager.cs (RegisterMethod): drop checking if we have
19072         registered this from here
19073
19074 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19075
19076         * class.cs (Method.EmitDestructor): Implement calling our base
19077         destructor. 
19078
19079         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19080         value of InFinally.
19081
19082         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19083         this routine and will wrap the call in a try/catch block.  Deal
19084         with the case.
19085
19086 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
19087
19088         * ecore.cs (Expression.MemberLookup): instead of taking a
19089         parameter `same_type' that was used to tell whether we could
19090         access private members we compute our containing type from the
19091         EmitContext.
19092
19093         (FieldExpr): Added partial support for volatile fields.  This does
19094         not work for volatile fields exposed from assemblies, as I can not
19095         figure out how to extract the modreq from it.
19096
19097         Updated all the source files to use this.
19098
19099         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19100         because it is referenced by MemberLookup very often. 
19101
19102 2002-01-09  Ravi Pratap  <ravi@ximian.com>
19103
19104         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19105         TypeBuilder.GetCustomAttributes to retrieve what we need.
19106
19107         Get rid of redundant default_member_attr_type as this is the same as
19108         default_member_type which already exists.
19109
19110         * interface.cs, attribute.cs : Update accordingly.
19111
19112 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
19113
19114         * typemanager.cs: Enable IndexerPropertyName again.  It does not
19115         work for TYpeBuilders though.  Ravi, can you please fix this?
19116
19117         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19118
19119         * expression.cs (Argument.Emit): Handle the case of ref objects
19120         being passed to ref functions;  
19121
19122         (ParameterReference.EmitLoad): Loads the content of the pointer
19123         without dereferencing.
19124
19125 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19126
19127         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19128
19129 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19130
19131         * class.cs (Indexer.DefineMethod): Incorporate the interface
19132         type in the name of the method if we are doing explicit interface
19133         implementation.
19134
19135         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19136
19137         (BetterConversion): Fix extremely trivial bug where we were referring to
19138         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19139         again !
19140
19141         * ../errors/bug16.cs : Add although we have fixed it.
19142
19143 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19144
19145         * expression.cs (BaseIndexer): Begin implementation.
19146
19147         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19148
19149         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19150         production directly to remove a shift/reduce, and implement
19151         explicit interface implementation.
19152
19153         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19154         after a floating point suffix.
19155
19156         * expression.cs (DoNumericPromotions): Improved the conversion for
19157         uint/uint.  If we have a constant, we avoid doing a typecast to a
19158         larger type.
19159
19160         * class.cs (Indexer): Implement explicit interface implementation
19161         for indexers.
19162
19163 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19164
19165         * class.cs: make the default instance constructor public and hidebysig.
19166
19167 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19168
19169         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19170         so we can call it from elsewhere.
19171
19172         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19173         we emit it internally if the class has a defined indexer; otherwise the user
19174         emits it by decorating the class definition with the DefaultMemberAttribute.
19175
19176         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19177         attribute is not used on a type which defines an indexer.
19178
19179         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19180         character when we skip whitespace.
19181
19182         * ../errors/cs0646.cs : Add.
19183
19184 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19185
19186         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19187         again. 
19188
19189         * makefile: Add practical target `mcs3.exe' which builds the third
19190         generation compiler. 
19191
19192         * expression.cs (New): Fix structures constructor calling.
19193
19194         * class.cs (Property, Method, Indexer): Emit Final flag on the
19195         method if we are an interface implementation and we are not
19196         abstract. 
19197
19198         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19199         whether this property is referencing a `base' method.
19200
19201         * expression.cs (Invocation.EmitCall): take an extra argument:
19202         is_base, this is used to determine whether the `call' or
19203         `callvirt' opcode should be used.
19204
19205
19206         * delegate.cs: update EmitCall.
19207
19208         * class.cs (Method.Define): Set NewSlot for the cases where we are
19209         not implementing an interface method.
19210
19211         (Property.Define): ditto.
19212
19213 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19214
19215         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19216         'r'.  Allows mcs to parse itself fully.
19217
19218 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19219
19220         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19221         of the number of initializers that require the InitializeArray method.
19222
19223         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19224         update the above field where necessary.
19225
19226         (MakeByteBlob): Update accordingly.
19227
19228         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19229         greater than 2.
19230
19231         (EmitDynamicInitializers): Update in accordance with the new optimization.
19232
19233         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19234         same OpCode applies.
19235
19236         * cs-parser.jay : Fix some glaring errors I introduced.
19237
19238 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19239
19240         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19241         so that we can check for name clashes there too.
19242
19243         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19244         for interface indexers.
19245
19246         * interfaces.cs (Define): Emit the default member attribute.
19247
19248         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19249         variable was being referred to while setting the value ;-)
19250
19251 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19252
19253         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19254         byte-by-byte information when we know the data is zero.
19255
19256         Make the block always a multiple of 4, because
19257         DefineInitializedData has a bug.
19258
19259         * assign.cs: Fix, we should assign from the temporary, not from
19260         the source. 
19261
19262         * expression.cs (MakeByteBlob): Fix my incorrect code.
19263
19264 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19265
19266         * typemanager.cs (EnumToUnderlying): This function is used to get
19267         the underlying type from an enumeration, because it does not
19268         always work. 
19269
19270         * constant.cs: Use the I4_S form for values between -128 and 127.
19271
19272         * statement.cs (Block.LookupLabel): Looks up a label.
19273         (Block): Drop support for labeled blocks.
19274
19275         (LabeledStatement): New kind of statement that represents a label
19276         only.
19277
19278         (Goto): Finally implement this bad boy.
19279
19280         * cs-parser.jay: Update to reflect new mechanism to implement
19281         labels.
19282
19283 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19284
19285         * codegen.cs (EmitContext.This): a codegen property that keeps the
19286         a single instance of this instead of creating many different this
19287         instances. 
19288
19289         * delegate.cs (Delegate.DoResolve): Update to use the property;
19290
19291         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19292
19293         * expression.cs (BaseAccess.DoResolve): Ditto.
19294
19295 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19296
19297         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19298         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19299
19300         (InitCoreTypes): Update accordingly.
19301
19302         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19303         so we can quickly store the state.
19304
19305         (ApplyAttributes): Set the correct implementation flags
19306         for InternalCall methods.
19307
19308 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19309
19310         * expression.cs (EmitCall): if a method is not virtual, then do
19311         not use callvirt on it.
19312
19313         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19314         user defined stuff) requires the use of stobj, which takes an
19315         address on the stack instead of an array and an index.  So emit
19316         the Ldelema operation for it.
19317
19318         (EmitStoreOpcode): Use stobj for valuetypes.
19319
19320         (UnaryMutator.EmitCode): Use the right 1 value depending on
19321         whether we are dealing with int64/uint64, float or doubles.
19322
19323         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19324         constructors that I implemented last night.
19325
19326         (Constructor.IsDefault): Fix to work properly for static
19327         constructors.
19328
19329         * cs-parser.jay (CheckDef): report method signature errors.
19330         Update error number 103 to be 132.
19331
19332         * decl.cs: New AdditionResult enumeration value: MethodExists.
19333         Although we do this check for methods later on in the semantic
19334         analysis, catching repeated default constructors is so easy that
19335         we catch these here. 
19336
19337         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19338         promotions code.
19339
19340         (ParameterReference.EmitAssign, Emit): handle
19341         bools as bytes.
19342
19343         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19344         (ArrayAccess.EmitStoreOpcode): ditto.
19345
19346         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19347
19348         * expression.cs (MakeByteBlob): Complete all the missing types
19349         (uint, short, ushort, byte, sbyte)
19350
19351         * class.cs: Only init instance field initializers on instance
19352         constructors. 
19353
19354         Rename `constructors' to instance_constructors. 
19355
19356         (TypeContainer.AddConstructor): Only add constructors to the list
19357         if it is not static.
19358
19359         Make sure that we handle default_static_constructor independently
19360         everywhere where we handle instance_constructors
19361
19362 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19363
19364         * class.cs: Do not lookup or create a base initializer for a
19365         static constructor.
19366
19367         (ConstructorInitializer.Resolve): use the proper type to lookup
19368         for constructors.
19369
19370         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19371
19372         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19373         in DeclSpace. 
19374
19375         * decl.cs: CloseType is now an virtual method, the default
19376         implementation just closes this type.
19377
19378 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19379
19380         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19381         to PreserveSig by default. Also emit HideBySig on such methods.
19382
19383         Basically, set the defaults to standard values.
19384
19385         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19386         argument, if candidate is better, it can't be worse than the best !
19387
19388         (Invocation): Re-write bits to differentiate between methods being
19389         applicable in their expanded form and their normal form - for params
19390         methods of course.
19391
19392         Get rid of use_standard everywhere as only standard conversions are allowed
19393         in overload resolution. 
19394
19395         More spec conformance.
19396
19397 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19398
19399         * driver.cs: Add --timestamp, to see where the compiler spends
19400         most of its time.
19401
19402         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19403         `this' in static code.
19404
19405         (SimpleName.DoResolve): Implement in terms of a helper function
19406         that allows static-references to be passed upstream to
19407         MemberAccess.
19408
19409         (Expression.ResolveWithSimpleName): Resolve specially simple
19410         names when called by MemberAccess to implement the special
19411         semantics. 
19412
19413         (Expression.ImplicitReferenceConversion): Handle conversions from
19414         Null to reference types before others, as Null's type is
19415         System.Object. 
19416
19417         * expression.cs (Invocation.EmitCall): Handle the special case of
19418         calling methods declared on a reference type from a ValueType
19419         (Base classes System.Object and System.Enum)
19420
19421         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19422         the left hand side is a TypeExpr, not on every enumeration. 
19423
19424         (Binary.Resolve): If types are reference types, then do a cast to
19425         object on operators != and == of both arguments.
19426
19427         * typemanager.cs (FindMembers): Extract instance and static
19428         members if requested.
19429
19430         * interface.cs (PopulateProperty): Use void_type instead of null
19431         as the return type for the setter method.
19432
19433         (PopulateIndexer): ditto.
19434
19435 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19436
19437         * support.cs (ReflectionParameters): Fix minor bug where we
19438         were examining the wrong parameter for the ParamArray attribute.
19439
19440         Cope with requests for the type of the parameter at position
19441         greater than the params parameter's. We now return the element
19442         type of the params array as that makes more sense.
19443
19444         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19445         accordingly as we no longer have to extract the element type
19446         ourselves.
19447
19448         (Invocation.OverloadResolve): Update.
19449
19450 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19451
19452         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19453         against IEnumerator, test whether the return value is a descendant
19454         of the IEnumerator interface.
19455
19456         * class.cs (Indexer.Define): Use an auxiliary method to implement
19457         the other bits of the method definition.  Begin support for
19458         explicit interface implementation.
19459
19460         (Property.DefineMethod): Use TypeManager.void_type instead of null
19461         for an empty return value.
19462
19463 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19464
19465         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19466         dealing with a FieldExpr which is composed of a FieldBuilder, in
19467         the code path we did extract the constant, but we should have
19468         obtained the underlying value to be able to cast it (otherwise we
19469         end up in an infinite loop, this is what Ravi was running into).
19470
19471         (ArrayCreation.UpdateIndices): Arrays might be empty.
19472
19473         (MemberAccess.ResolveMemberAccess): Add support for section
19474         14.5.4.1 that deals with the special case of E.I when E is a type
19475         and something else, that I can be a reference to a static member.
19476
19477         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19478         handle a particular array type to create byte blobs, it is just
19479         something we dont generate byteblobs for.
19480
19481         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19482         arguments. 
19483
19484         * location.cs (Push): remove the key from the hashtable that we
19485         are about to add.   This happens for empty files.
19486
19487         * driver.cs: Dispose files after we have parsed them.
19488
19489         (tokenize): new function that only runs the tokenizer on its
19490         input, for speed testing.
19491
19492 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19493
19494         * class.cs (Event.Define): Define the private field only if there
19495         are no accessors defined.
19496
19497         * expression.cs (ResolveMemberAccess): If there is no associated
19498         field with the event, that means we have an event defined with its
19499         own accessors and we should flag error cs0070 since transforming
19500         ourselves into a field is not valid in that case.
19501
19502         * ecore.cs (SimpleName.DoResolve): Same as above.
19503
19504         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19505         and charset to sane values.
19506
19507 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19508
19509         * assign.cs (DoResolve): Perform check on events only if they 
19510         are being accessed outside the declaring type.
19511
19512         * cs-parser.jay (event_declarations): Update rules to correctly
19513         set the type of the implicit parameter etc.
19514
19515         (add_accessor, remove_accessor): Set current local parameters.
19516
19517         * expression.cs (Binary): For delegate addition and subtraction,
19518         cast the return value from the method into the appropriate delegate
19519         type.
19520
19521 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19522
19523         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19524         of these as the workaround is unnecessary.
19525
19526         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19527         delegate data - none of that is needed at all.
19528
19529         Re-write bits to extract the instance expression and the delegate method
19530         correctly.
19531
19532         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19533         on delegates too.
19534
19535         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19536         of attaching attributes instead of duplicating code everywhere.
19537
19538         * everywhere : Update code to do attribute emission using the above method.
19539
19540 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19541
19542         * expression.cs (IsParamsMethodApplicable): if there are not
19543         parameters, return immediately.
19544
19545         * ecore.cs: The 0 literal can be implicity converted to an enum
19546         type. 
19547
19548         (SimpleName.DoResolve): First lookup the type, then lookup the
19549         members. 
19550
19551         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19552         want to get its address.  If the InstanceExpression is not
19553         addressable, store the result in a temporary variable, then get
19554         the address of it.
19555
19556         * codegen.cs: Only display 219 errors on warning level or above. 
19557
19558         * expression.cs (ArrayAccess): Make it implement the
19559         IMemoryLocation interface.
19560
19561         (Binary.DoResolve): handle the operator == (object a, object b)
19562         and operator != (object a, object b) without incurring into a
19563         BoxedCast (because 5 != o should never be performed).
19564
19565         Handle binary enumerator operators.
19566
19567         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19568         value type, otherwise use Ldelem_ref.
19569
19570         Use precomputed names;
19571
19572         (AddressOf): Implement address of
19573
19574         * cs-parser.jay (labeled_statement): Fix recursive block
19575         addition by reworking the production.
19576
19577         * expression.cs (New.DoEmit): New has a special case:
19578                 
19579                  If we are dealing with a ValueType, we have a few
19580                  situations to deal with:
19581                 
19582                     * The target of New is a ValueType variable, that is
19583                       easy, we just pass this as the variable reference
19584                 
19585                     * The target of New is being passed as an argument,
19586                       to a boxing operation or a function that takes a
19587                       ValueType.
19588                 
19589                       In this case, we need to create a temporary variable
19590                       that is the argument of New.
19591
19592
19593 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19594
19595         * rootcontext.cs (LookupType): Check that current_type is not null before
19596         going about looking at nested types.
19597
19598         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19599         not implement the IAssignMethod interface any more.
19600
19601         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19602         where we tranform them into FieldExprs if they are being resolved from within
19603         the declaring type.
19604
19605         * ecore.cs (SimpleName.DoResolve): Do the same here.
19606
19607         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19608
19609         * ../errors/bug10.cs : Add.
19610
19611         * ../errors/cs0070.cs : Add.
19612
19613         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19614
19615         * assign.cs : Get rid of EventIsLocal everywhere.
19616
19617 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19618
19619         * ecore.cs (ConvertIntLiteral): finished the implementation.
19620
19621         * statement.cs (SwitchLabel): Convert the value we are using as a
19622         key before looking up the table.
19623
19624 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19625
19626         * codegen.cs (EmitTopBlock): Require a Location argument now.
19627
19628         * cs-parser.jay (constructor_declarator): We need to setup
19629         current_local_parameters before we parse the
19630         opt_constructor_initializer, to allow the variables to be bound
19631         to the constructor arguments.
19632
19633         * rootcontext.cs (LookupType): First lookup nested classes in our
19634         class and our parents before we go looking outside our class.
19635
19636         * expression.cs (ConstantFold): Extract/debox the values at the
19637         beginnning. 
19638
19639         * rootcontext.cs (EmitCode): Resolve the constants first before we
19640         resolve the types.  This is not really needed, but it helps debugging.
19641
19642         * statement.cs: report location.
19643
19644         * cs-parser.jay: pass location to throw statement.
19645
19646         * driver.cs: Small bug fix.
19647
19648         * report.cs: Updated format to be 4-zero filled digits.
19649
19650 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19651
19652         * expression.cs (CheckIndices): Fix minor bug where the wrong
19653         variable was being referred to ;-)
19654
19655         (DoEmit): Do not call EmitStaticInitializers when the 
19656         underlying type is System.Object.
19657
19658 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19659
19660         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19661         and do the usual workaround for SRE.
19662
19663         * class.cs (MyEventBuilder.EventType): New member to get at the type
19664         of the event, quickly.
19665
19666         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19667
19668         * assign.cs (Assign.DoResolve): Handle the case when the target
19669         is an EventExpr and perform the necessary checks.
19670
19671         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19672         interface.
19673
19674         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19675
19676         (EventExpr): Set the type in the constructor itself since we 
19677         are meant to be born fully resolved.
19678
19679         (EventExpr.Define): Revert code I wrote earlier.
19680                 
19681         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19682         instance expression is null. The instance expression is a This in that case
19683         or a null, depending on whether it is a static method or not.
19684
19685         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19686         refers to more than one method.
19687
19688         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19689         and accordingly flag errors.
19690
19691 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19692
19693         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19694
19695 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19696
19697         * location.cs (ToString): Provide useful rutine.
19698
19699 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19700
19701         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19702         objects, return the actual integral boxed.
19703
19704         * statement.cs (SwitchLabel): define an ILLabel for each
19705         SwitchLabel. 
19706
19707         (Switch.CheckSwitch): If the value is a Literal, extract
19708         the underlying literal.
19709
19710         Also in the unused hashtable we had, add the SwitchLabel so we can
19711         quickly look this value up.
19712
19713         * constant.cs: Implement a bunch of new constants.  Rewrite
19714         Literal based on this.  Made changes everywhere to adapt to this.
19715
19716         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19717         dereferencing array only once, and also copes with enumrations.
19718
19719         bytes are two bytes wide, not one.
19720
19721         (Cast): Perform constant conversions.
19722
19723         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19724         wrappers to the literals here.
19725
19726         * expression.cs (DoNumericPromotions): long literals can converted
19727         to ulong implicity (this is taken care of elsewhere, but I was
19728         missing this spot).
19729
19730         * ecore.cs (Expression.Literalize): Make the return type Literal,
19731         to improve type checking.
19732
19733         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19734
19735 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19736
19737         * literal.cs: Revert code from ravi that checked the bounds.  The
19738         bounds are sane by the definition of the type itself. 
19739
19740         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19741         need to actually look up in our parent hierarchy for interfaces
19742         implemented. 
19743
19744         * const.cs: Use the underlying type for enumerations
19745
19746         * delegate.cs: Compute the basename for the delegate creation,
19747         that should fix the delegate test case, and restore the correct
19748         Type Lookup semantics in rootcontext
19749
19750         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19751         referencing a nested type with the Reflection API is using the "+"
19752         sign. 
19753
19754         * cs-parser.jay: Do not require EOF token at the end.
19755
19756 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19757
19758         * rootcontext.cs (LookupType): Concatenate type names with
19759         a '.' instead of a '+' The test suite passes again.
19760
19761         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19762         field of the enumeration.
19763
19764         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19765         the case when the member is an EventExpr.
19766
19767         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19768         static has an associated instance expression.
19769
19770         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19771
19772         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19773
19774         * class.cs (Event.Define): Register event and perform appropriate checks
19775         for error #111.
19776
19777         We define the Add and Remove methods even if the use provides none because
19778         in that case, we provide default implementations ourselves.
19779
19780         Define a private field of the type of the event. This is done by the CSC compiler
19781         and we should be doing it too ;-)
19782
19783         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19784         More methods we use in code we generate.
19785
19786         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19787         is important.
19788
19789         (InitCoreTypes): Update accordingly for the above.
19790
19791         * class.cs (Event.Emit): Generate code for default accessors that we provide
19792
19793         (EmitDefaultMethod): Do the job in the above.
19794
19795         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19796         appropriate place.
19797
19798 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19799
19800         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19801         builders even if we were missing one.
19802
19803         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19804         pass the Basename as our class name instead of the Name.  The
19805         basename will be correctly composed for us.
19806
19807         * parameter.cs (Paramters): Now takes a Location argument.
19808
19809         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19810         make all the code call directly LookupType in RootContext and take
19811         this chance to pass the Location information everywhere.
19812
19813         * Everywhere: pass Location information.
19814
19815 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19816
19817         * class.cs (Constructor.Define): Updated way of detecting the
19818         length of the parameters.
19819
19820         (TypeContainer.DefineType): Use basename as the type name for
19821         nested types.
19822
19823         (TypeContainer.Define): Do not recursively define types here, as
19824         definition is taken care in order by the RootContext.
19825
19826         * tree.cs: Keep track of namespaces in a per-file basis.
19827
19828         * parameter.cs (Parameter.ComputeSignature): Update to use
19829         DeclSpace. 
19830
19831         (Parameters.GetSignature): ditto.
19832
19833         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19834         instead of a TypeContainer.
19835
19836         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19837         resolve names.  Because we need to be resolve in our context, not
19838         our parents.
19839
19840         * driver.cs: Implement response files.
19841
19842         * class.cs (TypeContainer.DefineType): If we are defined, do not
19843         redefine ourselves.
19844
19845         (Event.Emit): Emit the code for add/remove handlers.
19846         (Event.Define): Save the MethodBuilders for add/remove.
19847
19848         * typemanager.cs: Use pair here too.
19849
19850         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19851         DictionaryEntry requires the first argument to be non-null.  
19852
19853         (enum_declaration): Compute full name for registering the
19854         enumeration.
19855
19856         (delegate_declaration): Instead of using
19857         formal_parameter_list, use opt_formal_parameter_list as the list
19858         can be empty.
19859
19860         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19861         (EventParsing): New property that controls whether `add' and
19862         `remove' are returned as tokens or identifiers (for events);
19863
19864 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19865
19866         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19867         use MyEventBuilder only and let it wrap the real builder for us.
19868
19869         (MyEventBuilder): Revamp constructor etc.
19870
19871         Implement all operations that we perform on EventBuilder in precisely the same
19872         way here too.
19873
19874         (FindMembers): Update to use the EventBuilder member.
19875
19876         (Event.Emit): Update accordingly.
19877
19878 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19879
19880         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19881         by calling the appropriate methods.
19882
19883         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19884         useful.
19885
19886         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19887
19888 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19889
19890         * delegate.cs (Delegate.Populate): Check that the return type
19891         and various parameters types are indeed accessible.
19892
19893         * class.cs (Constructor.Define): Same here.
19894
19895         (Field.Define): Ditto.
19896
19897         (Event.Define): Ditto.
19898
19899         (Operator.Define): Check that the underlying Method defined itself
19900         correctly - so it's MethodBuilder should not be null.
19901
19902         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19903         expression happens to be null.
19904
19905         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19906         members but as of now we don't seem to be able to do anything really useful with it.
19907
19908         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19909         not the EventBuilder.
19910
19911 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19912
19913         * cs-tokenizer.cs: Add support for defines.
19914         Add support for #if, #elif, #else, #endif
19915
19916         (eval_var): evaluates a variable.
19917         (eval): stubbed for evaluating functions.
19918
19919         * cs-parser.jay: Pass the defines information
19920
19921         * driver.cs: Add --define command line option.
19922
19923         * decl.cs: Move MemberCore here.
19924
19925         Make it the base class for DeclSpace.  This allows us to catch and
19926         report 108 and 109 for everything now.
19927
19928         * class.cs (TypeContainer.Define): Extract all the members
19929         before populating and emit the warning 108 (new keyword required
19930         to override) instead of having each member implement this.
19931
19932         (MemberCore.Define): New abstract method, we will be using this in
19933         the warning reporting engine in Populate.
19934
19935         (Operator.Define): Adjust to new MemberCore protocol. 
19936
19937         * const.cs (Const): This does not derive from Expression, it is a
19938         temporary object we use to create fields, it is a MemberCore. 
19939
19940         * class.cs (Method.Define): Allow the entry point to be in a
19941         specific class.
19942
19943         * driver.cs: Rewrite the argument handler to clean it up a bit.
19944
19945         * rootcontext.cs: Made it just an auxiliary namespace feature by
19946         making everything static.
19947
19948         * driver.cs: Adapt code to use RootContext type name instead of
19949         instance variable.
19950
19951         * delegate.cs: Remove RootContext argument.
19952
19953         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19954         argument. 
19955
19956         * class.cs (Event.Define): The lookup can fail.
19957
19958         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19959
19960         * expression.cs: Resolve the this instance before invoking the code.
19961
19962 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19963
19964         * cs-parser.jay: Add a production in element_access that allows
19965         the thing to become a "type" reference.  This way we can parse
19966         things like "(string [])" as a type.
19967
19968         Note that this still does not handle the more complex rules of
19969         casts. 
19970
19971
19972         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19973
19974         * ecore.cs: (CopyNewMethods): new utility function used to
19975         assemble the list of methods from running FindMembers.
19976
19977         (MemberLookup): Rework FindMembers so that 
19978
19979 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19980
19981         * class.cs (TypeContainer): Remove Delegates who fail to be
19982         defined.
19983
19984         * delegate.cs (Populate): Verify that we dont get null return
19985         values.   TODO: Check for AsAccessible.
19986
19987         * cs-parser.jay: Use basename to emit error 574 (destructor should
19988         have the same name as container class), not the full name.
19989
19990         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19991         possible representation.  
19992
19993         Also implements integer type suffixes U and L.
19994
19995 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19996
19997         * expression.cs (ArrayCreation.DoResolve): We need to do the
19998         argument resolution *always*.
19999
20000         * decl.cs: Make this hold the namespace.  Hold the root context as
20001         well.
20002         (LookupType): Move here.
20003
20004         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20005
20006         * location.cs (Row, Name): Fixed the code, it was always returning
20007         references to the first file.
20008
20009         * interface.cs: Register properties defined through interfaces.
20010
20011         * driver.cs: Add support for globbing on the command line
20012
20013         * class.cs (Field): Make it derive from MemberCore as well.
20014         (Event): ditto.
20015
20016 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20017
20018         * class.cs (Event::Define): Check that the type of the event is a delegate
20019         type else flag error #66.
20020
20021         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20022         same.
20023
20024         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20025         values of EntryPoint, CharSet etc etc.
20026
20027         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20028
20029         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20030         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20031         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20032         which needs this to do its work.
20033
20034         * ../errors/cs0066.cs : Add.
20035
20036 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20037
20038         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20039         helper functions.
20040
20041         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20042         clears out the parameters field.
20043         (MemberSignatureCompare): Cleanup
20044
20045         (MemberCore): New base class used to share code between MethodCore
20046         and Property.
20047
20048         (RegisterRequiredImplementations) BindingFlags.Public requires
20049         either BindingFlags.Instace or Static.  Use instance here.
20050
20051         (Property): Refactored code to cope better with the full spec.
20052
20053         * parameter.cs (GetParameterInfo): Return an empty array instead
20054         of null on error.
20055
20056         * class.cs (Property): Abstract or extern properties have no bodies.
20057
20058         * parameter.cs (GetParameterInfo): return a zero-sized array.
20059
20060         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20061         method modifier validation to the typecontainer so we can reuse
20062         this on properties.
20063
20064         (MethodCore.ParameterTypes): return an empty sized array of types.
20065
20066         (Property.Define): Test property modifier validity.
20067
20068         Add tests for sealed/override too.
20069
20070         (Method.Emit): abstract or extern methods have no bodies.
20071
20072 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20073
20074         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20075         thing.
20076
20077         (Method::Define, ::Emit): Modify accordingly.
20078
20079         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20080
20081         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20082
20083         * makefile: Pass in /unsafe.
20084
20085 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
20086
20087         * class.cs (MakeKey): Kill routine.
20088
20089         * class.cs (TypeContainer.Define): Correctly define explicit
20090         method implementations (they require the full interface name plus
20091         the method name).
20092
20093         * typemanager.cs: Deply the PtrHashtable here and stop using the
20094         lame keys.  Things work so much better.
20095
20096         This of course broke everyone who depended on `RegisterMethod' to
20097         do the `test for existance' test.  This has to be done elsewhere.
20098
20099         * support.cs (PtrHashtable): A hashtable that avoid comparing with
20100         the object stupid Equals method (because, that like fails all over
20101         the place).  We still do not use it.
20102
20103         * class.cs (TypeContainer.SetRequiredInterface,
20104         TypeContainer.RequireMethods): Killed these two routines and moved
20105         all the functionality to RegisterRequiredImplementations.
20106
20107         (TypeContainer.RegisterRequiredImplementations): This routine now
20108         registers all the implementations required in an array for the
20109         interfaces and abstract methods.  We use an array of structures
20110         which can be computed ahead of time to reduce memory usage and we
20111         also assume that lookups are cheap as most classes will not
20112         implement too many interfaces.
20113
20114         We also avoid creating too many MethodSignatures.
20115
20116         (TypeContainer.IsInterfaceMethod): Update and optionally does not
20117         clear the "pending" bit if we find that there are problems with
20118         the declaration.
20119
20120         (TypeContainer.VerifyPendingMethods): Update to report errors of
20121         methods that look like implementations but are not.
20122
20123         (TypeContainer.Define): Add support for explicit interface method
20124         implementation. 
20125
20126 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
20127
20128         * typemanager.cs: Keep track of the parameters here instead of
20129         being a feature of the TypeContainer.
20130
20131         * class.cs: Drop the registration of parameters here, as
20132         InterfaceMethods are also interface declarations.
20133
20134         * delegate.cs: Register methods with the TypeManager not only with
20135         the TypeContainer.  This code was buggy.
20136
20137         * interface.cs: Full registation here.
20138
20139 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20140
20141         * expression.cs: Remove reducer for binary expressions, it can not
20142         be done this way.
20143
20144         * const.cs: Put here the code that used to go into constant.cs
20145
20146         * constant.cs: Put here the code for constants, this is a new base
20147         class for Literals.
20148
20149         * literal.cs: Make Literal derive from Constant.
20150
20151 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20152
20153         * statement.cs (Return.Emit): Report error 157 if the user
20154         attempts to return from a finally block.
20155
20156         (Return.Emit): Instead of emitting a return, jump to the end of
20157         the function.
20158
20159         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20160         LocalBuilder to store the result of the function.  ReturnLabel is
20161         the target where we jump.
20162
20163
20164 2001-12-09  Radek Doulik  <rodo@ximian.com>
20165
20166         * cs-parser.jay: remember alias in current namespace
20167
20168         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20169         namespaces
20170
20171         * class.cs (LookupAlias): lookup alias in my_namespace
20172
20173         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20174         aliases hashtable
20175         (LookupAlias): lookup alias in this and if needed in parent
20176         namespaces
20177
20178 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20179
20180         * support.cs: 
20181
20182         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20183         making things static.  I need this to avoid passing the
20184         TypeContainer when calling ParameterType.
20185
20186         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20187         that did string manipulation to compute the type and then call
20188         GetType.  Use Parameter.ParameterType instead.
20189
20190         * cs-tokenizer.cs: Consume the suffix for floating values.
20191
20192         * expression.cs (ParameterReference): figure out whether this is a
20193         reference parameter or not.  Kill an extra variable by computing
20194         the arg_idx during emission.
20195
20196         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20197         function that returns whether a parameter is an out/ref value or not.
20198
20199         (Parameter.ParameterType): The type of the parameter (base,
20200         without ref/out applied).
20201
20202         (Parameter.Resolve): Perform resolution here.
20203         (Parameter.ExternalType): The full type (with ref/out applied).
20204
20205         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20206         support for expressions on the using statement.
20207
20208 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20209
20210         * statement.cs (Using.EmitLocalVariableDecls): Split the
20211         localvariable handling of the using statement.
20212
20213         (Block.EmitMeta): Keep track of variable count across blocks.  We
20214         were reusing slots on separate branches of blocks.
20215
20216         (Try.Emit): Emit the general code block, we were not emitting it. 
20217
20218         Check the type of the declaration to be an IDisposable or
20219         something that can be implicity converted to it. 
20220
20221         Emit conversions if required.
20222
20223         * ecore.cs (EmptyExpression): New utility class.
20224         (Expression.ImplicitConversionExists): New utility function.
20225
20226 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20227
20228         * statement.cs (Using): Implement.
20229
20230         * expression.cs (LocalVariableReference): Support read only variables.
20231
20232         * statement.cs: Remove the explicit emit for the Leave opcode.
20233         (VariableInfo): Add a readonly field.
20234
20235 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20236
20237         * ecore.cs (ConvCast): new class used to encapsulate the various
20238         explicit integer conversions that works in both checked and
20239         unchecked contexts.
20240
20241         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20242         properly generate the overflow opcodes.
20243
20244 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20245
20246         * statement.cs: The correct type for the EmptyExpression is the
20247         element_type, not the variable type.  Ravi pointed this out.
20248
20249 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20250
20251         * class.cs (Method::Define): Handle PInvoke methods specially
20252         by using DefinePInvokeMethod instead of the usual one.
20253
20254         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20255         above to do the task of extracting information and defining the method.
20256
20257 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20258
20259         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20260         of the condition for string type.
20261
20262         (Emit): Move that here. 
20263
20264         (ArrayCreation::CheckIndices): Keep string literals in their expression
20265         form.
20266
20267         (EmitDynamicInitializers): Handle strings appropriately.
20268
20269 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20270
20271         * codegen.cs (EmitContext): Replace multiple variables with a
20272         single pointer to the current Switch statement.
20273
20274         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20275         EmitContext.
20276
20277 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20278
20279         * statement.cs 
20280
20281         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20282         default'.
20283
20284         (Foreach.Emit): Foreach on arrays was not setting
20285         up the loop variables (for break/continue).
20286
20287         (GotoCase): Semi-implented.
20288
20289 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20290
20291         * attribute.cs (CheckAttribute): Handle system attributes by using
20292         Attribute.GetAttributes to examine information we need.
20293
20294         (GetValidPlaces): Same here.
20295
20296         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20297
20298         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20299
20300         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20301
20302         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20303
20304         (Method::Emit): Handle the case when we are a PInvoke method.
20305
20306 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20307
20308         * expression.cs: Use ResolveWithSimpleName on compound names.
20309
20310 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20311
20312         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20313         before trying to reduce it.
20314
20315         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20316
20317         * constant.cs (LookupConstantValue): Implement.
20318
20319         (EmitConstant): Use the above in emitting the constant.
20320
20321         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20322         that are user-defined by doing a LookupConstantValue on them.
20323
20324         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20325         too, like above.
20326
20327 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20328
20329         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20330
20331         (BaseAccess.DoResolve): Implement.
20332
20333         (MemberAccess.DoResolve): Split this routine into a
20334         ResolveMemberAccess routine that can be used independently
20335
20336 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20337
20338         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20339         As that share bits of the implementation.  Is returns a boolean,
20340         while As returns the Type that is being probed.
20341
20342 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20343
20344         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20345         instead of a Literal - much easier.
20346
20347         (EnumInTransit): Remove - utterly useless :-)
20348
20349         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20350
20351         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20352
20353         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20354         chain when we have no associated expression.
20355
20356 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20357
20358         * constant.cs (Define): Use Location while reporting the errror.
20359
20360         Also emit a warning when 'new' is used and there is no inherited
20361         member to hide.
20362
20363         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20364         populated.
20365
20366         (LookupEnumValue): Implement to lookup an enum member's value and define it
20367         if necessary.
20368
20369         (Populate): Re-write accordingly to use the above routine.
20370
20371 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20372
20373         * expression.cs (This): Fix prototype for DoResolveLValue to
20374         override the base class DoResolveLValue.
20375
20376         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20377         declarations) 
20378
20379         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20380         (we need to load the address of the field here).  This fixes
20381         test-22. 
20382
20383         (FieldExpr.DoResolveLValue): Call the DoResolve
20384         function to initialize the Instance expression.
20385
20386         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20387         correctly the GetEnumerator operation on a value type.
20388
20389         * cs-parser.jay: Add more simple parsing error catches.
20390
20391         * statement.cs (Switch): Add support for string switches.
20392         Handle null specially.
20393
20394         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20395
20396 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20397
20398         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20399
20400         (declare_local_constant): New helper function.
20401
20402         * statement.cs (AddConstant): Keep a separate record of constants
20403
20404         (IsConstant): Implement to determine if a variable is a constant.
20405
20406         (GetConstantExpression): Implement.
20407
20408         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20409
20410         * statement.cs (IsVariableDefined): Re-write.
20411
20412 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20413
20414         * class.cs (TypeContainer::FindMembers): Look for constants
20415         in the case when we are looking for MemberTypes.Field
20416
20417         * expression.cs (MemberAccess::DoResolve): Check that in the
20418         case we are a FieldExpr and a Literal, we are not being accessed
20419         by an instance reference.
20420
20421         * cs-parser.jay (local_constant_declaration): Implement.
20422
20423         (declaration_statement): Implement for constant declarations.
20424
20425 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20426
20427         * statement.cs (Switch): Catch double defaults.
20428
20429         (Switch): More work on the switch() statement
20430         implementation.  It works for integral values now, need to finish
20431         string support.
20432
20433
20434 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20435
20436         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20437         integer literals into other integer literals.  To be used by
20438         switch. 
20439
20440 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20441
20442         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20443         some memory.
20444
20445         (EmitDynamicInitializers): Cope with the above since we extract data
20446         directly from ArrayData now.
20447
20448         (ExpectInitializers): Keep track of whether initializers are mandatory
20449         or not.
20450
20451         (Bounds): Make it a hashtable to prevent the same dimension being 
20452         recorded for every element in that dimension.
20453
20454         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20455         from being found.
20456
20457         Also fix bug which was causing the indices to be emitted in the reverse
20458         order.
20459
20460 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20461
20462         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20463         unfinished.  They do not work, because the underlying code is
20464         sloppy.
20465
20466 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20467
20468         * cs-parser.jay: Remove bogus fixme.
20469
20470         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20471         on Switch statement.
20472
20473 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20474
20475         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20476         the same. 
20477
20478         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20479         parameter. Apparently, any expression is allowed. 
20480
20481         (ValidateInitializers): Update accordingly.
20482
20483         (CheckIndices): Fix some tricky bugs thanks to recursion.
20484
20485         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20486         I was being completely brain-dead.
20487
20488         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20489         and re-write acordingly.
20490
20491         (DelegateInvocation): Re-write accordingly.
20492
20493         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20494
20495         (MakeByteBlob): Handle types more correctly.
20496
20497         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20498         initialization from expressions but it is incomplete because I am a complete
20499         Dodo :-|
20500
20501 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20502
20503         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20504         on If.  Basically, we have to return `true' (ie, we do return to
20505         our caller) only if both branches of the if return.
20506
20507         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20508         short-circuit operators, handle them as short circuit operators. 
20509
20510         (Cast.DoResolve): Resolve type.
20511         (Cast.Cast): Take an expression as the target type.
20512
20513         * cs-parser.jay (cast_expression): Remove old hack that only
20514         allowed a limited set of types to be handled.  Now we take a
20515         unary_expression and we resolve to a type during semantic
20516         analysis.
20517
20518         Use the grammar productions from Rhys to handle casts (this is
20519         not complete like Rhys syntax yet, we fail to handle that corner
20520         case that C# has regarding (-x), but we will get there.
20521
20522 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20523
20524         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20525         field which is an array type.
20526
20527         * cs-parser.jay (declare_local_variables): Support array initialization too.
20528
20529         * typemanager.cs (MakeKey): Implement.
20530
20531         (everywhere): Use the above appropriately.
20532
20533         * cs-parser.jay (for_statement): Update for array initialization while
20534         declaring variables.
20535
20536         * ecore.cs : The error message was correct, it's the variable's names that
20537         were misleading ;-) Make the code more readable.
20538
20539         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20540         the correct type etc.
20541
20542         (ConvertExplicit): Handle Enum types by examining the underlying type.
20543
20544 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20545
20546         * parameter.cs (GetCallingConvention): Always return
20547         CallingConventions.Standard for now.
20548
20549 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20550
20551         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20552         and `r' after calling DoNumericPromotions.
20553
20554         * ecore.cs: Fix error message (the types were in the wrong order).
20555
20556         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20557         BindingFlags.Instance as well 
20558
20559         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20560         implicit int literal conversion in an empty cast so that we
20561         propagate the right type upstream.
20562
20563         (UnboxCast): new class used to unbox value types.
20564         (Expression.ConvertExplicit): Add explicit type conversions done
20565         by unboxing.
20566
20567         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20568         the target type before applying the implicit LongLiterals to ULong
20569         literal cast.
20570
20571 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20572
20573         * cs-parser.jay (for_statement): Reworked the way For works: now
20574         we declare manually any variables that are introduced in
20575         for_initializer to solve the problem of having out-of-band code
20576         emition (that is what got for broken).
20577
20578         (declaration_statement): Perform the actual variable declaration
20579         that used to be done in local_variable_declaration here.
20580
20581         (local_variable_declaration): Do not declare anything, just pass
20582         the information on a DictionaryEntry
20583
20584 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20585
20586         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20587         re-write of the logic to now make it recursive.
20588
20589         (UpdateIndices): Re-write accordingly.
20590
20591         Store element data in a separate ArrayData list in the above methods.
20592
20593         (MakeByteBlob): Implement to dump the array data into a byte array.
20594
20595 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20596
20597         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20598         into CheckIndices.
20599
20600         * constant.cs (Define): Implement.
20601
20602         (EmitConstant): Re-write fully.
20603
20604         Pass in location info.
20605
20606         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20607         respectively.
20608
20609         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20610         DictionaryEntry since we need location info too.
20611
20612         (constant_declaration): Update accordingly.
20613
20614         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20615         code into another method : UpdateIndices.
20616
20617 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20618
20619         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20620         some type checking etc.
20621
20622 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20623
20624         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20625         bits to provide dimension info if the user skips doing that.
20626
20627         Update second constructor to store the rank correctly.
20628
20629 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20630
20631         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20632         and try to implement.
20633
20634         * ../errors/cs0150.cs : Add.
20635
20636         * ../errors/cs0178.cs : Add.
20637
20638 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20639
20640         * statement.cs: Implement foreach on multi-dimensional arrays. 
20641
20642         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20643         name of the params argument.
20644
20645         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20646         initializing the array.
20647
20648         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20649         we can use this elsewhere.
20650
20651         * statement.cs: Finish implementation of foreach for single
20652         dimension arrays.
20653
20654         * cs-parser.jay: Use an out-of-band stack to pass information
20655         around, I wonder why I need this.
20656
20657         foreach_block: Make the new foreach_block the current_block.
20658
20659         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20660         function used to return a static Parameters structure.  Used for
20661         empty parameters, as those are created very frequently.
20662
20663         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20664
20665 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20666
20667         * interface.cs : Default modifier is private, not public. The
20668         make verify test passes again.
20669
20670 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20671
20672         * support.cs (ReflectionParameters): Fix logic to determine
20673         whether the last parameter is a params one. Test 9 passes again.
20674
20675         * delegate.cs (Populate): Register the builders we define with
20676         RegisterParameterForBuilder. Test 19 passes again.
20677
20678         * cs-parser.jay (property_declaration): Reference $6 instead
20679         of $$ to get at the location.
20680
20681         (indexer_declaration): Similar stuff.
20682
20683         (attribute): Ditto.
20684
20685         * class.cs (Property): Register parameters for the Get and Set methods
20686         if they exist. Test 23 passes again.
20687
20688         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20689         call to EmitArguments as we are sure there aren't any params arguments. 
20690         Test 32 passes again.
20691
20692         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20693         IndexOutOfRangeException. 
20694
20695         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20696         Test 33 now passes again.
20697
20698 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20699
20700         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20701         broke a bunch of things.  Will have to come up with a better way
20702         of tracking locations.
20703
20704         * statement.cs: Implemented foreach for single dimension arrays.
20705
20706 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20707
20708         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20709         an error.  This removes the lookup from the critical path.
20710
20711         * cs-parser.jay: Removed use of temporary_loc, which is completely
20712         broken. 
20713
20714 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20715
20716         * support.cs (ReflectionParameters.ParameterModifier): Report
20717         whether the argument is a PARAMS argument or not.
20718
20719         * class.cs: Set the attribute `ParamArrayAttribute' on the
20720         parameter argument.
20721
20722         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20723         and cons_param_array_attribute (ConstructorInfo for
20724         ParamArrayAttribute)., 
20725
20726         * codegen.cs: Emit the return using the `Return' statement, that
20727         way we can report the error correctly for missing return values. 
20728
20729         * class.cs (Method.Emit): Clean up.
20730
20731         * expression.cs (Argument.Resolve): Take another argument: the
20732         location where this argument is used.  Notice that this is not
20733         part of the "Argument" class as to reduce the size of the
20734         structure (we know the approximate location anyways).
20735
20736         Test if the argument is a variable-reference, if not, then
20737         complain with a 206.
20738
20739         (Argument.Emit): Emit addresses of variables.
20740
20741         (Argument.FullDesc): Simplify.
20742
20743         (Invocation.DoResolve): Update for Argument.Resolve.
20744
20745         (ElementAccess.DoResolve): ditto.
20746
20747         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20748         method should be virtual, as this method is always virtual.
20749
20750         (NewDelegate.DoResolve): Update for Argument.Resolve.
20751
20752         * class.cs (ConstructorInitializer.DoResolve): ditto.
20753
20754         * attribute.cs (Attribute.Resolve): ditto.
20755
20756 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20757
20758         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20759
20760         * expression.cs (ParameterReference): Drop IStackStorage and implement
20761         IAssignMethod instead. 
20762
20763         (LocalVariableReference): ditto.
20764
20765         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20766         IAssignMethod instead. 
20767
20768 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20769
20770         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20771         enumerations that are used in heavily used structures derive from
20772         byte in a laughable and pathetic attempt to reduce memory usage.
20773         This is the kind of pre-optimzations that you should not do at
20774         home without adult supervision.
20775
20776         * expression.cs (UnaryMutator): New class, used to handle ++ and
20777         -- separatedly from the other unary operators.  Cleans up the
20778         code, and kills the ExpressionStatement dependency in Unary.
20779
20780         (Unary): Removed `method' and `Arguments' from this class, making
20781         it smaller, and moving it all to SimpleCall, so I can reuse this
20782         code in other locations and avoid creating a lot of transient data
20783         strucutres when not required.
20784
20785         * cs-parser.jay: Adjust for new changes.
20786
20787 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20788
20789         * enum.cs (Enum.Populate): If there is a failure during
20790         definition, return
20791
20792         * cs-parser.jay (opt_enum_base): we used to catch type errors
20793         here, but this is really incorrect.  The type error should be
20794         catched during semantic analysis.
20795
20796 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20797
20798         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20799         current_local_parameters as expected since I, in my stupidity, had forgotten
20800         to do this :-)
20801
20802         * attribute.cs (GetValidPlaces): Fix stupid bug.
20803
20804         * class.cs (Method::Emit): Perform check on applicability of attributes.
20805
20806         (Constructor::Emit): Ditto.
20807
20808         (Field::Emit): Ditto.
20809
20810         (Field.Location): Store location information.
20811
20812         (Property, Event, Indexer, Operator): Ditto.
20813
20814         * cs-parser.jay (field_declaration): Pass in location for each field.
20815
20816         * ../errors/cs0592.cs : Add.
20817
20818 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20819
20820         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20821
20822         (InitCoreTypes): Update accordingly.
20823
20824         (RegisterAttrType, LookupAttr): Implement.
20825
20826         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20827         info about the same.
20828
20829         (Resolve): Update to populate the above as necessary.
20830
20831         (Error592): Helper.
20832
20833         (GetValidPlaces): Helper to the above.
20834
20835         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20836
20837         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20838
20839 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20840
20841         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20842
20843         * ../errors/cs0617.cs : Add.
20844
20845 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20846
20847         * enum.cs (Emit): Rename to Populate to be more consistent with what
20848         we expect it to do and when exactly it is called.
20849
20850         * class.cs, rootcontext.cs : Update accordingly.
20851
20852         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20853         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20854
20855         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20856
20857         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20858         of a fieldinfo using the above, when dealing with a FieldBuilder.
20859
20860 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20861
20862         * ../errors/cs0031.cs : Add.
20863
20864         * ../errors/cs1008.cs : Add.
20865
20866         * ../errrors/cs0543.cs : Add.
20867
20868         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20869         enum type.
20870
20871         (FindMembers): Implement.
20872
20873         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20874         enums and delegates too.
20875
20876         (enum_types): Rename to builder_to_enum.
20877
20878         (delegate_types): Rename to builder_to_delegate.
20879
20880         * delegate.cs (FindMembers): Implement.
20881
20882 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20883
20884         * typemanager.cs (IsEnumType): Implement.
20885
20886         * enum.cs (Emit): Re-write parts to account for the underlying type
20887         better and perform checking etc.
20888
20889         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20890         of the underlying type.
20891
20892         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20893         value
20894
20895         * enum.cs (error31): Helper to report error #31.
20896
20897         * cs-parser.jay (enum_declaration): Store location of each member too.
20898
20899         * enum.cs (member_to_location): New hashtable. 
20900
20901         (AddEnumMember): Update location hashtable.
20902
20903         (Emit): Use the location of each member while reporting errors.
20904
20905 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20906
20907         * cs-parser.jay: A for_initializer if is a
20908         local_variable_declaration really ammount to have an implicit
20909         block with the variable declaration and no initializer for for.
20910
20911         * statement.cs (For.Emit): Cope with null initializers.
20912
20913         This fixes the infinite loop on for initializers.
20914
20915 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20916
20917         * enum.cs: More cleanup.
20918
20919         * ecore.cs: Remove dead code.
20920
20921         * class.cs (Property.Emit): More simplification.
20922         (Event.Emit): ditto.
20923
20924         Reworked to have less levels of indentation.
20925
20926 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20927
20928         * class.cs (Property): Emit attributes.
20929
20930         (Field): Ditto.
20931
20932         (Event): Ditto.
20933
20934         (Indexer): Ditto.
20935
20936         (Operator): Ditto.
20937
20938         * enum.cs (Emit): Ditto.
20939
20940         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20941         Enums too.
20942
20943         * class.cs (Field, Event, etc.): Move attribute generation into the
20944         Emit method everywhere.
20945
20946         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20947         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20948         as we had no way of defining nested enums !
20949
20950         * rootcontext.cs : Adjust code accordingly.
20951
20952         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20953
20954 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20955
20956         * expression.cs (EvalConstantExpression): Move into ecore.cs
20957
20958         * enum.cs (Enum): Rename some members and make them public and readonly
20959         according to our convention.
20960
20961         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20962         nothing else.
20963
20964         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20965
20966         (Enum::Emit): Write a simple version for now which doesn't try to compute
20967         expressions. I shall modify this to be more robust in just a while.
20968
20969         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20970
20971         (TypeContainer::CloseType): Create the Enum types too.
20972
20973         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20974
20975         * expression.cs (EvalConstantExpression): Get rid of completely.
20976
20977         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20978         user-defined values and other cases.
20979
20980         (IsValidEnumLiteral): Helper function.
20981
20982         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20983         out there in the case we had a literal FieldExpr.
20984
20985         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20986
20987         (Literalize): Revamp a bit to take two arguments.
20988
20989         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20990
20991 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20992
20993         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20994
20995         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20996
20997         (Resolve): Use the above to ensure we have proper initializers.
20998
20999 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21000
21001         * expression.cs (Expression::EvalConstantExpression): New method to 
21002         evaluate constant expressions.
21003
21004         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21005
21006 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21007
21008         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21009         in an array.
21010
21011         (Binary.ResolveOperator): Handle operator != (object a, object b)
21012         and operator == (object a, object b);
21013
21014         (Binary.DoNumericPromotions): Indicate whether the numeric
21015         promotion was possible.
21016
21017         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21018         Implement.  
21019
21020         Made the ArrayAccess implement interface IAssignMethod instead of
21021         IStackStore as the order in which arguments are passed reflects
21022         this.
21023
21024         * assign.cs: Instead of using expr.ExprClass to select the way of
21025         assinging, probe for the IStackStore/IAssignMethod interfaces.
21026
21027         * typemanager.cs: Load InitializeArray definition.
21028
21029         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21030         static data that can be used to initialize arrays. 
21031
21032 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21033
21034         * expression.cs: Handle operator== and operator!= for booleans.
21035
21036         (Conditioal.Reduce): Implement reducer for the ?: operator.
21037
21038         (Conditional.Resolve): Implement dead code elimination.
21039
21040         (Binary.Resolve): Catch string literals and return a new
21041         concatenated string.
21042
21043         (Unary.Reduce): Implement reduction of unary expressions.
21044
21045         * ecore.cs: Split out the expression core handling here.
21046
21047         (Expression.Reduce): New method used to perform constant folding
21048         and CSE.  This is needed to support constant-expressions. 
21049
21050         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21051         targets, and optimize for !x.
21052
21053 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21054
21055         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21056         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21057         set custom atttributes.
21058
21059         * literal.cs (Literal::GetValue): New abstract method to return the actual
21060         value of the literal, cast as an object.
21061
21062         (*Literal): Implement GetValue method.
21063
21064         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21065         expressions to the arraylist but objects of type Argument.
21066
21067         * class.cs (TypeContainer::Emit): Emit our attributes too.
21068
21069         (Method::Emit, Constructor::Emit): Ditto.
21070
21071         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21072         to be ignoring earlier.
21073
21074 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21075
21076         * attribute.cs (AttributeSection::Define): Implement to do the business
21077         of constructing a CustomAttributeBuilder.
21078
21079         (Attribute): New trivial class. Increases readability of code.  
21080
21081         * cs-parser.jay : Update accordingly.
21082
21083         (positional_argument_list, named_argument_list, named_argument): New rules
21084
21085         (attribute_arguments): Use the above so that we are more correct.
21086
21087 2001-11-02  Ravi Pratap  <ravi@ximian.com>
21088
21089         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21090         to perform all checks for a method with a params parameter.
21091
21092         (Invocation::OverloadResolve): Update to use the above method and therefore
21093         cope correctly with params method invocations.
21094
21095         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
21096         params too.
21097
21098         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21099         constructors in our parent too because we can't afford to miss out on 
21100         protected ones ;-)
21101
21102         * attribute.cs (AttributeSection): New name for the class Attribute
21103
21104         Other trivial changes to improve readability.
21105
21106         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21107         use the new class names.
21108
21109 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21110
21111         * class.cs (Method::Define): Complete definition for params types too
21112
21113         (Indexer::Define): Ditto.
21114
21115         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21116         Cope everywhere with a request for info about the array parameter.
21117
21118 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21119
21120         * tree.cs (RecordNamespace): Fix up to check for the correct key.
21121
21122         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
21123         local_variable_type to extract the string corresponding to the type.
21124
21125         (local_variable_type): Fixup the action to use the new helper method.
21126
21127         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21128         go.
21129
21130         * expression.cs : Clean out code which uses the above.
21131
21132 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21133
21134         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21135         and bale out if necessary by returning a false.
21136
21137         (RegisterProperty): Ditto.
21138
21139         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21140         and print out appropriate error messages.
21141
21142         * interface.cs (everywhere): Ditto.
21143
21144         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21145         location to constructor.
21146
21147         * class.cs (Property, Event, Indexer): Update accordingly.
21148
21149         * ../errors/cs111.cs : Added.
21150
21151         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21152         of a method, as laid down by the spec.
21153
21154         (Invocation::OverloadResolve): Use the above method.
21155
21156 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21157
21158         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21159         now take a TypeContainer and a Parameters object.
21160
21161         (ParameterData): Modify return type of ParameterModifier method to be 
21162         Parameter.Modifier and not a string.
21163
21164         (ReflectionParameters, InternalParameters): Update accordingly.
21165
21166         * expression.cs (Argument::GetParameterModifier): Same here.
21167
21168         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21169         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21170         symbol in it at all so maybe this is only for now.
21171
21172 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21173
21174         * support.cs (InternalParameters): Constructor now takes an extra argument 
21175         which is the actual Parameters class.
21176
21177         (ParameterDesc): Update to provide info on ref/out modifiers.
21178
21179         * class.cs (everywhere): Update call to InternalParameters to pass in
21180         the second argument too.
21181
21182         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21183         to return the modifier info [ref/out etc]
21184
21185         (InternalParameters, ReflectionParameters): Implement the above.
21186
21187         * expression.cs (Argument::ParameterModifier): Similar function to return
21188         info about the argument's modifiers.
21189
21190         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21191         too.
21192
21193         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21194         a new SetFormalParameters object which we pass to InternalParameters.
21195
21196 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21197
21198         * expression.cs (NewArray): Merge into the ArrayCreation class.
21199
21200 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21201
21202         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21203         NewUserdefinedArray into one as there wasn't much of a use in having
21204         two separate ones.
21205
21206         * expression.cs (Argument): Change field's name to ArgType from Type.
21207
21208         (Type): New readonly property which returns the proper type, taking into 
21209         account ref/out modifiers.
21210
21211         (everywhere): Adjust code accordingly for the above.
21212
21213         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21214         whether we are emitting for a ref or out parameter.
21215
21216         * expression.cs (Argument::Emit): Use the above field to set the state.
21217
21218         (LocalVariableReference::Emit): Update to honour the flag and emit the
21219         right stuff.
21220
21221         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21222
21223         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21224
21225         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21226
21227         (ReflectionParameters, InternalParameters): Implement the above method.
21228
21229         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21230         reporting errors.
21231
21232         (Invocation::FullMethodDesc): Ditto. 
21233
21234 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21235
21236         * cs-parser.jay: Add extra production for the second form of array
21237         creation. 
21238
21239         * expression.cs (ArrayCreation): Update to reflect the above
21240         change. 
21241
21242         * Small changes to prepare for Array initialization.
21243
21244 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21245
21246         * typemanager.cs (ImplementsInterface): interface might be null;
21247         Deal with this problem;
21248
21249         Also, we do store negative hits on the cache (null values), so use
21250         this instead of calling t.GetInterfaces on the type everytime.
21251
21252 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21253
21254         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21255
21256         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21257         split functionality out into different classes.
21258
21259         (New::FormArrayType): Move into NewBuiltinArray.
21260
21261         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21262         quite useless.
21263
21264         (NewBuiltinArray): New class to handle creation of built-in arrays.
21265
21266         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21267         account creation of one-dimensional arrays.
21268
21269         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21270
21271         (NewUserdefinedArray::DoResolve): Implement.
21272
21273         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21274
21275         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21276         we maintain inside the TypeManager. This is necessary to perform lookups on the
21277         module builder.
21278
21279         (LookupType): Update to perform GetType on the module builders too.     
21280
21281         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21282
21283         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21284
21285 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21286
21287         * expression.cs (New::DoResolve): Implement guts of array creation.
21288
21289         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21290
21291 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21292
21293         * expression.cs: Fix bug I introduced lsat night that broke
21294         Delegates. 
21295
21296         (Expression.Resolve): Report a 246 error (can not resolve name)
21297         if we find a SimpleName in the stream.
21298
21299         (Expression.ResolveLValue): Ditto.
21300
21301         (Expression.ResolveWithSimpleName): This function is a variant of
21302         ResolveName, this one allows SimpleNames to be returned without a
21303         warning.  The only consumer of SimpleNames is MemberAccess
21304
21305 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21306
21307         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21308         might arrive here.  I have my doubts that this is correct.
21309
21310         * statement.cs (Lock): Implement lock statement.
21311
21312         * cs-parser.jay: Small fixes to support `lock' and `using'
21313
21314         * cs-tokenizer.cs: Remove extra space
21315
21316         * driver.cs: New flag --checked, allows to turn on integer math
21317         checking. 
21318
21319         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21320         Threading.Monitor.Exit 
21321
21322 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21323
21324         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21325         Expression Class to be IndexerAccess.
21326
21327         Notice that Indexer::DoResolve sets the eclass to Value.
21328
21329 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21330
21331         * class.cs (TypeContainer::Emit): Emit code for indexers.
21332
21333         * assign.cs (IAssignMethod): New interface implemented by Indexers
21334         and Properties for handling assignment.
21335
21336         (Assign::Emit): Simplify and reuse code. 
21337
21338         * expression.cs (IndexerAccess, PropertyExpr): Implement
21339         IAssignMethod, clean up old code. 
21340
21341 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21342
21343         * typemanager.cs (ImplementsInterface): New method to determine if a type
21344         implements a given interface. Provides a nice cache too.
21345
21346         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21347         method.
21348
21349         (ConvertReferenceExplicit): Ditto.
21350
21351         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21352         various methods, with correct names etc.
21353
21354         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21355         Operator.UnaryNegation.
21356
21357         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21358         we have a unary plus or minus operator.
21359
21360         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21361         UnaryMinus.
21362
21363         * everywhere : update accordingly.
21364
21365         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21366         respectively.
21367
21368         * class.cs (Method::Define): For the case where we are implementing a method
21369         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21370         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21371
21372 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21373
21374         * interface.cs (FindMembers): Implement to work around S.R.E
21375         lameness.
21376
21377         * typemanager.cs (IsInterfaceType): Implement.
21378
21379         (FindMembers): Update to handle interface types too.
21380
21381         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21382         use IsAssignableFrom as that is not correct - it doesn't work.
21383
21384         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21385         and accordingly override EmitStatement.
21386
21387         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21388         using the correct logic :-)
21389
21390 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21391
21392         * ../errors/cs-11.cs : Add to demonstrate error -11 
21393
21394 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21395
21396         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21397         then pass this as a hint to ResolveLValue.
21398
21399         * expression.cs (FieldExpr): Add Location information
21400
21401         (FieldExpr::LValueResolve): Report assignment to readonly
21402         variable. 
21403
21404         (Expression::ExprClassFromMemberInfo): Pass location information.
21405
21406         (Expression::ResolveLValue): Add new method that resolves an
21407         LValue. 
21408
21409         (Expression::DoResolveLValue): Default invocation calls
21410         DoResolve. 
21411
21412         (Indexers): New class used to keep track of indexers in a given
21413         Type. 
21414
21415         (IStackStore): Renamed from LValue, as it did not really describe
21416         what this did.  Also ResolveLValue is gone from this interface and
21417         now is part of Expression.
21418
21419         (ElementAccess): Depending on the element access type
21420
21421         * typemanager.cs: Add `indexer_name_type' as a Core type
21422         (System.Runtime.CompilerServices.IndexerNameAttribute)
21423
21424         * statement.cs (Goto): Take a location.
21425
21426 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21427
21428         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21429         if two delegates are compatible.
21430
21431         (NewDelegate::DoResolve): Update to take care of the case when
21432         we instantiate a delegate from another delegate.
21433
21434         * typemanager.cs (FindMembers): Don't even try to look up members
21435         of Delegate types for now.
21436
21437 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21438
21439         * delegate.cs (NewDelegate): New class to take care of delegate
21440         instantiation.
21441
21442         * expression.cs (New): Split the delegate related code out into 
21443         the NewDelegate class.
21444
21445         * delegate.cs (DelegateInvocation): New class to handle delegate 
21446         invocation.
21447
21448         * expression.cs (Invocation): Split out delegate related code into
21449         the DelegateInvocation class.
21450
21451 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21452
21453         * expression.cs (New::DoResolve): Implement delegate creation fully
21454         and according to the spec.
21455
21456         (New::DoEmit): Update to handle delegates differently.
21457
21458         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21459         because of which we were printing out arguments in reverse order !
21460
21461         * delegate.cs (VerifyMethod): Implement to check if the given method
21462         matches the delegate.
21463
21464         (FullDelegateDesc): Implement.
21465
21466         (VerifyApplicability): Implement.
21467
21468         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21469         delegate invocations too.
21470
21471         (Invocation::Emit): Ditto.
21472
21473         * ../errors/cs1593.cs : Added.
21474
21475         * ../errors/cs1594.cs : Added.
21476
21477         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21478
21479 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21480
21481         * typemanager.cs (intptr_type): Core type for System.IntPtr
21482
21483         (InitCoreTypes): Update for the same.
21484
21485         (iasyncresult_type, asynccallback_type): Ditto.
21486
21487         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21488         correct.
21489
21490         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21491         too.
21492
21493         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21494         the builders for the 4 members of a delegate type :-)
21495
21496         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21497         type.
21498
21499         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21500
21501         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21502
21503 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21504
21505         * statement.cs (Break::Emit): Implement.   
21506         (Continue::Emit): Implement.
21507
21508         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21509         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21510         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21511         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21512         end loop
21513
21514         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21515         properties that track the label for the current loop (begin of the
21516         loop and end of the loop).
21517
21518 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21519
21520         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21521         use of emitting anything at all.
21522
21523         * class.cs, rootcontext.cs : Get rid of calls to the same.
21524
21525         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21526
21527         (Populate): Define the constructor correctly and set the implementation
21528         attributes.
21529
21530         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21531         have been defined.
21532
21533         (AddDelegateType): Implement.
21534
21535         (IsDelegateType): Implement helper method.
21536
21537         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21538
21539         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21540         and accordingly handle it.
21541
21542         * delegate.cs (Populate): Take TypeContainer argument.
21543         Implement bits to define the Invoke method. However, I still haven't figured out
21544         how to take care of the native int bit :-(
21545
21546         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21547         Qualify the name of the delegate, not its return type !
21548
21549         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21550         conversion.
21551
21552         (StandardConversionExists): Checking for array types turns out to be recursive.
21553
21554         (ConvertReferenceExplicit): Implement array conversion.
21555
21556         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21557
21558 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21559
21560         * cs-parser.jay (delegate_declaration): Store the fully qualified
21561         name as it is a type declaration.
21562
21563         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21564         readonly.
21565
21566         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21567         as TypeContainer::DefineType.
21568
21569         (Populate): Method in which all the definition of the various methods (Invoke)
21570         etc is done.
21571
21572         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21573         see.
21574
21575         (CloseDelegate): Finally creates the delegate.
21576
21577         * class.cs (TypeContainer::DefineType): Update to define delegates.
21578         (Populate, Emit and CloseType): Do the same thing here too.
21579
21580         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21581         delegates in all these operations.
21582
21583 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21584
21585         * expression.cs: LocalTemporary: a new expression used to
21586         reference a temporary that has been created.
21587
21588         * assign.cs: Handle PropertyAccess back here, so that we can
21589         provide the proper semantic access to properties.
21590
21591         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21592         a few more explicit conversions. 
21593
21594         * modifiers.cs: `NEW' modifier maps to HideBySig.
21595
21596         * expression.cs (PropertyExpr): Make this into an
21597         ExpressionStatement, and support the EmitStatement code path. 
21598
21599         Perform get/set error checking, clean up the interface.
21600
21601         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21602         them into toplevel access objects.
21603
21604 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21605
21606         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21607         SRE.
21608
21609         * typemanager.cs: Keep track here of our PropertyBuilders again to
21610         work around lameness in SRE.
21611
21612 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21613
21614         * expression.cs (LValue::LValueResolve): New method in the
21615         interface, used to perform a second resolution pass for LValues. 
21616
21617         (This::DoResolve): Catch the use of this in static methods.
21618
21619         (This::LValueResolve): Implement.
21620
21621         (This::Store): Remove warning, assigning to `this' in structures
21622         is 
21623
21624         (Invocation::Emit): Deal with invocation of
21625         methods on value types.  We need to pass the address to structure
21626         methods rather than the object itself.  (The equivalent code to
21627         emit "this" for structures leaves the entire structure on the
21628         stack instead of a pointer to it). 
21629
21630         (ParameterReference::DoResolve): Compute the real index for the
21631         argument based on whether the method takes or not a `this' pointer
21632         (ie, the method is static).
21633
21634         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21635         value types returned from functions when we need to invoke a
21636         method on the sturcture.
21637
21638
21639 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21640
21641         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21642         defining the type in the Modulebuilder or Typebuilder. This is to take
21643         care of nested types which need to be defined on the TypeBuilder using
21644         DefineNestedMethod.
21645
21646         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21647         methods in RootContext, only ported to be part of TypeContainer.
21648
21649         (TypeContainer::GetInterfaceOrClass): Ditto.
21650
21651         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21652
21653         * interface.cs (Interface::DefineInterface): New method. Does exactly
21654         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21655         too.
21656
21657         (Interface::GetInterfaces): Move from RootContext here and port.
21658
21659         (Interface::GetInterfaceByName): Same here.
21660
21661         * rootcontext.cs (ResolveTree): Re-write.
21662
21663         (PopulateTypes): Re-write.
21664
21665         * class.cs (TypeContainer::Populate): Populate nested types too.
21666         (TypeContainer::Emit): Emit nested members too.
21667
21668         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21669         instead just use the name argument passed in as it is already fully
21670         qualified.
21671
21672         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21673         to TypeContainer mapping to see if a type is user-defined.
21674
21675         * class.cs (TypeContainer::CloseType): Implement. 
21676
21677         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21678         the default constructor.
21679
21680         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21681         twice.
21682
21683         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21684
21685         * interface.cs (CloseType): Create the type here.
21686
21687         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21688         the hierarchy.
21689
21690         Remove all the methods which are now in TypeContainer.
21691
21692 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21693
21694         * delegate.cs (Define): Re-write bits to define the delegate
21695         correctly.
21696
21697 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21698
21699         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21700
21701         * expression.cs (ImplicitReferenceConversion): handle null as well
21702         as a source to convert to any reference type.
21703
21704         * statement.cs (Return): Perform any implicit conversions to
21705         expected return type.  
21706
21707         Validate use of return statement.  
21708
21709         * codegen.cs (EmitContext): Pass the expected return type here.
21710
21711         * class.cs (Method, Constructor, Property): Pass expected return
21712         type to EmitContext.
21713
21714 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21715
21716         * expression.cs: Make DoResolve take an EmitContext instead of a
21717         TypeContainer.
21718
21719         Replaced `l' and `location' for `loc', for consistency.
21720
21721         (Error, Warning): Remove unneeded Tc argument.
21722
21723         * assign.cs, literal.cs, constant.cs: Update to new calling
21724         convention. 
21725
21726         * codegen.cs: EmitContext now contains a flag indicating whether
21727         code is being generated in a static method or not.
21728
21729         * cs-parser.jay: DecomposeQI, new function that replaces the old
21730         QualifiedIdentifier.  Now we always decompose the assembled
21731         strings from qualified_identifier productions into a group of
21732         memberaccesses.
21733
21734 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21735
21736         * rootcontext.cs: Deal with field-less struct types correctly now
21737         by passing the size option to Define Type.
21738
21739         * class.cs: Removed hack that created one static field. 
21740
21741 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21742
21743         * statement.cs: Moved most of the code generation here. 
21744
21745 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21746
21747         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21748         seem very right.
21749
21750         (ElementAccess): Remove useless bits for now - keep checks as the spec
21751         says.
21752
21753 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21754
21755         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21756         and start performing checks according to the spec.
21757
21758 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21759
21760         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21761         rank_specifiers instead.
21762
21763         (rank_specifiers): Change the order in which the rank specifiers are stored
21764
21765         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21766
21767         * expression.cs (ElementAccess): Implement the LValue interface too.
21768
21769 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21770
21771         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21772         except that user defined conversions are not included.
21773
21774         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21775         perform the conversion of the return type, if necessary.
21776
21777         (New::DoResolve): Check whether we are creating an array or an object
21778         and accordingly do the needful.
21779
21780         (New::Emit): Same here.
21781
21782         (New::DoResolve): Implement guts of array creation.
21783
21784         (New::FormLookupType): Helper function.
21785
21786 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21787
21788         * codegen.cs: Removed most of the code generation here, and move the
21789         corresponding code generation bits to the statement classes. 
21790
21791         Added support for try/catch/finalize and throw.
21792
21793         * cs-parser.jay: Added support for try/catch/finalize.
21794
21795         * class.cs: Catch static methods having the flags override,
21796         virtual or abstract.
21797
21798         * expression.cs (UserCast): This user cast was not really doing
21799         what it was supposed to do.  Which is to be born in fully resolved
21800         state.  Parts of the resolution were being performed at Emit time! 
21801
21802         Fixed this code.
21803
21804 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21805
21806         * expression.cs: Implicity convert the result from UserCast.
21807
21808 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21809
21810         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21811         prevented it from working correctly. 
21812
21813         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21814         merely ConvertImplicit.
21815
21816 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21817
21818         * typemanager.cs: Make the LookupTypeContainer function static,
21819         and not per-instance.  
21820
21821         * class.cs: Make static FindMembers (the one that takes a Type
21822         argument). 
21823
21824         * codegen.cs: Add EmitForeach here.
21825
21826         * cs-parser.jay: Make foreach a toplevel object instead of the
21827         inline expansion, as we need to perform semantic analysis on it. 
21828
21829 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21830
21831         * expression.cs (Expression::ImplicitUserConversion): Rename to
21832         UserDefinedConversion.
21833
21834         (Expression::UserDefinedConversion): Take an extra argument specifying 
21835         whether we look for explicit user conversions too.
21836
21837         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21838
21839         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21840
21841         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21842         with the appropriate arguments.
21843
21844         * cs-parser.jay (cast_expression): Record location too.
21845
21846         * expression.cs (Cast): Record location info.
21847
21848         (Expression::ConvertExplicit): Take location argument.
21849
21850         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21851         to determine if we are doing explicit conversions.
21852
21853         (UserCast::Emit): Update accordingly.
21854
21855         (Expression::ConvertExplicit): Report an error if everything fails.
21856
21857         * ../errors/cs0030.cs : Add.
21858
21859 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21860
21861         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21862         virtual and newslot bits. 
21863
21864         * class.cs (TypeContainer::RegisterRequiredImplementations):
21865         Record methods we need.
21866
21867         (TypeContainer::MakeKey): Helper function to make keys for
21868         MethodBases, since the Methodbase key is useless.
21869
21870         (TypeContainer::Populate): Call RegisterRequiredImplementations
21871         before defining the methods.   
21872
21873         Create a mapping for method_builders_to_methods ahead of time
21874         instead of inside a tight loop.
21875
21876         (::RequireMethods):  Accept an object as the data to set into the
21877         hashtable so we can report interface vs abstract method mismatch.
21878
21879 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21880
21881         * report.cs: Make all of it static.
21882
21883         * rootcontext.cs: Drop object_type and value_type computations, as
21884         we have those in the TypeManager anyways.
21885
21886         Drop report instance variable too, now it is a global.
21887
21888         * driver.cs: Use try/catch on command line handling.
21889
21890         Add --probe option to debug the error reporting system with a test
21891         suite. 
21892
21893         * report.cs: Add support for exiting program when a probe
21894         condition is reached.
21895
21896 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21897
21898         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21899         we do a forcible conversion regardless of type, to check if 
21900         ForceConversion returns a null.
21901
21902         (Binary::error19): Use location to report error.
21903
21904         (Unary::error23): Use location here too.
21905
21906         * ../errors/cs0019.cs : Check in.
21907
21908         * ../errors/cs0023.cs : Check in.
21909
21910         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21911         case of a non-null MethodInfo object with a length of 0 !
21912
21913         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21914         an applicable member - according to the spec :-)
21915         Also fix logic to find members in base types.
21916
21917         (Unary::ResolveOperator): Same here.
21918
21919         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21920         as I was getting thoroughly confused between this and error19 :-)
21921
21922         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21923         (::FindMostEncompassedType): Implement.
21924         (::FindMostEncompassingType): Implement.
21925         (::StandardConversionExists): Implement.
21926
21927         (UserImplicitCast): Re-vamp. We now need info about most specific
21928         source and target types so that we can do the necessary conversions.
21929
21930         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21931         mathematical union with no duplicates.
21932
21933 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21934
21935         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21936         in order from base classes to child classes, so that we can in
21937         child classes look up in our parent for method names and
21938         attributes (required for handling abstract, virtual, new, override
21939         constructs: we need to instrospect our base class, and if we dont
21940         populate the classes in order, the introspection might be
21941         incorrect.  For example, a method could query its parent before
21942         the parent has any methods and would determine that the parent has
21943         no abstract methods (while it could have had them)).
21944
21945         (RootContext::CreateType): Record the order in which we define the
21946         classes.
21947
21948 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21949
21950         * class.cs (TypeContainer::Populate): Also method definitions can
21951         fail now, keep track of this.
21952
21953         (TypeContainer::FindMembers): Implement support for
21954         DeclaredOnly/noDeclaredOnly flag.
21955
21956         (Constructor::Emit) Return the ConstructorBuilder.
21957
21958         (Method::Emit) Return the MethodBuilder. 
21959         Check for abstract or virtual methods to be public.
21960
21961         * rootcontext.cs (RootContext::CreateType): Register all the
21962         abstract methods required for the class to be complete and the
21963         interface methods that must be implemented. 
21964
21965         * cs-parser.jay: Report error 501 (method requires body if it is
21966         not marked abstract or extern).
21967
21968         * expression.cs (TypeOf::Emit): Implement.
21969
21970         * typemanager.cs: runtime_handle_type, new global type.
21971
21972         * class.cs (Property::Emit): Generate code for properties.
21973
21974 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21975
21976         * expression.cs (Unary::ResolveOperator): Find operators on base type
21977         too - we now conform exactly to the spec.
21978
21979         (Binary::ResolveOperator): Same here.
21980
21981         * class.cs (Operator::Define): Fix minor quirk in the tests.
21982
21983         * ../errors/cs0215.cs : Added.
21984
21985         * ../errors/cs0556.cs : Added.
21986
21987         * ../errors/cs0555.cs : Added.
21988
21989 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21990
21991         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21992         single integer which is really efficient
21993
21994 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21995
21996         *  expression.cs (Expression::ImplicitUserConversion): Use location
21997         even in the case when we are examining True operators.
21998  
21999         * class.cs (Operator::Define): Perform extensive checks to conform
22000         with the rules for operator overloading in the spec.
22001
22002         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22003         some of the other conversions mentioned in the spec.
22004
22005         * typemanager.cs (array_type): New static member for the System.Array built-in
22006         type.
22007
22008         (cloneable_interface): For System.ICloneable interface.
22009
22010         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22011         we start resolving the tree and populating types.
22012
22013         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22014  
22015 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22016
22017         * expression.cs (Expression::ExprClassFromMemberInfo,
22018         Expression::Literalize): Create literal expressions from
22019         FieldInfos which are literals.
22020
22021         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22022         type casts, because they were wrong.  The test suite in tests
22023         caught these ones.
22024
22025         (ImplicitNumericConversion): ushort to ulong requires a widening
22026         cast. 
22027
22028         Int32 constant to long requires widening cast as well.
22029
22030         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22031         for integers because the type on the stack is not i4.
22032
22033 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22034
22035         * expression.cs (report118): require location argument. 
22036
22037         * parameter.cs: Do not dereference potential null value.
22038
22039         * class.cs: Catch methods that lack the `new' keyword when
22040         overriding a name.  Report warnings when `new' is used without
22041         anything being there to override.
22042
22043         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22044
22045         * class.cs: Only add constructor to hashtable if it is non-null
22046         (as now constructors can fail on define).
22047
22048         (TypeManager, Class, Struct): Take location arguments.
22049
22050         Catch field instance initialization in structs as errors.
22051
22052         accepting_filter: a new filter for FindMembers that is static so
22053         that we dont create an instance per invocation.
22054
22055         (Constructor::Define): Catch errors where a struct constructor is
22056         parameterless 
22057
22058         * cs-parser.jay: Pass location information for various new
22059         constructs. 
22060
22061         * delegate.cs (Delegate): take a location argument.
22062
22063         * driver.cs: Do not call EmitCode if there were problesm in the
22064         Definition of the types, as many Builders wont be there. 
22065
22066         * decl.cs (Decl::Decl): Require a location argument.
22067
22068         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22069         into integers, and find the most appropiate integer for it.
22070
22071         * literal.cs: Implement ULongLiteral.
22072
22073         * rootcontext.cs: Provide better information about the location of
22074         failure when CreateType fails.
22075
22076 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22077
22078         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22079         as well.
22080
22081         * expression.cs (Binary::CheckShiftArguments): Add missing type
22082         computation.
22083         (Binary::ResolveOperator): Add type to the logical and and logical
22084         or, Bitwise And/Or and Exclusive Or code paths, it was missing
22085         before.
22086
22087         (Binary::DoNumericPromotions): In the case where either argument
22088         is ulong (and most signed types combined with ulong cause an
22089         error) perform implicit integer constant conversions as well.
22090
22091 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22092
22093         * expression.cs (UserImplicitCast): Method should always be
22094         non-null. 
22095         (Invocation::BetterConversion): Simplified test for IntLiteral.
22096
22097         (Expression::ImplicitNumericConversion): Split this routine out.
22098         Put the code that performs implicit constant integer conversions
22099         here. 
22100
22101         (Expression::Resolve): Become a wrapper around DoResolve so we can
22102         check eclass and type being set after resolve.
22103
22104         (Invocation::Badness): Remove this dead function
22105
22106         (Binary::ResolveOperator): Do not compute the expensive argumnets
22107         unless we have a union for it.
22108
22109         (Probe::Emit): Is needs to do an isinst and then
22110         compare against null.
22111
22112         (::CanConvert): Added Location argument.  If the Location argument
22113         is null (Location.Null), then we do not report errors.  This is
22114         used by the `probe' mechanism of the Explicit conversion.  We do
22115         not want to generate an error for something that the user
22116         explicitly requested to be casted.  But the pipeline for an
22117         explicit cast first tests for potential implicit casts.
22118
22119         So for now, if the Location is null, it means `Probe only' to
22120         avoid adding another argument.   Might have to revise this
22121         strategy later.
22122
22123         (ClassCast): New class used to type cast objects into arbitrary
22124         classes (used in Explicit Reference Conversions).
22125
22126         Implement `as' as well.
22127
22128         Reverted all the patches from Ravi below: they were broken:
22129
22130                 * The use of `level' as a mechanism to stop recursive
22131                   invocations is wrong.  That was there just to catch the
22132                   bug with a strack trace but not as a way of addressing
22133                   the problem.
22134
22135                   To fix the problem we have to *understand* what is going
22136                   on and the interactions and come up with a plan, not
22137                   just get things going.
22138
22139                 * The use of the type conversion cache that I proposed
22140                   last night had an open topic: How does this work across
22141                   protection domains.  A user defined conversion might not
22142                   be public in the location where we are applying the
22143                   conversion, a different conversion might be selected
22144                   (ie, private A->B (better) but public B->A (worse),
22145                   inside A, A->B applies, but outside it, B->A will
22146                   apply).
22147
22148                 * On top of that (ie, even if the above is solved),
22149                   conversions in a cache need to be abstract.  Ie, `To
22150                   convert from an Int to a Short use an OpcodeCast', not
22151                   `To convert from an Int to a Short use the OpcodeCast on
22152                   the variable 5' (which is what this patch was doing).
22153
22154 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22155
22156         * expression.cs (Invocation::ConversionExists): Re-write to use
22157         the conversion cache
22158
22159         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22160         cache all conversions done, not just user-defined ones.
22161
22162         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22163         to determine if a conversion exists instead of acutually trying to 
22164         perform the conversion. It's faster too.
22165
22166         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22167         and only then attempt the implicit conversion.
22168
22169 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22170
22171         * expression.cs (ConvertImplicit): Use a cache for conversions
22172         already found. Check level of recursion and bail out if necessary.
22173
22174 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22175
22176         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22177         Export standard methods that we expect for string operations.
22178
22179         * statement.cs (Block::UsageWarning): Track usage of variables and
22180         report the errors for not used variables.
22181
22182         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22183         operator. 
22184
22185 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22186
22187         * codegen.cs: remove unnneded code 
22188
22189         * expression.cs: Removed BuiltinTypeAccess class
22190
22191         Fix the order in which implicit conversions are
22192         done.  
22193
22194         The previous fixed dropped support for boxed conversions (adding a
22195         test to the test suite now)
22196
22197         (UserImplicitCast::CanConvert): Remove test for source being null,
22198         that code is broken.  We should not feed a null to begin with, if
22199         we do, then we should track the bug where the problem originates
22200         and not try to cover it up here.
22201
22202         Return a resolved expression of type UserImplicitCast on success
22203         rather than true/false.  Ravi: this is what I was talking about,
22204         the pattern is to use a static method as a "constructor" for
22205         objects. 
22206
22207         Also, do not create arguments until the very last minute,
22208         otherwise we always create the arguments even for lookups that
22209         will never be performed. 
22210
22211         (UserImplicitCast::Resolve): Eliminate, objects of type
22212         UserImplicitCast are born in a fully resolved state. 
22213
22214         * typemanager.cs (InitCoreTypes): Init also value_type
22215         (System.ValueType). 
22216
22217         * expression.cs (Cast::Resolve): First resolve the child expression.
22218
22219         (LValue): Add new method AddressOf to be used by
22220         the `&' operator.  
22221
22222         Change the argument of Store to take an EmitContext instead of an
22223         ILGenerator, because things like FieldExpr need to be able to call
22224         their children expression to generate the instance code. 
22225
22226         (Expression::Error, Expression::Warning): Sugar functions for
22227         reporting errors.
22228
22229         (Expression::MemberLookup): Accept a TypeContainer instead of a
22230         Report as the first argument.
22231
22232         (Expression::ResolvePrimary): Killed.  I still want to improve
22233         this as currently the code is just not right.
22234
22235         (Expression::ResolveMemberAccess): Simplify, but it is still
22236         wrong. 
22237
22238         (Unary::Resolve): Catch errors in AddressOf operators.
22239
22240         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22241         index to a byte for the short-version, or the compiler will choose
22242         the wrong Emit call, which generates the wrong data.
22243
22244         (ParameterReference::Emit, ::Store): same.
22245
22246         (FieldExpr::AddressOf): Implement.
22247
22248         * typemanager.cs: TypeManager: made public variable instead of
22249         property.
22250
22251         * driver.cs: document --fatal.
22252
22253         * report.cs (ErrorMessage, WarningMessage): new names for the old
22254         Error and Warning classes.
22255
22256         * cs-parser.jay (member_access): Turn built-in access to types
22257         into a normal simplename
22258
22259 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22260
22261         * expression.cs (Invocation::BetterConversion): Fix to cope
22262         with q being null, since this was introducing a bug.
22263
22264         * expression.cs (ConvertImplicit): Do built-in conversions first.
22265
22266 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22267
22268         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22269
22270 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22271
22272         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22273         I had introduced long ago (what's new ?).
22274
22275         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22276         the work of all the checking. 
22277         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22278         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22279
22280         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22281         that is the right way. 
22282
22283         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22284         overloading resolution. Use everywhere instead of cutting and pasting code.
22285
22286         (Binary::ResolveOperator): Use MakeUnionSet.
22287
22288         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22289         we have to convert to bool types. Not complete yet.
22290
22291 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22292
22293         * typemanager.cs (TypeManager::CSharpName): support ushort.
22294
22295         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22296         to provide an expression that performsn an implicit constant int
22297         conversion (section 6.1.6).
22298         (Expression::ConvertImplicitRequired): Reworked to include
22299         implicit constant expression conversions.
22300
22301         (Expression::ConvertNumericExplicit): Finished.
22302
22303         (Invocation::Emit): If InstanceExpression is null, then it means
22304         that we perform a call on this.
22305
22306 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22307
22308         * expression.cs (Unary::Emit): Remove some dead code.
22309         (Probe): Implement Resolve and Emit for `is'.
22310         (Expression::ConvertImplicitRequired): Attempt to do constant
22311         expression conversions here.  Maybe should be moved to
22312         ConvertImplicit, but I am not sure.
22313         (Expression::ImplicitLongConstantConversionPossible,
22314         Expression::ImplicitIntConstantConversionPossible): New functions
22315         that tell whether is it possible to apply an implicit constant
22316         expression conversion.
22317
22318         (ConvertNumericExplicit): Started work on explicit numeric
22319         conversions.
22320
22321         * cs-parser.jay: Update operator constants.
22322
22323         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22324         (Parameters::GetSignature): Hook up VerifyArgs here.
22325         (Parameters::VerifyArgs): Verifies that no two arguments have the
22326         same name. 
22327
22328         * class.cs (Operator): Update the operator names to reflect the
22329         ones that the spec expects (as we are just stringizing the
22330         operator names).
22331
22332         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22333         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22334         previous usage did only work for our methods.
22335         (Expression::ConvertImplicit): Handle decimal implicit numeric
22336         conversions as well.
22337         (Expression::InternalTypeConstructor): Used to invoke constructors
22338         on internal types for default promotions.
22339
22340         (Unary::Emit): Implement special handling for the pre/post
22341         increment/decrement for overloaded operators, as they need to have
22342         the same semantics as the other operators.
22343
22344         (Binary::ResolveOperator): ditto.
22345         (Invocation::ConversionExists): ditto.
22346         (UserImplicitCast::Resolve): ditto.
22347
22348 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22349
22350         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22351         operator, return after emitting body. Regression tests pass again !
22352
22353         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22354         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22355         (Invocation::OverloadResolve): Ditto.
22356         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22357
22358         * everywhere : update calls to the above methods accordingly.
22359
22360 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22361
22362         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22363
22364         * expression.cs (ExpressionStatement): New base class used for
22365         expressions that can appear in statements, so that we can provide
22366         an alternate path to generate expression that do not leave a value
22367         on the stack.
22368
22369         (Expression::Emit, and all the derivatives): We no longer return
22370         whether a value is left on the stack or not.  Every expression
22371         after being emitted leaves a single value on the stack.
22372
22373         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22374         facilties of ExpressionStatement if possible.
22375
22376         * cs-parser.jay: Update statement_expression.
22377
22378 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22379
22380         * driver.cs: Change the wording of message
22381
22382 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22383
22384         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22385         the type of the expression to the return type of the method if
22386         we have an overloaded operator match ! The regression tests pass again !
22387         (Unary::ResolveOperator): Ditto.
22388
22389         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22390         to find "op_Implicit", not "implicit" ;-)
22391         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22392         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22393
22394         * everywhere : Correct calls to the above accordingly.
22395
22396         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22397         (ConvertImplicit): Do user-defined conversion if it exists.
22398
22399 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22400
22401         * assign.cs: track location.
22402         (Resolve): Use implicit conversions on assignment.
22403
22404         * literal.cs: Oops.  Not good, Emit of short access values should
22405         pass (Bytes) or the wrong argument will be selected.
22406
22407         * expression.cs (Unary::Emit): Emit code for -expr.
22408
22409         (Unary::ResolveOperator): Handle `Substract' for non-constants
22410         (substract from zero from the non-constants).
22411         Deal with Doubles as well. 
22412
22413         (Expression::ConvertImplicitRequired): New routine that reports an
22414         error if no implicit conversion exists. 
22415
22416         (Invocation::OverloadResolve): Store the converted implicit
22417         expressions if we make them
22418
22419 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22420
22421         * class.cs (ConstructorInitializer): Take a Location argument.
22422         (ConstructorBaseInitializer): Same here.
22423         (ConstructorThisInitializer): Same here.
22424
22425         * cs-parser.jay : Update all calls accordingly.
22426
22427         * expression.cs (Unary, Binary, New): Take location argument.
22428         Update accordingly everywhere.
22429
22430         * cs-parser.jay : Update all calls to the above to take a location
22431         argument.
22432
22433         * class.cs : Ditto.
22434
22435 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22436
22437         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22438         (Invocation::BetterConversion): Same here
22439         (Invocation::ConversionExists): Ditto.
22440
22441         (Invocation::ConversionExists): Implement.
22442
22443 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22444
22445         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22446         Also take an additional TypeContainer argument.
22447
22448         * All over : Pass in TypeContainer as argument to OverloadResolve.
22449
22450         * typemanager.cs (CSharpName): Update to check for the string type and return
22451         that too.
22452
22453         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22454         a given method.
22455
22456 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22457
22458         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22459         (Invocation::BetterFunction): Implement.
22460         (Invocation::BetterConversion): Implement.
22461         (Invocation::ConversionExists): Skeleton, no implementation yet.
22462
22463         Okay, things work fine !
22464
22465 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22466
22467         * typemanager.cs: declare and load enum_type, delegate_type and
22468         void_type. 
22469
22470         * expression.cs (Expression::Emit): Now emit returns a value that
22471         tells whether a value is left on the stack or not.  This strategy
22472         might be reveted tomorrow with a mechanism that would address
22473         multiple assignments.
22474         (Expression::report118): Utility routine to report mismatches on
22475         the ExprClass.
22476
22477         (Unary::Report23): Report impossible type/operator combination
22478         utility function.
22479
22480         (Unary::IsIncrementableNumber): Whether the type can be
22481         incremented or decremented with add.
22482         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22483         complemented. 
22484         (Unary::ResolveOperator): Implement ++, !, ~,
22485
22486         (Invocation::Emit): Deal with new Emit convetion.
22487
22488         * All Expression derivatives: Updated their Emit method to return
22489         whether they leave values on the stack or not.
22490
22491         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22492         stack for expressions that are statements. 
22493
22494 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22495
22496         * expression.cs (LValue): New interface.  Must be implemented by
22497         LValue objects.
22498         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22499         LValue interface.
22500
22501         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22502         interface for generating code, simplifies the code.
22503
22504 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22505
22506         * expression.cs (everywhere): Comment out return statements in ::Resolve
22507         methods to avoid the warnings.
22508
22509 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22510
22511         * driver.cs (parse): Report error 2001 if we can not open the
22512         source file.
22513
22514         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22515         not resolve it.
22516
22517         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22518         object. 
22519
22520         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22521         otherwise nested blocks end up with the same index.
22522
22523         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22524
22525         * expression.cs:  Instead of having FIXMEs in the Resolve
22526         functions, throw exceptions so it is obvious that we are facing a
22527         bug. 
22528
22529         * cs-parser.jay (invocation_expression): Pass Location information.
22530
22531         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22532         Use a basename for those routines because .NET does not like paths
22533         on them. 
22534
22535         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22536         already defined.
22537
22538 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22539
22540         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22541         are loading the correct data types (throws an exception if not).
22542         (TypeManager::InitCoreTypes): Use CoreLookupType
22543
22544         * expression.cs (Unary::ResolveOperator): return the child
22545         expression for expressions which are just +expr.
22546         (Unary::ResolveOperator): Return negative literals for -LITERAL
22547         expressions (otherwise they are Unary {Literal}).
22548         (Invocation::Badness): Take into account `Implicit constant
22549         expression conversions'.
22550
22551         * literal.cs (LongLiteral): Implement long literal class.
22552         (IntLiteral): export the `Value' of the intliteral. 
22553
22554 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22555
22556         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22557
22558         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22559         instead of 'Operator'
22560
22561         * expression.cs (Binary::ResolveOperator): Update accordingly.
22562         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22563         and 'Minus'
22564
22565         * cs-parser.jay (unary_expression): Update to use the new names.
22566
22567         * gen-treedump.cs (GetUnary): Same here.
22568
22569         * expression.cs (Unary::Resolve): Implement.
22570         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22571         operators are found instead of making noise ;-)
22572         (Unary::ResolveOperator): New method to do precisely the same thing which
22573         Binary::ResolveOperator does for Binary expressions.
22574         (Unary.method, .Arguments): Add.
22575         (Unary::OperName): Implement.   
22576         (Unary::ForceConversion): Copy and Paste !
22577
22578         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22579         a unary operator.
22580
22581         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22582         for the inbuilt operators. Only overloading works for now ;-)
22583
22584 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22585
22586         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22587         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22588
22589         * expression.cs (This::Emit): Implement. 
22590         (This::Resolve): Implement.
22591         (TypeOf:Resolve): Implement.
22592         (Expression::ResolveSimpleName): Add an implicit this to instance
22593         field references. 
22594         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22595         Bind instance variable to Field expressions.
22596         (FieldExpr::Instance): New field used to track the expression that
22597         represents the object instance.
22598         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22599         binding 
22600         (FieldExpr::Emit): Implement.
22601
22602         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22603         the last instruction contains a return opcode to avoid generating
22604         the last `ret' instruction (this generates correct code, and it is
22605         nice to pass the peverify output).
22606
22607         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22608         initializer for static and instance variables.
22609         (Constructor::Emit): Allow initializer to be null in the case of
22610         static constructors.  Only emit initializer for instance
22611         constructors. 
22612
22613         (TypeContainer::FindMembers): Return a null array if there are no
22614         matches.
22615
22616         Also fix the code for the MemberTypes.Method branch, as it was not
22617         scanning that for operators (or tried to access null variables before).
22618
22619         * assign.cs (Assign::Emit): Handle instance and static fields. 
22620
22621         * TODO: Updated.
22622
22623         * driver.cs: Stop compilation if there are parse errors.
22624
22625         * cs-parser.jay (constructor_declaration): Provide default base
22626         initializer for non-static constructors.
22627         (constructor_declarator): Do not provide a default base
22628         initializers if none was specified.
22629         Catch the fact that constructors should not have parameters.
22630
22631         * class.cs: Do not emit parent class initializers for static
22632         constructors, that should be flagged as an error.
22633
22634 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22635
22636         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22637         Move back code into TypeContainer::Populate.
22638
22639 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22640
22641         * class.cs (TypeContainer::AddConstructor): Fix the check to
22642         compare against Name, not Basename. 
22643         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22644
22645         * cs-parser.jay : Update accordingly.
22646
22647         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22648         for methods, don't forget to look into the operators too.
22649         (RegisterMethodBuilder): Helper method to take care of this for
22650         methods, constructors and operators.
22651         (Operator::Define): Completely revamp.
22652         (Operator.OperatorMethod, MethodName): New fields.
22653         (TypeContainer::Populate): Move the registering of builders into
22654         RegisterMethodBuilder.
22655         (Operator::Emit): Re-write.
22656
22657         * expression.cs (Binary::Emit): Comment out code path to emit method
22658         invocation stuff for the case when we have a user defined operator. I am
22659         just not able to get it right !
22660
22661 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22662
22663         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22664         argument. 
22665
22666         (Expression::MemberLookup): Provide a version that allows to
22667         specify the MemberTypes and BindingFlags. 
22668
22669         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22670         so it was not fetching variable information from outer blocks.
22671
22672         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22673         Beforefieldinit as it was buggy.
22674
22675         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22676         that Ravi put here.  
22677
22678         * class.cs (Constructor::Emit): Only emit if block is not null.
22679         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22680         deal with this by semantically definining it as if the user had
22681         done it.
22682
22683         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22684         constructors as we now "emit" them at a higher level.
22685
22686         (TypeContainer::DefineDefaultConstructor): Used to define the
22687         default constructors if none was provided.
22688
22689         (ConstructorInitializer): Add methods Resolve and Emit. 
22690
22691         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22692
22693 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22694
22695         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22696         the default constructor builder with our hashtable for methodbuilders
22697         to methodcores.
22698
22699         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22700         and argument_count is 0 in which case we have a match.
22701         (Binary::ResolveOperator): More null checking and miscellaneous coding
22702         style cleanup.
22703
22704 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22705
22706         * rootcontext.cs (IsNameSpace): Compare against null.
22707
22708         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22709
22710         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22711         and Unary::Operator.
22712
22713         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22714         accordingly.
22715
22716         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22717         we have overloaded operators.
22718         (Binary::ResolveOperator): Implement the part which does the operator overload
22719         resolution.
22720
22721         * class.cs (Operator::Emit): Implement.
22722         (TypeContainer::Emit): Emit the operators we have too.
22723
22724         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22725         the case when we have a user-defined operator.
22726
22727 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22728
22729         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22730
22731 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22732
22733         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22734         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22735         (Constructor::Emit): Implement.
22736         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22737         if we have no work to do. 
22738         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22739         Emit method.
22740
22741         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22742         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22743
22744         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22745         of parent.parent.
22746
22747 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22748
22749         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22750         in the source.
22751         (Tree::RecordNamespace): Method to do what the name says ;-)
22752         (Tree::Namespaces): Property to get at the namespaces hashtable.
22753
22754         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22755         keep track.
22756
22757         * rootcontext.cs (IsNamespace): Fixed it :-)
22758
22759 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22760
22761         * class.cs (TypeContainer::FindMembers): Add support for
22762         constructors. 
22763         (MethodCore): New class that encapsulates both the shared aspects
22764         of a Constructor and a Method.  
22765         (Method, Constructor): Factored pieces into MethodCore.
22766
22767         * driver.cs: Added --fatal which makes errors throw exceptions.
22768         Load System assembly as well as part of the standard library.
22769
22770         * report.cs: Allow throwing exceptions on errors for debugging.
22771
22772         * modifiers.cs: Do not use `parent', instead use the real type
22773         container to evaluate permission settings.
22774
22775         * class.cs: Put Ravi's patch back in.  He is right, and we will
22776         have to cope with the
22777
22778 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22779
22780         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22781         FamORAssem, not FamANDAssem.
22782
22783 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22784
22785         * driver.cs: Added --parse option that only parses its input files
22786         and terminates.
22787
22788         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22789         incorrect.  IsTopLevel is not used to tell whether an object is
22790         root_types or not (that can be achieved by testing this ==
22791         root_types).  But to see if this is a top-level *class* (not
22792         necessarly our "toplevel" container). 
22793
22794 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22795
22796         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22797         parent instead of a direct call to GetType.
22798
22799 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22800
22801         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22802         Modifiers.TypeAttr. This should just be a call to that method.
22803
22804         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22805         object so that we can determine if we are top-level or not.
22806
22807         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22808         TypeContainer too.
22809
22810         * enum.cs (Enum::Define): Ditto.
22811
22812         * modifiers.cs (FieldAttr): Re-write.
22813
22814         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22815         (TypeContainer::HaveStaticConstructor): New property to provide access
22816         to precisely that info.
22817
22818         * modifiers.cs (MethodAttr): Re-write.
22819         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22820
22821         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22822         of top-level types as claimed.
22823
22824 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22825
22826         * expression.cs (MemberLookup): Fruitless attempt to lookup
22827         constructors.  Maybe I need to emit default constructors?  That
22828         might be it (currently .NET emits this for me automatically).
22829         (Invocation::OverloadResolve): Cope with Arguments == null.
22830         (Invocation::EmitArguments): new function, shared by the new
22831         constructor and us.
22832         (Invocation::Emit): Handle static and instance methods.  Emit
22833         proper call instruction for virtual or non-virtual invocations.
22834         (New::Emit): Implement.
22835         (New::Resolve): Implement.
22836         (MemberAccess:Resolve): Implement.
22837         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22838         to track instances.
22839         (FieldExpr::Resolve): Set type.
22840
22841         * support.cs: Handle empty arguments.
22842                 
22843         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22844         SimpleLookup): Auxiliary routines to help parse a qualifier
22845         identifier.  
22846
22847         Update qualifier_identifier rule.
22848
22849         * codegen.cs: Removed debugging messages.
22850
22851         * class.cs: Make this a global thing, this acts just as a "key" to
22852         objects that we might have around.
22853
22854         (Populate): Only initialize method_builders_to_methods once.
22855
22856         * expression.cs (PropertyExpr): Initialize type from the
22857         PropertyType. 
22858
22859         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22860         Resolve pattern.  Attempt to implicitly convert value to boolean.
22861         Emit code.
22862
22863         * expression.cs: Set the type for the int32/int32 argument case.
22864         (Binary::ResolveOperator): Set the return type to boolean for
22865         comparission operators
22866
22867         * typemanager.cs: Remove debugging print code.
22868
22869         (Invocation::Resolve): resolve type.
22870
22871         * class.cs: Allocate a MemberInfo of the correct size, as the code
22872         elsewhere depends on the test to reflect the correct contents.
22873
22874         (Method::) Keep track of parameters, due to System.Reflection holes
22875
22876         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22877         mapping here.
22878
22879         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22880         of the exact size and return that.
22881
22882         (Class::LookupMethodByBuilder): New function that maps
22883         MethodBuilders to its methods.  Required to locate the information
22884         on methods because System.Reflection bit us again.
22885
22886         * support.cs: New file, contains an interface ParameterData and
22887         two implementations: ReflectionParameters and InternalParameters
22888         used to access Parameter information.  We will need to grow this
22889         as required.
22890
22891         * expression.cs (Invocation::GetParameterData): implement a cache
22892         and a wrapper around the ParameterData creation for methods. 
22893         (Invocation::OverloadResolve): Use new code.
22894
22895 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22896
22897         * class.cs (TypeContainer::EmitField): Remove and move into 
22898         (Field::Define): here and modify accordingly.
22899         (Field.FieldBuilder): New member.
22900         (TypeContainer::Populate): Update accordingly.
22901         (TypeContainer::FindMembers): Implement.
22902
22903 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22904
22905         * statement.cs: (VariableInfo::VariableType): New field to be
22906         initialized with the full type once it is resolved. 
22907
22908 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22909
22910         * parameter.cs (GetParameterInfo): Use a type cache to compute
22911         things only once, and to reuse this information
22912
22913         * expression.cs (LocalVariableReference::Emit): Implement.
22914         (OpcodeCast::Emit): fix.
22915
22916         (ParameterReference::Resolve): Implement.
22917         (ParameterReference::Emit): Implement.
22918
22919         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22920         that are expressions need to stay as Expressions.
22921
22922         * typemanager.cs (CSharpName): Returns the C# name of a type if
22923         possible. 
22924
22925         * expression.cs (Expression::ConvertImplicit): New function that
22926         implements implicit type conversions.
22927
22928         (Expression::ImplicitReferenceConversion): Implements implicit
22929         reference conversions.
22930
22931         (EmptyCast): New type for transparent casts.
22932
22933         (OpcodeCast): New type for casts of types that are performed with
22934         a sequence of bytecodes.
22935
22936         (BoxedCast): New type used for casting value types into reference
22937         types.  Emits a box opcode.
22938
22939         (Binary::DoNumericPromotions): Implements numeric promotions of
22940         and computation of the Binary::Type.
22941
22942         (Binary::EmitBranchable): Optimization.
22943
22944         (Binary::Emit): Implement code emission for expressions.
22945
22946         * typemanager.cs (TypeManager): Added two new core types: sbyte
22947         and byte.
22948
22949 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22950
22951         * class.cs (TypeContainer::FindMembers): Method which does exactly
22952         what Type.FindMembers does, only we don't have to use reflection. No
22953         implementation yet.
22954
22955         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22956         typecontainer objects as we need to get at them.
22957         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22958
22959         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22960         typecontainer object.
22961
22962         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22963         of just a Report object.
22964
22965 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22966
22967         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22968         "remove_"
22969         (TypeContainer::Populate): Now define the delegates of the type too.
22970         (TypeContainer.Delegates): Property to access the list of delegates defined
22971         in the type.
22972
22973         * delegates.cs (Delegate::Define): Implement partially.
22974
22975         * modifiers.cs (TypeAttr): Handle more flags.
22976
22977 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22978
22979         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22980         and not <=
22981         (Operator::Define): Re-write logic to get types by using the LookupType method
22982         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22983         (Indexer::Define): Ditto.
22984         (Event::Define): Ditto.
22985         (Property::Define): Ditto.
22986
22987 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22988
22989         * class.cs (TypeContainer::Populate): Now define operators too. 
22990         (TypeContainer.Operators): New property to access the list of operators
22991         in a type.
22992         (Operator.OperatorMethodBuilder): New member to hold the method builder
22993         for the operator we are defining.
22994         (Operator::Define): Implement.
22995
22996 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22997
22998         * class.cs (Event::Define): Make the prefixes of the accessor methods
22999         addOn_ and removeOn_ 
23000
23001         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23002         of the location being passed in too. Ideally, this should go later since all
23003         error reporting should be done through the Report object.
23004
23005         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23006         (Populate): Iterate thru the indexers we have and define them too.
23007         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23008         for the get and set accessors.
23009         (Indexer::Define): Implement.
23010
23011 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23012
23013         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23014         my previous implementation, did not work.
23015
23016         * typemanager.cs: Add a couple of missing types (the longs).
23017
23018         * literal.cs: Use TypeManager.bool_type instead of getting it.
23019
23020         * expression.cs (EventExpr): New kind of expressions.
23021         (Expressio::ExprClassFromMemberInfo): finish
23022
23023 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23024
23025         * assign.cs: Emit stores to static fields differently.
23026
23027 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23028
23029         * Merge in changes and adjust code to tackle conflicts. Backed out my
23030         code in Assign::Resolve ;-) 
23031
23032 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23033
23034         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23035         instead Report.Error and also pass in the location.
23036         (CSharpParser::Lexer): New readonly property to return the reference
23037         to the Tokenizer object.
23038         (declare_local_variables): Use Report.Error with location instead of plain 
23039         old error.
23040         (CheckDef): Ditto.
23041
23042         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23043         (Operator.CheckBinaryOperator): Ditto.
23044
23045         * cs-parser.jay (operator_declarator): Update accordingly.
23046
23047         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23048         (CheckBinaryOperator): Same here.
23049
23050         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23051         on the name without any prefixes of namespace names etc. This is because we
23052         already might have something already fully qualified like 
23053         'System.Console.WriteLine'
23054
23055         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23056
23057 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23058
23059         * cs-tokenizer.cs (location): Return a string which also contains
23060         the file name.
23061
23062         * expression.cs (ElementAccess): New class for expressions of the
23063         type 'element access.'
23064         (BaseAccess): New class for expressions of the type 'base access.'
23065         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23066         respectively.
23067
23068         * cs-parser.jay (element_access): Implement action.
23069         (base_access): Implement actions.
23070         (checked_expression, unchecked_expression): Implement.
23071
23072         * cs-parser.jay (local_variable_type): Correct and implement.
23073         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23074
23075         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23076
23077         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23078         name and the specifiers.
23079
23080         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23081
23082         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
23083         making them all public ;-)
23084
23085         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23086         class anyways.
23087
23088 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
23089
23090         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23091         PropertyExprs.
23092         (FieldExpr, PropertyExprs): New resolved expressions.
23093         (SimpleName::MemberStaticCheck): Perform static checks for access
23094         to non-static fields on static methods. Maybe this should be
23095         generalized for MemberAccesses. 
23096         (SimpleName::ResolveSimpleName): More work on simple name
23097         resolution. 
23098
23099         * cs-parser.jay (primary_expression/qualified_identifier): track
23100         the parameter index.
23101
23102         * codegen.cs (CodeGen::Save): Catch save exception, report error.
23103         (EmitContext::EmitBoolExpression): Chain to expression generation
23104         instead of temporary hack.
23105         (::EmitStatementExpression): Put generic expression code generation.
23106
23107         * assign.cs (Assign::Emit): Implement variable assignments to
23108         local variables, parameters and fields.
23109
23110 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
23111
23112         * statement.cs (Block::GetVariableInfo): New method, returns the
23113         VariableInfo for a variable name in a block.
23114         (Block::GetVariableType): Implement in terms of GetVariableInfo
23115
23116         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23117         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23118
23119 2001-09-06  Ravi Pratap  <ravi@ximian.com>
23120
23121         * cs-parser.jay (operator_declaration): Continue on my quest : update
23122         to take attributes argument.
23123         (event_declaration): Ditto.
23124         (enum_declaration): Ditto.
23125         (indexer_declaration): Ditto.
23126
23127         * class.cs (Operator::Operator): Update constructor accordingly.
23128         (Event::Event): Ditto.
23129
23130         * delegate.cs (Delegate::Delegate): Same here.
23131
23132         * enum.cs (Enum::Enum): Same here.
23133
23134 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23135
23136         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23137
23138         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23139
23140         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23141         being passed around as an arraylist.
23142         (Attributes::AddAttribute): Method to add attribute sections.
23143
23144         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23145         (struct_declaration): Update accordingly.
23146         (constant_declaration): Update.
23147         (field_declaration): Update.
23148         (method_header): Update.
23149         (fixed_parameter): Update.
23150         (parameter_array): Ditto.
23151         (property_declaration): Ditto.
23152         (destructor_declaration): Ditto.
23153
23154         * class.cs (Struct::Struct): Update constructors accordingly.
23155         (Class::Class): Ditto.
23156         (Field::Field): Ditto.
23157         (Method::Method): Ditto.
23158         (Property::Property): Ditto.
23159         (TypeContainer::OptAttribute): update property's return type.
23160
23161         * interface.cs (Interface.opt_attributes): New member.
23162         (Interface::Interface): Update to take the extra Attributes argument.
23163
23164         * parameter.cs (Parameter::Parameter): Ditto.
23165
23166         * constant.cs (Constant::Constant): Ditto.
23167
23168         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23169         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23170         the attributes as a parameter.
23171         (InterfaceProperty): Update constructor call.
23172         (InterfaceEvent): Ditto.
23173         (InterfaceMethod): Ditto.
23174         (InterfaceIndexer): Ditto.
23175
23176         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23177         pass the attributes too.
23178         (interface_event_declaration): Ditto.
23179         (interface_property_declaration): Ditto.
23180         (interface_method_declaration): Ditto.
23181         (interface_declaration): Ditto.
23182
23183 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23184
23185         * class.cs (Method::Define): Track the "static Main" definition to
23186         create an entry point. 
23187
23188         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23189         EntryPoint if we find it. 
23190
23191         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23192         (EmitContext::ig): Make this variable public.
23193
23194         * driver.cs: Make the default output file be the first file name
23195         with the .exe extension.  
23196
23197         Detect empty compilations
23198
23199         Handle various kinds of output targets.  Handle --target and
23200         rename -t to --dumper.
23201
23202         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23203         methods inherited from Expression return now an Expression.  This
23204         will is used during the tree rewriting as we resolve them during
23205         semantic analysis.
23206
23207         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23208         the spec.  Missing entirely is the information about
23209         accessability of elements of it.
23210
23211         (Expression::ExprClassFromMemberInfo): New constructor for
23212         Expressions that creates a fully initialized Expression based on
23213         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23214         a Type.
23215
23216         (Invocation::Resolve): Begin implementing resolution of invocations.
23217
23218         * literal.cs (StringLiteral):  Implement Emit.
23219
23220 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23221
23222         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23223         member.
23224
23225 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23226
23227         * cs-parser.jay (attribute_arguments): Implement actions.
23228         (attribute): Fix bug in production. Implement action.
23229         (attribute_list): Implement.
23230         (attribute_target): Implement.
23231         (attribute_target_specifier, opt_target_specifier): Implement
23232         (CheckAttributeTarget): New method to check if the attribute target
23233         is valid.
23234         (attribute_section): Implement.
23235         (opt_attributes): Implement.
23236
23237         * attribute.cs : New file to handle attributes.
23238         (Attribute): Class to hold attribute info.
23239
23240         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23241         (attribute_section): Modify production to use 2 different rules to 
23242         achieve the same thing. 1 s/r conflict down !
23243         Clean out commented, useless, non-reducing dimension_separator rules.
23244
23245         * class.cs (TypeContainer.attributes): New member to hold list
23246         of attributes for a type.
23247         (Struct::Struct): Modify to take one more argument, the attribute list.
23248         (Class::Class): Ditto.
23249         (Field::Field): Ditto.
23250         (Method::Method): Ditto.
23251         (Property::Property): Ditto.
23252
23253         * cs-parser.jay (struct_declaration): Update constructor call to
23254         pass in the attributes too.
23255         (class_declaration): Ditto.
23256         (constant_declaration): Ditto.
23257         (field_declaration): Ditto.
23258         (method_header): Ditto.
23259         (fixed_parameter): Ditto.
23260         (parameter_array): Ditto.
23261         (property_declaration): Ditto.
23262
23263         * constant.cs (Constant::Constant): Update constructor similarly.
23264         Use System.Collections.
23265
23266         * parameter.cs (Parameter::Parameter): Update as above.
23267
23268 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23269
23270         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23271         (TypeContainer.delegates): New member to hold list of delegates.
23272
23273         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23274         this time as I seem to be on crack ;-)
23275
23276 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23277
23278         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23279         tell whether an identifier represents a namespace.
23280
23281         * expression.cs (NamespaceExpr): A namespace expression, used only
23282         temporarly during expression resolution.
23283         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23284         utility functions to resolve names on expressions.
23285
23286 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23287
23288         * codegen.cs: Add hook for StatementExpressions. 
23289
23290         * class.cs: Fix inverted test for static flag in methods.
23291
23292 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23293
23294         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23295         to make it coincide with MS' number.
23296         (Operator::CheckBinaryOperator): Ditto.
23297
23298         * ../errors/errors.txt : Remove error numbers added earlier.
23299
23300         * ../errors/cs1019.cs : Test case for error # 1019
23301
23302         * ../errros/cs1020.cs : Test case for error # 1020
23303
23304         * cs-parser.jay : Clean out commented cruft.
23305         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23306         used anywhere - non-reducing rule.
23307         (namespace_declarations): Non-reducing rule - comment out.
23308
23309         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23310         with TypeContainer::AddEnum.
23311
23312         * delegate.cs : New file for delegate handling classes.
23313         (Delegate): Class for declaring delegates.
23314
23315         * makefile : Update.
23316
23317         * cs-parser.jay (delegate_declaration): Implement.
23318
23319 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23320
23321         * class.cs (Event::Define): Implement.
23322         (Event.EventBuilder): New member.
23323
23324         * class.cs (TypeContainer::Populate): Update to define all enums and events
23325         we have.
23326         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23327         readonly fields for all these cases ?
23328
23329 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23330
23331         * class.cs (Property): Revamp to use the convention of making fields readonly.
23332         Accordingly modify code elsewhere.
23333
23334         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23335         the Define method of the Property class.
23336
23337         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23338         trivial bug.
23339         (TypeContainer::Populate): Update to define all the properties we have. Also
23340         define all enumerations.
23341
23342         * enum.cs (Define): Implement.
23343
23344 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23345
23346         * cs-parser.jay (overloadable_operator): The semantic value is an
23347         enum of the Operator class.
23348         (operator_declarator): Implement actions.
23349         (operator_declaration): Implement.
23350
23351         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23352         validity of definitions.
23353         (Operator::CheckBinaryOperator): Static method to check for binary operators
23354         (TypeContainer::AddOperator): New method to add an operator to a type.
23355
23356         * cs-parser.jay (indexer_declaration): Added line to actually call the
23357         AddIndexer method so it gets added ;-)
23358
23359         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23360         already taken care of by the MS compiler ?  
23361
23362 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23363
23364         * class.cs (Operator): New class for operator declarations.
23365         (Operator::OpType): Enum for the various operators.
23366
23367 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23368
23369         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23370         ostensibly handle this in semantic analysis.
23371
23372         * cs-parser.jay (general_catch_clause): Comment out
23373         (specific_catch_clauses, specific_catch_clause): Ditto.
23374         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23375         (catch_args, opt_catch_args): New productions.
23376         (catch_clause): Rewrite to use the new productions above
23377         (catch_clauses): Modify accordingly.
23378         (opt_catch_clauses): New production to use in try_statement
23379         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23380         and re-write the code in the actions to extract the specific and
23381         general catch clauses by being a little smart ;-)
23382
23383         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23384         Hooray, try and catch statements parse fine !
23385
23386 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23387
23388         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23389         string from the hashtable of variables.
23390
23391         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23392         I end up making that mistake ;-)
23393         (catch_clauses): Fixed gross error which made Key and Value of the 
23394         DictionaryEntry the same : $1 !!
23395
23396 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23397
23398         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23399
23400         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23401         when the add and remove accessors are specified. 
23402
23403 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23404
23405         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23406         information about indexer_declarator.
23407         (indexer_declarator): Implement actions.
23408         (parsing_indexer): New local boolean used to keep track of whether
23409         we are parsing indexers or properties. This is necessary because 
23410         implicit_parameters come into picture even for the get accessor in the 
23411         case of an indexer.
23412         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23413
23414         * class.cs (Indexer): New class for indexer declarations.
23415         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23416         (TypeContainer::indexers): New member to hold list of indexers for the
23417         type.
23418
23419 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23420
23421         * cs-parser.jay (add_accessor_declaration): Implement action.
23422         (remove_accessor_declaration): Implement action.
23423         (event_accessors_declaration): Implement
23424         (variable_declarators): swap statements for first rule - trivial.
23425
23426         * class.cs (Event): New class to hold information about event
23427         declarations.
23428         (TypeContainer::AddEvent): New method to add an event to a type
23429         (TypeContainer::events): New member to hold list of events.
23430
23431         * cs-parser.jay (event_declaration): Implement actions.
23432
23433 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23434
23435         * cs-parser.jay (dim_separators): Implement. Make it a string
23436         concatenating all the commas together, just as they appear.
23437         (opt_dim_separators): Modify accordingly
23438         (rank_specifiers): Update accordingly. Basically do the same
23439         thing - instead, collect the brackets here.
23440         (opt_rank_sepcifiers): Modify accordingly.
23441         (array_type): Modify to actually return the complete type string
23442         instead of ignoring the rank_specifiers.
23443         (expression_list): Implement to collect the expressions
23444         (variable_initializer): Implement. We make it a list of expressions
23445         essentially so that we can handle the array_initializer case neatly too.
23446         (variable_initializer_list): Implement.
23447         (array_initializer): Make it a list of variable_initializers
23448         (opt_array_initializer): Modify accordingly.
23449
23450         * expression.cs (New::NType): Add enumeration to help us
23451         keep track of whether we have an object/delegate creation
23452         or an array creation.
23453         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23454         members to hold data about array creation.
23455         (New:New): Modify to update NewType
23456         (New:New): New Overloaded contructor for the array creation
23457         case.
23458
23459         * cs-parser.jay (array_creation_expression): Implement to call
23460         the overloaded New constructor.
23461
23462 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23463
23464         * class.cs (TypeContainer::Constructors): Return member
23465         constructors instead of returning null.
23466
23467 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23468
23469         * typemanager.cs (InitCoreTypes): Initialize the various core
23470         types after we have populated the type manager with the user
23471         defined types (this distinction will be important later while
23472         compiling corlib.dll)
23473
23474         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23475         on Expression Classification.  Now all expressions have a method
23476         `Resolve' and a method `Emit'.
23477
23478         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23479         generation from working.     Also add some temporary debugging
23480         code. 
23481
23482 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23483
23484         * codegen.cs: Lots of code generation pieces.  This is only the
23485         beginning, will continue tomorrow with more touches of polish.  We
23486         handle the fundamentals of if, while, do, for, return.  Others are
23487         trickier and I need to start working on invocations soon.
23488
23489         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23490         s.InitStatement. 
23491
23492         * codegen.cs (EmitContext): New struct, used during code
23493         emission to keep a context.   Most of the code generation will be
23494         here. 
23495
23496         * cs-parser.jay: Add embedded blocks to the list of statements of
23497         this block.  So code generation proceeds in a top down fashion.
23498
23499 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23500
23501         * statement.cs: Add support for multiple child blocks.
23502
23503 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23504
23505         * codegen.cs (EmitCode): New function, will emit the code for a
23506         Block of code given a TypeContainer and its ILGenerator. 
23507
23508         * statement.cs (Block): Standard public readonly optimization.
23509         (Block::Block constructors): Link children. 
23510         (Block::Child): Child Linker.
23511         (Block::EmitVariables): Emits IL variable declarations.
23512
23513         * class.cs: Drop support for MethodGroups here, delay until
23514         Semantic Analysis.
23515         (Method::): Applied the same simplification that I did before, and
23516         move from Properties to public readonly fields.
23517         (Method::ParameterTypes): Returns the parameter types for the
23518         function, and implements a cache that will be useful later when I
23519         do error checking and the semantic analysis on the methods is
23520         performed.
23521         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23522         and made a method, optional argument tells whether this is a class
23523         or a structure to apply the `has-this' bit.
23524         (Method::GetCallingConvention): Implement, returns the calling
23525         convention. 
23526         (Method::Define): Defines the type, a second pass is performed
23527         later to populate the methods.
23528
23529         (Constructor::ParameterTypes): implement a cache similar to the
23530         one on Method::ParameterTypes, useful later when we do semantic
23531         analysis. 
23532
23533         (TypeContainer::EmitMethod):  New method.  Emits methods.
23534
23535         * expression.cs: Removed MethodGroup class from here.
23536
23537         * parameter.cs (Parameters::GetCallingConvention): new method.
23538
23539 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23540
23541         * class.cs (TypeContainer::Populate): Drop RootContext from the
23542         argument. 
23543
23544         (Constructor::CallingConvention): Returns the calling convention.
23545         (Constructor::ParameterTypes): Returns the constructor parameter
23546         types. 
23547
23548         (TypeContainer::AddConstructor): Keep track of default constructor
23549         and the default static constructor.
23550
23551         (Constructor::) Another class that starts using `public readonly'
23552         instead of properties. 
23553
23554         (Constructor::IsDefault): Whether this is a default constructor. 
23555
23556         (Field::) use readonly public fields instead of properties also.
23557
23558         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23559         track of static constructors;  If none is used, turn on
23560         BeforeFieldInit in the TypeAttributes. 
23561
23562         * cs-parser.jay (opt_argument_list): now the return can be null
23563         for the cases where there are no arguments. 
23564
23565         (constructor_declarator): If there is no implicit `base' or
23566         `this', then invoke the default parent constructor. 
23567
23568         * modifiers.cs (MethodAttr): New static function maps a set of
23569         modifiers flags into a MethodAttributes enum
23570         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23571         MethodAttr, TypeAttr to represent the various mappings where the
23572         modifiers are used.
23573         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23574
23575 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23576
23577         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23578         method arguments.
23579
23580         * interface.cs (PopulateIndexer): Implemented the code generator
23581         for interface indexers.
23582
23583 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23584
23585         * interface.cs (InterfaceMemberBase): Now we track the new status
23586         here.  
23587
23588         (PopulateProperty): Implement property population.  Woohoo!  Got
23589         Methods and Properties going today. 
23590
23591         Removed all the properties for interfaces, and replaced them with
23592         `public readonly' fields. 
23593
23594 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23595
23596         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23597         initialize their hashtables/arraylists only when they are needed
23598         instead of doing this always.
23599
23600         * parameter.cs: Handle refs and out parameters.
23601
23602         * cs-parser.jay: Use an ArrayList to construct the arguments
23603         instead of the ParameterCollection, and then cast that to a
23604         Parameter[] array.
23605
23606         * parameter.cs: Drop the use of ParameterCollection and use
23607         instead arrays of Parameters.
23608
23609         (GetParameterInfo): Use the Type, not the Name when resolving
23610         types. 
23611
23612 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23613
23614         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23615         and instead use public readonly fields.
23616
23617         * class.cs: Put back walking code for type containers.
23618
23619 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23620
23621         * class.cs (MakeConstant): Code to define constants.
23622
23623         * rootcontext.cs (LookupType): New function.  Used to locate types 
23624
23625
23626 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23627
23628         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23629         this System.Reflection code is.  Kudos to Microsoft
23630
23631         * typemanager.cs: Implement a type cache and avoid loading all
23632         types at boot time.  Wrap in LookupType the internals.  This made
23633         the compiler so much faster.  Wow.  I rule!
23634
23635         * driver.cs: Make sure we always load mscorlib first (for
23636         debugging purposes, nothing really important).
23637
23638         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23639         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23640
23641         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23642         on namespaces that have been imported using the `using' keyword.
23643
23644         * class.cs (TypeContainer::TypeAttr): Virtualize.
23645         (Class::TypeAttr): Return attributes suitable for this bad boy.
23646         (Struct::TypeAttr): ditto.
23647         Handle nested classes.
23648         (TypeContainer::) Remove all the type visiting code, it is now
23649         replaced with the rootcontext.cs code
23650
23651         * rootcontext.cs (GetClassBases): Added support for structs. 
23652
23653 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23654
23655         * interface.cs, statement.cs, class.cs, parameter.cs,
23656         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23657         Drop use of TypeRefs, and use strings instead.
23658
23659 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23660
23661         * rootcontext.cs: 
23662
23663         * class.cs (Struct::Struct): set the SEALED flags after
23664         checking the modifiers.
23665         (TypeContainer::TypeAttr): new property, returns the
23666         TypeAttributes for a class.  
23667
23668         * cs-parser.jay (type_list): Oops, list production was creating a
23669         new list of base types.
23670
23671         * rootcontext.cs (StdLib): New property.
23672         (GetInterfaceTypeByName): returns an interface by type name, and
23673         encapsulates error handling here.
23674         (GetInterfaces): simplified.
23675         (ResolveTree): Encapsulated all the tree resolution here.
23676         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23677         types. 
23678
23679         * driver.cs: Add support for --nostdlib, to avoid loading the
23680         default assemblies.
23681         (Main): Do not put tree resolution here. 
23682
23683         * rootcontext.cs: Beginning of the class resolution.
23684
23685 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23686
23687         * rootcontext.cs: Provide better error reporting. 
23688
23689         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23690
23691         * rootcontext.cs (CreateInterface): Handle the case where there
23692         are no parent interfaces.
23693
23694         (CloseTypes): Routine to flush types at the end.
23695         (CreateInterface): Track types.
23696         (GetInterfaces): Returns an array of Types from the list of
23697         defined interfaces.
23698
23699         * typemanager.c (AddUserType): Mechanism to track user types (puts
23700         the type on the global type hash, and allows us to close it at the
23701         end). 
23702
23703 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23704
23705         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23706         RecordInterface instead.
23707
23708         * cs-parser.jay: Updated to reflect changes above.
23709
23710         * decl.cs (Definition): Keep track of the TypeBuilder type that
23711         represents this type here.  Not sure we will use it in the long
23712         run, but wont hurt for now.
23713
23714         * driver.cs: Smaller changes to accomodate the new code.
23715
23716         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23717         when done. 
23718
23719         * rootcontext.cs (CreateInterface):  New method, used to create
23720         the System.TypeBuilder type for interfaces.
23721         (ResolveInterfaces): new entry point to resolve the interface
23722         hierarchy. 
23723         (CodeGen): Property, used to keep track of the code generator.
23724
23725 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23726
23727         * cs-parser.jay: Add a second production for delegate_declaration
23728         with `VOID'.
23729
23730         (enum_body): Put an opt_comma here instead of putting it on
23731         enum_body or enum_member_declarations so we can handle trailing
23732         commas on enumeration members.  Gets rid of a shift/reduce.
23733
23734         (type_list): Need a COMMA in the middle.
23735
23736         (indexer_declaration): Tell tokenizer to recognize get/set
23737
23738         * Remove old targets.
23739
23740         * Re-add the parser target.
23741
23742 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23743
23744         * cs-parser.jay: Add precendence rules for a number of operators
23745         ot reduce the number of shift/reduce conflicts in the grammar.
23746
23747 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23748
23749         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23750         and put it here.
23751
23752         Get rid of old crufty code.
23753
23754         * rootcontext.cs: Use this to keep track of the parsed
23755         representation and the defined types available to the program. 
23756
23757         * gen-treedump.cs: adjust for new convention.
23758
23759         * type.cs: Split out the type manager, and the assembly builder
23760         from here. 
23761
23762         * typemanager.cs: the type manager will live here now.
23763
23764         * cil-codegen.cs: And the code generator here. 
23765
23766 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23767
23768         * makefile: Fixed up for easy making.
23769
23770 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23771
23772         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23773         the 
23774
23775         (unary_expression): Expand pre_increment_expression and
23776         post_decrement_expression to reduce a shift/reduce.
23777
23778 2001-07-11  Simon Cozens
23779
23780         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23781
23782         Improve allow_keyword_as_indent name.
23783
23784 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23785
23786         * Adjustments for Beta2. 
23787
23788 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23789
23790         * decl.cs: Added `Define' abstract method.
23791         (InTransit): new property, used to catch recursive definitions. 
23792
23793         * interface.cs: Implement `Define'. 
23794
23795         * modifiers.cs: Map Modifiers.constants to
23796         System.Reflection.TypeAttribute flags.
23797
23798         * class.cs: Keep track of types and user-defined types.
23799         (BuilderInit): New method for creating an assembly
23800         (ResolveType): New function to launch the resolution process, only
23801         used by interfaces for now.
23802
23803         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23804         that are inserted into the name space. 
23805
23806 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23807
23808         * ARGH.  I have screwed up my tree so many times due to the use of
23809         rsync rather than using CVS.  Going to fix this at once. 
23810
23811         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23812         load types.
23813
23814 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23815
23816         * Experiment successful: Use System.Type rather that our own
23817         version of Type.  
23818
23819 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23820
23821         * cs-parser.jay: Removed nsAliases from here.
23822
23823         Use new namespaces, handle `using XXX;' 
23824
23825         * namespace.cs: Reimplemented namespace handling, use a recursive
23826         definition of the class.  Now we can keep track of using clauses
23827         and catch invalid using clauses.
23828
23829 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23830
23831         * gen-treedump.cs: Adapted for all the renaming.
23832
23833         * expression.cs (Expression): this class now has a Type property
23834         which returns an expression Type.
23835
23836         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23837         `Type', as this has a different meaning now in the base
23838
23839 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23840
23841         * interface.cs, class.cs: Removed from all the sources the
23842         references to signature computation, as we can not do method
23843         signature computation during the parsing time, as we are not
23844         trying to solve at that point distinguishing:
23845
23846         class X {
23847                 void a (Blah x) {}
23848                 void a (NS.Blah x) {}
23849         }
23850
23851         Which depending on the context might be valid or not, as we do not
23852         know if Blah is the same thing as NS.Blah at that point.
23853
23854         * Redid everything so the code uses TypeRefs now instead of
23855         Types.  TypeRefs are just temporary type placeholders, that need
23856         to be resolved.  They initially have a pointer to a string and the
23857         current scope in which they are used.  This is used later by the
23858         compiler to resolve the reference to an actual Type. 
23859
23860         * DeclSpace is no longer a CIR.Type, and neither are
23861         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23862         are all DeclSpaces, but no Types. 
23863
23864         * type.cs (TypeRefManager): This implements the TypeRef manager,
23865         which keeps track of all the types that need to be resolved after
23866         the parsing has finished. 
23867
23868 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23869
23870         * ARGH.  We are going to have to store `foreach' as a class rather
23871         than resolving it, as we need to verify error 1579 after name
23872         resolution.   *OR* we could keep a flag that says `This request to
23873         IEnumerator comes from a foreach statement' which we can then use
23874         to generate the error.
23875
23876 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23877
23878         * class.cs (TypeContainer.AddMethod): we now add methods to the
23879         MethodGroup instead of the method hashtable.  
23880
23881         * expression.cs: Add MethodGroup abstraction, which gets us one
23882         step closer to the specification in the way we handle method
23883         declarations.  
23884
23885         * cs-parser.jay (primary_expression): qualified_identifier now
23886         tried to match up an identifier to a local variable reference or
23887         to a parameter reference.
23888
23889         current_local_parameters is now a parser global variable that
23890         points to the current parameters for the block, used during name
23891         lookup.
23892
23893         (property_declaration): Now creates an implicit `value' argument to
23894         the set accessor.
23895
23896 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23897
23898         * parameter.cs: Do not use `param' arguments as part of the
23899         signature, per the spec.
23900
23901 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23902
23903         * decl.cs: Base class for classes, structs and interfaces.  This
23904         is the "Declaration Space" 
23905
23906         * cs-parser.jay: Use CheckDef for checking declaration errors
23907         instead of having one on each function.
23908
23909         * class.cs: Factor out some code for handling error handling in
23910         accordance to the "Declarations" section in the "Basic Concepts"
23911         chapter in the ECMA C# spec.
23912
23913         * interface.cs: Make all interface member classes derive from
23914         InterfaceMemberBase.
23915
23916 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23917
23918         * Many things: all interfaces are parsed and generated in
23919         gen-treedump.  Support for member variables, constructors,
23920         destructors, properties, constants is there.
23921
23922         Beginning of the IL backend, but very little done, just there for
23923         testing purposes. 
23924
23925 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23926
23927         * cs-parser.jay: Fix labeled statement.
23928
23929         * cs-tokenizer.cs (escape): Escape " and ' always.
23930         ref_line, ref_name: keep track of the line/filename as instructed
23931         by #line by the compiler.
23932         Parse #line.
23933
23934 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23935
23936         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23937         to match the values in System.CodeDOM.
23938
23939         Divid renamed to Divide.
23940
23941         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23942         statements. 
23943         (Statements.set): remove.
23944
23945         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23946         statements. 
23947
23948         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23949         falseStatements always have valid values. 
23950
23951         * cs-parser.jay: Use System.CodeDOM now.
23952