* mcs/support.cs: Unify with gmcs version.
[mono.git] / mcs / mcs / ChangeLog
1 2006-09-21  Raja R Harinath  <rharinath@novell.com>
2
3         * support.cs: Unify with gmcs version.
4
5 2006-09-20  Raja R Harinath  <rharinath@novell.com>
6
7         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
8         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
9
10         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
11         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
12         * mcs.exe.sources: Add generic.cs.
13
14         * codegen.cs: Unify with gmcs version.
15
16         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
17         (EmitContext): Add GenericDeclContainer implementation.
18         * decl.cs (MemberCore, DeclSpace): Likewise.
19         * namespace.cs: Remove #ifdef GMCS_SOURCE.
20
21         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
22         MCS TypeManager has a corresponding dummy method.
23
24 2006-09-19  Martin Baulig  <martin@ximian.com>
25
26         * expression.cs: Completely merged with the gmcs version.
27
28 2006-09-19  Martin Baulig  <martin@ximian.com>
29
30         * expression.cs (Invocation): Merged with the gmcs version.
31         (ArrayAccess.GetStoreOpcode): Likewise.
32
33 2006-09-19  Martin Baulig  <martin@ximian.com>
34
35         * typemanager.cs
36         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
37         (TypeManager.IsGenericMethodDefinition): Likewise.
38
39 2006-09-19  Martin Baulig  <martin@ximian.com>
40
41         * typemanager.cs
42         (TypeManager.IsEqual): Moved the gmcs implementation here.
43         (TypeManager.DropGenericTypeArguments): Likewise.
44         (TypeManager.DropGenericMethodArguments): Likewise.
45         (TypeManager.GetTypeArguments): Moved here from gmcs.
46         (TypeManager.HasGenericArguments): Likewise.
47
48 2006-09-19  Martin Baulig  <martin@ximian.com>
49
50         * expression.cs (Binary): Merged with the gmcs version.
51
52 2006-09-19  Martin Baulig  <martin@ximian.com>
53
54         * expression.cs (Probe, As, Is): Merged with the gmcs version.
55
56 2006-09-19  Martin Baulig  <martin@ximian.com>
57
58         * typemanager.cs: Merged with the gmcs version.
59
60 2006-09-16  Raja R Harinath  <rharinath@novell.com>
61
62         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
63         * driver.cs: Likewise.
64
65 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
66
67         A fix for #79401
68         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
69         only if parent type is class.
70         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
71         update.
72
73 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
74
75         * cs-parser.jay,
76         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
77         keywords are used.
78         * typemanager.cs(CSharpName): Converts NullType to null.
79
80 2006-09-15  Martin Baulig  <martin@ximian.com>
81
82         * typemanager.cs
83         (TypeManager.GetMethodName): Added mcs implementation.
84         (TypeManager.IsEqual): Likewise.
85
86         * ecore.cs
87         (SimpleName.RemoveGenericArity): Added dummy implementation.
88
89         * pending.cs: Merged with the gmcs version.     
90
91 2006-09-15  Martin Baulig  <martin@ximian.com>
92
93         * statement.cs: Merge with the gmcs version.
94
95 2006-09-15  Martin Baulig  <martin@ximian.com>
96
97         * statement.cs (Switch): Merge with the gmcs implementation
98         (without nullables), which is newer.
99
100 2006-09-15  Martin Baulig  <martin@ximian.com>
101
102         * statement.cs (Block.Variables): Make this public.
103         (ToplevelBlock.Parameters): Make this a property.
104         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
105
106 2006-09-15  Martin Baulig  <martin@ximian.com>
107
108         * namespace.cs: Merge with the gmcs version.
109
110 2006-09-15  Martin Baulig  <martin@ximian.com>
111
112         * decl.cs (MemberName): Minor code cleanups.
113
114 2006-09-15  Martin Baulig  <martin@ximian.com>
115
116         * parameter.cs: Merge with the gmcs version.
117
118 2006-09-15  Martin Baulig  <martin@ximian.com>
119
120         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
121         and an error in mcs.
122
123 2006-09-15  Martin Baulig  <martin@ximian.com>
124
125         * flowanalysis.cs: Merged from GMCS; added the generics code into
126         a `GMCS_SOURCE' conditional so we can share this file.
127
128 2006-09-08  Martin Baulig  <martin@ximian.com>
129
130         * typemanager.cs (TypeManager.interlocked_type): New public field.
131         (TypeManager.int_interlocked_compare-exchange): New public field.
132         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
133         enumerator types here and call InitGenericCoreTypes().
134         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
135         after calling InitEnumUnderlyingTypes().
136
137         * rootcontext.cs
138         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
139         `classes_second_stage'. 
140
141 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
142
143         * assign.cs, ecore.cs, expression.cs: Share error message text.
144         * class.cs (FieldMember.Define): Check for varible of static type.
145         * driver.cs (LoadAssembly): Uses error output for errors.
146         * statement.cs: Updated.
147
148 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
149
150         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
151         type instance.
152
153 2006-09-07  Martin Baulig  <martin@ximian.com>
154
155         * driver.cs
156         (MainDriver): Revert r62663 from Marek; see #70506 for details.
157
158 2006-08-29  Miguel de Icaza  <miguel@novell.com>
159
160         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
161         
162 2006-08-17  Miguel de Icaza  <miguel@novell.com>
163
164         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
165         #52019 and #79064, the use of the \uXXXX sequence in source code
166         to represent unicode characters.
167
168 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
169
170         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
171         support.
172         * class.cs, ecore.cs, statement.cs: Merged to one error message.
173
174 2006-08-13  Miguel de Icaza  <miguel@novell.com>
175
176         * assign.cs: Catch attempts to assign to a method groups in += and
177         report as 1656
178
179 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
180
181         A fix for #79056
182         * cs-parser.jay: Don't destroy current array type by typeof of array's.
183
184 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
185
186         * class.cs (Method.Define): Issue a warning when generic method looks like
187         an entry point.
188         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
189         as well.
190
191 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
192  
193         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
194         looking for ctor.
195         * decl.cs (MemberCache.FindMembers): When container is interface we need to
196         search all base interfaces as a member can be ambiguous.
197         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
198         Constructor member type filter. 
199         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
200         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
201         reporting for returned memberinfos.
202         * report.cs: Updated.
203         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
204         version to work on all runtimes.
205         (TypeManager.RealMemberLookup): Removed members filtering.
206
207 2006-08-08  Raja R Harinath  <rharinath@novell.com>
208
209         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
210         (PropertyExpr.EmitAssign): Likewise.
211         * expression.cs (Indirection.EmitAssign): Likewise.
212         (LocalVariableReference.EmitAssign): Likewise.
213         (ParameterReference.EmitAssign): Likewise.
214         (Invocation.EmitArguments): Likewise.
215         (ArrayAccess.EmitAssign): Likewise.
216         (IndexerAccess.EmitAssign): Likewise.
217         (This.EmitAssign): Likewise.
218         (ConditionalLogicalOperator.Emit): Likewise.
219
220         Fix #79026
221         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
222         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
223         leave it in after returning it.
224         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
225
226 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
227
228         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
229         message.
230
231 2006-08-03  Raja R Harinath  <rharinath@novell.com>
232
233         Fix cs0146-3.cs and cs0146-4.cs.
234         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
235         enclosing types don't depend on the current type.
236
237 2006-08-02  Raja R Harinath  <rharinath@novell.com>
238
239         Fix #77963
240         * class.cs (TypeContainer.DoDefineMembers): Use
241         FindBaseMemberWithSameName on Parent, since we're interested in
242         whether we hide inherited members or not.
243         (FindBaseMemberWithSameName): Make slightly more robust.
244
245         Fix the non-generic testcase from #77396
246         * decl.cs (DeclSpace.DeclContainer): Remove override.
247
248         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
249         declspaces for doppelgangers too.
250         (UsingEntry): Implement IResolveContext.
251         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
252         'this' as the resolve context.
253         (LocalAliasEntry): Likewise.
254
255         Implement parts of #77403
256         * roottypes.cs (RootDeclSpace): New.  Used to represent the
257         toplevel declaration space.  Each namespace declaration introduces
258         a "partial" root declaretion space.
259         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
260         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
261         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
262         from 'current_namespace.SlaveDeclSpace'.
263         (namespace_declaration): Likewise.
264         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
265         check.  It can't happen now.
266         * decl.cs (DeclSpace.LookupType): Likewise.
267         * driver.cs (MainDriver): Sanity check.
268
269 2006-08-01  Raja R Harinath  <rharinath@novell.com>
270
271         * decl.cs (DeclSpace.FindNestedType): Remove.
272         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
273         LookupTypeContainer to get the container of the nested type.
274         * class.cs (TypeContainer.FindNestedType): Make non-override.
275
276 2006-07-31  Raja R Harinath  <rharinath@novell.com>
277
278         * decl.cs (DeclSpace.PartialContainer): Move field from ...
279         * class.cs (TypeContainer.PartialContainer): ... here.
280         (TypeContainer.AddBasesForPart): New helper.
281         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
282         instead.
283         * cs-parser.jay (current_class): Convert to DeclSpace.
284         (struct_declaration, interface_declaration, class_declaration):
285         Use AddBasesForPart instead of .Bases directly.
286         * const.cs, iterators.cs: Update to changes.
287
288 2006-07-28  Raja R Harinath  <rharinath@novell.com>
289
290         * class.cs (TypeContainer.AddMemberType): Rename from
291         AddToTypeContainer.
292         (TypeContainer.AddMember): Rename from AddToMemberContainer.
293         (AddTypeContainer): New.  Combine AddClassOrStruct and
294         AddInterface.
295         (AddPartial): Update.  Add 'is_partial' argument.
296         * roottypes.cs: Update to changes.
297         * cs-parser.jay (push_current_class): New helper for handling
298         current_container and current_class.
299         (struct_declaration, interface_declaration, class_declaration):
300         Use it.
301
302 2006-07-26  Raja R Harinath  <rharinath@novell.com>
303
304         * roottypes.cs: Rename from tree.cs.
305
306         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
307         * tree.cs (Tree, ITreeDump): Remove types.
308         * rootcontext.cs (tree, Tree): Remove fields.
309         (root, ToplevelTypes): New.
310         * *.cs: Update to rename.
311
312         * tree.cs (Tree.RecordDecl): Remove.
313         (RootTypes.AddToTypeContainer): Record the toplevel type in its
314         namespace here.
315         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
316
317 2006-07-23  Raja R Harinath  <harinath@gmail.com>
318
319         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
320         DoFlowAnalysis and OmitStructFlowAnalysis here.
321         (ec.With): Rename from WithUnsafe and generalize.
322         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
323         (ec.WithFlowAnalyis): New.
324         * ecore.cs, expression.cs, statement.cs: Update.
325
326 2006-07-22  Raja R Harinath  <harinath@gmail.com>
327
328         * statement.cs (Block.ResolveMeta): Simplify slightly.
329
330         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
331         multiple boolean fields.  Convert InUnsafe, constant_check_state,
332         check_state to flags.
333         (CheckState, ConstantCheckState): Update.
334         (InUnsafe): New read-only property.
335         (FlagsHandle): Rename from CheckStateHandle and convert to handle
336         arbitrary flags.
337         (WithUnsafe): New helper similar to WithCheckState.
338         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
339         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
340
341 2006-07-21  Raja R Harinath  <rharinath@novell.com>
342
343         Make comparisons use the same IL irrespective of whether they're
344         in a 'checked' or 'unchecked' context: one of the issues in #78899
345         * codegen.cs (EmitContext.CheckState): Make read-only property.
346         (EmitContext.ConstantCheckState): Likewise.
347         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
348         helper that implement a save/restore stack for CheckState
349         values.  This is the only way to change check-state.
350         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
351         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
352         (CheckedExpr.EmitBranchable): New forwarding method.
353         (UnCheckedExpr): Likewise.
354         * statement.cs (Block.ResolveMeta): Use WithCheckState.
355         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
356         (Checked.Resolve, checked.DoEmit): Likewise.
357
358 2006-07-20  Miguel de Icaza  <miguel@novell.com>
359
360         * anonymous.cs: Cache the resolved anonymous delegate, and return
361         this so that the ResolveTopBlock is only triggered once, not
362         twice.
363
364         Currently we trigger ResolvetopBlock twice due to a first pass of
365         argument check compatibility, and a second pass that does the
366         actual resolution.   
367         
368 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
369
370         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
371         modifiers.
372         * rootcontext.cs (Reset): Add helper_classes.
373
374 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
375
376         A fix for #78860
377         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
378         correctly.
379
380 2006-07-13  Miguel de Icaza  <miguel@novell.com>
381
382         * statement.cs (Lock): Handle expressions of type
383         TypeManager.null_type specially.  Fixes #78770
384
385 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
386
387         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
388         to an event.
389
390 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
391
392         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
393         for accessors as well.
394         * ecore.cs (EventExpr): Add AccessorTable.
395
396 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
397
398         A fix for #78738
399         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
400         for CS0122 where appropriate.
401         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
402         level attributes.
403         (Filter): Assembly can be null in the case of top level attributes.
404
405 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
406
407         A fix for #78690
408
409         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
410         is done at global level.
411
412 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
413
414         A fix for #77002, Implemented TypeForwarder support.
415
416         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
417         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
418         * typemanager.cs (): Add type_forwarder_attr_type.
419
420 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
421
422         * report.cs: Add CS0469 warning.
423
424 2006-06-21  Martin Baulig  <martin@ximian.com>
425
426         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
427         the `try'-block, so we also report CS0016 etc. there.
428
429 2006-06-21  Martin Baulig  <martin@ximian.com>
430
431         * delegate.cs
432         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
433
434 2006-06-21  Martin Baulig  <martin@ximian.com>
435
436         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
437         also report CS1686 for parameters.
438
439 2006-06-21  Martin Baulig  <martin@ximian.com>
440
441         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
442         instead of an error if the value is not implicitly convertible to
443         the switch types; fixes #77964.
444
445 2006-06-21  Raja R Harinath  <rharinath@novell.com>
446
447         Fix #78673
448         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
449         FieldBuilder is null.
450
451         Fix #78662
452         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
453         'left' and 'right' before error-checking.
454
455 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
456
457         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
458         Fixed bug #78601.
459         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
460         (FieldExpr.DoResolve): likewise.
461         (PropertyExpr.InstanceResolve): likewise.
462         (EventExpr.InstanceResolve): likewise. 
463
464 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
465
466         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
467         attribute applicable tests for attribute argument.
468
469 2006-06-02  Raja R Harinath  <rharinath@novell.com>
470
471         Fix #78079
472         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
473         (Binary.OverloadResolve_PredefinedIntegral): New.
474         (Binary.OverloadResolve_PredefinedFloating): New.
475         (Binary.OverloadResolve_PredefinedString): New.
476         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
477         Follow the standard more closely, and treat numeric promotions in
478         terms of overload resolution.
479         (Binary.CheckShiftArguments): Simplify.
480
481 2006-06-01  Raja R Harinath  <rharinath@novell.com>
482
483         * flowanalysis.cs (MyBitVector): Simplify representation.
484         (MyBitVector.Clone): Avoid allocating BitArray.
485         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
486         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
487         (*): Update.  Change all references to MyBitVector.And and
488         MyBitVector.Or to &= and |=.
489
490 2006-05-29  Raja R Harinath  <rharinath@novell.com>
491
492         Fix cs0231-[34].cs.
493         * cs-parser.jay (formal_parameter_list): Extend the pattern below
494         to param arguments too.
495
496 2006-05-26  Miguel de Icaza  <miguel@novell.com>
497
498         * cs-parser.jay: Catch another parsing form for arglist being
499         followed by other arguments.  Fixes #78313.
500
501 2006-05-24  Raja R Harinath  <rharinath@novell.com>
502
503         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
504         checking of out parameters to ...
505         (FlowBranchingToplevel.Merge): ... here.
506         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
507         set, propagate the origin upward, and only complain if there was
508         no other error.
509         (FlowBranchingException.AddContinueOrigin): Likewise.
510         (FlowBranchingException.AddReturnOrigin): Likewise.
511         (FlowBranchingException.AddGotoOrigin): Likewise.       
512
513 2006-05-23  Raja R Harinath  <rharinath@novell.com>
514
515         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
516         unreachable, skip it.
517         (FlowBranchingException.Merge): Always propagate jumps, even if
518         the finally block renders subsequent code unreachable.
519
520 2006-05-18  Raja R Harinath  <rharinath@novell.com>
521
522         Fix #77601
523         * statement.cs (Goto.Resolve): Move responsibility for resolving
524         'goto' to FlowBranching.AddGotoOrigin.
525         (Goto.SetResolvedTarget): New.  Callback to set the
526         LabeledStatement that's the target of the goto.
527         (Goto.DoEmit): Use Leave instead of Br when crossing an
528         unwind-protect boundary.
529         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
530         LookupLabel and adjust to new semantics.
531         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
532         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
533         Goto.SetResolvedTarget to update target.
534         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
535         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
536         AddBreakOrigin & co.  Delay propagation until ...
537         (FlowBranchingException.Merge): ... this.
538
539         * statement.cs (Block.Resolve): Always depend on flow-branching to
540         determine unreachability.  Kill workaround that originally emitted
541         only one statement after an "unreachable" label (see infloop in
542         test-515.cs).
543
544         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
545         This is still "wrong", but anything better would probably need a
546         multi-pass algorithm.
547         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
548         usage vector.  Force current usage vector to be reachable, to
549         optimistically signify backward jumps.
550         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
551         detected.
552         (FlowBranchingLabeled.Merge): New.  If no backward jump was
553         detected, return the original salted-away usage vector instead,
554         updated with appropriate changes.  Print unreachable warning if
555         necessary.
556         * statement.cs (Block.Resolve): Don't print unreachable warning on
557         a labeled statement.
558
559 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
560
561         * driver.cs: Pass filename without path to AssemblyBuilder's 
562         AddResourceFile. Fixes bug #78407.
563
564 2006-05-17  Raja R Harinath  <rharinath@novell.com>
565
566         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
567         * flowanalysis.cs (FlowBranchingLabeled): ... here.
568         (FlowBranching.MergeChild): Overwrite
569         reachability information from Labeled branchings too.
570
571 2006-05-16  Raja R Harinath  <rharinath@novell.com>
572
573         * statement.cs (Goto.Resolve): Merge jump origins here ...
574         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
575
576         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
577         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
578         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
579         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
580         here, ...
581         * statement.cs (Goto.Resolve): ... not here.
582         (Goto.Emit): Remove CS1632 check.
583
584 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
585
586         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
587         error message.
588
589 2006-05-11  Raja R Harinath  <rharinath@novell.com>
590
591         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
592         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
593         (FlowBranchingException.Label): Likewise.
594
595         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
596         given value.
597         (MyBitVector.Or): Use it to avoid losing information (Count).
598         (FlowBranching.MergeOrigins): Likewise.
599
600         * flowanalysis.cs (UsageVector.IsDirty): Remove.
601         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
602         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
603         (UsageVector.ToString): Simplify.
604         (UsageVector.MergeSiblings): Move here from ...
605         (FlowBranching.Merge): ... here.
606         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
607         not a MyBitVector.
608
609 2006-05-10  Raja R Harinath  <rharinath@novell.com>
610
611         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
612         null bitvector is treated as all-true.
613
614         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
615         (MyBitVector): Rationalize invariants.  'vector != null' implies
616         that we have our own copy of the bitvector.  Otherwise,
617         'InheritsFrom == null' implies all inherited bits are true.
618
619 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
620
621         * statement.cs (LocalInfo): Add IsConstant.
622         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
623         local variable for constants.
624
625 2006-05-09  Raja R Harinath  <rharinath@novell.com>
626
627         * flowanalysis.cs (MyBitVector.Empty): New.
628         (MyBitVector): Don't allow InheritedFrom to be null.
629         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
630         (UsageVector, FlowBranching): Update to changes.
631
632         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
633         recursion.  The 'Parent == null' condition isn't sufficient for
634         anonymous methods.
635         (FlowBranching.AddBreakOrigin): Likewise.
636         (FlowBranching.AddContinueOrigin): Likewise.
637         (FlowBranching.AddReturnOrigin): Likewise.
638         (FlowBranching.StealFinallyClauses): Likewise.
639         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
640         (FlowBranching.CheckOutParameters): Likewise.
641         (FlowBranchingToplevel): Terminate all the above recursions here.
642         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
643         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
644
645         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
646         toplevel block.
647         (FlowBranchingToplevel): New.  Empty for now.
648         (FlowBranching.MergeTopBlock): Update.
649         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
650         branching for the anonymous delegate.
651         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
652
653         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
654         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
655         information at the start of the merge.  Reorganize.
656
657 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
658
659         * class.cs (MethodData.Define): Method cannot implement interface accessor.
660
661 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
662
663         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
664         to newly introduced ctor.
665
666         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
667         message to one place.
668         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
669         global namespace.
670
671 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
672
673         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
674
675         * ecore.cs (Expression.ResolveAsConstant): Updated.
676
677         * statement.cs (ResolveMeta): Updated.
678
679 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
680
681         * cs-parser.jay: __arglist cannot be used in initializer.
682
683 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
684
685         A fix for #77879
686         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
687         private types.
688
689 2006-05-05  Raja R Harinath  <rharinath@novell.com>
690
691         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
692         (LabeledStatement): Add 'name' parameter.
693         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
694         (Block.AddLabel): Update to changes.
695         * cs-parser.jay (labeled_statement): Likewise.
696
697         * flowanalysis.cs (BranchingType.Labeled): New.
698         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
699         (FlowBranchingLabeled): New.  Does nothing for now, but will
700         eventually handle 'goto' flows.
701         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
702         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
703         that's terminated ...
704         (Block.Resolve): ... here.
705
706         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
707         (UsageVector.MergeFinallyOrigins): Likewise.
708         (FlowBranching.InTryOrCatch): Likewise.
709         (FlowBranching.AddFinallyVector): Likewise.
710         (FlowBranchingException): Update to changes.
711
712         Fix #78290
713         * statement.cs (Return.Resolve): Move error checking to ...
714         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
715         (FlowBranchingException): Handle return origins like break and
716         continue origins.
717         (FlowBranching.UsageVector.CheckOutParameters): Remove.
718
719 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
720
721         A fix for #76122
722         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
723         filter.
724
725 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
726
727         A fix for #77543
728         * class.cs (MethodData.Define): Do public accessor check only when method
729         implements an interface.
730
731 2006-05-04  Raja R Harinath  <rharinath@novell.com>
732
733         Remove special handling of 'break'
734         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
735         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
736         (UsageVector.Break): Remove.
737         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
738         reachability.
739         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
740
741         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
742         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
743
744 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
745
746         A fix for #75726
747         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
748         be the interface member.
749
750 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
751
752         A fix for #60069
753         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
754         for emitting small (int) values.
755
756 2006-05-03  Raja R Harinath  <rharinath@novell.com>
757
758         Fix #59427
759         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
760         control-flow passes through the 'finally' after merging-in all the
761         control-flows from 'try' and the 'catch' clauses.
762
763         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
764         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
765         always true at the only non-recursive entry point.
766         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
767         FlowBranchingBreakable.
768         (FlowBranchingLoop): Remove.
769         * statement.cs (Return.DoResolve): Update to changes.
770
771         Fix #76471, #76665
772         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
773         (FlowBranching.CreateBranching): Handle it: create a
774         FlowBranchingContinuable.
775         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
776         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
777         except that it handles the 'continue' command.
778         (FlowBranching.UsageVector.MergeOrigins): Rename from
779         MergeBreakOrigins.
780         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
781         except that it overrides AddContinueOrigin.
782         (FlowBranchingException): Override AddContinueOrigin, similar to
783         AddBreakOrigin.
784         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
785         Create a new branching around the embedded statement.
786         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
787         control flow after the embedded statement.
788         (Continue.Resolve): Move all error checking to AddContinueOrigin.
789
790         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
791         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
792         FlowBranchingBreakable.
793         (FlowBranchingSwitch): Remove.
794
795         Fix test-503.cs
796         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
797         error reporting to ...
798         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
799         Rename from 'AddBreakVector'.  Add new location argument.  Return
800         a bool indicating whether the 'break' crosses an unwind-protect.
801         (FlowBranchingException.AddBreakOrigin): Add.
802         (FlowBranchingException.Merge): Propagate 'break's to surrounding
803         flowbranching after updating with the effects of the 'finally'
804         clause.
805         (FlowBranchingBreakable): New common base class for
806         FlowBranchingLoop and FlowBranchingSwitch.
807
808         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
809         embedded statement.
810         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
811
812 2006-05-02  Raja R Harinath  <rharinath@novell.com>
813
814         * statement.cs (Do.Resolve): If the loop is infinite, set the
815         barrier.
816         (While.Resolve, For.Resolve): Set a barrier after the embedded
817         statement.  There's no direct control flow that goes from the end
818         of the embedded statement to the end of the loop.
819         * flowanalysis.cs (FlowBranching.Infinite): Remove.
820         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
821         above ensure that the reachability is correctly computed.
822
823         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
824         (UsageVector.MergeBreakOrigins): If the current path is
825         unreachable, treat it as if all parameters/locals are initialized.
826         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
827         infinite loops before merging-in break origins.
828
829         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
830         (Reachability.Reachable): Split part into ...
831         (Reachability.Unreachable): ... this.  Simplify.
832         (Reachability.IsUnreachable): Use 'Unreachable' instead.
833
834         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
835         (Reachability.SetThrowsSometimes): Likewise.
836         (FlowBranchingBlock.MergeTopBlock): Don't compare against
837         TriState.Always, use corresponding property.
838         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
839         (Block.Resolve): Likewise.  Remove some redundant checks.
840
841 2006-05-02  Raja R Harinath  <harinath@gmail.com>
842
843         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
844         (Reachability.Meet): Don't bother checking AlwaysThrows --
845         barrier is always set.
846         (FlowBranchingBlock.Merge): Likewise.
847
848 2006-05-01  Raja R Harinath  <harinath@gmail.com>
849
850         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
851         checks for unreachable.
852
853 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
854
855         A fix for #77980
856         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
857
858         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
859         whether field is really assigned.
860
861 2006-04-30  Raja R Harinath  <harinath@gmail.com>
862
863         * flowanalysis.cs (Reachability): Make 4-argument constructor
864         private.
865         (Reachability.Meet): Rename from 'And'.  Remove static variant.
866         (Reachability.Always): Rename from the highly misleading
867         'Reachability.Never'.
868         (FlowBranching.Merge): Update to changes.  Mark an impossible
869         situation with a 'throw'.
870         (*): Update to changes.
871
872 2006-04-29  Raja R Harinath  <harinath@gmail.com>
873
874         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
875         Remove 'Undefined'.
876         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
877         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
878         (*): Update to changes.
879         * statement.cs: Update to changes.
880
881 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
882
883         A fix for #78049
884         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
885
886 2006-04-28  Raja R Harinath  <harinath@gmail.com>
887
888         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
889         dummy UsageVector.
890
891         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
892         argument to two arguments: an usage-vector and a bool.  Move call
893         to FlowBranching.Merge () ...
894         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
895
896         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
897         handling of loop and switch reachability to ...
898         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
899
900 2006-04-27  Raja R Harinath  <harinath@gmail.com>
901
902         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
903         handling to FlowBranchingLoop.InLoop.
904         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
905
906 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
907
908         A fix for #78115
909         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
910         anonymous method is allowed from AnonymousContainer here.
911
912         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
913
914 2006-04-24  Raja R Harinath  <rharinath@novell.com>
915
916         Fix #78156
917         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
918
919 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
920
921         A fix for #49011.
922         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
923         (DoubleConstant.Reduce): Ditto.
924
925 2006-04-23  Raja R Harinath  <rharinath@novell.com>
926
927         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
928         Remove 'lvalue_right_side' argument.  Move parts to ...
929         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
930         (LocalVariable.DoResolveLValue): ... these.
931
932 2006-04-21  Raja R Harinath  <rharinath@novell.com>
933
934         Fix cs1655.cs
935         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
936         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
937         (LocalVariableReference.DoResolveBase): Use it to implement new
938         CS1655 check.
939         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
940         (Argument.Resolve): Simplify.  Move CS1510 check ...
941         * ecore.cs (Expression.ResolveLValue): ... here.
942         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
943         (PropertyExpr.DoResolveLValue): Likewise.
944         (FieldExpr.Report_AssignToReadonly): Likewise.
945         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
946         LValueMemberAccess or LValueMemberOutAccess on instance depending
947         on it.
948         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
949         DoResolve as appropriate.
950
951 2006-04-20  Raja R Harinath  <rharinath@novell.com>
952
953         Fix #75800
954         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
955         implicit conversions on 'out' and 'ref' arguments.
956
957         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
958         improve clarity.  Remove dead code.
959
960         Fix #66031
961         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
962         (Catch.Resolve): Resolve VarBlock if it exists.
963
964 2006-04-19  Miguel de Icaza  <miguel@novell.com>
965
966         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
967         twice, this was some residual code, the enumerator was emitted
968         properly in the two branche of if later.
969
970 2006-04-19  Raja R Harinath  <rharinath@novell.com>
971
972         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
973         cast is never an lvalue.
974         (Cast.DoResolve, Cast.ResolveRest): Combine.
975         (Argument.Emit): Simplify slightly.  Move 'Expr is
976         IMemoryLocation' check ...
977         (Argument.Resolve): ... here.
978         (Argument.Error_LValueRequired): Remove.  Inline into only user.
979
980         Simplifications.  Fix cs0191-2.cs
981         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
982         CS1649 and CS1651 to ...
983         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
984         the actual selection of the error code and message to a lookup
985         table.  Add a dummy return value to simplify callsites.
986         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
987         readonly fields of other instances of the same type.  Move CS0197
988         warning from ...
989         * expression.cs (Argument.Resolve): ... here.  Simplify code.
990         Ensure that ec.InRefOutArgumentResolving is only set during LValue
991         resolution of an out or ref argument.  The code simplification
992         above uses this invariant.
993
994 2006-04-18  Raja R Harinath  <rharinath@novell.com>
995
996         Possibly fix #77752.  Fix cs1690-[4-7].cs.
997         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
998         CheckMarshallByRefAccess.  Drop parameter.
999         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1000         warning.
1001         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1002         InstanceExpression.
1003         * report.cs (AllWarnings): Add CS1690.
1004         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1005         for ref access too.
1006         (LocalVariableReference.DoResolveBase): Update.
1007
1008 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1009
1010         * class.cs (MethodOrOperator): Moved common parts from method class.
1011         detect obsolete attributes.
1012         (Method.Define): Simplified as it reuses code from base.
1013         (Constructor.ValidAttributeTargets): Fixed issue found during
1014         refactoring.
1015         (Destructor.ValidAttributeTargets): Fixed issue found during
1016         refactoring.
1017         (Operator): Finished refactoring set off by #78020. Operator class is now
1018         ordinary method class.
1019
1020         * anonymous.cs: Updated.
1021
1022         * decl.cs (DeclSpace): Add IsGeneric
1023
1024 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1025
1026         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1027
1028 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1029
1030         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1031         detect obsolete attributes.
1032         (Method.CreateEmitContext): Moved to MethodOrOperator.
1033
1034 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1035
1036         A fix for #78048.
1037         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1038         customized exception to make crash detection easier.
1039         (MethodOrOperator): Started to work on new base class for methods and
1040         operators.
1041         (Method): Derives from MethodOrOperator.
1042         (Constructor.Emit): Emits its own attributes.
1043         (AbstractPropertyEventMethod.Emit): Ditto.
1044         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1045         patch.
1046         (Operator.Emit): It's temporary more tricky than should be.
1047         
1048         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1049
1050         * report.cs (InternalErrorException): Add ctor with inner exception.
1051
1052 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1053
1054         A fix for #76744.
1055         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1056         only not visible.
1057
1058 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1059
1060         A fix for #77916.
1061         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1062         array.
1063
1064 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1065
1066         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1067         attribute is present and Guid not.
1068         (Interface.ApplyAttributeBuilder): Ditto.
1069
1070         * attribute.cs: Add error message.
1071
1072 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1073
1074         A fix for #78020.
1075
1076         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1077         sources (it's composite) so hold them in extra array as they are used in
1078         Emit phase only. It worked in the previous versions by mistake.
1079         (Attribute.Emit): Emit attribute for more owners when exist.
1080
1081         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1082         it has now different behaviour.
1083
1084 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1085
1086         * constant.cs (Constant.IsDefaultInitializer): New method.
1087
1088         * class.cs: Updated.
1089
1090         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1091         re-initialize default values. It saves KBs almost for every assembly.
1092         Thanks Zoltan for the idea.
1093         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1094         (ArrayCreation.DoResolve): Resolve only once.
1095         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1096         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1097
1098 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1099
1100         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1101         From #77961.
1102
1103 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1104
1105         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1106         in an embedded statement too.
1107
1108 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1109
1110         Fix #77958
1111         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1112
1113 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1114
1115         A fix for #77966.
1116
1117         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1118         was not specified.
1119
1120         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1121
1122 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1123
1124         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1125         phase.
1126
1127         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1128         LocalTemporary change.
1129
1130         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1131         TypeContainer.
1132         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1133         initializers optimization.
1134         (ClassOrStruct.TypeAttr): Moved from modifiers.
1135         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1136         (FieldBase.ResolveInitializer): Resolves initializer.
1137         (FieldBase.HasDefaultInitializer): New property.
1138
1139         * cs-parser.jay: Removed message.
1140
1141         * expression.cs (CompilerGeneratedThis): New specialization.
1142
1143         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1144
1145 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1146
1147         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1148
1149 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1150
1151         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1152         be now EnumConstants only.
1153
1154 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1155
1156         * attribute.cs, driver.cs: Reset more caches.
1157
1158 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1159
1160         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1161
1162 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1163
1164         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1165         for easier reuse. Updated all overrides.
1166         (IntegralConstant): New base class for all integral constants.
1167         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1168         of the constant range, report custom error.
1169         (UIntConstant.Reduce): Fixed uint conversion.
1170
1171         * ecore.cs, literal.cs: Reduce updates.
1172
1173 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1174
1175         A fix for #75813.
1176
1177         * class.cs (Constructor.Define): Removed extra if for default ctors.
1178         A patch from Atsushi Enomoto.
1179
1180 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1181
1182         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1183         GetAttributableValue.
1184
1185         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1186         when required.
1187
1188         * convert.cs (ImplicitConversionRequired): Error message moved to
1189         DoubleLiteral.
1190
1191         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1192         automatic implicit conversion of an output value.
1193         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1194
1195         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1196         conversion.
1197         (TypeOf.GetAttributableValue): Add extra handling for object type.
1198
1199         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1200         special error message.
1201
1202 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1203
1204         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1205         InternalCall.
1206         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1207         compatible with MS runtime.
1208
1209 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1210
1211         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1212         attribute arguments here.
1213
1214         * class.cs (Indexer.Define): The check was moved to attribute class.
1215
1216 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
1217
1218         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1219         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1220         easier.
1221
1222 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1223
1224         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1225         mcs to keep code differences small.
1226         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1227         * typemanager.cs (parameter_default_value_attribute_type): New.
1228         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1229         CS1908 check.
1230
1231 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1232
1233         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1234
1235 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1236
1237         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1238
1239         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1240         the blocks too.
1241
1242 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1243
1244         * doc-bootstrap.cs : fix build.
1245
1246 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1247
1248         * expression.cs (StringConcat.Append): Issue a warning when empty string
1249         is going to append.
1250
1251 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1252
1253         * assign.cs (CompoundAssign.ResolveSource): Removed.
1254
1255         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1256         clean up.
1257
1258         * class.cs (TypeContainer.FindMethods): Removed.
1259         (TypeContainer.CheckMemberUsage): Made static.
1260
1261         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1262
1263         * constant.cs (CheckRange): Removed unused type argument.
1264         (CheckUnsigned): Removed unused type argument.
1265
1266         * cs-parser.jay: Updated after MemberAccess clean up.
1267         Uses Length for empty string test.
1268
1269         * cs-tokenizer.cs: Uses Length for empty string test.
1270         (IsCastToken): Made static.
1271         (is_hex): Made static.
1272         (real_type_suffix): Made static.
1273
1274         * decl.cs (SetupCache): Made static.
1275         (OnGenerateDocComment): Removed unused ds argument.
1276
1277         * delegate.cs (VerifyDelegate): Removed unused argument.
1278
1279         * doc.cs: Uses Length for empty string test.
1280
1281         * driver.cs: Uses Length for empty string test.
1282
1283         * enum.cs (IsValidEnumType): Made static
1284
1285         * expression.cs (EnumLiftUp): Removed unused argument.
1286         (ResolveMethodGroup): Ditto.
1287         (BetterConversion): Ditto.
1288         (GetVarargsTypes): Ditto.
1289         (UpdateIndices): Ditto.
1290         (ValidateInitializers): Ditto.
1291         (MemberAccess.ctor): Ditto.
1292         (GetIndexersForType): Ditto.
1293
1294         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1295
1296         * iterators.cs: Updated after MemberAccess clean up.
1297
1298         * location.cs: Uses Length for empty string test.
1299
1300         * namespace.cs: Uses Length for empty string test.
1301
1302          * report.cs (CheckWarningCode): Made static.
1303
1304         * statement.cs (LabeledStatement): Removed unused argument.
1305
1306         * typemanager.cs (FilterNone): Removed.
1307
1308 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1309
1310         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1311         obsolete.
1312
1313         * class.cs: Updated.
1314
1315 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1316
1317         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1318
1319 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1320
1321         A fix for #77822.
1322
1323         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1324         reporting, it's more tricky than I thought.
1325
1326 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1327
1328         A fix for #77816.
1329
1330         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1331         host container.
1332         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1333         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1334         Add more error reporting; Fixed issue with params.
1335
1336         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1337
1338         * cs-parser.jay: AnonymousMethod requires host container.
1339
1340         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1341
1342 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1343
1344         * class.cs: Change 'TypeContainer ds' constructor argument to
1345         'DeclSpace parent'.  Some classes were missed below due to
1346         different naming convention.
1347
1348         * class.cs (MemberCore.Parent): Delete.  This makes the
1349         ParentContainer changes below enforceable by the compiler.
1350
1351         Treat pointers to enclosing declaration space as 'DeclSpace', not
1352         'TypeContainer'.
1353         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1354         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1355
1356         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1357         of TypeContainer.
1358         (Block.AddThisVariable): Likewise.
1359         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1360         (AbstractPropertyEventMethod.Emit): Likewise.
1361         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1362         (GetMethod.Define, SetMethod.Define): Likewise.
1363         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1364         (DelegateMethod.EmitMethod): Likewise.
1365
1366         Fix regression test-partial-13.cs.
1367         Rationalize use of PartialContainer.  Ensure that the partial
1368         class semantics can be tied to type-correctness, i.e., any
1369         violation will cause a compile error.
1370         * class.cs, const.cs: Access all fields that belong to class
1371         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1372         Resolve()-like functions still use 'Parent'.
1373
1374         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1375         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1376         (PropertyMethod.CheckModifiers): Remove unused argument.
1377         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1378         DeclSpace.
1379
1380 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1381
1382         Make semantics of PartialContainer simpler.
1383         * decl.cs (DeclSpace.IsPartial): Remove.
1384         * class.cs (TypeContainer.IsPartial): Likewise.
1385         (TypeContainer..ctor): Set PartialContainer to point to self.
1386         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1387         (TypeContainer.FindNestedType): Likewise.
1388         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1389
1390 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1391
1392         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1393
1394 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1395
1396         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1397         classes.
1398
1399 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1400
1401         * class.cs (Operator.Define): An error for base conversion was not
1402         reported correctly.
1403
1404 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1405
1406         * iterator.cs : yield break is allowed in try statement which has
1407           catch clauses. Fixed bug #77767.
1408
1409 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1410
1411         A fix for #77593, #77574.
1412
1413         * class.cs (MethodCore.CheckBase): Another if for operator.
1414
1415 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1416
1417         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1418         were not resolved
1419
1420         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1421         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1422         conversion test.
1423         
1424         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1425         not needed.
1426
1427         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1428         Updated after another emitcontext usage was clean up. It should help us to
1429         synchronize with gmcs easier.
1430
1431 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1432
1433         A fix for #77353.
1434
1435         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1436         (Event.Define): ditto
1437         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1438
1439         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1440         Removed redundant code and set NewSlot for Invoke method too.
1441
1442         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1443         (Parameters.MergeGenerated): New method. Use this method when you merge
1444         compiler generated argument with user arguments.
1445
1446 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1447
1448         * attribute.cs (ResolveAsTypeTerminal): Removed.
1449
1450         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1451         specialization for predefined types; 30% speed up.
1452         Finally placed obsolete check to right place.
1453         (Expression.ResolveType): Removed.
1454
1455         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1456         Updated after ResolveType was removed.
1457
1458         * expression.cs (Cast.ctor): Check void cast.
1459         (Binary.ResolveAsTypeTerminal): Is never type.
1460         (Conditional.ResolveAsTypeTerminal): Is never type.
1461
1462         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1463
1464 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1465
1466         Fix #77679.
1467         * expression.cs (ParameterReference.DoResolveBase): Change return
1468         type to bool.
1469         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1470         Update.
1471
1472         Fix #77628.
1473         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1474
1475         Fix #77642.
1476         * typemanager.cs (GetFullNameSignature): Don't nullref on
1477         protected accessors.
1478
1479 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1480
1481         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1482         these two separated members to simplify the code.
1483         (Attribute.Resolve): Refactored to use new fields and methods.
1484         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1485         implemented obsolete attribute checking.
1486         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1487         implemented obsolete checking again. It look line never ending quest ;-)
1488         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1489
1490         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1491
1492         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1493
1494         *class.cs (Property.Define): Add RegisterProperty call.
1495
1496         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1497         argument groups (only 2).
1498
1499         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1500         encoding expression to arguments.
1501         (Expression.ExprClassToResolveFlags): Just turned to property.
1502
1503         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1504         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1505         optimized as well as implemented support for zero-length attributes.
1506
1507         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1508         Add caching of PropertyInfo's.
1509
1510 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1511
1512         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1513         error multiple times.
1514
1515 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1516
1517         New partial class implementation.
1518         A fix for #77027, #77029, #77403
1519
1520         * attribute.cs (Attributable): Made attributes protected.
1521
1522         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1523         the replacements of ClassPart and PartialContainer.
1524         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1525         (TypeContainer.AddInterface): Ditto.
1526         (TypeContainer.AddPartial): The main method for partial classes. It checks
1527         for errors and merges ModFlags and attributes. At the end class is added to
1528         partial_parts list.
1529         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1530         required here.
1531         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1532         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1533         from the rest of partial classes.
1534         (TypeContainer.GetClassBases): Simplified.
1535         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1536         DefineType.
1537         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1538         (TypeContainer.HasExplicitLayout): Uses Flags now.
1539         (PartialContainer): Removed.
1540         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1541         (StaticClass): Was merged with Class.
1542         (Class.GetClassBases): class and static class bases are verified here.
1543         (Class.TypeAttr): Added static attributes when class is static.
1544         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1545         (MemberBase): In some cases we need to call parent container for partial
1546         class. It should be eliminated but it's not easy now.
1547
1548         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1549
1550         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1551         partial classed to accumulate class comments.
1552         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1553
1554         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1555
1556         * driver.cs (MainDriver): Tree.GetDecl was removed.
1557
1558         * modifiers.cs (Modifiers): Add partial modifier.
1559
1560         * tree.cs (Tree.decl): Removed.
1561         (RootTypes): Started to use this class more often for root types
1562         specializations.
1563
1564 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1565
1566         A fix for #77615
1567
1568         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1569         external interface does not have an attribute.
1570
1571 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1572
1573         Another prerequisites for new partial classs implementation.
1574         
1575         * attribute.cs (Attribute.Equal): Implemented.
1576         (Attribute.Emit): Changed as attributes can be applied more than twice.
1577         (Attributes.Emit): Check for duplicate attributes here.
1578
1579         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1580         as a parameter, clean-up.
1581
1582 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1583
1584         A fix for #77485
1585
1586         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1587         contains obsolete attribute check which can in some cases look for base
1588         type of current class which is not initialized yet.
1589         (TypeContainer.BaseType): Replacement of ptype.
1590
1591         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1592
1593 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1594
1595         First of prerequisites for new partial classs implemention.
1596         
1597         * attribute.cs (Attributable): Extended by ResolveContext;
1598         Attributes finally have correct context for resolving in all cases.
1599         (AttachTo): Attribute owner is assigned here.
1600
1601         * codegen.cs (IResolveContext): Introduce new interface to hold
1602         all information needed in resolving phase.
1603         (EmitContext): Implements IResolveContext; more clean-up needed here.
1604         
1605         * decl.cs (MemberCore): Implemented IResolveContext.
1606
1607         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1608         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1609         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1610         Refactored to use new IResolveContext instead of EmitContext; cleanup
1611
1612 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1613
1614         * codegen.cs (EmitScopeInitFromBlock): check here the
1615         capture_context, there is no need to make two calls to the
1616         EmitContext. 
1617
1618         * anonymous.cs: Add some debugging messages that might help me
1619         track other instances of this problem in the future (the
1620         regression of test 467).
1621
1622         * cs-parser.jay: track the variable block, as we need to initalize
1623         any captured variables declared in this block for the "catch"
1624         portion of the "Try" statement.
1625
1626         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1627         scope initialization for captured variables. 
1628
1629         Also, move the emit for the variables after the block location has
1630         been marked.
1631
1632 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1633
1634         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1635
1636 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1637
1638         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1639         commit yesterday, the initialization for the roots is necessary.
1640         What is not necessary is the scope activation.
1641
1642 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1643
1644         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1645         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1646         CS0206 checks.
1647         (Argument.Resolve): Remove CS0206 checks.
1648
1649 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1650
1651         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1652         scopes for all the roots, the scopes will now be emitted when the
1653         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
1654
1655         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1656         code.  This reduces a lot of existing cruft.
1657         
1658         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1659         that the ScopeInfo is generated as we enter the scope, not at the
1660         time of use, which is what we used to do before.
1661
1662         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1663         every time a Block is about to be emitted if we have a
1664         CaptureContext. 
1665
1666 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1667
1668         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1669         (Reset): Update.
1670         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1671
1672         * typemanager.cs (cons_param_array_attribute): Make private.
1673         (Reset): Set it to null.
1674         (InitCoreHelpers): Don't initialize it.
1675         (ConsParamArrayAttribute): New.  Initialize it as needed.
1676         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1677
1678 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1679
1680         * expression.cs: There might be errors reported during the
1681         selection of applicable methods.  If there are errors, do not
1682         continue execution as it will lead the compiler to crash.
1683
1684 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1685
1686         * expression.cs: Member access is not allowed on anonymous
1687         methods.  Fixes #77402.
1688
1689 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1690
1691         Fix #77401
1692         * cs-parser.jay (VariableDeclaration): Don't set
1693         current_array_type to null.
1694         (field_declaration, event_declaration, declaration_statement):
1695         Set it to null here.
1696
1697 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1698
1699         * typemanager.cs (GenericParameterPosition): New.
1700         * doc.cs: Use it.
1701
1702 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1703
1704         * doc.cs : To process "include" elements, first we should create
1705           another list than XmlNodeList, because it could result in node
1706           removal, which could result in that the XmlNodeList gives up
1707           yielding next node.
1708
1709           (Also made code identical to gmcs again.)
1710
1711 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1712
1713         * ecore.cs: Introduce an error report that we were not catching
1714         before, if not silent, we must report the error.  Gonzalo ran into
1715         it.
1716
1717 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1718
1719         A fix for bug: #76957
1720         
1721         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1722         ComputeMethodHost before creating the method, this is a new
1723         requirement. 
1724
1725         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1726         that this method references (RegisterScope).  The actual scope
1727         where the method is hosted is computed with the ComputeMethodHost
1728         before we create the method.
1729
1730         Moved the Deepest routine here.
1731
1732         (AnonymousContainer.ComputeMethodHost): New routine used to
1733         compute the proper ScopeInfo that will host the anonymous method.
1734
1735         (ScopeInfo): Deal with multiple roots.  The problem was that we
1736         did not have a unique root where all ScopeInfos could be hanged
1737         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1738         of roots.  
1739
1740         Remove AdjustMethodScope which is now computed at the end.  Remove
1741         LinkScope which did a partial link, instead link all ScopeInfos
1742         before code generation from the new "LinkScopes" routine. 
1743
1744         Simplify all the Add* routines as they no longer need to maintain
1745         the tree, they just need to record that they are using variables
1746         from a ScopeInfo.
1747
1748         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1749         routines to produce the forest of ScopeInfo trees.
1750
1751         * class.cs (TypeContainer.AppendMethod): This is just like
1752         AddMethod, but ensures that an interface implementation method
1753         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1754         methods, but at the end.
1755
1756         We use this functionality to ensure that the generated MoveNext
1757         method in the iterator class is resolved/emitted before the
1758         enumerator methods created.   
1759
1760         This is required because the MoveNext method computes the right
1761         ScopeInfo for the method.  And the other methods will eventually
1762         need to resolve and fetch information computed from the anonymous
1763         method. 
1764
1765 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1766             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1767
1768         Fix rest of #76995.
1769         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1770         the 'aliases' hash.
1771         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1772         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1773
1774 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1775
1776         Fix #76656, cs0231-2.cs.
1777         * cs-parser.jay (formal_parameter_list): Make error case catch
1778         more issues.
1779         (parenthesized_expression_0): Add CS1026 check.
1780         (invocation_expression): Remove unused { $$ = lexer.Location }.
1781
1782 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1783
1784         Fix #76824.
1785         * cs-parser.jay (statement_expression): Don't list out the
1786         individual statement-expressions.  Convert syntax error into
1787         CS0201 check.
1788
1789 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1790
1791         Fix #76874.
1792         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1793         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1794         CheckIntermediateModification.
1795         (FieldExpr.DoResolve): Add new two-argument version that
1796         allows us to resolve the InstanceExpression as an lvalue.
1797         The one-argument variant is now just a wrapper.
1798         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1799         Resolve the lhs as an lvalue if the it has a value type.
1800         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1801         from Assign.DoResolve.
1802         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1803         resolved as an lvalue.
1804         (PropertyExpr.DoResolve): Update.
1805         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1806         has a value type.  Move CS1612 check here from
1807         CheckIntermediateModification.
1808         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1809         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1810         'right_side' of a ResolveLValue on an 'out' argument.
1811         (EmptyExpression.LValueMemberAccess): New.  Used as the
1812         'right_side' of a propagated ResolveLValue on a value type.
1813         (LocalVariableReference.DoResolveBase): Recognize
1814         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1815         Add CS1654 check.
1816         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1817         EmptyExpression.Null.
1818
1819 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1820
1821         * typemanager.cs : added IsGenericParameter(). In mcs it always
1822           return false.
1823         * doc.cs : for generic parameters, use GenericParameterPosition,
1824           not FullName.
1825
1826 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1827
1828         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1829
1830 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1831
1832         This fixes the problem where we used ldfld instead of ldflda to
1833         load the "THIS" pointer on captured parameters, when THIS is a
1834         value type.  See bug #77205.
1835         
1836         * iterators.cs (CapturedThisReference.Emit): Pass false to
1837         EmitThis (we do not need the address).
1838
1839         * codegen.cs (EmitThis): it needs to know whether we need the
1840         address of `this' or not.  This is used by value types.  
1841
1842         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1843         every other call passes false.
1844
1845 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1846
1847         Fix #77221.
1848         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1849         GetOverride.
1850         * expression.cs (Invocation.OverloadResolve): Update.
1851         (Invocation.DoResolve): Avoid double resolution of invocation.
1852
1853 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1854
1855         Fix #77180.
1856         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1857         unary negation of floating point types as 0-expr; negation cannot
1858         overflow in floating point types.
1859
1860         Fix #77204.
1861         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1862         on operands of 'void' type.
1863
1864         Fix #77200.
1865         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1866         and ExclusiveOr for boolean constants too.
1867
1868 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1869
1870         Fix #75636.
1871         * expression.cs (Invocation.OverloadResolve): Replace reflected
1872         override methods with their base virtual methods, rather than
1873         skipping over them.
1874         * typemanager.cs (TypeManager.GetOverride): New.
1875
1876 2006-01-05  Jb Evain  <jbevain@gmail.com>
1877
1878         * class.cs (Property.Define, Indexer.Define): do not tag the
1879         properties as SpecialName | RTSpecialName.
1880
1881 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1882
1883         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1884         doing a low-level comparission of parameter types.  It was lacking
1885         a check for __argslist. 
1886
1887 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1888
1889         * expression.cs (ParameterReference.DoResolveBase): Allow
1890         reference parameters if they are local to this block. 
1891
1892         This allows the ref and out parameters of a delegate to be used in
1893         an anonymous method, for example:
1894
1895         delegate void set (out int x);
1896
1897         set s = delegate (out int x){
1898                 x = 0;
1899         };
1900
1901         This is used by functionality introduced late in the C# language.
1902         
1903         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1904         method that take ref and out parameters. 
1905
1906         Fixes #77119 which was a late change in the spec.
1907
1908 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1909
1910         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1911         parent if its the same scope.  Fixes #77060.
1912
1913 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1914
1915         * driver.cs: Report the case of no source files and no -out:
1916         argument provided.
1917
1918 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1919
1920         Fix #77035.
1921         * expression.cs (ComposedCast.GetSignatureForError): Define.
1922
1923 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1924
1925         Fix #76995
1926
1927         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1928         ListDictionary, to contain the ExternAliasEntry entries (in
1929         addition to the NamespaceEntry.aliases hashtable). This field is
1930         shared between the original entry and its doppelganger (bodyless 
1931         copy of it).
1932         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1933         extern_aliases field.
1934         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1935         lookup in extern_aliases.
1936
1937 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1938
1939         Fix #77006.
1940         * class.cs (TypeContainer.Mark_HasEquals): New.
1941         (TypeContainer.Mark_HasGetHashCode): New.
1942         (ClassPart): Override them.
1943         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1944
1945         Fix #77008.
1946         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1947         'parent' argument to the base constructor.
1948
1949         Remove all mention of TypeContainer from decl.cs.
1950         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1951         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1952         (DeclSpace.DeclSpace): Likewise.
1953         (DeclSpace.DefineMembers): Remove unused argument.
1954         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1955         debugging check -- we don't care if the debug code throws an
1956         InvalidCastException instead of an InternalErrorException.
1957         * class.cs (TypeContainer.DefineMembers): Update to changes.
1958         (TypeContainer.DoDefineMembers): Likewise.
1959         (TypeContainer.GetMethods): Likewise.
1960         (PropertyMember.Define): Likewise.
1961         (MemberBase.Parent): New property that forwards to
1962         MemberCore.Parent, but ensures that we get a TypeContainer.
1963         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1964         (RootContext.PopulateTypes): Likewise.  Remove special case code
1965         for !RootContext.StdLib: DefineMembers is idempotent.
1966
1967 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1968
1969         * convert.cs (ExplicitConversionCore): Check the return value from
1970         ExplicitConversionCore which can return null on failure.  Fixes #76914
1971
1972 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1973
1974         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1975
1976 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1977
1978         * doc.cs : The search for referenced namespace was insufficient to
1979           get global one as it used to do. Fixed bug #76965.
1980
1981 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1982
1983         * doc.cs : check name in cref in the last phase that whether it is
1984           namespace or not.
1985
1986 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1987
1988         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1989           Mono.C5.
1990
1991 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1992
1993         * doc.cs : so it turned out that we cannot skip override check for 
1994           interface members. Fixed bug #76954.
1995
1996 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1997
1998         * cs-tokenizer.cs : fixed bug #75984:
1999           - #warning and #error should not be handled when the source line
2000             is disabled.
2001           - #line is not checked strictly when the source line is disabled.
2002           - #define and #undef is on the other hand checked strictly at any
2003             state.
2004
2005 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2006
2007         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2008           CS1027 report.
2009
2010 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2011
2012         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2013
2014         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2015         event initializers.
2016         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2017         (FieldBase.Initializer): Initializer is now optional.
2018         (EventField.Define): Only event field can have initializer.
2019
2020         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2021
2022         * const.cs (Const): Reuse initializer.
2023
2024         * cs-parser.jay: Updated after FieldBase changes.
2025         Added current_array_type to simplify array initializers.
2026
2027         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2028
2029         * expression.cs, iterators.cs: Updated.
2030
2031         * namespace.cs (NamespaceEntry): Made UsingFound private.
2032
2033 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2034
2035         * parameterCollection.cs: Obsolete, removed.
2036         * parser.cs: Obsolete, removed.
2037
2038 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2039
2040         Fix #76849.
2041         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2042
2043         * enum.cs (Enum.Define): Set obsolete context here.
2044
2045 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2046
2047         * doc.cs :
2048           - FindDocumentedMember() now expects 1) paramList as null
2049             when "we don't have to check the number of parameters" and
2050             2) Type.EmptyTypes when "there is no arguments".
2051           - Introduced FoundMember struct to hold the exact type which was
2052             used to find the documented member (the above change broke
2053             test-xml-044; it might be better just to use DeclaringType than
2054             what MS does, like this change does, but it depends on usage.)
2055
2056 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2057
2058         * doc.cs : documented member might be from DeclaringType for nested
2059           types. Fixed bug #76782.
2060
2061 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2062
2063         * anonymous.cs: Have the param code handle leaving copies on the
2064         stack etc. Allows anonymous params to take part in the assignment
2065         code (++, +=, etc). Fixes bug #76550
2066
2067         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2068         it down to the anon code.
2069
2070         * iterators.cs: Use dummy var here
2071
2072         * codegen.cs: Handle new vars
2073
2074 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2075
2076         Fix #76849.
2077         * class.cs (MethodData.Define): Set proper Obsolete context.
2078
2079         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2080         obsolete context.
2081         (FieldExpr.DoResolve): Ditto.
2082
2083 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2084
2085         Fix #76849.
2086         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2087         parent is not obsolete.
2088
2089 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2090
2091         * doc.cs : (FindDocumentedMember) find parameterless members first
2092           and get CS0419 in the early stage. Fixed first case of bug #76727.
2093
2094 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2095
2096         Fix #76859.
2097         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2098         no error was reported.
2099
2100         *expression.cs (Binary.DoResolve): left can be null.
2101
2102 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2103
2104         Fix #76783.
2105         * class.cs (MethodData.Emit): Parameters should be labeled first.
2106
2107 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2108
2109         Fix #76761.
2110         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2111
2112 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2113
2114         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2115
2116         * class.cs (MethodCore): Parameter clean up.
2117         (IMethodData): Added ParameterInfo.
2118         (MethodData): Parameter clean up.
2119         (Indexer.Define): Parameter clean up.
2120
2121         * anonymous.cs,
2122         * codegen.cs,
2123         * cs-parser.jay,
2124         * decl.cs,
2125         * doc.cs,
2126         * ecore.cs,
2127         * flowanalysis.cs,
2128         * iterators.cs,
2129         * pending.cs,
2130         * statement.cs,
2131         * typemanager.cs: Parameter clean up.
2132
2133         * delegate.cs (Define): Get rid of duplicated code.
2134
2135         * expression.cs (ParameterReference): Removed useless parameters
2136         and simplified.
2137         (Invocation): Ditto.
2138
2139         * parameter.cs (ParamsParameter): New class, params specialization.
2140         (ArglistParameter): Attemp to separate arglist.
2141         (Parameter): Refactored to be reusable and faster.
2142         (Parameter.Modifier): Made understandable.
2143         (Parameters): Changed to be used as a class for `this' assembly
2144         parameters. Refactored to use new specialized classes.
2145
2146         * support.cs (ParameterData): Added Types property.
2147         (InternalParameters): Deleted.
2148
2149 2005-08-20  Martin Baulig  <martin@ximian.com>
2150
2151         Merging this patch from GMCS to fix #75867.
2152
2153         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2154         scope if we don't already have it.
2155
2156 2005-11-17  Martin Baulig  <martin@ximian.com>
2157
2158         * anonymous.cs
2159         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2160         inherit the scope from our parent.  Fixes #76653.
2161
2162 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2163
2164         * doc.cs : the previous patch does not actually fix the bug.
2165           PropertyInfo override check is now implemented and really fixed it.
2166         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2167
2168 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2169
2170         * doc.cs : apply "override filter" also to properties.
2171           Fixed bug #76730.
2172
2173 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2174
2175         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2176           no need to check overrides. For classes, omit those results from 
2177           interfaces since they must exist in the class. Fixed bug #76726.
2178
2179 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2180
2181         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2182           with different parameters. Fixed the second problem in #76685.
2183
2184 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2185
2186         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2187           get expected 'protected' access in CheckValidFamilyAccess()).
2188           Fixed bug #76692.
2189
2190 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2191
2192         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2193           Fixed bug #76705.  CS1569 was incorrectly commented out.
2194
2195 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2196
2197         * doc.cs : use Invocation.IsOverride() to do real override check.
2198         * expression.cs : made Invocation.IsOverride() internal.
2199
2200 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2201
2202         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2203           TypeBuilder.FindMembers() and filter overriden base members out.
2204           Fixed bug #76990.
2205
2206 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2207
2208         * doc.cs : ref/out parameters are represented as '@' (instead of
2209           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2210
2211 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2212
2213         * doc.cs : when there was no '.' in cref to methods in doc comment,
2214           then parameters were missing in the output. Fixed bug #76691.
2215
2216 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2217
2218         * driver.cs : don't output docs when there is an error.
2219           Fixed bug #76693.
2220
2221 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2222
2223         * doc.cs :
2224           Now it should detect indexers. Fixed primary concern in bug #76685.
2225           Fixed CS0419 message to not show the identical member signature in
2226           the message.
2227
2228 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2229
2230         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2231           instead of Type.FindMembers() since it does not handle events.
2232           Fixed bug #71604.
2233
2234 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2235
2236         * codegen.cs: Fixed typo (speficied -> specified).
2237
2238 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2239
2240         Fix #76369.
2241         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2242
2243 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2244
2245         * attribute.cs: Changed error message.
2246
2247         * cs-tokenizer.cs: One more check.
2248
2249 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2250
2251         * statement.cs (Block.Resolve): Ignore empty statement.
2252
2253 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2254
2255         * report.cs: Made error/warning methods more strict to avoid
2256         their misuse.
2257
2258         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2259         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2260         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2261         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2262
2263 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2264
2265         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2266         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2267
2268         * class.cs (TypeContainer.IsComImport): New property.
2269         (Constructor.Define): Create proper ctor for ComImport types.
2270
2271         * expression.cs (New.CheckComImport): Fixed.
2272
2273 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2274
2275         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2276         that a parameter has been captured does not mean that we do not
2277         have to do the rest of the processing.  This fixes the second part
2278         of #76592.  If there was another anonymous method capturing
2279         values in the past, the Scope would never be set for the second
2280         method that captured the same parameter.
2281
2282         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2283         properly manipulate the stack.   Second part of fix for #76592.
2284
2285         * expression.cs (New): Add support for invoking "new" on
2286         interfaces that have been flagged with the ComImport attribute and
2287         the CoClass.  Fixes #76637 
2288
2289         * statement.cs (Try.DoEmit): When a variable is captured, do not
2290         try to emit the vi.LocalBuilder variable as it has been captured.
2291         Create a temporary variable and store the results on the
2292         FieldBuilder.  Fixes #76642
2293
2294 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2295
2296         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2297
2298         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2299
2300         * expression.cs (Binary.DoResolve): Added && optimalization.
2301     
2302         * typemanager.cs (AddUserType): Removed useless argument.
2303
2304 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2305
2306         * statement.cs (Block.variables): Uses ListDictionary.
2307
2308 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2309
2310         Fix #75969.
2311         * class.cs (PartialContainer.EmitType): Customized to emit
2312         security attributes.
2313         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2314         for partial classes.
2315
2316 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2317
2318         Fix #76599.
2319         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2320         access has to be fixed.
2321         
2322         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2323
2324 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2325
2326         Fix #76590.
2327         * ecore.cs (NullCast.Reduce): Implemented.
2328
2329         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2330         constant type.
2331         
2332         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2333         properly.
2334         (Foreach.Resolve): Catch null properly.
2335
2336 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2337  
2338         * cs-tokenizer.cs: Warning text fix.
2339
2340         * driver.cs: AllWarningNumbers exposed on public interface.
2341
2342         * report.cs (): Reviewed warning numbers.
2343         (IsValidWarning): Use binary search.
2344
2345 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2346  
2347         * driver.cs: Implemeted resource visibility.
2348         (Resources): New class for code sharing between /res: and
2349         /linkres:
2350  
2351 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2352
2353         Fix #76568.
2354         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2355         folding.
2356         
2357         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2358         contants only.
2359         
2360         * ecore.cs (NullCast): Child is contant only.
2361         
2362         * literal.cs (NullLiteral.Reduce): null can be converted to any
2363         reference type.
2364
2365 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2366
2367         * driver.cs: Use Encoding.Default as default code page instead
2368           of ISO-28591.
2369
2370 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2371
2372         Fix #76085.
2373         * expression.cs (Invocation.Error_InvalidArguments): Handle
2374         __arglist parameters.
2375         (Invocation.VerifyArgumentsCompat): Likewise.
2376         * support.cs (ReflectionParameters.GetSignatureForError): Print
2377         __arglist parameters.
2378         (InternalParamters.GetSignatureForError): Likewise.
2379         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2380
2381 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2382
2383         * attribute.cs (GetPropertyValue): Made public.
2384
2385         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2386         Resolve.
2387         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2388         attribute.
2389         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2390         is not defined.
2391         
2392         * driver.cs: Reflect method name change.
2393         
2394         * statement.cs (Try.Resolve): Warn when try has both general
2395         exception handlers.
2396         
2397         * typemanager.cs: runtime_compatibility_attr_type new predefined
2398         type.
2399
2400 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2401
2402         Fix #76419.
2403         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2404         treat it as an empty parameter list.
2405
2406 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2407
2408         Fix #76271.     
2409         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2410         ResolveAsTypeStep silent.
2411         * statement.cs (Block.AddConstant): Mark block as used.
2412         (Block.ResolveMeta): Avoid piling on error messages
2413         if a constant initializer resolution fails.
2414
2415 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2416
2417         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2418         Remove.
2419         (NamespaceEntry.VerifyAllUsing): New.
2420         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2421         behaviour.  Delegates actual resolution of alias to ...
2422         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2423         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2424         Update.
2425         * driver.cs (Driver.MainDriver): Update.
2426         
2427         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2428         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2429         property.
2430         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2431         Remove.
2432         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2433         RootNamespace.DefineNamespacesForAll.
2434
2435 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2436
2437         * typemanager.cs (assemblies, external_aliases, modules)
2438         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2439         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2440         overhead.  Move resposibility ...
2441         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2442         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2443
2444 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2445
2446         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2447         cached_namespaces.  Improve usage.
2448         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2449         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2450         Move from GlobalRootNamespace and simplify.
2451         (RootNamespace.Global): Make instance variable.
2452         (RootNamespace.RootNamespace): Add "alias name" parameter.
2453         (GlobalRootNamespace): Simplify drastically.
2454         (Namespace.Lookup): Don't use GetNamespace.
2455         * typemanager.cs (GetRootNamespace): Rename from
2456         ComputeNamespaceForAlias.
2457         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2458
2459 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2460
2461         * anonymous.cs (AnonymousContainer): Don't crash when container
2462         doesn't exist.
2463
2464 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2465
2466         * expression.cs (Binary.DoResolve): Warn when comparing same
2467         values.
2468
2469 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2470
2471         Fix #76486.
2472         * expression.cs (Binary.DoResolve): It looks like there are no
2473         convetsion rules in enum context.
2474
2475 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2476
2477         Add support for extern alias qualifiers.
2478         * typemanager.cs: Move some LookupTypeReflection code
2479         to namespace.cs, to have cleaner code. Added some methods
2480         to help us keep track of the extern aliased references.
2481         * driver.cs: Add suport for extern alias assemblies on command
2482         line and check for their warnings/errors. Also keep track of the
2483         extern aliased assemblies.
2484         * namespace.cs: Move the global functionality of Namespace
2485         to GlobalRootNamespace/RootNamespace. Now the global namespace
2486         is GlobalRootNamespace.Globa. Also the code moved from 
2487         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2488         Finally added LocalAliasEntry (AliasEntry before) and
2489         ExternAliasEntry, to handle alias statements.
2490         * cs-parser.jay: Add support in the grammar for extern alias
2491         statement.
2492         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2493         Update callings to Namespace (now in GlobalRootNamespace).
2494
2495 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2496
2497         Fix #76371.
2498         * class.cs (TypeContainer.DefineType): Move updating of
2499         topological sort earlier in the code.
2500         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2501
2502 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2503
2504         Fix #76273.
2505         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2506         
2507         * constant.cs (Constant.TryReduce): Moved from Cast class.
2508         (Reduce): Made little bit more OO and fixed missing conversions.
2509         
2510         * ecore.cs (Reduce): Implemented.
2511         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2512         
2513         * literal.cs (Reduce): Implemented.
2514         
2515         * class.cs: Reverted Miguel's wrong commit.
2516
2517 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2518
2519         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2520
2521 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2522
2523         * cs-parser.jay, expression.cs : CS0214 was missing error location
2524           for constants. Fixed bug #76404.
2525
2526 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2527
2528         Fix #76370.
2529         * convert.cs (ExplicitConversionCore): Fixed object->enum
2530         conversion.
2531
2532 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2533
2534         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2535         InstanceExpression.
2536         (PropertyExpr.EmitCall): Likewise.
2537         * expression.cs (Invocation.EmitArguments): Handle case where
2538         arguments == null.
2539         (Invocation.EmitCall): Avoid allocating temporary variable if
2540         there are no arguments.
2541
2542 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2543
2544         Fix #76323.
2545         * convert.cs (ImplicitConversionStandard): Move conversion of
2546         void* to arbitrary pointer types ...
2547         (ExplicitConversionStandard): .. here.
2548         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2549         error to always print typenames.
2550
2551 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2552
2553         * convert.cs (GetConversionOperator): Rename from
2554         GetConversionOperators.  Move operator selection code from ...
2555         (UserDefinedConversion): ... here.
2556
2557 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2558
2559         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2560         conversion.
2561
2562 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2563
2564         * assign.cs (Assign.DoResolve): Error method changed.
2565
2566         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2567         
2568         * const.cs (ResolveValue): Reset in_transit immediately.
2569         
2570         * constant.cs: Error method changed.
2571         
2572         * convert.cs: Removed useless location parameter.
2573         (ExplicitNumericConversion): Don't do double enum check.
2574         (ExplicitConversionCore): Renamed from ExplicitConversion.
2575         (ExplicitUnsafe): Extracted from ExplicitConversion.
2576         (ExplicitConversion): Uses for error reporting.
2577         
2578         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2579         error messages.
2580         (ResolveBoolean): Uses common error method.
2581         (CastToDecimal): Get rid of ec.
2582         (CastFromDecimal): Optimized.
2583         (ConvCast): Get rid of ec.
2584         
2585         * enum.cs (ResolveValue): Reset in_transit immediately.
2586         (Emit): Return after first error.
2587         
2588         * expression.cs: Convert changes.
2589         
2590         * literal.cs: Error method changed.
2591         
2592         * statement.cs: Error method changed.
2593
2594 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2595
2596         * support.cs (SeekableStreamReader.Position): Don't error out when
2597         the requested position is just beyond the end of the current
2598         buffered data.
2599
2600 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2601
2602         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2603         try to keep in sync with the byte count of the underlying Stream.
2604         However, this limits us to a window size of 2048 characters: i.e.,
2605         the maximum lookahead of our lexer/parser can be 2048 characters.
2606
2607 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2608
2609         Fix #76255.
2610         * driver.cs: Fix compilation files with full root path.
2611
2612 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2613
2614         * report.cs (SymbolRelatedToPreviousError): Format the output so
2615         it does not use an open parenthesis that is never closed. 
2616
2617         * driver.cs: Follow coding guidelines
2618
2619 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2620
2621         Fix #72930.
2622         * const.cs (Const.ResolveValue): Check for assigning non-null
2623         value to reference type.
2624
2625 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2626
2627         * anonymous.cs: Implemented ExprClassName.
2628         
2629         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2630         delegate.
2631         
2632         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2633         check.
2634         
2635         * class.cs (StaticClass.DefineContainerMembers): Report protected
2636         members as error.
2637         
2638         * codegen.cs: if(ed) PRODUCTION.
2639         
2640         * convert.cs (Error_CannotImplicitConversion): Better error
2641         distinction.
2642         
2643         * cs-parser.jay: More error checks.
2644         
2645         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2646         
2647         * driver.cs (CSCParseOption): Enabled wrong option check.
2648         
2649         * ecore.cs (Expression.ExprClassName): Turned to property.
2650         (MemberExpr.CheckIntermediateModification): For checking boxed
2651         value types     modification.
2652         
2653         * statement.cs (Fixed.Resolve): Expression type must be
2654         convertible to fixed type.
2655         (CollectionForeach.GetEnumeratorFilter,TryType):
2656         Small refactoring for easier error checking.
2657
2658 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2659
2660         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2661         attributes.
2662         
2663         * class.cs (GeneratedBaseInitializer): New class for customization
2664         compiler generated initializers.
2665         (MemberBase.DoDefine): Check Obsolete attribute here.
2666         (FieldMember.DoDefine): Ditto.
2667         
2668         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2669         constants.
2670         
2671         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2672         (MemberCore.GetObsoleteAttribute): Removed argument.
2673         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2674         (MemberCore.CheckObsoleteType): New helper.
2675         
2676         * delegate.cs,
2677         * enum.cs,
2678         * statement.cs: Updates after MemberCore changes.
2679         
2680         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2681         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2682         
2683         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2684         obsolete attribute for compiler construct.
2685         (As.DoResolve): Cache result.
2686         
2687         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2688
2689 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2690
2691         Fix #76133.
2692         * expression.cs (This.VerifyFixed): In a value type T, the type of
2693         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2694         value type R, 'this' is treated as a value parameter.
2695
2696 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2697
2698         * statement.cs (Lock): Use the TemporaryVariable class instead of
2699         manually using local variables as those do not work when variables
2700         are captured.
2701
2702         * ecore.cs: Moved the TemporaryVariable class from being a nested
2703         class inside Foreach to be a public class that can be employed in
2704         other places. 
2705
2706 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2707
2708         * cs-parser.jay: interface_accessors replaced by
2709         accessor_declarations.
2710
2711         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2712         location.
2713         
2714         * statement.cs (GotoCase.Resolve): Convert null constant to
2715         null case.
2716         (SwitchLabel.ResolveAndReduce): Ditto.
2717         (SwitchLabel.NullStringCase): Custom null stamp.
2718         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2719         
2720         typemanager.cs (CSharpSignature): Don't skip first argument
2721         for full names.
2722
2723 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2724
2725         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2726
2727         * location.cs (InEmacs): in this mode, do not report column
2728         location as it confuses Emacs.
2729
2730 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2731
2732         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2733         expression.cs, iterators.cs, literal.cs: Store constants and
2734         literals location.
2735         
2736         * class.cs (MemberBase.ShortName): Pass location.
2737         
2738         * cs-parser.jay: Some location fixes.
2739         
2740         * ecore.cs (Expression.Location): Made virtual.
2741
2742 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2743
2744         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2745         if the underlying types are the same, otherwise we need to produce
2746         code that will do the proper cast.
2747
2748         This was exposed by Marek's constant rewrite which produced
2749         invalid code for the call site:
2750
2751         enum X : long { a }
2752         void Method (X v) {}
2753
2754         Method ((X) 5)
2755
2756         This fixes test-49.cs
2757
2758 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2759
2760         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2761           Type/Object should be allowed as well. Fixed bug #75968.
2762
2763 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2764
2765         * expression.cs : (Binary.DoResolve): when one is enum constant and
2766           another is constant 0, then return enum one *as enum type*.
2767           Fixed bug 74846.
2768
2769 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2770
2771         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2772         internal.
2773
2774         Fix #75941.
2775         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2776         flow-branching for LocalVariableReferences in case we were invoked
2777         from a MemberAccess.
2778         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2779         Carved out of ...
2780         (LocalVariableReference.DoResolveBase): ... this.
2781         (MemberAccess.Resolve): Do the check that was disabled during
2782         SimpleNameResolve.
2783
2784 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2785
2786         * class.cs :
2787           (PartialContainer.Create): check abstract/sealed/static strictly
2788           but abstract/sealed can exist only at one side. Fixed bug #75883.
2789
2790 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2791
2792         Fix #75945.
2793         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2794         specified, don't default to UnmanagedType.I4.
2795
2796 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2797
2798         * expression.cs : conditional operator should check possibly
2799           incorrect assign expression. Fixed bug #75946.
2800
2801 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2802
2803         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2804           Reverting the change. gmcs is much complex than mcs on this matter.
2805
2806 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2807
2808         * cs-tokenizer.cs : To read another token ahead of the actual 
2809           consumption, use new SavedToken and cache token instead of moving
2810           back the stream with SeekableStreamReader (it seemed problematic).
2811         * cs-parser.jay,
2812           driver.cs : Thus use StreamReader directly.
2813         * support.cs : Thus removed SeekableStreamReader.
2814
2815 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2816
2817         Fix #75934.
2818         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2819         (ScopeInfo.EmitScopeType): Use it to construct field names from
2820         names of captured locals.
2821
2822         Fix #75929.
2823         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2824         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2825         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2826         (ExplicitConversion): Remove enum cases already handled by
2827         implicit conversion.  Move implicit conversion check to the beginning.
2828         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2829         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2830         Don't treat System.Enum as a struct.
2831
2832 2005-08-30  Jb Evain  <jbevain@gmail.com>
2833
2834         * attribute.cs: handles as expression in parameters.
2835
2836 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2837
2838         Fix #75802.
2839         * class.cs (TypeContainer.VerifyClsName): Don't use a
2840         PartialContainer when verifying CLS compliance.
2841         (AbstractPropertyEventMethod): Set Parent here, ...
2842         (PropertyMethod): ... not here.
2843
2844 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2845
2846         * attribute.cs : escaped attribute name should not be allowed to be
2847           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2848
2849 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2850
2851         Fix #75927.
2852         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2853         when converting a long constant to unsigned long.
2854         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2855         detect where IsApplicable and VerifyArgumentsCompat disagree.
2856
2857 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2858         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2859
2860         Fix #75848.
2861         * class.cs (TypeContainer.CanElideInitializer): New helper.
2862         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2863         can safely emitting the initializer of a field.
2864
2865 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2866
2867         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2868           allowed inside a switch (without loop). Fixed bug #75433.
2869
2870 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2871
2872         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2873         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2874
2875 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2876
2877         * driver.cs : kinda reverting the default encoding changes (not exact 
2878           revert since I noticed that "codepage:reset" might not work fine).
2879
2880 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2881
2882         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2883           Location. Now getter and setter store location correctly.
2884           (errors/cs0111-12.cs now reports the expected location.)
2885
2886 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2887
2888         * driver.cs : Use default encoding on the environment.
2889           Removed (now that) extra parameter for SeekableStreamReader.
2890         * support.cs : (SeekableStreamReader) third .ctor() argument for
2891           StreamReader is not required (always true). preamble size could
2892           be acquired in simpler and safe way.
2893
2894 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2895
2896         * cs-parser.jay: report CS0642 at warning level 3
2897           and report CS0642 for an if else statement also
2898           fixes bug #74745. Patch by John Luke (and a bit
2899           modified by me).
2900           Removed extra CS0642 warning check for "while",
2901           "for" and "fixed".
2902         * statement.cs: In Block.Resolve(), CS0642 check
2903           is reimplemented to check a sequence of an empty
2904           statement and a block.
2905
2906           Both fix bug #66777.
2907
2908 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2909
2910         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2911         detection until I fix it.
2912         
2913         * cs-tokenizer.cs: Changed error message.
2914         
2915         * cs-parser.jay: Fixed 2 error locations.
2916         
2917         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2918         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2919         properties.
2920         
2921         * enum.cs (GetSignatureForError): Fixed.
2922         
2923         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2924         method detection.
2925         
2926         * class.cs,
2927         * typemanager.cs (RegisterProperty): Removed.
2928         
2929         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2930
2931 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2932
2933         Fix #75874.
2934         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2935         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2936
2937 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2938
2939         * expression.cs : tiny fix is required for not warning positive ulong.
2940           See test-441.cs.
2941
2942 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2943
2944         * expression.cs : add CS0652 check for constant and integral
2945           expression. Fixed bug #53974.
2946
2947 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2948
2949         * expression.cs : in DoNumericPromotions(), check if there is implicit
2950           conversion overload for string (to check CS0034). Fixed bug #52492.
2951
2952 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2953
2954         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2955
2956 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2957
2958         * ecore.cs : report location when it is *not* Null.
2959
2960 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2961
2962         * codegen.cs,
2963           ecore.cs,
2964           flowanalysis.cs,
2965           expression.cs:
2966           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2967           correctly. Fixed bug #75721.
2968
2969 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2970
2971         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2972         loop that performs 'min (pos, char_count)'.
2973
2974         Fix #75862.
2975         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2976         converted value in Operator.OnesComplement.
2977
2978 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2979
2980         * anonymous.cs: If the anon method is pulled into a helper class,
2981         it needs to be `internal' not `private'. Fixes runtime behavior on
2982         msft. bug #75704
2983
2984 2005-08-20  Martin Baulig  <martin@ximian.com>
2985
2986         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2987         scope if we don't already have it.
2988
2989         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2990         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2991         fixes #75867.
2992
2993 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2994
2995         Fix #75803
2996         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2997         is a partial class.
2998
2999 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3000
3001         The big constants rewrite
3002         Fix #75746, #75685 and more
3003         As a side effect saved 1MB for MWF ;-)
3004         
3005         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3006         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3007         enum based for corlib compilation.
3008         
3009         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3010         subtractions.
3011         
3012         * class.cs (FixedField.Define): Use ResolveAsConstant.
3013         
3014         * const.cs (IConstant): Interface constants and enums.
3015         (Const.ResolveValue): New method for constant resolvning.
3016         (ExternalConstant): Constants from imported assemblies.
3017         
3018         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3019         conversion; like enums.
3020         (Constant.ToType): Converts this constant to different type.
3021         (Constant.Increment): Adds 1.
3022         
3023         * convert.cs (ImplicitConversionRequired): Simplified.
3024         
3025         * cs-parser.jay: Create EnumMember directly.
3026         
3027         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3028         
3029         * doc.cs (GenerateEnumDocComment): Removed.
3030         
3031         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3032         (ConvertIntLiteral): Removed.
3033         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3034         
3035         * enum.cs (EnumMember): Implement IConstant.
3036         (Enum.IsValidEnumConstant): Removed.
3037         (Enum.GetNextDefaultValue): Removed.
3038         (Enum.FindMembers): Updated.
3039         (Enum.GenerateDocComment): Iterate enum members.
3040         
3041         * expression.cs (Cast.TryReduce): Handle enums correctly.
3042         (New.Constantify): Made public.
3043         (MemberAccess.DoResolve): Removed contant specific if(s).
3044         
3045         * literal.cs (NullLiteral): Implement new abstract methods.
3046         
3047         * statement.cs (GotoCase.Resolve): Use new constant methods.
3048         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3049         
3050         * typemanager.cs (LookupEnum): Removed.
3051         (IsEnumType): Fixed to work with corlib.
3052         (RegisterConstant): Removed.
3053         (LookupConstant): Removed.
3054         (GetConstant): Changed to work with IConstant.
3055
3056 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3057
3058         * location.cs : Fixed overflown (>255) column number.
3059
3060 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3061
3062         First cut of the qualified-alias-member feature.
3063         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3064         token.
3065         * cs-parser.jay (DOUBLE_COLON): New token.
3066         (namespace_or_type_name): Add rule for recognizing
3067         qualified-alias-members.
3068         (primary_expression): Likewise.
3069         (element_access): Allow QualifiedAliasMember as a possible
3070         type-bearing expression.
3071         (local_variable_type, local_variable_pointer_type): Likewise.
3072         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3073         aliases in the current and enclosing namespace declarations.
3074         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3075         * decl.cs (MemberName.is_double_colon): New.
3076         (MemberName.MemberName): Add new constructor for alias-member.
3077         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3078         * expression.cs (QualifiedAliasMember): New expression type.
3079
3080 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3081
3082         * location.cs : it borked when no argument was specified.
3083
3084 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3085
3086         * location.cs : tiny ToString() format fix.
3087
3088 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3089
3090         * statement.cs : oops, it was missing.
3091
3092 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3093
3094         A set of fixes for precise line/column location.
3095
3096         * location.cs :
3097           "token" field now holds a file/line "delta", a line number offset 
3098           from the segment, and a column number. See also:
3099           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3100           December/009508.html
3101           Removed static IsNull. Use instance IsNull property instead.
3102         * cs-tokenizer.cs :
3103           For some tokens it stores Location. For Identifier it stores
3104           LocatedToken which is a pair of string name and location.
3105           Column numbers are adjusted only at getChar().
3106         * report.cs :
3107           Use Location.ToString() for reporting (it now contains column).
3108         * cs-parser.jay :
3109           Largely modified to use LocatedToken instead of
3110           string (IDENTIFIER), and to acquire Location from some tokens.
3111         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3112           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3113           codegen.cs :
3114           Now MemberName holds Location. DeclSpace.ctor() receives Location
3115           as a parameter. Removed extra parameters to all derived classes.
3116           Replaced Location.IsNull() with instance property.
3117         * assign.cs, expression.cs :
3118           Added .ctor() overload that omits Location.
3119         * attribute.cs :
3120           Added "nameEscaped" flag that indicates the identifier was escaped
3121           in the source file. This fixes bug #57047.
3122
3123 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3124
3125         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3126         New method, looking for lo-case imported cls type.
3127
3128         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3129         here.
3130
3131         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3132
3133         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3134
3135         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3136         all_imported_types.
3137         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3138
3139         Optimized to save 3.5 MB for SWF compilation.
3140
3141 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3142
3143         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3144         (PartialContainer.Create): Moved logic AddToContainer.
3145         (PartialContainer.MarkForDuplicationCheck): Shares name.
3146         
3147         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3148         place.
3149         
3150         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3151         initialization.
3152         (Namespace.GetSignatureForError): New method.
3153         
3154         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3155         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3156
3157 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3158
3159         Fix #75669.
3160         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3161         member lookup rather than qualifier_type, since qualifier_type can
3162         be null.
3163
3164 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3165
3166         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3167         enum member.
3168
3169 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3170
3171         * statement.cs: Copy the local exception into the exception
3172         captured local.  Fixes 75674
3173
3174 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3175
3176         Fix #75658.
3177         * expression.cs (Invocation.OverloadResolve): Don't report error
3178         CS1501 if error CS1502 has been reported.
3179         (New.DoResolve): Delegate CS1501 reporting to
3180         Invocation.OverloadResolve.
3181
3182         Fix #75656.
3183         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3184         invariant-meaning-in-block property in an enclosing block if
3185         necessary.
3186
3187 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3188
3189         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3190         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3191         (Switch.CheckSwitch): Just save 50kb for SWF.
3192
3193 2005-07-27  Martin Baulig  <martin@ximian.com>
3194
3195         * anonymous.cs (CaptureContext.AddField): Added
3196         `AnonymousContainer am' argument; compute its toplevel scope if
3197         it's not already computed.  Fixes #75649.
3198
3199 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3200
3201         Fix #75628.
3202         * class.cs (Constructor.Emit): Reset block to null if the block
3203         resolve fails.
3204
3205 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3206
3207         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3208
3209 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3210
3211         * class.cs (MethodData.Define): Check whether accessor implementing
3212         interface is public.
3213
3214         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3215
3216 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3217
3218         Fix #57245
3219         * namespace.cs (LookupType): Moved same type check to...
3220         
3221         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3222         with the same name.
3223
3224 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3225
3226         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3227         already found a typebuilder.
3228         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3229         MemberNames, not strings.
3230
3231         * const.cs (Error_ExpressionMustBeConst): 
3232         Rename from Error_EpressionMustBeConst.
3233         * const.cs, class.cs, statement.cd: Update.
3234
3235 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3236
3237         Fix #65573
3238
3239         * const.cs (Const.LookupConstantValue): Report missing contant expression
3240         everytime.
3241         (Error_EpressionMustBeConstant): Only one error method.
3242
3243         * class.cs, statement.c: Updated.
3244
3245 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3246
3247         * statement.cs (Block.Flags): Add back HasVarargs.
3248         (Block.flags): Make protected.
3249         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3250
3251         * typemanager.cs (types, typecontainers, user_types): Remove.
3252         (UserTypes, TypeContainers): Likewise.
3253         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3254         (CleanUp, Reset): Update.
3255         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3256         (GetNestedType): Use Type.GetNestedType.
3257         (CoreLookupType): Take two arguments, the namespace and the
3258         basename of the type.  Update to use the Namespace.Lookup
3259         mechanism.
3260         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3261         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3262         string concatenation and substring matches.
3263         * class.cs, enum.cs, delegate.cs: Update to changes.
3264
3265 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3266
3267         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3268         Expression and made virtual.
3269
3270         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3271         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3272
3273         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3274
3275         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3276         error message.
3277
3278         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3279         change.
3280
3281 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3282
3283         Fix #57707
3284         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3285         AssemblyCultureAttribute is not used on executable.
3286
3287         * rootcontext.cs,
3288         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3289
3290 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3291
3292         Fix #60638.
3293         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3294         New.  Reports CS0252/CS0253.
3295         Mostly taken from preliminary patch by Duncak Mak.
3296         (Binary.DoResolveOperator): Store results of operator lookup.
3297         Use them to detect if we need to warn about unintended reference
3298         comparisons.
3299
3300 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3301
3302         Fix #72969.
3303         * namespace.cs (Namespace.Lookup): Add back location parameter.
3304         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3305         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3306
3307         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3308         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3309         (Namespace.LookupType): ... this.
3310         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3311         of namespaces.
3312         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3313         purported to handle pointers.
3314         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3315         CoreLookupType.
3316
3317 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3318
3319         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3320         type as namespace.
3321
3322 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3323
3324         * namespace.cs (Namespace.Lookup): Drop location parameter.
3325         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3326         (NamespaceEntry.Lookup): ... this.
3327         (NamespaceEntry.Error_AmbiguousTypeReference):
3328         Move here from DeclSpace.
3329         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3330         names ...
3331         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3332         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3333         Move to NamespaceEntry.
3334         * delegate.cs, expression.cs: Update to changes.
3335
3336 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3337
3338         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3339         CheckAttributeType and refactored.
3340         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3341         ResolveAsTypeTerminal error handling.
3342         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3343         handling.
3344         (GetSignatureForError): Print errors in same way.
3345
3346         * class.cs,
3347         * codegen.cs: Reflect attribute GetSignatureForError change.
3348
3349         * ecore.cs,
3350         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3351
3352         * namespace.cs (UsingEntry): Refactored to make fields private.
3353
3354         * assign.cs,
3355         statement.cs: Error_UnexpectedKind has extra parameter.
3356
3357 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3358
3359         * ecore.cs (IAlias): Remove.
3360         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3361         that implement the interface.
3362         * namespace.cs (Namespace): Likewise.
3363         (Namespace.declspaces): Renamed from 'defined_names'.
3364         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3365         DeclSpace instead of an IAlias.
3366         * tree.cs (Tree.AddDecl): Update.
3367
3368 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3369
3370         * statement.cs (Block.Flags); Remove HasVarargs.
3371         (Block.HasVarargs): Move to ToplevelBlock.
3372         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3373         (Block.Variables): Make protected.  Initialize variable hashtable
3374         if necessary.
3375         (Block.AddVariable): Update.
3376         (Block.Resolve): Update to changes.
3377         (ToplevelBlock.HasVarargs): New boolean.
3378         (ToplevelBlock.ThisVariable): Move here from Block.
3379         (ToplevelBlock.AddThisVariable): Likewise.
3380         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3381         * expression.cs (This.ResolveBase): Update to changes.
3382         (ArglistAccess.DoResolve): Likewise.
3383
3384 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3385
3386         Fix #75321
3387         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3388
3389         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3390         not used and not used & assigned.
3391         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3392
3393 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3394
3395         Fix #75053
3396         * expression.cs (Is.DoResolve): null is never provided type.
3397
3398 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3399
3400         Fix #52496
3401         * cs-parser.jay: Less strict event error rule to catch more errors.
3402
3403 2005-07-08  Martin Baulig  <martin@ximian.com>
3404
3405         Fix test-iter-10.cs - distinguish whether we `yield' in a property
3406         gettter (allowed) or setter (not allowed).
3407
3408         * class.cs (Accessor): Implement IIteratorContainer.
3409         (Accessor.Yields): New public field.
3410         (PropertyBase.PropertyMethod.Define): Handle iterators on a
3411         per-accessor basis.
3412
3413         * cs-parser.jay
3414         (get_accessor_declaration, set_accessor_declaration): Set the
3415         `yields' flag on the accessor, not the property.
3416         (property_declaration): Do the iterators check on a per-accessor
3417         basis and not for the whole property.
3418
3419 2005-07-08  Martin Baulig  <martin@ximian.com>
3420
3421         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3422         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3423
3424 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3425
3426         Fix #74975
3427         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3428         (ExtractSecurityPermissionSet): Cope with self referencing security
3429         attributes properly.
3430
3431         * driver.cs (SetOutputFile): Made public property OutputFile.
3432
3433 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3434
3435         Fix #75486.
3436         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3437         has_nonstatic_fields.  Make into a FieldBase pointer.
3438         (TypeContainer.AddField): Add CS0282 check.
3439         (TypeContainer.EmitType): Update.
3440
3441 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3442
3443         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3444         compare if they start with __.
3445
3446 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3447
3448         * statement.cs (Switch.SwitchGoverningType): Only look at
3449         UserCasts that don't need implicit standard conversions to one of
3450         the allowed switch types (Fixes test-322.cs).
3451         (LocalInfo.Resolve): Re-enable sanity-test.
3452
3453 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3454
3455         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3456         
3457         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3458         
3459         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3460
3461 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3462
3463         Fix #75472.
3464         * ecore.cs (SimpleName.GetSignatureForError): Add.
3465         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3466         (MemberAccess.GetSignatureForError): Add.
3467
3468 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3469  
3470         The big error and warning messages review.
3471         
3472         * anonymous.cs,
3473         * assign.cs,
3474         * attribute.cs,
3475         * class.cs,
3476         * codegen.cs,
3477         * convert.cs,
3478         * cs-parser.jay,
3479         * cs-tokenizer.cs,
3480         * decl.cs,
3481         * delegate.cs,
3482         * doc.cs,
3483         * driver.cs,
3484         * ecore.cs,
3485         * enum.cs,
3486         * expression.cs,
3487         * flowanalysis.cs,
3488         * iterators.cs,
3489         * literal.cs,
3490         * location.cs,
3491         * modifiers.cs,
3492         * namespace.cs,
3493         * parameter.cs,
3494         * pending.cs,
3495         * report.cs,
3496         * rootcontext.cs,
3497         * statement.cs,
3498         * support.cs,
3499         * tree.cs,
3500         * typemanager.cs: Updated.
3501         
3502         * class.cs: (MethodCore.SetYields): Moved here to share.
3503         (PropertyMethod.Define): Moved iterator setup here.
3504         
3505         * iterators.cs: Add orig_method to have full access to parent
3506         container.
3507
3508 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3509
3510         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3511         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3512         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3513         variable of struct type.
3514         * expression.cs (Unary.ResolveOperator): Update to change.
3515         (Indirection.VerifyFixed): Likewise.
3516         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3517         (ParameterReference.VerifyFixed): Value parameters are fixed.
3518         (This.VerifyFixed): Treat 'this' as a value parameter.
3519         * statement.cs (LocalInfo.IsFixed): Remove.
3520
3521 2005-07-01  Martin Baulig  <martin@ximian.com>
3522
3523         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3524         `ec.EmitThis ()' to get the correct scope.
3525
3526 2005-07-01  Martin Baulig  <martin@ximian.com>
3527
3528         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3529         instance is a ParameterReference; fixes #75299.
3530
3531 2005-07-01  Martin Baulig  <martin@ximian.com>
3532
3533         Reverted Marek's latest patch (r46725):
3534         - it contains structural changes which are neither mentioned in
3535           the ChangeLog nor explained anywhere; for example the additional
3536           argument of EmitContext's and Iterator's .ctor's and the
3537           TypeContainer.DefineMembers() change.
3538         - structural changes like this should go in in seperate patches
3539           and not be hidden in a huge patch which just seems to affect
3540           warnings and errors.
3541           a big and hard to understand patch.
3542         - it breaks iterators and causes regressions, for instance in
3543           test-iter-03.cs.      
3544
3545 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3546
3547         Fix #75412.
3548         * expression.cs (Indexers.map): Remove.
3549         (Indexers.Append): Filter out inaccessible setters and getters.
3550         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3551
3552         Fix #75283.
3553         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3554         Refactored from ...
3555         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3556         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3557         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3558         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3559
3560 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3561
3562         Fix #75322
3563         * class.cs (FieldBase.GetInitializerExpression): One more field
3564         for backup.
3565
3566 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3567
3568         * pending.cs: Do not define a proxy if the base method is virtual,
3569         it will be picked up by the runtime (bug 75270).
3570
3571 2005-06-08  Martin Baulig  <martin@ximian.com>
3572
3573         The big Iterators rewrite :-)
3574
3575         * iterators.cs: Rewrite this to use the anonymous methods framework.
3576
3577         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3578         before the TypeContainers; see 2test-21.cs.
3579
3580         * class.cs
3581         (TypeContainer.DefineType): Don't create a new EmitContext if we
3582         already have one (this only happens if we're an Iterator).
3583         (TypeContainer.Define): Also call Define() on all our iterators.
3584         (Method.CreateEmitContext): Added support for iterators.
3585
3586         * anonymous.cs
3587         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3588         (AnonymousContainer.CreateMethodHost): Moved here from
3589         AnonymousMethod and made abstract.
3590         (AnonymousContainer.CreateScopeType): New abstract method.
3591         (AnonymousContainer.IsIterator): New public property.
3592         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3593         get the ScopeTypeBuilder rather than manually defining it here. 
3594         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3595         iterators here.
3596
3597         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3598         before RootContext.DefineTypes().
3599
3600         * codegen.cs (EmitContext.RemapToProxy): Removed.
3601         (EmitContext.CurrentAnonymousMethod): Changed type from
3602         AnonymousMethod -> AnonymousContainer.
3603         (EmitContext.ResolveTopBlock): Protect from being called twice.
3604         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3605         (EmitContext.EmitThis): Removed the iterators hacks; use the
3606         anonymous methods framework for that.
3607
3608         * statement.cs
3609         (ToplevelBlock.Container): Make this a property, not a field.
3610         (ToplevelBlock.ReParent): New public method; move the
3611         ToplevelBlock into a new container.
3612         (Foreach.TemporaryVariable): Simplify.
3613
3614 2005-06-05  Martin Baulig  <martin@ximian.com>
3615
3616         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3617         (Block.AddTemporaryVariable): New public method; creates a new
3618         `LocalInfo' for a temporary variable.
3619         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3620         variables here.
3621         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3622         non-iterator variables.
3623
3624 2005-06-05  Martin Baulig  <martin@ximian.com>
3625
3626         * statement.cs (Foreach.TemporaryVariable): Create the
3627         LocalBuilder in the Emit phase and not in Resolve since in some
3628         situations, we don't have an ILGenerator during Resolve; see
3629         2test-19.cs for an example.
3630
3631 2005-06-04  Martin Baulig  <martin@ximian.com>
3632
3633         **** Merged r45395 from GCS ****
3634
3635         The big Foreach rewrite - Part II.
3636
3637         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3638         with `PropertyInfo ienumerator_getcurrent'.
3639
3640         * codegen.cs (VariableStorage): Removed.
3641
3642         * statement.cs
3643         (Foreach): Derive from Statement, not ExceptionStatement.
3644         (Foreach.CollectionForeach): New nested class.  Moved all the code
3645         dealing with collection foreach here.
3646         (Foreach.ForeachHelperMethods): Removed.
3647         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3648
3649 2005-05-23  Martin Baulig  <martin@ximian.com>
3650
3651         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3652         don't need to.  Fix #75014.
3653
3654 2005-05-20  Martin Baulig  <martin@ximian.com>
3655
3656         Merged r44808 from GMCS.
3657
3658         * class.cs (TypeContainer.CircularDepException): Removed.
3659         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3660         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3661         (CS0146) and interface (CS0529) dependencies here.
3662
3663 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3664
3665         * expression.cs (Invocation.EmitCall): Fix initialization
3666         'this_call' to reflect current behaviour.  Fix indentation.
3667
3668         * convert.cs (FindMostEncompassedType): Add two trivial special
3669         cases (number_of_types == 0 || number_of_types == 1).
3670         (FindMostEncompasingType): Likewise.
3671
3672 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3673
3674         Some cleanups preparing for the fix of #75283.
3675         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3676         error testing.
3677         (EventExpr.InstanceResolve): Likewise.
3678         (EventExpr.DoResolve): Remove redundant checks.
3679
3680 2005-06-10  Duncan Mak  <duncan@novell.com>
3681
3682         * cs-tokenizer.cs (process_directives): New flag for controlling
3683         the processing of preprocessor directives.
3684         (x_token): After seeing a '#', return Token.NONE instead of going
3685         to handle_preprocessing_directive() when not processing
3686         directives. This avoids unnecessary processing during the token peek in
3687         is_punct().
3688
3689         This fixes #74939.
3690
3691         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3692         the existing error reporting methods instead of Report.Error.
3693
3694         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3695         after Raja's rewrite.
3696
3697 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3698
3699         * class.cs: Small fix.
3700
3701 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3702
3703         Fix #75160.
3704         * class.cs (GetPartialBases): Fix return value check of
3705         part.GetClassBases.
3706
3707 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3708
3709         Ensure that partial classes are registered in their enclosing
3710         namespace.  Initial part of fix of #75160.
3711         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3712         Register declspace with namespace here, not in
3713         DeclSpace.RecordDecl.
3714         * cs-parser.jay: Pass namespace to RecordDecl.
3715         * class.cs (PartialContainer.Create): Likewise.
3716         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3717         called.
3718         * decl.cs (Declspace.RecordDecl): Remove.
3719         * namespace.cs (NamespaceEntry.DefineName): Remove.
3720
3721 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3722
3723         * rootcontext.cs: Reset TargetExt as well.
3724
3725 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3726
3727         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3728         -langversion:ISO-1.
3729
3730 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3731
3732         Fix #75080, cs0119.cs.
3733         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3734         of ...
3735         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3736         allowing ExprClass.Type and ExprClass.Namespace for
3737         ResolveFlags.VariableOrValue.
3738         (Expression.Resolve) [1-argument variant]: Change default resolve
3739         flags based on language version.
3740         (Expression.Error_UnexpectedKind): Use a simple string array
3741         rather than an ArrayList.
3742         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3743         not ExprClass.Type.
3744         (TypeOfVoid.DoResolve): Likewise.
3745         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3746         flags argument -- it always has the same value.
3747
3748 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3749
3750         Fix #75081.
3751         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3752         Use it in the error message.
3753         * assign.cs, expression.cs, statement.cs: Update.
3754
3755 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3756
3757         Fix #75088.
3758         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3759         the "almostMatchedMember" case too.
3760         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3761         that failed the accessibility checks to 'almost_match'.
3762
3763 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3764
3765         * attribute.cs: Use internal MethodBuilder methods to set
3766         ExactSpelling and SetLastError on PInvoke methods, instead
3767         of passing them via charset.  Fixes #75060.
3768
3769 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3770
3771         * parameter.cs (Parameter): Remove TODO comment.
3772         (Parameter.DefineParameter): Remove Location parameter.
3773         (Parameters.LabelParameters): Likewise.
3774         * class.cs (Constructor.Emit): Update to change.
3775         (MethodData.Emit): Likewise.
3776         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3777         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3778
3779 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3780
3781         * parameter.cs,
3782           Removed Parameters.Location and added Parameter.Location instead.
3783           Removed Location parameter from Emit() and GetSignature().
3784         * anonymous.cs,
3785           class.cs,
3786           cs-parser.jay,
3787           delegate.cs,
3788           iterators.cs,
3789           statement.cs :
3790           Modified all related calls.
3791
3792 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3793
3794         Improve user-defined conversion handling.
3795         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3796         applicable operators.
3797         (AddConversionOperators): New.  Helper for GetConversionOperators.
3798         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3799         there is only one most encompassed/encompassing type.
3800         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3801         "applicable operator" handling.
3802         (UserConversion): Move cache here from GetConversionOperators.
3803         Directly cache the chosen operator, rather than the whole
3804         MethodGroup.
3805         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3806         case.  Allow conversion of decimal to sbyte and byte too.
3807         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3808         New static methods.  Used to avoid allocating EmptyExpressions in
3809         convert.cs.
3810
3811 2005-05-24  Duncan Mak  <duncan@novell.com>
3812
3813         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3814         another class, used in Convert.ExplicitNumericConversion.
3815         (CastToDecimal): New class, similar to above, but casts to
3816         System.Decimal, used in Convert.ImplicitNumericConversion and also
3817         in explicit convesion from double/float to decimal.
3818
3819         * convert.cs (ImplicitNumericConversion): Handle implicit
3820         conversions to System.Decimal.
3821         (ExplicitNumericConversion): handle explicit conversions to
3822         System.Decimal.
3823
3824         This fixes #68711.
3825         
3826 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3827
3828         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3829         know the type at this stage, just break through.   Fixes #75008 
3830
3831 2005-05-19  Martin Baulig  <martin@ximian.com>
3832
3833         * delegate.cs
3834         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3835         to disable error reporting.
3836
3837         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3838         here since we don't want to report an error; see the new test-336.cs.
3839
3840 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3841
3842         * statement.cs (ToplevelBlock.GetParameterReference)
3843         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3844         Move here from class Block.
3845         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3846         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3847
3848 2005-05-18  Martin Baulig  <martin@ximian.com>
3849
3850         Fix #74978.
3851
3852         * flowanalysis.cs
3853         (FlowBranching.Reachability): Add non-static public And() and Or()
3854         methods.
3855         (FlowBranchingSwitch): New class; do the `break_origins' thing
3856         like in FlowBranchingLoop.
3857         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3858         reachability, not just locals and parameters.
3859         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3860         switch; MergeBreakOrigins() now takes care of that.
3861
3862 2005-05-18  Martin Baulig  <martin@ximian.com>
3863
3864         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3865         a loop and may leave it, reset the barrier; fixes #74974.
3866
3867 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3868         
3869         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3870         is back.
3871         
3872         * cs-parser.jay: Catch more lexical errors.
3873         
3874         * report.cs: Add one more Error method.
3875         
3876         * rootcontext.cs,
3877         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3878
3879 2005-05-17  Martin Baulig  <martin@ximian.com>
3880
3881         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3882         #70970. 
3883
3884 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3885
3886         Fix test-382.cs.  Emit values of decimal constants.
3887         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3888         Carved out of ...
3889         (TypeContainer.AddField): ... this.
3890         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3891         with initializers to include 'Const's.
3892         (ClassPart.RegisterFieldForInitialization): Forward to
3893         PartialContainer.
3894         * const.cs (Const.Const): Pass initializer to base class.
3895         (Const.Define): In case of decimal constants, register them for
3896         initialization in a static constructor.
3897
3898 2005-05-14  Martin Baulig  <martin@ximian.com>
3899
3900         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3901         do not call ResolveUnreachable() on unreachable statements in
3902         here, see the comment in the source code.
3903
3904 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3905
3906         Fix #74934.
3907         * expression.cs (BinaryResolveOperator): If one of the operands of
3908         an equality comparison is 'null' and the other is a pointer type,
3909         convert the null to a NullPointer.
3910         * convert.cs (ImplicitReferenceConversion): If the expression is a
3911         NullLiteral and the target type is a pointer type, return a
3912         NullPointer instead.
3913         (ImplicitConversionStandard): Likewise.
3914
3915 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3916         
3917         * cs-parser.jay: Set readonly context based on special constructs.
3918         
3919         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3920         readonly variable error handling.
3921         
3922         * rootcontext.cs (EmitCode): Don't verify members when error
3923         occurred.
3924         
3925         * statement.cs (LocalInfo): Add reaodnly context information.
3926         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3927
3928 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3929
3930         * statement.cs (Block.Resolve): Revert change below.  Modify fix
3931         for #74041 to initialize 'resolved' to false only for explicit
3932         blocks.  Fixes #74873.
3933
3934 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3935
3936         Fix #74920.
3937         * typemanager.cs (unmanaged_enclosing_types): New.
3938         (IsUnmanagedType): Avoid infloops by using
3939         'unmanaged_enclosing_types' to talk with recursive invocations.
3940
3941 2005-05-13  Martin Baulig  <martin@ximian.com>
3942
3943         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3944         instance variable, not a local.  Fix #74873.
3945         (Block.ResolveUnreachable): Set it to true here.
3946
3947 2005-05-11  Duncan Mak  <duncan@novell.com>
3948
3949         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3950         continuing to process for 'arg'.
3951         (handle_preprocessing_directive): Check the argument of the #endif
3952         directive and report error CS1025 if there are any trailing
3953         characters.
3954
3955         According to the C# spec, having even whitespace after the #endif
3956         directive is illegal; however, because we call arg.TrimEnd ()
3957         beforehand, we have the same behavior as csc, allowing whitespace
3958         after the directive.
3959
3960         Fixes #74892.
3961
3962 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3963
3964         Fix #74863.
3965         
3966         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3967         (Constructor.GetObsoleteAttribute): Implemented correctly.
3968
3969 2005-05-10  Martin Baulig  <martin@ximian.com>
3970
3971         * support.cs (ReflectionParameters.ParameterModifier): Use
3972         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3973         and `ParameterAttributes.In'.  Fixes #74884.
3974
3975 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3976
3977         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3978         
3979         * expression.cs (Argument.GetParameterModifier): Turned to property.
3980         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3981         
3982         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3983         its C# equivalent.
3984         
3985 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3986
3987         Fix #74852.
3988         * decl.cs (MemberCache.AddMethods): Register override methods,
3989         rather than non-override methods.
3990         * typemanager.cs (RegisterOverride): New.
3991         (IsOverride): Update.
3992
3993 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3994
3995         Fix #73105.
3996         
3997         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3998         recursive declaration.
3999         
4000         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4001         
4002 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4003
4004         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4005         
4006         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4007
4008 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4009
4010         Fix #74797.
4011         * decl.cs (DeclSpace.FamilyAccessible): 
4012         Use TypeManager.IsNestedFamilyAccessible.
4013
4014         Fix reopened #64812.
4015         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4016         internal'.
4017
4018 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4019             Abin Thomas  <projectmonokochi@rediffmail.com>
4020             Anoob V E  <projectmonokochi@rediffmail.com>
4021             Harilal P R  <projectmonokochi@rediffmail.com>
4022
4023         Fix #64812.
4024         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4025         allow access to all static members.
4026
4027 2005-05-04  Martin Baulig  <martin@ximian.com>
4028
4029         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4030
4031 2005-05-04  Martin Baulig  <martin@ximian.com>
4032
4033         Fix #74655.
4034
4035         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4036         section at the end; make things work if `default' is not the last
4037         section.        
4038
4039 2005-05-04  Martin Baulig  <martin@ximian.com>
4040
4041         Fix #70400.
4042
4043         * statement.cs (Switch): Replaced the `got_default' field with a
4044         `default_section' one.
4045         (Switch.CheckSwitch): Set `default_section' here.
4046         (Switch.Resolve): If we're a constant switch and the constant is
4047         not found, use the default section.
4048
4049 2005-05-03  Martin Baulig  <martin@ximian.com>
4050
4051         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4052
4053         * statement.cs (Foreach.ArrayForeach): New nested class.
4054         (Foreach.TemporaryVariable): New nested class.
4055         (Foreach.EmitArrayForeach): Removed; this is now in the new
4056         ArrayForeach class.
4057
4058 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4059
4060         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4061         more conservative.
4062         (VerifyPendingMethods): Revert change below.
4063
4064         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4065         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4066         that used to trigger warning -28.  Remove warning -28.
4067         * expression.cs (Invocation.OverloadResolve): Use
4068         TypeManager.IsOverride to distinguish override methods.
4069
4070         Fix #74773.
4071         * pending.cs (VerifyPendingMethods): If a base type implements the
4072         requested interface, don't bother checking individual methods of
4073         the base type.  As a side-effect, this prevents the creation of
4074         unnecessary proxies.
4075
4076 2005-05-02  Martin Baulig  <martin@ximian.com>
4077
4078         Fix #70182.
4079
4080         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4081         Also `And' the locals if the old vector is null.
4082         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4083         null; in this case we basically reset all the variables.        
4084
4085 2005-05-02  Martin Baulig  <martin@ximian.com>
4086
4087         Fix #74529.
4088
4089         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4090         Added `FlowBranching branching' argument; always `and' the
4091         variables instead of `or'ing them unless we're an infinite loop.
4092
4093         * statement.cs (While.Resolve): Create a new sibling unless we're
4094         infinite.       
4095
4096 2005-05-02  Martin Baulig  <martin@ximian.com>
4097
4098         Fix #70140.
4099
4100         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4101         arguments; use it instead of creating a new TopLevelBlock.
4102         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4103         our ConstructorInitializer.
4104
4105         * statement.cs
4106         (TopLevelBlock.TopLevelBranching): New public property.
4107         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4108         and create our `TopLevelBranching'.
4109
4110         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4111         anonymous method host, use `block.TopLevelBranching' rather than
4112         creating a new branching.
4113
4114 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4115
4116         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4117         a ScopeInfo, if any of the current children is a child of the new
4118         entry, move those children there.
4119
4120 2005-04-30  Martin Baulig  <martin@ximian.com>
4121
4122         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4123         at the beginning of a SwitchSection.  Fix #73335.
4124
4125 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4126
4127         Fix #74378
4128         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4129         
4130         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4131         (FieldExpr.DoResolve): Obsolete members are ignored for field
4132         initializers.
4133         
4134 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4135
4136         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4137         of arrays detection.
4138
4139         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4140         verification.
4141         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4142
4143         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4144         arrays report.
4145
4146 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4147
4148         * cs-parser.jay: Use the prefered version of -unsafe in error
4149         message.
4150
4151 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4152
4153         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4154         circumstances.
4155
4156 2005-04-20  John Luke  <john.luke@gmail.com>
4157
4158         * driver.cs: fix typo in error message, --outout to --output
4159
4160 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4161
4162         * codegen.cs (InRefOutArgumentResolving): New field.
4163         
4164         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4165         fields outside contructor.
4166         
4167         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4168         
4169 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4170
4171         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4172         parameter code was not completed ever, so it was not as up-to-date
4173         as local variables.  Must finish it.
4174
4175         The bug fix was to compare the Toplevel of the block, not the
4176         current block.  Thanks for Ben for pointing this out. 
4177
4178 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4179
4180         * decl.cs (AddMethods): Use the declaring type of the problem
4181         method to determine if we want to squash a warning.
4182
4183 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4184
4185         * attribute.cs: Removed debug output.
4186
4187         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4188         
4189         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4190         Report.Stderr.
4191         
4192 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4193
4194         Fix #74481.
4195         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4196         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4197         all null comparisons against reference types.
4198
4199 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4200
4201         Fix# 74565
4202         * class.cs (TypeContainer.CircularDepException) New nested
4203         exception class.
4204         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4205         (TypeContainer.DefineType): Removed error, reset InTransit before
4206         exit.
4207         (Class.DefineType): Throw exception when is in Transit.
4208         Catch exception and report error.
4209         (Struct.DefineType): Throw exception when is in Transit.
4210         Catch exception and report error.
4211         (Interface.DefineType): Throw exception when is in Transit.
4212         Catch exception and report error.
4213
4214         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4215         handle nested exception handlers.
4216
4217         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4218         a catch.
4219
4220         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4221         InFinally and InCatch storage.
4222
4223         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4224         (Catch.Resolve): Set and Restore ec.InCatch.
4225         (Try.Resolve): Set and Restore ec.InFinally.
4226         (Try.HasCatch): True when try has catch.
4227
4228 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4229
4230         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4231           for the same event member, so exclude such cases from warning 419.
4232           Fixed bug #74633.
4233
4234 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4235
4236         * expression.cs (Binary.ResolveOperator): Apply patch from John
4237         Luke to fix bug 59864: operators &, | and ^ on enumerations
4238         require that the same enum type on both sides.
4239
4240         * driver.cs: Add warnings to old flag usage, this is to assist
4241         people who produce Makefiles and hope that the Makefiles will be
4242         used on Windows.
4243
4244         * class.cs (TypeContainer.EmitType): Moved the definition of the
4245         special $PRIVATE$ field from the resolve phase to the Emit phase.
4246         During resolve we do not know if we are a struct with
4247         HasExplicitLayout, we know this only after the attributes for the
4248         type are emitted.
4249
4250         Set the FieldOffset to zero on the dummy field that we create for
4251         the class.   Fixes 74590.
4252
4253 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4254
4255         Fix #73834.
4256         * ecore.cs (PropertyExpr.resolved): New.
4257         (DoResolve): Use it to handle a case of double resolution here.
4258         Handle a case of identical-name-and-type-name.
4259         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4260         resolution by storing the results of expression resolution back
4261         into the "probes" array.
4262
4263 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4264
4265         Fix cs0208-7.cs and cs0208-8.cs.
4266         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4267         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4268         error reporting to point out the reason a struct is not unmanaged.
4269
4270 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4271
4272         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4273           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4274
4275 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4276
4277         Fix #74528.
4278         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4279         IdenticalNameAndTypeName here.
4280         (EventExpr.InstanceResolve): Likewise.
4281
4282 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4283
4284         C# 2.0 DefaultCharSetAttribute implementation
4285         
4286         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4287         which allows us to set GlobalNamespace for every resolve.
4288         (Attribute.ResolveArguments): Cut from Resolve.
4289         (Attribute.GetCharSetValue): Returns CharSet named argument.
4290         (Attribute.DefinePInvokeMethod): Gets default charset from
4291         module settings.
4292         (GlobalAttribute.ResolveAsTypeStep): Override.
4293         (GlobalAttribute.ResolveArguments): Override.
4294         
4295         * class.cs (TypeAttr): Is protected.
4296         
4297         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4298         (ModuleClass.DefaultCharSetType): New memeber.
4299         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4300         
4301         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4302         charset from module.
4303         
4304         * delegate.cs (TypeAttr): Override.
4305         (Delegate.DefineType): Use this TypeAttr.
4306         
4307         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4308         at very early stage (before types are defined) to resolve model
4309         module attributes. It will probably not work with corlib but it
4310         should be ok.
4311         
4312         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4313         charset from module.
4314         
4315         * typemanager.cs (default_charset_type): New type.
4316
4317 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4318
4319         * decl.cs (MemberCache.AddMethods): Don't warn if
4320         System.Object.Finalize has buggy MethodAttributes.
4321
4322         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4323         removed below.
4324
4325 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4326
4327         * doc.cs : detect ambiguous reference to overloaded members.
4328           Fixed bug #71603. MS 1.1 csc does not detect it.
4329
4330 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4331
4332         * doc.cs : delegates must not be referenced with parameters.
4333           Fixed bug #71605.
4334
4335 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4336
4337         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4338
4339 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4340
4341         * driver.cs (MainDriver): Stop processing if the CLS stage found
4342         errors. 
4343
4344         (CompilerCallableEntryPoint.InvokeCompiler): Always
4345         reset after execution;   Take a TextWriter argument for the
4346         output.
4347
4348         * report.cs: Use the error stream instead of hardcoding stderr. 
4349
4350 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4351
4352         * class.cs: Reduce code paths to test, too small of an
4353         optimization to make it worth the extra testing.  Always perform
4354         it. 
4355
4356 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4357
4358         Fix #74510.
4359         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4360         operators that had errors reported on them.
4361
4362 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4363
4364         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4365         argument types.
4366         (Attribute.Resolve): Add named argument type checking.
4367         
4368         * class.cs (FixedField.Define): Use IsPrimitiveType
4369         
4370         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4371         
4372         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4373         unsafe parameter types.
4374         
4375         * statement.cs (Using.ResolveExpression): Add better error description.
4376         
4377         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4378         
4379 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4380
4381         Fix #74484.
4382         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4383         AttributeUsageAttribute in the emitcontext of the attribute class,
4384         not in the emitcontext of the attributable entity it was attached to.
4385         * cs-parser.jay: Use 'current_class', not 'current_container',
4386         when creating a GlobalAttribute.
4387
4388 2005-04-08  Alp Toker  <alp@atoker.com>
4389
4390         * pending.cs: The fix to #58413 failed to compile methods implementing
4391         interfaces with/without params modifiers and vice versa, even though
4392         params modifiers aren't part of the signature. Make the modifier check
4393         less strict as in csc.
4394
4395 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4396             Anoob V E  <projectmonokochi@rediffmail.com>
4397             Harilal P R  <projectmonokochi@rediffmail.com>
4398
4399         Fix #58413.
4400         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4401         modifiers of pending methods.
4402         (PendingImplementation.PendingImplementation): Initialize it.
4403         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4404         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4405         with ParameterData.  Add check for modifiers.
4406         * class.cs (MethodData.Define): Update to changes.
4407
4408 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4409
4410         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4411
4412 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4413
4414         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4415         property.
4416         
4417         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4418         
4419         * rootcontext.cs,
4420         * typemanager.cs: Registered RequiredAttributeAttribute.
4421         
4422 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4423
4424         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4425         Warning CS0169 is back at level 3.
4426         (IMethodData.SetMemberIsUsed): New method.
4427         
4428         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4429         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4430         
4431         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4432
4433         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4434         contants.
4435         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4436         is used.
4437         
4438         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4439         is used.
4440         
4441         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4442         to avoid the problems with nested types.
4443
4444 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4445             Anoob V.E  <projectmonokochi@rediffmail.com>
4446             Harilal P.R  <projectmonokochi@rediffmail.com>
4447             Raja R Harinath  <rharinath@novell.com>
4448
4449         Fix #73820.
4450         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4451         attribute.
4452         * typemanager (GetConstructor): Make public.
4453
4454 2005-04-05  John Luke  <john.luke@gmail.com>
4455             Raja R Harinath  <rharinath@novell.com>
4456
4457         Fix #62232.
4458         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4459         struct too.  Return false quicker in a few cases.
4460         (VerifyUnManaged): Use it.
4461
4462 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4463
4464         Fix #74041.
4465         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4466         not 'unreachable_seen'.
4467
4468 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4469
4470         * attribute.cs (Attribute.GetValue): Removed unused.
4471         
4472         * codegen.cs (CodeGen.TrimExt): Removed unused.
4473         
4474         * cs-parser.jay (output): Removed unused.
4475         
4476         * cs-tokenizer.cs (hex_digits): Removed unused.
4477         
4478         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4479         
4480         * expression.cs (Indirection.LoadExprValue): Removed unused.
4481         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4482         
4483         * iterators.cs (Iterator.param_types): Removed unused.
4484         
4485         * statement.cs (Goto.block): Removed unused.
4486         (ToplevelBlock.did): Removed unused.
4487         (Switch.ResolveConstantSwitch): Removed unused.
4488
4489 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4490
4491         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4492         resetting thingy.
4493
4494 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4495
4496         Fix #74232 and cs0208-3.cs.
4497         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4498         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4499         unmanaged type.  Don't use FieldBuilders when 't' is a
4500         TypeBuilder.  Use ModFlags and MemberType fields.
4501         * class.cs (MemberBase.member_type): Rename from MemberType.
4502         (MemberBase.MemberType): New property.  Determines member_type on
4503         demand.
4504         (MemberBase.DoDefine): Don't initialize MemberType here.
4505         (FieldMember.Define): Likewise.
4506
4507 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4508
4509         Fix #74241
4510         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4511         Attributes are emitted there.
4512         
4513 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4514
4515         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4516         keyword in 'partial enum' too.
4517         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4518         is not allowed).
4519         Report from Kamil Skalski <nazgul@omega.pl>.
4520
4521         Fix #74309.
4522         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4523         have partial containers too.
4524
4525         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4526         in block' checks to Block.CheckInvariantMeaningInBlock.
4527         * statement.cs (Block.GetKnownVariableInfo): Make private.
4528         (Block.IsVariableUsedInChildBlock): Remove.
4529         (Block.IsVariableUsedInBlock): Likewise.
4530         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4531         conflicting declaration.
4532         (Block.AddVariable): Make error messages less long-winded and more
4533         specific.  Show location of conflicting declaration.
4534         * parameter.cs (Parameters.Location): New readonly property.
4535
4536 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4537
4538         Clean up semantics of invoking ResolveMemberAccess.
4539         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4540         can have an instance, ensure that we pass in a non-TypeExpression
4541         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4542         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4543         argument.  Update to changes and simplify.
4544         (FieldExpr.Emitinstance): Remove CS0120 check.
4545         (PropertyExpr.EmitInstance): Likewise.
4546         * expression.cs (Argument.Resolve): Likewise.
4547         (Invocation.DoResolve): Update to changes in semantics of
4548         InstanceExpression.
4549
4550 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4551
4552         Fix #74241
4553         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4554         customization.
4555         
4556         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4557
4558 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4559
4560         Fix difference in behaviour with commandline invocation.
4561         * driver.cs (Driver.Reset): New.
4562         (CompilerCallableEntryPoint): Call it.
4563
4564         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4565         variable" warnings if the boolean expression failed to resolve.
4566
4567 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4568
4569         * attribute.cs: Fix the union of several permissions when some of them
4570         are unrestricted (so the result isn't an unrestricted permission set).
4571         Fix #74036.
4572
4573 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4574
4575         * ecore.cs (MemberExpr): New class.  Convert from interface
4576         IMemberExpr.
4577         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4578         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4579         error checks.
4580         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4581         (MethodGroupExpr.IsExplicitImpl): Remove.
4582         (Expression.GetFieldFromEvent): Remove.
4583         (SimpleName.MemberStaticCheck): Remove.
4584         (SimpleName.DoSimpleNameResolve): Update to changes.
4585         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4586         (MemberAccess.IdenticalNameAndTypeName): Remove.
4587         (MemberAccess.error176): Move to MemberExpr.
4588         (MemberAccess.DoResolve): Update to changes.
4589         (BaseAccess.DoResolve): Likewise.
4590
4591 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4592
4593         C# 2.0 Conditional attribute class implementation
4594         
4595         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4596         Analyzes class whether it has attribute which has ConditionalAttribute
4597         and its condition is not defined.
4598         
4599         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4600         (Class.IsExcluded): New method. Search for at least one defined
4601         condition in ConditionalAttribute of attribute class.
4602
4603 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4604
4605         * ecore.cs (PropertyExpr): Derive from Expression, not
4606         ExpressionStatement.
4607         (PropertyExpr.EmitStatement): Remove.
4608
4609 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4610
4611         Fix #74060.
4612         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4613         internal field "value__" of an enum be private.  The examples for
4614         "value__" that I found on MSDN all used FieldAttributes.Private.
4615
4616         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4617         Don't mention IL method attribute names.
4618
4619         Fix #47991.  Remove a TODO.
4620         * statement.cs (Block.Toplevel): Make into a field.
4621         (Block.Parameters): Move into ToplevelBlock.
4622         (Block.known_variables): Rename from child_variable_names.
4623         (Block.Block): Remove variants that take Parameters.  Initialize
4624         'Toplevel' with the immediately surrounding toplevel block.
4625         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4626         LocalInfo parameter.
4627         (Block.GetKnownVariableInfo): New.
4628         (Block.IsVariableNameUsedInChildBlock): Update.
4629         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4630         the block, even though it may not be in scope.
4631         (Block.AddVariable): Remove Parameters parameter.  Use
4632         Toplevel.Parameters instead.
4633         (Block.AddConstant): Remove Parameters parameter.
4634         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4635         (Block.IsParamaterReference): Likewise.
4636         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4637         (ToplevelBlock.Parameters): New.  Moved from Block.
4638         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4639         initialize Parameters to a non-null value.
4640         * cs-parser.jay: Update to changes.
4641         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4642         simple names that mean different things in the same block.  Use
4643         Block.IsVariableNameUsedInBlock.
4644
4645 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4646
4647         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4648         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4649         GetTypeHandle.  It is possible for a reflected type to derive from
4650         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4651         System.Array during mscorlib compilation).
4652         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4653         contain a method_hash, don't create one either.  Don't create a
4654         deep copy of the base cache's method_hash.
4655         (MemberCache.SetupCache): Rename back from DeepCopy.
4656         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4657         already initialized.  If we see an override function, add its
4658         underlying base virtual function to the member_hash too.
4659
4660         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4661
4662 2005-03-26  Raja R Harinath  <harinath@acm.org>
4663
4664         Fix #73038.
4665         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4666         fails to resolve, ensure that the LHS is still resolved as an
4667         lvalue.
4668
4669 2005-03-25  Raja R Harinath  <harinath@acm.org>
4670
4671         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4672         ec.ContainerType.
4673         (Enum.current_ec): Remove.
4674         (Enum.LookupEnumValue): Remove EmitContext argument.
4675         Just uses the one created during DefineType.
4676         (Enum.FindMembers): Update.
4677         * expression.cs (MemberAccess.DoResolve): Update.
4678
4679 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4680
4681         * assign.cs (Assign.DoResolve): Check for CS1717 when
4682         source and target are same (uses Equals).
4683
4684         * expression.cs (LocalVariableReference, ParameterReference,
4685         This): Implemented Equals, GetHashCode.
4686
4687         * statement.cs (Block.GetParameterReference): Removed useless
4688         local variable.
4689
4690 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4691
4692         Fix cs0128.cs
4693         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4694         blocks before deciding whether the error is cs0136 or cs0128.
4695
4696         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4697         (using_alias_directive, using_namespace_directive): Pass
4698         MemberName, not an expression to Namespace.UsingAlias and
4699         Namespace.Using.
4700         (MakeName): Use the MemberName of the namespace.
4701         * namespace.cs (Namespace.MemberName): New.
4702         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4703         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4704         Likewise.
4705         * decl.cs (MemberName.Name): Make readonly.
4706         (MemberName.FromDotted): New "constructor".
4707         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4708         (MemberCore.Name): Compute from MemberName on demand.
4709         (MemberCore.SetMemberName): Provide a way to change the
4710         MemberName.
4711         (MemberCore.AddToContainer): Don't take a fullname parameter.
4712         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4713         fully qualified name of the container to the member name.
4714         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4715         only if the type is a member of the root container.
4716         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4717         MemberName.Left rather than searching for an embedded ".".
4718         (PartialContainer.CreatePart): Update to changes in RootContext.
4719         (MemberBase.ShortName): Turn into a property.  Use
4720         MemberCore.SetMemberName.
4721         (MemberBase.ExplicitInterfaceName): Remove.
4722         (MemberBase.UpdateMemberName): Remove.
4723         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4724         (PropertyBase.SetMemberName): New override.
4725         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4726         (Tree.GetDecl): New.
4727         (Tree.AllDecls): Rename from Decls.
4728         * attribute.cs, enum.cs, report.cs: Update to changes.
4729         * driver.cs (MainDriver): Use MemberName.FromDotted on
4730         RootContext.MainClass.
4731
4732 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4733
4734         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4735         checks.
4736
4737         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4738
4739 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4740
4741         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4742         property accessor modifiers.
4743
4744         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4745         fixed buffer attribute (CS1716).
4746         (PropertyMethod.HasCustomAccessModifier): When property accessor
4747         has custom modifier.
4748
4749         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4750         modifiers.
4751         (PropertyExpr.DoResolveLValue): Add CS0272.
4752
4753 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4754
4755         * convert.cs: When converting to a pointer, use the proper Conv.U
4756         or Conv.I depending on the source data type.
4757
4758         * cs-tokenizer.cs: Make the size for large decimal constants,
4759         fixes #72957.
4760
4761 2005-03-17  Martin Baulig  <martin@ximian.com>
4762
4763         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4764         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4765
4766 2005-03-17  Martin Baulig  <martin@ximian.com>
4767
4768         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4769         to bool so we can return an error condition.
4770         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4771         returned an error.
4772
4773 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4774
4775         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4776         attributes.
4777
4778 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4779
4780         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4781         Refactor to avoid traversing the list of assemblies, and to avoid
4782         string concatenation.
4783         * typemanager.cs (guid_attr_type): Remove.
4784         (negative_hits, pointers, references): Remove hashes.
4785         (type_hash): New.
4786         (GetConstructedType): New.  Uses type_hash to handle constructed
4787         types (arrays, references, pointers).
4788         (GetReferenceType, GetPointerType): Use it.
4789         (GetNestedType): New.  Uses type_hash to handle nested types of
4790         reflected types.
4791         (LookupType, LookupTypeDirect): Remove.
4792         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4793         'types' hash and LookupTypeReflection directly.
4794         (params_string, params_object): Use GetConstructedType.
4795         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4796         top-level types.
4797         (Namespace.Lookup): Use cached_types.
4798         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4799         provided by old TypeManager.LookupType.
4800         * rootcontext.cs (MakeFQN): Remove.
4801         * decl.cs (DeclSpace.MakeFQN): Likewise.
4802         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4803         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4804         TypeManager.GetConstructedType.
4805         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4806
4807 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4808
4809         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4810         indexers.
4811
4812         * cs-parser.jay: Reports CS1527 for any namespace element.
4813
4814         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4815         Added CS0407.
4816
4817         * expression.cs (ParameterReference.IsAssigned): Changed error to
4818         CS0269.
4819         (Error_WrongNumArguments): Moved CS0245 detection here.
4820
4821         * statement.cs (Return.Resolve): Add CS1622 report.
4822
4823 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4824
4825         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4826
4827 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4828
4829         * attribute.cs expression.cs: Get rid of some allocations.
4830
4831 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4832
4833         * doc.cs : just eliminate the latest change.
4834
4835 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4836
4837         * doc.cs : commented out the latest change. It breaks xml-030.cs
4838
4839 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4840
4841         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4842           fail. So invoke CreateType() in FindDocumentedType().
4843
4844 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4845
4846         * cs-tokenizer.cs : added IsKeyword().
4847         * doc.cs : Detect keyword incorrectly used as identifier.
4848           Allow identifiers prefixed by @.
4849
4850 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4851
4852         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4853         It caused exception in namespace resolving (again!).
4854         
4855         * class.cs (Class.ctor): Removed exit.
4856         (PropertyMethod.ctor): ditto.
4857         
4858         * codegen.cs (Codegen.Reset): Reset static data.
4859         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4860         
4861         * cs-tokenizer.cs (Cleanup): Removed.
4862         
4863         * driver.cs (GetSystemDir): Rewrote to one line command.
4864         It caused problem with unloaded dynamic modules.
4865         (UnixParseOption): Removed Exit.
4866         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4867         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4868         Now can be mcs used as library.
4869         
4870         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4871         empty location.
4872         
4873         * location.cs (Reset): Reset static data.
4874         
4875         * namespace.cs (Reset): Reset static data.
4876         
4877         * report.cs (Report.Reset): Reset static data.
4878         
4879         * rootcontext.cs (RootContext.Reset): Reset static data.
4880         
4881         * tree.cs (RootTypes.ctor): Use Location.Null
4882         
4883         * typemanager.cs (TypeManager.Reset): Reset static data.
4884         (CoreLookupType): Removed Exit.
4885         (TypeHandle.Reset): Reset static data.
4886         
4887 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4888
4889         Fix #73516.
4890         * typemanager.cs (ComputeNamespaces): Import namespaces from
4891         referenced modules too.
4892
4893 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4894
4895         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4896         than '.'.
4897
4898 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4899
4900         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4901         enclosing DeclSpace.  This ensures that a name-lookup populates
4902         more caches and there are fewer 'TypeExpression's.  Carve out
4903         nested type lookup into ...
4904         (LookupNestedTypeInHierarchy): ... this.
4905
4906 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4907
4908         Clean up a few partial-class semantics.  
4909         Fixes test-357.cs and cs1618-2.cs.
4910         * cs-parser.jay (struct_declaration): Use 'current_class' as
4911         parent of newly-created struct.  Remove call to Register ().
4912         Use 'pop_current_class' to complete handing the current struct.
4913         (interface_declaration): Likewise.
4914         (class_declaration): Likewise.
4915         (enum_declaration): Use 'current_class' as parent of newly created
4916         enum.
4917         (delegate_declaration): Likewise.
4918         (pop_current_class): New function.  This is used to handle closing
4919         up the 'current_class' and 'current_container', and pointing them
4920         to the enclosing class/container.
4921         (CSharpParser): Initialize 'current_class' too.
4922         * decl.cs (MemberCore): Add check for invariant: a partial
4923         container is not a parsed entity, and thus does not enclose any
4924         parsed members.
4925         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4926         (DeclSpace.BaseTypeExpr): Use it.
4927         (DeclSpace.LookupType): Add check for invariant.
4928         * class.cs (TypeContainer): Add check for invariant: a nested
4929         class should have the same NamespaceEntry as its enclosing class.
4930         (TypeContainer.EmitFieldInitializers): Make virtual.
4931         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4932         MemberCore.
4933         (TypeContainer.Register): Remove.
4934         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4935         null.  Use TypeResolveEmitContext for resolving base types and
4936         interfaces.  Move initialization of Parts.TypeBuilder here from
4937         ...
4938         (TypeContainer.DefineNestedTypes): ... here.
4939         (PartialContainer): Take a Namespace not a NamespaceEntry.
4940         (PartialContainer.Create): Don't use Register.  Call the
4941         appropriate Add... function directly.
4942         (ClassPart): Take both the PartialContainer and the enclosing
4943         class as constructor arguments.
4944         (ClassPart.EmitFieldInitializers): Override.
4945         (ClassPart.PartFindNestedTypes): Remove.
4946         (FieldBase.GetInitializerExpression): Resolve the initializer
4947         expression in the emit context of the enclosing class.
4948         * tree.cs (RootTypes): Remove Register ().
4949         
4950 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4951
4952         * cs-parser.jay: Removed CS0134.
4953         
4954         * driver.cs: Removed CS1901.
4955         
4956         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4957         for predefined types.
4958
4959 2005-03-07  Duncan Mak  <duncan@novell.com>
4960
4961         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4962         well. Fixes bug #73454.
4963
4964 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4965
4966         * cs-tokenizer.cs (xtoken): Add CS1035.
4967         
4968         * class.cs (MethodData.Define): Add CS0683.
4969         (FieldMember.ctor): Add CS0681.
4970
4971 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4972
4973         * ecore.cs (SimpleName.DoResolve): Rename from
4974         SimpleName.DoResolveAllowStatic.
4975         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4976         Pass 'intermediate' flag to MemberStaticCheck.
4977         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4978         of "intermediate" lookups via MemberAccess.
4979         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4980         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4981
4982 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4983
4984         Fix #73394.
4985         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4986         slipped in because of variable names that are identical to a
4987         builtin type's BCL equivalent ('string String;', 'int Int32;').
4988         (PropertyExpr.EmitInstance): Likewise.
4989
4990 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4991
4992         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4993         
4994         * report.cs (warning_ignore_table): Made public.
4995
4996 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4997
4998         Fix #73282.
4999         * class.cs (MethodData.Emit): Pass 'container' to
5000         container.GetObsoleteAttribute instead of 'container.Parent'.
5001
5002 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5003
5004         * cs-parser.jay: Add 1534 error test.
5005
5006         * iterators.cs (Yield.CheckContext): Add error 1629.
5007         (Iterator.ctor): Save unsafe modifier.
5008         (MoveNextMethod.DoEmit): Restore unsafe context.
5009
5010         * namespace.cs (UsingAlias): Better error message.
5011
5012 2005-03-03  Dan Winship  <danw@novell.com>
5013
5014         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5015         the warning message [#73219]
5016
5017 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5018
5019         Fix compile with MCS 1.0.0.0.
5020         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5021         w_restore to not depend on string constant folding.
5022
5023 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5024
5025         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5026         CS0246 check to users who passed 'silent = false'.
5027         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5028         check.
5029         (SimpleName.SimpleNameResolve): Update.
5030         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5031         (MemberAccess.IdenticalNameAndTypeName): Update.
5032         * doc.cs (FindDocumentedTypeNonArray): Update.
5033
5034 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5035
5036         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5037         * parameters.cs (ComputeAndDefineParameters): Remove.
5038         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5039         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5040         Use GetParameterInfo.
5041
5042 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5043
5044         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5045
5046 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5047
5048         Unify DeclSpace.LookupType and DeclSpace.FindType.
5049         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5050         is in charge of defining nested types on demand.
5051         (DeclSpace.LookupType): Use it when the current_type is a
5052         TypeBuilder.  Use LookupTypeDirect for reflected types.
5053         (DeclSpace.FindType): Remove.
5054         (DeclSpace.LookupInterfaceOrClass): Likewise.
5055         (DeclSpace.DefineTypeAndParents): Likewise.
5056         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5057         DeclSpace.LookupType.
5058         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5059         * typemanager.cs (LookupType): Simplify.
5060         (AddUserType): Remove type from negative_hits.
5061         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5062         * class.cs (TypeContainer.FindMembers): Move handling of nested
5063         types ...
5064         (TypeContainer.FindMembers_NestedTypes): ... here.
5065         (TypeContainer.FindNestedType): Implement override.
5066         (ClassPart.FindNestedType): Delegate to PartialContainer.
5067         (ClassPart.PartFindNestedType): Looks up the nested types of the
5068         part alone.
5069
5070 2005-03-02  Martin Baulig  <martin@ximian.com>
5071
5072         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5073         static constructor in static classes.
5074
5075 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5076
5077         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5078         sizeParamIndex is not specified.
5079
5080 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5081
5082         Fix #73117
5083         * report.cs (WarningMessage.IsEnabled): Missing null check.
5084
5085 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5086
5087         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5088         in the fields and not in the properties.
5089
5090 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5091
5092         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5093         fields as well.
5094
5095 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5096
5097         * attribute.cs: Small refactoring (improved robustness).
5098         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5099         (ValidateGuid): Removed.
5100         (Resolve): Removed referenced to above mentioned.
5101         (GetAttributeUsage): Made private and changed to work without
5102         class assistance.
5103         (GetIndexerAttributeValue): Don't crash.
5104         (GetConditionalAttributeValue): Ditto.
5105         (GetClsCompliantAttributeValue): Ditto.
5106         (ExtractSecurityPermissionSet): All attributes exceptions are
5107         error 648.
5108         (GetPropertyValue): New helper.
5109         (GetMethodImplOptions): New method.
5110         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5111         some missing properties.
5112         
5113         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5114         (Method.ApplyAttributeBuilder): Updated.
5115         
5116         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5117         exception.
5118
5119 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5120
5121         Fix #73052.
5122         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5123         non-simple types (array, pointer, reference).
5124
5125 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5126
5127         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5128
5129         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5130         for operators.
5131         (Method.CheckBase): Catch wrong destructor here.
5132         (MethodData.Define): Add errors 550, 668.
5133
5134         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5135
5136         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5137
5138         * pending.cs (VerifyPendingMethods): Add error 551.
5139
5140         * typemanager.cs (CSharpName): Next error report helper.
5141
5142 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5143
5144         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5145         attributes. Removed useless attribute double check.
5146         It saves almost 2MBs for corlib.
5147
5148 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5149
5150         Fix #72924.
5151         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5152         called twice in case of error.
5153
5154 2005-02-23  Chris Toshok  <toshok@ximian.com>
5155
5156         Fix compiler portions of #72827.
5157         * statement.cs (Block.Emit): call Begin/EndScope on the
5158         EmitContext instead of the ILGenerator.
5159
5160         * codegen.cs (EmitContext.BeginScope): new method, call
5161         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5162         we have one.)
5163         (EmitContext.BeginScope): same, but EndScope and CloseScope
5164
5165         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5166         offset and call the superclass's OpenScope(int) with it.
5167         (SymbolWriter.CloseScope): get the current il
5168         offset and call superclass's CloseScope(int) with it.
5169
5170 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5171
5172         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5173         CS1677 for out and ref as well.
5174
5175         * class.cs (Method.Define): Add error CS1599 detection.
5176         
5177         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5178         
5179         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5180         
5181         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5182         
5183         * support.cs.cs (ModifierDesc): New helper method.
5184
5185 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5186             Abin Thomas  <projectmonokochi@rediffmail.com>
5187             Anoob V E  <projectmonokochi@rediffmail.com>
5188             Harilal P R  <projectmonokochi@rediffmail.com>
5189
5190         Fix #57851, #72718.
5191         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5192         MemberLookup (used for error reporting) actually returns a result.
5193         Fix error report number (122, not 112).
5194
5195 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5196             Anoob V E  <projectmonokochi@rediffmail.com>
5197             Harilal P R  <projectmonokochi@rediffmail.com>
5198
5199         Fix #71134.
5200         * pending.cs (PendingImplementation.GetAbstractMethods):
5201         Find NonPublic members too.
5202
5203 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5204
5205         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5206         Fixed error 217.
5207         
5208         * class.cs (MethodCore.CheckMethodAgainstBase):
5209         Add error 239 report.
5210
5211 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5212
5213         Fix #68955.
5214         * expression.cs (Invocation.IsApplicable): Make public.
5215         (Invocation.IsParamsMethodApplicable): Likewise.
5216         * delegate.cs (Delegate.VerifyApplicability): Don't use
5217         Invocation.VerifyArgumentCompat for parameter applicability
5218         testing.  Use Invocation.IsApplicable and
5219         Invocation.IsParamsMethodApplicable.
5220
5221 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5222
5223         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5224         
5225         * class.cs (Operator.Define): Add error 217 report.
5226         
5227 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5228
5229         * namespace.cs (UsingEntry.Resolve): Undo change below.
5230
5231 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5232
5233         Fix #72756.
5234         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5235         disable the error message when the extended MemberLookup also
5236         fails.
5237         (Expression.MemberLookupFinal): Update.
5238         (SimpleName.DoSimpleNameResolve): Update.
5239         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5240         Don't use MemberLookupFinal.
5241         (New.DoResolve): Update.
5242         (BaseAccess.CommonResolve): Update.
5243
5244 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5245
5246         Fix #72732.
5247         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5248         occured previously, don't resolve again.
5249
5250 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5251
5252         Fix #69949
5253         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5254         argument. Call ResolveAttributeUsage for unresolved.
5255         when types doesn't match ctor arguments.
5256         
5257         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5258         for nested attribute classes.
5259         (Class.attribute_usage): Removed.
5260         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5261         for attribute class.
5262         
5263         * ecore.cs (IsAttribute): Removed.
5264         
5265         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5266         
5267         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5268         now normal types.
5269         (attribute_types): Removed.
5270         (EmitCode): Global attributes are emited as the latest.
5271
5272 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5273
5274         * class.cs (EmitFieldInitializers): Don't emit field initializer
5275         for default values when optimilization is on.
5276         
5277         * constant.cs (Constant.IsDefaultValue): New property.
5278         
5279         * driver.cs: Add /optimize handling.
5280         
5281         * constant.cs,
5282         * ecore.cs,
5283         * literal.cs: Implement new IsDefaultValue property.
5284         
5285         * rootcontext.cs (Optimize): New field, holds /optimize option.
5286
5287 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5288
5289         Fix crasher in re-opened #72347.
5290         * namespace.cs (Namespace.Lookup): Return null if
5291         DeclSpace.DefineType returns null.
5292
5293         Fix #72678.
5294         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5295
5296 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5297
5298         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5299         now returns null if it cannot resolve to an lvalue.
5300         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5301         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5302         returned null.  Remove check for SimpleName.
5303         (EventExpr.DoResolveLValue): New.
5304         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5305         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5306         error from ...
5307         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5308         avoid CS0131 error.
5309         (Unary.ResolveOperator): Move CS0211 check ...
5310         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5311         CS0131 error.
5312         (Unary.DoResolveLValue): Simplify.
5313         (AddressOf.DoResolveLValue): New.
5314         (ArrayAccess.DoResolveLValue): New.
5315
5316 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5317
5318         * attribute.cs (Attribute.Resolve): Add arguments casting for
5319         when types doesn't match ctor arguments.
5320
5321 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5322
5323         Fix parts of #63202.
5324         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5325         lookup of operator in base type.  Ensure that all checks happen
5326         when the operator resolves to an "op_..." method.
5327
5328 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5329
5330         Fix #71992.
5331         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5332         'ignore_cs0104' parameter.  Pass it to ...
5333         (NamespaceEntry.Lookup): ... this.
5334         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5335         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5336         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5337         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5338         Update.  Request that cs0104 errors be ignored.
5339         (ComposedCast.ResolveAsTypeStep): Update.
5340
5341 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5342
5343         Fix #59209.
5344         * expression.cs (Invocation.BetterFunction): Remove support for
5345         comparing virtual functions and their overrides.
5346         (Invocation.IsOverride): New.
5347         (Invocation.OverloadResolve): Don't consider 'override' functions
5348         during candidate selection.  Store them in a lookaside list.
5349         If the selected method is a 'virtual' function, use the list to
5350         find any overrides that are closer to the LHS type.
5351
5352 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5353
5354         * expression.cs (New.DoResolve): Add complex core type reduction.
5355         (New.Constantify): Converts complex core type syntax like 'new int ()'
5356         to simple constant.
5357         
5358 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5359
5360         * decl.cs (EntryType.EntryType): New constructor to create an
5361         updated copy of a cache entry.
5362         (MemberCache.AddMethods): Use it.
5363         (MemberCache.ClearDeclaredOnly): Remove.
5364         (MemberCache.MemberCache): Update.
5365
5366 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5367
5368         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5369         variable.  This one is represents the actual low-level declaration
5370         of the method, as opposed to the semantic level `IsStatic'.   
5371
5372         An anonymous method which is hosted into a static method might be
5373         actually an instance method.  IsStatic would reflect the
5374         container, while MethodIsStatic represents the actual code
5375         generated.
5376
5377         * expression.cs (ParameterReference): Use the new MethodIsStatic
5378         instead of IsStatic.
5379
5380         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5381         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5382         set on the current EmitContext. 
5383
5384         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5385         resolve our casted expression as an LValue.  This triggers the
5386         proper LValue processing that is later required by Assign.
5387
5388         This fixes 72347.
5389
5390         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5391
5392 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5393
5394         C# 2.0 Fixed buffer implementation
5395
5396         * anonymous.cs: Update after RegisterHelperClass renaming.
5397
5398         * attribute.cs (AttributeTester.fixed_buffer_cache):
5399         Cache of external fixed buffers.
5400         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5401         implementation if field is fixed buffer else null.
5402
5403         * class.cs
5404         (TypeContainer.AddField): Accept FieldMember instead of Field.
5405         (FieldBase.IsFieldClsCompliant): Extracted code from
5406         VerifyClsCompliance descendant customization.
5407         (FixedField): New class handles fixed buffer fields.
5408         (FixedFieldExternal): Keeps information about imported fixed
5409         buffer.
5410         (IFixedField): Make access to internal or external fixed buffer
5411         same.
5412
5413         * cs-parser.jay: Add fixed buffer parsing.
5414
5415         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5416         buffer.
5417
5418         * expression.cs (Indirection): Extended implementation to accept
5419         fixed buffer field.
5420         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5421         (ElementAccess.MakePointerAccess): Get type as parameter.
5422         (DoResolve): Add fixed buffer field expression conversion.
5423         (DoResolveLValue): Ditto.
5424         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5425         (ArrayPtr): Derives from FixedBufferPtr.
5426         (ArrayPtr.Emit): Add extra emit for array elements.
5427
5428         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5429
5430         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5431         for compiler generated types.
5432         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5433
5434         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5435         and consume less memory.
5436         (Fixed.Resolve): Add fixed buffer case.
5437
5438         * typemanager.cs (compiler_generated_attr_ctor,
5439         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5440         (HasElementType): Add our own implementation to work on every
5441         runtime.
5442
5443 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5444
5445         * anonymous.cs (CaptureContext): Track whether `this' has been
5446         referenced.   
5447
5448         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5449         only captured `this' if it was implicitly done (instance
5450         methods/variables were used). 
5451
5452         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5453         `this' must be captured.
5454
5455 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5456  
5457         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5458         is null it means that there has been no need to capture anything,
5459         so we just create a sibling.
5460
5461         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5462
5463         Just a partial fix.  The other half is fairly elusive.
5464         
5465 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5466
5467         Fix #52586, cs0121-4.cs.
5468         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5469         and return a hashtable.
5470         (MemberCache.ClearDeclaredOnly): New.
5471         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5472         the method_hash of a base type too.
5473         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5474         type methods.  Overwrite entries with the same MethodHandle so
5475         that the ReflectedType is correct.  The process leaves in base
5476         virtual functions and their overrides as distinct entries.
5477         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5478         matters since it was boxed in a ArrayList before.
5479         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5480         modifier.
5481         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5482         case of a virtual function and its override (choose the overload
5483         as better).
5484         (Invocation.OverloadResolve): Avoid 'override' members during
5485         'applicable_type' calculation.
5486
5487 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5488
5489         Combine two near-redundant caches.
5490         * typemanager.cs (method_params): Rename from method_internal_params.
5491         (TypeManager.GetParameterData): New.  Replace
5492         Invocation.GetParameterData.
5493         (TypeManager.LookupParametersByBuilder): Remove.
5494         * expression.cs (Invocation.method_parameter_cache): Remove.
5495         (Invocation.GetParameterData): Remove.
5496         Update to changes.
5497         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5498         Update to changes.
5499
5500 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5501
5502         Fix #72015.
5503         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5504         TypeManager.multicast_delegate_type is null, resolve it by looking
5505         up "System.MulticastDelegate".
5506         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5507
5508 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5509             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5510             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5511
5512         Fix cs0164.cs.
5513         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5514         (LabeledStatement.AddReference): New.  Set 'referenced'.
5515         (Goto.Resolve): Use it.
5516
5517 2005-02-05  John Luke  <john.luke@gmail.com>
5518
5519         * driver.cs: remove duplicate -doc line in Usage ()
5520
5521 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5522
5523         * location.cs (Location.AddFile): Fix CS2002 error report.
5524
5525 2005-02-02  Martin Baulig  <martin@ximian.com>
5526
5527         * delegate.cs (Delegate.DefineType): Report an internal error if
5528         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5529         details.        
5530
5531 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5532
5533         Fix a crasher in a variant of #31984.
5534         * const.cs (Constant.CheckBase): New override that defers the
5535         new-or-override check in case the base type hasn't been populated
5536         yet.
5537         (Constant.Define): Ensure the new-or-override check is performed.
5538
5539 2005-02-01  Duncan Mak  <duncan@ximian.com>
5540
5541         * const.cs (LookupConstantValue): Check that `ce' is not null
5542         before calling GetValue ().
5543
5544 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5545
5546         Fix test-334.cs (#69519).
5547         * cs-parser.jay (using_alias_directive): Pass in an expression to
5548         NamespaceEntry.UsingAlias.
5549         (using_namespace_directive): Pass in an expression to
5550         NamespaceEntry.Using.
5551         (namespace_name): Don't flatten to a string.
5552         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5553         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5554         ResolveAsTypeStep.
5555         (NamespaceEntry.UsingEntry): Likewise.
5556         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5557         changes.
5558         (NamespaceEntry.LookupForUsing): Remove.
5559         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5560         names.
5561         (NamespaceEntry.Lookup): Remove support for dotted names.
5562
5563 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5564
5565         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5566         split into two.
5567         (NamespaceEntry.ImplicitParent): Compute on demand.
5568         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5569         parallels the current.
5570         (NamespaceEntry.LookupForUsing): Use it.
5571         (NamespaceEntry.Lookup): If the current namespace-entry is
5572         implicit, don't search aliases and using tables.
5573
5574 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5575
5576         Fix #31984.
5577         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5578         BaseCache here.
5579         (TypeContainer.BaseCache): Compute on demand.
5580         (TypeContainer.FindMembers): Define constants and types if they're
5581         not already created.
5582         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5583         check.
5584         * const.cs (Constant.Define): Make idempotent.
5585
5586 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5587
5588         * pending.cs: Produce better code (no nops produced by using Ldarg
5589         + value).
5590         
5591         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5592         i - 1' it should be arg + 1.
5593
5594         Fixes bug #71819.
5595
5596 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5597
5598         * attribute.cs (Attribute.CheckAttributeType): Make private
5599         non-virtual.
5600         (Attribute.ResolveType): Make virtual.
5601         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5602         handling of RootContext.Tree.Types.
5603
5604 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5605
5606         Update attribute-handling to use the SimpleName/MemberAccess
5607         mechanisms.
5608         * cs-parser.jay (attribute): Pass in an expression to the
5609         constructors of Attribute and GlobalAttribute.
5610         * attribute.cs (Attribute): Take an expression for the name.
5611         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5612         passed in attribute name expression.
5613         (Attribute.CheckAttributeType): Use it.
5614         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5615         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5616         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5617         argument to prevent error messages if the lookup fails.
5618
5619 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5620
5621         * expression.cs (Indirection): Implemented IVariable interface
5622         to support indirection in AddressOf operator.
5623         (PointerArithmetic.Emit): Add optimalization for case where
5624         result can be precomputed.
5625
5626 2005-01-26  Martin Baulig  <martin@ximian.com>
5627
5628         * class.cs (TypeContainer.AttributeTargets): Return the correct
5629         AttributeTargets depending on our `Kind' instead of throwing an
5630         exception; fixes #71632.
5631
5632 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5633
5634         Fix #71257
5635         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5636         constant members.
5637
5638 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5639
5640         Fix #71602.
5641         * expression.cs (MemberAccess.DoResolve): Don't complain with
5642         cs0572 when the LHS of a member access has identical name and type
5643         name.
5644
5645 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5646
5647         Fix #71651, #71675
5648         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5649         CreatePermission.
5650         Create custom PermissionSet only for PermissionSetAttribute.
5651
5652 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5653
5654         Fix #71649
5655         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5656         delegates in static class.
5657
5658 2005-01-24  Martin Baulig  <martin@ximian.com>
5659
5660         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5661         merging an implicit block, just use its reachability.
5662
5663         * statement.cs (Block.Resolve): Make the unreachable code check
5664         work wrt. implicit blocks; see test-337 from #63842.
5665
5666 2005-01-21  Alp Toker  <alp@atoker.com>
5667  
5668         * cs-parser.jay: destructor_declaration's container is PartialContainer
5669         not Class when partial types are used, so use Kind prop instead of
5670         'is'.
5671         
5672 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5673
5674         * cs-parser.jay: Improve error reporting when an interface
5675         declares new types.
5676
5677 2005-01-20  Dick Porter  <dick@ximian.com>
5678
5679         * support.cs: SeekableStreamReader fix from Sandor Dobos
5680         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5681         chars are read.  Fixes bug 70369.
5682
5683 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5684
5685         * cs-parser.jay (catch_clause): Simplify current_block handling
5686         somewhat.
5687
5688 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5689
5690         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5691         code with ImplicitStandardConversion to handle the implicit
5692         conversion of method groups into valid delegate invocations. 
5693
5694         The problem is that in parameter handling we were using this code
5695         path.  Fixes bug #64698
5696
5697 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5698
5699         * cs-parser.jay: Fix several infelicities.
5700         - Avoid assigning to the parser value stack.  Code like 
5701           '$3 = null' is unclean.  Synthesize a value for the code block
5702           instead. 
5703         - Avoid using oob_stack for storing location information.  Use ...
5704         (_mark_): ... this.  New (empty) rule.  Saves the current location
5705         in $$.
5706         (foreach_statement): Avoid using oob_stack for current_block
5707         handling.  Use technique used in for_statement and
5708         using_statement.  Synthesize a value for the code block to store
5709         additional intermediate information.
5710
5711 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5712
5713         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5714         of a different type is only allowed to private fields of a
5715         containing type, not on fields of a base class.
5716
5717         See test-174.cs and error cs0122-9.cs
5718
5719 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5720
5721         Fix test-335.cs (bug #58126).
5722         * cs-parser.jay (argument): Split out non-expression parts of the
5723         rule into 'non_simple_argument'.
5724         (invocation_expression): Support parenthesized invocations with
5725         multiple arguments, and with single non-simple arguments.
5726
5727 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5728
5729         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5730         places.
5731
5732 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5733
5734         Fix cs0038-1.cs, cs1640-6.cs.
5735         * ecore.cs (Expression.Resolve): Remove special-case for
5736         SimpleName in error-handling.
5737         (Expression.almostMatchedMembers): Relax access permission to
5738         protected.
5739         (Expression.MemberLookupFailed): Handle duplicates in
5740         almostMatchedMembers list.
5741         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5742         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5743         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5744         overload if the passed in MemberInfo is a MethodBase.
5745
5746 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5747
5748         Fix #70749
5749         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5750         for non-CAS & merge permission sets properly.
5751
5752 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5753
5754         Improve standard-compliance of simple name and member access 
5755         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5756         * ecore.cs (FullNamedExpression): New abstract base class 
5757         for Namespaces and TypeExpressions.
5758         (ResolveFlags.SimpleName): Remove.
5759         (SimpleName): Remove support for dotted names.
5760         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5761         DeclSpace.FindType and DeclSpace.LookupType.
5762         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5763         (Expression.ExprClassName): Make member function.
5764         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5765         a namespace.  Remove creation of dotted "SimpleName"s.
5766         (MemberAccess.DoResolve): Likewise.
5767         * decl.cs (DeclSpace.Cache): Make private.
5768         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5769         (DeclSpace.FindType): Update.
5770         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5771         FullNamedExpression.
5772         * namespace.cs (Namespace): Derive from FullNamedExpression
5773         so that it can be part of expression resolution.
5774         (Namespace.Lookup): Return an FullNamedExpression.
5775         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5776         namespace.
5777         * rootcontext.cs (NamespaceLookup): Remove.
5778         (LookupType): Move to DeclSpace.
5779         * attribute.cs (CheckAttributeType): Update.
5780         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5781         (FindDocumentedTypeNonArray): Likewise.
5782
5783 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5784
5785         Fix cs0509.cs, cs1632.cs.
5786         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5787         is the same as IsInterface.
5788         (TypeContainer.GetClassBases): Likewise.
5789         * statement.cs (LabeledStatement.ig): New field.
5790         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5791         label.
5792         (LabeledStatement.DoEmit): Check that the label was created with
5793         the same ILGenerator.
5794
5795 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5796
5797         Fix #71058
5798         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5799         accessors to its properties.
5800
5801         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5802         from accessors to property.
5803         
5804 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5805
5806         Fix #70722
5807         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5808         only for overrides.
5809         
5810 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5811
5812         * attribute.cs: Check for null and empty strings.  
5813
5814         I have lost another battle to Paolo.
5815
5816 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5817
5818         Fix #70942
5819         * class.cs (PropertyMethod): Set Parent field in ctors.
5820         (SetMethod.InternalParameters): Add unsafe switch hack.
5821         Override MarkForDuplicationCheck where it is appropriate.
5822
5823         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5824         It says whether container allows members with the same name.
5825         Base default is no.
5826         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5827         Removed is_method parameter.
5828
5829 2005-01-06  Duncan Mak  <duncan@ximian.com>
5830
5831         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5832         because the previous change led to incorrect reporting of CS1032
5833         ("Cannot define/undefine preprocessor symbols after first token in
5834         file"). Instead of using `tokens_seen' as the only flag that
5835         triggers CS1040, introduce `comments_seen'. This new flag is used
5836         to signify having seen comments on the current line, so it is
5837         unset after a newline.
5838
5839 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5840
5841         * doc.cs : When searching for a type, find nested type too.
5842           This fixes bug #71040.
5843
5844 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5845
5846         * doc.cs :
5847           - Warn missing member comment on those classes which also does not
5848             have doc comments. Fixed bug #71041.
5849           - Don't warn missing doc comment on default constructor.
5850             Fixed bug #71042.
5851
5852 2005-01-06  Duncan Mak  <duncan@ximian.com>
5853
5854         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5855         comments, set `tokens_seen' to true. This allows us to detect
5856         misplaced preprocessor directives (i.e. not at the beginning of
5857         the a line, nor after whitespaces). In that case, report error
5858         CS1040. This fixes bug #56460.
5859
5860         * cs-parser.jay (interface_member_declaration): Add checks for
5861         IsExplicitImpl, and report CS0541 error if an interface member is
5862         defined as an explicit interface declaration.
5863
5864 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5865
5866         Fix #70817
5867         * class.cs (PropertyMethod): Set Parent field in ctors.
5868         (SetMethod.InternalParameters): Add unsafe switch hack.
5869         
5870         * decl.cs (MemberCore.Parent): Cannot be readonly.
5871
5872 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5873
5874         * decl.cs (DeclSpace.ResolveType): Remove.
5875         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5876         Merge in code from ...
5877         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5878         * class.cs, enum.cs: Update to changes.
5879
5880 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5881
5882         * anonymous.cs: Ensure that we init the scope of our parent if it
5883         has not been initialized yet.
5884
5885 2004-12-30  Duncan Mak  <duncan@ximian.com>
5886
5887         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5888         if field.FieldBuilder is null. Fixes #70758.
5889
5890         * convert.cs: Fixed some typos and updated some of the comments.
5891         (ImplicitStandardConversionExists):
5892         (TryImplicitIntConversion): If `target_type' is an interface and
5893         the type of `ic' implements this interface, return true or a new
5894         BoxedCast instead of null. This fixes #70468.
5895
5896 2004-12-29  Duncan Mak  <duncan@ximian.com>
5897
5898         * expression.cs (Argument.Emit): Check that Expr is
5899         IMemoryLocation before casting to it, and report CS1510 otherwise.
5900
5901         This fixes #70402.
5902
5903 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5904
5905         * statement.cs (Block.ThisVariable): remove the recursion here, to
5906         make the --profile more sane.
5907
5908 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5909
5910         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5911         assembly, by JB Evain.
5912
5913 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5914
5915         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5916           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5917         "parent" refers to enclosing type/class.  "base" refers to superclass.
5918
5919 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5920
5921         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5922         Ensure that we only have GlobalAttributes.
5923         * attribute.cs (Attribute.Emit): Make non-virtual.
5924         (GlobalAttribute.Emit): Remove.
5925         (Attribute.Resolve): Make virtual.
5926         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5927         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5928         the argument. Don't create one.
5929         (Attribute.GetObsoleteAttribute): Likewise.
5930         (Attribute.GetClsCompliantAttributeValue): Likewise.
5931         * class.cs, decl.cs: Update to changes.
5932
5933 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5934
5935         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5936         
5937         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5938         
5939         * statement.cs (Foreach.Resolve): Add error 186 report.
5940
5941 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5942
5943         * expression.cs (Conditional.DoResolve): Add warning 429.
5944         
5945         * statement.cs (If.Resolve): Add warning 665.
5946
5947 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5948
5949         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5950         except when in the parser, and in GlobalAttribute.
5951         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5952         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5953         RootContext.Tree.Types.NamespaceEntry once work is done.
5954         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5955         and resets RootContext.Tree.Types.NamespaceEntry.
5956
5957 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5958
5959         * cs-parser.jay: Don't create a block for every variable.
5960
5961 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5962
5963         * location.cs: Provide extra information.
5964
5965         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5966         variables from the captured environment, it is the ldarg_0.
5967
5968 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5969
5970         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5971         find a conclusion.
5972         
5973         * class.cs: Changed warning level for 169 to avoid developer
5974         displeasure from warning flooding. It will be changed back when they
5975         fix most of current BCL warnings.
5976         
5977         * RootContext.cs: Pushed default WarningLevel to 3.
5978         
5979         * statement.cs: Removed unused variable.
5980
5981 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5982
5983         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5984         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5985         Add error 502 report.
5986         (StaticClass.DefineType): Add error 441 report.
5987         (Class.AllowedModifiersProp): New virtual property as temporary
5988         extension to AllowedModifiers.
5989         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5990         to share implementation with StaticClass and don't call virtual
5991         methods from ctor.
5992         
5993         * driver.cs (MainDriver): Add error 1558 test.
5994
5995         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5996         report. Moved error 36 test here.
5997
5998         * statement.cs (Throw.Resolve): Add error 724 report.
5999
6000         * typemanager.cs: Add out_attribute_type core type.
6001         
6002 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6003
6004         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6005         3018 report.
6006         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6007
6008         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6009         3017 report.
6010         
6011         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6012
6013         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6014         Add error 3023 report.
6015         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6016
6017         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6018         implementation.
6019
6020 2004-12-12  John Luke  <john.luke@gmail.com>
6021
6022         * driver.cs (AddArgs): take -- into account when
6023         adding arguments, fixes bug 65710 
6024
6025 2004-12-12  Martin Baulig  <martin@ximian.com>
6026
6027         * expression.cs (Unary.TryReduceNegative): Added support for
6028         SByteConstant and ByteConstant.
6029         (Unary.Reduce): Check error values from TryReduceNegative().
6030
6031 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6032
6033         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6034         and report exception as error 182.
6035
6036 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6037
6038         * driver.cs (Main): Fix message when there are warnings.
6039
6040 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6041
6042         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6043
6044 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6045
6046         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6047         Reduced number of warnings.
6048         
6049         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6050
6051 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6052
6053         * driver.cs: Removed message.
6054
6055         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6056
6057 2004-12-08    <vargaz@freemail.hu>
6058
6059         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6060
6061 2004-12-08  Martin Baulig  <martin@ximian.com>
6062
6063         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6064         instead of a CS3002 for properties and indexer.
6065
6066 2004-12-08  Martin Baulig  <martin@ximian.com>
6067
6068         * decl.cs (MemberName.ToString): Make this work again.
6069
6070 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6071
6072         * attribute.cs (Resolve): Add error 591 detection.
6073
6074         * class.cs (FieldMember.Define): Add error 1547 detection.
6075         (Indexer.Define): Add error 620 detection.
6076         (Operator.Define): Add error 590 detection.
6077
6078         * ecore.cs: Missing argument for error 79.
6079
6080         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6081         detection.
6082
6083 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6084
6085         Fix #70106
6086         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6087         only.
6088
6089 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6090
6091         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6092           Some operator comments were suppressed.
6093         * doc.cs : Implicit/explicit operator name in doc comments are like
6094           "op_Explicit(type)~returnType", so added suffix handling.
6095
6096 2004-12-07  Martin Baulig  <martin@ximian.com>
6097
6098         * decl.cs
6099         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6100         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6101         (DeclSpace.ec): New protected field; store the EmitContext here.
6102         (DeclSpace.EmitContext): New public property; moved here from
6103         `TypeContainer'.
6104         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6105         EmitContext.
6106
6107         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6108         (Enum.Emit): Don't create a new EmitContext.
6109
6110         * delegate.cs (Delegate.DefineType): Always create the
6111         EmitContext.
6112
6113         * iterators.cs (Iterators.DefineIterator): Create a new
6114         EmitContext and store it in `ec'.
6115
6116 2004-08-24  Martin Baulig  <martin@ximian.com>
6117
6118         * typemanager.cs
6119         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6120         this for accessibility checks.
6121         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6122         IsNestedFamilyAccessible.
6123         (TypeManager.IsSubclassOf): New method, do what the name actually
6124         says.   
6125
6126 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6127
6128         Fix crash on cs0657-17.cs.
6129         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6130         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6131         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6132         the case where the NamespaceEntry gets overwritten.
6133
6134 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6135
6136         Fixed #69195, #56821
6137         * ecore.cs (ResolveBoolean): Tiny refactoring.
6138
6139         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6140         of right expression resolving when left is false constant and
6141         operator is LogicalAnd OR true constant and operator is LogicalOr.
6142
6143         * statement.cs (ResolveUnreachable): Always reports warning.
6144
6145 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6146
6147         * class.cs: Distinguish between 1721 and 1722 (just a little help
6148         for the programmer).
6149
6150 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6151
6152         * delegate.cs: Only allow this on new versions of the language. 
6153
6154 2004-12-02  Duncan Mak  <duncan@ximian.com>
6155
6156         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6157         Expression class.
6158         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6159         here as a static method. Take an additional bool out parameter
6160         `must_do_cs1540_check' for signaling to InstanceResolve.
6161         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6162         member field from PropertyExpr class and made it an argument of
6163         the method instead.
6164         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6165         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6166         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6167         and `remove_accessor' as well as InstanceResolve: report CS0122
6168         where applicable.
6169
6170         Fixes #70129.
6171
6172 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6173
6174         Fix test-327.cs, test-328.cs, and put in early infrastructure
6175         for eventually fixing #52697.
6176         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6177         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6178         from other methods.
6179         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6180         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6181         (VerifyUsing, error246): Update.
6182         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6183         'NamespaceEntry.LookupNamespaceOrType'.
6184
6185 2004-12-03  Martin Baulig  <martin@ximian.com>
6186
6187         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6188         method as our child, call AnonymousMethod.Compatible() on it.
6189
6190 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6191
6192         Disable XML documentation support in 'basic' profile.
6193         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6194         Redirect XmlElement to System.Object.
6195         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6196         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6197         * mcs.exe.sources: Add doc-bootstrap.cs.
6198         * doc-bootstrap.cs: New file.  Contains empty stub implementation
6199         of doc.cs.
6200
6201 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6202
6203         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6204           comments are allowed.
6205
6206 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6207
6208         * delegate.cs: Add checks for subtypes in paramaters and return values
6209         in VerifyMethod () to add support for Covariance/Contravariance
6210         in delegates.
6211         
6212 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6213
6214         * report.cs: Remove extra closing parenthesis.
6215
6216         * convert.cs (Error_CannotImplicitConversion): If the name of the
6217         types are the same, provide some extra information.
6218
6219         * class.cs (FieldBase): Use an unused bit field from the field to
6220         encode the `has_offset' property from the FieldMember.  This saves
6221         a couple of Ks on bootstrap compilation.
6222
6223         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6224         method as our child, return the AnonymousMethod resolved
6225         expression.
6226
6227         * expression.cs (New.DoResolve): Allow return values from
6228         NewDelegate to also include AnonymousMethods.
6229
6230         Fixes #70150.
6231
6232 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6233
6234         Fix bug #70102
6235         * attribute.cs (Resolve): Improved implementation of params
6236         attribute arguments.
6237
6238         * support.cs (ParameterData): Add HasParams to be faster.
6239
6240 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6241
6242         all things are for /doc support:
6243
6244         * doc.cs: new file that supports XML documentation generation.
6245         * mcs.exe.sources: added doc.cs.
6246         * driver.cs:
6247           Handle /doc command line option.
6248           Report error 2006 instead of 5 for missing file name for /doc.
6249           Generate XML documentation when required, after type resolution.
6250         * cs-tokenizer.cs:
6251           Added support for picking up documentation (/// and /** ... */),
6252           including a new XmlCommentState enumeration.
6253         * cs-parser.jay:
6254           Added lines to fill Documentation element for field, constant,
6255           property, indexer, method, constructor, destructor, operator, event
6256           and class, struct, interface, delegate, enum.
6257           Added lines to warn incorrect comment.
6258         * rootcontext.cs :
6259           Added Documentation field (passed only when /doc was specified).
6260         * decl.cs:
6261           Added DocComment, DocCommentHeader, GenerateDocComment() and
6262           OnGenerateDocComment() and some supporting private members for
6263           /doc feature to MemberCore.
6264         * class.cs:
6265           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6266         * delegate.cs:
6267           Added overriden DocCommentHeader.
6268         * enum.cs:
6269           Added overriden DocCommentHeader and GenerateDocComment().
6270
6271 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6272
6273         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6274         unwrapping the enumeration values, chain to
6275         DoConstantNumericPromotions again, so we can promote things to the
6276         fundamental types (takes care of enums that are bytes, sbytes).
6277
6278         Fixes bug #62054.
6279
6280 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6281
6282         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6283         Fix long-standing bug in type-lookup.  Use FindType instead of
6284         LookupType when ec.ResolvingTypeTree.
6285         (Attribute.ResolveType, Attribute.Resolve)
6286         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6287         Update to changes.
6288         (Attributes.Search): Remove internal version.  Update.
6289         (Attributes.SearchMulti): Update.
6290         (Attributes.GetClsCompliantAttribute): Remove.
6291         (Attributes.GetIndexerNameAttribute): Remove.
6292         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6293         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6294         * class.cs (Indexer.Define): Likewise.
6295
6296 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6297
6298         Fix bug #68790
6299         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6300         MarshallByReference members access.
6301
6302         * expression.cs: Use CheckMarshallByRefAccess;
6303         Better error CS0197 message.
6304
6305         * report.cs: Print whole related error message.
6306
6307 2004-11-30  Raja R Harinath  <rharinath@novell.com>
6308
6309         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6310         the current directory to help debugging.
6311
6312 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6313
6314         * class (GetClassBases): Better error 60 report.
6315         (EventProperty): Disabled warning 67 detection.
6316
6317 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6318
6319         Fix bug #60324
6320         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6321
6322         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6323         precise values.
6324
6325 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6326
6327         Fix bug #49488
6328         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6329
6330         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6331
6332 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6333
6334         * attribute.cs (Attribute.Resolve): Refine error reporting and
6335         report a cs0117 if the identifier does not exist, to distinguish
6336         from 0617 which is a miss-use of the actual identifier.
6337
6338         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6339         between cs0070 and cs0079.
6340
6341         * class.cs (MemberBase.DoDefine): When reporting a wrong
6342         accessibility level, we use MethodCore to compare instead of
6343         Method (this was a regression in some refactoring effort).
6344
6345         So now we correctly report cs0056 again.
6346
6347         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6348         testing the target_type (which was known to be object_type) and
6349         not the source type (which is anonymous_method).
6350
6351         Fixed reporting of error cs1660.
6352
6353         * expression.cs (UserCast.Source): Expose the underlying cast.
6354
6355         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6356         allowed types to find a match to int32 first (most common).
6357
6358         In addition, it ignores any ImplicitUserConversions that did an
6359         internal implicit conversion (as the switch statement allows only
6360         one integral conversion to exist).
6361
6362         * class.cs (PartialContainer.Create): rename `name' to
6363         `member_name' for clarity.  Then replace the string calls with a
6364         call to MemberName.GetPartialName, as now using
6365         MemberName.ToString is an error (this is due to the side effects
6366         it had, that were fixed in the past).
6367
6368         This will restore the error reporting on a number of partial class
6369         errors that were missusing this (and getting an exception as a
6370         results, which is now just a plain textual warning, because
6371         yyparse debug output would crash otherwise).
6372
6373 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6374
6375         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6376
6377 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6378
6379         * rootcontext.cs (LookupType): Make sure to cache lookups that
6380         don't give us a negative result. This saves about 5% of corlib
6381         compilation time.
6382
6383 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6384
6385         * report.cs (AbstractMessage.Print): messages are sent to stderr
6386
6387         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6388         non-interface in the list of interfaces (at this point, either
6389         parent was properly set, or a base class is being listed in the
6390         interfaces section).
6391
6392         This flags error 1722, and resolves the crash from bug 69259.
6393
6394 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6395
6396         * statement.cs (Using.EmitExpressionFinally): make this work right
6397         for valuetypes. Fixes 69926.
6398
6399 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6400
6401         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6402         converted to an enum" here, before we try to change the underlying
6403         type.  This code exists, but it is a different code path than the
6404         one used while encoding constants.
6405
6406         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6407         old bug: when converting from the null literal to a pointer,
6408         return an EmptyCast, not the NullLiteral.
6409
6410         This fixes #69921, the recent null_type changes probably made this
6411         bug more prominent.
6412
6413         (ImplicitReferenceConversionExists): In addition, resynchronized
6414         the code here, so it matches the same code in
6415         ImplicitReferenceConversionExists for the `from any class-type S
6416         to any interface-type T'.
6417         
6418
6419 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6420
6421         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6422
6423 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6424
6425         * cs-parser.jay: Use verbosity accordingly. 
6426
6427 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6428
6429         * expression.cs (Unary.ResolveOperator): Do not report warning;
6430         AddressOf reads from variable.
6431         
6432         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6433
6434 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6435
6436         Fix bug #69462
6437
6438         * attribute.cs (Attributable): Removed CheckTargets.
6439         (Attributes.Emit): Explicit attribute targets are tested here.
6440
6441         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6442         not enabled for interfaces.
6443
6444         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6445         (GetAssemblyName): Ouch next bug there.
6446
6447 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6448
6449         * expression.cs: Error 275 added.
6450         
6451 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6452
6453         Fix bug #69177 (Implemented decimal constant support)
6454
6455         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6456         (BinaryFold): Add DecimalConstant.
6457
6458         * const.cs (Define): Decimal constant 
6459         (is not constant.
6460         (ChangeType): Add decimal type handling.
6461         (LookupConstantValue): Don't set value for decimal type but
6462         emit DecimalConstantAttribute. Needed for constant optimization.
6463
6464         * constant.cs (ToDecimal): New method.
6465         (ConvertToDecimal): New method.
6466         (IntConstant): Implemented ConvertToDecimal.
6467         (DecimalConstant.Emit): Emit optimized version for decimals in
6468         int range.
6469
6470         * expression.cs (ResolveOperator): Changed order of constant
6471         reduction to work correctly with native types which have
6472         overloaded operators.
6473         (ResolveMemberAccess): Extract constant value from attribute
6474         for decimal type.
6475
6476         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6477
6478         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6479         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6480         (ChangeType): Decimal is special.
6481         (TypeToCoreType): Add decimal type.
6482
6483 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6484
6485         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6486         decimal types.
6487
6488 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6489
6490         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6491         test cs1667-5.cs.
6492
6493 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6494
6495         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6496
6497         * pending.cs (PendingImplementation): Grab only interfaces.
6498
6499 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6500
6501         * statement.cs (ForeachHelperMethods): Add location member and
6502         error 202 detection.
6503
6504 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6505
6506         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
6507         automatically handled by executable.make.
6508         (PROGRAM): Make profile-specific.
6509
6510 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6511
6512         * expression.cs (DoResolveBase): Fixed wrong warning for out
6513         variables.
6514
6515 2004-11-18  Martin Baulig  <martin@ximian.com>
6516
6517         Merged latest changes into gmcs.  Please keep this comment in
6518         here, it makes it easier for me to see what changed in MCS since
6519         the last time I merged.
6520
6521 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6522
6523         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6524         (TypeHandle.GetMemberCache): New.
6525         (TypeHandle.TypeHandle): Update.
6526         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6527         (TypeManager.LookupParentInterfacesCache):
6528         Rename from LookupInterfaceCache.  Optimize slightly.
6529         (TypeManager.MemberLookup_FindMembers): Update.
6530         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6531         multi-type variant.
6532         (AddCacheContents): Rename from AddHashtable.
6533         * class.cs (TypeContainer.parent_container): Remove.
6534         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6535         (TypeContainer.DoDefineMembers): Don't initialize it.
6536         Update to name changes.
6537         
6538 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6539
6540         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6541         that factors the code to check access modifiers on override.  
6542
6543         (PropertyBase): Use the code here.
6544
6545         Patch from Lluis S'anchez, fixes bug #69361.
6546
6547 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6548
6549         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6550         routine that is used to report the use of a captured variable
6551         whose address has been taken.
6552
6553         There are two checks: one when variables are being captured and
6554         the other check is when the address of a variable is taken. 
6555         
6556         (because an anonymous methods might be resolved before *or* after
6557         the address has been taken) and 
6558
6559         * expression.cs (Conditional.DoResolve): Remove the special
6560         casing that Martin added to trueExpr and falseExpr being both
6561         NullLiteral.  We get the right behavior now just by introducing
6562         the null_type into the compiler. 
6563
6564         * convert.cs (ExplicitConversion): Change the code to use
6565         null_type instead of testing `expr is NullLiteral'.
6566         (ImplicitConversionStandard): use null_type too.
6567         (ImplicitReferenceConversionExists): use null_type too.
6568         (ImplicitReferenceConversion): use null_type too.
6569
6570         * literal.cs: The type of `NullLiteral' is now null_type instead
6571         of object_type. 
6572         (Resolve): Set the type here.
6573
6574         * typemanager.cs: Introduce null_type.
6575
6576 2004-11-17  Martin Baulig  <martin@ximian.com>
6577
6578         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6579         direction, like FindMembers() does.  Fixes #69546, testcase is in
6580         test-315.cs.    
6581
6582 2004-11-16  Martin Baulig  <martin@ximian.com>
6583
6584         This is based on a patch from Marek Safar, see bug #69082.
6585         Fixes bugs #63705 and #67130.
6586
6587         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6588         method; create a MemberCache for an interface type and cache the
6589         result.
6590
6591         * decl.cs (IMemberContainer.ParentContainer): Removed.
6592         (IMemberContainer.ParentCache): New property.
6593         (MemberCache.SetupCacheForInterface): Removed.
6594         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6595         to create a cache for an interface's "parent".
6596
6597         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6598         interfaces too.
6599
6600 2004-11-16  Martin Baulig  <martin@ximian.com>
6601
6602         Merged back from gmcs; these changes already went into gmcs a
6603         couple of weeks ago.
6604
6605         * typemanager.cs
6606         (TypeManager.AddUserType): Removed the `ifaces' argument.
6607         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6608         `TypeExpr []'.
6609         (TypeManager.AddUserInterface): Removed.
6610         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6611         `TypeExpr []'.
6612         (TypeManager.GetInterfaces): Likewise.
6613         (TypeManager.GetExplicitInterfaces): Likewise.
6614
6615         * ecore.cs (TypeExpr.GetInterfaces): Removed.
6616
6617         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6618         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6619
6620 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6621
6622         * statement.cs: Avoid adding bools to a hashtable.
6623
6624 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6625
6626         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6627         calling an unsafe method from a safe location.
6628
6629 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6630
6631         Fix #69167
6632         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6633
6634 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6635
6636         * namespace.cs (VerifyUsing): use GetPartialName instead of
6637         ToString. 
6638
6639 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6640
6641         * statement.cs (Return.Resolve): Fix regression in typo: if
6642         `in_exc', we have to request a NeedReturnLabel, this was a typo
6643         introduced in the anonymous method check-in.  Fixes #69131.
6644
6645         * Indexers were using the ShortName when defining themselves,
6646         causing a regression in the compiler bootstrap when applying the
6647         patch from 2004-11-02 (first part), now they use their full name
6648         and the bug is gone.
6649
6650 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6651
6652         * driver.cs: Strip the path from the names of embedded resources. Fixes
6653         #68519.
6654
6655 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6656
6657         Fix error message regression: cs0104-2.cs.
6658         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6659         (AliasEntry.Resolve): Update.
6660         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6661         'silent' flag.
6662         (RootContext.LookupType): Update.
6663
6664 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6665
6666         * cs-parser.jay: Add support for handling accessor modifiers
6667         * class: Add support port accessor modifiers and error checking,
6668         define PropertyMethod.Define as virtual (not abstract anymore)
6669         * ecore.cs: Add checking for proeprties access with access modifiers
6670         * iterators.cs: Modify Accessor constructor call based in the modified
6671         constructor
6672 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6673
6674         * expression.cs (StringConcat): Handle being called twice,
6675         as when we have a concat in a field init with more than two
6676         ctors in the class
6677
6678 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6679
6680         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6681         special case explicit implementations, we should always produce
6682         the .property or .event declaration.
6683         
6684         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6685         since it will not return correct data if people use this
6686         unresolved in the presence of using statements (see test-313).
6687
6688         * class.cs (MethodData.Define): If we are an explicit interface
6689         implementation, set the method name to the full name of the
6690         interface plus the name of the method.  
6691
6692         Notice that using the method.MethodName.GetFullName() does not
6693         work, as it will only contain the name as declared on the source
6694         file (it can be a shorthand in the presence of using statements)
6695         and not the fully qualifed type name, for example:
6696
6697         using System;
6698
6699         class D : ICloneable {
6700                 object ICloneable.Clone ()  {
6701                 }
6702         }
6703
6704         Would produce a method called `ICloneable.Clone' instead of
6705         `System.ICloneable.Clone'.
6706
6707         * namespace.cs (Alias.Resolve): Use GetPartialName.
6708         
6709 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6710
6711         * cs-parser.jay: Add error 1055 report.
6712
6713 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6714
6715         * assign.cs (Assign.DoResolve): Only do the transform of
6716         assignment into a New if the types are compatible, if not, fall
6717         through and let the implicit code deal with the errors and with
6718         the necessary conversions. 
6719
6720 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6721
6722         * cs-parser.jay: Add error 1031 report.
6723
6724         * cs-tokenizer.cs: Add location for error 1038.
6725
6726 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6727
6728         * cs-parser.jay: Add error 1016 report.
6729
6730 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6731
6732         * cs-parser.jay: Add errors 1575,1611 report.
6733
6734 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6735
6736         * cs-parser.jay: Add error 1001 report.
6737
6738 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6739
6740         Fix #68850
6741         * attribute.cs (GetMarshal): Add method argument for
6742         caller identification.
6743
6744         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6745         agument for GetMarshal and RuntimeMissingSupport.
6746
6747 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6748
6749         * attribute.cs (ExtractSecurityPermissionSet): Removed
6750         TypeManager.code_access_permission_type.
6751
6752         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6753
6754 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6755
6756         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6757         for obsolete use of a variable here.   Fixes regression on errors
6758         cs0619-25 and cs0619-26.
6759
6760 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6761
6762         Fix #62358, implemented security attribute encoding.
6763
6764         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6765         Tests permitted SecurityAction for assembly or other types.
6766         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6767         data from SecurityPermissionAttribute to PermisionSet class.
6768
6769         * class.cs (ApplyAttributeBuilder): Added special handling
6770         for System.Security.Permissions.SecurityAttribute based types.
6771
6772         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6773         special handling for System.Security.Permissions.SecurityAttribute
6774         based types.
6775
6776         * enum.cs (ApplyAttributeBuilder): Added special handling
6777         for System.Security.Permissions.SecurityAttribute based types.
6778
6779         * parameter.cs (ApplyAttributeBuilder): Added special handling
6780         for System.Security.Permissions.SecurityAttribute based types.
6781
6782         * rootcontext.cs: Next 2 core types.
6783
6784         * typemanager.cs (TypeManager.security_permission_attr_type):
6785         Built in type for the SecurityPermission Attribute.
6786         (code_access_permission_type): Build in type.
6787
6788 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6789
6790         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6791         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6792         all of this information into
6793         EmitContext.EmitCapturedVariableInstance.
6794         
6795         * codegen.cs (EmitCapturedVariableInstance): move here the
6796         funcionality of emitting an ldarg.0 in the presence of a
6797         remapping.   This centralizes the instance emit code.
6798
6799         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6800         then emit a load of this: it means that we have reached the
6801         topmost ScopeInfo: the one that contains the pointer to the
6802         instance of the class hosting the anonymous method.
6803
6804         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6805         captures to the topmost CaptureContext.
6806
6807 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6808
6809         * expression.cs (LocalVariableReference): Move the knowledge about
6810         the iterators into codegen's EmitCapturedVariableInstance.
6811
6812 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6813
6814         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6815         all code paths return a value from an anonymous method (it is the
6816         same as the 161 error, but for anonymous methods).
6817
6818 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6819
6820         The introduction of anonymous methods in the compiler changed
6821         various ways of doing things in the compiler.  The most
6822         significant one is the hard split between the resolution phase
6823         and the emission phases of the compiler.
6824
6825         For instance, routines that referenced local variables no
6826         longer can safely create temporary variables during the
6827         resolution phase: they must do so from the emission phase,
6828         since the variable might have been "captured", hence access to
6829         it can not be done with the local-variable operations from the runtime.
6830         
6831         * statement.cs 
6832
6833         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6834         is a toplevel block.
6835
6836         (ToplevelBlock): A new kind of Block, these are the blocks that
6837         are created by the parser for all toplevel method bodies.  These
6838         include methods, accessors and anonymous methods.
6839
6840         These contain some extra information not found in regular blocks:
6841         A pointer to an optional CaptureContext (for tracking captured
6842         local variables and parameters).  A pointer to the parent
6843         ToplevelBlock.
6844         
6845         (Return.Resolve): Catch missmatches when returning a value from an
6846         anonymous method (error 1662).
6847         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6848         phase.
6849
6850         (Break.Resolve): ditto.
6851
6852         (SwitchLabel): instead of defining the labels during the
6853         resolution phase, we now turned the public ILLabel and ILLabelCode
6854         labels into methods called GetILLabelCode() and GetILLabel() that
6855         only define the label during the Emit phase.
6856
6857         (GotoCase): Track the SwitchLabel instead of the computed label
6858         (its contained therein).  Emit the code by using
6859         SwitchLabel.GetILLabelCode ().
6860
6861         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6862         whether the Local has been captured or not.
6863
6864         (LocalInfo.IsCaptured): New property, used to tell whether the
6865         local has been captured.
6866         
6867         * anonymous.cs: Vastly updated to contain the anonymous method
6868         support.
6869
6870         The main classes here are: CaptureContext which tracks any
6871         captured information for a toplevel block and ScopeInfo used to
6872         track the activation frames for various local variables.   
6873
6874         Each toplevel block has an optional capture context associated
6875         with it.  When a method contains an anonymous method both the
6876         toplevel method and the anonymous method will create a capture
6877         context.   When variables or parameters are captured, they are
6878         recorded on the CaptureContext that owns them, for example:
6879
6880         void Demo () {
6881              int a;
6882              MyDelegate d = delegate {
6883                  a = 1;
6884              }
6885         }
6886
6887         Here `a' will be recorded as captured on the toplevel
6888         CapturedContext, the inner captured context will not have anything
6889         (it will only have data if local variables or parameters from it
6890         are captured in a nested anonymous method.
6891
6892         The ScopeInfo is used to track the activation frames for local
6893         variables, for example:
6894
6895         for (int i = 0; i < 10; i++)
6896                 for (int j = 0; j < 10; j++){
6897                    MyDelegate d = delegate {
6898                         call (i, j);
6899                    }
6900                 }
6901
6902         At runtime this captures a single captured variable `i', but it
6903         captures 10 different versions of the variable `j'.  The variable
6904         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6905         recorded on a child.  
6906
6907         The toplevel ScopeInfo will also track information like the `this'
6908         pointer if instance variables were referenced (this is necessary
6909         as the anonymous method lives inside a nested class in the host
6910         type of the method). 
6911
6912         (AnonymousMethod): Expanded to track the Toplevel, implement
6913         `AnonymousMethod.Compatible' to tell whether an anonymous method
6914         can be converted to a target delegate type. 
6915
6916         The routine now also produces the anonymous method content
6917
6918         (AnonymousDelegate): A helper class that derives from
6919         DelegateCreation, this is used to generate the code necessary to
6920         produce the delegate for the anonymous method that was created. 
6921
6922         * assign.cs: API adjustments for new changes in
6923         Convert.ImplicitStandardConversionExists.
6924
6925         * class.cs: Adjustments to cope with the fact that now toplevel
6926         blocks are of type `ToplevelBlock'. 
6927
6928         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6929         insteda of standard blocks.
6930
6931         Flag errors if params arguments are passed to anonymous methods.
6932
6933         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6934         `CurrentAnonymousMethod' which points to the current Anonymous
6935         Method.  The variable points to the AnonymousMethod class that
6936         holds the code being compiled.  It is set in the new EmitContext
6937         created for the anonymous method.
6938
6939         (EmitContext.Phase): Introduce a variable and an enumeration to
6940         assist in enforcing some rules about when and where we are allowed
6941         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6942         only one that enfonces this right now).
6943
6944         (EmitContext.HaveCaptureInfo): new helper method that returns
6945         whether we have a CapturedContext initialized.
6946
6947         (EmitContext.CaptureVariable): New method used to register that a
6948         LocalInfo must be flagged for capturing. 
6949
6950         (EmitContext.CapturedParameter): New method used to register that a
6951         parameters must be flagged for capturing. 
6952         
6953         (EmitContext.CapturedField): New method used to register that a
6954         field must be flagged for capturing. 
6955
6956         (EmitContext.HaveCapturedVariables,
6957         EmitContext.HaveCapturedFields): Return whether there are captured
6958         variables or fields. 
6959
6960         (EmitContext.EmitMethodHostInstance): This is used to emit the
6961         instance for the anonymous method.  The instance might be null
6962         (static methods), this (for anonymous methods that capture nothing
6963         and happen to live side-by-side with the current method body) or a
6964         more complicated expression if the method has a CaptureContext.
6965
6966         (EmitContext.EmitTopBlock): Routine that drives the emission of
6967         code: it will first resolve the top block, then emit any metadata
6968         and then emit the code.  The split is done so that we can extract
6969         any anonymous methods and flag any captured variables/parameters.
6970         
6971         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6972         during this phase, the ILGenerator should not be used as labels
6973         and local variables declared here might not be accessible to any
6974         code that is part of an anonymous method.  
6975
6976         Exceptions to this include the temporary variables that are
6977         created by some statements internally for holding temporary
6978         variables. 
6979         
6980         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6981         metadata for a cb
6982
6983         (EmitContext.TemporaryReturn): This method is typically called
6984         from the Emit phase, and its the only place where we allow the
6985         ReturnLabel to be defined other than the EmitMeta.  The reason is
6986         that otherwise we would have to duplicate a lot of logic in the
6987         Resolve phases of various methods that today is on the Emit
6988         phase. 
6989
6990         (EmitContext.NeedReturnLabel): This no longer creates the label,
6991         as the ILGenerator is not valid during the resolve phase.
6992
6993         (EmitContext.EmitThis): Extended the knowledge in this class to
6994         work in anonymous methods in addition to iterators. 
6995
6996         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6997         code is necessary on the stack to access the instance to a local
6998         variable (the variable will be accessed as a field).
6999
7000         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7001         EmitContext.EmitAddressOfParameter): Routines to support
7002         parameters (not completed at this point). 
7003         
7004         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7005         will also remove the parameters.
7006
7007         * convert.cs (Convert): Define a `ConstantEC' which points to a
7008         null.  This is just to prefity some code that uses
7009         ImplicitStandardConversion code and do not have an EmitContext
7010         handy.
7011
7012         The idea is to flag explicitly that at that point in time, it is
7013         known that the conversion will not trigger the delegate checking
7014         code in implicit conversions (which requires a valid
7015         EmitContext). 
7016
7017         Everywhere: pass new EmitContext parameter since
7018         ImplicitStandardConversionExists now requires it to check for
7019         anonymous method conversions. 
7020
7021         (Convert.ImplicitStandardConversionExists): If the type of an
7022         expression is the anonymous_method_type, and the type is a
7023         delegate, we invoke the AnonymousMethod.Compatible method to check
7024         whether an implicit conversion is possible. 
7025
7026         (Convert.ImplicitConversionStandard): Only do implicit method
7027         group conversions if the language level is not ISO_1.
7028
7029         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7030         MethodInfo for the Invoke method.  used by Delegate and
7031         AnonymousDelegate.
7032
7033         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7034         method conversions if the target type is a delegate.
7035
7036         Removed extra debugging nops.
7037
7038         (LocalVariableReference): Turn the `local_info' into a public
7039         field. 
7040
7041         Add `prepared' field, the same hack used for FieldExprs to cope
7042         with composed assignments, as Local variables do not necessarily
7043         operate purely on the stack as they used to: they can be captured
7044         fields. 
7045
7046         Add `temp' for a temporary result, like fields.
7047
7048         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7049
7050         It now copes with Local variables that are captured and emits the
7051         proper instance variable to load it from a field in the captured
7052         case. 
7053
7054         (ParameterReference.DoResolveBase): During the resolve phase,
7055         capture parameters if we are in an anonymous method.
7056
7057         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7058         anonymous method, use the EmitContext helper routines to emit the
7059         parameter reference.
7060
7061         * iterators.cs: Set RemapToProxy to true/false during the
7062         EmitDispose class.
7063
7064         * parameters.cs (GetParameterByName): New helper method. 
7065
7066         * typemanager.cs (anonymous_method_type) a new type that
7067         represents an anonyous method.  This is always an internal type,
7068         used as a fencepost to test against the anonymous-methodness of an
7069         expression. 
7070         
7071 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7072
7073         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7074         561 report.
7075         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7076
7077 2004-10-18  Martin Baulig  <martin@ximian.com>
7078
7079         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7080         `Type' directly, but call ResolveType() on it.
7081         (Catch.Resolve): Likewise.
7082         (Foreach.Resolve): Likewise.
7083
7084 2004-10-18  Martin Baulig  <martin@ximian.com>
7085
7086         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7087         `Type' directly, but call ResolveType() on it.
7088         (Probe.DoResolve): Likewise.
7089         (ArrayCreation.LookupType): Likewise.
7090         (TypeOf.DoResolve): Likewise.
7091         (SizeOf.DoResolve): Likewise.
7092
7093 2004-10-18  Martin Baulig  <martin@ximian.com>
7094
7095         * expression.cs (Invocation.BetterFunction): Put back
7096         TypeManager.TypeToCoreType().
7097
7098 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7099
7100         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7101         the ResolveType.
7102
7103 2004-10-18  Martin Baulig  <martin@ximian.com>
7104
7105         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
7106         `Type' directly, but call ResolveType() on it.
7107
7108 2004-10-18  Martin Baulig  <martin@ximian.com>
7109
7110         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7111         `Type' directly, but call ResolveType() on it.
7112         (MemberBase.DoDefine): Likewise.
7113
7114         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7115         `Type' directly, but call ResolveType() on it.
7116         (ComposedCast.DoResolveAsTypeStep): Likewise.
7117
7118         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7119         `Type' directly, but call ResolveType() on it.
7120
7121 2004-10-17  John Luke  <john.luke@gmail.com>
7122
7123         * class.cs (Operator.GetSignatureForError): use CSharpName
7124
7125         * parameter.cs (Parameter.GetSignatureForError): Returns
7126         correct name even if was not defined.
7127
7128 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7129
7130         Fix #65816.
7131         * class.cs (TypeContainer.EmitContext): New property.
7132         (DefineNestedTypes): Create an emitcontext for each part.
7133         (MethodCore.DoDefineParameters): Use container's emitcontext.
7134         Pass type array to InternalParameters.
7135         (MemberBase.DoDefine): Use container's emitcontext.
7136         (FieldMember.Define): Likewise.
7137         (Event.Define): Likewise.
7138         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7139         Pass type array to InternalParameters.
7140         (SetIndexerMethod.GetParameterInfo): Likewise.
7141         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7142         * delegate.cs (Define): Pass emitcontext to
7143         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7144         array to InternalParameters.
7145         * expression.cs (ParameterReference.DoResolveBase): Pass
7146         emitcontext to GetParameterInfo.
7147         (ComposedCast.DoResolveAsTypeStep): Remove check on
7148         ec.ResolvingTypeTree.
7149         * parameter.cs (Parameter.Resolve): Change argument to
7150         EmitContext.  Use ResolveAsTypeTerminal.
7151         (Parameter.GetSignature): Change argument to EmitContext.
7152         (Parameters.ComputeSignature): Likewise.
7153         (Parameters.ComputeParameterTypes): Likewise.
7154         (Parameters.GetParameterInfo): Likewise.
7155         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7156         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7157         * support.cs (InternalParameters..ctor): Remove variant that takes
7158         a DeclSpace.
7159         * typemanager.cs (system_intptr_expr): New.
7160         (InitExpressionTypes): Initialize it.
7161
7162 2004-10-12  Chris Toshok  <toshok@ximian.com>
7163
7164         * cs-parser.jay: fix location for try_statement and catch_clause.
7165
7166 2004-10-11  Martin Baulig  <martin@ximian.com>
7167
7168         * report.cs: Don't make --fatal abort on warnings, we have
7169         -warnaserror for that.
7170
7171 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7172
7173         More DeclSpace.ResolveType avoidance.
7174         * decl.cs (MemberCore.InUnsafe): New property.
7175         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7176         with newly created EmitContext.
7177         (FieldMember.Define): Likewise.
7178         * delegate.cs (Delegate.Define): Likewise.
7179         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7180         only if normal name-lookup fails.
7181         (TypeExpr.DoResolve): Enable error-checking.
7182         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7183         (SizeOf.DoResolve): Likewise.
7184         (ComposedCast.DoResolveAsTypeStep): Likewise.
7185         (StackAlloc.DoResolve): Likewise.
7186         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7187         (Block.Unsafe): New property.
7188         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7189         (Unsafe): Set 'unsafe' flag of contained block.
7190         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7191         (Fixed.Resolve): Likewise.
7192         (Catch.Resolve): Likewise.
7193         (Using.ResolveLocalVariableDecls): Likewise.
7194         (Foreach.Resolve): Likewise.
7195
7196 2004-10-05  John Luke <john.luke@gmail.com>
7197
7198         * cs-parser.jay: add location to error CS0175
7199
7200 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7201
7202         * ecore.cs (Expression.Constantity): Add support for turning null
7203         into a constant.
7204
7205         * const.cs (Const.Define): Allow constants to be reference types
7206         as long as the value is Null.
7207
7208 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7209
7210         * namespace.cs (NamespaceEntry.Using): No matter which warning
7211         level is set, check if this namespace name has already been added.
7212
7213 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7214
7215         * expression.cs: reftype [!=]= null should always use br[true,false].
7216         # 67410
7217
7218 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7219
7220         Fix #67108
7221         * attribute.cs: Enum conversion moved to 
7222         GetAttributeArgumentExpression to be applied to the all
7223         expressions.
7224
7225 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7226
7227         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7228         * class.c (TypeContainer.DefineType): Flag error if
7229         base types aren't accessible due to access permissions.
7230         * decl.cs (DeclSpace.ResolveType): Move logic to
7231         Expression.ResolveAsTypeTerminal.
7232         (DeclSpace.ResolveTypeExpr): Thin layer over
7233         Expression.ResolveAsTypeTerminal.
7234         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7235         Refactor code into NestedAccess.  Use it.
7236         (DeclSpace.NestedAccess): New.
7237         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7238         argument to silence errors.  Check access permissions.
7239         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7240         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7241         (Cast.DoResolve): Likewise.
7242         (New.DoResolve): Likewise.
7243         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7244         (TypeOf.DoResolve): Likewise.
7245
7246         * expression.cs (Invocation.BetterConversion): Return the Type of
7247         the better conversion.  Implement section 14.4.2.3 more faithfully.
7248         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7249         section 14.4.2.2 explicit.
7250         (Invocation.OverloadResolve): Update.
7251         (Invocation): Remove is_base field.
7252         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7253         (Invocation.Emit): Likewise.
7254
7255 2004-09-27  Raja R Harinath  <rharinath@novell.com>
7256
7257         * README: Update to changes.
7258
7259 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7260
7261         * cs-parser.jay: Reverted 642 warning fix.
7262
7263 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7264
7265         Fix bug #66615
7266         * decl.cs (FindMemberWithSameName): Indexer can have more than
7267         1 argument.
7268
7269 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7270
7271         * expression.cs (LocalVariableReference.DoResolveLValue):
7272         Do not report warning 219 for out values.
7273         (EmptyExpression.Null): New member to avoid extra allocations.
7274
7275 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7276
7277         * cs-parser.jay: Fix wrong warning 642 report.
7278
7279         * cs-tokenizer.cs (CheckNextToken): New helper;
7280         Inspect next character if is same as expected.
7281
7282 2004-09-23  Martin Baulig  <martin@ximian.com>
7283
7284         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7285         (Convert.ImplicitReferenceConversionExists): Likewise.
7286
7287 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7288
7289         * class.cs (Operator.Define): Add error 448 and 559 report.
7290
7291 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7292
7293         * class.cs (MemberBase.IsTypePermitted): New protected
7294         method for checking error CS0610.
7295
7296 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7297
7298         * class.cs (TypeContainer.HasExplicitLayout): New property
7299         Returns whether container has StructLayout attribute set Explicit.
7300         (FieldMember): New abstract class for consts and fields.
7301         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7302         (Field): Reuse FieldMember.
7303
7304         * const.cs (Const): Reuse FieldMember.
7305
7306         * rootcontext.cs: EmitConstants call moved to class.
7307
7308 2004-09-22  Martin Baulig  <martin@ximian.com>
7309
7310         Thanks to Peter Sestoft for this bug report.
7311
7312         * expression.cs (Conditional): If both the `trueExpr' and the
7313         `falseExpr' is a NullLiteral, return a NullLiteral.
7314
7315 2004-09-22  Martin Baulig  <martin@ximian.com>
7316
7317         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7318         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7319         for the "get_Current" call.
7320
7321 2004-09-22  Martin Baulig  <martin@ximian.com>
7322
7323         Marek and me just fixed one of our oldest bugs: #28562 :-)
7324
7325         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7326
7327         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7328         we're an EnumConstant, just return that.
7329         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7330         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7331         to get the value which'll actually be written into the attribute.
7332         However, we have to use GetValue() to access the attribute's value
7333         in the compiler.        
7334
7335 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7336
7337         * constant.cs (Constant.IsNegative): New abstract property
7338         IsNegative.
7339
7340         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7341         (StackAlloc.DoResolve): Reused IsNegative.
7342
7343 2004-09-21  Martin Baulig  <martin@ximian.com>
7344
7345         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7346         if we're used in an iterator, we may be called from different
7347         methods.
7348
7349         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7350         we actually have an exception block.
7351
7352 2004-09-20  John Luke <jluke@cfl.rr.com>
7353
7354         * class.cs, cs-parser.jay: Improve the error report for 1520:
7355         report the actual line where the error happens, not where the
7356         class was declared.
7357
7358         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7359         Pass location information that was available elsewhere.
7360
7361 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
7362
7363         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7364         runtime to delay sign assemblies.
7365
7366 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7367
7368         * cs-parser.jay: Do not report the stack trace, this is barely
7369         used nowadays.
7370
7371 2004-08-22  John Luke  <john.luke@gmail.com>
7372  
7373         * driver.cs : check that a resource id is not already used
7374         before adding it, report CS1508 if it is, bug #63637
7375
7376 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7377
7378         * ecore.cs: Removed dead code.
7379
7380 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
7381
7382         * class.cs: Do not report warning CS0067 on the interfaces.
7383
7384 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7385
7386         * cs-parser.jay: Add error 504 report.
7387
7388 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7389
7390         * rootcontext.cs: WarningLevel is 4 by default now.
7391
7392         * statement.cs (Fixed.Resolve): Do not null
7393         VariableInfo.
7394
7395 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7396
7397         Fixed bug #55780
7398         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7399         deep search when property is not virtual.
7400         (PropertyExpr.ResolveAccessors): Make one call for both
7401         accessors.
7402
7403 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7404
7405         Fixed bug #65766
7406         * statement.cs: Error 152 report constains also location.
7407
7408 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7409
7410         Fixed bug #65766
7411         * const.cs: Explicitly set constant as static.
7412
7413 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7414
7415         Fixed bug #64226
7416         * cs-parser.jay: Add error 1017 report.
7417
7418 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7419
7420         Fixed bug #59980, #64224
7421         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7422
7423         * typemanager.cs (IsSpecialMethod): Simplified
7424
7425 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7426
7427         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7428         condition with better params.
7429
7430 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7431
7432         Fixed bug #65238
7433         * attribute.cs (Resolve): Property has to have both
7434         accessors.
7435
7436 2004-09-14  Martin Baulig  <martin@ximian.com>
7437
7438         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7439
7440 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7441
7442         Fixed bug #61902
7443         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7444         called and is obsolete then this member suppress message
7445         when call is inside next [Obsolete] method or type.
7446
7447         * expression.cs: Use TestObsoleteMethodUsage member.
7448
7449 2004-09-14  Martin Baulig  <martin@ximian.com>
7450
7451         * cs-parser.jay: Sync a bit with the GMCS version.
7452
7453 2004-09-14  Martin Baulig  <martin@ximian.com>
7454
7455         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7456         (CSharpParser.yacc_verbose_flag): New public field.
7457
7458         * genericparser.cs: Removed.
7459
7460 2004-09-14  Raja R Harinath  <rharinath@novell.com>
7461
7462         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7463
7464 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7465
7466         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7467
7468 2004-09-10  Martin Baulig  <martin@ximian.com>
7469
7470         Backported my MemberName changes from GMCS into MCS.
7471
7472         - we are now using a special `MemberName' class instead of using
7473         strings; in GMCS, the `MemberName' also contains the type
7474         arguments.
7475
7476         - changed the grammar rules a bit:
7477           * the old `member_name' is now a `namespace_or_type_name':
7478             The rule is that we use `namespace_or_type_name' everywhere
7479             where we expect either a "member name" (GetEnumerator) or a
7480             "member name" with an explicit interface name
7481             (IEnumerable.GetEnumerator).
7482             In GMCS, the explicit interface name may include type arguments
7483             (IEnumerable<T>.GetEnumerator).
7484           * we use `member_name' instead of just `IDENTIFIER' for
7485             "member names":
7486             The rule is that we use `member_name' wherever a member may
7487             have type parameters in GMCS.       
7488
7489         * decl.cs (MemberName): New public class.
7490         (MemberCore.MemberName): New public readonly field.
7491         (MemberCore.ctor): Take a `MemberName' argument, not a string.
7492         (DeclSpace): Likewise.
7493
7494         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7495         * enum.cs (Enum.ctor): Likewise.
7496
7497         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7498         MemberName.     
7499         (AliasEntry.ctor): Take a MemberName, not an Expression.
7500         (AliasEntry.UsingAlias): Likewise.
7501
7502         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7503         (IMethodData.MemberName): Changed type from string to MemberName.
7504         (MemberBase.ExplicitInterfaceName): Likewise.
7505         (AbstractPropertyEventMethod.SetupName): Make this private.
7506         (AbstractPropertyEventMethod.ctor): Added `string prefix'
7507         argument; compute the member name here.
7508         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7509         on the `member.MemberName' and the `prefix'.
7510
7511         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7512         not `type_name'.
7513         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7514         thus, we get a `MemberName' instead of a `string'.  These
7515         declarations may have type parameters in GMCS.
7516         (interface_method_declaration, delegate_declaration): Likewise.
7517         (class_declaration, interface_declaration): Likewise.
7518         (method_header): Use `namespace_or_type_name' instead of
7519         `member_name'.  We may be an explicit interface implementation.
7520         (property_declaration, event_declaration): Likewise.
7521         (member_name): This is now just an `IDENTIFIER', not a
7522         `namespace_or_type_name'.
7523         (type_name, interface_type): Removed.
7524         (namespace_or_type_name): Return a MemberName, not an Expression.
7525         (primary_expression): Use `member_name' instead of `IDENTIFIER';
7526         call GetTypeExpression() on the MemberName to get an expression.
7527         (IndexerDeclaration.interface_type): Changed type from string to
7528         MemberName.
7529         (MakeName): Operate on MemberName's instead of string's.
7530
7531 2004-09-13  Raja R Harinath  <rharinath@novell.com>
7532
7533         Fix bug #55770.
7534         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7535         (NamespaceEntry.Lookup): Add new argument to flag if we want the
7536         lookup to avoid symbols introduced by 'using'.
7537         * rootcontext.cs (NamespaceLookup): Update.
7538
7539 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7540
7541         * class.cs (TypeContainer.DoDefineMembers): Do not call
7542         DefineDefaultConstructor for static classes.
7543
7544 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7545
7546         * attribute.cs (Attribute.Resolve): Add error 653 report.
7547
7548         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7549         report.
7550         (Method.ApplyAttributeBuilder): Add error 685 report.
7551         (Operator.Define): Add error 564 report.
7552
7553         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7554
7555         * expression.cs (Invocation.DoResolve): Add error
7556         245 and 250 report.
7557
7558         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7559         error 674 report.
7560
7561 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7562
7563         * class.cs (ConstructorInitializer.Resolve):
7564         Wrong error number (515->516).
7565
7566 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7567
7568         * class.cs (Indexer.Define): Add error 631 report.
7569
7570 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7571
7572         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7573
7574 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7575
7576         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7577
7578 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7579
7580         * cs-parser.jay: Added error CS0241 report.
7581
7582 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7583
7584         * cs-parser.jay (fixed_statement): Introduce a scope for the
7585         declaration in the 'fixed' statement.
7586
7587 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7588
7589         * cs-parser.jay: Added CS0230 error report.
7590
7591 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7592
7593         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7594
7595 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7596
7597         * expression.cs (Argument.Resolve): Added error CS0192 and
7598         CS0199 report.
7599
7600 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7601
7602         C# 2.0 #pragma warning feature
7603
7604         * cs-tokenizer.cs (PreProcessPragma): New method; 
7605         Handles #pragma directive.
7606
7607         * report.cs (WarningRegions): New class; Support
7608         class for #pragma warning directive. It tests whether
7609         warning is enabled for a given line.
7610
7611 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7612
7613         * const.cs: Add more descriptive error report, tahnks to
7614         Sebastien. 
7615
7616 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7617
7618         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7619
7620 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7621
7622         * expression.cs: Apply patch from Ben: Remove dead code from
7623         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7624         as that code just threw an exception anwyays.
7625
7626         * const.cs: Remove the call to the turnintoconstant, for details
7627         see bug: #63144
7628         
7629         * literal.cs: The type of the null-literal is the null type;  So
7630         we use a placeholder type (literal.cs:System.Null, defined here)
7631         for it.
7632
7633         * expression.cs (Conditional.DoResolve): Remove some old code that
7634         is no longer needed, conversions have been fixed.
7635
7636         (ArrayCreationExpression.DoResolve): Return false if we fail to
7637         resolve the inner expression.
7638
7639 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7640
7641         Fix test-290.cs.
7642         * cs-parser.jay (delegate_declaration): Record a delegate
7643         declaration as a type declaration.
7644         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7645
7646 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7647
7648         * parameter.cs: Do not crash if the type can not be resolved. 
7649
7650         * expression.cs: Report errors with unsafe pointers, fixes #64896
7651
7652 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7653
7654         * expression.cs: Pointer arith always needs to do a conv.i
7655         if the operand is a long. fix 65320
7656
7657 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7658
7659         Fixed cs0619-37.cs, cs0619-38.cs
7660
7661         * enum.cs (GetObsoleteAttribute): Removed.
7662
7663         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7664         on Enum member is double staged. The first is tested member
7665         and then enum.
7666
7667 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7668
7669         Fixed #56986, #63631, #65231
7670
7671         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7672         adds member to name container.
7673         (TypeContainer.AddToTypeContainer): New method, adds type to
7674         name container.
7675         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7676         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7677         AddOperator): Simplified by reusing AddToMemberContainer.
7678         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7679         instead of field.
7680         (Method.CheckForDuplications): Fixed implementation to test all
7681         possibilities.
7682         (MemberBase): Detection whether member is explicit interface
7683         implementation is now in constructor.
7684         (MemberBase.UpdateMemberName): Handles IndexerName.
7685         (Accessor): Changed to keep also location information.
7686         (AbstractPropertyEventMethod): Is derived from MemberCore.
7687         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7688         will be emited or not.
7689         (PropertyBase.AreAccessorsDuplicateImplementation):
7690         Tests whether accessors are not in collision with some method.
7691         (Operator): Is derived from MethodCore to simplify common
7692         operations.
7693
7694         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7695         must be performed.
7696         (DeclSpace.AddToContainer): Adds the member to defined_names
7697         table. It tests for duplications and enclosing name conflicts.
7698
7699         * enum.cs (EnumMember): Clean up to reuse the base structures
7700
7701 2004-09-03  Martin Baulig  <martin@ximian.com>
7702
7703         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7704         into TypeContainer, to make partial classes work again.
7705
7706 2004-09-03  Martin Baulig  <martin@ximian.com>
7707
7708         * rootcontext.cs (RootContext.V2): Removed.
7709
7710 2004-03-23  Martin Baulig  <martin@ximian.com>
7711
7712         * expression.cs (Invocation.OverloadResolve): Added `bool
7713         may_fail' argument and use it instead of the Location.IsNull() hack.
7714
7715 2004-09-03  Martin Baulig  <martin@ximian.com>
7716
7717         Merged latest changes into gmcs.  Please keep this comment in
7718         here, it makes it easier for me to see what changed in MCS since
7719         the last time I merged.
7720
7721 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7722
7723         Fix #61128.
7724         * expression.cs (BetterConversion): Don't allow either conversion 
7725         to be null.  Remove redundant implicit conversion test when 'q ==
7726         null' -- when this function is invoked, we already know that the
7727         implicit conversion exists.
7728         (BetterFunction): Assume that 'best' is non-null.  Remove
7729         redundant reimplementation of IsApplicable when 'best' is null.
7730         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7731         number of arguments.
7732         (IsAncestralType): Extract from OverloadResolve.
7733         (OverloadResolve): Make robust to the MethodGroupExpr being
7734         unsorted.  Implement all the logic of Section 14.5.5.1, and
7735         support overloading of methods from multiple applicable types.
7736         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7737
7738         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7739         (RealError, Warning): Append type of report to related symbol.
7740
7741 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7742
7743         * enum.cs: Fixed CLS-Compliance checks for enum members.
7744         Error tests cs3008-8.cs, cs3014-8.cs
7745
7746 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7747
7748         Fixed bug #62342, #63102
7749         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7750         like ImplementMethod.
7751
7752 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7753
7754         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7755         Fixed bug #65170.
7756
7757 2004-09-02  Martin Baulig  <martin@ximian.com>
7758
7759         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7760         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7761         on the MethodBase.
7762
7763 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7764
7765         C# 2.0 Static classes implemented
7766
7767         * class.cs (TypeContainer): instance_constructors,
7768         initialized_fields, initialized_static_fields,
7769         default_constructor, base_inteface_types are protected to be
7770         accessible from StaticClass.
7771         (TypeContainer.DefineDefaultConstructor): New virtual method
7772         for custom default constructor generating
7773         (StaticClass): New class to handle "Static classes" feature.
7774
7775         * cs-parser.jay: Handle static keyword on class like instance
7776         of StaticClass.
7777
7778         * driver.cs: Added "/langversion" command line switch with two
7779         options (iso-1, default).
7780
7781 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7782
7783         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7784
7785 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7786
7787         * delegate.cs: Style.
7788
7789 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7790
7791         * delegate.cs: Add seperate instance expr field for miguel.
7792
7793 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7794
7795         * PointerArithmetic (Resolve): make sure we are not doing
7796         pointer arith on void*. Also, make sure we are resolved
7797         by not setting eclass until resolve.
7798
7799         All callers: Make sure that PointerArithmetic gets resolved.
7800
7801 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7802
7803         * ArrayCreation (LookupType): If the type does not resolve 
7804         to an array, give an error.
7805
7806 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7807
7808         * statement.cs (Try.Resolve): Fixed bug #64222
7809
7810 2004-08-27  Martin Baulig  <martin@ximian.com>
7811
7812         * class.cs
7813         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7814         crash here.     
7815
7816 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7817
7818         * ecore.cs (Constantify): Get underlying type via
7819         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7820         Windows in special cases.
7821
7822 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7823
7824         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7825         for obtaining also private methods.
7826         (GetRemoveMethod): Used GetRemoveMethod (true)
7827         for obtaining also private methods.
7828
7829 2004-08-24  Martin Baulig  <martin@ximian.com>
7830
7831         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7832         MethodAttributes.HideBySig for operators.
7833
7834 2004-08-23  Martin Baulig  <martin@ximian.com>
7835
7836         Back to the old error reporting system :-)
7837
7838         * report.cs (Message): Removed.
7839         (Report.MessageData, ErrorData, WarningData): Removed.
7840         (Report.Error, Warning): Back to the old system.
7841
7842 2004-08-23  Martin Baulig  <martin@ximian.com>
7843
7844         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7845
7846         * class.cs (TypeContainer.ParentContainer): New public virtual
7847         method; replaces the explicit interface implementation.
7848         (ClassPart.ParentContainer): Override.
7849
7850 2004-08-23  Martin Baulig  <martin@ximian.com>
7851
7852         * statement.cs (Switch): Added support for constant switches; see
7853         #59428 or test-285.cs.
7854
7855 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7856
7857         Fixed bug #62740.
7858         * statement.cs (GetEnumeratorFilter): Removed useless
7859         logic because C# specs is strict. GetEnumerator must be
7860         public.
7861
7862 2004-08-22  Martin Baulig  <martin@ximian.com>
7863
7864         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7865         a switch and may break, reset the barrier.  Fixes #59867.
7866
7867 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7868
7869         CLS-Compliance speed up (~5% for corlib)
7870
7871         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7872         New method. Tests container for CLS-Compliant names
7873
7874         * class.cs (TypeContainer.VerifyClsName): New method.
7875         Checks whether container name is CLS Compliant.
7876         (Constructor): Implements IMethodData.
7877
7878         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7879         low-case table for CLS Compliance test.
7880         (MemberCache.VerifyClsParameterConflict): New method.
7881         Checks method parameters for CS3006 error.
7882
7883         * enum.cs (EnumMember): Is derived from MemberCore.
7884         (Enum.VerifyClsName): Optimized for better performance.
7885
7886 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7887
7888         * report.cs: Renamed Error_T to Error and changed all
7889         references.
7890
7891 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7892
7893         * class.cs (TypeContainer.IndexerArrayList): New inner class
7894         container for indexers.
7895         (TypeContainer.DefaultIndexerName): New constant for default
7896         indexer name. Replaced all "Item" with this constant.
7897         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7898
7899         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7900         DefaultMemberAttribute constructor.
7901
7902 2004-08-05  Martin Baulig  <martin@ximian.com>
7903
7904         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7905         Fix bug #59429.
7906
7907 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7908
7909         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7910         multi platforms problem.
7911
7912         * compiler.csproj: Included shared files.
7913
7914 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7915
7916         Fix bug 60333, 55971 in the more general way
7917         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7918         Added arg_type argument for constant conversion.
7919         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7920
7921 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7922
7923         Fix bug #59760
7924         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7925         OperatorArrayList, MethodCoreArrayList for typecontainer
7926         containers. Changed class member types to these new types.
7927         (MethodArrayList.DefineMembers): Added test for CS0659.
7928
7929 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7930
7931         * cfold.cs: Synchronize the folding with the code in expression.cs
7932         Binary.DoNumericPromotions for uint operands.
7933
7934         * attribute.cs: Revert patch from Raja, it introduced a regression
7935         while building Blam-1.2.1 (hard to isolate a test case).
7936
7937 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7938
7939         Fix for #55382
7940         * class.cs:
7941         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7942         name collision.
7943         (MethodCore.parent_method): New member. The method we're overriding
7944         if this is an override method.
7945         (MethodCore.CheckBase): Moved from Method class and made common.
7946         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7947         private.
7948         (MethodCore.CheckForDuplications): New abstract method. For custom
7949         member duplication search in a container
7950         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7951         method and its return type.
7952         (Event.conflict_symbol): New member. Symbol with same name in the
7953         parent class.
7954
7955         * decl.cs:
7956         (MemberCache.FindMemberWithSameName): New method. The method
7957         is looking for conflict with inherited symbols.
7958
7959 2004-08-04  Martin Baulig  <martin@ximian.com>
7960
7961         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7962
7963         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7964
7965 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7966
7967         * report.cs (Message): New enum for better error, warning reference in
7968         the code.
7969         (MessageData): New inner abstract class. It generally handles printing of
7970         error and warning messages.
7971         Removed unused Error, Warning, Message methods.
7972
7973 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7974
7975         Fix for cs0592-8.cs test
7976         * attribute.cs
7977         (Attributable.ValidAttributeTargets): Made public.
7978         (Attribute.ExplicitTarget): New member for explicit target value.
7979         (Attribute.CheckTargets): Now we translate explicit attribute
7980         target to Target here.
7981
7982 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7983
7984         * ecore.cs (MethodGroupExpr): new IsBase property.
7985
7986         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7987
7988         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7989         rather than an instance expr.
7990
7991         (DelegateCreation.Emit): Use the method group rather than
7992         the instance expression. Also, if you have base.Foo as the
7993         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7994
7995         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7996
7997         (NewDelegate.DoResolve): Only check for the existance of Invoke
7998         if the method is going to be needed. Use MethodGroupExpr.
7999
8000         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8001
8002         * expression.cs: For pointer arith., make sure to use
8003         the size of the type, not the size of the pointer to
8004         the type.
8005
8006 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8007
8008         Fix for #60722
8009         * class.cs (Class): Added error CS0502 test.
8010
8011 2004-08-03  John Luke  <jluke@cfl.rr.com>
8012             Raja R Harinath  <rharinath@novell.com>
8013
8014         Fix for #60997.
8015         * attribute.cs (Attribute.complained_before): New flag.
8016         (Attribute.ResolveType, Attribute.Resolve),
8017         (Attribute.DefinePInvokeMethod): Set it.
8018         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8019         
8020 2004-08-03  Martin Baulig  <martin@ximian.com>
8021
8022         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8023         use a user-defined operator; we still need to do numeric
8024         promotions in case one argument is a builtin type and the other
8025         one has an implicit conversion to that type.  Fixes #62322.
8026
8027 2004-08-02  Martin Baulig  <martin@ximian.com>
8028
8029         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8030         (LocalInfo.IsThis): New public property.
8031         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8032
8033 2004-08-01  Martin Baulig  <martin@ximian.com>
8034
8035         * class.cs (TypeContainer.GetClassBases): Don't set the default
8036         here since we may get called from GetPartialBases().
8037         (TypeContainer.DefineType): If GetClassBases() didn't return a
8038         parent, use the default one.
8039
8040 2004-07-30  Duncan Mak  <duncan@ximian.com>
8041
8042         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8043
8044 2004-07-30  Martin Baulig  <martin@ximian.com>
8045
8046         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8047
8048         * class.cs (SourceMethod): New public class, derive from the
8049         symbol writer's ISourceMethod.
8050         (Method): Use the new symbol writer API.
8051
8052         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8053         as argument and use the new symbol writer.
8054
8055         * location.cs
8056         (SourceFile): Implement the symbol writer's ISourceFile.
8057         (Location.SymbolDocument): Removed.
8058         (Location.SourceFile): New public property.
8059
8060         * symbolwriter.cs: Use the new symbol writer API.
8061
8062 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8063
8064         * Makefile (install-local): Remove.  Functionality moved to
8065         executable.make.
8066
8067 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8068
8069         * Makefile: Install mcs.exe.config file together with mcs.exe.
8070         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8071         correct runtime version.
8072         
8073 2004-07-25  Martin Baulig  <martin@ximian.com>
8074
8075         * class.cs
8076         (TypeContainer.RegisterOrder): Removed, this was unused.
8077         (TypeContainer, interface_order): Removed.
8078         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8079         TypeContainer as argument since we can also be called with a
8080         `PartialContainer' for a partial class/struct/interface.
8081         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8082         of checking whether we're an `Interface' - we could be a
8083         `PartialContainer'.
8084         (PartialContainer.Register): Override; call
8085         AddClass()/AddStruct()/AddInterface() on our parent.
8086
8087         * cs-parser.jay (interface_member_declaration): Add things to the
8088         `current_container', not the `current_class'.
8089
8090         * rootcontext.cs (RegisterOrder): The overloaded version which
8091         takes an `Interface' was unused, removed.
8092
8093         * typemanager.cs (TypeManager.LookupInterface): Return a
8094         `TypeContainer', not an `Interface'.
8095         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8096         contain a `PartialContainer' for an interface, so check it's
8097         `Kind' to figure out what it is.
8098
8099 2004-07-25  Martin Baulig  <martin@ximian.com>
8100
8101         * class.cs (Class.DefaultTypeAttributes): New public constant.
8102         (Struct.DefaultTypeAttributes): Likewise.
8103         (Interface.DefaultTypeAttributes): Likewise.
8104         (PartialContainer.TypeAttr): Override this and add the
8105         DefaultTypeAttributes.
8106
8107 2004-07-25  Martin Baulig  <martin@ximian.com>
8108
8109         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8110         we can just use the `Parent' field instead.
8111
8112 2004-07-25  Martin Baulig  <martin@ximian.com>
8113
8114         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8115
8116 2004-07-25  Martin Baulig  <martin@ximian.com>
8117
8118         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8119         our parts before defining any methods.
8120         (TypeContainer.VerifyImplements): Make this virtual.
8121         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8122         on our PartialContainer.
8123
8124 2004-07-25  Martin Baulig  <martin@ximian.com>
8125
8126         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8127
8128         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8129         argument, we can just use the `Parent' field instead.
8130
8131         * class.cs
8132         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8133         (MemberBase.DoDefine): Likewise.
8134
8135 2004-07-24  Martin Baulig  <martin@ximian.com>
8136
8137         * decl.cs (MemberCore.Parent): New public field.
8138         (DeclSpace.Parent): Moved to MemberCore.
8139
8140         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8141         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8142         parent's .ctor.
8143         (FieldBase, Field, Operator): Likewise.
8144         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8145         (EventField, Event): Likewise.
8146
8147 2004-07-23  Martin Baulig  <martin@ximian.com>
8148
8149         * class.cs (PartialContainer): New public class.
8150         (ClassPart): New public class.
8151         (TypeContainer): Added support for partial classes.
8152         (TypeContainer.GetClassBases): Splitted some of the functionality
8153         out into GetNormalBases() and GetPartialBases().
8154
8155         * cs-tokenizer.cs (Token.PARTIAL): New token.
8156         (Tokenizer.consume_identifier): Added some hacks to recognize
8157         `partial', but only if it's immediately followed by `class',
8158         `struct' or `interface'.
8159
8160         * cs-parser.jay: Added support for partial clases.
8161
8162 2004-07-23  Martin Baulig  <martin@ximian.com>
8163
8164         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8165         a `DeclSpace' and also made it readonly.
8166         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8167         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8168         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8169
8170         * cs-parser.jay: Pass the `current_class', not the
8171         `current_container' (at the moment, this is still the same thing)
8172         to a new Method, Property, Event, Indexer or Constructor.
8173
8174 2004-07-23  Martin Baulig  <martin@ximian.com>
8175
8176         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8177         and removed the `current_interface' one.
8178         (struct_declaration, class_declaration, interface_declaration):
8179         Set `current_class' to the newly created class/struct/interface;
8180         set their `Bases' and call Register() before parsing their body.
8181
8182 2004-07-23  Martin Baulig  <martin@ximian.com>
8183
8184         * class.cs (Kind): New public enum.
8185         (TypeContainer): Made this class abstract.
8186         (TypeContainer.Kind): New public readonly field.
8187         (TypeContainer.CheckDef): New public method; moved here from
8188         cs-parser.jay.
8189         (TypeContainer.Register): New public abstract method.
8190         (TypeContainer.GetPendingImplementations): New public abstract
8191         method.
8192         (TypeContainer.GetClassBases): Removed the `is_class' and
8193         `is_iface' parameters.
8194         (TypeContainer.DefineNestedTypes): Formerly known as
8195         DoDefineType().
8196         (ClassOrStruct): Made this class abstract.
8197
8198         * tree.cs (RootTypes): New public type. 
8199
8200 2004-07-20  Martin Baulig  <martin@ximian.com>
8201
8202         * tree.cs (Tree.RecordNamespace): Removed.
8203         (Tree.Namespaces): Removed.
8204
8205         * rootcontext.cs (RootContext.IsNamespace): Removed.
8206
8207         * cs-parser.jay (namespace_declaration): Just create a new
8208         NamespaceEntry here.
8209
8210 2004-07-20  Martin Baulig  <martin@ximian.com>
8211
8212         * statement.cs (ExceptionStatement): New abstract class.  This is
8213         now used as a base class for everyone who's using `finally'.
8214         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8215         our local variables before using them.
8216
8217         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8218         virtual method.  This is used by Yield.Resolve() to "steal" an
8219         outer block's `finally' clauses.
8220         (FlowBranchingException): The .ctor now takes an ExceptionStatement
8221         argument.
8222
8223         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8224         version which takes an ExceptionStatement.  This version must be
8225         used to create exception branchings.
8226
8227         * iterator.cs
8228         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8229         (Iterator.EmitMoveNext): Added exception support; protect the
8230         block with a `fault' clause, properly handle 'finally' clauses.
8231         (Iterator.EmitDispose): Run all the `finally' clauses here.
8232
8233 2004-07-20  Martin Baulig  <martin@ximian.com>
8234
8235         * iterator.cs: This is the first of a set of changes in the
8236         iterator code.  Match the spec more closely: if we're an
8237         IEnumerable, then GetEnumerator() must be called.  The first time
8238         GetEnumerator() is called, it returns the current instance; all
8239         subsequent invocations (if any) must create a copy.
8240
8241 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
8242
8243         * expression.cs: Resolve the constant expression before returning
8244         it. 
8245
8246 2004-07-19  Martin Baulig  <martin@ximian.com>
8247
8248         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8249         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8250         the return type of the new EmitContext.
8251
8252 2004-07-18  Martin Baulig  <martin@ximian.com>
8253
8254         * class.cs (Property.Define): Fix iterators.
8255
8256         * iterators.cs (Iterator.Define): Moved the
8257         `container.AddInterator (this)' call here from the .ctor; only do
8258         it if we resolved successfully.
8259
8260 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
8261
8262         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8263         `true' for preprocessing directives that we parse.  The return
8264         value indicates whether we should return to regular tokenizing or
8265         not, not whether it was parsed successfully.
8266
8267         In the past if we were in: #if false ... #line #endif, we would
8268         resume parsing after `#line'.  See bug 61604.
8269
8270         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8271         building: IsEnumType should return true only for enums, not for
8272         enums or System.Enum itself.  This fixes #61593.
8273
8274         Likely what happened is that corlib was wrong: mcs depended on
8275         this bug in some places.  The bug got fixed, we had to add the
8276         hack, which caused bug 61593.
8277
8278         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8279         that was a workaround for the older conditions.
8280
8281 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
8282
8283         * assign.cs: IAssignMethod has a new interface, as documented
8284         inline. All assignment code now uses this new api.
8285
8286         * ecore.cs, expression.cs: All classes which implement
8287         IAssignMethod now use the new interface.
8288
8289         * expression.cs (Invocation): add a hack to EmitCall so that
8290         IndexerAccess can be the target of a compound assignment without
8291         evaluating its arguments twice.
8292
8293         * statement.cs: Handle changes in Invocation api.
8294
8295 2004-07-16  Martin Baulig  <martin@ximian.com>
8296
8297         * iterators.cs: Rewrote this.  We're now using one single Proxy
8298         class for both the IEnumerable and the IEnumerator interface and
8299         `Iterator' derives from Class so we can use the high-level API.
8300
8301         * class.cs (TypeContainer.AddIterator): New method.
8302         (TypeContainer.DoDefineType): New protected virtual method, which
8303         is called from DefineType().
8304         (TypeContainer.DoDefineMembers): Call DefineType() and
8305         DefineMembers() on all our iterators.
8306         (TypeContainer.Emit): Call Emit() on all our iterators.
8307         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8308
8309         * codegen.cs (EmitContext.CurrentIterator): New public field.
8310
8311 2004-07-15  Martin Baulig  <martin@ximian.com>
8312
8313         * typemanager.cs
8314         (TypeManager.not_supported_exception_type): New type.   
8315
8316 2004-07-14  Martin Baulig  <martin@ximian.com>
8317
8318         * iterators.cs: Use real error numbers.
8319
8320 2004-07-14  Martin Baulig  <martin@ximian.com>
8321
8322         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8323         requires this to be a System.Collection.IEnumerable and not a
8324         class implementing that interface.
8325         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8326
8327 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8328
8329         * class.cs: Fixed previous fix, it broke some error tests.
8330
8331 2004-07-12  Martin Baulig  <martin@ximian.com>
8332
8333         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8334         Fixes #61293.
8335
8336 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8337
8338         * assign.cs (LocalTemporary): Add new argument: is_address,If
8339         `is_address' is true, then the value that we store is the address
8340         to the real value, and not the value itself.
8341         
8342         * ecore.cs (PropertyExpr): use the new local temporary
8343         stuff to allow us to handle X.Y += z (where X is a struct)
8344
8345 2004-07-08  Martin Baulig  <martin@ximian.com>
8346
8347         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8348         not always return, just like we're doing in Using.Resolve().
8349
8350 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8351
8352         * cs-parser.jay (fixed_statement): flag this as Pinned.
8353
8354 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8355
8356         * typemanager.cs (TypeManager): Removed MakePinned method, this
8357         mechanism is replaced with the .NET 2.x compatible mechanism of
8358         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8359
8360         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8361         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8362         `IsFixed' property which has a different meaning.
8363
8364 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8365
8366         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8367         visible from inside a nested class, not just the names of the
8368         immediately enclosing class.
8369         Fix for bug #60730.
8370
8371 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8372
8373         * expression.cs (BetterConversion): Remove buggy special-case
8374         handling of "implicit constant expression conversions".  At this
8375         point, we already know that the conversion is possible -- we're
8376         only checking to see which is better.
8377
8378 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8379
8380         * cs-parser.jay: Added error CS0210 test.
8381
8382 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8383
8384         * cs-parser.jay: Added error CS0134 test.
8385
8386 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8387
8388         Fix bug #52507
8389         * cs-parser.jay: Added error CS0145 test.
8390
8391 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8392
8393         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8394
8395 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8396         
8397         * expression.cs (StackAlloc.Resolve): The argument may not
8398         be a constant; deal with this case.
8399         
8400 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8401
8402         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8403         GetIndexerAttributeValue.
8404         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8405
8406         * class.cs (Indexer.Define): Added error tests for CS0415,
8407         CS0609.
8408
8409 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8410
8411         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8412         property code.
8413
8414 2004-06-23  Martin Baulig  <martin@ximian.com>
8415
8416         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8417         neither return nor throw, reset the barrier as well.  Fixes #60457.
8418
8419 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8420
8421         * class.cs : EventAttributes is now set to None by default.
8422           This fixes bug #60459.
8423
8424 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8425
8426         Fix bug #60219
8427         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8428         Don't throw exception but return null (it's sufficient now).
8429
8430 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8431
8432         * typemanager.cs (GetArgumentTypes): Faster implementation.
8433
8434 2004-06-18  Martin Baulig  <martin@ximian.com>
8435
8436         * attribute.cs (Attribute.Resolve): Check whether we're an
8437         EmptyCast which a Constant child.  Fixes #60333.
8438
8439 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8440
8441         * statement.cs (EmitCollectionForeach): Account for the fact that
8442         not all valuetypes are in areas which we can take the address of.
8443         For these variables, we store to a temporary variable. Also, make
8444         sure that we dont emit a `callvirt' on a valuetype method.
8445
8446 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8447
8448         * expression.cs (StackAlloc.DoReSolve): Added test for
8449         negative parameter (CS0247).
8450
8451 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8452
8453         Fix bug #59792
8454         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8455
8456 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8457
8458         Fix bug #59781
8459         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8460         ulong.
8461
8462 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8463
8464         Fix bug #58254 & cs1555.cs, cs1556.cs
8465         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8466
8467 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8468
8469         * cs-parser.jay: Added error CS1669 test for indexers.
8470
8471 2004-06-11  Martin Baulig  <martin@ximian.com>
8472
8473         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8474         call this twice: for params and varargs methods.
8475
8476 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8477
8478         * class.cs:
8479         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8480
8481 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8482
8483         * attribute.cs (Attribute.GetValidTargets): Made public.
8484
8485         * class.cs: 
8486         (AbstractPropertyEventMethod): New class for better code sharing.
8487         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8488         CS1667 report.
8489         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8490
8491 2004-06-11  Raja R Harinath  <rharinath@novell.com>
8492
8493         Fix bug #59477.
8494         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8495         that the call to Resolve is part of a MemberAccess.
8496         (Expression.Resolve): Use it for SimpleName resolution.
8497         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8498         Add 'intermediate' boolean argument.
8499         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
8500         error message when the SimpleName can be resolved ambiguously
8501         between an expression and a type.
8502         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8503         public.
8504         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8505         call on the left-side.
8506
8507 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8508
8509         * class.cs:
8510         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8511
8512 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8513
8514         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8515
8516 2004-06-11  Martin Baulig  <martin@ximian.com>
8517
8518         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8519         varargs methods if applicable.
8520
8521 2004-06-11  Martin Baulig  <martin@ximian.com>
8522
8523         * expression.cs (Invocation.EmitCall): Don't use
8524         `method.CallingConvention == CallingConventions.VarArgs' since the
8525         method could also have `CallingConventions.HasThis'.
8526
8527 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8528
8529         * class.cs (Event.GetSignatureForError): Implemented.
8530         Fixed crash in error test cs3010.cs
8531
8532 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
8533
8534         * cs-tokenizer.cs: Change the way we track __arglist to be
8535         consistent with the other keywords.
8536
8537 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
8538
8539         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8540         tomorrow.
8541
8542 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
8543
8544         * codegen.cs: Check that all referenced assemblies have a strongname
8545         before strongnaming the compiled assembly. If not report error CS1577.
8546         Fix bug #56563. Patch by Jackson Harper.
8547         * typemanager.cs: Added a method to return all referenced assemblies.
8548         Fix bug #56563. Patch by Jackson Harper.
8549
8550 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8551
8552         * class.cs:
8553         (Method.ApplyAttributeBuilder): Moved and added conditional
8554         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8555
8556         * delegate.cs:
8557         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8558
8559 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8560
8561         Fixed #59640
8562         * class.cs: (EventField.attribute_targets): Changed default target.
8563
8564 2004-06-08  Martin Baulig  <martin@ximian.com>
8565
8566         * expression.cs (Invocation.EmitCall): Enable varargs methods.
8567
8568 2004-06-08  Martin Baulig  <martin@ximian.com>
8569
8570         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8571
8572 2004-06-07  Martin Baulig  <martin@ximian.com>
8573
8574         Added support for varargs methods.
8575
8576         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8577         keyword.
8578
8579         * cs-parser.jay: Added support for `__arglist'.
8580
8581         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8582
8583         * expression.cs (Argument.AType): Added `ArgList'.
8584         (Invocation): Added support for varargs methods.
8585         (ArglistAccess): New public class.
8586         (Arglist): New public class.
8587
8588         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8589
8590         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
8591         a method's top-level block if the method has varargs.
8592
8593         * support.cs (ReflectionParameters, InternalParameters): Added
8594         support for varargs methods.    
8595
8596 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
8597
8598         * class.cs: Provide location in indexer error report.
8599
8600         * driver.cs: Use standard names.
8601
8602         * namespace.cs: Catch the use of using after a namespace has been
8603         declared also on using aliases.
8604
8605 2004-06-03  Raja R Harinath  <rharinath@novell.com>
8606
8607         Bug #50820.
8608         * typemanager.cs (closure_private_ok, closure_invocation_type)
8609         (closure_qualifier_type, closure_invocation_assembly)
8610         (FilterWithClosure): Move to ...
8611         (Closure): New internal nested class.
8612         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8613         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8614         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8615         (MemberLookup, MemberLookupFailed): Use it.
8616         * expression.cs (New.DoResolve): Treat the lookup for the
8617         constructor as being qualified by the 'new'ed type.
8618         (Indexers.GetIndexersForTypeOrInterface): Update.
8619
8620 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
8621
8622         * attribute.cs
8623         (GetConditionalAttributeValue): New method. Returns
8624         condition of ConditionalAttribute.
8625         (SearchMulti): New method.  Returns all attributes of type 't'.
8626         Use it when attribute is AllowMultiple = true.
8627         (IsConditionalMethodExcluded): New method.
8628
8629         * class.cs
8630         (Method.IsExcluded): Implemented. Returns true if method has conditional
8631         attribute and the conditions is not defined (method is excluded).
8632         (IMethodData): Extended interface for ConditionalAttribute support.
8633         (PropertyMethod.IsExcluded): Implemented.
8634
8635         * decl.cs
8636         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8637
8638         * expression.cs
8639         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8640         on the method.
8641
8642 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8643
8644         * expression.cs (ArrayCreationExpression): Make this just an
8645         `expression'. It can't be a statement, so the code here was
8646         dead.
8647
8648 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8649
8650         Fixed #59072
8651         * typemanager.cs (GetFullNameSignature): New method for
8652         MethodBase types.
8653
8654 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8655
8656         Fixed #56452
8657         * class.cs (MemberBase.GetSignatureForError): New virtual method.
8658         Use this method when MethodBuilder is null.
8659         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8660         Added test for error CS0626 (MONO reports error for this situation).
8661         (IMethodData.GetSignatureForError): Extended interface.
8662
8663 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8664
8665         * attribute.cs
8666         (AttributeTester.GetObsoleteAttribute): Returns instance of
8667         ObsoleteAttribute when type is obsolete.
8668
8669         * class.cs
8670         (TypeContainer.VerifyObsoleteAttribute): Override.
8671         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8672         (MethodCode.VerifyObsoleteAttribute): Override.
8673         (MemberBase.VerifyObsoleteAttribute): Override.
8674
8675         * decl.cs
8676         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8677         and report proper error.
8678
8679         *delegate.cs
8680         Delegate.VerifyObsoleteAttribute): Override.
8681
8682         * ecore.cs
8683         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8684         and report proper error.
8685         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8686
8687         * enum.cs
8688         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8689         and enum member.
8690
8691         * expression.cs
8692         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8693         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8694         Added test for ObsoleteAttribute.
8695
8696         * statement.cs
8697         (Catch): Derived from Statement.
8698
8699 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8700  
8701         Fixed bug #59071 & cs0160.cs
8702  
8703         * statement.cs (Try.Resolve): Check here whether order of catch
8704         clauses matches their dependencies.
8705
8706 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
8707
8708         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
8709         caused a regression: #59343.  Referencing nested classes from an
8710         assembly stopped working.
8711
8712 2004-05-31  Martin Baulig  <martin@ximian.com>
8713
8714         MCS is now frozen for beta 2.
8715
8716 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8717
8718         * convert.cs: add a trivial cache for overload operator resolution.
8719
8720 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8721
8722         * decl.cs: If possible, use lookuptypedirect here. We can only do
8723         this if there is no `.' after the namespace. Avoids using
8724         LookupType, which does lots of slow processing.
8725         (FindNestedType) New method, does what it says :-).
8726         * namespace.cs: use LookupTypeDirect.
8727         * rootcontext.cs: use membercache, if possible.
8728         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8729
8730 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8731
8732         * expression.cs:
8733         According to the spec, 
8734
8735         In a member access of the form E.I, if E is a single identifier,
8736         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8737         field, property, localvariable, or parameter with the same type as
8738         the meaning of E as a type-name (§3.8), then both possible
8739         meanings of E are permitted.
8740
8741         We did not check that E as a simple-name had the same type as E as
8742         a type name.
8743
8744         This trivial check gives us 5-7% on bootstrap time.
8745
8746 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8747
8748         * expression.cs (Invocation.OverloadResolve): Avoid the
8749         use of hashtables and boxing here by allocating on demand.
8750
8751 2004-05-30  Martin Baulig  <martin@ximian.com>
8752
8753         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8754         we're doing a silent lookup.  Don't try to lookup nested types in
8755         TypeManager.object_type (thanks to Ben Maurer).
8756
8757 2004-05-30  Martin Baulig  <martin@ximian.com>
8758
8759         Committing a patch from Ben Maurer.
8760
8761         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8762
8763 2004-05-29  Martin Baulig  <martin@ximian.com>
8764
8765         * class.cs (IMethodData.ShouldIgnore): New method.
8766
8767         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8768         `Location' argument, we don't need it anywhere.  Use
8769         `IMethodData.ShouldIgnore ()' instead of
8770         `MethodData.GetMethodFlags ()'.
8771         (TypeManager.AddMethod): Removed.
8772         (TypeManager.AddMethod2): Renamed to AddMethod.
8773
8774 2004-05-29  Martin Baulig  <martin@ximian.com>
8775
8776         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8777
8778         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8779         converting from a class type S to an interface type and we already
8780         have an object on the stack, don't box it again.  Fixes #52578.
8781
8782 2004-05-29  Martin Baulig  <martin@ximian.com>
8783
8784         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8785         Added support for `params' parameters.  Fixes #59267.
8786
8787 2004-05-29  Martin Baulig  <martin@ximian.com>
8788
8789         * literal.cs (NullPointer): Provide a private .ctor which sets
8790         `type' to TypeManager.object_type.  Fixes #59048.
8791
8792 2004-05-29  Martin Baulig  <martin@ximian.com>
8793
8794         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8795         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8796
8797         * ecore.cs (EventExpr.instance_expr): Make the field private.
8798
8799 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8800
8801         Fixed bug #50080 & cs0214-2.cs
8802         * expression.cs (Cast.DoResolve): Check unsafe context here.
8803         
8804         * statement.cs (Resolve.DoResolve): Likewise.
8805
8806 2004-05-26  Martin Baulig  <martin@ximian.com>
8807
8808         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8809
8810         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8811         (RootContext.LookupType): Pass down the `silent' flag.
8812
8813 2004-05-25  Martin Baulig  <martin@ximian.com>
8814
8815         * expression.cs
8816         (MethodGroupExpr.IdenticalTypeName): New public property.
8817         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8818         expression actually refers to a type.
8819
8820 2004-05-25  Martin Baulig  <martin@ximian.com>
8821
8822         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8823         for #56176 and made it actually work.
8824
8825 2004-05-25  Martin Baulig  <martin@ximian.com>
8826
8827         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8828         (FieldExpr, PropertyExpr): Override and implement
8829         CacheTemporaries.  Fixes #52279.
8830
8831 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8832
8833         * location.cs: In the new compiler listing a file twice is a
8834         warning, not an error.
8835
8836 2004-05-24  Martin Baulig  <martin@ximian.com>
8837
8838         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8839         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8840
8841 2004-05-24  Martin Baulig  <martin@ximian.com>
8842
8843         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8844         walking the `using' list.  Fixes #53921.
8845
8846 2004-05-24  Martin Baulig  <martin@ximian.com>
8847
8848         * const.cs (Const.LookupConstantValue): Added support for
8849         EmptyCast's; fixes #55251.
8850
8851 2004-05-24  Martin Baulig  <martin@ximian.com>
8852
8853         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8854         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8855         which does the CS0135 check.  The reason is that we first need to
8856         check whether the variable actually exists.
8857
8858 2004-05-24  Martin Baulig  <martin@ximian.com>
8859
8860         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8861         than RootContext.LookupType() to find the explicit interface
8862         type.  Fixes #58584.
8863
8864 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8865
8866         * Makefile: Simplify.  Use executable.make.
8867         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8868
8869 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8870
8871         * decl.cs:
8872         * enum.cs:
8873         Use the invariant culture when doing String.Compare for CLS case
8874         sensitivity.
8875         
8876 2004-05-23  Martin Baulig  <martin@ximian.com>
8877
8878         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8879         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8880
8881         * namespace.cs (NamespaceEntry.Lookup): Likewise.
8882         
8883 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8884
8885         * class.cs (MemberBase.Define): Reuse MemberType member for 
8886         resolved type. Other methods can use it too.
8887
8888 2004-05-23  Martin Baulig  <martin@ximian.com>
8889
8890         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8891         the variable also exists in the current block (otherwise, we need
8892         to report a CS0103).  Fixes #58670.
8893
8894 2004-05-23  Martin Baulig  <martin@ximian.com>
8895
8896         * flowanalysis.cs (Reachability.Reachable): Compute this
8897         on-the-fly rather than storing it as a field.
8898
8899 2004-05-23  Martin Baulig  <martin@ximian.com>
8900
8901         * flowanalysis.cs (Reachability.And): Manually compute the
8902         resulting `barrier' from the reachability.      
8903        
8904 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8905
8906         Fix bug #57835
8907         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8908         instance of ObsoleteAttribute when symbol is obsolete.
8909
8910         * class.cs
8911         (IMethodData): Extended interface for ObsoleteAttribute support.
8912
8913 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8914
8915         * attribute.cs: Fix bug #55970
8916
8917 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8918
8919         Fix bug #52705
8920         * attribute.cs
8921         (GetObsoleteAttribute): New method. Creates the instance of
8922         ObsoleteAttribute.
8923         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8924         ObsoleteAttribute when member is obsolete.
8925         (AttributeTester.Report_ObsoleteMessage): Common method for
8926         Obsolete error/warning reporting.
8927
8928         * class.cs
8929         (TypeContainer.base_classs_type): New member for storing parent type.
8930
8931         * decl.cs
8932         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8933         for this MemberCore.
8934
8935 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8936
8937         * attribute.cs, const.cs: Fix bug #58590
8938
8939 2004-05-21  Martin Baulig  <martin@ximian.com>
8940
8941         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8942         out parameters if the end of the method is unreachable.  Fixes
8943         #58098. 
8944
8945 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8946
8947         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8948         Hari was right, why extra method.
8949
8950 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8951
8952         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8953
8954 2004-05-20  Martin Baulig  <martin@ximian.com>
8955
8956         Merged this back from gmcs to keep the differences to a minumum.
8957
8958         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8959         instead of a Declspace.
8960         (Attribute.ResolveType): Likewise.
8961         (Attributes.Search): Likewise.
8962         (Attributes.Contains): Likewise.
8963         (Attributes.GetClsCompliantAttribute): Likewise.
8964
8965         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8966         argument.
8967         (MethodData.ApplyAttributes): Take an EmitContext instead of a
8968         DeclSpace.
8969
8970 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8971
8972         Fix bug #58688 (MCS does not report error when the same attribute
8973         is assigned twice)
8974
8975         * attribute.cs (Attribute.Emit): Distinction between null and default.
8976
8977 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8978
8979         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8980         of a top-level attribute without an attribute target.
8981         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8982         Make non-static.
8983         (Attribute.Conditional_GetConditionName), 
8984         (Attribute.Obsolete_GetObsoleteMessage): Update.
8985         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8986         part of ScanForIndexerName.
8987         (Attribute.CanIgnoreInvalidAttribute): New function.
8988         (Attribute.ScanForIndexerName): Move to ...
8989         (Attributes.ScanForIndexerName): ... here.
8990         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8991         (Attributes.Search): New internal variant that can choose not to
8992         complain if types aren't resolved.  The original signature now
8993         complains.
8994         (Attributes.GetClsCompliantAttribute): Use internal variant, with
8995         complaints suppressed.
8996         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8997         only if it not useful.
8998         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8999         top-level for attributes that are shared between the assembly
9000         and a top-level class.
9001         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9002         * class.cs: Update to reflect changes.
9003         (DefineIndexers): Fuse loops.
9004         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9005         a couple more variants of attribute names.
9006
9007 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9008
9009         Fix bug #52585 (Implemented explicit attribute declaration)
9010
9011         * attribute.cs:
9012         (Attributable.ValidAttributeTargets): New abstract method. It gets
9013         list of valid attribute targets for explicit target declaration.
9014         (Attribute.Target): It holds target itself.
9015         (AttributeSection): Removed.
9016         (Attribute.CheckTargets): New method. It checks whether attribute
9017         target is valid for the current element.
9018
9019         * class.cs:
9020         (EventProperty): New class. For events that are declared like
9021         property (with add and remove accessors).
9022         (EventField): New class. For events that are declared like field.
9023         class.cs
9024
9025         * cs-parser.jay: Implemented explicit attribute target declaration.
9026
9027         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9028         Override ValidAttributeTargets.
9029
9030         * parameter.cs:
9031         (ReturnParameter): Class for applying custom attributes on 
9032         the return type.
9033         (ParameterAtribute): New class. Class for applying custom
9034         attributes on the parameter type.
9035
9036 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9037
9038         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9039         definitions. 
9040
9041         (Method): Allow UNSAFE here.
9042
9043         * modifiers.cs: Support unsafe reporting.
9044
9045 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9046
9047         * decl.cs: Fix bug #58478.
9048
9049 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9050
9051         * statement.cs: When checking for unreachable code on an EmptyStatement,
9052         set the location. Fixes bug #58488.
9053
9054 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9055
9056         * driver.cs: Add -pkg handling.
9057
9058         From Gonzalo: UseShelLExecute=false
9059
9060 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9061
9062         * attribute.cs:
9063         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9064         for attribute.
9065         (Attribute.IsClsCompliaceRequired): Moved to base for better
9066         accesibility.
9067         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9068         when attribute is AttributeUsageAttribute.
9069         (Attribute.GetValidTargets): Simplified.
9070         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9071         attribute for this type.
9072         (Attribute.ApplyAttributes): Method renamed to Emit and make
9073         non-static.
9074         (GlobalAttributeSection): New class for special handling of global
9075         attributes (assembly, module).
9076         (AttributeSection.Emit): New method.
9077
9078         * class.cs: Implemented Attributable abstract methods.
9079         (MethodCore.LabelParameters): Moved to Parameter class.
9080         (Accessor): Is back simple class.
9081         (PropertyMethod): Implemented Attributable abstract class.
9082         (DelegateMethod): Implemented Attributable abstract class.
9083         (Event): New constructor for disctintion between normal Event
9084         and Event with accessors.
9085
9086         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9087
9088         * codegen.cs, const.cs, decl.cs, delegate.cs:
9089         (CommonAssemblyModulClass): Implemented Attributable abstract class
9090         and simplified.
9091
9092         * enum.cs: Implement IAttributeSupport interface.
9093         (EnumMember): New class for emum members. Implemented Attributable
9094         abstract class
9095
9096         * parameter.cs:
9097         (ParameterBase): Is abstract.
9098         (ReturnParameter): New class for easier [return:] attribute handling.
9099
9100         * typemanager.cs: Removed builder_to_attr.
9101
9102 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9103
9104         Fix bug #57151.
9105         * attribute.cs (Attribute.GetPositionalValue): New function.
9106         * class.cs (TypeContainer.VerifyMembers): New function.
9107         (TypeContainer.Emit): Use it.
9108         (ClassOrStruct): New base class for Class and Struct.
9109         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9110         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9111         class.
9112         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9113         then each non-static field should have a FieldOffset attribute.
9114         Otherwise, none of the fields should have a FieldOffset attribute.
9115         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9116         and FieldOffset attributes.
9117         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9118         (TypeManager.field_offset_attribute_type): New core types.
9119         (TypeManager.InitCoreTypes): Initialize them.
9120
9121 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9122
9123         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9124         Return correct type.
9125         From bug #58270.
9126
9127 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9128
9129         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9130         be implicitly converted to ulong.
9131         
9132         * expression.cs: The logic for allowing operator &, | and ^ worked
9133         was wrong, it worked before because we did not report an error in
9134         an else branch.  Fixes 57895.
9135
9136         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9137         allow volatile fields to be reference types.
9138
9139 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9140
9141         * driver.cs: Add support for /debug-
9142
9143 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9144
9145         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9146         Add a 'complain' parameter to silence errors.
9147         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9148         silently overlooked type-resolutions.
9149         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9150         to reflect changes.
9151         (Attributes.Search): New function.
9152         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9153         (Attributes.GetAttributeFullName): Remove hack.
9154         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9155         Update to reflect changes.
9156         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9157         Use Attributes.Search instead of nested loops.
9158
9159 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9160
9161         * decl.cs:
9162         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9163         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9164         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9165
9166         * report.cs: (Report.Warning): Renamed to Warning_T because of
9167         parameter collision.
9168
9169 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9170
9171         * expression.cs (MemberAccess.ResolveMemberAccess):
9172         Exit with non-zero status after Report.Error.
9173         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9174         Likewise.
9175         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9176
9177 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9178
9179         * support.cs: Don't hang when the file is empty.
9180
9181 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9182
9183         * support.cs: In SeekableStreamReader, compute the preamble size of the
9184           underlying stream. Position changes should take into account that initial
9185           count of bytes.
9186
9187 2004-05-03  Todd Berman  <tberman@sevenl.net>
9188
9189         * driver.cs: remove unused GetSysVersion function.
9190
9191 2004-05-03  Todd Berman  <tberman@sevenl.net>
9192
9193         * driver.cs: Remove the hack from saturday, as well as the hack
9194         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9195         link_paths to get that bit proper.
9196
9197 2004-05-01  Todd Berman  <tberman@sevenl.net>
9198
9199         * driver.cs: Try a LoadFrom before a Load, this checks the current
9200         path. This is currently a bug in mono that is be fixed, however, this
9201         provides a workaround for now. This will be removed when the bug
9202         is fixed.
9203
9204 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9205
9206         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9207         incomplete key pairs (#57941).
9208
9209 2004-05-01  Todd Berman  <tberman@sevenl.net>
9210
9211         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9212         from the GAC
9213
9214 2004-04-30  Jackson Harper  <jackson@ximian.com>
9215
9216         * codegen.cs: Open keys readonly.
9217         
9218 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9219
9220         * typemanager.cs: don't report cyclic struct layout when a struct
9221         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9222         which has 2 Pango.Rectangle fields.
9223
9224 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9225
9226         * expression.cs: Handle IntPtr comparisons with IL code
9227         rather than a method call.
9228
9229 2004-04-29  Martin Baulig  <martin@ximian.com>
9230
9231         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9232         the list of PropertyInfo's in class hierarchy and find the
9233         accessor.  Fixes #56013.
9234
9235 2004-04-29  Martin Baulig  <martin@ximian.com>
9236
9237         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9238
9239 2004-04-29  Martin Baulig  <martin@ximian.com>
9240
9241         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9242
9243         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9244
9245 2004-04-29  Martin Baulig  <martin@ximian.com>
9246
9247         * class.cs (ConstructorInitializer.Resolve): Check whether the
9248         parent .ctor is accessible.  Fixes #52146.
9249
9250 2004-04-29  Martin Baulig  <martin@ximian.com>
9251
9252         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9253
9254         * statement.cs (Using.EmitLocalVariableDecls): Use
9255         TypeManager.idisposable_type, not typeof (IDisposable).
9256         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9257
9258 2004-04-29  Martin Baulig  <martin@ximian.com>
9259
9260         * class.cs (Event.Define): Don't emit the field and don't set
9261         RTSpecialName and SpecialName for events on interfaces.  Fixes
9262         #57703. 
9263
9264 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9265
9266         Refactor Attribute.ApplyAttributes.
9267         * attribute.cs (Attributable): New base class for objects that can
9268         have Attributes applied on them.
9269         (Attribute): Make AttributeUsage fields public.
9270         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9271         (Attribute.IsInternalCall): New property.
9272         (Attribute.UsageAttr): Convert to a public read-only property.
9273         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9274         (Attribute.ResolveType, Attribute.Resolve)
9275         (Attribute.ScanForIndexerName): Update to reflect changes.
9276         (Attribute.CheckAttributeTarget): Re-format.
9277         (Attribute.ApplyAttributes): Refactor, to various
9278         Attributable.ApplyAttributeBuilder methods.
9279         * decl.cs (MemberCore): Make Attributable.
9280         * class.cs (Accessor): Make Attributable.
9281         (MethodData.ApplyAttributes): Use proper attribute types, not
9282         attribute names.
9283         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9284         (TypeContainer.ApplyAttributeBuilder)
9285         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9286         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9287         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9288         (Operator.ApplyAttributeBuilder): New factored-out methods.
9289         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9290         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9291         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9292         * parameter.cs (ParameterBase): New Attributable base class
9293         that can also represent Return types.
9294         (Parameter): Update to the changes.
9295
9296 2004-04-29  Jackson Harper  <jackson@ximian.com>
9297
9298         * driver.cs: Prefer the corlib system version when looking for
9299         assemblies in the GAC. This is still a hack, but its a better hack
9300         now.
9301         
9302 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9303
9304         * decl.cs, enum.cs: Improved error 3005 reporting.
9305   
9306         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9307         (related_symbols): New private member for list of symbols
9308         related to reported error/warning.
9309         
9310         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9311
9312 2004-04-29  Martin Baulig  <martin@ximian.com>
9313
9314         * ecore.cs (Expression.Constantify): If we're an enum and
9315         TypeManager.TypeToCoreType() doesn't give us another type, use
9316         t.UnderlyingSystemType.  Fixes #56178.  
9317
9318 2004-04-29  Martin Baulig  <martin@ximian.com>
9319
9320         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9321         interfaces and for each interface, only add members directly
9322         declared in that interface.  Fixes #53255.
9323
9324 2004-04-28  Martin Baulig  <martin@ximian.com>
9325
9326         * expression.cs (ConditionalLogicalOperator): Use a temporary
9327         variable for `left' to avoid that we evaluate it more than once;
9328         bug #52588.
9329
9330 2004-04-28  Martin Baulig  <martin@ximian.com>
9331
9332         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9333         `void[]' (CS1547).
9334
9335 2004-04-28  Martin Baulig  <martin@ximian.com>
9336
9337         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9338         void (CS1547).
9339
9340         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9341         whether the type is not void (CS1547).
9342
9343 2004-04-28  Martin Baulig  <martin@ximian.com>
9344
9345         * expression.cs (Unary.DoResolveLValue): Override this and report
9346         CS0131 for anything but Operator.Indirection.
9347
9348 2004-04-28  Martin Baulig  <martin@ximian.com>
9349
9350         Committing a patch from Ben Maurer; see bug #50820.
9351
9352         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9353         check for classes.
9354
9355         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9356         classes.        
9357
9358 2004-04-28  Martin Baulig  <martin@ximian.com>
9359
9360         Committing a patch from Ben Maurer; see bug #50820.
9361
9362         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9363         check for classes.
9364
9365         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9366         classes.        
9367
9368 2004-04-28  Martin Baulig  <martin@ximian.com>
9369
9370         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9371         (Block.AddLabel): Call DoLookupLabel() to only search in the
9372         current block.
9373
9374 2004-04-28  Martin Baulig  <martin@ximian.com>
9375
9376         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9377         comparing StringConstants and NullLiterals in Equality and Inequality.
9378
9379 2004-04-28  Jackson Harper  <jackson@ximian.com>
9380
9381         * driver.cs: Attempt to load referenced assemblies from the
9382         GAC. This is the quick and dirty version of this method that
9383         doesnt take into account versions and just takes the first
9384         canidate found. Will be good enough for now as we will not have more
9385         then one version installed into the GAC until I update this method.
9386
9387 2004-04-28  Martin Baulig  <martin@ximian.com>
9388
9389         * typemanager.cs (TypeManager.CheckStructCycles): New public
9390         static method to check for cycles in the struct layout.
9391
9392         * rootcontext.cs (RootContext.PopulateTypes): Call
9393         TypeManager.CheckStructCycles() for each TypeContainer.
9394         [Note: We only need to visit each type once.]
9395
9396 2004-04-28  Martin Baulig  <martin@ximian.com>
9397
9398         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9399
9400         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9401         success and added `out object value'.  Use a `bool resolved' field
9402         to check whether we've already been called rather than
9403         `ConstantValue != null' since this breaks for NullLiterals.
9404
9405 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9406
9407         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9408         setting of this flag, since the 'set' method may be non-public.
9409
9410 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9411
9412         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9413         check on current_vector.Block.
9414
9415 2004-04-27  Martin Baulig  <martin@ximian.com>
9416
9417         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9418         a field initializer.  Fixes #56459.
9419
9420 2004-04-27  Martin Baulig  <martin@ximian.com>
9421
9422         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9423         we're not attempting to use an indexer.  Fixes #52154.
9424
9425 2004-04-27  Martin Baulig  <martin@ximian.com>
9426
9427         * statement.cs (Return): Don't create a return label if we don't
9428         need it; reverts my change from January 20th.  Thanks to Ben
9429         Maurer for this.
9430
9431 2004-04-27  Martin Baulig  <martin@ximian.com>
9432
9433         According to the spec, `goto' can only leave a nested scope, but
9434         never enter it.
9435
9436         * statement.cs (Block.LookupLabel): Only lookup in the current
9437         block, don't recurse into parent or child blocks.
9438         (Block.AddLabel): Check in parent and child blocks, report
9439         CS0140/CS0158 if we find a duplicate.
9440         (Block): Removed this indexer for label lookups.
9441         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9442         this already does the error reporting for us.
9443
9444         * flowanalysis.cs
9445         (FlowBranching.UsageVector.Block): New public variable; may be null.
9446         (FlowBranching.CreateSibling): Added `Block' argument.
9447         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9448         label for the target of a `goto' and check whether we're not
9449         leaving a `finally'.
9450
9451 2004-04-27  Martin Baulig  <martin@ximian.com>
9452
9453         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9454         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9455         just for returns).
9456
9457 2004-04-27  Martin Baulig  <martin@ximian.com>
9458
9459         * statement.cs (Block.AddLabel): Also check for implicit blocks
9460         and added a CS0158 check.
9461
9462 2004-04-27  Martin Baulig  <martin@ximian.com>
9463
9464         * flowanalysis.cs (FlowBranchingLoop): New class.
9465         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9466         UsageVector's instead of an ArrayList.
9467         (FlowBranching.Label): Likewise.
9468         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9469         (FlowBranching.AddBreakVector): New method.
9470
9471 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9472
9473         * attribute.cs: Small regression fix: only convert the type if we
9474         the type is different, fixes System.Drawing build.
9475
9476 2004-04-27  Martin Baulig  <martin@ximian.com>
9477
9478         * attribute.cs (Attribute.Resolve): If we have a constant value
9479         for a named field or property, implicity convert it to the correct
9480         type.
9481
9482 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9483
9484         * statement.cs (Block.Block): Implicit blocks share
9485         'child_variable_names' fields with parent blocks.
9486         (Block.AddChildVariableNames): Remove.
9487         (Block.AddVariable): Mark variable as "used by a child block" in
9488         every surrounding block.
9489         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9490         been used in a child block, complain about violation of "Invariant
9491         meaning in blocks" rule.
9492         * cs-parser.jay (declare_local_variables): Don't use
9493         AddChildVariableNames.
9494         (foreach_statement): Don't create an implicit block: 'foreach'
9495         introduces a scope.
9496
9497 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9498
9499         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9500         converting from 0L to ulong.  Fixes 57522.
9501
9502 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9503
9504         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9505         derived class hides via 'new' keyword field from base class (test-242.cs).
9506         TODO: Handle this in the more general way.
9507         
9508         * class.cs (CheckBase): Ditto.
9509
9510 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9511
9512         * decl.cs (caching_flags): New member for storing cached values
9513         as bit flags.
9514         (MemberCore.Flags): New enum where bit flags for caching_flags
9515         are defined.
9516         (MemberCore.cls_compliance): Moved to caching_flags.
9517         (DeclSpace.Created): Moved to caching_flags.
9518
9519         * class.cs: Use caching_flags instead of DeclSpace.Created
9520         
9521 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9522
9523         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9524         if we are only a derived class, not a nested class.
9525
9526         * typemanager.cs: Same as above, but do this at the MemberLookup
9527         level (used by field and methods, properties are handled in
9528         PropertyExpr).   Allow for the qualified access if we are a nested
9529         method. 
9530
9531 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9532
9533         * class.cs: Refactoring.
9534         (IMethodData): New inteface; Holds links to parent members
9535         to avoid member duplication (reduced memory allocation).
9536         (Method): Implemented IMethodData interface.
9537         (PropertyBase): New inner classes for get/set methods.
9538         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9539         (Event): New inner classes for add/remove methods.
9540         (Event.DelegateMethod): Implemented IMethodData interface.
9541
9542         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9543         EmitContext (related to class.cs refactoring).
9544
9545 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9546
9547         * delegate.cs (Delegate.VerifyApplicability): If the number of
9548         arguments are the same as the number of parameters, first try to
9549         verify applicability ignoring  any 'params' modifier on the last
9550         parameter.
9551         Fixes #56442.
9552
9553 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9554
9555         * class.cs (TypeContainer.AddIndexer): Use
9556         'ExplicitInterfaceName' to determine if interface name was
9557         explicitly specified.  'InterfaceType' is not initialized at this time.
9558         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9559         Indexers array is already in the required order.  Initialize
9560         'IndexerName' only if there are normal indexers.
9561         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9562         (TypeContainer.Emit): Emit DefaultMember attribute only if
9563         IndexerName is initialized.
9564         Fixes #56300.
9565
9566 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9567
9568         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9569         Fixes #57007
9570
9571 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9572
9573         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9574         attributes.
9575         Fix for #56456.
9576
9577         * attribute.cs (Attribute.Resolve): Check for duplicate named
9578         attributes.
9579         Fix for #56463.
9580
9581 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9582
9583         * iterators.cs (MarkYield): track whether we are in an exception,
9584         and generate code accordingly.  Use a temporary value to store the
9585         result for our state.
9586
9587         I had ignored a bit the interaction of try/catch with iterators
9588         since their behavior was not entirely obvious, but now it is
9589         possible to verify that our behavior is the same as MS .NET 2.0
9590
9591         Fixes 54814
9592
9593 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9594
9595         * iterators.cs: Avoid creating temporaries if there is no work to
9596         do. 
9597
9598         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9599         Enumerations, use TypeManager.EnumToUnderlying and call
9600         recursively. 
9601
9602         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9603         bug #57013
9604
9605         (This.Emit): Use EmitContext.EmitThis to emit our
9606         instance variable.
9607
9608         (This.EmitAssign): Ditto.
9609
9610         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9611         codepaths, we will move all the functionality into
9612         Mono.CSharp.This 
9613
9614         (FieldExpr.EmitAssign): Ditto.
9615
9616         This fixes several hidden bugs that I uncovered while doing a code
9617         review of this today.
9618
9619         * codegen.cs (EmitThis): reworked so the semantics are more clear
9620         and also support value types "this" instances.
9621
9622         * iterators.cs: Changed so that for iterators in value types, we
9623         do not pass the value type as a parameter.  
9624
9625         Initialization of the enumerator helpers is now done in the caller
9626         instead of passing the parameters to the constructors and having
9627         the constructor set the fields.
9628
9629         The fields have now `assembly' visibility instead of private.
9630
9631 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9632
9633         * expression.cs (Argument.Resolve): Check if fields passed as ref
9634         or out are contained in a MarshalByRefObject.
9635
9636         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9637         another compiler type.
9638
9639 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9640
9641         * class.cs (Indexer.Define): use the new name checking method.
9642         Also, return false on an error.
9643         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9644         (is_identifier_[start/part]_character): make static.
9645
9646 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9647
9648         * expression.cs (Binary.ResolveOperator): Do no append strings
9649         twice: since we can be invoked more than once (array evaluation)
9650         on the same concatenation, take care of this here.  Based on a fix
9651         from Ben (bug #56454)
9652
9653 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9654
9655         * codegen.cs: Fix another case where CS1548 must be reported (when 
9656         delay-sign isn't specified and no private is available #56564). Fix
9657         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9658         error when MCS is used on the MS runtime and we need to delay-sign 
9659         (which seems unsupported by AssemblyBuilder - see #56621).
9660
9661 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9662
9663         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9664         (TypeManager.ComputeNamespaces): Faster implementation for
9665         Microsoft runtime.
9666
9667         * compiler.csproj: Updated AssemblyName to mcs.
9668
9669 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9670
9671         * rootcontext.cs: Add new types to the boot resolution.
9672
9673         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9674         MulticastDelegate is not allowed.
9675
9676         * typemanager.cs: Add new types to lookup: System.TypedReference
9677         and ArgIterator.
9678
9679         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9680         check for TypedReference or ArgIterator, they are not allowed. 
9681
9682         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9683         makes us properly catch 1510 in some conditions (see bug 56016 for
9684         details). 
9685
9686 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9687
9688         * CryptoConvert.cs: update from corlib version
9689         with endian fixes.
9690
9691 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9692
9693         * class.cs (Indexer.Define): Check indexername declaration
9694
9695 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9696
9697         * attribute.cs (IsClsCompliant): Fixed problem with handling
9698         all three states (compliant, not-compliant, undetected).
9699
9700 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9701
9702         * attribute.cs (Attribute): Location is now public.
9703         (Resolve): Store resolved arguments (pos_values) in attribute class.
9704         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9705         (GetClsCompliantAttributeValue): New method that gets
9706         CLSCompliantAttribute value.
9707         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9708         if exists else null.
9709         (AttributeTester): New class for CLS-Compliant verification routines.
9710
9711         * class.cs (Emit): Add CLS-Compliant verification.
9712         (Method.GetSignatureForError): Implemented.
9713         (Constructor.GetSignatureForError): Implemented
9714         (Constructor.HasCompliantArgs): Returns if constructor has
9715         CLS-Compliant arguments.
9716         (Constructor.Emit): Override.
9717         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9718         is needed to test only parameters.
9719         (FieldBase.GetSignatureForError): Implemented.
9720         (TypeContainer): New member for storing base interfaces.
9721         (TypeContainer.FindMembers): Search in base interfaces too.
9722
9723         * codegen.cs (GetClsComplianceAttribute): New method that gets
9724         assembly or module CLSCompliantAttribute value.
9725         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9726         for assembly.
9727         (ModuleClass.Emit): Add error 3012 test.
9728
9729         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9730
9731         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9732         state for all decl types.
9733         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9734         if CLS-Compliant tests are required.
9735         (IsClsCompliaceRequired): New method. Analyze whether code
9736         must be CLS-Compliant.
9737         (IsExposedFromAssembly): New method. Returns true when MemberCore
9738         is exposed from assembly.
9739         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9740         value or gets cached value.
9741         (HasClsCompliantAttribute): New method. Returns true if MemberCore
9742         is explicitly marked with CLSCompliantAttribute.
9743         (IsIdentifierClsCompliant): New abstract method. This method is
9744         used to testing error 3005.
9745         (IsIdentifierAndParamClsCompliant): New method. Common helper method
9746         for identifier and parameters CLS-Compliant testing.
9747         (VerifyClsCompliance): New method. The main virtual method for
9748         CLS-Compliant verifications.
9749         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9750         null. I don't know why is null (too many public members !).
9751         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9752         and get value of first CLSCompliantAttribute that found.
9753
9754         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9755         (VerifyClsCompliance): Override and add extra tests.
9756
9757         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9758         clscheck- disable CLS-Compliant verification event if assembly is has
9759         CLSCompliantAttribute(true).
9760
9761         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9762         ApllyAttribute is now called in emit section as in the other cases.
9763         Possible future Emit integration.
9764         (IsIdentifierClsCompliant): New override.
9765         (VerifyClsCompliance): New override.
9766         (GetEnumeratorName): Returns full enum name.
9767
9768         * parameter.cs (GetSignatureForError): Implemented.
9769
9770         * report.cs (WarningData): New struct for Warning message information.
9771         (LocationOfPreviousError): New method.
9772         (Warning): New method. Reports warning based on the warning table.
9773         (Error_T): New method. Reports error based on the error table.
9774
9775         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9776         verifications are done here.
9777
9778         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9779
9780         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9781         CLSCompliantAttribute.
9782         (all_imported_types): New member holds all imported types from other
9783         assemblies.
9784         (LoadAllImportedTypes): New method fills static table with exported types
9785         from all referenced assemblies.
9786         (Modules): New property returns all assembly modules.
9787
9788 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
9789
9790         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9791         throwing a parser error.
9792
9793         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9794         which removes the hardcoded get_/set_ prefixes for properties, as
9795         IL allows for the properties to be named something else.  
9796
9797         Bug #56013
9798
9799         * expression.cs: Do not override operand before we know if it is
9800         non-null.  Fix 56207
9801
9802 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9803
9804         * typemanager.cs: support for pinned variables.
9805
9806 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9807
9808         * decl.cs, typemanager.cs: Avoid using an arraylist
9809         as a buffer if there is only one result set.
9810
9811 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9812
9813         * expression.cs: Make sure you cant call a static method
9814         with an instance expression, bug #56174.
9815
9816 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
9817
9818         * class.cs (IsDuplicateImplementation): Improve error reporting to
9819         flag 663 (method only differs in parameter modifier).
9820
9821         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9822         in preprocessor directives.
9823
9824         * location.cs (LookupFile): Allow for the empty path.
9825
9826         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
9827         better approach for some of that patch, but its failing with the
9828         CharSet enumeration.  For now try/catch will do.
9829
9830         * typemanager.cs: Do not crash if a struct does not have fields.
9831         Fixes 56150.
9832
9833 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9834
9835         * expression.cs: cs0213, cant fix a fixed expression.
9836         fixes 50231.
9837
9838 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9839
9840         * cs-parser.jay: detect invalid embeded statements gracefully.
9841         bug #51113.
9842
9843 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9844
9845         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9846         As a regex:
9847         s/
9848         the invocation type may not be a subclass of the tye of the item/
9849         The type of the item must be a subclass of the invocation item.
9850         /g
9851
9852         Fixes bug #50820.
9853
9854 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
9855
9856         * attribute.cs: Added methods to get a string and a bool from an
9857         attribute. Required to information from AssemblyKeyFileAttribute,
9858         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9859         * codegen.cs: Modified AssemblyName creation to include support for
9860         strongnames. Catch additional exceptions to report them as CS1548.
9861         * compiler.csproj: Updated include CryptoConvert.cs.
9862         * compiler.csproj.user: Removed file - user specific configuration.
9863         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
9864         Mono.Security assembly. The original class is maintained and tested in
9865         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9866         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9867         like CSC 8.0 (C# v2) supports.
9868         * Makefile: Added CryptoConvert.cs to mcs sources.
9869         * rootcontext.cs: Added new options for strongnames.
9870
9871 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
9872
9873         * driver.cs: For --expect-error, report error code `2'
9874         if the program compiled with no errors, error code `1' if
9875         it compiled with an error other than the one expected.
9876
9877 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
9878
9879         * compiler.csproj: Updated for Visual Studio .NET 2003.
9880         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9881         * compiler.sln: Updated for Visual Studio .NET 2003.
9882
9883 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
9884
9885         * expression.cs: Fix bug #47234. We basically need to apply the
9886         rule that we prefer the conversion of null to a reference type
9887         when faced with a conversion to 'object' (csc behaviour).
9888
9889 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9890
9891         * statement.cs: Shorter form for foreach, eliminates
9892         a local variable. r=Martin.
9893
9894 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9895
9896         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9897         checks if we can use brtrue/brfalse to test for 0.
9898         * expression.cs: use the above in the test for using brtrue/brfalse.
9899         cleanup code a bit.
9900
9901 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9902
9903         * expression.cs: Rewrite string concat stuff. Benefits:
9904
9905         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9906         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9907         rather than a concat chain.
9908
9909         * typemanager.cs: Add lookups for more concat overloads.
9910
9911 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9912
9913         * expression.cs: Emit shorter il code for array init.
9914
9915         newarr
9916         dup
9917         // set 1
9918
9919         // set 2
9920
9921         newarr
9922         stloc.x
9923
9924         ldloc.x
9925         // set 1
9926
9927         ldloc.x
9928         // set 2
9929
9930 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
9931
9932         * statement.cs: Before, two switch blocks would be merged if the
9933         total size of the blocks (end_item - begin_item + 1) was less than
9934         two times the combined sizes of the blocks.
9935
9936         Now, it will only merge if after the merge at least half of the
9937         slots are filled.
9938
9939         fixes 55885.
9940
9941 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
9942
9943         * class.cs : csc build fix for GetMethods(). See bug #52503.
9944
9945 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
9946
9947         * expression.cs: Make sure fp comparisons work with NaN.
9948         This fixes bug #54303. Mig approved this patch a long
9949         time ago, but we were not able to test b/c the runtime
9950         had a related bug.
9951
9952 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
9953
9954         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
9955
9956 2004-03-19  Martin Baulig  <martin@ximian.com>
9957
9958         * class.cs (MemberCore.IsDuplicateImplementation): Report the
9959         error here and not in our caller.
9960
9961 2004-03-19  Martin Baulig  <martin@ximian.com>
9962
9963         * interface.cs: Completely killed this file.
9964         (Interface): We're now a TypeContainer and live in class.cs.
9965
9966         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9967         argument; we're now also called for interfaces.
9968         (TypeContainer.DefineMembers): Allow this method being called
9969         multiple times.
9970         (TypeContainer.GetMethods): New public method; formerly known as
9971         Interface.GetMethod().  This is used by PendingImplementation.
9972         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9973         it's now private and non-static.
9974         (Interface): Moved this here; it's now implemented similar to
9975         Class and Struct.
9976         (Method, Property, Event, Indexer): Added `bool is_interface'
9977         argument to their .ctor's.
9978         (MemberBase.IsInterface): New public field.
9979
9980         * cs-parser.jay: Create normal Method, Property, Event, Indexer
9981         instances instead of InterfaceMethod, InterfaceProperty, etc.
9982         (opt_interface_base): Removed; we now use `opt_class_base' instead.
9983         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9984
9985 2004-03-19  Martin Baulig  <martin@ximian.com>
9986
9987         * class.cs (MethodCore.IsDuplicateImplementation): New private
9988         method which does the CS0111 checking.
9989         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9990         Use IsDuplicateImplementation().
9991
9992 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9993
9994         * decl.cs (FindMemberToOverride): New method to find the correct
9995         method or property to override in the base class.
9996         * class.cs
9997             - Make Method/Property use the above method to find the
9998               version in the base class.
9999             - Remove the InheritableMemberSignatureCompare as it is now
10000               dead code.
10001
10002         This patch makes large code bases much faster to compile, as it is
10003         O(n) rather than O(n^2) to do this validation.
10004
10005         Also, it fixes bug 52458 which is that nested classes are not
10006         taken into account when finding the base class member.
10007
10008         Reviewed/Approved by Martin.
10009
10010 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10011
10012         * interface.cs: In all interface classes removed redundant
10013         member initialization.
10014
10015 2004-03-16  Martin Baulig  <martin@ximian.com>
10016
10017         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10018
10019 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10020
10021         * decl.cs (DefineTypeAndParents): New helper method to define a
10022         type's containers before the type itself is defined;  This is a
10023         bug exposed by the recent changes to Windows.Forms when an
10024         implemented interface was defined inside a class that had not been
10025         built yet.   
10026
10027         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10028
10029         (Check): Loop correctly to report errors modifiers
10030         (UNSAFE was not in the loop, since it was the same as TOP).
10031
10032         * interface.cs: Every interface member now takes a ModFlags,
10033         instead of a "is_new" bool, which we set on the base MemberCore. 
10034
10035         Every place where we called "UnsafeOk" in the interface, now we
10036         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10037         the unsafe settings from the member declaration instead of the
10038         container interface. 
10039
10040         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10041
10042         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10043         `set_indexer_name' to the pending bits (one per type).
10044
10045         We fixed a bug today that was picking the wrong method to
10046         override, since for properties the existing InterfaceMethod code
10047         basically ignored the method name.  Now we make sure that the
10048         method name is one of the valid indexer names.
10049
10050 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10051  
10052         * support.cs (SeekableStreamReader): Keep track of stream byte
10053         positions and don't mix them with character offsets to the buffer.
10054
10055         Patch from Gustavo Giráldez
10056
10057 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10058
10059         * interface.cs (InterfaceSetGetBase): Removed double member
10060         initialization, base class does it as well.
10061
10062 2004-03-13  Martin Baulig  <martin@ximian.com>
10063
10064         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10065         when compiling corlib.
10066
10067 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10068
10069         * convert.cs (ExplicitConversion): We were reporting an error on
10070         certain conversions (object_type source to a value type, when the
10071         expression was `null') before we had a chance to pass it through
10072         the user defined conversions.
10073
10074         * driver.cs: Replace / and \ in resource specifications to dots.
10075         Fixes 50752
10076
10077         * class.cs: Add check for duplicate operators.  Fixes 52477
10078
10079 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10080
10081         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10082         that are in the middle of the statements, not only at the end.
10083         Fixes #54987
10084
10085         * class.cs (TypeContainer.AddField): No longer set the
10086         `HaveStaticConstructor' flag, now we call it
10087         `UserDefineStaticConstructor' to diferentiate the slightly
10088         semantic difference.
10089
10090         The situation is that we were not adding BeforeFieldInit (from
10091         Modifiers.TypeAttr) to classes that could have it.
10092         BeforeFieldInit should be set to classes that have no static
10093         constructor. 
10094
10095         See:
10096
10097         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10098
10099         And most importantly Zoltan's comment:
10100
10101         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10102
10103         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10104          before its static fields are used', i.e. initialization does not need
10105          to be triggered by the first access to the type. Setting this flag
10106          helps the JIT to compile better code, since it can run the static
10107          constructor at JIT time, and does not need to generate code to call it
10108          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10109          this flag for lots of classes like String. 
10110          
10111          csc sets this flag if the type does not have an explicit static 
10112          constructor. The reasoning seems to be that if there are only static
10113          initalizers for a type, and no static constructor, then the programmer
10114          does not care when this initialization happens, so beforefieldinit
10115          can be used.
10116          
10117          This bug prevents the AOT compiler from being usable, since it 
10118          generates so many calls to mono_runtime_class_init that the AOT code
10119          is much slower than the JITted code. The JITted code is faster, 
10120          because it does not generate these calls if the vtable is type is
10121          already initialized, which is true in the majority of cases. But the
10122          AOT compiler can't do this."
10123
10124 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10125
10126         * class.cs (MethodData.Emit): Refactor the code so symbolic
10127         information is generated for destructors;  For some reasons we
10128         were taking a code path that did not generate symbolic information
10129         before. 
10130
10131 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10132
10133         * class.cs: Create a Constructor.CheckBase method that
10134         takes care of all validation type code. The method
10135         contains some code that was moved from Define.
10136
10137         It also includes new code that checks for duplicate ctors.
10138         This fixes bug #55148.
10139
10140 2004-03-09  Joshua Tauberer <tauberer@for.net>
10141
10142         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10143         a { ... }-style array creation invokes EmitStaticInitializers
10144         which is not good for reference-type arrays.  String, decimal
10145         and now null constants (NullCast) are not counted toward
10146         static initializers.
10147
10148 2004-03-05  Martin Baulig  <martin@ximian.com>
10149
10150         * location.cs (SourceFile.HasLineDirective): New public field;
10151         specifies whether the file contains or is referenced by a "#line"
10152         directive.
10153         (Location.DefineSymbolDocuments): Ignore source files which
10154         either contain or are referenced by a "#line" directive.        
10155
10156 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10157
10158         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10159         direct access to our parent, so check the method inline there.
10160
10161 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10162
10163         * expression.cs (Invocation.EmitCall): Miguel's last commit
10164         caused a regression. If you had:
10165
10166             T t = null;
10167             t.Foo ();
10168
10169         In Foo the implict this would be null.
10170
10171 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10172
10173         * expression.cs (Invocation.EmitCall): If the method is not
10174         virtual, do not emit a CallVirt to it, use Call.
10175
10176         * typemanager.cs (GetFullNameSignature): Improve the method to
10177         cope with ".ctor" and replace it with the type name.
10178
10179         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10180         as an argument the ConstructorBuilder where it is being defined,
10181         to catch the recursive constructor invocations.
10182
10183 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10184
10185         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10186         routines to check if a type is an enumerable/enumerator allow
10187         classes that implement the IEnumerable or IEnumerator interfaces.
10188
10189         * class.cs (Property, Operator): Implement IIteratorContainer, and
10190         implement SetYields.
10191
10192         (Property.Define): Do the block swapping for get_methods in the
10193         context of iterators.   We need to check if Properties also
10194         include indexers or not.
10195
10196         (Operator): Assign the Block before invoking the
10197         OperatorMethod.Define, so we can trigger the Iterator code
10198         replacement. 
10199
10200         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10201         Property and Operator classes are not created when we parse the
10202         declarator but until we have the block completed, so we use a
10203         singleton SimpleIteratorContainer.Simple to flag whether the
10204         SetYields has been invoked.
10205
10206         We propagate this setting then to the Property or the Operator to
10207         allow the `yield' to function.
10208
10209 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10210
10211         * codegen.cs: Implemented attribute support for modules.
10212         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10213         Assembly/Module functionality.
10214
10215         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10216         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10217         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10218
10219 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10220
10221         * interface.cs (FindMembers): The operation is performed on all base
10222         interfaces and not only on the first. It is required for future CLS Compliance patch.
10223
10224 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10225
10226         * statement.cs, codegen.cs:
10227         This patch deals with patterns such as:
10228
10229         public class List : IEnumerable {
10230
10231                 public MyEnumerator GetEnumerator () {
10232                         return new MyEnumerator(this);
10233                 }
10234
10235                 IEnumerator IEnumerable.GetEnumerator () {
10236                         ...
10237                 }
10238                 
10239                 public struct MyEnumerator : IEnumerator {
10240                         ...
10241                 }
10242         }
10243
10244         Before, there were a few things we did wrong:
10245         1) we would emit callvirt on a struct, which is illegal
10246         2) we emited ldarg when we needed to emit ldarga
10247         3) we would mistakenly call the interface methods on an enumerator
10248         type that derived from IEnumerator and was in another assembly. For example:
10249
10250         public class MyEnumerator : IEnumerator
10251
10252         Would have the interface methods called, even if there were public impls of the
10253         method. In a struct, this lead to invalid IL code.
10254
10255 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10256
10257         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10258           renamed to Emit.
10259
10260         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10261
10262 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10263
10264         * cs-parser.jay: Fix small regression: we were not testing V2
10265         compiler features correctly.
10266
10267         * interface.cs: If the emit context is null, then create one
10268
10269 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10270
10271         * decl.cs (GetSignatureForError): New virtual method to get full name
10272           for error messages.
10273
10274         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10275           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10276
10277         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10278           Duplicated members and code in these classes has been removed.
10279           Better encapsulation in these classes.
10280
10281 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10282
10283         * assign.cs (Assign.DoResolve): When dealing with compound
10284         assignments, there is a new rule in ECMA C# 2.4 (might have been
10285         there before, but it is documented here) that states that in:
10286
10287         a op= b;
10288
10289         If b is of type int, and the `op' is a shift-operator, then the
10290         above is evaluated as:
10291
10292         a = (int) a op b 
10293
10294         * expression.cs (Binary.ResolveOperator): Instead of testing for
10295         int/uint/long/ulong, try to implicitly convert to any of those
10296         types and use that in pointer arithmetic.
10297
10298         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10299         method to print information for from the type, not from the
10300         null-method we were given.
10301
10302 2004-02-01  Duncan Mak  <duncan@ximian.com>
10303
10304         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10305         parsing for cmd, fixes bug #53694.
10306
10307 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10308
10309         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10310         in the member name duplication tests. Property and operator name duplication
10311         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10312
10313 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10314
10315         * interface.cs (PopulateMethod): Fixed crash when interface method
10316         returns not existing type (error test cs0246-3.cs).
10317
10318 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10319
10320         * cs-parser.jay (interface_accessors): Re-write actions to also
10321         store attributes attached to get and set methods. Fix spelling
10322         while at it.
10323
10324         (inteface_property_declaration): Modify accordingly.
10325
10326         (InterfaceAccessorInfo): New helper class to store information to pass
10327         around between rules that use interface_accessors.
10328
10329         * interface.cs (Emit): Apply attributes on the get and set
10330         accessors of properties and indexers too.
10331
10332         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10333         right MethodBuilder when applying attributes to the get and set accessors.
10334
10335 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10336
10337         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10338
10339 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10340
10341         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10342
10343 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10344
10345         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10346         changes that treat `yield' specially when present before `break'
10347         or `return' tokens.
10348
10349         * cs-tokenizer.cs: yield is no longer a keyword.
10350
10351 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10352
10353         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10354         setting for default constructors.
10355         For default constructors are almost every time set wrong Modifier. The
10356         generated IL code has been alright. But inside mcs this values was
10357         wrong and this was reason why several of my CLS Compliance tests
10358         failed.
10359
10360 2004-01-22  Martin Baulig  <martin@ximian.com>
10361
10362         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10363         not a QualifiedIdentifier.  This is what `type_name_expression'
10364         was previously doing.
10365         (type_name_expression): Removed; the code is now in
10366         `namespace_or_type_name'.
10367         (qualified_identifier): Removed, use `namespace_or_type_name'
10368         instead.
10369         (QualifiedIdentifier): Removed this class.      
10370
10371 2004-01-22  Martin Baulig  <martin@ximian.com>
10372
10373         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10374         not a string as alias name.
10375
10376 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10377
10378         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10379         #52730 bug, and instead compute correctly the need to use a
10380         temporary variable when requesting an address based on the
10381         static/instace modified of the field and the constructor.
10382  
10383 2004-01-21  Martin Baulig  <martin@ximian.com>
10384
10385         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10386         class and namespace before looking up aliases.  Fixes #52517.
10387
10388 2004-01-21  Martin Baulig  <martin@ximian.com>
10389
10390         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10391         assinged in a 'try'; fixes exception4.cs.
10392
10393 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10394         * class.cs : Implemented parameter-less constructor for TypeContainer
10395
10396         * decl.cs: Attributes are now stored here. New property OptAttributes
10397
10398         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10399
10400         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10401
10402 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10403
10404         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10405           (CSharpSignature): New method for indexer and property signature.
10406
10407 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10408
10409         * pending.cs (IsVirtualFilter): Faster implementation.
10410
10411 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10412
10413         * typemanager.cs: Avoid inclusion of same assembly more than once.
10414
10415 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10416
10417         * cs-parser.jay: Fixed problem where the last assembly attribute
10418           has been applied also to following declaration (class, struct, etc.)
10419           
10420 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10421
10422         * class.cs: Added error CS0538, CS0539 reporting.
10423         Fixed crash on Microsoft runtime when field type is void.
10424
10425         * cs-parser.jay: Added error CS0537 reporting.
10426
10427         * pending.cs: Added error CS0535 reporting.
10428         Improved error report for errors CS0536, CS0534.
10429
10430 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10431
10432         Merge a few bits from the Anonymous Method MCS tree.
10433
10434         * statement.cs (ToplevelBlock): New class for toplevel methods,
10435         will hold anonymous methods, lifted variables.
10436
10437         * cs-parser.jay: Create toplevel blocks for delegates and for
10438         regular blocks of code. 
10439
10440 2004-01-20  Martin Baulig  <martin@ximian.com>
10441
10442         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10443         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10444         and `NeedExplicitReturn'; added `IsLastStatement'.
10445         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10446         have a `ReturnLabel' or we're not unreachable.
10447
10448         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10449         child's reachability; don't just override ours with it.  Fixes
10450         #58058 (lluis's example).
10451         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10452         InFinally(), InLoop(), InSwitch() and
10453         BreakCrossesTryCatchBoundary() methods.
10454
10455         * statement.cs (Return): Do all error checking in Resolve().
10456         Unless we are the last statement in a top-level block, always
10457         create a return label and jump to it.
10458         (Break, Continue): Do all error checking in Resolve(); also make
10459         sure we aren't leaving a `finally'.
10460         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10461         statement in a top-level block.
10462         (Block.Flags): Added `IsDestructor'.
10463         (Block.IsDestructor): New public property.
10464
10465 2004-01-20  Martin Baulig  <martin@ximian.com>
10466
10467         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10468
10469 2004-01-20  Martin Baulig  <martin@ximian.com>
10470
10471         * statement.cs (Statement.ResolveUnreachable): New public method.
10472         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10473         (Block.Resolve): Resolve unreachable statements.
10474
10475 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10476
10477         * expression.cs: We need to fix the case where we do
10478         not have a temp variable here.
10479
10480         * assign.cs: Only expression compound assignments need
10481         temporary variables.
10482
10483 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10484
10485         * flowanalysis.cs: Reduce memory allocation in a few ways:
10486           - A block with no variables should not allocate a bit
10487             vector for itself.
10488           - A method with no out parameters does not need any tracking
10489             for assignment of the parameters, so we need not allocate
10490             any data for it.
10491           - The arrays:
10492                 public readonly Type[] VariableTypes;
10493                 public readonly string[] VariableNames;
10494             Are redundant. The data is already stored in the variable
10495             map, so we need not allocate another array for it.
10496           - We need to add alot of checks for if (params | locals) == null
10497             due to the first two changes.
10498
10499 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10500
10501         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10502         implement IMemoryLocation, we store a copy on a local variable and
10503         take the address of it.  Patch from Benjamin Jemlich
10504
10505         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10506         to use a special "type_name_expression" rule which reduces the
10507         number of "QualifiedIdentifier" classes created, and instead
10508         directly creates MemberAccess expressions.
10509
10510 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
10511
10512         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10513         that fixes #52853.  Null literal assignment to ValueType
10514
10515         * class.cs (MethodData.Emit): Instead of checking the name of the
10516         method to determine if its a destructor, create a new derived
10517         class from Method called Destructor, and test for that.  
10518
10519         * cs-parser.jay: Create a Destructor object instead of a Method.  
10520
10521         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10522
10523         Fixes: 52933
10524
10525 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
10526
10527         * expression.cs (Binary.ResolveOperator): Perform an implicit
10528         conversion from MethodGroups to their delegate types on the
10529         Addition operation.
10530
10531         * delegate.cs: Introduce a new class DelegateCreation that is the
10532         base class for `NewDelegate' and `ImplicitDelegateCreation',
10533         factor some code in here.
10534
10535         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10536         conversion from MethodGroups to compatible delegate types. 
10537
10538         * ecore.cs (Expression.Resolve): Do not flag error 654
10539         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10540         we allow conversions from MethodGroups to delegate types now.
10541
10542         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10543         assignments in v2 either.
10544
10545 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
10546
10547         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10548         static read-only fields in ctors.
10549
10550         Applied patch from Benjamin Jemlich 
10551
10552         * expression.cs (UnaryMutator): Avoid leaking local variables. 
10553
10554 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
10555
10556         * cs-tokenizer.cs (IsCastToken): Allow the various native types
10557         here to return true, as they can be used like this:
10558
10559                 (XXX) int.MEMBER ()
10560
10561         Fixed 49836 and all the other dups
10562
10563 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
10564
10565         * driver.cs: Implement /win32res and /win32icon.
10566
10567 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
10568
10569         * cs-parser.jay: Add a rule to improve error handling for the
10570         common mistake of placing modifiers after the type.
10571
10572 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
10573
10574         * cs-parser.jay (interface_event_declaration): Catch
10575         initialization of events on interfaces, and report cs0068
10576
10577         * cs-parser.jay (interface_event_declaration): Catch
10578         initialization of events. 
10579
10580         * ecore.cs: Better report missing constructors.
10581
10582         * expression.cs (Binary.ResolveOperator): My previous bug fix had
10583         the error reporting done in the wrong place.  Fix.
10584
10585         * expression.cs (Binary.ResolveOperator): Catch the 
10586         operator + (E x, E y) error earlier, and later allow for implicit
10587         conversions in operator +/- (E e, U x) from U to the underlying
10588         type of E.
10589
10590         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10591         52596, if the container class is abstract, the default constructor
10592         is protected otherwise its public (before, we were always public).
10593
10594         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10595         fixed statement.
10596
10597         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10598         Jemlich that fixes bug #52597, MCS was generating invalid code for
10599         idisposable structs.   Thanks to Ben for following up with this
10600         bug as well.
10601
10602 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
10603
10604         * driver.cs: Allow assemblies without code to be generated, fixes
10605         52230.
10606
10607 2004-01-07  Nick Drochak <ndrochak@gol.com>
10608
10609         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10610
10611 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
10612
10613         * cs-parser.jay: Add rules to improve error reporting if fields or
10614         methods are declared at the namespace level (error 116)
10615
10616         * Add rules to catch event add/remove
10617
10618 2004-01-04  David Sheldon <dave-mono@earth.li>
10619
10620   * expression.cs: Added matching ")" to error message for 
10621   CS0077
10622
10623 2004-01-03 Todd Berman <tberman@gentoo.org>
10624
10625         * ecore.cs, attribute.cs:
10626         Applying fix from #52429.
10627
10628 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10629
10630         * ecore.cs, expression.cs, statement.cs:
10631         Total rewrite of how we handle branching. We
10632         now handle complex boolean expressions with fewer
10633         jumps. As well if (x == 0) no longer emits a ceq.
10634
10635         if (x is Foo) is much faster now, because we generate
10636         better code.
10637
10638         Overall, we get a pretty big improvement on our benchmark
10639         tests. The code we generate is smaller and more readable.
10640
10641         I did a full two-stage bootstrap. The patch was reviewed
10642         by Martin and Miguel.
10643
10644 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10645
10646         * cs-parser.jay: Make primary_expression not take a QI.
10647         we dont need this because the member_access rule covers
10648         us here. So we replace the rule with just IDENTIFIER.
10649
10650         This has two good effects. First, we remove a s/r conflict.
10651         Second, we allocate many fewer QualifiedIdentifier objects.
10652
10653 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10654
10655         * attribute.cs: Handle MarshalAs attributes as pseudo, and
10656         set the correct information via SRE. This prevents
10657         hanging on the MS runtime. Fixes #29374.
10658
10659 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10660
10661         * convert.cs: correctly handle conversions to value types
10662         from Enum and ValueType as unboxing conversions.
10663
10664         Fixes bug #52569. Patch by Benjamin Jemlich.
10665
10666 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10667
10668         * expression.cs (BetterConversion): Prefer int -> uint
10669         over int -> ulong (csc's behaviour). This fixed bug #52046.
10670
10671 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10672
10673         * decl.cs (MemberCache.FindMembers): now returns a
10674         MemberInfo [].
10675
10676         * typemanager.cs: In general, go with with ^^.
10677         (CopyNewMethods): take an IList.
10678         (RealMemberLookup): Only allocate an arraylist
10679         if we copy from two sets of methods.
10680
10681         This change basically does two things:
10682         1) Fewer array lists allocated due to CopyNewMethods.
10683         2) the explicit cast in MemberList costed ALOT.
10684
10685 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10686
10687         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10688         a hashtable to avoid needless string allocations when an identifier is
10689         used more than once (the common case).
10690
10691 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10692
10693         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10694         is broken, it will not return anything. So, we
10695         have to use the information we have in mcs to
10696         do the task.
10697
10698         * typemanager.cs: Add a cache for GetInterfaces,
10699         since this will now be used more often (due to ^^)
10700
10701         (GetExplicitInterfaces) New method that gets the
10702         declared, not effective, interfaces on a type
10703         builder (eg, if you have interface IFoo, interface
10704         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10705         { IBar }.
10706
10707         This patch makes MCS able to bootstrap itself on
10708         Windows again.
10709
10710 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10711
10712         * expression.cs: Remove the Nop's that Miguel put
10713         in by mistake.
10714
10715 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10716
10717         * report.cs, codegen.cs: Give the real stack trace to
10718         the error when an exception is thrown.
10719
10720 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10721
10722         * decl.cs: only allocate hashtables for ifaces if 
10723         it is an iface!
10724
10725 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10726
10727         * expression.cs: fix the error from cs0121-2.cs
10728         (a parent interface has two child interfaces that
10729         have a function with the same name and 0 params
10730         and the function is called through the parent).
10731
10732 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10733
10734         * class.cs, rootcontext.cs, typmanager.cs: do not
10735         leak pointers.
10736
10737 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10738
10739         * codegen.cs: remove stack for the ec flow branching.
10740         It is already a linked list, so no need.
10741
10742 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10743
10744         * Makefile: Allow custom profiler here.
10745
10746 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10747
10748         * typemanager.cs (LookupType):
10749           - Use a static char [], because split takes
10750             a param array for args, so it was allocating
10751             every time.
10752           - Do not store true in a hashtable, it boxes.
10753
10754 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10755
10756         * flowanalysis.cs: bytify common enums.
10757
10758 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10759
10760         * modifiers.cs: Add a new set of flags for the
10761         flags allowed on explicit interface impls.
10762         * cs-parser.jay: catch the use of modifiers in
10763         interfaces correctly.
10764         * class.cs: catch private void IFoo.Blah ().
10765
10766         All related to bug #50572.
10767
10768 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10769
10770         * decl.cs: Rewrite the consistant accessability checking.
10771         Accessability is not linear, it must be implemented in
10772         a tableish way. Fixes #49704.
10773
10774 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10775
10776         * expression.cs: Handle negation in a checked context.
10777         We must use subtraction from zero. Fixes #38674.
10778
10779 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10780
10781         * class.cs: Ignore static void main in DLLs.
10782         * rootcontext.cs: Handle the target type here,
10783         since we are have to access it from class.cs
10784         * driver.cs: account for the above.
10785
10786 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10787
10788         * report.cs: Give line numbers and files if available.
10789
10790 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10791
10792         * driver.cs: Implement /addmodule.
10793
10794         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10795         ModuleBuilders.
10796
10797 2003-12-20  Martin Baulig  <martin@ximian.com>
10798
10799         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10800         (FieldBase.IsAssigned): Removed this field.
10801         (FieldBase.SetAssigned): New public method.
10802         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10803
10804 2003-12-20  Martin Baulig  <martin@ximian.com>
10805
10806         * expression.cs (LocalVariableReference.DoResolve): Don't set
10807         `vi.Used' if we're called from DoResolveLValue().
10808
10809         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10810         returns the usage vector it just merged into the current one -
10811         pass this one to UsageWarning().
10812         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10813         of the `EmitContext', don't call this recursively on our children.
10814
10815 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
10816
10817         * driver.cs: Implement /target:module.
10818
10819 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10820
10821         * support.cs (CharArrayHashtable): New helper class.
10822
10823         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
10824         char arrays, not strings, so we can avoid creating a string in
10825         consume_identifier if the identifier is a keyword.
10826
10827 2003-12-16  Martin Baulig  <martin@ximian.com>
10828
10829         * statement.cs (LocalInfo.Assigned): Removed this property.
10830         (LocalInfo.Flags): Removed `Assigned'.
10831         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10832         and uses flow analysis.
10833         (Block.UsageWarning): Made this method private.
10834         (Block.Resolve): Call UsageWarning() if appropriate.
10835
10836         * expression.cs (LocalVariableReference.DoResolve): Always set
10837         LocalInfo.Used here.
10838
10839 2003-12-13  Martin Baulig  <martin@ximian.com>
10840
10841         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10842         any value here; we're now using flow analysis to figure out
10843         whether a statement/block returns a value.
10844
10845 2003-12-13  Martin Baulig  <martin@ximian.com>
10846
10847         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10848         working again.
10849         (FlowBranching.MergeFinally): Don't call
10850         `branching.CheckOutParameters()' here, this is called in
10851         MergeTopBlock().
10852         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10853         when adding the `finally' vector.       
10854
10855 2003-12-13  Martin Baulig  <martin@ximian.com>
10856
10857         * flowanalysis.cs
10858         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10859         actually work and also fix #48962.
10860
10861 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10862
10863         * decl.cs: Do not check System.Object for nested types,
10864         since we know it does not have any. Big bang for buck:
10865
10866         BEFORE:
10867            Run 1:   8.35 seconds
10868            Run 2:   8.32 seconds
10869            corlib:  17.99 seconds
10870         AFTER:
10871            Run 1:   8.17 seconds
10872            Run 2:   8.17 seconds
10873            corlib:  17.39 seconds
10874
10875 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10876
10877         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10878         time we are returning 0 members, so we save alot here.
10879
10880 2003-12-11  Martin Baulig  <martin@ximian.com>
10881
10882         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10883         `MergeChild()', also just take the `FlowBranching' as argument;
10884         call Merge() on it and return the result.
10885         (FlowBranching.Merge): We don't need to do anything if we just
10886         have one sibling.
10887
10888 2003-12-11  Martin Baulig  <martin@ximian.com>
10889
10890         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10891         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10892         Maurer for this idea.
10893
10894 2003-12-11  Martin Baulig  <martin@ximian.com>
10895
10896         * flowanalysis.cs (MergeResult): This class is now gone; we now
10897         use the `UsageVector' for this.  The reason for this is that if a
10898         branching just has one sibling, we don't need to "merge" them at
10899         all - that's the next step to do.
10900         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10901         `MergeResult'.
10902
10903 2003-12-11  Martin Baulig  <martin@ximian.com>
10904
10905         Reworked flow analyis and made it more precise and bug-free.  The
10906         most important change is that we're now using a special `Reachability'
10907         class instead of having "magic" meanings of `FlowReturns'.  I'll
10908         do some more cleanups and optimizations and also add some more
10909         documentation this week.
10910
10911         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10912         largely reworked this class.
10913         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10914         the new `Reachability' class instead of having "magic" values here.
10915         (FlowBranching): We're now using an instance of `Reachability'
10916         instead of having separate `Returns', `Breaks' etc. fields.
10917
10918         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10919         based on flow analysis; ignore the return value of block.Emit ().
10920
10921 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10922
10923         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10924         if they are private.
10925
10926 2003-12-09  Martin Baulig  <martin@ximian.com>
10927
10928         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10929         call them directly on the UsageVector.
10930
10931 2003-12-09  Martin Baulig  <martin@ximian.com>
10932
10933         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10934         Changed return type from `FlowReturns' to `Reachability'.
10935
10936 2003-12-09  Martin Baulig  <martin@ximian.com>
10937
10938         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10939         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10940         `Reachable' fields with a single `Reachability' one.
10941
10942 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10943
10944         * class.cs (FindMembers): Remove foreach's.
10945
10946         Bootstrap times:
10947
10948         BEFORE
10949                 Run 1:   8.74 seconds
10950                 Run 2:   8.71 seconds
10951
10952         AFTER
10953                 Run 1:   8.64 seconds
10954                 Run 2:   8.58 seconds
10955
10956
10957 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10958
10959         * cs-parser.jay:
10960         * gen-treedump.cs:
10961         * statement.cs:
10962         This patch does a few things:
10963                 1. EmptyStatement is now a singleton, so it is never reallocated.
10964                 2. All blah is EmptyStatement constructs have been changed to
10965                    blah == EmptyStatement.Value, which is much faster and valid
10966                    now that EmptyStatement is a singleton.
10967                 3. When resolving a block, rather than allocating a new array for
10968                    the non-empty statements, empty statements are replaced with
10969                    EmptyStatement.Value
10970                 4. Some recursive functions have been made non-recursive.
10971         Mainly the performance impact is from (3), however (1) and (2) are needed for
10972         this to work. (4) does not make a big difference in normal situations, however
10973         it makes the profile look saner.
10974
10975         Bootstrap times:
10976
10977         BEFORE
10978         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10979         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10980         Total memory allocated: 56397 KB
10981
10982         AFTER
10983         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10984         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10985         Total memory allocated: 55666 KB
10986
10987 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10988
10989         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10990         than the hashtable in a hashtable version
10991
10992         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10993         we always end up concating a string. This results in a huge perf
10994         loss, because many strings have to be tracked by the GC. In this
10995         patch, we first use a hashtable that works with two keys, so that
10996         the strings do not need to be concat'ed.
10997
10998         Bootstrap times:
10999         BEFORE
11000                 Run 1:   8.74 seconds
11001                 Run 2:   8.71 seconds
11002
11003         AFTER
11004                 Run 1:   8.65 seconds
11005                 Run 2:   8.56 seconds
11006
11007 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11008
11009         * Makefile: Add a new target `do-time' that does a quick and simple
11010         profile, leaving easy to parse output.
11011
11012 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11013
11014         * codegen.cs (Init): Create the dynamic assembly with 
11015         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11016
11017 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11018
11019         * support.cs: Make the PtrHashtable use only one
11020         instance of its comparer.
11021
11022 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11023
11024         * typemanager.cs: Fix lookup of GetNamespaces.
11025
11026 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11027
11028         * expression.cs: Removed redundant line.
11029
11030         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11031         ArrayLists, use for loops with bounds.  
11032
11033         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11034         arraylist.
11035
11036         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11037         arraylists, use for loop with bounds.
11038
11039         The above three changes give us a 0.071 second performance
11040         improvement out of 3.294 seconds down to 3.223.  On my machine
11041         the above changes reduced the memory usage by 1,387 KB during
11042         compiler bootstrap.
11043
11044         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11045         QualifiedIdentifiers.  Before we created a new string through
11046         concatenation, and mostly later on, the result would be
11047         manipulated by DecomposeQI through string manipulation.
11048
11049         This reduced the compiler memory usage for bootstrapping from
11050         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11051         compile times in 0.05 seconds.
11052
11053 2003-11-28  Dick Porter  <dick@ximian.com>
11054
11055         * support.cs: Do string compares with the Invariant culture.
11056
11057         * rootcontext.cs: 
11058         * gen-treedump.cs: 
11059         * expression.cs: 
11060         * driver.cs: 
11061         * decl.cs: 
11062         * codegen.cs: 
11063         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11064         the comparison is done with the Invariant culture.
11065
11066 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11067
11068         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11069         GetEnumerator method.
11070
11071         (ProbeCollectionType): Iterate starting at the most specific type
11072         upwards looking for a GetEnumerator
11073
11074         * expression.cs: Shift count can be up to 31 for int/uint and 63
11075         for long/ulong.
11076
11077 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11078
11079         * statement.cs (Block.LookupLabel): Also look for the label on the
11080         children blocks.  Use a hash table to keep track of visited
11081         nodes. 
11082
11083         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11084         we actually did transform the other operand, otherwise fall back
11085         to the common codepath that casts to long.
11086
11087         * cs-tokenizer.cs: Use the same code pattern as the int case.
11088         Maybe I should do the parsing myself, and avoid depending on the
11089         Parse routines to get this done.
11090
11091 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11092
11093         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11094         which fixes bug 51347.  This time test it.
11095
11096         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11097         attributes for example can not tell the difference between these.
11098         The difference was only a syntax feature of the language. 
11099
11100         * attribute.cs: Apply attributes to delegates.
11101
11102         * delegate.cs: Call the apply attributes method.
11103
11104 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11105
11106         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11107         comparing 0 vs Byte.MinValue, not the value
11108
11109         (ImplicitConversionRequired): When reporting a conversion error,
11110         use error 31 to print out the constant error instead of the
11111         simpler 29.
11112
11113         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11114         which fixes bug 51347.
11115
11116 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11117
11118         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11119         which fixes the -warnaserror command line option.
11120
11121 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11122
11123         * cfold.cs (DoNumericPromotions): During constant folding of
11124         additions on UIntConstant, special case intconstants with
11125         IntConstants like we do on the expression binary operator. 
11126
11127 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11128
11129         * convert.cs (ImplicitReferenceConversion): We were missing a case
11130         (System.Enum are not value types or class types, so we need to
11131         classify them separatedly).
11132
11133         * driver.cs: We do not support error 2007.
11134
11135 2003-11-12 Jackson Harper <jackson@ximian.com>
11136
11137         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11138         system directory. Also use the full file name so users can
11139         libraries names mscorlib-o-tron.dll in a non system dir.
11140
11141 2003-11-10  Martin Baulig  <martin@ximian.com>
11142
11143         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11144         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11145         calling `ResolveType()' on them, directly assign their `Type'.
11146
11147 2003-11-08  Martin Baulig  <martin@ximian.com>
11148
11149         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11150         return value and the `out parent' parameter.
11151         (TypeContainer.DefineType): Moved the CS0644 check into
11152         GetClassBases().  Don't pass the interface types to the
11153         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11154         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11155
11156         * ecore.cs (TypeExpr.IsAttribute): New property.
11157         (TypeExpr.GetInterfaces): New method.
11158
11159         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11160         TypeExpr instead of a Type.
11161         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11162         (Interface.DefineType): Don't pass the interface types to the
11163         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11164         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11165
11166         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11167         instead of a `Type[]'.
11168         (TypeManager.RegisterBuilder): Likewise.
11169         (TypeManager.AddUserInterface): Likewise.
11170         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11171         `Type[]' and also return a `TypeExpr[]'.
11172         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11173
11174 2003-11-08  Martin Baulig  <martin@ximian.com>
11175
11176         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11177         Expression.     
11178
11179 2003-11-08  Martin Baulig  <martin@ximian.com>
11180
11181         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11182         TypeManager.ResolveExpressionTypes().
11183
11184         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11185         instead of an Expression.
11186         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11187         (TypeExpression): New public class; formerly known as `TypeExpr'.
11188
11189         * expression.cs (ComposedCast): Derive from TypeExpr.
11190
11191         * typemanager.cs (TypeManager.system_*_expr): These are now
11192         TypExpr's instead of Expression's.
11193         (TypeManager.ResolveExpressionTypes): New public static function;
11194         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11195         of them.        
11196
11197 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11198
11199         * expression.cs (New.DoResolve): Do not dereference value that
11200         might be a null return.
11201
11202         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11203         sure that the constant value has the right type.  Fixes an
11204         unreported bug, similar to 50425.
11205
11206         * const.cs (Const.LookupConstantValue): Call
11207         ImplicitStandardConversionExists before doing a conversion to
11208         avoid havng the TypeManager.ChangeType do conversions.
11209
11210         Reduced the number of casts used
11211
11212         (Const.ChangeType): New routine to enable reuse of the constant
11213         type changing code from statement.
11214
11215         * typemanager.cs (ChangeType): Move common initialization to
11216         static global variables.
11217
11218         Fixes #50425.
11219
11220         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11221         every value type to go through, even if it was void.  Fix that. 
11222
11223         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11224         character of the define, and the is_identifier_part_character for
11225         the rest of the string.
11226
11227 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11228
11229         * expression.cs (UnaryMutator.EmitCode): When I updated
11230         LocalVariableReference.DoResolve, I overdid it, and dropped an
11231         optimization done on local variable references.
11232
11233 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11234
11235         * ecore.cs: Convert the return from Ldlen into an int.
11236
11237 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11238
11239         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11240         the accessibility, this is a special case for toplevel non-public
11241         classes (internal for instance).
11242
11243 2003-10-20  Nick Drochak <ndrochak@gol.com>
11244
11245         * ecore.cs: Fix typo and build.  Needed another right paren.
11246
11247 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11248
11249         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11250         `internal' case regular and protected, but not allowing protected
11251         to be evaluated later.  Bug 49840
11252
11253 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11254
11255         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11256         to kb.Nlast, and not the kb.nFirst to isolate the switch
11257         statement.
11258
11259         Extract the underlying type, so enumerations of long/ulong are
11260         treated like long/ulong.
11261
11262 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11263
11264         * expression.cs (New): Overload the meaning of RequestedType to
11265         track the possible creation of the NewDelegate type, since
11266         DoResolve is invoked more than once for new constructors on field
11267         initialization.
11268
11269         See bugs: #48800 and #37014
11270
11271         * cs-parser.jay (declare_local_constants): Take an arraylist
11272         instead of a single constant.
11273
11274         (local_constant_declaration): It should take a
11275         constant_declarators, not a constant_declarator.  Fixes 49487
11276
11277         * convert.cs: Fix error report.
11278
11279 2003-10-13 Jackson Harper <jackson@ximian.com>
11280
11281         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11282         bug #49611
11283
11284 2003-10-09  Martin Baulig  <martin@ximian.com>
11285
11286         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11287         to the .ctor.
11288         (MethodCore.DoDefineParameters): Removed the TypeContainer
11289         argument; use the DeclSpace which was passed to the .ctor instead.
11290         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11291         TypeContainer; we only need a DeclSpace here.
11292
11293 2003-10-09  Martin Baulig  <martin@ximian.com>
11294
11295         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11296         to the .ctor.
11297         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11298         EmitContext's .ctor.    
11299
11300 2003-10-09  Martin Baulig  <martin@ximian.com>
11301
11302         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11303         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11304         AsAccessible(), moved them as well.
11305
11306         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11307
11308 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11309
11310         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11311
11312 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11313
11314         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11315         generation for >=, as spotted by Paolo, bug 48679.  
11316         Patch from David Waite.
11317
11318         * cs-tokenizer.cs: Add handling for #pragma.
11319
11320         * cs-parser.jay: Allow for both yield and yield return in the
11321         syntax.  The anti-cobolization of C# fight will go on!
11322
11323         * class.cs (TypeBuilder.DefineType): Catch error condition here
11324         (Parent.DefineType erroring out and returning null).
11325
11326         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11327         coping with enumerations variables, we were mistakenly processing
11328         them as a regular value type instead of built-in types.  Fixes the
11329         bug #48063
11330
11331         * typemanager.cs (IsBuiltinOrEnum): New method.
11332
11333 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
11334
11335         * cs-parser.jay: Upgrade: yield now needs the return clause.
11336
11337 2003-09-19  Martin Baulig  <martin@ximian.com>
11338
11339         * decl.cs (MemberCache.SetupCacheForInterface): Take a
11340         `MemberCache parent' argument.  Normally, an interface doesn't
11341         have a parent type except System.Object, but we use this in gmcs
11342         for generic type parameters.
11343
11344 2003-09-18  Martin Baulig  <martin@ximian.com>
11345
11346         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11347         on `type.IsInterface'; don't check whether the type has a parent
11348         to determine whether it's an interface.
11349
11350 2003-09-15  Martin Baulig  <martin@ximian.com>
11351
11352         * class.cs (TypeContainer.DefineType): Added an error flag to
11353         avoid reporting duplicate CS0146's ("class definition is
11354         circular.").
11355
11356         * driver.cs (Driver.MainDriver): Abort if
11357         RootContext.ResolveTree() reported any errors.
11358
11359 2003-09-07  Martin Baulig  <martin@ximian.com>
11360
11361         * report.cs (Error, Warning): Added overloaded versions which take
11362         a `params object[] args' and call String.Format().
11363
11364 2003-09-07  Martin Baulig  <martin@ximian.com>
11365
11366         * decl.cs (DeclSpace..ctor): Don't call
11367         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11368         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11369         (DeclSpace.RecordDecl): New method.
11370
11371         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11372
11373 2003-09-02  Ravi Pratap  <ravi@ximian.com>
11374
11375         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11376         value attributes to be applied to ParameterBuilders.
11377
11378         * class.cs (MethodCore.LabelParameters): Make static and more
11379         generic so that it can be used from other places - like interface
11380         methods, for instance.
11381
11382         * interface.cs (Interface.Emit): Call LabelParameters before
11383         emitting attributes on the InterfaceMethod.
11384
11385 2003-08-26  Martin Baulig  <martin@ximian.com>
11386
11387         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11388         resolving aliases; fixes #47927.
11389
11390 2003-08-26  Martin Baulig  <martin@ximian.com>
11391
11392         * statement.cs (Using.DoResolve): This is internally emitting a
11393         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11394         do not always return.  Fixes #47681.
11395
11396 2003-08-26  Martin Baulig  <martin@ximian.com>
11397
11398         * decl.cs (MemberCore): Moved WarningNotHiding(),
11399         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11400         into MemberBase.
11401         (AdditionResult): Make this nested in DeclSpace.
11402         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11403         argument; call NamespaceEntry.Define() unless we're nested in a
11404         class or struct.
11405
11406         * namespace.cs (Namespace.DefineName): New public function.  This
11407         is called from DeclSpace's .ctor to add 
11408         (Namespace.Lookup): Include DeclSpaces in the lookup.
11409
11410         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11411
11412         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11413
11414 2003-08-25  Martin Baulig  <martin@ximian.com>
11415
11416         * convert.cs (Convert.ExplicitReferenceConversion): When
11417         converting from an interface type to a class, unbox if the target
11418         type is a struct type.  Fixes #47822.
11419
11420 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11421
11422         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11423         #47854.
11424
11425 2003-08-22  Martin Baulig  <martin@ximian.com>
11426
11427         * class.cs (TypeManager.DefineType): When defining a nested type,
11428         call DefineType() on our parent; fixes #47801.
11429
11430 2003-08-22  Martin Baulig  <martin@ximian.com>
11431
11432         * class.cs (MethodData.Define): While checking if a method is an
11433         interface implementation, improve the test a bit more to fix #47654.
11434
11435 2003-08-22  Martin Baulig  <martin@ximian.com>
11436
11437         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11438         correctly; fixes #47722.
11439
11440 2003-08-22  Martin Baulig  <martin@ximian.com>
11441
11442         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11443         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11444
11445         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11446
11447 2003-08-22  Martin Baulig  <martin@ximian.com>
11448
11449         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11450         can only be assigned in static constructors.  Fixes #47161.
11451
11452 2003-08-22  Martin Baulig  <martin@ximian.com>
11453
11454         Rewrote and improved the flow analysis code.
11455
11456         * flowbranching.cs (FlowBranching): Make this class abstract.
11457         (FlowBranching.CreateBranching): New static function to create a
11458         new flow branching.
11459         (FlowBranchingBlock, FlowBranchingException): New classes.
11460         (FlowBranching.UsageVector.Type): New public readonly field.
11461         (FlowBranching.UsageVector.Breaks): Removed the setter.
11462         (FlowBranching.UsageVector.Returns): Removed the setter.
11463         (FlowBranching.UsageVector): Added Break(), Return(),
11464         NeverReachable() and Throw() methods to modify the reachability.
11465         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11466         done by FlowBranching.Merge().
11467         (FlowBranching.UsageVector.MergeChild): New method; merges the
11468         merge result into the current vector.
11469         (FlowBranching.Merge): New abstract method to merge a branching.
11470
11471 2003-08-12  Martin Baulig  <martin@ximian.com>
11472
11473         * expression.cs (Indirection.CacheTemporaries): Create the
11474         LocalTemporary with the pointer type, not its element type.
11475
11476 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11477
11478         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11479         token was a keyword or not.
11480
11481         Add `error' options where an IDENTIFIER was expected;  Provide
11482         CheckToken and CheckIdentifierToken convenience error reporting
11483         functions. 
11484
11485         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11486
11487         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11488         NameSpaceEntry NameSpaceEntry.
11489
11490         (LookupInterfaceOrClass): Avoid creating a full qualified name
11491         from namespace and name: avoid doing lookups when we know the
11492         namespace is non-existant.   Use new Tree.LookupByNamespace which
11493         looks up DeclSpaces based on their namespace, name pair.
11494
11495         * driver.cs: Provide a new `parser verbose' to display the
11496         exception thrown during parsing.  This is turned off by default
11497         now, so the output of a failure from mcs is more graceful.
11498
11499         * namespace.cs: Track all the namespaces defined in a hashtable
11500         for quick lookup.
11501
11502         (IsNamespace): New method
11503
11504 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11505
11506         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11507         we know that we need to concatenate (full typename can never be
11508         null). 
11509
11510         * class.cs: ditto.
11511
11512         * statement.cs: Use a bitfield;  Do not initialize to null things
11513         which are done by the constructor by default.
11514
11515         * cs-parser.jay: bug fix, parameter was 4, not 3.
11516
11517         * expression.cs: Just use the property;
11518
11519         * statement.cs: No need for GetVariableInfo method.
11520
11521 2003-08-08  Martin Baulig  <martin@ximian.com>
11522
11523         * flowanalysis.cs (FlowReturns): This is now nested in the
11524         `FlowBranching' class.
11525         (MyBitVector): Moved this here from statement.cs.
11526         (FlowBranching.SiblingType): New enum type.
11527         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11528
11529 2003-08-07  Martin Baulig  <martin@ximian.com>
11530
11531         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11532         `FlowBranching' class and called `BranchingType'.
11533
11534 2003-08-07  Martin Baulig  <martin@ximian.com>
11535
11536         * flowanalysis.cs: Moved all the control flow analysis code into
11537         its own file.
11538
11539 2003-08-07  Martin Baulig  <martin@ximian.com>
11540
11541         * assign.cs (Assign.DoResolve): `target' must either be an
11542         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11543         #37319.
11544
11545 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11546
11547         * expression.cs (BinaryMethod): This kind of expression is created by the
11548         Binary class if it determines that the operator has to be handled
11549         by a method.
11550
11551         (BinaryDelegate): This kind of expression is created if we are
11552         dealing with a + or - operator on delegates.
11553
11554         (Binary): remove method, argumetns, and DelegateOperator: when
11555         dealing with methods, 
11556
11557         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11558
11559         * statement.cs (Block): use bitfields for the three extra booleans
11560         we had in use.   Remove unused topblock parameter.
11561
11562         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11563
11564         * assign.cs: Drop extra unneeded tests.
11565
11566 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11567
11568         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11569
11570         * statement.cs (Foreach): Use VariableStorage instead of
11571         LocalBuilders.   
11572
11573         * codegen.cs (VariableStorage): New class used by clients that
11574         require a variable stored: locals or fields for variables that
11575         need to live across yield.
11576
11577         Maybe provide a convenience api for EmitThis+EmitLoad?
11578
11579         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11580         these bad boys.
11581
11582 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11583
11584         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11585         RemapParameterLValue): New methods that are used to turn a
11586         precomputed FieldInfo into an expression like this:
11587
11588                 instance.FieldInfo
11589
11590         The idea is to use this instead of making LocalVariableReference
11591         have more than one meaning.
11592
11593         * cs-parser.jay: Add error production to BASE.
11594
11595         * ecore.cs: Deal with TypeManager.GetField returning null, which
11596         is now a valid return value.
11597
11598         (FieldExprNoAddress): New expression for Fields whose address can
11599         not be taken.
11600
11601         * expression.cs (LocalVariableReference): During the resolve
11602         phases, create new expressions if we are in a remapping context.
11603         Remove code that dealt with remapping here.
11604
11605         (ParameterReference): same.
11606
11607         (ProxyInstance): New expression, like the `This' expression, but
11608         it is born fully resolved.  We know what we are doing, so remove
11609         the errors that are targeted to user-provided uses of `this'.
11610
11611         * statement.cs (Foreach): our variable is now stored as an
11612         Expression;  During resolution, follow the protocol, dont just
11613         assume it will return this.
11614
11615 2003-08-06  Martin Baulig  <martin@ximian.com>
11616
11617         * support.cs (SeekableStreamReader.cs): New public class.
11618
11619         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11620         SeekableStreamReader instead of the normal StreamReader.
11621
11622 2003-08-04  Martin Baulig  <martin@ximian.com>
11623
11624         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11625         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11626         deambiguate casts and delegate invocations.
11627         (parenthesized_expression): Use the new tokens to ensure this is
11628         not a cast of method invocation.
11629
11630         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11631         when reading a `)' and Deambiguate_CloseParens () was previously
11632         called.
11633
11634         * expression.cs (ParenthesizedExpression): New class.  This is
11635         just used for the CS0075 test.
11636         (Binary.DoResolve): Check for CS0075.   
11637
11638 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11639
11640         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11641         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11642         reference comparison.
11643
11644         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11645         examine the ReturnType for equality - this is necessary in the
11646         cases of implicit and explicit operators whose signature also
11647         includes the return type.
11648
11649 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11650
11651         * namespace.cs: Cache the result of the namespace computation,
11652         instead of computing it every time.
11653
11654 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11655
11656         * decl.cs: Use a global arraylist that we reuse over invocations
11657         to avoid excesive memory consumption.  Reduces memory usage on an
11658         mcs compile by one meg (45 average).
11659
11660         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11661         private, work around that.
11662
11663 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11664
11665         * literal.cs (IntLiteral): Define Zero and One static literals. 
11666
11667         * cs-parser.jay (integer_literal): use static literals to reduce
11668         memory usage for the most used literals (0, 1 and -1).  211kb
11669         reduced in memory usage.
11670
11671         Replace all calls to `new ArrayList' with `new
11672         ArrayList(4)' which is a good average number for most allocations,
11673         and also requires only 16 bytes of memory for its buffer by
11674         default. 
11675
11676         This reduced MCS memory usage in seven megabytes for the RSS after
11677         bootstrapping.
11678
11679 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11680
11681         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11682         handle params methods the correct way by forming only one
11683         applicable set with params and normal methods in them. Earlier we
11684         were looking at params methods only if we found no normal methods
11685         which was not the correct thing to do.
11686
11687         (Invocation.BetterFunction): Take separate arguments indicating
11688         when candidate and the best method are params methods in their
11689         expanded form.
11690
11691         This fixes bugs #43367 and #46199.
11692
11693         * attribute.cs: Documentation updates.
11694
11695         (CheckAttribute): Rename to CheckAttributeTarget.
11696         (GetValidPlaces): Rename to GetValidTargets.
11697
11698         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11699         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11700
11701         Fixes bug #44468.
11702
11703 2003-07-28  Martin Baulig  <martin@ximian.com>
11704
11705         * class.cs (TypeContainer.DefineMembers): Use the base type's full
11706         name when looking up the base class of a nested class.  Fixes #46977.
11707
11708 2003-07-26  Martin Baulig  <martin@ximian.com>
11709
11710         * expression.cs (Indexers.Indexer): New nested struct; contains
11711         getter, setter and the indexer's type.
11712         (Indexers.Properties): This is now an ArrayList of
11713         Indexers.Indexer's.
11714         (IndexerAccess.DoResolveLValue): Correctly set the type if the
11715         indexer doesn't have any getters.
11716
11717         * assign.cs (Assign.DoResolve): Also do the implicit conversions
11718         for embedded property and indexer assignments.
11719
11720 2003-07-26  Martin Baulig  <martin@ximian.com>
11721
11722         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11723         preprocessor directive is not the first non-whitespace character
11724         on a line.
11725
11726 2003-07-26  Martin Baulig  <martin@ximian.com>
11727
11728         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11729         namespace parsing, follow the spec more closely.
11730
11731         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11732         NamespaceEntry.Lookup().
11733
11734 2003-07-25  Martin Baulig  <martin@ximian.com>
11735
11736         * MethodCore.cs (OverridesSomething): New public field; it's set
11737         from TypeContainer.DefineMembers if this method overrides
11738         something (which doesn't need to be a method).  Fix #39462.
11739
11740 2003-07-25  Ravi Pratap  <ravi@ximian.com>
11741
11742         * typemanager.cs (GetMembers): Ensure that the list of members is
11743         reversed. This keeps things in sync.
11744
11745         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11746         find an AttributeUsage attribute.
11747
11748         * expression.cs (Invocation.OverloadResolve): Perform the check
11749         which disallows Invoke to be directly called on a Delegate.
11750
11751         (Error_InvokeOnDelegate): Report error cs1533.
11752
11753 2003-07-25  Martin Baulig  <martin@ximian.com>
11754
11755         * expression.cs (Indexers.GetIndexersForType): Only look in the
11756         interface hierarchy if the requested type is already an
11757         interface.  Fixes #46788 while keeping #46502 fixed.
11758
11759 2003-07-25  Martin Baulig  <martin@ximian.com>
11760
11761         * class.cs (TypeContainer.DefineMembers): Check whether all
11762         readonly fields have been assigned and report warning CS0649 if
11763         not.
11764
11765         * statement.cs (LocalInfo.IsFixed): Always return true if this is
11766         a valuetype.
11767
11768 2003-07-24  Ravi Pratap  <ravi@ximian.com>
11769
11770         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11771         returned from GetMethods to make things consistent with the
11772         assumptions MCS makes about ordering of methods.
11773
11774         This should comprehensively fix bug #45127 and it does :-)
11775
11776         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11777         ordering is actually reverse.
11778
11779         * Clean up some debug messages I left lying around.
11780
11781         * interface.cs (Populate*): Get rid of code which emits attributes
11782         since the stage in which we emit attributes is the 'Emit' stage,
11783         not the define stage.
11784
11785         (Emit): Move attribute emission for interface members here.
11786
11787 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11788
11789         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11790         closely: we eliminate methods in base types when we have an
11791         applicable method in a top-level type.
11792
11793         Please see section 14.5.5.1 for an exact description of what goes
11794         on. 
11795
11796         This fixes bug #45127 and a host of other related to corlib compilation.
11797
11798         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11799         array is the method corresponding to the top-level type (this is
11800         because of the changes made to icall.c) so we change this
11801         accordingly.
11802
11803         (MethodGroupExpr.Name): This too.
11804
11805         * typemanager.cs (GetElementType): New method which does the right
11806         thing when compiling corlib. 
11807
11808         * everywhere: Make use of the above in the relevant places.
11809
11810 2003-07-22  Martin Baulig  <martin@ximian.com>
11811
11812         * cs-parser.jay (invocation_expression): Moved
11813         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11814         `cast_expression', but create a InvocationOrCast which later
11815         resolves to either an Invocation or a Cast.
11816
11817         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11818         method; call this before EmitStatement() to make sure that this
11819         expression can be used as a statement.
11820
11821         * expression.cs (InvocationOrCast): New class; resolves to either
11822         an Invocation or a Cast.
11823
11824         * statement.cs (StatementExpression): Call ResolveStatement() on
11825         the ExpressionStatement before emitting it.
11826
11827 2003-07-21  Martin Baulig  <martin@ximian.com>
11828
11829         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11830         `ref' and `out' attributes match; fixes #46220.
11831         (MemberAccess.ResolveMemberAccess): You can't reference a type
11832         through an expression; fixes #33180.
11833         (Indexers.GetIndexersForType): Don't return the indexers from
11834         interfaces the class implements; fixes #46502.
11835
11836 2003-07-21  Martin Baulig  <martin@ximian.com>
11837
11838         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11839         CS0661 checks; fixes bug #30442.
11840
11841 2003-07-21  Martin Baulig  <martin@ximian.com>
11842
11843         * decl.cs (AdditionResult): Added `Error'.
11844
11845         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11846
11847         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11848         makes cs0031.cs actually work.
11849
11850 2003-07-20  Martin Baulig  <martin@ximian.com>
11851
11852         * namespace.cs: Fixed that bug which caused a crash when compiling
11853         the debugger's GUI.
11854
11855 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11856
11857         * typemanager.cs (LookupTypeReflection): Never expose types which
11858         are NotPublic, NestedPrivate, NestedAssembly, or
11859         NestedFamANDAssem.  We used to return these, and later do a check
11860         that would report a meaningful error, but the problem is that we
11861         would not get the real match, if there was a name override.
11862
11863 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11864
11865         * namespace.cs (Namespace, Name): Do not compute the namespace
11866         name dynamically, compute it in the constructor.  This reduced
11867         memory usage by 1697 KB.
11868
11869         * driver.cs: Use --pause to pause at the end.
11870
11871 2003-07-17  Peter Williams  <peter@newton.cx>
11872
11873         * Makefile: Change the name of the test target so that it doesn't
11874         conflict with the recursive test target.
11875
11876 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11877
11878         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11879         AddressOf): Do not use EmitThis, that was wrong, use the actual
11880         this pointer.
11881
11882 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11883
11884         * class.cs (MethodData.Define): While checking if a method is an
11885         interface implementation, improve the test: If we are not public
11886         (use new test here: use the computed MethodAttributes directly,
11887         instead of the parsed modifier flags) check if the `implementing'
11888         method comes from an interface or not.
11889
11890         * pending.cs (VerifyPendingMethods): Slightly better error
11891         message.
11892
11893         * makefile: add test target that does the mcs bootstrap.
11894
11895 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11896
11897         * interface.cs (Define): Do nothing here since there are no
11898         members to populate etc. Move the attribute emission out of here
11899         since this was just totally the wrong place to put it. Attribute
11900         application happens during the 'Emit' phase, not in the 'Define'
11901         phase.
11902
11903         (Emit): Add this method and move the attribute emission here
11904
11905         * rootcontext.cs (EmitCode): Call the Emit method on interface
11906         types too.
11907
11908 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11909
11910         * expression.cs (OverloadResolve): Report error only if Location
11911         is not 'Null' which means that there was a probe going on.
11912
11913 2003-07-14  Martin Baulig  <martin@ximian.com>
11914
11915         * expression.cs (ConditionalLogicalOperator): New public class to
11916         implement user defined conditional logical operators.
11917         This is section 14.11.2 in the spec and bug #40505.
11918
11919 2003-07-14  Martin Baulig  <martin@ximian.com>
11920
11921         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11922
11923 2003-07-14  Martin Baulig  <martin@ximian.com>
11924
11925         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11926
11927         * ecore.cs (IVariable.VerifyFixed): New interface method.
11928
11929         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11930         operator, check whether the variable is actually fixed.  Fixes bug
11931         #36055.  Set a variable definitely assigned when taking its
11932         address as required by the spec.
11933
11934         * statement.cs (LocalInfo.IsFixed): New field.
11935         (LocalInfo.MakePinned): Set `IsFixed' to true.
11936
11937 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11938
11939         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11940         for .ctors, ensure that we only ask for members declared in the
11941         attribute type (BindingFlags.DeclaredOnly).
11942
11943         Fixes bug #43632.
11944
11945         * expression.cs (Error_WrongNumArguments): Report error 1501
11946         correctly the way CSC does.
11947
11948 2003-07-13  Martin Baulig  <martin@ximian.com>
11949
11950         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11951         lookup on the fully qualified name, to make things like "X.X" work
11952         where "X.X" is a fully qualified type name, but we also have a
11953         namespace "X" in the using list.  Fixes #41975.
11954
11955 2003-07-13  Martin Baulig  <martin@ximian.com>
11956
11957         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11958         function. If we're a CompoundAssign, we need to create an embedded
11959         CompoundAssign, not an embedded Assign.
11960         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11961         Fixes #45854.
11962
11963 2003-07-13  Martin Baulig  <martin@ximian.com>
11964
11965         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11966         work to fix bug #46088.
11967
11968 2003-07-13  Ravi Pratap <ravi@ximian.com>
11969
11970         * class.cs (Operator.Emit): Do not emit attributes here - it is
11971         taken care of by the Method class that we delegate too. This takes
11972         care of bug #45876.
11973
11974 2003-07-10  Martin Baulig  <martin@ximian.com>
11975
11976         * expression.cs (TypeOfVoid): New class.
11977         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11978
11979 2003-07-10  Martin Baulig  <martin@ximian.com>
11980
11981         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11982         bug #35957.
11983
11984 2003-07-10  Martin Baulig  <martin@ximian.com>
11985
11986         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11987         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11988
11989         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11990
11991         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11992
11993 2003-07-10  Martin Baulig  <martin@ximian.com>
11994
11995         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11996         of decimal.  Fixes #42850.
11997
11998         NOTE: I also fixed the created byte blob, but this doesn't work on
11999         the MS runtime and csc never produces any byte blobs for decimal
12000         arrays.
12001
12002 2003-07-10  Martin Baulig  <martin@ximian.com>
12003
12004         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12005         structs; fixes #32068.
12006         (Block.AddChildVariableNames): Fixed #44302.
12007
12008 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12009
12010         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12011
12012 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12013
12014         * attribute.cs: And this test is onger needed.
12015
12016 2003-07-08  Martin Baulig  <martin@ximian.com>
12017
12018         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12019         inaccessible types.  Fixes #36313.
12020
12021         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12022
12023         * namespace.cs (NamespaceEntry): Create implicit entries for all
12024         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12025         implicit entries for N1.N2 and N1.
12026
12027 2003-07-08  Martin Baulig  <martin@ximian.com>
12028
12029         Rewrote the handling of namespaces to fix a lot of the issues
12030         wrt. `using' aliases etc.
12031
12032         * namespace.cs (Namespace): Splitted this class into a
12033         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12034
12035         * typemanager.cs (TypeManager.IsNamespace): Removed.
12036         (TypeManager.ComputeNamespaces): Only compute namespaces from
12037         loaded assemblies here, not the namespaces from the assembly we're
12038         currently compiling.
12039
12040 2003-07-08  Martin Baulig  <martin@ximian.com>
12041
12042         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12043
12044 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12045
12046         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12047         already fixed it.  
12048
12049         I thought about the memory savings here, but LookupTypeReflection
12050         is used under already very constrained scenarios.  Compiling
12051         corlib or mcs only exposes one hit, so it would not really reduce
12052         any memory consumption.
12053
12054 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12055
12056         * typemanager.cs: fixes bug #45889 by only adding public types from
12057         other assemblies to the list of known types.
12058
12059 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12060
12061         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12062         on the type we resolved.
12063
12064 2003-07-05  Martin Baulig  <martin@ximian.com>
12065
12066         * pending.cs (PendingImplementation.ParentImplements): Don't
12067         create the proxy if the parent is abstract.
12068
12069         * class.cs (TypeContainer.DefineIndexers): Process explicit
12070         interface implementations first.  Fixes #37714.
12071
12072 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12073
12074         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12075         defined recursively;  but since we modify the input parameters
12076         (left is set to `this' temporarily), we reset this value if the
12077         left_is_explicit is false, which gives the original semantics to
12078         the code.  
12079
12080         * literal.cs (NullPointer): new class used to represent a null
12081         literal in a pointer context.
12082
12083         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12084         type is a pointer, use a NullPointer object instead of a
12085         NullLiteral.   Closes 43687
12086
12087         (ExplicitConversion): Convert pointer values using
12088         the conv opcode to the proper type.
12089
12090         * ecore.cs (New): change ValueTypeVariable property into a method,
12091         that returns whether the valuetype is suitable for being used.
12092
12093         * expression.cs (Binary.DoNumericPromotions): Only return if we
12094         the int constant was a valid uint, and we can return both left and
12095         right as uints.  If not, we continue processing, to trigger the
12096         type conversion.  This fixes 39018.
12097
12098         * statement.cs (Block.EmitMeta): During constant resolution, set
12099         the CurrentBlock property on the emitcontext, so that we resolve
12100         constants propertly.
12101
12102 2003-07-02  Martin Baulig  <martin@ximian.com>
12103
12104         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12105         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12106
12107         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12108         than emitting it here.
12109
12110         * statement.cs: Fixed some more flow analysis bugs.
12111
12112 2003-07-02  Martin Baulig  <martin@ximian.com>
12113
12114         * class.cs (MethodData.Define): When implementing interface
12115         methods, set Final unless we're Virtual.
12116
12117         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12118         check work for interface methods.
12119
12120 2003-07-01  Martin Baulig  <martin@ximian.com>
12121
12122         * ecore.cs (EmitContext.This): Replaced this property with a
12123         GetThis() method which takes a Location argument.  This ensures
12124         that we get the correct error location for a CS0188.
12125
12126 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12127
12128         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12129         ImplicitStandardConversion.
12130
12131         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12132
12133 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
12134
12135         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12136         optimization.
12137
12138 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
12139
12140         * class.cs (Constructor.Define): Turn off initlocals for unsafe
12141         constructors.
12142
12143         (MethodData.Define): Turn off initlocals for unsafe methods.
12144
12145 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
12146
12147         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12148         complete;  Fixes #37521.
12149
12150         * delegate.cs: Use Modifiers.TypeAttr to compute the
12151         TypeAttributes, instead of rolling our own.  This makes the flags
12152         correct for the delegates.
12153
12154 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12155
12156         * class.cs (Constructor.Define): Set the private flag for static
12157         constructors as well.
12158
12159         * cs-parser.jay (statement_expression): Set the return value to
12160         null, to avoid a crash when we catch an error.
12161
12162 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12163
12164         * cs-parser.jay: Applied patch from Jackson that adds support for
12165         extern and unsafe modifiers to destructor declarations.
12166
12167         * expression.cs: Report error 21 if the user is trying to index a
12168         System.Array.
12169
12170         * driver.cs: Add an error message, suggested by the bug report.
12171
12172         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12173         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12174
12175 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12176
12177         * namespace.cs: Add some information to reduce FAQs.
12178
12179 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12180
12181         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12182         underlying enumeration types.  Fixes #43915.
12183
12184         * expression.cs: Treat ushort/short as legal values to be used in
12185         bitwise operations.
12186
12187 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12188
12189         * delegate.cs: transfer custom attributes for paramenters from
12190         the delegate declaration to Invoke and BeginInvoke.
12191
12192 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12193
12194         * attribute.cs: handle custom marshalers and emit marshal info
12195         for fields, too.
12196
12197 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12198
12199         * makefile.gnu: Added anonymous.cs to the compiler sources.
12200
12201 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12202
12203         * iterators.cs: Change the name of the proxy class to include two
12204         underscores.
12205
12206         * cs-parser.jay: Update grammar to include anonymous methods.
12207
12208         * anonymous.cs: new file.
12209
12210 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12211
12212         * class.cs (Field.Define): Add missing test for pointers and
12213         safety. 
12214
12215 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12216
12217         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12218         we use the stobj opcode.
12219
12220         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12221         since it wasn't the correct fix. 
12222
12223         It still is puzzling that we are required to use stobj for IntPtr
12224         which seems to be a ValueType.
12225
12226 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12227
12228         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12229         during regular simple name resolution.   Now, the trick is that
12230         instead of returning for processing the simplename, we do a
12231         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12232         contextual lookup type).   If a match is found, return that, if
12233         not, return for further composition.
12234
12235         This fixes long-standing 30485.
12236
12237         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12238         using the address to initialize an object, do an Stobj instead of
12239         using the regular Stelem.
12240
12241         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12242         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12243         Because if we are a BaseIndexerAccess that value will be true.
12244         Fixes 43643.
12245
12246         * statement.cs (GotoCase.Resolve): Return after reporting an
12247         error, do not attempt to continue. 
12248
12249         * expression.cs (PointerArithmetic.Emit): If our operand is a
12250         long, convert our constants to match the operand before
12251         multiplying.  Convert to I type before adding.   Fixes 43670.
12252
12253 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12254
12255         * enum.cs (ImplicitConversionExists) : Rename to
12256         ImplicitEnumConversionExists to remove ambiguity. 
12257
12258         * ecore.cs (NullCast): New type of cast expression class which
12259         basically is very similar to EmptyCast with the difference being
12260         it still is a constant since it is used only to cast a null to
12261         something else
12262         (eg. (string) null)
12263
12264         * convert.cs (ImplicitReferenceConversion): When casting a null
12265         literal, we return a NullCast.
12266
12267         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12268         should be around anymore.
12269
12270         The renaming (reported was slightly wrong). Corrections:
12271
12272         ConvertImplicitStandard -> ImplicitConversionStandard
12273         ConvertExplicitStandard -> ExplicitConversionStandard
12274
12275         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12276         before passing them in !
12277
12278         * convert.cs (ImplicitConversionStandard): When comparing for
12279         equal expr and target types, ensure that expr is not a
12280         NullLiteral.
12281
12282         In general, we must not be checking (expr_type ==
12283         target_type) in the top level conversion methods
12284         (ImplicitConversion, ExplicitConversion etc). This checking is
12285         done in the methods that they delegate to.
12286
12287 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12288
12289         * convert.cs: Move Error_CannotConvertType,
12290         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12291         ImplicitNumericConversion, ImplicitConversionExists,
12292         ImplicitUserConversionExists, StandardConversionExists,
12293         FindMostEncompassedType, FindMostSpecificSource,
12294         FindMostSpecificTarget, ImplicitUserConversion,
12295         ExplicitUserConversion, GetConversionOperators,
12296         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12297         TryImplicitIntConversion, Error_CannotConvertImplicit,
12298         ConvertImplicitRequired, ConvertNumericExplicit,
12299         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12300         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12301         its own file.
12302
12303         Perform the following renames:
12304
12305         StandardConversionExists -> ImplicitStandardConversionExists
12306         ConvertImplicit -> ImplicitConversion
12307         ConvertImplicitStandard -> ImplicitStandardConversion
12308         TryImplicitIntConversion -> ImplicitIntConversion
12309         ConvertImplicitRequired -> ImplicitConversionRequired
12310         ConvertNumericExplicit -> ExplicitNumericConversion
12311         ConvertReferenceExplicit -> ExplicitReferenceConversion
12312         ConvertExplicit -> ExplicitConversion
12313         ConvertExplicitStandard -> ExplicitStandardConversion
12314
12315 2003-05-19  Martin Baulig  <martin@ximian.com>
12316
12317         * statement.cs (TypeInfo.StructInfo): Made this type protected.
12318         (TypeInfo): Added support for structs having structs as fields.
12319
12320         * ecore.cs (FieldExpr): Implement IVariable.
12321         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12322         VariableInfo for the field.
12323
12324 2003-05-18  Martin Baulig  <martin@ximian.com>
12325
12326         * expression.cs (This.DoResolve): Report a CS0027 if we're
12327         emitting a field initializer.
12328
12329 2003-05-18  Martin Baulig  <martin@ximian.com>
12330
12331         * expression.cs (This.ResolveBase): New public function.
12332         (This.DoResolve): Check for CS0188.
12333
12334         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12335         This.Resolve().
12336
12337         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12338         `instance_expression' to null if we don't have any non-static
12339         methods.
12340
12341 2003-05-18  Martin Baulig  <martin@ximian.com>
12342
12343         Reworked the way how local variables and parameters are handled by
12344         the flow analysis code.
12345
12346         * statement.cs (TypeInfo, VariableMap): New public classes.
12347         (VariableInfo): New public class.  This is now responsible for
12348         checking whether a variable has been assigned.  It is used for
12349         parameters and local variables.
12350         (Block.EmitMeta): Take the InternalParameters as argument; compute
12351         the layout of the flow vectors here.
12352         (Block.LocalMap, Block.ParameterMap): New public properties.
12353         (FlowBranching): The .ctor doesn't get the InternalParameters
12354         anymore since Block.EmitMeta() now computes the layout of the flow
12355         vector.
12356         (MyStructInfo): This class is now known as `StructInfo' and nested
12357         in `TypeInfo'; we don't access this directly anymore.
12358
12359         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12360         property and removed IsAssigned(), IsFieldAssigned(),
12361         SetAssigned() and SetFieldAssigned(); we now call them on the
12362         VariableInfo so we don't need to duplicate this code everywhere.
12363
12364         * expression.cs (ParameterReference): Added `Block block' argument
12365         to the .ctor.
12366         (LocalVariableReference, ParameterReference, This): The new
12367         VariableInfo class is now responsible for all the definite
12368         assignment stuff.
12369
12370         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12371         IsParameterAssigned, SetParameterAssigned): Removed.
12372
12373 2003-05-18  Martin Baulig  <martin@ximian.com>
12374
12375         * typemanager.cs (InitCoreTypes): Try calling
12376         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12377         the 3-args-version.  Corlib now also needs our `void_type'.
12378         (GetMethod): Added overloaded version which takes an optional
12379         `bool report_errors' to allow lookups of optional methods.
12380
12381 2003-05-12  Martin Baulig  <martin@ximian.com>
12382
12383         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12384         only used for locals and not for parameters.
12385
12386 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12387
12388         * support.cs (InternalParameters.ParameterType): Return the
12389         ExternalType of the parameter.
12390
12391         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12392         they were unused.
12393
12394 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12395
12396         * class.cs (MethodData.Define): Do not set the `newslot' on
12397         interface members, if they are also flagged as "override".
12398
12399         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12400         better code for ++i and i++.  This only works for static fields
12401         and local variables.
12402
12403         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12404         want to pull the DeclSpace out of the builder_to_declspace instead
12405         of the TypeBuilder (like in TypeContainer.FindMembers).
12406
12407         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12408         instead of LookupTypeContainer.  Fixes the crash on .NET for
12409         looking up interface members.
12410
12411         * const.cs: Create our own emit context during the Definition
12412         stage, so that constants are evaluated in the proper context, when
12413         a recursive definition happens.
12414
12415 2003-05-11  Martin Baulig  <martin@ximian.com>
12416
12417         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12418         new block for a switch section.
12419         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12420         the adding/lookup in the switch block.  Fixes #39828.
12421
12422 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12423
12424         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12425         functionality: I needed to convert the data after I had performed
12426         the add/sub operation into the operands type size.
12427
12428         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12429         pass the type for the box operation, otherwise the resulting
12430         object would have been of type object.
12431
12432         (BoxedCast): Add constructor to specify the type to box as.
12433
12434 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12435
12436         * iterators.cs: I was reusing the `count' variable inadvertently,
12437         take steps to not allow this to happen.
12438
12439 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12440
12441         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12442         by creating an array at the point where the params starts and
12443         putting all those arguments there, then adjusting the size of the
12444         array.
12445
12446 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12447
12448         * expression.cs (New.AddressOf): Implement interface
12449         IMemoryLocation.  This is used when the `new' operator is used in
12450         the context of an invocation to a method on a value type.
12451
12452         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12453         example. 
12454
12455         * namespace.cs: Also check the using aliases here.
12456
12457         * driver.cs: Move the test for using validity after the types have
12458         been entered, so we do a single pass that also includes the using
12459         aliases. 
12460
12461         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12462         in the regular case.   CreateSiblingForFinally is doing extra
12463         error checking.
12464
12465         * attribute.cs (GetAttributeArgumentExpression): Store the result
12466         on an out value, and use the return value to indicate failure
12467         instead of using null (which is a valid return for Constant.GetValue).
12468
12469         * statement.cs: Perform the analysis flow for the increment
12470         portion after the statement, because this will be the real flow of
12471         execution.  Fixes #42385
12472
12473         * codegen.cs (EmitContext.EmitArgument,
12474         EmitContext.EmitStoreArgument): New helper functions when the
12475         RemapToProxy flag is set.
12476
12477         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12478         function.
12479
12480         Add support for remapping parameters. 
12481
12482         * iterators.cs: Propagate parameter values;  Store parameter
12483         values in the proxy classes.
12484
12485 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12486
12487         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12488         need a proxy reference;  I do not know what I was thinking
12489
12490         * cs-parser.jay (constructor_initializer): catch another error,
12491         and display nice message.
12492
12493         (field_declaration): catch void field declaration
12494         to flag a better error. 
12495
12496         * class.cs (MemberBase.CheckBase): Report an error instead of a
12497         warning if a new protected member is declared in a struct. 
12498         (Field.Define): catch the error of readonly/volatile.
12499
12500         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12501
12502         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12503         volatile variable is taken
12504
12505 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12506
12507         * statement.cs (Fixed.Resolve): Report an error if we are not in
12508         an unsafe context.
12509
12510 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12511
12512         * typemanager.cs: reuse the code that handles type clashes for
12513         delegates and enumerations.
12514
12515         * class.cs (Report28): Always report.
12516
12517         * expression.cs (EncodeAsAttribute): Allow nulls here.
12518
12519 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12520
12521         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12522         the functionality for testing whether an expression is valid for
12523         an attribute here.  Also handle the case of arrays of elements
12524         being stored. 
12525
12526         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12527         encoding a linear array into an array of objects that are suitable
12528         to be passed to an CustomAttributeBuilder.
12529
12530         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12531
12532         * ecore.cs: (FieldExpr): Handle field remapping here.
12533
12534         * iteratators.cs: Pass the instance variable (if the method is an
12535         instance method) to the constructors, so we can access the field
12536         variables on the class.
12537
12538         TODO: Test this with structs.  I think the THIS variable on
12539         structs might have to be a pointer, and not a refenrece
12540
12541 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12542
12543         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12544         local variables to fields in a proxy class.
12545
12546         * iterators.cs (PopulateProxy): Rename our internal fields to
12547         <XXX>.  
12548         Create a <THIS> field if we are an instance method, so we can
12549         reference our parent container variables.
12550         (MapVariable): Called back from the EmitContext code to enter a
12551         new variable to field mapping into the proxy class (we just create
12552         a FieldBuilder).
12553
12554         * expression.cs
12555         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12556         for using the remapped locals to fields.
12557
12558         I placed the code here, because that gives the same semantics to
12559         local variables, and only changes the Emit code.
12560
12561         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12562         statements inside iterators.
12563         (VariableInfo): Add a FieldBuilder for the cases when we are
12564         remapping local variables to fields in a proxy class
12565
12566         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12567         current_block != null.
12568
12569         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12570         not cope with strings, as it has been moved to the
12571         TableSwitchEmit.  Fixed bug in switch generation.
12572
12573         * expression.cs (New.DoResolve): Provide more context for the user
12574         when reporting an error.
12575
12576         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12577         pointers. 
12578
12579         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12580         check the permissions for it.  Note than in a type-resolution
12581         context the check was already present in DeclSpace.ResolveType,
12582         but was missing from the MemberAccess.
12583
12584         (ArrayCreation.CheckIndices): warn if the user has
12585         more nested levels of expressions, but there are no more
12586         dimensions specified.  Avoids crash on bug 41906.
12587
12588 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12589
12590         * statement.cs (Block): replace Implicit bool, for a generic
12591         flags.   
12592         New flag: `Unchecked'.  This is used during the EmitMeta phase
12593         (which is out-of-line with the regular Resolve/Emit process for a
12594         statement, as this is done ahead of time, but still gets a chance
12595         to call constant resolve).
12596
12597         (Block.Flags): new enum for adding a new flag.
12598
12599         (Block.EmitMeta): track the state of unchecked.
12600
12601         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12602         to enable constant resolution to work there as well.
12603
12604 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12605
12606         * typemanager.cs (ienumerable_type): Also look up
12607         System.Collections.IEnumerable. 
12608
12609 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12610
12611         TODO: Test more than one conditional per method.
12612
12613         * class.cs (Indexer.Define): Report the location where the user is
12614         referencing the unsupported feature.
12615
12616         (MethodData): Overload the use of `conditionals' to
12617         minimize the creation of needless ArrayLists.   This saves roughly
12618         212kb on my machine.
12619
12620         (Method): Implement the new IIteratorContainer interface.
12621         (Method.SetYields): Implement the method by setting the ModFlags
12622         to contain METHOD_YIELDS.
12623
12624         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12625         which just got set to null.
12626
12627         * iterators.cs: New file.
12628
12629         (Yield, YieldBreak): New statements.
12630
12631         * statement.cs (Return.Resolve): Flag an error if we are used in
12632         an iterator method.
12633
12634         * codegen.cs (InIterator): New flag set if the code is being
12635         compiled in an iterator method.
12636
12637         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12638         internal modifier, and we just use it to avoid adding extra
12639         fields, as this is seldom used.  
12640
12641         * cs-parser.jay: Add yield_statement (yield and yield break).
12642
12643         * driver.cs: New flag -v2 to turn on version 2 features. 
12644
12645         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12646         hashtable when v2 is enabled.
12647
12648 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12649
12650         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12651         there is already a namespace defined with this name.
12652
12653         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12654         people upgraded their corlibs.
12655
12656         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12657         always use fully qualified types, no need to use the compiler
12658         front end.
12659
12660         (TypeManager.IsNamespace): Use binarysearch.
12661
12662         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12663         AddDelegate): I did not quite use the new IsValid API properly: I
12664         have to pass the short-name and the fullname.  I was passing only
12665         the basename instead of the fullname sometimes. 
12666
12667         (TypeContainer.DefineType): call NamespaceClash.
12668
12669         * interface.cs (Interface.DefineType): use NamespaceClash before
12670         defining the type.
12671
12672         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12673         defining the type.
12674
12675         * enum.cs: (Enum.DefineType): use NamespaceClash before
12676         defining the type.
12677
12678         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12679         speed increase.  First, use the negative_hits cache when we get a
12680         negative.  Second, add the type with its full original name
12681         instead of the new . and + encoded name (reflection uses + to
12682         separate type from a nested type).  Use LookupTypeReflection
12683         directly which bypasses the type->name hashtable (that we already
12684         know does not contain the type.
12685
12686         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12687         location/container type. 
12688
12689         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12690
12691 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12692
12693         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12694
12695         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12696         method is being referenced in the method group from a static
12697         context, and report error 120 if so.
12698
12699         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12700         Error118. 
12701
12702         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12703         is created, we create the A namespace).
12704
12705         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12706         Fixes #41591
12707
12708 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12709
12710         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12711         invocation to ModuleBuilder.GetType with the same values will
12712         return a new type instance, so we need to cache its return
12713         values. 
12714
12715         * expression.cs (Binary.ResolveOperator): Only allow the compare
12716         operators on enums if they are of the same type.
12717
12718         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12719         types of ValueType on their own case.  Before we were giving them
12720         the same treatment as objects.
12721
12722         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12723         fullname.  Short name is used to compare against container name.
12724         Fullname is used to check against defined namespace names.
12725
12726         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12727         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12728
12729         (Method.CheckBase): Call parent.
12730         (MemberBase.CheckBase): Check for protected members on sealed
12731         classes.
12732         (PropertyBase.CheckBase): Call parent.
12733         (Field.Define): Call parent.
12734
12735         * report.cs: Negative error codes are now mapped to 8000 - code,
12736         so that the display is render more nicely.
12737
12738         * typemanager.cs: Do not use try/catch, instead report a regular
12739         error. 
12740
12741         (GetPointerType, GetReferenceType): These methods provide
12742         mechanisms to obtain the T* and T& from a T.  We had the code
12743         previously scattered around the code base, and it also used
12744         TypeManager.LookupType that would go through plenty of caches.
12745         This one goes directly to the type source.
12746
12747         In some places we did the Type.GetType followed by
12748         ModuleBuilder.GetType, but not in others, so this unifies the
12749         processing as well.
12750
12751         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12752         statements now that we have namespace information.
12753
12754         * typemanager.cs (IsNamespace): New method, returns whether the
12755         string presented is a namespace or not.
12756
12757         (ComputeNamespaces): New public entry point, computes the list of
12758         available namespaces, using the GetNamespaces API call in Mono, or
12759         the slower version in MS.NET.   
12760
12761         Now before we start the semantic analysis phase, we have a
12762         complete list of namespaces including everything that the user has
12763         provided.
12764
12765         Deleted old code to cache namespaces in .nsc files.
12766
12767 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12768
12769         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12770         class/struct location definition Location for the implicit
12771         constructor location.
12772
12773         (Operator.Define): Use the location of the operator for the
12774         implicit Method definition.
12775
12776         (Constructor.Emit): use the constructor location for the implicit
12777         base initializer constructor.
12778
12779         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12780         and the Expression class now contains two new methods:
12781
12782         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12783         isolate type lookup from the rest of the resolution process.
12784
12785         Since we use Expressions to hold type definitions due to the way
12786         we parse the input we have historically overloaded Resolve to
12787         perform the Type lookups if a special flag is passed.  Now this is
12788         eliminated and two methods take their place. 
12789
12790         The differences in the two methods between xStep and xTerminal is
12791         that xStep is involved in our current lookup system that uses
12792         SimpleNames to compose a name, while xTerminal is used just to
12793         catch the case where the simplename lookup failed.
12794
12795 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12796
12797         * expression.cs (ResolveMemberAccess): Remove redundant code.
12798         TypeExpr expressions are always born fully resolved.
12799
12800         * interface.cs (PopulateMethod): Do not lookup the types twice.
12801         We were doing it once during SemanticAnalysis and once during
12802         PopulateMethod.
12803
12804         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12805         in local variable type definitions, were being returned as a
12806         SimpleName (we decomposed everything into a string), that is
12807         because primary_expression was being used instead of a type in the
12808         grammar (reduce/reduce conflicts).
12809
12810         The part that was wrong is that we converted the expression into a
12811         string (an oversimplification in one hand, compounded with primary
12812         expressions doing string concatenation).
12813
12814         So things like:
12815
12816         A.B.C [] x;
12817
12818         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12819         using clauses from working on this particular context.  And a type
12820         was being matched directly against "A.B.C[]".
12821
12822         We now use the correct approach, and allow for ComposedCast to be
12823         part of the unary expression.  So the "A.B.C []" become a composed
12824         cast of "A.B.C" (as a nested group of MemberAccess with a
12825         SimpleName at the end) plus the rank composition "[]". 
12826
12827         Also fixes 35567
12828
12829 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12830
12831         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12832         for the access level checking.
12833
12834         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12835         `TypeContainer container', because I kept getting confused when I
12836         was debugging this code.
12837
12838         * expression.cs (Indexers): Instead of tracking getters/setters,
12839         we now track them in parallel.  We create one arraylist less, but
12840         most importantly it is possible now for the LValue code to find a
12841         matching get for a set.
12842
12843         (IndexerAccess.DoResolveLValue): Update the code.
12844         GetIndexersForType has been modified already to extract all the
12845         indexers from a type.  The code assumed it did not.
12846
12847         Also make the code set the correct return type for the indexer.
12848         This was fixed a long time ago for properties, but was missing for
12849         indexers.  It used to be void_type.
12850
12851         (Binary.Emit): Test first for doubles instead of
12852         floats, as they are more common.
12853
12854         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12855         when dealing with floats and the <=, >= operators.  This fixes bug
12856         #39314 
12857
12858         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12859         to load the array value by emitting a load on the foreach variable
12860         type.  This was incorrect.  
12861
12862         We now emit the code to load an element using the the array
12863         variable type, and then we emit the conversion operator.
12864
12865         Fixed #40176
12866
12867 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12868
12869         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12870
12871 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12872
12873         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12874         test for protection before we test for signatures. 
12875
12876         (MethodSignature.ToString): implement.
12877
12878         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12879         to the case where we reduced into a LongConstant.
12880
12881         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12882         depend on whether the information is acurrate, because the
12883         Microsoft runtime will always claim that the array type is public,
12884         regardless of the real state.
12885
12886         If the type is a pointer, another problem happens: the type is
12887         reported as non-public in Microsoft.  
12888
12889         In both cases we have to call CheckAccessLevel recursively with
12890         the underlying type as the argument to be tested.
12891
12892 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12893
12894         * assign.cs (Assign.Emit): If we are dealing with a compound
12895         assignment expression, we should use the code path that stores the
12896         intermediate result in a temporary value.  This fixes #40903.
12897
12898         *expression.cs (Indirection.ToString): Provide ToString method for
12899         debugging. 
12900
12901 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12902
12903         * class.cs: Null out fields holding references to Block objects so
12904         they can be garbage collected.
12905
12906         * expression.cs (OverloadResolve): Remove unused local.
12907
12908 2003-04-07  Martin Baulig  <martin@ximian.com>
12909
12910         * codegen.cs (EmitContext.CurrentFile): New public field.
12911         (EmitContext.Mark): Use the CurrentFile to check whether the
12912         location is in the correct file.
12913         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12914
12915 2003-04-07  Martin Baulig  <martin@ximian.com>
12916
12917         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12918
12919         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12920         location.  [FIXME: The location argument which gets passed to this
12921         method is sometimes wrong!]
12922
12923 2003-04-07  Nick Drochak <ndrochak@gol.com>
12924
12925         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12926
12927 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12928
12929         * expression.cs (Indirection.EmitAssign): We were using the
12930         temporary, but returning immediately instead of continuing the
12931         EmitAssing flow.
12932
12933 2003-04-06  Martin Baulig  <martin@ximian.com>
12934
12935         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12936         if it's a nested child, but also deriving from the outer class.
12937         See test 190.cs.
12938
12939         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12940         nested child, but also deriving from the outer class.  See
12941         test-190.cs.
12942         (FilterWithClosure): We may access private members of the outer
12943         class if we're a nested child and deriving from the outer class.
12944         (RealMemberLookup): Only set `closure_private_ok' if the
12945         `original_bf' contained BindingFlags.NonPublic.
12946
12947 2003-04-05  Martin Baulig  <martin@ximian.com>
12948
12949         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12950
12951 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12952
12953         * class.cs (Event.Define): Do not allow abstract events to have
12954         initializers. 
12955
12956 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12957
12958         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12959         block in event declarations.
12960
12961         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12962         value type, get its address.
12963
12964         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12965         leaving a class on the stack instead of a boolean value (int
12966         0/1).  Change the code so we compare against null, and then the
12967         result against zero.
12968
12969         * class.cs (TypeContainer.GetClassBases): We were checking for the
12970         parent class being sealed too late.
12971
12972         * expression.cs (Binary.Emit): For <= and >= when dealing with
12973         floating point values, use cgt.un and clt.un instead of cgt and
12974         clt alone.
12975
12976 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12977
12978         * statement.cs: Apply the same optimization as MS: skip the 
12979         GetEnumerator returning an IEnumerator, and use the one returning a 
12980         CharEnumerator instead. This allows us to avoid the try-finally block 
12981         and the boxing.
12982
12983 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12984
12985         * cs-parser.jay: Attributes cannot be applied to
12986                          namespaces. Fixes #40473
12987
12988 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12989
12990         * class.cs:
12991         (Add*): check if the name is valid using the full name for constants,
12992         fields, properties and events.
12993
12994 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12995
12996         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12997         char constants to be part of the enumeration.
12998
12999         * expression.cs (Conditional.DoResolve): Add support for operator
13000         true. Implements the missing functionality from 14.12
13001
13002         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13003         operator true/false as required by the spec.
13004
13005         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13006         implicit conversion to boolean.
13007
13008         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13009         also one where the type implements `operator true'. 
13010
13011         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13012         get an expression that will invoke operator true based on an
13013         expression.  
13014
13015         (GetConversionOperators): Removed the hack that called op_True
13016         here.  
13017
13018         (Expression.ResolveBoolean): Move this from Statement.
13019
13020 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13021
13022         * ecore.cs (FieldExpr): do not allow initialization of initonly
13023         fields on derived classes
13024
13025 2003-03-13  Martin Baulig  <martin@ximian.com>
13026
13027         * statement.cs (Block.Emit): Call ig.BeginScope() and
13028         ig.EndScope() when compiling with debugging info; call
13029         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13030
13031 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13032
13033         * expression.cs (Indexers): Do not construct immediately, allow
13034         for new members to be appended as we go.  Fixes 38143
13035
13036 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13037
13038         * expression.cs: save/restore context when resolving an unchecked
13039         expression.
13040
13041 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13042
13043         * cfold.cs: Catch division by zero in modulus operator during
13044         constant folding.
13045
13046 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13047
13048         * interface.cs (Interface.DefineMembers): Avoid defining members
13049         twice. 
13050
13051 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13052
13053         * driver.cs: handle the +/- options for -noconfig
13054
13055         * statement.cs (Unckeched.Resolve): Also track the state of
13056         unchecked in the Resolve phase.
13057
13058 2003-02-27  Martin Baulig  <martin@ximian.com>
13059
13060         * ecore.cs (Expression.MemberLookup): Don't create a
13061         MethodGroupExpr for something which is not a method.  Fixes #38291.
13062
13063 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13064
13065         * class.cs (MemberBase.CheckParameters): Also check that the type
13066         is unmanaged if it is a pointer.
13067
13068         * expression.cs (SizeOf.Resolve): Add location information.
13069
13070         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13071         a managed type is declared.
13072
13073         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13074         parameter modifiers as well.  Fixes bug 38606
13075
13076         * class.cs: Very sad.  Am backing out the speed up changes
13077         introduced by the ArrayList -> Array in the TypeContainer, as they
13078         were not actually that much faster, and introduced a bug (no error
13079         reports on duplicated methods).
13080
13081         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13082         source first, this will guarantee that we have a valid expression
13083         before calling in lower levels functions that will require a
13084         resolved object.  Then use this original_source in the
13085         target.ResolveLValue instead of the original source that was
13086         passed to us.
13087
13088         Another change.  Use target.Resolve instead of LValueResolve.
13089         Although we are resolving for LValues, we will let the Assign code
13090         take care of that (it will be called again from Resolve).  This
13091         basically allows code like this:
13092
13093         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13094         class Y { void A (X x) { x [0] += o; }
13095
13096         The problem was that the indexer was trying to resolve for
13097         set_Item (idx, object o) and never finding one.  The real set_Item
13098         was set_Item (idx, X).  By delaying the process we get the right
13099         semantics. 
13100
13101         Fixes bug 36505
13102
13103 2003-02-23  Martin Baulig  <martin@ximian.com>
13104
13105         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13106         while calling DoEmit ().
13107
13108         * codegen.cs (EmitContext.Mark): Don't mark locations in other
13109         source files; if you use the #line directive inside a method, the
13110         compiler stops emitting line numbers for the debugger until it
13111         reaches the end of the method or another #line directive which
13112         restores the original file.
13113
13114 2003-02-23  Martin Baulig  <martin@ximian.com>
13115
13116         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13117
13118 2003-02-23  Martin Baulig  <martin@ximian.com>
13119
13120         * statement.cs (Block.AddChildVariableNames): We need to call this
13121         recursively, not just for our immediate children.
13122
13123 2003-02-23  Martin Baulig  <martin@ximian.com>
13124
13125         * class.cs (Event.Define): Always make the field private, like csc does.
13126
13127         * typemanager.cs (TypeManager.RealMemberLookup): Make events
13128         actually work, fixes bug #37521.
13129
13130 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
13131
13132         * delegate.cs: When creating the various temporary "Parameters"
13133         classes, make sure that we call the ComputeAndDefineParameterTypes
13134         on those new parameters (just like we do with the formal ones), to
13135         allow them to be resolved in the context of the DeclSpace.
13136
13137         This fixes the bug that Dick observed in Bugzilla #38530.
13138
13139 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
13140
13141         * expression.cs (ResolveMemberAccess): When resolving a constant,
13142         do not attempt to pull a constant if the value was not able to
13143         generate a valid constant.
13144
13145         * const.cs (LookupConstantValue): Do not report more errors than required.
13146
13147 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13148
13149         * expression.cs: fixes bug #38328.
13150
13151 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13152
13153         * class.cs: Changed all the various members that can be part of a
13154         class from being an ArrayList to be an Array of the right type.
13155         During the DefineType type_list, interface_list, delegate_list and
13156         enum_list are turned into types, interfaces, delegates and enums
13157         arrays.  
13158
13159         And during the member population, indexer_list, event_list,
13160         constant_list, field_list, instance_constructor_list, method_list,
13161         operator_list and property_list are turned into their real arrays.
13162
13163         Although we could probably perform this operation earlier, for
13164         good error reporting we need to keep the lists and remove the
13165         lists for longer than required.
13166
13167         This optimization was triggered by Paolo profiling the compiler
13168         speed on the output of `gen-sample-program.pl' perl script. 
13169
13170         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13171         not crash in methods like MemberLookupFailed that use this field.  
13172
13173         This problem arises when the compiler fails to resolve a type
13174         during interface type definition for example.
13175
13176 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13177
13178         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13179         inherit from System.Object, so we have to stop at null, not only
13180         when reaching System.Object.
13181
13182 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13183
13184         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13185         DeclaredOnly because the parent indexer might have had a different
13186         name, but did not loop until the top of the hierarchy was reached.
13187
13188         The problem this one fixes is 35492: when a class implemented an
13189         indexer from an interface, we were getting the interface method
13190         (which was abstract) and we were flagging an error (can not invoke
13191         abstract method).
13192
13193         This also keeps bug 33089 functioning, and test-148 functioning.
13194
13195         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13196         out if a method is special is to see if it is declared in a
13197         property or event, or whether it is one of the predefined operator
13198         names.   This should fix correctly #36804.
13199
13200 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13201
13202         The goal here is to remove the dependency on EmptyCast.Peel ().
13203         Killing it completely.
13204
13205         The problem is that currently in a number of places where
13206         constants are expected, we have to "probe" for an EmptyCast, and
13207         Peel, which is not the correct thing to do, as this will be
13208         repetitive and will likely lead to errors. 
13209
13210         The idea is to remove any EmptyCasts that are used in casts that
13211         can be reduced to constants, so we only have to cope with
13212         constants. 
13213
13214         This bug hunt was triggered by Bug 37363 and the desire to remove
13215         the duplicate pattern where we were "peeling" emptycasts to check
13216         whether they were constants.  Now constants will always be
13217         constants.
13218
13219         * ecore.cs: Use an enumconstant here instead of wrapping with
13220         EmptyCast.  
13221
13222         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13223         throwing me off.  By handling this we can get rid of a few hacks.
13224
13225         * statement.cs (Switch): Removed Peel() code.
13226
13227 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13228
13229         * class.cs: Location information for error 508
13230
13231         * expression.cs (New.DoResolve): Add a guard against double
13232         resolution of an expression.  
13233
13234         The New DoResolve might be called twice when initializing field
13235         expressions (see EmitFieldInitializers, the call to
13236         GetInitializerExpression will perform a resolve on the expression,
13237         and later the assign will trigger another resolution
13238
13239         This leads to bugs (#37014)
13240
13241         * delegate.cs: The signature for EndInvoke should contain any ref
13242         or out parameters as well.  We were not doing this in the past. 
13243
13244         * class.cs (Field.Define): Do not overwrite the type definition
13245         inside the `volatile' group.  Turns out that volatile enumerations
13246         were changing the type here to perform a validity test, which
13247         broke conversions. 
13248
13249 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13250
13251         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13252         and structs, we do not want to load the instance variable
13253
13254         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13255         enum_type has to be handled like an object reference (implicit
13256         conversions exists from this to object), but the regular IsClass
13257         and IsValueType tests will never return true for this one.
13258
13259         Also we use TypeManager.IsValueType instead of type.IsValueType,
13260         just for consistency with the rest of the code (this is only
13261         needed if we ever use the construct exposed by test-180.cs inside
13262         corlib, which we dont today).
13263
13264 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13265
13266         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13267         just InternalCall.
13268
13269 2003-02-09  Martin Baulig  <martin@ximian.com>
13270
13271         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13272         (Namespace.DefineNamespaces): New static public method; this is
13273         called when we're compiling with debugging to add all namespaces
13274         to the symbol file.
13275
13276         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13277         pass it to the Namespace's .ctor.
13278
13279         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13280         and MethodBase arguments; pass the namespace ID to the symwriter;
13281         pass the MethodBase instead of the token to the symwriter.
13282         (SymbolWriter.DefineNamespace): New method to add a namespace to
13283         the symbol file.
13284
13285 2003-02-09  Martin Baulig  <martin@ximian.com>
13286
13287         * symbolwriter.cs: New file.  This is a wrapper around
13288         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13289         methods here in near future.
13290
13291 2003-02-09  Martin Baulig  <martin@ximian.com>
13292
13293         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13294         ILGenerator.MarkSequencePoint() which are actually used by the
13295         symbol writer.
13296
13297 2003-02-09  Martin Baulig  <martin@ximian.com>
13298
13299         * location.cs (SourceFile): New public sealed class.  This
13300         contains the name and an index which is used in the location's token.
13301         (Location): Reserve an appropriate number of bits in the token for
13302         the source file instead of walking over that list, this gives us a
13303         really huge performance improvement when compiling with debugging.
13304
13305         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13306         `SourceFile' argument instead of a string.
13307         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13308         but don't parse/tokenize here, we need to generate the list of all
13309         source files before we do that.
13310         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13311         the files.
13312
13313         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13314         instead of a string.
13315
13316         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13317         of a string.
13318
13319 2003-02-09  Martin Baulig  <martin@ximian.com>
13320
13321         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13322         filename on `#line default'.
13323
13324 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13325
13326         * statement.cs: don't clear the pinned var when the fixed statement
13327         returns from the method (fixes bug#37752).
13328
13329 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13330
13331         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13332         to IsValueType.
13333
13334 2003-02-07  Martin Baulig  <martin@ximian.com>
13335
13336         * driver.cs: Removed the `--debug-args' command line argument.
13337
13338         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13339         automatically by the AsssemblyBuilder.
13340         (CodeGen.InitializeSymbolWriter): We don't need to call any
13341         initialization function on the symbol writer anymore.  This method
13342         doesn't take any arguments.
13343
13344 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13345
13346         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13347         from referenced assemblies as well.
13348
13349 2003-02-02  Martin Baulig  <martin@ximian.com>
13350
13351         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13352
13353 2003-02-02  Martin Baulig  <martin@ximian.com>
13354
13355         * class.cs (Constructor.Emit): Open the symbol writer before
13356         emitting the constructor initializer.
13357         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13358         single-stepping through constructor initializers.
13359
13360 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13361
13362         * class.cs: Handle error 549: do not allow virtual methods in
13363         sealed classes. 
13364
13365 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13366
13367         * decl.cs: Check access levels when resolving types
13368
13369 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13370
13371         * statement.cs: Add parameters and locals set in catch blocks that might 
13372         return to set vector
13373
13374 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13375
13376         * class.cs (Operator): Set the SpecialName flags for operators.
13377
13378         * expression.cs (Invocation.DoResolve): Only block calls to
13379         accessors and operators on SpecialName methods.
13380
13381         (Cast.TryReduce): Handle conversions from char constants.
13382
13383
13384 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13385
13386         * statement.cs: small memory and time optimization in FlowBranching.
13387
13388 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13389
13390         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13391         problem that the last fix but in the other sid (Set).
13392
13393         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13394         access when there is no indexer in the hierarchy.
13395
13396 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13397
13398         * class.cs: Combine some if statements.
13399
13400 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13401
13402         * driver.cs: fixed bug #37187.
13403
13404 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13405
13406         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13407         any indexer, it's needed to build a list with all the indexers in the
13408         hierarchy (AllGetters), else we have problems. Fixes #35653.
13409
13410 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13411
13412         * class.cs (MethodData.Define): It is wrong for an interface
13413         implementation to be static in both cases: explicit and implicit.
13414         We were only handling this in one case.
13415
13416         Improve the if situation there to not have negations.
13417
13418         * class.cs (Field.Define): Turns out that we do not need to check
13419         the unsafe bit on field definition, only on usage.  Remove the test.
13420
13421 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13422
13423         * driver.cs: use assembly.Location instead of Codebase (the latest
13424         patch made mcs fail when using MS assemblies).
13425
13426 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13427
13428         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13429         get the path to *corlib.dll.
13430
13431 2003-01-21  Nick Drochak <ndrochak@gol.com>
13432
13433         * cs-tokenizer.cs:
13434         * pending.cs:
13435         * typemanager.cs: Remove compiler warnings
13436
13437 2003-01-20  Duncan Mak  <duncan@ximian.com>
13438
13439         * AssemblyInfo.cs: Bump the version number to 0.19.
13440
13441 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13442
13443         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13444
13445 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13446
13447         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13448
13449 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13450
13451         * cs-parser.jay: Small fix: we were not comparing the constructor
13452         name correctly.   Thanks to Zoltan for the initial pointer.
13453
13454 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13455
13456         * cs-tokenizer.cs: Set file name when specified with #line
13457
13458 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13459
13460         * cs-parser.jay: Only perform the constructor checks here if we
13461         are named like the class;  This will help provider a better
13462         error.  The constructor path is taken when a type definition is
13463         not found, but most likely the user forgot to add the type, so
13464         report that rather than the constructor error.
13465
13466 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13467
13468         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13469         allocations.
13470
13471 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13472
13473         * cs-parser.jay: Add cleanup call.
13474
13475 2003-01-13  Duncan Mak  <duncan@ximian.com>
13476
13477         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13478         consistent with other methods.
13479
13480 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13481
13482         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13483
13484 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13485
13486         * attribute.cs: only set GuidAttr to true when we have a
13487         GuidAttribute.
13488
13489 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13490
13491         * ecore.cs:
13492         * expression.cs:
13493         * typemanager.cs: fixes to allow mcs compile corlib with the new
13494         Type.IsSubclassOf fix.
13495
13496 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13497
13498         * expression.cs (LocalVariableReference.DoResolve): Classify a
13499         constant as a value, not as a variable.   Also, set the type for
13500         the variable.
13501
13502         * cs-parser.jay (fixed_statement): take a type instead of a
13503         pointer_type, so we can produce a better error message later.
13504
13505         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13506         as an error.  
13507
13508         (For.DoEmit): Make inifinite loops have a
13509         non-conditional branch back.
13510
13511         (Fixed.DoEmit): First populate the pinned variables, then emit the
13512         statement, then clear the variables.  Before I was emitting the
13513         code once for each fixed piece.
13514
13515
13516 2003-01-08  Martin Baulig  <martin@ximian.com>
13517
13518         * statement.cs (FlowBranching.MergeChild): A break in a
13519         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13520
13521 2003-01-08  Martin Baulig  <martin@ximian.com>
13522
13523         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13524         lives in the same number space than `param_map'.  Fixes #36154.
13525
13526 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13527
13528         * cs-parser.jay (constructor_declaration): Set the
13529         Constructor.ModFlags before probing for it.  This makes the
13530         compiler report 514, 515 and 132 (the code was there, but got
13531         broken). 
13532
13533         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13534         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13535         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13536
13537 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13538
13539         * enum.cs: create the enum static fields using the enum type.
13540
13541 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13542
13543         * class.cs: don't try to create the ParamBuilder for the return
13544         type if it's not needed (and handle it breaking for the ms runtime
13545         anyway).
13546
13547 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13548
13549         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13550
13551 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13552
13553         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13554         the command.   This showed up while compiling the JANET source
13555         code, which used \r as its only newline separator.
13556
13557 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13558
13559         * class.cs (Method.Define): If we are an operator (because it
13560         reuses our code), then set the SpecialName and HideBySig.  #36128
13561
13562 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13563
13564         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13565         exception, report error 120 `object reference required'.
13566
13567         * driver.cs: Add --pause option, used during to measure the size
13568         of the process as it goes with --timestamp.
13569
13570         * expression.cs (Invocation.DoResolve): Do not allow methods with
13571         SpecialName to be invoked.
13572
13573 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13574
13575         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13576         number before adding it.
13577
13578 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13579
13580         * ecore.cs (StandardImplicitConversion): When in an unsafe
13581         context, we allow conversion between void * to any other pointer
13582         type. This fixes bug #35973.
13583
13584 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13585
13586         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13587         is not thrown when extensionless outputs are used 
13588
13589 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13590
13591         * rootcontext.cs: fixed compilation of corlib.
13592
13593 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13594
13595         * attribute.cs (Attributes.Contains): Add new method.
13596
13597         * class.cs (MethodCore.LabelParameters): if the parameter is an
13598         `out' parameter, check that no attribute `[In]' has been passed.
13599
13600         * enum.cs: Handle the `value__' name in an enumeration.
13601
13602 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13603
13604         * decl.cs: Added special case to allow overrides on "protected
13605         internal" methods
13606
13607 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13608
13609         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13610         since it makes much more sense.
13611
13612         (Attributes.ctor): Don't require a Location parameter.
13613
13614         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13615
13616         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13617         since we already have that information per attribute.
13618
13619         * everywhere : make appropriate changes.
13620
13621         * class.cs (LabelParameters): Write the code which actually
13622         applies attributes to the return type. We can't do this on the MS
13623         .NET runtime so we flag a warning in the case an exception is
13624         thrown.
13625
13626 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13627
13628         * const.cs: Handle implicit null conversions here too.
13629
13630 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13631
13632         * class.cs (MethodCore.LabelParameters): Remove the extra
13633         Type [] parameter since it is completely unnecessary. Instead
13634         pass in the method's attributes so that we can extract
13635         the "return" attribute.
13636
13637 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13638
13639         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13640         of ignoring it and letting the compile continue.
13641
13642         * typemanager.cs (ChangeType): use an extra argument to return an
13643         error condition instead of throwing an exception.
13644
13645 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13646
13647         * expression.cs (Unary.TryReduce): mimic the code for the regular
13648         code path.  Perform an implicit cast in the cases where we can
13649         implicitly convert to one of the integral types, and then reduce
13650         based on that constant.   This fixes bug #35483.
13651
13652 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13653
13654         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13655
13656 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13657
13658         * namespace.cs: fixed bug #35489.
13659
13660 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13661
13662         * class.cs: Remove some dead code.
13663
13664         * cs-parser.jay: Estimate the number of methods needed
13665         (RootContext.MethodCount);
13666
13667         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13668         numbers instead of StringBuilders.
13669
13670         * support.cs (PtrHashtable): Add constructor with initial size;
13671         We can now reduce reallocations of the method table.
13672
13673 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13674
13675         * attribute.cs (ApplyAttributes): Keep track of the emitted
13676         attributes on a per-target basis. This fixes bug #35413.
13677
13678 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13679
13680         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13681         default to the Windows 1252 encoding.
13682
13683         (UnixParseOption): Support version, thanks to Alp for the missing
13684         pointer. 
13685
13686         * AssemblyInfo.cs: Add nice assembly information.
13687
13688         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13689         (bug 35169).
13690
13691         * cs-parser.jay: Allow a trailing comma before the close bracked
13692         in the attribute_section production.
13693
13694         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13695         address of the instance was being taken, I will take this out,
13696         because we take the address of the object immediately here.
13697
13698 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13699
13700         * typemanager.cs (AreMultipleAllowed): Take care of the most
13701         obvious case where attribute type is not in the current assembly -
13702         stupid me ;-)
13703
13704 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13705
13706         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13707         definitions, instead of doing that afterwards.  
13708
13709         Also we use a nice little hack, depending on the constructor, we
13710         know if we are a "composed" name or a simple name.  Hence, we
13711         avoid the IndexOf test, and we avoid 
13712
13713         * codegen.cs: Add code to assist in a bug reporter to track down
13714         the source of a compiler crash. 
13715
13716 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13717
13718         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13719         types have been emitted for a given element and flag an error
13720         if something which does not have AllowMultiple set is used more
13721         than once.
13722
13723         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13724         attribute types and their corresponding AllowMultiple properties
13725
13726         (AreMultipleAllowed): Check the property for a given type.
13727
13728         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13729         property in the case we have a TypeContainer.
13730
13731         (Attributes.AddAttribute): Detect duplicates and just skip on
13732         adding them. This trivial fix catches a pretty gross error in our
13733         attribute emission - global attributes were being emitted twice!
13734
13735         Bugzilla bug #33187 is now fixed.
13736
13737 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13738
13739         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13740         instead of pp_and).
13741
13742         * expression.cs (Binary.ResolveOperator): I can only use the
13743         Concat (string, string, string) and Concat (string, string,
13744         string, string) if the child is actually a concatenation of
13745         strings. 
13746
13747 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13748
13749         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13750         context where we need a 2-character lookahead.
13751
13752         * pending.cs (PendingImplementation): Rework so we can keep track
13753         of interface types all the time, and flag those which were
13754         implemented by parents as optional.
13755
13756 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13757
13758         * expression.cs (Binary.ResolveOperator): Use
13759         String.Concat(string,string,string) or
13760         String.Concat(string,string,string,string) when possible. 
13761
13762         * typemanager: More helper methods.
13763
13764
13765 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13766
13767         * pending.cs: remove the bogus return from GetMissingInterfaces()
13768         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13769
13770 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13771
13772         * namespace.cs: avoid duplicated 'using xxx' being added to
13773         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13774         when we get more than one 'using' statement for the same namespace.
13775         Report a CS0105 warning for it.
13776
13777 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13778
13779         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13780         of calling getChar/putback, uses internal knowledge of it.    
13781
13782         (xtoken): Reorder tokenizer so most common patterns are checked
13783         first.  This reduces the compilation time in another 5% (from 8.11s
13784         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13785
13786         The parsing time is 22% of the compilation in mcs, and from that
13787         64% is spent on the tokenization process.  
13788
13789         I tried using a binary search for keywords, but this is slower
13790         than the hashtable.  Another option would be to do a couple of
13791         things:
13792
13793                 * Not use a StringBuilder, instead use an array of chars,
13794                   with a set value.  Notice that this way we could catch
13795                   the 645 error without having to do it *afterwards*.
13796
13797                 * We could write a hand-parser to avoid the hashtable
13798                   compares altogether.
13799
13800         The identifier consumption process takes 37% of the tokenization
13801         time.  Another 15% is spent on is_number.  56% of the time spent
13802         on is_number is spent on Int64.Parse:
13803
13804                 * We could probably choose based on the string length to
13805                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13806                   computations. 
13807
13808         Another 3% is spend on wrapping `xtoken' in the `token' function.
13809
13810         Handle 0xa0 as whitespace (#34752)
13811
13812 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13813
13814         * typemanager.cs (IsCLRType): New routine to tell whether a type
13815         is one of the builtin types.  
13816
13817         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13818         typecode in more places instead of doing pointer comparissions.
13819         We could leverage some knowledge about the way the typecodes are
13820         laid out.
13821
13822         New code to cache namespaces in assemblies, it is currently not
13823         invoked, to be used soon.
13824
13825         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13826
13827         * expression.cs (Binary.ResolveOperator): specially handle
13828         strings, and do not perform user-defined operator overloading for
13829         built-in types.
13830
13831 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13832
13833         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13834         internalcall as it is a pretty simple operation;  Avoid whenever
13835         possible to call Char.IsLetter.
13836
13837         (consume_identifier): Cut by half the number of
13838         hashtable calls by merging the is_keyword and GetKeyword behavior.
13839
13840         Do not short-circuit, because if we do, we
13841         report errors (ie, #if false && true would produce an invalid
13842         directive error);
13843
13844
13845 2002-11-24  Martin Baulig  <martin@ximian.com>
13846
13847         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13848         check constant ranges and report a CS0221.  Fixes #33186.
13849
13850 2002-11-24  Martin Baulig  <martin@ximian.com>
13851
13852         * cs-parser.jay: Make this work for uninitialized variable
13853         declarations in the `for' initializer.  Fixes #32416.
13854
13855 2002-11-24  Martin Baulig  <martin@ximian.com>
13856
13857         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13858         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13859
13860 2002-11-24  Martin Baulig  <martin@ximian.com>
13861
13862         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13863         argument; if true, we also check for user-defined conversions.
13864         This is only needed if both arguments are of a user-defined type.
13865         Fixes #30443, added test-175.cs.
13866         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13867
13868         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13869
13870 2002-11-24  Martin Baulig  <martin@ximian.com>
13871
13872         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13873         function to get the store opcode.
13874         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13875         only emit the Ldelema if the store opcode is Stobj.  You must run
13876         both test-34 and test-167 to test this.  Fixes #34529.
13877
13878 2002-11-23  Martin Baulig  <martin@ximian.com>
13879
13880         * ecore.cs (Expression.MemberLookup): Added additional
13881         `qualifier_type' argument which is used when we're being called
13882         from MemberAccess.DoResolve() and null if we're called from a
13883         SimpleName lookup.
13884         (Expression.MemberLookupFailed): New method to report errors; this
13885         does the CS1540 check and reports the correct error message.
13886
13887         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13888         argument for the CS1540 check and redone the way how we're dealing
13889         with private members.  See the comment in the source code for details.
13890         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13891         `closure_start_type' to `closure_qualifier_type' and check whether
13892         it's not null.  It was not this filter being broken, it was just
13893         being called with the wrong arguments.
13894
13895         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13896         and pass it the correct `qualifier_type'; this also does the error
13897         handling for us.
13898
13899 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13900
13901         * expression.cs (Invocation.EmitParams): If the we are dealing
13902         with a non-built-in value type, load its address as well.
13903
13904         (ArrayCreation): Use a a pretty constant instead
13905         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13906         static initializers.  
13907
13908         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13909         because they are not really value types, just glorified integers. 
13910
13911         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13912
13913         * ecore.cs: Remove redundant code for enumerations, make them use
13914         the same code path as everything else, fixes the casting issue
13915         with enumerations in Windows.Forms.
13916
13917         * attribute.cs: Do only cast to string if it is a string, the
13918         validation happens later.
13919
13920         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13921         people upgrade their corlibs.
13922
13923         * ecore.cs: Oops, enumerations were not following the entire code path
13924
13925 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13926
13927         * typemanager.cs (FilterWithClosure): Commented out the test for
13928         1540 in typemanager.cs, as it has problems when accessing
13929         protected methods from a parent class (see test-174.cs). 
13930
13931         * attribute.cs (Attribute.ValidateGuid): new method.
13932         (Attribute.Resolve): Use above.
13933
13934 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13935
13936         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13937
13938         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13939         handling for enumerations, as we only needed the TypeContainer
13940         functionality to begin with (this is required for the fix below to
13941         work for enums that reference constants in a container class for
13942         example). 
13943
13944         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13945
13946         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13947         a valid TypeBuilder to perform lookups on.o
13948
13949         * class.cs (InheritableMemberSignatureCompare): Use true in the
13950         call to GetGetMethod and GetSetMethod, because we are comparing
13951         the signature, and we need to get the methods *even* if they are
13952         private. 
13953
13954         (PropertyBase.CheckBase): ditto.
13955
13956         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13957         GotoCase.Resolve): Use Peel on EmpytCasts.
13958
13959         * ecore.cs (EmptyCast): drop child, add Peel method.
13960
13961 2002-11-17  Martin Baulig  <martin@ximian.com>
13962
13963         * ecore.cs (EmptyCast.Child): New public property.
13964
13965         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13966         label resolved to an EmptyCast.  Fixes #34162.
13967         (GotoCase.Resolve): Likewise.
13968         (Block.EmitMeta): Likewise.
13969
13970 2002-11-17  Martin Baulig  <martin@ximian.com>
13971
13972         * expression.cs (Invocation.BetterConversion): Prefer int over
13973         uint; short over ushort; long over ulong for integer literals.
13974         Use ImplicitConversionExists instead of StandardConversionExists
13975         since we also need to check for user-defined implicit conversions.
13976         Fixes #34165.  Added test-173.cs.
13977
13978 2002-11-16  Martin Baulig  <martin@ximian.com>
13979
13980         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13981         with the `true' and `false' literals.  Fixes #33151.
13982
13983 2002-11-16  Martin Baulig  <martin@ximian.com>
13984
13985         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13986         October 22nd; don't do the cs1540 check for static members.
13987
13988         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13989         now using our own filter here and doing the cs1540 check again.
13990
13991 2002-11-16  Martin Baulig  <martin@ximian.com>
13992
13993         * support.cs (InternalParameters): Don't crash if we don't have
13994         any fixed parameters.  Fixes #33532.
13995
13996 2002-11-16  Martin Baulig  <martin@ximian.com>
13997
13998         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13999         when looking up static methods to make this work on Windows.
14000         Fixes #33773.
14001
14002 2002-11-16  Martin Baulig  <martin@ximian.com>
14003
14004         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14005         a setter rather than using PropertyInfo.CanWrite.
14006
14007 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14008
14009         * class.cs: Allow acces to block member by subclasses. Fixes build
14010         breaker.
14011
14012 2002-11-14  Martin Baulig  <martin@ximian.com>
14013
14014         * class.cs (Constructor.Emit): Added the extern/block check.
14015         Fixes bug #33678.
14016
14017 2002-11-14  Martin Baulig  <martin@ximian.com>
14018
14019         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14020         iteration while looking for indexers, this is needed because the
14021         indexer may have a different name in our base classes.  Fixed the
14022         error reporting (no indexers at all, not get accessor, no
14023         overloaded match).  Fixes bug #33089.
14024         (IndexerAccess.DoResolveLValue): Likewise.
14025
14026 2002-11-14  Martin Baulig  <martin@ximian.com>
14027
14028         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14029         indexers.  Fixes the first part of bug #33089.
14030         (MethodSignature.InheritableMemberSignatureCompare): Added support
14031         for properties.
14032
14033 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14034
14035         * attribute.cs (Attribute.Resolve): Catch the
14036         NullReferenceException and report it since it isn't supposed to
14037         happen. 
14038
14039 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14040
14041         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14042         LogicalOr and LogicalAnd that can benefit from recursively
14043         handling EmitBranchable.  The code now should be nice for Paolo.
14044
14045 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14046
14047         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14048         the Type lookups, as we perform quite a number of lookups on
14049         non-Types.  This can be removed once we can deterministically tell
14050         whether we have a type or a namespace in advance.
14051
14052         But this might require special hacks from our corlib.
14053
14054         * TODO: updated.
14055
14056         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14057         and double which avoids a conversion from an integer to a double.
14058
14059         * expression.cs: tiny optimization, avoid calling IsConstant,
14060         because it effectively performs the lookup twice.
14061
14062 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14063
14064         But a bogus return here to keep the semantics of the old code
14065         until the Mono runtime is fixed.
14066
14067         * pending.cs (GetMissingInterfaces): New method used to remove all
14068         the interfaces that are already implemented by our parent
14069         classes from the list of pending methods. 
14070
14071         * interface.cs: Add checks for calls after ResolveTypeExpr.
14072
14073 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14074
14075         * class.cs (Class.Emit): Report warning 67: event not used if the
14076         warning level is beyond 3.
14077
14078         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14079         being a NullLiteral.
14080
14081         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14082         specifiers. 
14083
14084         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14085         path that might fail if a type can not be resolved.
14086
14087         * expression.cs (Binary.Emit): Emit unsigned versions of the
14088         operators. 
14089
14090         * driver.cs: use error 5.
14091
14092 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14093
14094         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14095
14096 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14097
14098         * cs-parser.jay (switch_section): A beautiful patch from Martin
14099         Baulig that fixed 33094.
14100
14101 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14102
14103         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14104         Check whether the base is abstract and report an error if so.
14105
14106         * expression.cs (IndexerAccess.DoResolveLValue,
14107         IndexerAccess.DoResolve): ditto. 
14108
14109         (Invocation.DoResolve): ditto.
14110
14111         (Invocation.FullMethodDesc): Improve the report string.
14112
14113         * statement.cs (Block): Eliminate IsVariableDefined as it is
14114         basically just a wrapper for GetVariableInfo.
14115
14116         * ecore.cs (SimpleName): Use new 
14117
14118         * support.cs (ReflectionParamter.ParameterType): We unwrap the
14119         type, as we return the actual parameter ref/unref state on a
14120         different call.
14121
14122 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
14123
14124         * support.cs: Return proper flags REF/OUT fixing the previous
14125         commit.  
14126
14127         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
14128         not used to mean `ref' but `ref or out' in ParameterReference
14129
14130         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14131         full type signature instead of calling TypeManger.CSharpName
14132         ourselves. 
14133
14134         * support.cs (InternalParameters.ParameterDesc): Do not compare
14135         directly to the modflags, because REF/OUT will actually be bitsets
14136         if set. 
14137
14138         * delegate.cs (VerifyMethod): Check also the modifiers.
14139
14140         * cs-tokenizer.cs: Fix bug where floating point values with an
14141         exponent where a sign was missing was ignored.
14142
14143         * driver.cs: Allow multiple assemblies to be specified in a single
14144         /r: argument
14145
14146 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
14147
14148         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
14149         because identifiers after a parenthesis would end up in this kind
14150         of production, and we needed to desamiguate it for having casts
14151         like:
14152
14153                 (UserDefinedType *) xxx
14154
14155 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14156
14157         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14158         we should set on the Bindingflags.NonPublic, but not turn on
14159         private_ok.  private_ok controls whether a Private member is
14160         returned (this is chekced on the filter routine), while the
14161         BindingFlags.NonPublic just controls whether private/protected
14162         will be allowed.   This fixes the problem part of the problem of
14163         private properties being allowed to be used in derived classes.
14164
14165         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14166         so we can call the children DoResolveLValue method (this will
14167         properly signal errors on lvalue assignments to base properties)
14168
14169         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14170         getter are null, and we have a property info, we know that this
14171         happened because the lookup failed, so we report an error 122 for
14172         protection level violation.
14173
14174         We also silently return if setter and getter are null in the
14175         resolve functions, this condition only happens if we have flagged
14176         the error before.  This is the other half of the problem. 
14177
14178         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14179         not have accessibility information, that is why we were returning
14180         true in the filter function in typemanager.cs.
14181
14182         To properly report 122 (property is inaccessible because of its
14183         protection level) correctly, we report this error in ResolveAccess
14184         by failing if both the setter and the getter are lacking (ie, the
14185         lookup failed). 
14186
14187         DoResolve and DoLResolve have been modified to check for both
14188         setter/getter being null and returning silently, the reason being
14189         that I did not want to put the knowledge about this error in upper
14190         layers, like:
14191
14192         int old = Report.Errors;
14193         x = new PropertyExpr (...);
14194         if (old != Report.Errors)
14195                 return null;
14196         else
14197                 return x;
14198
14199         So the property expr is returned, but it is invalid, so the error
14200         will be flagged during the resolve process. 
14201
14202         * class.cs: Remove InheritablePropertySignatureCompare from the
14203         class, as we no longer depend on the property signature to compute
14204         whether it is possible to implement a method or not.
14205
14206         The reason is that calling PropertyInfo.GetGetMethod will return
14207         null (in .NET, in Mono it works, and we should change this), in
14208         cases where the Get Method does not exist in that particular
14209         class.
14210
14211         So this code:
14212
14213         class X { public virtual int A { get { return 1; } } }
14214         class Y : X { }
14215         class Z : Y { public override int A { get { return 2; } } }
14216
14217         Would fail in Z because the parent (Y) would not have the property
14218         defined.  So we avoid this completely now (because the alternative
14219         fix was ugly and slow), and we now depend exclusively on the
14220         method names.
14221
14222         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14223         reference method, instead of using the property.
14224
14225         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14226         routines are gone now.
14227
14228         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14229         names, they were incorrectly named.
14230
14231         * cs-tokenizer.cs: Return are more gentle token on failure. 
14232
14233         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14234         had an out-of-sync index variable, which caused it to remove from
14235         the list of pending methods the wrong method sometimes.
14236
14237 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14238
14239         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14240         CanWrite, because those refer to this particular instance of the
14241         property, and do not take into account the fact that we can
14242         override single members of a property.
14243
14244         Constructor requires an EmitContext.  The resolution process does
14245         not happen here, but we need to compute the accessors before,
14246         because the resolution does not always happen for properties.
14247
14248         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14249         subclass, before we did not update this flag, but we did update
14250         bindingflags. 
14251
14252         (GetAccessors): Drop this routine, as it did not work in the
14253         presence of partially overwritten set/get methods. 
14254
14255         Notice that this broke the cs1540 detection, but that will require
14256         more thinking. 
14257
14258 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14259
14260         * class.cs:
14261         * codegen.cs:
14262         * driver.cs: issue a warning instead of an error if we don't support
14263         debugging for the platform. Also ignore a couple of errors that may
14264         arise when trying to write the symbols. Undo my previous patch.
14265
14266 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14267
14268         * driver.cs: ignore /debug switch except for Unix platforms.
14269
14270 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14271
14272         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14273
14274 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14275
14276         * driver.cs: Do not make mcs-debug conditional, so we do not break
14277         builds that use it.
14278
14279         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14280         review this patch.  But basically after all the children variables
14281         have been merged, the value of "Breaks" was not being set to
14282         new_breaks for Switch blocks.  I think that it should be set after
14283         it has executed.  Currently I set this to the value of new_breaks,
14284         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14285         conservative, but I do not understand this code very well.
14286
14287         I did not break anything in the build, so that is good ;-)
14288
14289         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14290
14291 2002-10-20  Mark Crichton  <crichton@gimp.org>
14292
14293         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14294
14295 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14296
14297         * cfold.cs: Fixed compile blocker.
14298
14299 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14300
14301         * driver.cs: I was chekcing the key, not the file.
14302
14303 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14304
14305         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14306         message that we were generating - we just need to silently return
14307         a null.
14308
14309 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14310
14311         * class.cs (Event.Define): Change my previous commit, as this
14312         breaks the debugger.  This is a temporary hack, as it seems like
14313         the compiler is generating events incorrectly to begin with.
14314
14315         * expression.cs (Binary.ResolveOperator): Added support for 
14316         "U operator - (E x, E y)"
14317
14318         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14319         y)".
14320
14321         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14322         init-only variables, but this path did not take into account that
14323         there might be also instance readonly variables.  Correct this
14324         problem. 
14325
14326         This fixes bug 32253
14327
14328         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14329         delegates as well.
14330
14331         * driver.cs: Change the extension for modules to `netmodule'
14332
14333         * cs-parser.jay: Improved slightly the location tracking for
14334         the debugger symbols.
14335
14336         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14337         modifiers that were specified instead of the hardcoded value
14338         (FamAndAssem).  This was basically ignoring the static modifier,
14339         and others.  Fixes 32429.
14340
14341         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14342         fixed a bug in the process (32476)
14343
14344         * expression.cs (ArrayAccess.EmitAssign): Patch from
14345         hwang_rob@yahoo.ca that fixes bug 31834.3
14346
14347 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14348
14349         * driver.cs: Make the module extension .netmodule.
14350
14351 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14352
14353         * driver.cs: Report an error if the resource file is not found
14354         instead of crashing.
14355
14356         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14357         false, like Emit does.
14358
14359 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14360
14361         * typemanager.cs: Remove unused private member.  Also reported mcs
14362         bug to report this as a warning like csc.
14363
14364 2002-10-15  Martin Baulig  <martin@gnome.org>
14365
14366         * statement.cs (Statement.Emit): Made this a virtual method; emits
14367         the line number info and calls DoEmit().
14368         (Statement.DoEmit): New protected abstract method, formerly knows
14369         as Statement.Emit().
14370
14371         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14372
14373 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14374
14375         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14376         have fixed a remaining problem: not every AddXXXX was adding a
14377         fully qualified name.  
14378
14379         Now everyone registers a fully qualified name in the DeclSpace as
14380         being defined instead of the partial name.  
14381
14382         Downsides: we are slower than we need to be due to the excess
14383         copies and the names being registered this way.  
14384
14385         The reason for this is that we currently depend (on the corlib
14386         bootstrap for instance) that types are fully qualified, because
14387         we dump all the types in the namespace, and we should really have
14388         types inserted into the proper namespace, so we can only store the
14389         basenames in the defined_names array.
14390
14391 2002-10-10  Martin Baulig  <martin@gnome.org>
14392
14393         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14394         from bug #31834, see the bug report for a testcase which is
14395         miscompiled.
14396
14397 2002-10-10  Martin Baulig  <martin@gnome.org>
14398
14399         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14400         flow analysis code for this.
14401
14402         * statement.cs (Do, While, For): Tell the flow analysis code about
14403         infinite loops.
14404         (FlowBranching.UsageVector): Added support for infinite loops.
14405         (Block.Resolve): Moved the dead code elimination here and use flow
14406         analysis to do it.
14407
14408 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14409
14410         * class.cs (Field.Define): Catch cycles on struct type
14411         definitions. 
14412
14413         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14414         fields if the fields are static.  We only need to check instance
14415         fields. 
14416
14417         * expression.cs (As.DoResolve): Test for reference type.
14418
14419         * statement.cs (Using.ResolveExpression): Use
14420         ConvertImplicitRequired, not ConvertImplicit which reports an
14421         error on failture
14422         (Using.ResolveLocalVariableDecls): ditto.
14423
14424         * expression.cs (Binary.ResolveOperator): Report errors in a few
14425         places where we had to.
14426
14427         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14428
14429 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14430
14431         * expression.cs: Use StoreFromPtr instead of extracting the type
14432         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14433
14434         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14435         an enumeration value to a System.Enum, but System.Enum is not a
14436         value type, but an class type, so we need to box.
14437
14438         (Expression.ConvertExplicit): One codepath could return
14439         errors but not flag them.  Fix this.  Fixes #31853
14440
14441         * parameter.cs (Resolve): Do not allow void as a parameter type.
14442
14443 2002-10-06  Martin Baulig  <martin@gnome.org>
14444
14445         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14446         if it's a class type and not a struct.  Fixes #31815.
14447
14448 2002-10-06  Martin Baulig  <martin@gnome.org>
14449
14450         * statement.cs: Reworked the flow analysis code a bit to make it
14451         usable for dead code elimination.
14452
14453 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14454
14455         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14456
14457 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14458
14459         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14460         to fix the test 165, will investigate deeper.
14461
14462 2002-10-04  Martin Baulig  <martin@gnome.org>
14463
14464         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14465         finally blocks actually work.
14466         (Try.Resolve): We don't need to create a sibling for `finally' if
14467         there is no finally block.
14468
14469 2002-10-04  Martin Baulig  <martin@gnome.org>
14470
14471         * class.cs (Constructor.Define): The default accessibility for a
14472         non-default constructor is private, not public.
14473
14474 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14475
14476         * class.cs (Constructor): Make AllowedModifiers public, add
14477         EXTERN.
14478
14479         * cs-parser.jay: Perform the modifiers test here, as the
14480         constructor for the Constructor class usually receives a zero
14481         because of the way we create it (first we create, later we
14482         customize, and we were never checking the modifiers).
14483
14484         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14485         is a version of LookupTypeReflection that includes the type-name
14486         cache.  This can be used as a fast path for functions that know
14487         the fully qualified name and are only calling into *.GetType() to
14488         obtain a composed type.
14489
14490         This is also used by TypeManager.LookupType during its type
14491         composition.
14492
14493         (LookupType): We now also track the real type name, as sometimes
14494         we can get a quey for the real type name from things like
14495         ComposedCast.  This fixes bug 31422.
14496
14497         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14498         complete type fullname, it does not have to go through the type
14499         resolution system to obtain the composed version of the type (for
14500         obtaining arrays or pointers).
14501
14502         (Conditional.Emit): Use the EmitBoolExpression to
14503         generate nicer code, as requested by Paolo.
14504
14505         (ArrayCreation.CheckIndices): Use the patch from
14506         hwang_rob@yahoo.ca to validate the array initializers. 
14507
14508 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14509
14510         * class.cs (ConstructorInitializer.Emit): simplify code by using
14511         Invocation.EmitCall, and at the same time, fix the bugs in calling
14512         parent constructors that took variable arguments. 
14513
14514         * ecore.cs (Expression.ConvertNumericExplicit,
14515         Expression.ImplicitNumericConversion): Remove the code that
14516         manually wrapped decimal (InternalTypeConstructor call is now gone
14517         as well).
14518
14519         * expression.cs (Cast.TryReduce): Also handle decimal types when
14520         trying to perform a constant fold on the type.
14521
14522         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14523
14524         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14525         that only turned off an error report, and did nothing else. 
14526
14527 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14528
14529         * driver.cs: Handle and ignore /fullpaths
14530
14531 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14532
14533         * expression.cs (Binary.ResolveOperator): Catch the case where
14534         DoNumericPromotions returns true, 
14535
14536         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14537
14538 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14539
14540         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14541         report error 70.
14542
14543 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14544
14545         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14546         conversion exists, but it is also required that the conversion be
14547         performed.  This manifested in "(Type64Enum) 2".  
14548
14549         * class.cs (TypeManager.AddMethod): The fix is not to change
14550         AddEnum, because that one was using a fully qualified name (every
14551         DeclSpace derivative does), but to change the AddMethod routine
14552         that was using an un-namespaced name.  This now correctly reports
14553         the duplicated name.
14554
14555         Revert patch until I can properly fix it.  The issue
14556         is that we have a shared Type space across all namespaces
14557         currently, which is wrong.
14558
14559         Options include making the Namespace a DeclSpace, and merge
14560         current_namespace/current_container in the parser.
14561
14562 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14563
14564         * cs-parser.jay: Improve error reporting when we get a different
14565         kind of expression in local_variable_type and
14566         local_variable_pointer_type. 
14567
14568         Propagate this to avoid missleading errors being reported.
14569
14570         * ecore.cs (ImplicitReferenceConversion): treat
14571         TypeManager.value_type as a target just like object_type.   As
14572         code like this:
14573
14574         ValueType v = 1;
14575
14576         Is valid, and needs to result in the int 1 being boxed before it
14577         is assigned to the value type v.
14578
14579         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14580         to validate the enumeration name.
14581
14582         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14583         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14584         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14585
14586         * ecore.cs (TryImplicitIntConversion): When doing an
14587         implicit-enumeration-conversion, check if the type is 64-bits and
14588         perform a conversion before passing to EnumConstant.
14589
14590 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14591
14592         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14593         report ambiguous type references.  Unlike the MS version, we
14594         report what the ambiguity is.   Innovation at work ;-)
14595
14596         (DeclSpace.FindType): Require a location argument to
14597         display when we display an ambiguous error.
14598
14599         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14600
14601         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14602
14603         * expression.cs (EmitDynamicInitializers): Apply patch from
14604         hwang_rob@yahoo.ca that fixes the order in which we emit our
14605         initializers. 
14606
14607 2002-09-21  Martin Baulig  <martin@gnome.org>
14608
14609         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14610         delegate takes no arguments.
14611
14612 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14613
14614         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14615         from integers.
14616
14617         * expression.cs: Extract the underlying type.
14618
14619         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14620
14621         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14622
14623 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14624
14625         * class.cs (TypeContainer.DefineType): We can not use the nice
14626         PackingSize with the size set to 1 DefineType method, because it
14627         will not allow us to define the interfaces that the struct
14628         implements.
14629
14630         This completes the fixing of bug 27287
14631
14632         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14633         means also structs.  This fixes part of the problem. 
14634         (Expresion.ImplicitReferenceConversionExists): ditto.
14635
14636         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14637         error if there were no errors reported during the type lookup
14638         process, to avoid duplicates or redundant errors.  Without this
14639         you would get an ambiguous errors plus a type not found.  We have
14640         beaten the user enough with the first error.  
14641
14642         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14643         reference. 
14644
14645         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14646         during the resolution process, stop the lookup, this avoids
14647         repeated error reports (same error twice).
14648
14649         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14650
14651         * typemanager.cs (LookupType): Redo the type lookup code to match
14652         the needs of System.Reflection.  
14653
14654         The issue is that System.Reflection requires references to nested
14655         types to begin with a "+" sign instead of a dot.  So toplevel
14656         types look like: "NameSpace.TopLevelClass", and nested ones look
14657         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14658         levels. 
14659
14660 2002-09-19  Martin Baulig  <martin@gnome.org>
14661
14662         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14663         says that a method always returns or always throws an exception,
14664         don't report the CS0161.
14665
14666         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14667         set `Returns = new_returns'.
14668
14669 2002-09-19  Martin Baulig  <martin@gnome.org>
14670
14671         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14672         to an enum constant, check for a CS0176.
14673
14674 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14675
14676         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14677         for operators that must be in pairs and report errors.
14678
14679         * ecore.cs (SimpleName.DoResolveType): During the initial type
14680         resolution process, when we define types recursively, we must
14681         check first for types in our current scope before we perform
14682         lookups in the enclosing scopes.
14683
14684         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14685
14686         (Invocation.VerifyArgumentsCompat): Call
14687         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14688         I thought we were supposed to always call this, but there are a
14689         few places in the code where we dont do it.
14690
14691 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14692
14693         * driver.cs: Add support in -linkres and -resource to specify the
14694         name of the identifier.
14695
14696 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14697
14698         * ecore.cs (StandardConversionExists): Sync with the conversion
14699         code: allow anything-* to void* conversions.
14700
14701         (FindMostSpecificSource): Use an Expression argument
14702         instead of a Type, because we might be handed over a Literal which
14703         gets a few more implicit conversions that plain types do not.  So
14704         this information was being lost.
14705
14706         Also, we drop the temporary type-holder expression when not
14707         required.
14708
14709 2002-09-17  Martin Baulig  <martin@gnome.org>
14710
14711         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14712         this is an explicit interface implementation.
14713
14714 2002-09-17  Martin Baulig  <martin@gnome.org>
14715
14716         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14717         different `IndexerName' attributes.
14718
14719         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14720         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14721         virtual CommonResolve().
14722
14723 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14724
14725         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14726         and convert that to the UnderlyingType.
14727
14728         * statement.cs (Foreach.Resolve): Indexers are just like variables
14729         or PropertyAccesses.
14730
14731         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14732         inside quoted strings, we were not doing this before.
14733
14734 2002-09-16  Martin Baulig  <martin@gnome.org>
14735
14736         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14737         resolve it.  This is needed for the definite assignment check of the
14738         instance expression, fixes bug #29846.
14739         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14740
14741 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14742
14743         * parameter.cs: Fix compile error.  Cannot reference static member
14744         from an instance object.  Is this an mcs bug?
14745
14746 2002-09-14  Martin Baulig  <martin@gnome.org>
14747
14748         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14749         multiple times.  Fixes bug #30295, added test-166.cs.
14750
14751 2002-09-14  Martin Baulig  <martin@gnome.org>
14752
14753         * statement.cs (Block.Emit): Don't emit unreachable code.
14754         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14755         `break' statements.
14756         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14757
14758 2002-09-14  Martin Baulig  <martin@gnome.org>
14759
14760         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14761         is set.
14762
14763 2002-09-14  Martin Baulig  <martin@gnome.org>
14764
14765         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14766         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14767         be false on the ms runtime.
14768
14769 2002-09-13  Martin Baulig  <martin@gnome.org>
14770
14771         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14772         the CS0038 error message.
14773
14774 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14775
14776         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14777         constant inside, return it.
14778
14779 2002-09-12  Martin Baulig  <martin@gnome.org>
14780
14781         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14782         implicit conversion can be done between enum types.
14783
14784         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14785         check whether an implicit conversion to the current enum's UnderlyingType
14786         exists and report an error if not.
14787
14788         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14789         without debugging support.
14790
14791         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14792         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14793
14794 2002-09-12  Martin Baulig  <martin@gnome.org>
14795
14796         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14797
14798         * ecore.cs (IMemberExpr.DeclaringType): New property.
14799         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14800         nonstatic member of an outer type (CS0038).
14801
14802 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14803
14804         * driver.cs: Activate the using-error detector at warning level
14805         4 (at least for MS-compatible APIs).
14806
14807         * namespace.cs (VerifyUsing): Small buglett fix.
14808
14809         * pending.cs (PendingImplementation): pass the container pointer. 
14810
14811         * interface.cs (GetMethods): Allow for recursive definition.  Long
14812         term, I would like to move every type to support recursive
14813         definitions, not the current ordering mechanism that we have right
14814         now.
14815
14816         The situation is this: Attributes are handled before interfaces,
14817         so we can apply attributes to interfaces.  But some attributes
14818         implement interfaces, we will now handle the simple cases
14819         (recursive definitions will just get an error).  
14820
14821         * parameter.cs: Only invalidate types at the end if we fail to
14822         lookup all types.  
14823
14824 2002-09-09  Martin Baulig  <martin@gnome.org>
14825
14826         * ecore.cs (PropertyExpr.Emit): Also check for
14827         TypeManager.system_int_array_get_length so this'll also work when
14828         compiling corlib.  Fixes #30003.
14829
14830 2002-09-09  Martin Baulig  <martin@gnome.org>
14831
14832         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14833         and throw an exception if we can't get the type's size.  Fixed #30040,
14834         added test-165.cs.
14835
14836 2002-09-09  Martin Baulig  <martin@gnome.org>
14837
14838         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14839
14840         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14841         context.  Fixes bug #30027.
14842
14843         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14844         virtual functions.  Fixes bug #30043, added test-164.cs.
14845
14846 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14847
14848         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14849
14850 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14851
14852         * driver.cs: Use an object to get the windows codepage since it's not a
14853         static property.
14854
14855 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14856
14857         * statement.cs (For.Emit): for infinite loops (test == null)
14858         return whether there is a break inside, not always "true".
14859
14860         * namespace.cs (UsingEntry): New struct to hold the name of the
14861         using definition, the location where it is defined, and whether it
14862         has been used in a successful type lookup.
14863
14864         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14865         strings.
14866
14867         * decl.cs: ditto.
14868
14869 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14870
14871         * attribute.cs : Fix incorrect code which relied on catching
14872         a NullReferenceException to detect a null being passed in
14873         where an object was expected.
14874
14875 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14876
14877         * statement.cs (Try): flag the catch variable as assigned
14878
14879         * expression.cs (Cast): Simplified by using ResolveType instead of
14880         manually resolving.
14881
14882         * statement.cs (Catch): Fix bug by using ResolveType.
14883
14884 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14885
14886         * expression.cs (BetterConversion): Special case for when we have
14887         a NullLiteral as the argument and we have to choose between string
14888         and object types - we choose string the way csc does.
14889
14890         * attribute.cs (Attribute.Resolve): Catch the
14891         NullReferenceException and report error #182 since the Mono
14892         runtime no more has the bug and having this exception raised means
14893         we tried to select a constructor which takes an object and is
14894         passed a null.
14895
14896 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14897
14898         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14899         message (1502, 1503) when we can't locate a method after overload
14900         resolution. This is much more informative and closes the bug
14901         Miguel reported.
14902
14903         * interface.cs (PopulateMethod): Return if there are no argument
14904         types. Fixes a NullReferenceException bug.
14905
14906         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14907         expressions too. Previously we were checking only in one place for
14908         positional arguments leaving out named arguments.
14909
14910         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14911         type to the enum type is not allowed. Remove code corresponding to
14912         that.
14913
14914         (ConvertNumericExplicit): Allow explicit conversions from
14915         the underlying type to enum type. This precisely follows the spec
14916         and closes a bug filed by Gonzalo.
14917
14918 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14919
14920         * compiler.csproj:
14921         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14922
14923 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14924
14925         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14926         it was important that we stored the right value after the
14927         reduction in `converted'.
14928
14929 2002-09-04  Martin Baulig  <martin@gnome.org>
14930
14931         * location.cs (Location.SymbolDocument): Use full pathnames for the
14932         source files.
14933
14934 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14935
14936         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14937         of the expression resolve mechanism, because that will catch the
14938         SimpleName error failures.
14939
14940         (Conditional): If we can not resolve the
14941         expression, return, do not crash.
14942
14943 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14944
14945         * cs-tokenizer.cs:
14946         (location): display token name instead of its number.
14947
14948 2002-08-28  Martin Baulig  <martin@gnome.org>
14949
14950         * expression.cs (Binary.ResolveOperator): Don't silently return
14951         but return an error if an operator cannot be applied between two
14952         enum types.
14953
14954 2002-08-28  Martin Baulig  <martin@gnome.org>
14955
14956         * class.cs (Constructor.Define): Set the permission attributes
14957         correctly instead of making all constructors public.
14958
14959 2002-08-28  Martin Baulig  <martin@gnome.org>
14960
14961         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14962         for private members before reporting a CS0103; if we find anything,
14963         it's a CS0122.
14964
14965 2002-08-28  Martin Baulig  <martin@gnome.org>
14966
14967         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14968         to check whether `closure_start_type == closure_invocation_type',
14969         we also need to check whether `m.DeclaringType == closure_invocation_type'
14970         before bypassing the permission checks.  We might be accessing
14971         protected/private members from the base class.
14972         (TypeManager.RealMemberLookup): Only set private_ok if private
14973         members were requested via BindingFlags.NonPublic.
14974
14975         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14976
14977         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14978         MethodGroupExpr.IsExplicitImpl if appropriate.
14979         (Invocation.DoResolve): Don't report the CS0120 for explicit
14980         interface implementations.
14981
14982 2002-08-27  Martin Baulig  <martin@gnome.org>
14983
14984         * expression.cs (Invocation.DoResolve): If this is a static
14985         method and we don't have an InstanceExpression, we must report
14986         a CS0120.
14987
14988 2002-08-25  Martin Baulig  <martin@gnome.org>
14989
14990         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14991         `==' between a valuetype and an object.
14992
14993 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14994
14995         * ecore.cs (TypeExpr): Provide a ToString method.
14996
14997 2002-08-24  Martin Baulig  <martin@gnome.org>
14998
14999         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15000         now called proggie.dbg and it's a binary file.
15001
15002 2002-08-23  Martin Baulig  <martin@gnome.org>
15003
15004         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15005
15006 2002-08-23  Martin Baulig  <martin@gnome.org>
15007
15008         * struct.cs (MyStructInfo.ctor): Make this work with empty
15009         structs; it's not allowed to use foreach() on null.
15010
15011 2002-08-23  Martin Baulig  <martin@gnome.org>
15012
15013         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15014         writer the full pathname of the generated assembly.
15015
15016 2002-08-23  Martin Baulig  <martin@gnome.org>
15017
15018         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15019         A `finally' block never returns or breaks; improved handling of
15020         unreachable code.
15021
15022 2002-08-23  Martin Baulig  <martin@gnome.org>
15023
15024         * statement.cs (Throw.Resolve): Allow `throw null'.
15025
15026 2002-08-23  Martin Baulig  <martin@gnome.org>
15027
15028         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15029         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15030         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15031         MemberLookup would return a wrong event if this is an explicit
15032         interface implementation and the class has an event with the same
15033         name.
15034
15035 2002-08-23  Martin Baulig  <martin@gnome.org>
15036
15037         * statement.cs (Block.AddChildVariableNames): New public method.
15038         (Block.AddChildVariableName): Likewise.
15039         (Block.IsVariableNameUsedInChildBlock): Likewise.
15040         (Block.AddVariable): Check whether a variable name has already
15041         been used in a child block.
15042
15043         * cs-parser.jay (declare_local_variables): Mark all variable names
15044         from the current block as being used in a child block in the
15045         implicit block.
15046
15047 2002-08-23  Martin Baulig  <martin@gnome.org>
15048
15049         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15050         find the symbol writer.
15051
15052         * driver.cs: csc also allows the arguments to /define being
15053         separated by commas, not only by semicolons.
15054
15055 2002-08-23  Martin Baulig  <martin@gnome.org>
15056
15057         * interface.cs (Interface.GetMembers): Added static check for events.
15058
15059 2002-08-15  Martin Baulig  <martin@gnome.org>
15060
15061         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15062         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15063
15064         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15065         why the MethodData.EmitDestructor() change was necessary.
15066
15067 2002-08-20  Martin Baulig  <martin@gnome.org>
15068
15069         * class.cs (TypeContainer.FindMembers): Added static check for events.
15070
15071         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15072
15073         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15074         use Type.GetEvents(), not Type.FindMembers().
15075
15076 2002-08-20  Martin Baulig  <martin@gnome.org>
15077
15078         * decl.cs (MemberCache): Added a special method cache which will
15079         be used for method-only searched.  This ensures that a method
15080         search will return a MethodInfo with the correct ReflectedType for
15081         inherited methods.      
15082
15083 2002-08-20  Martin Baulig  <martin@gnome.org>
15084
15085         * decl.cs (DeclSpace.FindMembers): Made this public.
15086
15087 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15088
15089         * delegate.cs: fixed build on windows.
15090         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15091
15092 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15093
15094         * ecore.cs (StandardConversionExists): Return a false
15095         if we are trying to convert the void type to anything else
15096         since that is not allowed.
15097
15098         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15099         we flag error 70 in the event an event is trying to be accessed
15100         directly from outside the declaring type.
15101
15102 2002-08-20  Martin Baulig  <martin@gnome.org>
15103
15104         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15105         MemberCache from typemanager.cs to decl.cs.
15106
15107 2002-08-19  Martin Baulig  <martin@gnome.org>
15108
15109         * class.cs (TypeContainer): Implement IMemberContainer.
15110         (TypeContainer.DefineMembers): Create the MemberCache.
15111         (TypeContainer.FindMembers): Do better BindingFlags checking; only
15112         return public members if BindingFlags.Public was given, check
15113         whether members are static.
15114
15115 2002-08-16  Martin Baulig  <martin@gnome.org>
15116
15117         * decl.cs (DeclSpace.Define): Splitted this in Define and
15118         DefineMembers.  DefineMembers is called first and initializes the
15119         MemberCache.
15120
15121         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
15122         DefineMembers() on all our DeclSpaces.
15123
15124         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15125         but call DefineMembers() on all nested interfaces.  We call their
15126         Define() in our new Define() function.
15127
15128         * interface.cs (Interface): Implement IMemberContainer.
15129         (Interface.Define): Moved all code except the attribute stuf to
15130         DefineMembers().
15131         (Interface.DefineMembers): Initialize the member cache.
15132
15133         * typemanager.cs (IMemberFinder): Removed this interface, we don't
15134         need this anymore since we can use MemberCache.FindMembers directly.
15135
15136 2002-08-19  Martin Baulig  <martin@gnome.org>
15137
15138         * typemanager.cs (MemberCache): When creating the cache for an
15139         interface type, add all inherited members.
15140         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15141         to `out bool used_cache' and documented it.
15142         (TypeManager.MemberLookup): If we already used the cache in the first
15143         iteration, we don't need to do the interfaces check.
15144
15145 2002-08-19  Martin Baulig  <martin@gnome.org>
15146
15147         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
15148         here from IMemberFinder and don't implement this interface anymore.
15149         (DeclSpace.MemberCache): Moved here from IMemberFinder.
15150
15151         * typemanager.cs (IMemberFinder): This interface is now only used by
15152         classes which actually support the member cache.
15153         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15154         since we only put DeclSpaces into this Hashtable.
15155         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15156         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15157
15158 2002-08-16  Martin Baulig  <martin@gnome.org>
15159
15160         * typemanager.cs (ICachingMemberFinder): Removed.
15161         (IMemberFinder.MemberCache): New property.
15162         (TypeManager.FindMembers): Merged this with RealFindMembers().
15163         This function will never be called from TypeManager.MemberLookup()
15164         so we can't use the cache here, just the IMemberFinder.
15165         (TypeManager.MemberLookup_FindMembers): Check whether the
15166         IMemberFinder has a MemberCache and call the cache's FindMembers
15167         function.
15168         (MemberCache): Rewrote larger parts of this yet another time and
15169         cleaned it up a bit.
15170
15171 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15172
15173         * driver.cs (LoadArgs): Support quoting.
15174
15175         (Usage): Show the CSC-like command line arguments.
15176
15177         Improved a few error messages.
15178
15179 2002-08-15  Martin Baulig  <martin@gnome.org>
15180
15181         * typemanager.cs (IMemberContainer.Type): New property.
15182         (IMemberContainer.IsInterface): New property.
15183
15184         The following changes are conditional to BROKEN_RUNTIME, which is
15185         defined at the top of the file.
15186
15187         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15188         class'es members, but add all members from TypeHandle.ObjectType
15189         if we're an interface.
15190         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15191         is the current type.
15192         (MemberCache.CacheEntry.Container): Removed this field.
15193         (TypeHandle.GetMembers): Include inherited members.
15194
15195 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15196
15197         * typemanager.cs: fixed compilation and added a comment on a field that
15198         is never used.
15199
15200 2002-08-15  Martin Baulig  <martin@gnome.org>
15201
15202         * class.cs (ConstructorInitializer.Resolve): In the
15203         Expression.MemberLookup call, use the queried_type as
15204         invocation_type.
15205
15206         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15207         declared' attribute, it's always true.
15208         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15209         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15210         temporary wrapper for FindMembers which tells MemberLookup whether
15211         members from the base classes are included in the return value.
15212         This will go away soon.
15213         (TypeManager.MemberLookup): Use this temporary hack here; once the
15214         new MemberCache is completed, we don't need to do the DeclaredOnly
15215         looping here anymore since the MemberCache will take care of this.
15216         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15217         (MemberCache): When creating the MemberCache for a class, get
15218         members from the current class and all its base classes.
15219         (MemberCache.CacheEntry.Container): New field.  This is a
15220         temporary hack until the Mono runtime is fixed to distinguish
15221         between ReflectedType and DeclaringType.  It allows us to use MCS
15222         with both the MS runtime and the unfixed Mono runtime without
15223         problems and without accecting performance.
15224         (MemberCache.SearchMembers): The DeclaredOnly looping from
15225         TypeManager.MemberLookup is now done here.      
15226
15227 2002-08-14  Martin Baulig  <martin@gnome.org>
15228
15229         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15230         Type.GetFields on dynamic types but get the fields from the
15231         corresponding TypeContainer.
15232         (MyStructInfo.GetStructInfo): Added check for enum types.
15233
15234         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15235         (MemberList.SyncRoot): Implemented.
15236         (TypeManager.FilterWithClosure): No need to check permissions if
15237         closure_start_type == closure_invocation_type, don't crash if
15238         closure_invocation_type is null.
15239
15240 2002-08-13  Martin Baulig  <martin@gnome.org>
15241
15242         Rewrote TypeContainer.FindMembers to use a member cache.  This
15243         gives us a speed increase of about 35% for the self-hosting MCS
15244         build and of about 15-20% for the class libs (both on GNU/Linux).
15245
15246         * report.cs (Timer): New class to get enhanced profiling.  This
15247         whole class is "TIMER" conditional since it remarkably slows down
15248         compilation speed.
15249
15250         * class.cs (MemberList): New class.  This is an IList wrapper
15251         which we're now using instead of passing MemberInfo[]'s around to
15252         avoid copying this array unnecessarily.
15253         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15254         (ICachingMemberFinder, IMemberContainer): New interface.
15255         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15256         has already been checked, otherwise use it for the name comparision.
15257         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15258         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15259         if possible.  Returns a MemberList, not a MemberInfo [].
15260         (TypeHandle): New class, implements IMemberContainer.  We create
15261         one instance of this class per type, it contains a MemberCache
15262         which is used to do the member lookups.
15263         (MemberCache): New class.  Each instance of this class contains
15264         all members of a type and a name-based hash table.
15265         (MemberCache.FindMembers): This is our new member lookup
15266         function.  First, it looks up all members of the requested name in
15267         the hash table.  Then, it walks this list and sorts out all
15268         applicable members and returns them.
15269
15270 2002-08-13  Martin Baulig  <martin@gnome.org>
15271
15272         In addition to a nice code cleanup, this gives us a performance
15273         increase of about 1.4% on GNU/Linux - not much, but it's already
15274         half a second for the self-hosting MCS compilation.
15275
15276         * typemanager.cs (IMemberFinder): New interface.  It is used by
15277         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15278         Enum, Delegate or Interface.
15279         (TypeManager.finder_to_member_finder): New PtrHashtable.
15280         (TypeManager.finder_to_container): Removed.
15281         (TypeManager.finder_to_delegate): Removed.
15282         (TypeManager.finder_to_interface): Removed.
15283         (TypeManager.finder_to_enum): Removed.
15284
15285         * interface.cs (Interface): Implement IMemberFinder.
15286
15287         * delegate.cs (Delegate): Implement IMemberFinder.
15288
15289         * enum.cs (Enum): Implement IMemberFinder.
15290
15291         * class.cs (TypeContainer): Implement IMemberFinder.
15292
15293 2002-08-12  Martin Baulig  <martin@gnome.org>
15294
15295         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15296
15297 2002-08-12  Martin Baulig  <martin@gnome.org>
15298
15299         * ecore.cs (ITypeExpression): New interface for expressions which
15300         resolve to a type.
15301         (TypeExpression): Renamed to TypeLookupExpression.
15302         (Expression.DoResolve): If we're doing a types-only lookup, the
15303         expression must implement the ITypeExpression interface and we
15304         call DoResolveType() on it.
15305         (SimpleName): Implement the new ITypeExpression interface.
15306         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15307         hack, the situation that we're only looking up types can't happen
15308         anymore when this method is called.  Moved the type lookup code to
15309         DoResolveType() and call it.
15310         (SimpleName.DoResolveType): This ITypeExpression interface method
15311         is now doing the types-only lookup.
15312         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15313         (ResolveFlags): Added MaskExprClass.
15314
15315         * expression.cs (MemberAccess): Implement the ITypeExpression
15316         interface.
15317         (MemberAccess.DoResolve): Added support for a types-only lookup
15318         when we're called via ITypeExpression.DoResolveType().
15319         (ComposedCast): Implement the ITypeExpression interface.
15320
15321         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15322         Expression.Resolve() with ResolveFlags.Type instead.
15323
15324 2002-08-12  Martin Baulig  <martin@gnome.org>
15325
15326         * interface.cs (Interface.Define): Apply attributes.
15327
15328         * attribute.cs (Attribute.ApplyAttributes): Added support for
15329         interface attributes.
15330
15331 2002-08-11  Martin Baulig  <martin@gnome.org>
15332
15333         * statement.cs (Block.Emit): Only check the "this" variable if we
15334         do not always throw an exception.
15335
15336         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15337         whether the property has a set accessor.
15338
15339 2002-08-11  Martin Baulig  <martin@gnome.org>
15340
15341         Added control flow analysis support for structs.
15342
15343         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15344         with control flow analysis turned off.
15345         (IVariable): New interface.
15346         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15347         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15348         (FieldExpr.DoResolve): Resolve the instance expression with flow
15349         analysis turned off and do the definite assignment check after the
15350         resolving when we know what the expression will resolve to.
15351
15352         * expression.cs (LocalVariableReference, ParameterReference):
15353         Implement the new IVariable interface, only call the flow analysis
15354         code if ec.DoFlowAnalysis is true.
15355         (This): Added constructor which takes a Block argument.  Implement
15356         the new IVariable interface.
15357         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15358         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15359         This does the definite assignment checks for struct members.
15360
15361         * class.cs (Constructor.Emit): If this is a non-static `struct'
15362         constructor which doesn't have any initializer, call
15363         Block.AddThisVariable() to tell the flow analysis code that all
15364         struct elements must be initialized before control returns from
15365         the constructor.
15366
15367         * statement.cs (MyStructInfo): New public class.
15368         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15369         argument to this indexer.  If non-zero, check an individual struct
15370         member, not the whole struct.
15371         (FlowBranching.CheckOutParameters): Check struct members.
15372         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15373         overloaded versions of these methods which take an additional
15374         `int field_idx' argument to check struct members.
15375         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15376         overloaded versions of these methods which take an additional
15377         `string field_name' argument to check struct member.s
15378         (VariableInfo): Implement the IVariable interface.
15379         (VariableInfo.StructInfo): New public property.  Returns the
15380         MyStructInfo instance of the variable if it's a struct or null.
15381         (Block.AddThisVariable): New public method.  This is called from
15382         Constructor.Emit() for non-static `struct' constructor which do
15383         not have any initializer.  It creates a special variable for the
15384         "this" instance variable which will be checked by the flow
15385         analysis code to ensure that all of the struct's fields are
15386         initialized before control returns from the constructor.
15387         (UsageVector): Added support for struct members.  If a
15388         variable/parameter is a struct with N members, we reserve a slot
15389         in the usage vector for each member.  A struct is considered fully
15390         initialized if either the struct itself (slot 0) or all its
15391         members are initialized.
15392
15393 2002-08-08  Martin Baulig  <martin@gnome.org>
15394
15395         * driver.cs (Driver.MainDriver): Only report an error CS5001
15396         if there were no compilation errors.
15397
15398         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15399         `UnsafeContext' property to determine whether the parent is in
15400         unsafe context rather than checking the parent's ModFlags:
15401         classes nested in an unsafe class are unsafe as well.
15402
15403 2002-08-08  Martin Baulig  <martin@gnome.org>
15404
15405         * statement.cs (UsageVector.MergeChildren): Distinguish between
15406         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15407         we return.  Added test17() and test18() to test-154.cs.
15408
15409 2002-08-08  Martin Baulig  <martin@gnome.org>
15410
15411         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15412         Family access, make sure the invoking type isn't a subclass of the
15413         queried type (that'd be a CS1540).
15414
15415         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15416         this method which takes an additional `Type invocation_type'.
15417
15418         * expression.cs (BaseAccess.DoResolve): Use the base type as
15419         invocation and query type.
15420         (MemberAccess.DoResolve): If the lookup failed and we're about to
15421         report a CS0122, try a lookup with the ec.ContainerType - if this
15422         succeeds, we must report a CS1540.
15423
15424 2002-08-08  Martin Baulig  <martin@gnome.org>
15425
15426         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15427         (MethodGroupExpr): Implement the IMemberExpr interface.
15428
15429         * expression (MemberAccess.ResolveMemberAccess): No need to have
15430         any special code for MethodGroupExprs anymore, they're now
15431         IMemberExprs.   
15432
15433 2002-08-08  Martin Baulig  <martin@gnome.org>
15434
15435         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15436         Family, FamANDAssem and FamORAssem permissions.
15437         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15438
15439 2002-08-08  Martin Baulig  <martin@gnome.org>
15440
15441         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15442         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15443         or loop block.
15444
15445 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15446
15447         * driver.cs: implemented /resource option to embed managed resources.
15448
15449 2002-08-07  Martin Baulig  <martin@gnome.org>
15450
15451         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15452         (FieldBase.HasFieldInitializer): New public property.
15453         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15454         returns the field initializer and makes sure it is only resolved once.
15455         (TypeContainer.EmitFieldInitializers): Call
15456         FieldBase.GetInitializerExpression to get the initializer, this ensures
15457         that it isn't resolved multiple times.
15458
15459         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15460         the resolving process (SimpleName/MemberLookup) that we're currently
15461         emitting a field initializer (which must not access any instance members,
15462         this is an error CS0236).
15463
15464         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15465         argument, if the `IsFieldInitializer' flag is set, we must report and
15466         error CS0236 and not an error CS0120.   
15467
15468 2002-08-07  Martin Baulig  <martin@gnome.org>
15469
15470         * ecore.cs (IMemberExpr): New public interface.
15471         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15472         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15473         if the expression is an IMemberExpr.
15474
15475         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15476         to be null, implicitly default to `this' if we're non-static in
15477         this case.  Simplified the code a lot by using the new IMemberExpr
15478         interface.  Also fixed bug #28176 here.
15479
15480 2002-08-06  Martin Baulig  <martin@gnome.org>
15481
15482         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15483         ParameterReferences during semantic analysis so that we can do a
15484         type-only search when resolving Cast, TypeOf and SizeOf.
15485         (block): Pass the `current_local_parameters' to the Block's
15486         constructor.
15487
15488         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15489         argument to the constructor.
15490         (ConstructorInitializer.Resolve): Create a temporary implicit
15491         block with the parameters.
15492
15493         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15494         references here if we aren't doing a type-only search.
15495
15496         * statement.cs (Block): Added constructor which takes a
15497         `Parameters parameters' argument.
15498         (Block.Parameters): New public property.
15499
15500         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15501         to `Parameters' and made it public readonly.
15502
15503 2002-08-06  Martin Baulig  <martin@gnome.org>
15504
15505         * ecore.cs (Expression.Warning): Made this public as well.
15506
15507         * report.cs (Report.Debug): Print the contents of collections.
15508
15509 2002-08-06  Martin Baulig  <martin@gnome.org>
15510
15511         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15512         used to tell Resolve() which kinds of expressions it may return.
15513         (Expression.Resolve): Added overloaded version of this method which
15514         takes a `ResolveFlags flags' argument.  This can be used to tell
15515         Resolve() which kinds of expressions it may return.  Reports a
15516         CS0118 on error.
15517         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15518         ResolveFlags.SimpleName.
15519         (Expression.Error118): Added overloaded version of this method which
15520         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15521         which kinds of expressions are allowed.
15522
15523         * expression.cs (Argument.ResolveMethodGroup): New public method.
15524         Resolves an argument, but allows a MethodGroup to be returned.
15525         This is used when invoking a delegate.
15526
15527         * TODO: Updated a bit.
15528
15529 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15530
15531         Fixed compilation with csc.
15532
15533         * ecore.cs: Expression.Error made public. Is this correct? Should
15534         Warning be made public too?
15535
15536         * expression.cs: use ea.Location instead of ea.loc.
15537         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15538
15539 2002-08-06  Martin Baulig  <martin@gnome.org>
15540
15541         * ecore.cs (Expression.loc): Moved the location here instead of
15542         duplicating it in all derived classes.
15543         (Expression.Location): New public property.
15544         (Expression.Error, Expression.Warning): Made them non-static and
15545         removed the location argument.
15546         (Expression.Warning): Added overloaded version which takes an
15547         `int level' argument.
15548         (Expression.Error118): Make this non-static and removed the
15549         expression and location arguments.
15550         (TypeExpr): Added location argument to the constructor.
15551
15552         * expression.cs (StaticCallExpr): Added location argument to
15553         the constructor.
15554         (Indirection, PointerArithmetic): Likewise.
15555         (CheckedExpr, UnCheckedExpr): Likewise.
15556         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15557         (StringPtr): Likewise.
15558
15559
15560 2002-08-05  Martin Baulig  <martin@gnome.org>
15561
15562         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15563
15564         * assign.cs (Assign.DoResolve): Check whether the source
15565         expression is a value or variable.
15566
15567         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15568         while resolving the corresponding blocks.
15569
15570         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15571         an error, don't silently return null.
15572
15573         * statement.cs (Block.AddVariable): Do the error reporting here
15574         and distinguish between CS0128 and CS0136.
15575         (Block.DoResolve): Report all unused labels (warning CS0164).
15576         (LabeledStatement): Pass the location to the constructor.
15577         (LabeledStatement.HasBeenReferenced): New property.
15578         (LabeledStatement.Resolve): Set it to true here.
15579
15580         * statement.cs (Return.Emit): Return success even after reporting
15581         a type mismatch error (CS0126 or CS0127), this is what csc does and
15582         it avoids confusing the users with any consecutive errors.
15583
15584 2002-08-05  Martin Baulig  <martin@gnome.org>
15585
15586         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15587
15588         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15589
15590         * expression.cs (MemberAccess.DoResolve): Silently return if an
15591         error has already been reported.
15592
15593         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15594         error has already been reported.
15595
15596 2002-08-05  Martin Baulig  <martin@gnome.org>
15597
15598         * statement.cs (UsageVector): Only initialize the `parameters'
15599         vector if we actually have any "out" parameters.
15600
15601 2002-08-05  Martin Baulig  <martin@gnome.org>
15602
15603         * expression.cs (Binary.ResolveOperator): When combining delegates,
15604         they must have the same type.
15605
15606 2002-08-05  Martin Baulig  <martin@gnome.org>
15607
15608         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15609         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15610         work with the ms runtime and we also don't need it: if we're a
15611         PropertyBuilder and not in the `indexer_arguments' hash, then we
15612         are a property and not an indexer.
15613
15614         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15615         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15616         since the latter one doesn't work with the ms runtime.
15617
15618 2002-08-03  Martin Baulig  <martin@gnome.org>
15619
15620         Fixed bugs #27998 and #22735.
15621
15622         * class.cs (Method.IsOperator): New public field.
15623         (Method.CheckBase): Report CS0111 if there's already a method
15624         with the same parameters in the current class.  Report CS0508 when
15625         attempting to change the return type of an inherited method.
15626         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15627         and it's not marked abstract or extern.
15628         (PropertyBase): New abstract base class for Property and Indexer.
15629         (PropertyBase.CheckBase): Moved here from Property and made it work
15630         for indexers.
15631         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15632         the same so we can reuse it there.
15633         (Property, Indexer): Derive from PropertyBase.
15634         (MethodSignature.inheritable_property_signature_filter): New delegate
15635         to find properties and indexers.
15636
15637         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15638         argument and improved error reporting.
15639
15640         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15641         EmptyReadOnlyParameters and made it a property.
15642
15643         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15644         version of this method which takes a `PropertyInfo indexer'.
15645         (TypeManager.RegisterIndexer): New method.
15646
15647         * class.cs: Added myself as author of this file :-)
15648
15649 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15650
15651         * class.cs: fixed compilation on windoze.
15652
15653 2002-08-03  Martin Baulig  <martin@gnome.org>
15654
15655         * interface.cs (Interface.GetInterfaceBases): Check whether all
15656         base interfaces are at least as accessible than the current one.
15657
15658         * class.cs (TypeContainer.GetClassBases): Check whether base types
15659         are at least as accessible than the current type.
15660         (TypeContainer.AsAccessible): Implemented and made non-static.
15661         (MemberBase.CheckParameters): Report errors if the accessibility
15662         checks fail.
15663
15664         * delegate.cs (Delegate.Delegate): The default visibility is
15665         internal for top-level types and private for nested types.
15666         (Delegate.Define): Report errors if the accessibility checks fail.
15667
15668         * enum.cs (Enum.Enum): The default visibility is internal for
15669         top-level types and private for nested types.
15670         (Enum.DefineType): Compute the correct visibility.
15671
15672         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15673         function which takes a `bool is_toplevel' instead of a TypeContainer.
15674
15675         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15676         builtin type.
15677
15678 2002-08-02  Martin Baulig  <martin@gnome.org>
15679
15680         * expression.cs (LocalVariableReferenc): Added constructor which
15681         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15682         (LocalVariableReference.IsReadOnly): New property.
15683         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15684         variable is readonly, use our own readonly flag to do this; you can
15685         use the new constructor to get a writable reference to a read-only
15686         variable.
15687
15688         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15689         reference to the local variable.
15690
15691 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15692
15693         * rootcontext.cs (ResolveCore): Also include System.Exception
15694
15695         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15696         we reach an EmptyStatement.
15697
15698         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15699         is also fine.
15700
15701         * expression.cs (Binary.ResolveOperator): Check error result in
15702         two places.
15703
15704         use brtrue/brfalse directly and avoid compares to null.
15705
15706 2002-08-02  Martin Baulig  <martin@gnome.org>
15707
15708         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15709         Fixes bug #28407, added test-155.cs.
15710
15711 2002-08-01  Martin Baulig  <martin@gnome.org>
15712
15713         * class.cs (Event.EmitDefaultMethod): Make this work with static
15714         events.  Fixes #28311, added verify-3.cs.
15715
15716 2002-08-01  Martin Baulig  <martin@gnome.org>
15717
15718         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15719         `is_disposable' fields.
15720         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15721         `hm.is_disposable' if we're using the collection pattern.
15722         (Foreach.EmitCollectionForeach): Use the correct type for the
15723         enumerator's local variable, only emit the try/finally block if
15724         necessary (fixes #27713).
15725
15726 2002-08-01  Martin Baulig  <martin@gnome.org>
15727
15728         * ecore.cs (Expression.report118): Renamed to Error118 and made
15729         it public static.
15730
15731         * statement.cs (Throw.Resolve): Check whether the expression is of
15732         the correct type (CS0118) and whether the type derives from
15733         System.Exception (CS0155).
15734         (Catch.Resolve): New method.  Do the type lookup here and check
15735         whether it derives from System.Exception (CS0155).
15736         (Catch.CatchType, Catch.IsGeneral): New public properties.
15737
15738         * typemanager.cs (TypeManager.exception_type): Added.
15739
15740 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15741
15742         * driver.cs: Updated About function.
15743
15744 2002-07-31  Martin Baulig  <martin@gnome.org>
15745
15746         Implemented Control Flow Analysis.
15747
15748         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15749         (EmitContext.CurrentBranching): Added.
15750         (EmitContext.StartFlowBranching): Added.
15751         (EmitContext.EndFlowBranching): Added.
15752         (EmitContext.KillFlowBranching): Added.
15753         (EmitContext.IsVariableAssigned): Added.
15754         (EmitContext.SetVariableAssigned): Added.
15755         (EmitContext.IsParameterAssigned): Added.
15756         (EmitContext.SetParameterAssigned): Added.
15757         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15758         Added control flow analysis stuff here.
15759
15760         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15761         resolve the expression as lvalue.
15762         (LocalVariableReference.DoResolve): Check whether the variable has
15763         already been assigned.
15764         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15765         the parameter as assigned here.
15766         (ParameterReference.DoResolve): Check whether the parameter has already
15767         been assigned.
15768         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15769         expression as lvalue.
15770
15771         * statement.cs (FlowBranching): New class for the flow analysis code.
15772         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15773         (LabeledStatement.IsDefined): New public property.
15774         (LabeledStatement.AddUsageVector): New public method to tell flow
15775         analyis that the label may be reached via a forward jump.
15776         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15777         flow analysis.
15778         (VariableInfo.Number): New public field.  This is used by flow analysis
15779         to number all locals of a block.
15780         (Block.CountVariables): New public property.  This is the number of
15781         local variables in this block (including the locals from all parent
15782         blocks).
15783         (Block.EmitMeta): Number all the variables.
15784
15785         * statement.cs: Added flow analysis support to all classes.
15786
15787 2002-07-31  Martin Baulig  <martin@gnome.org>
15788
15789         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15790         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15791         then use this argument.
15792
15793         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15794
15795         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15796         use this to specify /define options.
15797
15798 2002-07-29  Martin Baulig  <martin@gnome.org>
15799
15800         * statement.cs (Fixed): Moved all code that does variable lookups
15801         and resolvings from Emit to Resolve.
15802
15803         * statement.cs (For): Moved all code that does variable lookups
15804         and resolvings from Emit to Resolve.
15805
15806         * statement.cs (Using): Moved all code that does variable lookups
15807         and resolvings from Emit to Resolve.
15808
15809 2002-07-29  Martin Baulig  <martin@gnome.org>
15810
15811         * attribute.cs (Attribute.Resolve): Explicitly catch a
15812         System.NullReferenceException when creating the
15813         CustromAttributeBuilder and report a different warning message.
15814
15815 2002-07-29  Martin Baulig  <martin@gnome.org>
15816
15817         * support.cs (ParameterData.ParameterName): Added method to
15818         get the name of a parameter.
15819
15820         * typemanager.cs (TypeManager.IsValueType): New public method.
15821
15822 2002-07-29  Martin Baulig  <martin@gnome.org>
15823
15824         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15825         is a flag which specifies that it's either ref or out.
15826         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15827         the out parameter to `out Parameter.Modifier mod', also set the
15828         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15829
15830         * support.cs (InternalParameters.ParameterModifier): Distinguish
15831         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15832         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15833
15834         * expression.cs (Argument.GetParameterModifier): Distinguish
15835         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15836         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15837
15838 2002-07-29  Martin Baulig  <martin@gnome.org>
15839
15840         * expression.cs (ParameterReference.ParameterReference): Added
15841         `Location loc' argument to the constructor.
15842
15843         * cs-parser.jay: Pass location to ParameterReference.
15844
15845 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15846
15847         * statement.cs (Try): Initialize the location.
15848
15849         * cs-parser.jay: pass location to Try.
15850
15851         * expression.cs (Unary.Reduce): Change the prototype to return
15852         whether a constant fold could be performed or not.  The result is
15853         returned in an out parameters.  In the case of Indirection and
15854         AddressOf, we want to perform the full tests.
15855
15856 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15857
15858         * statement.cs (Statement.Emit): Flag dead code.
15859
15860 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15861
15862         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15863
15864 2002-07-27  Martin Baulig  <martin@gnome.org>
15865
15866         * class.cs (MethodData.Define): Put back call to
15867         TypeManager.AddMethod(), accidentally commented this out.
15868
15869         * report.cs (Debug): New public method to print debugging information,
15870         this is `[Conditional ("DEBUG")]'.
15871
15872 2002-07-26  Martin Baulig  <martin@gnome.org>
15873
15874         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15875         (switch_statement): Push the current_block to the switch_stack and
15876         pop it again when we're done with the switch.
15877         (switch_section): The new block is a child of the current_block.
15878         Fixes bug #24007, added test-152.cs.
15879
15880 2002-07-27  Martin Baulig  <martin@gnome.org>
15881
15882         * expression.cs (Invocation.EmitArguments): When calling a varargs
15883         function with only its fixed arguments, we need to pass an empty
15884         array.
15885
15886 2002-07-27  Martin Baulig  <martin@gnome.org>
15887
15888         Mono 0.13 has been released.
15889
15890 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15891
15892         * driver.cs: Rename --resource to --linkres, because that is what
15893         we do currently, we dont support --resource yet.
15894
15895         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15896
15897 2002-07-25  Martin Baulig  <martin@gnome.org>
15898
15899         * class.cs (MethodData): New public class.  This is a `method builder'
15900         class for a method or one accessor of a Property/Indexer/Event.
15901         (MethodData.GetMethodFlags): Moved here from MemberBase.
15902         (MethodData.ApplyAttributes): Likewise.
15903         (MethodData.ApplyObsoleteAttribute): Likewise.
15904         (MethodData.ApplyConditionalAttribute): Likewise.
15905         (MethodData.ApplyDllImportAttribute): Likewise.
15906         (MethodData.CheckAbstractAndExternal): Likewise.
15907         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15908         (MethodData.Emit): Formerly known as Method.Emit().
15909         (MemberBase): Moved everything which was specific to a single
15910         accessor/method to MethodData.
15911         (Method): Create a new MethodData and call Define() and Emit() on it.
15912         (Property, Indexer, Event): Create a new MethodData objects for each
15913         accessor and call Define() and Emit() on them.
15914
15915 2002-07-25  Martin Baulig  <martin@gnome.org>
15916
15917         Made MethodCore derive from MemberBase to reuse the code from there.
15918         MemberBase now also checks for attributes.
15919
15920         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15921         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15922         as virtual.
15923         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15924         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15925         (MemberBase.ApplyAttributes): New virtual method; applies the
15926         attributes to a method or accessor.
15927         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15928         (MemberBase.ApplyConditionalAttribute): Likewise.
15929         (MemberBase.ApplyDllImportAttribute): Likewise.
15930         (MemberBase.CheckAbstractAndExternal): Likewise.
15931         (MethodCore.ParameterTypes): This is now a property instead of a
15932         method, it's initialized from DoDefineParameters().
15933         (MethodCore.ParameterInfo): Removed the set accessor.
15934         (MethodCore.DoDefineParameters): New protected virtual method to
15935         initialize ParameterTypes and ParameterInfo.
15936         (Method.GetReturnType): We can now simply return the MemberType.
15937         (Method.GetMethodFlags): Override the MemberBase version and add
15938         the conditional flags.
15939         (Method.CheckBase): Moved some code from Define() here, call
15940         DoDefineParameters() here.
15941         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15942         here to avoid some larger code duplication.
15943         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15944         ensure that abstract and external accessors don't declare a body.
15945
15946         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15947         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15948         lookup in the attribute's parent classes, so we need to abort as soon
15949         as we found the first match.
15950         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15951         the attribute has no arguments.
15952
15953         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15954         of a Method.
15955
15956 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15957
15958         * cs-parser.jay: reverted previous patch.
15959
15960 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15961
15962         * cs-parser.jay: fixed bug #22119.
15963
15964 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15965
15966         * attribute.cs: fixed compilation. The error was:
15967         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15968         be assigned to before control leaves the current method."
15969         [FIXME:  Filed as bug #28186: MCS must report this error.]
15970
15971 2002-07-25  Martin Baulig  <martin@gnome.org>
15972
15973         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15974         method to pull the condition name ouf of a Conditional attribute.
15975         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15976         the obsolete message and error flag out of an Obsolete attribute.
15977
15978         * class.cs (Method.GetMethodFlags): New public method to get the
15979         TypeManager.MethodFlags for this method.
15980         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15981         private methods.
15982         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15983         if we're overriding a virtual function, set the new private variable
15984         `parent_method'; call the new TypeManager.AddMethod().
15985
15986         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15987         the MethodBuilder and the Method in a PtrHashtable.
15988         (TypeManager.builder_to_method): Added for this purpose.
15989         (TypeManager.MethodFlags): Added IsObsoleteError.
15990         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15991         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15992         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15993         the message from the attribute.
15994
15995 2002-07-24  Martin Baulig  <martin@gnome.org>
15996
15997         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15998         preprocessor directives, ensure that the argument to #define/#undef is
15999         exactly one identifier and that it's actually an identifier.
16000
16001         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16002         did not work ....
16003
16004 2002-07-24  Martin Baulig  <martin@gnome.org>
16005
16006         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16007         initialize it to TypeManager.object_type in the constructor.
16008         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16009         of the `hm.get_current' method if we're using the collection pattern.
16010         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16011         for the explicit conversion to make it work when we're using the collection
16012         pattern and the `Current' property has a different return type than `object'.
16013         Fixes #27713.
16014
16015 2002-07-24  Martin Baulig  <martin@gnome.org>
16016
16017         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16018         does not match, but don't report any errors.  This method is called in
16019         order for all methods in a MethodGroupExpr until a matching method is
16020         found, so we don't want to bail out if the first method doesn't match.
16021         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16022         matches, report the 123.  Fixes #28070.
16023
16024 2002-07-24  Martin Baulig  <martin@gnome.org>
16025
16026         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16027         TypeManager.TypeToCoreType() to the top of the method so the
16028         following equality checks will work.  Fixes #28107.
16029
16030 2002-07-24  Martin Baulig  <martin@gnome.org>
16031
16032         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16033         operand is of type uint, and the other operand is of type sbyte,
16034         short or int, the operands are converted to type long." -
16035         Actually do what this comment already told us.  Fixes bug #28106,
16036         added test-150.cs.
16037
16038 2002-07-24  Martin Baulig  <martin@gnome.org>
16039
16040         * class.cs (MethodBase): New abstract class.  This is now a base
16041         class for Property, Indexer and Event to avoid some code duplication
16042         in their Define() and DefineMethods() methods.
16043         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16044         generic methods for Define() and DefineMethods().
16045         (FieldBase): Derive from MemberBase, not MemberCore.
16046         (Property): Derive from MemberBase, not MemberCore.
16047         (Property.DefineMethod): Moved all the code from this method to the
16048         new MethodBase.DefineAccessor(), just call it with appropriate
16049         argumetnts.
16050         (Property.Define): Call the new Property.DoDefine(), this does some
16051         sanity checks and we don't need to duplicate the code everywhere.
16052         (Event): Derive from MemberBase, not MemberCore.
16053         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16054         accessors, this will also make them work with interface events.
16055         (Indexer): Derive from MemberBase, not MemberCore.
16056         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16057         (Indexer.Define): Use the new MethodBase functions.
16058
16059         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16060         argument to the constructor.
16061         (Interface.FindMembers): Added support for interface events.
16062         (Interface.PopluateEvent): Implemented.
16063
16064         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16065
16066 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16067
16068         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16069         but this is required to check for a method name being the same as
16070         the containing class.  
16071
16072         Handle this now.
16073
16074 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16075
16076         * interface.cs: initialize variable.
16077
16078 2002-07-23  Martin Baulig  <martin@gnome.org>
16079
16080         Implemented the IndexerName attribute in interfaces.
16081
16082         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16083         name if this is an explicit interface implementation.
16084         (Indexer.InterfaceIndexerName): New public variable.  If we're
16085         implementing an interface indexer, this is the IndexerName in that
16086         interface.  Otherwise, it's the IndexerName.
16087         (Indexer.DefineMethod): If we're implementing interface indexer,
16088         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16089         and Pending.ImplementIndexer methods.
16090         (Indexer.Define): Also define the PropertyBuilder if we're
16091         implementing an interface indexer and this is neither an explicit
16092         interface implementation nor do the IndexerName match the one in
16093         the interface.
16094
16095         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16096         If a method is defined here, then we always need to create a proxy
16097         for it.  This is used when implementing interface indexers.
16098         (Pending.IsInterfaceIndexer): New public method.
16099         (Pending.ImplementIndexer): New public method.
16100         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16101         This is used when implementing interface indexers to define a proxy
16102         if necessary.
16103         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16104         define a proxy if necessary.
16105
16106         * interface.cs (Interface.IndexerName): New public variable.
16107         (Interface.PopulateIndexer): Set the IndexerName.
16108         (Interface.DefineIndexers): New private method.  Populate all the
16109         indexers and make sure their IndexerNames match.
16110
16111         * typemanager.cs (IndexerPropertyName): Added support for interface
16112         indexers.
16113
16114 2002-07-22  Martin Baulig  <martin@gnome.org>
16115
16116         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16117         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16118         ret if HasReturnLabel.
16119         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16120         variables.
16121
16122         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16123         and set the ec.LoopBeginTryCatchLevel.
16124         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16125         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16126         the current ec.TryCatchLevel, the branch goes out of an exception
16127         block.  In this case, we need to use Leave and not Br.
16128
16129 2002-07-22  Martin Baulig  <martin@gnome.org>
16130
16131         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16132         block unless the block does not always return or it is contained in
16133         another try { ... } catch { ... } block.  Fixes bug #26506.
16134         Added verify-1.cs to the test suite.
16135
16136 2002-07-22  Martin Baulig  <martin@gnome.org>
16137
16138         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16139         then we do not always return.  Fixes bug #24985.
16140
16141 2002-07-22  Martin Baulig  <martin@gnome.org>
16142
16143         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16144         lookup on a per-class level; ie. walk up the class hierarchy until we
16145         found at least one applicable method, then choose the best among them.
16146         Fixes bug #24463 and test-29.cs.
16147
16148 2002-07-22  Martin Baulig  <martin@gnome.org>
16149
16150         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16151         return types of the methods.  The return type is not part of the
16152         signature and we must not check it to make the `new' modifier work.
16153         Fixes bug #27999, also added test-147.cs.
16154         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16155
16156         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16157         on the method's return type.
16158
16159 2002-07-21  Martin Baulig  <martin@gnome.org>
16160
16161         * assign.cs: Make this work if the rightmost source is a constant and
16162         we need to do an implicit type conversion.  Also adding a few more tests
16163         to test-38.cs which should have caught this.
16164
16165         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16166         target in the makefile for this.  The makefile.gnu is primarily intended
16167         for end-users who don't want to debug the compiler.
16168
16169 2002-07-21  Martin Baulig  <martin@gnome.org>
16170
16171         * assign.cs: Improved the Assign class so it can now handle embedded
16172         assignments (X = Y = Z = something).  As a side-effect this'll now also
16173         consume less local variables.  test-38.cs now passes with MCS, added
16174         a few new test cases to that test.
16175
16176 2002-07-20  Martin Baulig  <martin@gnome.org>
16177
16178         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16179         instructions.  Fixes bug #27977, also added test-146.cs.
16180
16181 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16182
16183         * cs-tokenizer.cs: fixed getHex ().
16184
16185 2002-07-19  Martin Baulig  <martin@gnome.org>
16186
16187         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16188         not Type.GetType() to lookup the array type.  This is needed when
16189         we're constructing an array of a user-defined type.
16190         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16191         single-dimensional arrays, but also for single-dimensial arrays of
16192         type decimal.
16193
16194 2002-07-19  Martin Baulig  <martin@gnome.org>
16195
16196         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16197         this function is called, it's not allowed to share LocalBuilders
16198         among ILGenerators.
16199
16200 2002-07-19  Martin Baulig  <martin@gnome.org>
16201
16202         * expression.cs (Argument.Resolve): Report an error 118 when trying
16203         to pass a type as argument.
16204
16205 2002-07-18  Martin Baulig  <martin@gnome.org>
16206
16207         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16208         Conv_R_Un for the signed `long' type.
16209
16210 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16211
16212         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16213         `expr' for the temporary result, as that will fail if we do
16214         multiple resolves on the same expression.
16215
16216 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16217
16218         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16219         ec.TypeContainer for looking up aliases. 
16220
16221         * class.cs (TypeContainer): Remove LookupAlias from here.
16222
16223         * decl.cs (DeclSpace); Move here.
16224
16225 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16226
16227         * class.cs (FindMembers): Only call filter if the constructor
16228         bulider is not null.
16229
16230         Also handle delegates in `NestedTypes' now.  Now we will perform
16231         type lookups using the standard resolution process.  This also
16232         fixes a bug.
16233
16234         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16235         This uses Expressions (the limited kind that can be parsed by the
16236         tree) instead of strings.
16237
16238         * expression.cs (ComposedCast.ToString): Implement, used to flag
16239         errors since now we have to render expressions.
16240
16241         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16242         FormArrayType. 
16243
16244         * ecore.cs (SimpleName.ToString): ditto.
16245
16246         * cs-parser.jay: Instead of using strings to assemble types, use
16247         Expressions to assemble the type (using SimpleName, ComposedCast,
16248         MemberAccess).  This should fix the type lookups in declarations,
16249         because we were using a different code path for this.
16250
16251         * statement.cs (Block.Resolve): Continue processing statements
16252         even when there is an error.
16253
16254 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16255
16256         * class.cs (Event.Define): Also remove the `remove' method from
16257         the list of pending items.
16258
16259         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16260         generate more compact code. 
16261
16262 2002-07-17  Martin Baulig  <martin@gnome.org>
16263
16264         * const.cs (Const.LookupConstantValue): Add support for constant
16265         `unchecked' and `checked' expressions.
16266         Also adding test case test-140.cs for this.
16267
16268 2002-07-17  Martin Baulig  <martin@gnome.org>
16269
16270         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16271         check whether mi.ReturnType implements the IEnumerator interface; the
16272         `==' and the IsAssignableFrom() will fail in this situation.
16273
16274 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16275
16276         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16277         here too.
16278
16279 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16280
16281         * expression.cs: fixed bug #27811.
16282
16283 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16284
16285         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16286         Molaro: when we are a ref, the value already contains a pointer
16287         value, do not take the address of it.
16288
16289 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16290         * removed mb-parser.jay and mb-tokenizer.cs
16291
16292 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16293
16294         * expression.cs: check against the building corlib void type.
16295
16296 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16297
16298         * ecore.cs: fix for valuetype static readonly fields: when 
16299         initializing them, we need their address, not the address of a copy.
16300
16301 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16302
16303         * typemanager.cs: register also enum_type in corlib.
16304
16305 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16306
16307         * class.cs: allow calling this (but not base) initializers in structs.
16308
16309 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16310
16311         * ecore.cs: make sure we compare against the building base types
16312         in GetTypeSize ().
16313
16314 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16315
16316         * typemanager.cs: fix TypeToCoreType() to handle void and object
16317         (corlib gets no more typerefs after this change).
16318
16319 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16320
16321         * expression.cs (ArrayCreation.EmitArrayArguments): use
16322         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16323
16324         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16325         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16326         array indexes, the runtime actually forbids them.
16327
16328         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16329         for array arguments here.
16330
16331         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16332         instead of the default for ValueTypes.
16333
16334         (New.DoEmit): Use IsValueType instead of
16335         IsSubclassOf (value_type)
16336         (New.DoResolve): ditto.
16337         (Invocation.EmitCall): ditto.
16338
16339         * assign.cs (Assign): ditto.
16340
16341         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16342         Statements *are* currently doing part of their resolution during
16343         Emit.  
16344
16345         Expressions do always resolve during resolve, but statements are
16346         only required to propagate resolution to their children.
16347
16348 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16349
16350         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16351
16352         (LoadAssembly): Do not add the dll if it is already specified
16353
16354         (MainDriver): Add the System directory to the link path at the end,
16355         after all the other -L arguments. 
16356
16357         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16358         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16359         ldelem.u1) and using the opposite for sbytes.
16360
16361         This fixes Digger, and we can finally run it.
16362
16363         * driver.cs (UnixParseOption): Move the option parsing here.  
16364         (CSCParseOption): Implement CSC-like parsing of options.
16365
16366         We now support both modes of operation, the old Unix way, and the
16367         new CSC-like way.  This should help those who wanted to make cross
16368         platform makefiles.
16369
16370         The only thing broken is that /r:, /reference: and /lib: are not
16371         implemented, because I want to make those have the same semantics
16372         as the CSC compiler has, and kill once and for all the confussion
16373         around this.   Will be doing this tomorrow.
16374
16375         * statement.cs (Unsafe.Resolve): The state is checked during
16376         resolve, not emit, so we have to set the flags for IsUnsfe here.
16377
16378 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16379
16380         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16381         not catch the Error_ObjectRefRequired in SimpleName (as it is
16382         possible to have a class/instance variable name that later gets
16383         deambiguated), we have to check this here.      
16384
16385 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16386
16387         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16388         make static and put into Expression.
16389
16390         (Event.Define): Register the private field of the event with the 
16391         TypeManager so that GetFieldFromEvent can get at it.
16392
16393         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16394         keep track of the private field associated with an event which
16395         has no accessors.
16396
16397         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16398         private field.
16399
16400         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16401
16402 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16403
16404         * expression.cs (Binary.EmitBranchable): this routine emits the
16405         Binary expression in a branchable context.  This basically means:
16406         we need to branch somewhere, not just get the value on the stack.
16407
16408         This works together with Statement.EmitBoolExpression.
16409
16410         * statement.cs (Statement.EmitBoolExpression): Use
16411         EmitBranchable. 
16412
16413 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16414
16415         * statement.cs (For): Reduce the number of jumps in loops.
16416
16417         (For): Implement loop inversion for the For statement.
16418
16419         (Break): We can be breaking out of a Try/Catch controlled section
16420         (foreach might have an implicit try/catch clause), so we need to
16421         use Leave instead of Br.
16422
16423         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16424         now).  If the instace expression supports IMemoryLocation, we use
16425         the AddressOf method from the IMemoryLocation to extract the
16426         address instead of emitting the instance.
16427
16428         This showed up with `This', as we were emitting the instance
16429         always (Emit) instead of the Address of This.  Particularly
16430         interesting when This is a value type, as we dont want the Emit
16431         effect (which was to load the object).
16432
16433 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16434
16435         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16436
16437         * statement.cs (Checked): Set the CheckedState during the resolve
16438         process too, as the ConvCast operations track the checked state on
16439         the resolve process, and not emit.
16440
16441         * cs-parser.jay (namespace_member_declaration): Flag that we have
16442         found a declaration when we do.  This is used to flag error 1529
16443
16444         * driver.cs: Report ok when we display the help only.
16445
16446 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16447
16448         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16449
16450 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16451
16452         * cs-tokenizer.cs (define): We also have to track locally the
16453         defines.  AllDefines is just used for the Conditional Attribute,
16454         but we also need the local defines for the current source code. 
16455
16456 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16457
16458         * statement.cs (While, For, Do): These loops can exit through a
16459         Break statement, use this information to tell whether the
16460         statement is the last piece of code.
16461
16462         (Break): Flag that we break.
16463
16464         * codegen.cs (EmitContexts): New `Breaks' state variable.
16465
16466 2002-07-03  Martin Baulig  <martin@gnome.org>
16467
16468         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16469         modifiers in method declarations in structs.  Otherwise, you won't
16470         be able to override things like Object.Equals().
16471
16472 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16473
16474         * class.cs (Method, Property, Indexer): Do not allow the public
16475         modifier to be used in explicit interface implementations.
16476
16477         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16478         override modifiers in method declarations in structs
16479
16480 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16481
16482         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16483         integer or real overflow, report an error
16484
16485 2002-07-02  Martin Baulig  <martin@gnome.org>
16486
16487         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16488         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16489         to tell the runtime about our newly created System.Object and
16490         System.ValueType types.
16491
16492 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16493
16494         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16495         struct instead of Ldarg/Starg.
16496
16497 2002-07-02  Martin Baulig  <martin@gnome.org>
16498
16499         * expression.cs (Indirection.Indirection): Call
16500         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16501
16502 2002-07-02  Martin Baulig  <martin@gnome.org>
16503
16504         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16505         ValueType, call TypeManager.TypeToCoreType() on it.
16506         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16507         the OpCodes.Newarr argument.
16508
16509 2002-07-02  Martin Baulig  <martin@gnome.org>
16510
16511         * expression.cs (Invocation.EmitCall): When compiling corlib,
16512         replace all calls to the system's System.Array type to calls to
16513         the newly created one.
16514
16515         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16516         System.Array methods.
16517         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16518         from the system's System.Array type which must be replaced.
16519
16520 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16521
16522         * typemanager.cs: load unverifiable_code_ctor so we can build
16523         corlib using the correct type. Avoid using GetTypeCode() with
16524         TypeBuilders.
16525         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16526         TypeManager.object_type to allow building corlib.
16527
16528 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16529
16530         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16531
16532 2002-07-01  Martin Baulig  <martin@gnome.org>
16533
16534         * class.cs: Make the last change actually work, we need to check
16535         whether `ifaces != null' to avoid a crash.
16536
16537 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16538
16539         * class.cs: when we build structs without fields that implement
16540         interfaces, we need to add the interfaces separately, since there is
16541         no API to both set the size and add the interfaces at type creation
16542         time.
16543
16544 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16545
16546         * expression.cs: the dimension arguments to the array constructors
16547         need to be converted if they are a long.
16548
16549 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16550
16551         * class.cs: don't emit ldarg.0 if there is no parent constructor
16552         (fixes showstopper for corlib).
16553
16554 2002-06-29  Martin Baulig  <martin@gnome.org>
16555
16556         MCS now compiles corlib on GNU/Linux :-)
16557
16558         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16559         ie. check for MethodImplOptions.InternalCall.
16560
16561         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16562         and TypeManager.attribute_type are null, so we must explicitly check
16563         whether parent is not null to find out whether it's an attribute type.
16564         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16565         and SetBuilder, not only if the property is neither abstract nor external.
16566         This is necessary to set the MethodImplOptions on the accessor methods.
16567         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16568         SetBuilder, see Property.Emit().
16569
16570         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16571         populate "System.Object", "System.ValueType" and "System.Attribute" since
16572         they've already been populated from BootCorlib_PopulateCoreTypes().
16573
16574 2002-06-29  Martin Baulig  <martin@gnome.org>
16575
16576         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16577         is the NullLiteral, we also need to make sure that target_type is not
16578         an enum type.   
16579
16580 2002-06-29  Martin Baulig  <martin@gnome.org>
16581
16582         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16583         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16584         before calling BootstrapCorlib_ResolveDelegate ().
16585
16586 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16587
16588         * statement.cs: fixed build-breaker. All tests passed ok.
16589
16590 2002-06-27  Martin Baulig  <martin@gnome.org>
16591
16592         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16593         for System.Decimal when compiling corlib.
16594
16595 2002-06-27  Martin Baulig  <martin@gnome.org>
16596
16597         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16598         switch blocks which contain nothing but a default clause.
16599
16600 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16601
16602        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16603
16604 2002-06-27  Martin Baulig  <martin@gnome.org>
16605
16606         * ecore.cs (PropertyExpr.PropertyExpr): Call
16607         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16608
16609         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16610         is already a TypeBuilder.
16611
16612 2002-06-27  Martin Baulig  <martin@gnome.org>
16613
16614         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16615         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16616         the "from an array-type to System.Array" case.  This makes it work
16617         when compiling corlib.
16618
16619 2002-06-27  Martin Baulig  <martin@gnome.org>
16620
16621         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16622         non-static PropertyExpr, set its InstanceExpression.  This makes
16623         the `ICollection.Count' property work in System/Array.cs.
16624
16625 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16626
16627         * driver.cs: Made error handling more consistent.  Errors now
16628         tracked by Report class, so many methods which used to return int
16629         now return void.  Main() now prints success/failure and 
16630         errors/warnings message.
16631
16632         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16633         the magic number return values (123 and 124).  Now, if the
16634         expected error occurs, the compiler exits with success (exit value
16635         0).  If the compilation completes without seeing that particular
16636         error, the compiler exits with failure (exit value 1).  The
16637         makefile in mcs/errors has been changed to handle the new behaviour.
16638
16639         * report.cs: Made 'expected error' number a property and renamed
16640         it from 'Probe' to 'ExpectedError'.
16641
16642         * genericparser.cs: Removed error handling support, since it is
16643         now all done by Report class.
16644
16645         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16646         class, so parse() no longer returns an int.
16647
16648         * namespace.cs: Use Report.Error instead of GenericParser.error
16649
16650 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16651
16652         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16653         TypeContainer.AddOperator): At the front of the list put the
16654         explicit implementations, so they get resolved/defined first. 
16655
16656 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16657
16658         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16659         interface type is implemented by this TypeContainer.  Used during
16660         explicit interface implementation.
16661
16662         (Property.Define, Indexer.Define, Method.Define): Validate that
16663         the given interface in the explicit implementation is one of the
16664         base classes for the containing type.
16665
16666         Also if we are explicitly implementing an interface, but there is
16667         no match in the pending implementation table, report an error.
16668
16669         (Property.Define): Only define the property if we are
16670         not explicitly implementing a property from an interface.  Use the
16671         correct name also for those properties (the same CSC uses,
16672         although that is really not needed).
16673
16674         (Property.Emit): Do not emit attributes for explicitly implemented
16675         properties, as there is no TypeBuilder.
16676
16677         (Indexer.Emit): ditto.
16678
16679         Hiding then means that we do not really *implement* a pending
16680         implementation, which makes code fail.
16681
16682 2002-06-22  Martin Baulig  <martin@gnome.org>
16683
16684         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16685         the return value of Object.GetType().  [FIXME: we need to do this whenever
16686         we get a type back from the reflection library].
16687
16688 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16689
16690         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16691
16692 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16693
16694         * attribute.cs: Return null if we can not look up the type.
16695
16696         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16697         the interface types found.
16698
16699         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16700         interface types found.
16701
16702         * typemanager.cs (GetInterfaces): Make this routine returns alll
16703         the interfaces and work around the lame differences between
16704         System.Type and System.Reflection.Emit.TypeBuilder in the results
16705         result for GetInterfaces.
16706
16707         (ExpandInterfaces): Given an array of interface types, expand and
16708         eliminate repeated ocurrences of an interface.  This expands in
16709         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16710         be IA, IB, IC.
16711
16712 2002-06-21  Martin Baulig  <martin@gnome.org>
16713
16714         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16715         on System.Enum.
16716
16717 2002-06-21  Martin Baulig  <martin@gnome.org>
16718
16719         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16720         and called with one of the core types, return the corresponding typebuilder for
16721         that type.
16722
16723         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16724         element type.
16725
16726 2002-06-21  Martin Baulig  <martin@gnome.org>
16727
16728         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16729         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16730         (Expression.ConvertReferenceExplicit): Likewise.
16731
16732         * expression.cs (ElementAccess.DoResolve): Likewise.
16733         (ElementAccess.DoResolveLValue): Likewise.
16734
16735 2002-06-10  Martin Baulig  <martin@gnome.org>
16736
16737         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16738         add the "value" parameter to the parameter list.
16739
16740         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16741         to our caller.
16742
16743 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16744
16745         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16746         the argument to an int, uint, long or ulong, per the spec.  Also
16747         catch negative constants in array creation.
16748
16749 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16750
16751         * class.cs: do not allow the same interface to appear twice in
16752         the definition list.
16753
16754 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16755
16756         * ecore.cs: don't use ldlen with System.Array.
16757
16758 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16759
16760         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16761
16762 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16763
16764         * modifiers.cs: produce correct field attributes for protected
16765         internal. Easy fix so miguel can work on ther harder stuff:-)
16766
16767 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16768
16769         * pending.cs: New file.  Move the code from class.cs here.
16770         Support clearning the pending flag for all methods (when not doing
16771         explicit interface implementation).
16772
16773 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16774
16775         * rootcontext.cs: added a couple more types needed to bootstrap.
16776
16777 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16778
16779         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16780         constructor in the type, instead of any constructor in the type
16781         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16782         a bug in the Mono runtime when applying the params attribute). 
16783
16784 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16785         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16786
16787 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16788
16789         * expression.cs (Unary.ResolveOperator): Use TypeManager
16790         to resolve the type.
16791
16792 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16793
16794         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16795         attached.
16796
16797         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16798         with each member too.
16799
16800         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16801         field builders too - this takes care of the enum member case.
16802
16803 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16804
16805         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16806         address-of operator on both value types and pointers.
16807
16808 2002-06-10  Martin Baulig  <martin@gnome.org>
16809
16810         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16811         PropertyBuilder to the `property_builders' list.
16812
16813         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16814         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16815         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16816         find any indexers which are inherited from an interface.
16817
16818 2002-06-09  Martin Baulig  <martin@gnome.org>
16819
16820         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16821         the same type as the constant if necessary.  There's also a test-130.cs
16822         for this.
16823
16824         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16825
16826         * typemanager.cs (TypeManager.ChangeType): Previously known as
16827         Enum.ChangeEnumType().
16828
16829 2002-06-09  Martin Baulig  <martin@gnome.org>
16830
16831         * expression.cs (Cast.TryReduce): Added support for consts.
16832
16833 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16834
16835         * class.cs (Accessor): Hold attributes information so we can pass
16836         it along.
16837
16838         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16839         Modify to pass in attributes attached to the methods.
16840
16841         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16842
16843         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16844         to handle the Accessor kind :-)
16845
16846         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16847
16848 2002-06-08  Martin Baulig  <martin@gnome.org>
16849
16850         * expression.cs (Unary.TryReduceNegative): Added support for
16851         ULongConstants.
16852
16853 2002-06-08  Martin Baulig  <martin@gnome.org>
16854
16855         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16856         name can't be found in the `defined_names' - the caller will do a
16857         MemberLookup in this case and thus find methods in System.Enum
16858         such as Enum.IsDefined().
16859
16860 2002-06-08  Martin Baulig  <martin@gnome.org>
16861
16862         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16863         Convert.ChangeType() which works with TypeBuilder created types.
16864         (Enum.LookupEnumValue, Enum.Define): Use it here.
16865
16866         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16867         `TypeBuilder.BaseType != null' check.
16868         (TypeContainer.FindMembers): Only lookup parent members if we
16869         actually have a parent.
16870         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16871         (ConstructorInitializer.Resolve): Likewise.
16872
16873         * interface.cs (Interface.FindMembers): Added
16874         `TypeBuilder.BaseType != null' check.
16875
16876         * rootcontext.cs (RootContext.ResolveCore): Added
16877         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16878         classes_second_stage.
16879
16880         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16881         debug_type and trace_type when compiling with --nostdlib.       
16882
16883 2002-06-07  Martin Baulig  <martin@gnome.org>
16884
16885         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16886         (AddField): Set it to true when adding a non-static field.
16887         (DefineType): Use `have_nonstatic_fields' to find out whether we
16888         have non-static fields, not `Fields != null'.
16889
16890 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16891
16892         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16893         dereferencing a null on the static-field code path)
16894
16895 2002-05-30  Martin Baulig  <martin@gnome.org>
16896
16897         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16898         to take command line arguments.  Use reflection to call the new
16899         custom `Initialize' function on the symbol writer and pass it the
16900         command line arguments.
16901
16902         * driver.cs (--debug-args): New command line argument to pass command
16903         line arguments to the symbol writer.
16904
16905 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16906
16907         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16908         the target type for indexers and properties.  Thanks to Joe for
16909         catching this.
16910
16911 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16912
16913         * typemanager.cs (MethodFlags): returns the method flags
16914         (Obsolete/ShouldIgnore) that control warning emission and whether
16915         the invocation should be made, or ignored. 
16916
16917         * expression.cs (Invocation.Emit): Remove previous hack, we should
16918         not do this on matching a base type, we should do this based on an attribute
16919
16920         Only emit calls to System.Diagnostics.Debug and
16921         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16922         on the command line.
16923
16924         * rootcontext.cs: Global settings for tracing and debugging.
16925
16926         * cs-tokenizer.cs (define): New utility function to track
16927         defines.   Set the global settings for TRACE and DEBUG if found.
16928
16929 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16930
16931         * interface.cs (Populate*): Pass in the TypeContainer as well as
16932         the DeclSpace as parameters so that we can create EmitContexts and
16933         then use that to apply attributes etc.
16934
16935         (PopulateMethod, PopulateEvent, PopulateProperty)
16936         (PopulateIndexer): Apply attributes everywhere.
16937
16938         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16939         etc.
16940
16941         (ApplyAttributes): Update accordingly.
16942
16943         We now apply interface attributes for all members too.
16944
16945 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16946
16947         * class.cs (Indexer.Define); Correctly check if we are explicit
16948         implementation (instead of checking the Name for a ".", we
16949         directly look up if the InterfaceType was specified).
16950
16951         Delay the creation of the PropertyBuilder.
16952
16953         Only create the PropertyBuilder if we are not an explicit
16954         interface implementation.   This means that explicit interface
16955         implementation members do not participate in regular function
16956         lookups, and hence fixes another major ambiguity problem in
16957         overload resolution (that was the visible effect).
16958
16959         (DefineMethod): Return whether we are doing an interface
16960         implementation. 
16961
16962         * typemanager.cs: Temporary hack until we get attributes in
16963         interfaces (Ravi is working on that) and we get IndexerName
16964         support in interfaces.
16965
16966         * interface.cs: Register the indexers as properties.
16967
16968         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16969         warning, I have verified that this is a bug in the .NET runtime
16970         (JavaScript suffers of the same problem).
16971
16972         * typemanager.cs (MemberLookup): When looking up members for
16973         interfaces, the parent of an interface is the implicit
16974         System.Object (so we succeed in searches of Object methods in an
16975         interface method invocation.  Example:  IEnumerable x;  x.ToString
16976         ()) 
16977
16978 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16979
16980         * class.cs (Event): Events should also register if they do
16981         implement the methods that an interface requires.
16982
16983         * typemanager.cs (MemberLookup); use the new GetInterfaces
16984         method. 
16985
16986         (GetInterfaces): The code used to lookup interfaces for a type is
16987         used in more than one place, factor it here. 
16988
16989         * driver.cs: Track the errors at the bottom of the file, we kept
16990         on going.
16991
16992         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16993         instance if the method we are calling is static!
16994
16995 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16996
16997         * attribute.cs (ApplyAttributes): Make this function filter out
16998         the IndexerName attribute (as that attribute in reality is never
16999         applied) and return the string constant for the IndexerName
17000         attribute. 
17001
17002         * class.cs (TypeContainer.Emit): Validate that all the indexers
17003         have the same IndexerName attribute, and if so, set the
17004         DefaultName attribute on the class. 
17005
17006         * typemanager.cs: The return value might contain other stuff (not
17007         only methods).  For instance, consider a method with an "Item"
17008         property and an Item method.
17009
17010         * class.cs: If there is a problem with the parameter types,
17011         return. 
17012
17013 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17014
17015         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17016         looks at user defined conversion after making a call to 
17017         StandardConversionExists - we need this for overload resolution.
17018
17019         * expression.cs : Update accordingly the various method calls.
17020
17021         This fixes 2 bugs filed against implicit user defined conversions 
17022
17023 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17024
17025         * statement.cs: Track the result of the assignment.
17026
17027 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17028
17029         * expression.cs (MemberAccess): Improved error reporting for
17030         inaccessible members.
17031
17032 2002-05-22  Martin Baulig  <martin@gnome.org>
17033
17034         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17035         itself with debugging support.
17036
17037 2002-05-22  Martin Baulig  <martin@gnome.org>
17038
17039         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17040         Removed, this isn't needed anymore.
17041
17042 2002-05-20  Martin Baulig  <martin@gnome.org>
17043
17044         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17045         be underlying type for an enum.
17046
17047 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17048
17049         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17050         that splits out the loading of just the core types.
17051
17052         * rootcontext.cs (ResolveCore): Split the struct resolution in
17053         two, so we can load the enumeration underlying types before any
17054         enums are used.
17055
17056         * expression.cs (Is): Bandaid until we fix properly Switch (see
17057         bug #24985 for details).
17058
17059         * typemanager.cs (ImplementsInterface): The hashtable will contain
17060         a null if there are no interfaces implemented.
17061
17062 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17063
17064         * cs-parser.jay (indexer_declarator): It is fine to have array
17065         parameters
17066
17067 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17068
17069         * typemanager.cs: (RegisterBuilder): New function used to register
17070         TypeBuilders that implement interfaces.  Since
17071         TypeBuilder.GetInterfaces (as usual) does not work with lame
17072         Reflection.Emit. 
17073         (AddUserType): register interfaces.
17074
17075         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17076         dealing with TypeBuilder.  Also, arrays are showing up as
17077         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17078         methods can not be invoked on them!
17079
17080         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17081         (ImplicitReferenceConversionExists): Split out from
17082         StandardConversionExists. 
17083
17084         * expression.cs (As): We were only implementing one of the three
17085         cases for the as operator.  We now implement them all.
17086         (Is): Implement the various other cases for Is as well.
17087
17088         * typemanager.cs (CACHE): New define used to control if we want or
17089         not the FindMembers cache.  Seems to have a negative impact on
17090         performance currently
17091
17092         (MemberLookup): Nested types have full acess to
17093         enclosing type members
17094
17095         Remove code that coped with instance/static returns for events, we
17096         now catch this in RealFindMembers.
17097
17098         (RealFindMembers): only perform static lookup if the instance
17099         lookup did not return a type or an event.  
17100
17101 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17102
17103         * assign.cs (CompoundAssign): We pass more semantic information
17104         now to Compound Assignments than we did before: now we have all
17105         the information at hand, and now we resolve the target *before* we
17106         do the expression expansion, which allows the "CacheValue" method
17107         to have the effect we intended (before, a [x] += 1 would generate
17108         two differen ArrayAccess expressions from the ElementAccess,
17109         during the resolution process).
17110
17111         (CompoundAssign.DoResolve): Resolve target and original_source here.
17112
17113 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
17114
17115         * expression.cs (ArrayAccess): dropped debugging information. 
17116
17117         * typemanager.cs: Small bug fix: I was always returning i_members,
17118         instead of one of i_members or s_members (depending on which had
17119         the content).
17120
17121         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
17122         method is invoked before any code generation takes place, and it
17123         is a mechanism to inform that the expression will be invoked more
17124         than once, and that the method should use temporary values to
17125         avoid having side effects
17126
17127         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17128
17129         * ecore.cs (Expression.CacheTemporaries): Provide empty default
17130         implementation.
17131
17132         * expression.cs (Indirection, ArrayAccess): Add support for
17133         CacheTemporaries in these two bad boys. 
17134
17135         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17136         ldobj or ldind_ref.  
17137         (StoreFromPtr): Handle stobj as well.
17138
17139         * expression.cs (UnaryMutator): Share more code.
17140
17141         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17142         down: I was not tracking the Filter function as well, which
17143         was affecting the results of the cache.
17144
17145 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
17146
17147         * attribute.cs: Remove the hack to handle the CharSet property on
17148         StructLayouts. 
17149
17150 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17151
17152         * attribute.cs (DoResolve): More uglyness, we now only try to
17153         resolve the attribute partially, to extract the CharSet
17154         information (only if we are a StructLayout attribute).  Otherwise 
17155
17156         (GetExtraTypeInfo): Add some code to conditionally kill in the
17157         future this.   I am more and more convinced that the .NET
17158         framework has special code to handle the attribute setting on
17159         certain elements.
17160
17161         * expression.cs (IsParamsMethodApplicable): Revert my previous
17162         foreach change here, it was wrong.
17163
17164 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17165
17166         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17167         (pp_expr): do not abort on unknown input, just return.
17168         (eval): abort if there are pending chars.
17169
17170         * attribute.cs (Attribute.Resolve): Positional parameters are
17171         optional.  Deal with that case.
17172
17173         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17174         the Ansi/Unicode/Auto information for the type.
17175
17176         (TypeContainer.DefineType): instantiate the EmitContext here, as
17177         we will be using it during the type definition (to resolve
17178         attributes) and during the emit phase.
17179
17180         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17181         to pull type information out of the attributes
17182
17183         (Attribute.Resolve): track the constructor builder, and allow for
17184         multiple invocations (structs and classes will use this).
17185
17186         * ecore.cs (MemberLookupFinal): new version with all the
17187         parameters customizable.
17188
17189         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17190         constructors.  Return if the result value is null (as the error
17191         would have been flagged already by MemberLookupFinal)
17192
17193         Do not allow instances of abstract classes or interfaces to be
17194         created.
17195
17196         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17197         We have to compare the assembly property here when dealing with
17198         FamANDAssem and Assembly access modifiers, because we might be
17199         creating an assembly from *modules* (that means that we are not
17200         getting TypeBuilders for types defined in other modules that are
17201         part of this assembly).
17202
17203         (Method.Emit): If the method is marked abstract and has a body,
17204         emit an error. 
17205
17206         (TypeContainer.DefineMembers): If both the defined member and the
17207         parent name match are methods, then do not emit any warnings: let
17208         the Method.Define routine take care of flagging warnings.  But if
17209         there is a mismatch (method overrides something else, or method is
17210         overriwritten by something, then emit warning).
17211
17212         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17213         set to null, this means `do not check for the return type on the
17214         signature'. 
17215
17216         (Method.Define): set the return type for the method signature to
17217         null, so that we get methods with the same name and parameters and
17218         different return types.  This is used to flag warning 114 (you are
17219         hiding a method, and you probably want to use the new/override
17220         keywords instead).
17221
17222         * typemanager.cs (MemberLookup): Implemented proper access
17223         control, closing a long standing set of bug reports.  The problem
17224         was that the Framework only has two bits: Public and NonPublic,
17225         and NonPublic includes private and protected methods, but we need
17226         to enforce the FamANDAssem, FamOrAssem and Family. 
17227
17228 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17229
17230         * statement.cs (GotoCase): Return true: Ammounts to giving up
17231         knowledge on whether we return or not, and letting the other case
17232         be responsible for it.
17233
17234 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17235
17236         * driver.cs: Do not load directories for each file processed, only
17237         do it if there is a pattern.
17238
17239         * ecore.cs: Report readonly assigns here as well, as we might have
17240         been resolved only by MemberAccess.
17241
17242         (SimpleName.SimpleNameResolve): Also be useful for LValue
17243         resolution.   We need this to propagate assign to local readonly variables
17244
17245         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17246         do not want to reuse potential criteria memory.
17247
17248         * class.cs (MyEventBuilder): Set reflected_type;
17249
17250         * ecore.cs (Constantify): Added support for constifying bools.
17251
17252         (RootContext.LookupType): Added a cache for values looked up in
17253         the declaration space.
17254
17255         * typemanager.cs (FindMembers): Now is a front-end to
17256         RealFindMembers, and provides a two-level hashtable-based cache to
17257         the request.  
17258
17259         15% performance improvement: from 22.5 to 19.2 seconds.
17260
17261         * expression.cs (IsParamsMethodApplicable): use foreach.
17262         (Invocation.DoResolve): ditto.
17263         (New.DoResolve): ditto.
17264         (ArrayCreation.DoResolve): ditto.
17265
17266         * ecore.cs (FindMostEncompassingType): use foreach.
17267
17268         * delegate.cs (NewDelegate.DoResolve): Use foreach
17269
17270         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17271         (RemoveMethods): use foreach.
17272
17273         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17274         nested foreach statements instead of for, and also break out of
17275         the inner loop once a match is found.
17276
17277         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17278
17279 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17280
17281         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17282         we actually unwrap the expression to allow for extra information
17283         to be extracted. 
17284
17285         * expression.cs: Use Shr_Un on unsigned operations. 
17286
17287 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17288
17289         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17290         applicable operators was not being considered correctly. This closes
17291         the bug Miguel reported.
17292
17293 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17294
17295         * attribute.cs: check that the type derives from System.Attribute
17296         and report the correct error in that case (moved the duplicate code to
17297         its own method, too).
17298
17299 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17300
17301         * attribute.cs: lookup attribute type name as the spec says: first the
17302         bare attribute name and then name + "Attribute" (nant compiles with
17303         mcs after this fix).
17304
17305 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17306
17307         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17308         Because of the way we parse things, we should try to see if a
17309         UIntConstant can fit in an integer.
17310
17311 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17312
17313         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17314         when we are in an explicit context.
17315
17316         (ConvertReferenceExplicit): When converting from Iface type S to Class
17317         T make sure the rules are implemented as an OR.
17318
17319         * parameter.cs (ParameterType): Make it a property for now although the
17320         purpose really isn't anything immediate.
17321
17322         * expression.cs (Is*Applicable): Do better checking on the parameter type
17323         of a ref/out parameter. The ones from the system assemblies are already 
17324         marked with the correct type so we don't need to do any correction.
17325
17326         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17327         the object type is standard too so include that.
17328
17329 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17330
17331         * ecore.cs (StandardConversionExists): Augment with missing code:
17332         deal with IntConstant, LongConstants and Enumerations.
17333
17334         * assign.cs: Report the error, instead of failing silently
17335
17336         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17337         typecontainer that they are declared, because the
17338         typecontainer/namespace will have the list of using clauses that
17339         need to be applied.
17340
17341         Assembly Attributes were escaping the normal registration
17342         mechanism. 
17343
17344         (EmitCode): Apply attributes within an EmitContext that represents
17345         the container they were declared on.
17346
17347         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17348
17349 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17350
17351         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17352         Revamp completely - make much cleaner as we now operate only
17353         on a set of Types.
17354
17355         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17356         to implement the logic detailed in the spec more correctly.
17357
17358         (UserDefinedConversion): Update accordingly.
17359
17360 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17361
17362         * statement.cs: Return flow analysis information up.
17363
17364         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17365         and the default.
17366
17367         (token): Do not consume an extra character before calling
17368         decimal_digits.
17369
17370 2002-05-06  Piers Haken <piersh@friskit.com>
17371
17372         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17373
17374 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17375
17376         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17377         EmitContext during the instance constructor initializer
17378         resolution, to stop access to instance variables.
17379
17380         This is mandated by the spec, last paragraph of the `constructor
17381         initializers' section. 
17382
17383 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17384
17385         * cs-parser.jay, class.cs (Accessor): new class used to represent
17386         an accessor (get or set).  In the past we used `null' to represent
17387         a missing accessor.  But this is ambiguous because there was no
17388         way to tell in abstract indexers/properties if one of them was
17389         specified.
17390
17391         Now there is a way of addressing that.
17392
17393         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17394         instead of FindMembers.
17395
17396         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17397         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17398
17399         * attribute.cs: Treat indexers and properties as the same in terms
17400         of applying attributes
17401
17402         * ecore.cs (FindMostEncompassedType): Use statically initialized
17403         EmptyExpressions()s like we do elsewhere to avoid creating useless
17404         objects (and we take this out of the tight loop).
17405
17406         (GetConversionOperators): Move the code to extract the actual
17407         operators to a separate routine to clean things up.
17408
17409 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17410
17411         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17412         events are always registered FieldBuilders.
17413
17414         * class.cs (FieldBase): New class shared by Fields 
17415
17416         * delegate.cs: If we are a toplevel delegate, use our full name.
17417         If we are a nested delegate, then only use our tail name.
17418
17419 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17420
17421         * expression.cs (IsApplicable): Ensure that we add the "&" to
17422         ref/out types before comparing it with the type of the argument.
17423
17424         (IsParamsMethodApplicable): Ditto.
17425
17426         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17427         silly me ;-)
17428
17429         * delegate.cs : Handle the case when we have more than one applicable
17430         method. Flag an error only when we finish checking all.
17431
17432 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17433
17434         * expression.cs: Add support for boolean static initializers.
17435
17436 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17437
17438         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17439
17440         * parameter.cs (ComputeParameterTypes,
17441         ComputeAndDefineParameterTypes): Better error handling: now we
17442         clear the `types' cache if we fail during any of the type lookups.
17443         We also return the status code correctly to our caller
17444
17445         * delegate.cs: If we fail to define a delegate, abort the extra
17446         steps. 
17447
17448         * expression.cs (Binary.ResolveOperator): for
17449         operator==(object,object) and operator !=(object, object) we also
17450         have to verify that there is an implicit conversion from one to
17451         the other.
17452
17453         (ArrayAccess.DoResolve): Array Access can operate on
17454         non-variables. 
17455
17456 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17457
17458         * assign.cs (CompoundAssign): A new class used as a "flag" that
17459         the assignment actually is happening as part of a compound
17460         assignment operator.
17461
17462         During compound assignment, a few new rules exist to enable things
17463         like:
17464
17465         byte b |= 1 + 2
17466
17467         From the spec:
17468
17469         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17470         to the type of x) if y is implicitly convertible to the type of x,
17471         and the operator is a builtin operator and the return type of the
17472         operator is explicitly convertible to the type of x. 
17473
17474         * rootcontext.cs: Reset warning level to 2.  4 catches various
17475         "interesting" features in mcs, we must clean this up at some
17476         point, but currently am trying to kill other bugs ;-)
17477
17478         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17479         in container classes as well.  
17480
17481         * expression.cs (Binary.ResolveOperator): Handle string case
17482         before anything else (as operator overloading does emit an error
17483         before doing anything else).
17484
17485         This code could go away when we move to a table driven model, but
17486         i could not come up with a good plan last night.
17487
17488 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17489
17490         * typemanager.cs (CSharpName): reimplementation using regex.
17491         * class.cs: added null check for fields in Emit
17492         * rootcontext.cs: set warninglevel to 4
17493
17494 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17495
17496         * typemanager.cs (CSharpName): reimplemented with Lupus
17497         suggestion.
17498
17499 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17500
17501         * statement.cs (If): correclty implement Resolve, because we were
17502         not catching sem errors in there.  The same process is needed
17503         everywhere else. 
17504         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17505
17506
17507         (Statement.Warning_DeadCodeFound): Factorize code.
17508         (While): Report dead code here too.
17509
17510         (Statement): Added Resolve virtual method to allow
17511         for resolution split from the emit code.
17512
17513 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17514
17515         * statement.cs (EmitBoolExpression): No longer try to resolve the
17516         expression here.    
17517         (MakeBoolean): New utility function that resolve, implicitly
17518         converts to boolean and tags the expression. 
17519
17520
17521         (If, Do): Implement dead code elimination.
17522         (While): Implement loop inversion
17523
17524         (Do, While, For, If): Resolve the expression prior to calling our
17525         code generation.
17526
17527 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17528
17529         * class.cs:
17530           - added method Report28 (warning: program has more than one entry point)
17531           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17532           - modified method Method.Define, the part at the end of the method
17533
17534         * rootcontext.cs: added static public Location EntryPointLocation;
17535           
17536         * ../errors/cs0028.cs : Add test case for the above warning.              
17537
17538         * typemanager.cs:
17539           - modified method CSharpName to allow arrays of primitive type to
17540             be printed nicely (e.g. instead of System.Int32[][] it now prints
17541             int[][])
17542           - added method CSharpSignature: returns the signature of a method
17543             in string format to be used in reporting errors, warnings, etc.
17544
17545         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17546         with String.Empty.
17547
17548 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17549
17550         * delegate.cs (Define): Fix extremely silly bug where I was
17551         setting the type of the 'object' parameter of the BeginInvoke
17552         method to System.IAsyncResult instead of System.Object ;-)
17553
17554 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17555
17556         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17557         here. 
17558
17559         (Constructor.Emit): return if we fail to initialize the
17560         constructor.  Another door closed!  
17561
17562         * expression.cs (New.DoResolve): Improve error message (from -6 to
17563         1501).  Use DeclaredOnly lookup to find the exact constructor.
17564
17565         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17566         loop.  This is useful.
17567
17568         * cs-parser.jay: Adjust the default parameters so that destructors
17569         have the proper signature.
17570
17571 2002-04-26  Martin Baulig  <martin@gnome.org>
17572
17573         * driver.cs (LoadAssembly): If `assembly' contains any characters
17574         which are only valid in path names and not in assembly names
17575         (currently slash, backslash and point), use Assembly.LoadFrom ()
17576         instead of Assembly.Load () on the `assembly' (before iteration
17577         over the link_paths).
17578
17579 2002-04-26  Martin Baulig  <martin@gnome.org>
17580
17581         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17582
17583 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17584
17585         * class.cs (Property): use the new typemanager.MemberLookup
17586
17587         (TypeContainer.MemberLookup): Implement using the
17588         TypeManager.MemberLookup now. 
17589
17590         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17591         and return MemberInfos, so that these can be used without an
17592         EmitContext (what we had before).
17593
17594 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17595
17596         * expression.cs: Fix the case where the argument to params if the
17597         type of the params.  I omitted handling this before.   Fixed
17598
17599 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17600
17601         * driver.cs: Call BootCorlib_PopulateCoreType
17602
17603         * class.cs (Property.CheckBase): Check for properties only, not
17604         for all members. 
17605
17606         * interface.cs: Temporary hack: try/catch around the
17607         CustomAttributeBuilder, because I am getting an exception that I
17608         do not understand.
17609
17610         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17611         types whose definitions are required to be there (attributes are
17612         defined before standard types).
17613
17614         Compute definitions as we boot the various types, as they are used
17615         immediately (value_type class will need object_type, but if we do
17616         not initialize object_type, we will pass a null, which will let
17617         the runtime pick the System.Object from the existing corlib, which
17618         is not what we want).
17619
17620 2002-04-22  Patrik Torstensson <totte@labs2.com>
17621
17622         * cs-tokenizer.cs: fixed a number of trim() issues.
17623
17624 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17625
17626         * expression.cs (Argument.Type): Ensure that we return the correct
17627         type when we have out or ref parameters [in which case we 
17628         append a "&"].
17629
17630 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17631
17632         * class.cs (Property, Indexer): Allow extern modifier in there. 
17633
17634         * typemanager.cs (InitBaseTypes): Initializes object_type and
17635         value_type, since those will be used early on during the bootstrap
17636         process to compile corlib.
17637
17638         (InitCoreTypes): Move code from here to InitBaseTypes.
17639
17640 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17641
17642         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17643         single-dimension arrays as using the ldlen opcode.  
17644
17645         Daniel Lewis discovered this optimization.  
17646
17647         * typemanager.cs: Add signature for System.Array::get_Length
17648
17649 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17650
17651         * statement.cs: report the error when the foreach does not apply to an
17652         array nor a collection.
17653
17654 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17655
17656         * expression.cs: Add implicit conversions to the operator ~.
17657
17658         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17659
17660         * typemanager.cs: Locate the decimal constructor.
17661
17662 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17663
17664         * attribute.cs: use the new property of TypeOf.
17665         * expression.cs: added 'get' property around typearg.
17666
17667         These changes fix a build breaker reported by NickD. Is this the
17668         correct way to fix?  If not, please, revert my changes and make it
17669         work :-).
17670
17671 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17672
17673         * attribute.cs: Add support for typeof in attribute invocations.
17674         I am not sure that this is right though.
17675
17676 2002-04-14  Duncan Mak  <duncan@ximian.com>
17677
17678         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17679         Binary.Operator.Division case.
17680
17681 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17682
17683         * class.cs (DefineType): Ensure that we do a proper check on
17684         attribute types and also register it with the TypeManager.
17685
17686         (TypeContainer.Targets): The default for attribute types is
17687         AttributeTargets.All.
17688
17689         * attribute.cs (ApplyAttributes): Registering the attribute type
17690         is done elsewhere, not when we discover we have a Usage attribute.
17691
17692 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17693
17694         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17695         and get rid of is_delegate parameter.
17696
17697         * everywhere : update.
17698
17699 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17700
17701         * cs-parser.jay (compilation_unit): Revamp completely to use
17702         some new ideas that I got from Rhys' grammar to solve the problems
17703         with assembly level attributes.
17704
17705         (outer_declaration): New grammar production.
17706
17707         (attribute_sections): Add.
17708
17709         (opt_attributes): Base on attribute_sections
17710
17711         (namespace_declaration): Allow opt_attributes to tackle the case
17712         when we have assembly level attributes - we are clever in this
17713         regard now ;-)
17714
17715         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17716         attributes in the non-global context.
17717
17718         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17719         instead of SetGlobalAttributes.
17720
17721         * class.cs, rootcontext.cs : Ensure we define and generate 
17722         attribute types before anything else.
17723
17724         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17725         and flag the new error -20 for the case when the attribute type
17726         does not have valid targets specified. csc does not catch this.
17727
17728         * ../errors/errors.txt : update for error # -20
17729
17730 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17731
17732         * support.cs (InternalParameters.ParameterModifier): Do some null
17733         checking and return sane values.
17734
17735         * class.cs (Method.Define): If we are a PInvoke method, ensure
17736         that we are static and extern. Report error # 601
17737
17738         * ../errors/cs0601.cs : Add test case for the above error.
17739
17740 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17741
17742         * rootcontext.cs (attribute_types): We need to keep type of
17743         all attribute types separately and emit code for them first.
17744
17745         (RegisterAttribute) : Implement.
17746
17747         * class.cs (DefineType): Check if the current Type is a custom
17748         attribute type and register it accordingly.
17749
17750         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17751         adding the first attribute twice and rename to
17752
17753         (SetGlobalAttributes): this.
17754
17755         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17756         lookups.
17757
17758         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17759         if we are processing global arguments. Hmm, I am unsure of this.
17760
17761 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17762
17763         * expression.cs: added static array of strings to avoid calling
17764         Enum.ToString () for Operator in Binary. Significant recover of
17765         performance.
17766
17767 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17768
17769         * class.cs (FindMembers): Allow the Builders of the various
17770         members to be null.  If they are skip them.  This only happens
17771         during the PInvoke declaration.
17772
17773 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17774
17775         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17776         failure, so we do not keep going afterwards.
17777
17778         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17779         wanted to pass `false' as the `is_delegate' argument.  If this is
17780         the case, why not use delegate_type == null to mean `is_delegate =
17781         false' and anything else as is_delegate = true.
17782
17783 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17784
17785         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17786         code for the section, not the beginning of the tests.
17787
17788 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17789
17790         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17791
17792         * expression.cs (Binary): same.  Warn about errors where we have
17793         Enum/Enum in operator + as well.
17794
17795 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17796
17797         * statement.cs:
17798                 - added support for switch(bool)
17799                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17800                 - add TableSwitchEmit() to handle table-based switch statements
17801
17802 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17803
17804         * expression.cs (Invocation.OverloadResolve): Factor out code which
17805         does parameter compatibility checking with arguments so that we can 
17806         re-use the code even from Delegate.VerifyApplicability
17807
17808         (VerifyArgumentsCompat): Move above code here.
17809
17810         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17811         and instead make a call to the above method.
17812
17813 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17814
17815         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17816         We use it to keep track of classes which are attribute types.
17817
17818 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17819
17820         * delegate.cs (Delegate.Define): Correctly define the types in the
17821         presence of fixed and array parameters.
17822
17823         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17824         doing FindMembers.
17825
17826         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17827         include NonPublic after the first iteration.
17828
17829         * class.cs (Indexer.CheckBase): Only check if both parents are
17830         non-null. 
17831
17832         * cs-parser.jay (accessor_body): If empty, set to null.
17833
17834         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17835         same code path here to resolve constants names that we did have in
17836         MemberAccess.DoResolve.  There is too much code duplicated here.
17837
17838 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17839
17840         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17841
17842         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17843         to MakeUnionSet.
17844
17845         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17846         tokens, numbers and strings.
17847
17848         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17849         parenthesis.
17850
17851         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17852         asyncronous parameters and the regular parameters.  
17853
17854         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17855         specify the target directory.
17856
17857         * expression.cs: (This.DoResolve): Simplify
17858         (As.Emit): Optimize, do not generate IsInst if the expression is
17859         always of the given type.
17860
17861         (Is.DoResolve): Bug fix, we were reporting both always/never for
17862         the is expression.
17863
17864         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17865         creating too many unnecessary arrays.
17866
17867 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17868
17869         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17870         fields instead of rolling our own initializer.   Takes care of all
17871         implicit conversions, and drops unnecessary static checks/argument.
17872
17873 2002-03-31  Dick Porter  <dick@ximian.com>
17874
17875         * driver.cs: use the GetDirectories() return values properly, and
17876         use "/" as path separator.
17877
17878 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17879
17880         * expression.cs (Unary): Optimize - - expr into expr.
17881         (Binary): Optimize a + (-b) into a -b.
17882
17883         * codegen.cs (CodeGen): Made all methods static.
17884
17885 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17886
17887         * rootcontext.cs: 
17888
17889         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17890         TypeBuilder property.
17891
17892         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17893         instead. 
17894
17895         * tree.cs: Removed the various RecordXXXX, and replaced with a
17896         single RecordDecl.  Removed all the accessor methods, and just
17897         left a single access point Type 
17898
17899         * enum.cs: Rename DefineEnum to DefineType.
17900
17901         * decl.cs: New abstract method `DefineType' used to unify the
17902         Defines for Enumerations, Interfaces, TypeContainers and
17903         Delegates.
17904
17905         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17906         LookupBaseClasses method that used to live in class.cs and
17907         interface.cs here, and renamed to FindType.
17908
17909         * delegate.cs: Implement DefineType.  Take advantage of the
17910         refactored pattern for locating the parent builder without taking
17911         the parent_builder argument (which we know does not work if we are
17912         nested, and triggering a toplevel definition).
17913
17914 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17915
17916         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17917         accessibility of a member has changed during override and report
17918         an error if so.
17919
17920         * class.cs (Method.Define, Property.Define): Only complain on
17921         overrides if the method is private, any other accessibility is
17922         fine (and since we just checked the permission is the same, we are
17923         good to go).
17924
17925         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17926         and elif are processed always.  The other pre-processing
17927         directives are only processed if we are "taking" the path
17928
17929 2002-03-29  Martin Baulig  <martin@gnome.org>
17930
17931         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17932         current location is not Null.
17933
17934         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17935         a separate method so we can profile it.
17936
17937         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17938         `span.Seconds' are just seconds, but no minutes or hours.
17939         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17940
17941 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17942
17943         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17944         Remove the gratuitous set of Final:
17945
17946                                 // If an interface implementation, then we can set Final.
17947                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17948                                     implementing.DeclaringType.IsInterface)
17949                                         flags |= MethodAttributes.Final;
17950
17951         I do not know what I was smoking when I used that.
17952
17953
17954         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17955         step into fixing the name resolution issues for delegates and
17956         unifying the toplevel name resolution.
17957
17958 2002-03-28  Martin Baulig  <martin@gnome.org>
17959
17960         * class.cs (Method.Emit): If we have a symbol writer, call its
17961         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17962         tell it about the current method.
17963
17964         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17965         writer that we're going to emit the first byte of IL code for a new
17966         statement (a new source line).
17967         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17968         EmitContext.Mark() before emitting any code.
17969
17970         * location.cs (SymbolDocument): Return null when we're Null.
17971
17972         * statement.cs (Statement): Moved the `Location loc' variable here.
17973         (Statement.EmitBoolExpression): If we have a symbol writer, call
17974         ec.Mark() before emitting any code to tell it that we're at the
17975         beginning of a new statement.
17976         (StatementExpression): Added `Location' argument to the constructor.
17977         (Block): Added public readonly variable `StartLocation' and public
17978         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17979         (Block): Added constructor which takes a start and end location.
17980         (Block.SetEndLocation): New method. This sets the end location.
17981         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17982         local variables we create.
17983         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17984         each statement and do also mark the begin and end of the block.
17985
17986         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17987         tell it the current lexer.Location, use Location.Null for the end of the
17988         block.
17989         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17990         current block, set its end location using SetEndLocation().
17991         (statement_expression): StatementExpression constructor now takes the
17992         lexer.Location as additional argument.
17993         (for_statement, declare_local_variables): Likewise.
17994         (declare_local_variables): When creating a new implicit block, use the
17995         new Block constructor and pass it the lexer.Location.
17996
17997 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17998
17999         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18000         members also on the parent interfaces recursively.
18001
18002 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18003
18004         * report.cs: Use new formats, since Gonzalo finished the missing
18005         bits. 
18006
18007         * expression.cs (Binary.ResolveOperator): added missing operator|
18008         operator& and operator^ for bool/bool.
18009
18010         * cs-parser.jay: CheckDef now takes a Location argument that is
18011         used to report errors more precisly (instead of reporting the end
18012         of a definition, we try to track something which is a lot closer
18013         to the source of the problem).
18014
18015         * cs-tokenizer.cs: Track global token use, so we can properly flag
18016         the use of #define/#undef after the first token has been seen.
18017
18018         Also, rename the reportXXXX to Error_DescriptiveName
18019
18020         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18021         TypeContainer, so that Enum and Interface can use this too.
18022
18023         * class.cs (TypeContainer.LookupInterfaceOrClass,
18024         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18025         `builder' argument.  Typically this was used to pass the parent
18026         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18027         the definition).  
18028
18029         The problem is that a nested class could trigger the definition of
18030         a toplevel class, and the builder would be obviously wrong in that
18031         case. 
18032
18033         So we drop this argument, and we compute dynamically the
18034         TypeBuilder/ModuleBuilder (the correct information was available
18035         to us anyways from DeclSpace.Parent)
18036
18037         * interface.cs (Interface.DefineInterface): Drop builder
18038         parameter cleanup like class.cs
18039
18040         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18041         like class.cs
18042
18043         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18044         values. 
18045
18046         (Try.Emit): Propagate the returns value from the statement.
18047
18048         (Return.Emit): Even if we are leavning 
18049
18050         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18051
18052         * modifiers.cs: Fix the computation of MethodAttributes flags.
18053
18054 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18055
18056         * driver.cs: allow compilation of files that start with '/'.
18057         Add a default case when checking the argument of --target.
18058
18059 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18060
18061         * interface.cs: Implement the same search algorithm for types in
18062         the interface code.
18063
18064         * delegate.cs: Do not allow multiple definition.
18065
18066         * Recovered ChangeLog that got accidentally amputated
18067
18068         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18069
18070         * rootcontext.cs: Load manually enum to allow core classes to
18071         contain enumerations.
18072
18073         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18074         Update to new static methods in TypeManager.
18075
18076         * typemanager.cs (GetMethod, GetConstructor): Use our
18077         implementation of FindMembers to find the members, since during
18078         corlib compilation, the types are TypeBuilders and GetMethod and
18079         GetConstructor do not work.
18080
18081         Make all methods in TypeManager static.
18082
18083         (InitCodeHelpers): Split the functionality from
18084         the InitCodeTypes function.
18085
18086         * driver.cs: Call InitCodeHelpers after we have populated the
18087         types. 
18088
18089         * cs-parser.jay (delegate_declaration): we did not used to compute
18090         the delegate name correctly for void delegates.
18091
18092 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18093
18094         * rootcontext.cs (RootContext): Init the interface_resolve_order
18095         and type_container_resolve_order always.
18096
18097         (ResolveCore, BootstrapCorlib_ResolveClass,
18098         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18099         compiler when compiling with --nostdlib
18100
18101         * class.cs (TypeContainer.DefineType): Check that our parent is
18102         not null.  This test is most important when we are bootstraping
18103         the core types.
18104
18105         * codegen.cs: Split out the symbol writing code.
18106
18107 2002-03-25  Martin Baulig  <martin@gnome.org>
18108
18109         * driver.cs (-g): Made -g an alias for --debug.
18110
18111 2002-03-24  Martin Baulig  <martin@gnome.org>
18112
18113         * codegen.cs (SymbolWriter): New public variable. Returns the
18114         current symbol writer.
18115         (CodeGen): Added `bool want_debugging_support' argument to the
18116          constructor. If true, tell the ModuleBuild that we want debugging
18117         support and ask it for the ISymbolWriter.
18118         (Save): If we have a symbol writer, call it's Close() method after
18119         saving the assembly.
18120
18121         * driver.c (--debug): New command line argument to create a
18122         debugger information file.
18123
18124         * location.cs (SymbolDocument): New public property. Returns an
18125         ISymbolDocumentWriter object for the current source file or null
18126         if we don't have a symbol writer.
18127
18128 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
18129
18130         * driver.cs (LoadAssembly): Correctly return when all the paths
18131         have been tried and not before.
18132
18133         * statement.cs (Switch.Emit): return the actual coverage for this
18134         statement (returns/not-returns)
18135
18136         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18137         switch of the statement if we are the last switch section.  That
18138         kills two problems: try/catch problems (we used to emit an empty
18139         nop at the end) and switch statements where all branches would
18140         return. 
18141
18142 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
18143
18144         * driver.cs: Add default assemblies (the equivalent to the
18145         Microsoft CSC.RSP file)
18146
18147         * cs-tokenizer.cs: When updating `cols and setting it to zero,
18148         also update tokens_seen and set it to false.
18149
18150         * driver.cs: Implement --recurse for Mike.
18151
18152         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18153         correctly splitting out the paths.
18154
18155 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18156
18157         * interface.cs (Interface.PopulateProperty): Instead of using
18158         `parent' as the declaration space for the set parameters, use
18159         `this' 
18160
18161         * support.cs (InternalParameters): InternalParameters constructor
18162         takes a DeclSpace instead of a TypeContainer.
18163
18164         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18165         types are being initialized, load the address of it before calling
18166         the function.  
18167
18168         (New): Provide a mechanism to disable the generation of local
18169         value type temporaries when the caller will be providing us with
18170         an address to store it.
18171
18172         (ArrayCreation.EmitDynamicInitializers): Use it.
18173
18174 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18175
18176         * expression.cs (Invocation.EmitArguments): Only probe for array
18177         property if there is more than one argument.  Sorry about that.
18178
18179         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18180         empty param arrays.
18181
18182         * class.cs (Method.LabelParameters): Fix incorrect code path that
18183         prevented the `ParamArrayAttribute' from being applied to the
18184         params attribute.
18185
18186 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18187
18188         * support.cs (ReflectionParameters): Correctly compute whether the
18189         last argument is a params array.  Fixes the problem with
18190         string.Split ('a')
18191
18192         * typemanager.cs: Make the assemblies array always be non-null
18193         (empty, but non-null)
18194
18195         * tree.cs (RecordDecl): New function that abstracts the recording
18196         of names.  This reports error 101, and provides a pointer to the
18197         previous declaration.  Fixes a crash in the compiler.
18198
18199         * cs-parser.jay (constructor_declaration): Update to new grammar,
18200         and provide a constructor_body that can be empty.
18201
18202 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18203
18204         * driver.cs: Add support for --resources.
18205
18206         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18207         Make all types for the various array helper methods be integer.
18208
18209         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18210         CheckState to ConvCast.
18211
18212         (ConvCast): Now it takes a `checked' state argument, to avoid
18213         depending on the emit context for the conversion, and just using
18214         the resolve time setting.
18215
18216         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18217         instead of Invocation.EmitArguments.  We do not emit the original
18218         arguments, instead we emit those which have been converted to
18219         unsigned int expressions.
18220
18221         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18222
18223         * codegen.cs: ditto.
18224
18225         * expression.cs (LocalVariableReference): Drop the use of the
18226         Store function that depended on the variable index.
18227
18228         * statement.cs (VariableInfo): Drop the `Idx' property from this
18229         class, as this is not taking into account the indexes for
18230         temporaries tat we generate during the execution, getting the
18231         indexes wrong.
18232
18233         * class.cs: First emit class initializers, then call the parent
18234         constructor. 
18235
18236         * expression.cs (Binary): Fix opcode emision.
18237         (UnaryMutator.EmitCode): Support checked code generation
18238
18239         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18240         matches for events for both the Static and Instance scans,
18241         pointing to the same element.   Fix that.
18242
18243 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18244
18245         * rootcontext.cs (ResolveTree): Always set the
18246         interface_resolve_order, because nested interfaces will be calling
18247         into us.
18248
18249         * class.cs (GetInterfaceOrClass): Track the same resolution
18250         process used by TypeManager.LookupType.  This fixes the nested
18251         type lookups in class declarations (separate path from
18252         LookupType). 
18253
18254         (TypeContainer.DefineType): Also define nested interfaces.
18255         (TypeContainer.RegisterOrder): New public function used to
18256         register the order in which child interfaces need to be closed.
18257
18258         Nested interfaces need to be closed after their parents have been
18259         created. 
18260
18261         * interface.cs (InterfaceAttr): Put all the logic for computing
18262         the interface attribute here. 
18263
18264         (DefineInterface): Register our interface order with the
18265         RootContext or with the TypeContainer depending on the case.
18266
18267 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18268
18269         * cs-parser.jay: rework foreach statement to work with the new
18270         changes to the policy on SimpleNames.
18271
18272         * report.cs: support Stacktrace on warnings as well.
18273
18274         * makefile: drop --unsafe and /unsafe from the compile.
18275
18276 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18277
18278         * ecore.cs (StandardConversionExists): Modify to take an Expression
18279         as the first parameter. Ensure we do null -> reference type conversion
18280         checking.
18281
18282         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18283         temporary Expression objects.
18284
18285 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18286
18287         * interface.cs: workaround bug in method overloading resolution
18288         (there is already a bugzilla bug for it).
18289
18290 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18291
18292         We could also solve this problem by having a separate path for
18293         performing type lookups, instead of DoResolve, we could have a
18294         ResolveType entry point, and only participating pieces of the
18295         production (simplename, deref, array) would implement this. 
18296
18297         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18298         signal SimpleName to only resolve type names and not attempt to
18299         resolve anything else.
18300
18301         * expression.cs (Cast): Set the flag.
18302
18303         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18304
18305         * class.cs: Only report 108 if there is no `new' modifier.
18306
18307         * cs-parser.jay: rework foreach statement to work with the new
18308         changes to the policy on SimpleNames.
18309
18310         * report.cs: support Stacktrace on warnings as well.
18311
18312         * makefile: drop --unsafe and /unsafe from the compile.
18313
18314 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18315
18316         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18317         lookups here, instead of doing that at parse time.  This means
18318         that our grammar will not introduce `LocalVariableReferences' as
18319         expressions at this point.  That solves the problem of code like
18320         this:
18321
18322         class X {
18323            static void Main ()
18324            { int X = 1;
18325             { X x = null }}}
18326
18327         This is only half the fix.  The full fix requires parameters to
18328         also be handled in this way.
18329
18330         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18331         makes the use more obvious of the DeclSpace.  The
18332         ec.TypeContainer.TypeBuilder is now only used to pull the
18333         TypeBuilder for it.
18334
18335         My theory is that I can get rid of the TypeBuilder completely from
18336         the EmitContext, and have typecasts where it is used (from
18337         DeclSpace to where it matters).  
18338
18339         The only pending problem is that the code that implements Aliases
18340         is on TypeContainer, and probably should go in DeclSpace.
18341
18342         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18343         lookups here, instead of doing that at parse time.  This means
18344         that our grammar will not introduce `LocalVariableReferences' as
18345         expressions at this point.  That solves the problem of code like
18346         this:
18347
18348         class X {
18349            static void Main ()
18350            { int X = 1;
18351             { X x = null }}}
18352
18353         This is only half the fix.  The full fix requires parameters to
18354         also be handled in this way.
18355
18356         * class.cs (Property.DefineMethod): When implementing an interface
18357         method, set newslot, when implementing an abstract method, do not
18358         set the flag (before we tried never setting it, or always setting
18359         it, which is the difference).
18360         (Indexer.DefineMethod): same.
18361         (Method.DefineMethod): same.
18362
18363         * ecore.cs: Only set the status used flag if we get back a Field.
18364
18365         * attribute.cs: Temporary hack, so Paolo can keep working.
18366
18367 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18368
18369         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18370         the unmanaged type in the case we have a MarshalAs attribute.
18371
18372         (Resolve): Handle the case when we are parsing the special MarshalAs
18373         attribute [we need to store the unmanaged type to use later]
18374
18375         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18376         MarshalAs Attribute.
18377
18378         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18379         on parameters and accordingly set the marshalling info.
18380
18381 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18382
18383         * class.cs: Optimizing slightly by removing redundant code after
18384         we switched to the `NoTypes' return value.
18385         (Property.DefineMethod): use NoTypes here too.
18386
18387         This fixes the bug I introduced in my last batch of changes.
18388
18389 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18390
18391         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18392
18393         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18394         Enums since those are types too. 
18395
18396         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18397
18398         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18399         thanks to a call during the lookup process.
18400
18401 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18402
18403         * statement.cs (Foreach): Lots of work to accomodate a particular
18404         kind of foreach statement that I had not kept in mind.  It is
18405         possible to have foreachs on classes that provide a GetEnumerator
18406         method that return objects that implement the "pattern" for using
18407         a foreach, there is no need to support GetEnumerator
18408         specifically. 
18409
18410         This is needed to compile nant.
18411
18412         * decl.cs: Only report 114 if the member is not `Finalize' and if
18413         the warning level is at least 2.
18414
18415         * class.cs: Moved the compare function from Method to
18416         MethodSignature. 
18417
18418         (MethodSignature.InheritableMemberSignatureCompare): Add new
18419         filter function that is used to extract inheritable methods from a
18420         class. 
18421
18422         (Method.Define): Use the new `inheritable_method_signature_filter'
18423         delegate
18424
18425         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18426         command. 
18427
18428 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18429
18430         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18431
18432         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18433
18434         * expression.cs: Pass location information to
18435         ConvertImplicitStandard. 
18436
18437         * class.cs: Added debugging code to track return values from
18438         interfaces. 
18439
18440 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18441
18442         * expression.cs (Is.DoResolve): If either side of the `is' is an
18443         interface, do not flag the warning.
18444
18445         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18446         for interfaces
18447
18448         * report.cs: Allow for --fatal to be used with --probe.
18449
18450         * typemanager.cs (NoTypes): Move the definition for the empty Type
18451         array here. 
18452
18453         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18454         properties. 
18455         (TypeContainer.DefineProxy): New function used to proxy to parent
18456         implementations when implementing interfaces.
18457         (TypeContainer.ParentImplements): used to lookup if our parent
18458         implements a public function that is required by an interface.
18459         (TypeContainer.VerifyPendingMethods): Hook this up.
18460
18461         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18462         `modules' and `assemblies' arraylists into arrays.  We only grow
18463         these are the very early start up of the program, so this improves
18464         the speedof LookupType (nicely measured).
18465
18466         * expression.cs (MakeByteBlob): Replaced unsafe code with
18467         BitConverter, as suggested by Paolo.
18468
18469         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18470         folding of string concatenation, but if either side is a string,
18471         and the other is not, then return null, and let the runtime use
18472         the concatenation on the string plus the object (using
18473         `Object.ToString'). 
18474
18475 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18476
18477         Constant Folding has been implemented now.
18478
18479         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18480         the error instead on types that are not supported in one's
18481         complement. 
18482
18483         * constant.cs (Constant and all children): New set of functions to
18484         perform implict and explicit conversions.
18485
18486         * ecore.cs (EnumConstant): Implement the new functions to perform
18487         conversion by proxying to the child expression.
18488
18489         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18490         own separate setting that can not be turned off from the command
18491         line using --unchecked or --checked and is only controlled using
18492         the checked/unchecked statements and expressions.  This setting is
18493         used by the constant folder to flag errors.
18494
18495         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18496         ConstantCheckState as well.   
18497
18498         During Resolve, they also have to flag the state, because the
18499         constant folder runs completely in the Resolve phase.
18500
18501         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18502         well.
18503
18504 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18505
18506         * cfold.cs: New file, this file contains the constant folder.
18507
18508         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18509         argument to track whether we are using the resulting address to
18510         load or store a value and provide better error messages. 
18511
18512         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18513         new AddressOf arguments.
18514
18515         * statement.cs (Foreach.EmitCollectionForeach): Update
18516
18517         * expression.cs (Argument.Emit): Call AddressOf with proper
18518         arguments to track usage.
18519
18520         (New.DoEmit): Call AddressOf with new arguments.
18521
18522         (Unary.Emit): Adjust AddressOf call.
18523
18524 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18525
18526         * cs-parser.jay (member_access): Change the case for pre-defined types
18527         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18528         this suggestion.
18529
18530         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18531         a method body.
18532
18533         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18534         essentially like methods and apply attributes like MethodImplOptions to them too.
18535
18536         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18537         not being null.
18538
18539         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18540         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18541         is the DeclSpace.
18542
18543         * Update code everywhere accordingly.
18544
18545         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18546
18547         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18548
18549 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18550
18551         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18552         try performing lookups against those instead of jumping straight into using
18553         the 'using' clauses.
18554
18555         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18556
18557         (LookupType): Perform lookups in implicit parents too.
18558
18559         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18560         sequence as RootContext.LookupType. 
18561
18562         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18563         the various cases of namespace lookups into this method.
18564
18565 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18566
18567         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18568         in positional arguments)
18569
18570         * class.cs (Operator): Update the AllowedModifiers to contain
18571         extern. 
18572
18573         * cs-parser.jay: Update operator declaration to allow for the
18574         operator body to be empty.
18575
18576         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18577         values. 
18578
18579 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18580
18581         * class.cs (Method.Emit): Label parameters.
18582
18583         * driver.cs: Return 1 or 0 as the program exit code.
18584
18585 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18586
18587         * expression.cs: Special case the `null' object when trying to
18588         auto-compute the type, as anything can be explicitly converted to
18589         that. 
18590
18591         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18592         spotting this Paolo.
18593
18594         (Expression.ImplicitNumericConversion): Perform comparissions of
18595         the type using the underlying type in the case of an enumeration
18596         rather than using the enumeration type for the compare.
18597
18598         Cope with the underlying == type case, which is not possible to
18599         catch before. 
18600
18601         (Expression.ConvertNumericExplicit): Perform comparissions of
18602         the type using the underlying type in the case of an enumeration
18603         rather than using the enumeration type for the compare.
18604
18605         * driver.cs: If the user does not supply an extension, assume .exe
18606
18607         * cs-parser.jay (if_statement): Rewrote so that we can track the
18608         location for the if statement.
18609
18610         * expression.cs (Binary.ConstantFold): Only concat strings when
18611         the operation is "+", not everything ;-)
18612
18613         * statement.cs (Statement.EmitBoolExpression): Take a location
18614         argument. 
18615         (If, While, Do): Track location.
18616
18617         * expression.cs (Binary.ResolveOperator): In the object + string
18618         case, I was missing a call to ConvertImplicit
18619
18620 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18621
18622         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18623         Location arguments. Ensure we use RootContext.LookupType to do our work
18624         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18625
18626         * interface.cs (PopulateMethod): Handle the type of the parameter being
18627         null gracefully.
18628
18629         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18630         have a params method with no fixed arguments and a call is made with no
18631         arguments.
18632
18633 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18634
18635         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18636         the verbatim-string-literal
18637
18638         * support.cs (InternalParameters.ParameterModifier): handle null
18639         fixed parameters.
18640         (InternalParameters.ParameterType): ditto.
18641
18642         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18643         duplicating the name of the variable parameter.
18644         (GetParameterByName): Fix bug where we were not looking up array
18645         paramters if they were the only present (thanks Paolo!).
18646         (GetParameterInfo): We only have an empty set of types if both
18647         fixed and array are set to null.
18648         (GetParameterInfo-idx): Handle FixedParameter == null
18649
18650         * cs-parser.jay: Handle the case where there is no catch
18651         statements (missing null test).
18652
18653 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18654
18655         * driver.cs (MainDriver): Be conservative on our command line
18656         handling.
18657
18658         Catch DirectoryNotFoundException when calling GetFiles.
18659
18660         (SplitPathAndPattern): Used to split the input specification into
18661         a path and a pattern that we can feed to Directory.GetFiles.
18662
18663 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18664
18665         * statement.cs (Fixed): Implement the last case of the Fixed
18666         statement (string handling).
18667
18668         * expression.cs (StringPtr): New class used to return a char * to
18669         a string;  Used by the Fixed statement.
18670
18671         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18672
18673         * expression.cs (Binary.ResolveOperator): Remove redundant
18674         MemberLookup pn parent type.
18675         Optimize union call, we do not need a union if the types are the same.
18676         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18677         type.
18678
18679         Specialize the use of MemberLookup everywhere, instead of using
18680         the default settings. 
18681
18682         (StackAlloc): Implement stackalloc keyword.
18683
18684         * cs-parser.jay: Add rule to parse stackalloc.
18685
18686         * driver.cs: Handle /h, /help, /?
18687
18688         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18689         before we supported unsafe code.
18690
18691         * makefile: add --unsafe to the self compilation of mcs.
18692
18693 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18694
18695         * expression.cs (PointerArithmetic): New class that is used to
18696         perform pointer arithmetic.
18697         (Binary.Resolve): Handle pointer arithmetic
18698         Handle pointer comparission.
18699         (ArrayPtr): Utility expression class that is used to take the
18700         address of an array.
18701
18702         (ElementAccess): Implement array access for pointers
18703
18704         * statement.cs (Fixed): Implement fixed statement for arrays, we
18705         are missing one more case before we are done.
18706
18707         * expression.cs (Indirection): Implement EmitAssign and set the
18708         ExprClass to Variable.  This allows pointer dereferences to be
18709         treated as variables, and to have values assigned to them.
18710
18711         * ecore.cs (Expression.StoreFromPtr): New utility function to
18712         store values dereferencing.
18713
18714 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18715
18716         * expression.cs (Binary.ResolveOperator): Ensure that we are
18717         not trying to operate on a void type - this fixes the reported
18718         bug.
18719
18720         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18721         the parent implementation is sealed.
18722
18723         * ../errors/cs0239.cs : Add.
18724
18725         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18726
18727         * typemanager.cs (unverifiable_code_type): Corresponds to 
18728         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18729         which have unsafe code in them.
18730
18731         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18732         unsafe context.
18733
18734 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18735
18736         * cs-tokenizer.cs: Add support for @"litreal strings"
18737
18738         Make tokenizer accept pre-processor directives
18739         on any column (remove the old C-like limitation). 
18740
18741         * rootcontext.cs (EmitCode): Emit any global attributes.
18742         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18743
18744         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18745
18746         * cs-parser.jay: Add support for global attributes.  
18747
18748 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18749
18750         * expression.cs (Indirection): New helper class.  Unary will
18751         create Indirection classes to be able to implement the
18752         IMemoryLocation interface on it.
18753
18754 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18755
18756         * cs-parser.jay (fixed_statement): reference the right statement.
18757
18758         * statement.cs (Fixed.Emit): Finish implementing the fixed
18759         statement for the &x case.
18760
18761 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18762
18763         * class.cs (Property.Define, Method.Define): Remove newslot when
18764         `implementing'.  
18765
18766         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18767         wrong.  NewSlot should only be used if the `new' keyword is present.
18768
18769         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18770         locating our system dir.  Sorry about this.
18771
18772 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18773
18774         * driver.cs (GetSystemDir): Compute correctly the location of our
18775         system assemblies.  I was using the compiler directory instead of
18776         the library directory.
18777
18778 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18779
18780         * expression.cs (BetterFunction): Put back in what Miguel commented out
18781         since it is the correct fix. The problem is elsewhere ;-)
18782
18783         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18784         parameters of the parms method are themselves compatible or not !
18785
18786         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18787         to check that a class implements an interface before saying that an implicit
18788         conversion was allowed. Use ImplementsInterface to do the checking.
18789
18790 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18791
18792         * class.cs (Method.Define): Track whether we are an explicit
18793         implementation or not.  And only call DefineMethodOverride if we
18794         are an explicit implementation.
18795
18796         (Property.DefineMethod): Ditto.
18797
18798 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18799
18800         * expression.cs (BetterFunction): Catch hideous bug which was
18801          preventing us from detecting ambiguous calls due to implicit casts i.e
18802         cs0121.
18803
18804 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18805
18806         * support.cs (Pair): Remove un-needed method.  I figured why I was
18807         getting the error in cs-parser.jay, the variable in a foreach loop
18808         is readonly, and the compiler does not really treat this as a variable.
18809
18810         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18811         instead of EQUALS in grammar.  
18812
18813         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18814
18815         * expression.cs (Unary.DoResolve): Check whether the argument is
18816         managed or not.
18817
18818 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18819
18820         * support.cs: Api for Pair to set a value.  Despite the fact that
18821         the variables are public the MS C# compiler refuses to compile
18822         code that accesses the field if the variable is part of a foreach
18823         statement. 
18824
18825         * statement.cs (Fixed): Begin implementation of the fixed
18826         statement.
18827
18828         (Block.AddVariable): Return the VariableInfo on success and null
18829         on failure instead of true/false. 
18830
18831         * cs-parser.jay (foreach): Catch errors on variables already
18832         defined (we were ignoring this value before) and properly unwind
18833         the block hierarchy
18834
18835         (fixed_statement): grammar for the fixed statement.
18836
18837 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18838
18839         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18840         pointer types to be incretemented.
18841
18842         (SizeOf): Implement.
18843
18844         * cs-parser.jay (pointer_member_access): Implement
18845         expr->IDENTIFIER production.
18846
18847         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18848         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18849         on safe contexts.
18850
18851         (Unary): Implement indirection.
18852
18853         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18854         use in non-unsafe context).
18855
18856         (SimpleName.DoResolve): Check for pointers in field access on safe
18857         contexts. 
18858
18859         (Expression.LoadFromPtr): Factor the load-indirect code in this
18860         function.  This was duplicated in UnboxCast and ParameterReference
18861
18862 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18863
18864         * expression.cs (ComposedCast): report an error if a pointer cast
18865         is used in a safe region.
18866
18867         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18868         pointer type casts in unsafe context.
18869
18870         * codegen.cs (EmitContext): Set up IsUnsafe.
18871
18872         * cs-parser.jay (non_expression_type): Add productions for pointer
18873         casts. 
18874
18875         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18876         code.  We should not use force into static mode if the method is
18877         not virtual.  Fixes bug in MIS
18878
18879         * statement.cs (Do.Emit, While.Emit, For.Emit,
18880         Statement.EmitBoolExpression): Add support to Do and While to
18881         propagate infinite loop as `I do return' semantics.
18882
18883         Improve the For case to also test for boolean constants.
18884
18885         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18886         to the list of attributes we can add.
18887
18888         Remove `EmitContext' argument.
18889
18890         * class.cs (Method.Define): Apply parameter attributes.
18891         (Constructor.Define): Apply parameter attributes.
18892         (MethodCore.LabelParameters): Move here the core of labeling
18893         parameters. 
18894
18895         * support.cs (ReflectionParameters.ParameterModifier,
18896         InternalParameters.ParameterModifier): Use IsByRef on the type and
18897         only return the OUT bit for these parameters instead of in/out/ref
18898         flags.
18899
18900         This is because I miss-understood things.  The ParameterInfo.IsIn
18901         and IsOut represent whether the parameter has the [In] and [Out]
18902         attributes set.  
18903
18904 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18905
18906         * ecore.cs (FieldExpr.Emit): Release temporaries.
18907
18908         * assign.cs (LocalTemporary.Release): new function.
18909
18910         * codegen.cs (EmitContext.GetTemporaryStorage,
18911         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18912         temporary storage.  Now we can "put back" localbuilders when we
18913         are done with them
18914
18915 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18916
18917         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18918         need to make a copy of the variable to generate verifiable code.
18919
18920 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18921
18922         * driver.cs: Compute dynamically the system directory.
18923
18924         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18925         Slower, but more generally useful.  Used by the abstract
18926         registering implementation. 
18927
18928         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18929         the rules for the special rule on Type/instances.  First check if
18930         we have the same name, and if so, try that special static path
18931         rather than the instance path.
18932
18933 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18934
18935         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18936         for, while and if.
18937
18938         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18939         Enum, ValueType, Delegate or Array for non-corlib compiles.
18940
18941         * cs-tokenizer.cs: Catch long identifiers (645)
18942
18943         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18944         piece of code.
18945
18946         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18947         fix, we were returning too early, so we were not registering
18948         pending methods from abstract classes.
18949
18950         Do not register pending methods if the class is abstract.
18951
18952         * expression.cs (Conditional.DoResolve): Report circular implicit
18953         conversions when we neecd to compute it for conditional
18954         expressions. 
18955
18956         (Is.DoResolve): If the expression is always of the provided type,
18957         flag warning 183.  If the expression can not ever be of the
18958         provided type flag warning 184.
18959
18960         * class.cs: Catch 169 as well.
18961
18962         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18963         read. 
18964
18965 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18966
18967         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18968
18969 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18970
18971         * interface.cs: (PopulateMethod): Check for pointers being defined
18972         only if the unsafe context is active.
18973         (PopulateProperty): ditto.
18974         (PopulateIndexer): ditto.
18975
18976         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18977         specified.  If pointers are present, make sure that they are
18978         present in an unsafe context.
18979         (Constructor, Constructor.Define): ditto.
18980         (Field, Field.Define): ditto.
18981         (Property, Property.Define): ditto.
18982         (Event, Event.Define): ditto.
18983
18984         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18985         hashtable if there are classes or structs defined.
18986
18987         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18988         code, as the constant resolution moved.
18989
18990         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18991         the metadata, so we can flag error 133. 
18992
18993         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18994         pointer is being declared in an unsafe context.
18995
18996 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18997
18998         * modifiers.cs (Modifiers.Check): Require a Location argument.
18999         Report error 227 for Unsafe use.
19000
19001         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19002
19003         * statement.cs (For.Emit): If the test is null, then report that
19004         we do `return', as we wont reach anything afterwards.
19005
19006         (Switch.SwitchGoverningType): Track the expression that matched
19007         the conversion.
19008
19009         * driver.cs: Allow negative numbers as an error code to flag.
19010
19011         * cs-parser.jay: Handle 1551.
19012
19013         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19014
19015 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19016
19017         * cs-parser.jay: Report 1518 (type declaration can only contain
19018         class, struct, interface, enum or delegate)
19019
19020         (switch_label): Report 1523 (keywords `case' or `default' must
19021         preced code)
19022
19023         (opt_switch_sections): Report 1522 (empty switch)
19024
19025         * driver.cs: Report 1515 (response file specified multiple times)
19026         Report 1516 (Source file specified multiple times).
19027
19028         * expression.cs (Argument.Resolve): Signal 1510
19029
19030         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19031         access not allowed in static code)
19032
19033 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19034
19035         * typemanager.cs (IsPointerType): Utility method which we are going
19036         to need a lot.
19037
19038         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19039         the object type, so we take care of that.
19040
19041         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19042
19043         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19044         added to non-params parameters :-)
19045
19046         * typemanager.cs (CSharpName): Include 'void' type too. 
19047
19048         (void_ptr_type): Include in the set of core types.
19049
19050         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19051         duplicating code.
19052
19053         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19054         an unsafe context.
19055
19056         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19057         completely forgotten about it.
19058
19059 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19060
19061         * cs-parser.jay (pointer_type): Add. This begins our implementation
19062         of parsing rules for unsafe code.
19063
19064         (unsafe_statement): Implement.
19065
19066         (embedded_statement): Modify to include the above.
19067
19068         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19069
19070         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19071         if the current context is an unsafe one.
19072
19073         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19074         are handled differently, we need separate rules for them.
19075
19076         (local_variable_declaration): Update to use local_variable_pointer_type
19077         to allow variable declarations of unmanaged pointer types.
19078
19079         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19080         in unsafe contexts.
19081
19082         * ../errors/cs0214.cs : Add.
19083
19084 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19085
19086         * makefile: remove 'response' file when cleaning.
19087
19088 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19089
19090         * cs-parser.jay: Report 1524.
19091
19092 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19093
19094         * typemanager.cs (RegisterMethod): drop checking if we have
19095         registered this from here
19096
19097 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19098
19099         * class.cs (Method.EmitDestructor): Implement calling our base
19100         destructor. 
19101
19102         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19103         value of InFinally.
19104
19105         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19106         this routine and will wrap the call in a try/catch block.  Deal
19107         with the case.
19108
19109 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
19110
19111         * ecore.cs (Expression.MemberLookup): instead of taking a
19112         parameter `same_type' that was used to tell whether we could
19113         access private members we compute our containing type from the
19114         EmitContext.
19115
19116         (FieldExpr): Added partial support for volatile fields.  This does
19117         not work for volatile fields exposed from assemblies, as I can not
19118         figure out how to extract the modreq from it.
19119
19120         Updated all the source files to use this.
19121
19122         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19123         because it is referenced by MemberLookup very often. 
19124
19125 2002-01-09  Ravi Pratap  <ravi@ximian.com>
19126
19127         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19128         TypeBuilder.GetCustomAttributes to retrieve what we need.
19129
19130         Get rid of redundant default_member_attr_type as this is the same as
19131         default_member_type which already exists.
19132
19133         * interface.cs, attribute.cs : Update accordingly.
19134
19135 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
19136
19137         * typemanager.cs: Enable IndexerPropertyName again.  It does not
19138         work for TYpeBuilders though.  Ravi, can you please fix this?
19139
19140         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19141
19142         * expression.cs (Argument.Emit): Handle the case of ref objects
19143         being passed to ref functions;  
19144
19145         (ParameterReference.EmitLoad): Loads the content of the pointer
19146         without dereferencing.
19147
19148 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19149
19150         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19151
19152 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19153
19154         * class.cs (Indexer.DefineMethod): Incorporate the interface
19155         type in the name of the method if we are doing explicit interface
19156         implementation.
19157
19158         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19159
19160         (BetterConversion): Fix extremely trivial bug where we were referring to
19161         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19162         again !
19163
19164         * ../errors/bug16.cs : Add although we have fixed it.
19165
19166 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19167
19168         * expression.cs (BaseIndexer): Begin implementation.
19169
19170         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19171
19172         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19173         production directly to remove a shift/reduce, and implement
19174         explicit interface implementation.
19175
19176         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19177         after a floating point suffix.
19178
19179         * expression.cs (DoNumericPromotions): Improved the conversion for
19180         uint/uint.  If we have a constant, we avoid doing a typecast to a
19181         larger type.
19182
19183         * class.cs (Indexer): Implement explicit interface implementation
19184         for indexers.
19185
19186 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19187
19188         * class.cs: make the default instance constructor public and hidebysig.
19189
19190 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19191
19192         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19193         so we can call it from elsewhere.
19194
19195         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19196         we emit it internally if the class has a defined indexer; otherwise the user
19197         emits it by decorating the class definition with the DefaultMemberAttribute.
19198
19199         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19200         attribute is not used on a type which defines an indexer.
19201
19202         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19203         character when we skip whitespace.
19204
19205         * ../errors/cs0646.cs : Add.
19206
19207 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19208
19209         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19210         again. 
19211
19212         * makefile: Add practical target `mcs3.exe' which builds the third
19213         generation compiler. 
19214
19215         * expression.cs (New): Fix structures constructor calling.
19216
19217         * class.cs (Property, Method, Indexer): Emit Final flag on the
19218         method if we are an interface implementation and we are not
19219         abstract. 
19220
19221         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19222         whether this property is referencing a `base' method.
19223
19224         * expression.cs (Invocation.EmitCall): take an extra argument:
19225         is_base, this is used to determine whether the `call' or
19226         `callvirt' opcode should be used.
19227
19228
19229         * delegate.cs: update EmitCall.
19230
19231         * class.cs (Method.Define): Set NewSlot for the cases where we are
19232         not implementing an interface method.
19233
19234         (Property.Define): ditto.
19235
19236 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19237
19238         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19239         'r'.  Allows mcs to parse itself fully.
19240
19241 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19242
19243         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19244         of the number of initializers that require the InitializeArray method.
19245
19246         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19247         update the above field where necessary.
19248
19249         (MakeByteBlob): Update accordingly.
19250
19251         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19252         greater than 2.
19253
19254         (EmitDynamicInitializers): Update in accordance with the new optimization.
19255
19256         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19257         same OpCode applies.
19258
19259         * cs-parser.jay : Fix some glaring errors I introduced.
19260
19261 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19262
19263         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19264         so that we can check for name clashes there too.
19265
19266         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19267         for interface indexers.
19268
19269         * interfaces.cs (Define): Emit the default member attribute.
19270
19271         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19272         variable was being referred to while setting the value ;-)
19273
19274 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19275
19276         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19277         byte-by-byte information when we know the data is zero.
19278
19279         Make the block always a multiple of 4, because
19280         DefineInitializedData has a bug.
19281
19282         * assign.cs: Fix, we should assign from the temporary, not from
19283         the source. 
19284
19285         * expression.cs (MakeByteBlob): Fix my incorrect code.
19286
19287 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19288
19289         * typemanager.cs (EnumToUnderlying): This function is used to get
19290         the underlying type from an enumeration, because it does not
19291         always work. 
19292
19293         * constant.cs: Use the I4_S form for values between -128 and 127.
19294
19295         * statement.cs (Block.LookupLabel): Looks up a label.
19296         (Block): Drop support for labeled blocks.
19297
19298         (LabeledStatement): New kind of statement that represents a label
19299         only.
19300
19301         (Goto): Finally implement this bad boy.
19302
19303         * cs-parser.jay: Update to reflect new mechanism to implement
19304         labels.
19305
19306 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19307
19308         * codegen.cs (EmitContext.This): a codegen property that keeps the
19309         a single instance of this instead of creating many different this
19310         instances. 
19311
19312         * delegate.cs (Delegate.DoResolve): Update to use the property;
19313
19314         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19315
19316         * expression.cs (BaseAccess.DoResolve): Ditto.
19317
19318 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19319
19320         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19321         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19322
19323         (InitCoreTypes): Update accordingly.
19324
19325         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19326         so we can quickly store the state.
19327
19328         (ApplyAttributes): Set the correct implementation flags
19329         for InternalCall methods.
19330
19331 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19332
19333         * expression.cs (EmitCall): if a method is not virtual, then do
19334         not use callvirt on it.
19335
19336         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19337         user defined stuff) requires the use of stobj, which takes an
19338         address on the stack instead of an array and an index.  So emit
19339         the Ldelema operation for it.
19340
19341         (EmitStoreOpcode): Use stobj for valuetypes.
19342
19343         (UnaryMutator.EmitCode): Use the right 1 value depending on
19344         whether we are dealing with int64/uint64, float or doubles.
19345
19346         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19347         constructors that I implemented last night.
19348
19349         (Constructor.IsDefault): Fix to work properly for static
19350         constructors.
19351
19352         * cs-parser.jay (CheckDef): report method signature errors.
19353         Update error number 103 to be 132.
19354
19355         * decl.cs: New AdditionResult enumeration value: MethodExists.
19356         Although we do this check for methods later on in the semantic
19357         analysis, catching repeated default constructors is so easy that
19358         we catch these here. 
19359
19360         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19361         promotions code.
19362
19363         (ParameterReference.EmitAssign, Emit): handle
19364         bools as bytes.
19365
19366         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19367         (ArrayAccess.EmitStoreOpcode): ditto.
19368
19369         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19370
19371         * expression.cs (MakeByteBlob): Complete all the missing types
19372         (uint, short, ushort, byte, sbyte)
19373
19374         * class.cs: Only init instance field initializers on instance
19375         constructors. 
19376
19377         Rename `constructors' to instance_constructors. 
19378
19379         (TypeContainer.AddConstructor): Only add constructors to the list
19380         if it is not static.
19381
19382         Make sure that we handle default_static_constructor independently
19383         everywhere where we handle instance_constructors
19384
19385 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19386
19387         * class.cs: Do not lookup or create a base initializer for a
19388         static constructor.
19389
19390         (ConstructorInitializer.Resolve): use the proper type to lookup
19391         for constructors.
19392
19393         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19394
19395         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19396         in DeclSpace. 
19397
19398         * decl.cs: CloseType is now an virtual method, the default
19399         implementation just closes this type.
19400
19401 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19402
19403         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19404         to PreserveSig by default. Also emit HideBySig on such methods.
19405
19406         Basically, set the defaults to standard values.
19407
19408         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19409         argument, if candidate is better, it can't be worse than the best !
19410
19411         (Invocation): Re-write bits to differentiate between methods being
19412         applicable in their expanded form and their normal form - for params
19413         methods of course.
19414
19415         Get rid of use_standard everywhere as only standard conversions are allowed
19416         in overload resolution. 
19417
19418         More spec conformance.
19419
19420 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19421
19422         * driver.cs: Add --timestamp, to see where the compiler spends
19423         most of its time.
19424
19425         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19426         `this' in static code.
19427
19428         (SimpleName.DoResolve): Implement in terms of a helper function
19429         that allows static-references to be passed upstream to
19430         MemberAccess.
19431
19432         (Expression.ResolveWithSimpleName): Resolve specially simple
19433         names when called by MemberAccess to implement the special
19434         semantics. 
19435
19436         (Expression.ImplicitReferenceConversion): Handle conversions from
19437         Null to reference types before others, as Null's type is
19438         System.Object. 
19439
19440         * expression.cs (Invocation.EmitCall): Handle the special case of
19441         calling methods declared on a reference type from a ValueType
19442         (Base classes System.Object and System.Enum)
19443
19444         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19445         the left hand side is a TypeExpr, not on every enumeration. 
19446
19447         (Binary.Resolve): If types are reference types, then do a cast to
19448         object on operators != and == of both arguments.
19449
19450         * typemanager.cs (FindMembers): Extract instance and static
19451         members if requested.
19452
19453         * interface.cs (PopulateProperty): Use void_type instead of null
19454         as the return type for the setter method.
19455
19456         (PopulateIndexer): ditto.
19457
19458 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19459
19460         * support.cs (ReflectionParameters): Fix minor bug where we
19461         were examining the wrong parameter for the ParamArray attribute.
19462
19463         Cope with requests for the type of the parameter at position
19464         greater than the params parameter's. We now return the element
19465         type of the params array as that makes more sense.
19466
19467         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19468         accordingly as we no longer have to extract the element type
19469         ourselves.
19470
19471         (Invocation.OverloadResolve): Update.
19472
19473 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19474
19475         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19476         against IEnumerator, test whether the return value is a descendant
19477         of the IEnumerator interface.
19478
19479         * class.cs (Indexer.Define): Use an auxiliary method to implement
19480         the other bits of the method definition.  Begin support for
19481         explicit interface implementation.
19482
19483         (Property.DefineMethod): Use TypeManager.void_type instead of null
19484         for an empty return value.
19485
19486 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19487
19488         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19489         dealing with a FieldExpr which is composed of a FieldBuilder, in
19490         the code path we did extract the constant, but we should have
19491         obtained the underlying value to be able to cast it (otherwise we
19492         end up in an infinite loop, this is what Ravi was running into).
19493
19494         (ArrayCreation.UpdateIndices): Arrays might be empty.
19495
19496         (MemberAccess.ResolveMemberAccess): Add support for section
19497         14.5.4.1 that deals with the special case of E.I when E is a type
19498         and something else, that I can be a reference to a static member.
19499
19500         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19501         handle a particular array type to create byte blobs, it is just
19502         something we dont generate byteblobs for.
19503
19504         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19505         arguments. 
19506
19507         * location.cs (Push): remove the key from the hashtable that we
19508         are about to add.   This happens for empty files.
19509
19510         * driver.cs: Dispose files after we have parsed them.
19511
19512         (tokenize): new function that only runs the tokenizer on its
19513         input, for speed testing.
19514
19515 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19516
19517         * class.cs (Event.Define): Define the private field only if there
19518         are no accessors defined.
19519
19520         * expression.cs (ResolveMemberAccess): If there is no associated
19521         field with the event, that means we have an event defined with its
19522         own accessors and we should flag error cs0070 since transforming
19523         ourselves into a field is not valid in that case.
19524
19525         * ecore.cs (SimpleName.DoResolve): Same as above.
19526
19527         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19528         and charset to sane values.
19529
19530 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19531
19532         * assign.cs (DoResolve): Perform check on events only if they 
19533         are being accessed outside the declaring type.
19534
19535         * cs-parser.jay (event_declarations): Update rules to correctly
19536         set the type of the implicit parameter etc.
19537
19538         (add_accessor, remove_accessor): Set current local parameters.
19539
19540         * expression.cs (Binary): For delegate addition and subtraction,
19541         cast the return value from the method into the appropriate delegate
19542         type.
19543
19544 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19545
19546         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19547         of these as the workaround is unnecessary.
19548
19549         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19550         delegate data - none of that is needed at all.
19551
19552         Re-write bits to extract the instance expression and the delegate method
19553         correctly.
19554
19555         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19556         on delegates too.
19557
19558         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19559         of attaching attributes instead of duplicating code everywhere.
19560
19561         * everywhere : Update code to do attribute emission using the above method.
19562
19563 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19564
19565         * expression.cs (IsParamsMethodApplicable): if there are not
19566         parameters, return immediately.
19567
19568         * ecore.cs: The 0 literal can be implicity converted to an enum
19569         type. 
19570
19571         (SimpleName.DoResolve): First lookup the type, then lookup the
19572         members. 
19573
19574         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19575         want to get its address.  If the InstanceExpression is not
19576         addressable, store the result in a temporary variable, then get
19577         the address of it.
19578
19579         * codegen.cs: Only display 219 errors on warning level or above. 
19580
19581         * expression.cs (ArrayAccess): Make it implement the
19582         IMemoryLocation interface.
19583
19584         (Binary.DoResolve): handle the operator == (object a, object b)
19585         and operator != (object a, object b) without incurring into a
19586         BoxedCast (because 5 != o should never be performed).
19587
19588         Handle binary enumerator operators.
19589
19590         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19591         value type, otherwise use Ldelem_ref.
19592
19593         Use precomputed names;
19594
19595         (AddressOf): Implement address of
19596
19597         * cs-parser.jay (labeled_statement): Fix recursive block
19598         addition by reworking the production.
19599
19600         * expression.cs (New.DoEmit): New has a special case:
19601                 
19602                  If we are dealing with a ValueType, we have a few
19603                  situations to deal with:
19604                 
19605                     * The target of New is a ValueType variable, that is
19606                       easy, we just pass this as the variable reference
19607                 
19608                     * The target of New is being passed as an argument,
19609                       to a boxing operation or a function that takes a
19610                       ValueType.
19611                 
19612                       In this case, we need to create a temporary variable
19613                       that is the argument of New.
19614
19615
19616 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19617
19618         * rootcontext.cs (LookupType): Check that current_type is not null before
19619         going about looking at nested types.
19620
19621         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19622         not implement the IAssignMethod interface any more.
19623
19624         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19625         where we tranform them into FieldExprs if they are being resolved from within
19626         the declaring type.
19627
19628         * ecore.cs (SimpleName.DoResolve): Do the same here.
19629
19630         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19631
19632         * ../errors/bug10.cs : Add.
19633
19634         * ../errors/cs0070.cs : Add.
19635
19636         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19637
19638         * assign.cs : Get rid of EventIsLocal everywhere.
19639
19640 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19641
19642         * ecore.cs (ConvertIntLiteral): finished the implementation.
19643
19644         * statement.cs (SwitchLabel): Convert the value we are using as a
19645         key before looking up the table.
19646
19647 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19648
19649         * codegen.cs (EmitTopBlock): Require a Location argument now.
19650
19651         * cs-parser.jay (constructor_declarator): We need to setup
19652         current_local_parameters before we parse the
19653         opt_constructor_initializer, to allow the variables to be bound
19654         to the constructor arguments.
19655
19656         * rootcontext.cs (LookupType): First lookup nested classes in our
19657         class and our parents before we go looking outside our class.
19658
19659         * expression.cs (ConstantFold): Extract/debox the values at the
19660         beginnning. 
19661
19662         * rootcontext.cs (EmitCode): Resolve the constants first before we
19663         resolve the types.  This is not really needed, but it helps debugging.
19664
19665         * statement.cs: report location.
19666
19667         * cs-parser.jay: pass location to throw statement.
19668
19669         * driver.cs: Small bug fix.
19670
19671         * report.cs: Updated format to be 4-zero filled digits.
19672
19673 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19674
19675         * expression.cs (CheckIndices): Fix minor bug where the wrong
19676         variable was being referred to ;-)
19677
19678         (DoEmit): Do not call EmitStaticInitializers when the 
19679         underlying type is System.Object.
19680
19681 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19682
19683         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19684         and do the usual workaround for SRE.
19685
19686         * class.cs (MyEventBuilder.EventType): New member to get at the type
19687         of the event, quickly.
19688
19689         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19690
19691         * assign.cs (Assign.DoResolve): Handle the case when the target
19692         is an EventExpr and perform the necessary checks.
19693
19694         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19695         interface.
19696
19697         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19698
19699         (EventExpr): Set the type in the constructor itself since we 
19700         are meant to be born fully resolved.
19701
19702         (EventExpr.Define): Revert code I wrote earlier.
19703                 
19704         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19705         instance expression is null. The instance expression is a This in that case
19706         or a null, depending on whether it is a static method or not.
19707
19708         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19709         refers to more than one method.
19710
19711         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19712         and accordingly flag errors.
19713
19714 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19715
19716         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19717
19718 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19719
19720         * location.cs (ToString): Provide useful rutine.
19721
19722 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19723
19724         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19725         objects, return the actual integral boxed.
19726
19727         * statement.cs (SwitchLabel): define an ILLabel for each
19728         SwitchLabel. 
19729
19730         (Switch.CheckSwitch): If the value is a Literal, extract
19731         the underlying literal.
19732
19733         Also in the unused hashtable we had, add the SwitchLabel so we can
19734         quickly look this value up.
19735
19736         * constant.cs: Implement a bunch of new constants.  Rewrite
19737         Literal based on this.  Made changes everywhere to adapt to this.
19738
19739         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19740         dereferencing array only once, and also copes with enumrations.
19741
19742         bytes are two bytes wide, not one.
19743
19744         (Cast): Perform constant conversions.
19745
19746         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19747         wrappers to the literals here.
19748
19749         * expression.cs (DoNumericPromotions): long literals can converted
19750         to ulong implicity (this is taken care of elsewhere, but I was
19751         missing this spot).
19752
19753         * ecore.cs (Expression.Literalize): Make the return type Literal,
19754         to improve type checking.
19755
19756         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19757
19758 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19759
19760         * literal.cs: Revert code from ravi that checked the bounds.  The
19761         bounds are sane by the definition of the type itself. 
19762
19763         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19764         need to actually look up in our parent hierarchy for interfaces
19765         implemented. 
19766
19767         * const.cs: Use the underlying type for enumerations
19768
19769         * delegate.cs: Compute the basename for the delegate creation,
19770         that should fix the delegate test case, and restore the correct
19771         Type Lookup semantics in rootcontext
19772
19773         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19774         referencing a nested type with the Reflection API is using the "+"
19775         sign. 
19776
19777         * cs-parser.jay: Do not require EOF token at the end.
19778
19779 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19780
19781         * rootcontext.cs (LookupType): Concatenate type names with
19782         a '.' instead of a '+' The test suite passes again.
19783
19784         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19785         field of the enumeration.
19786
19787         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19788         the case when the member is an EventExpr.
19789
19790         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19791         static has an associated instance expression.
19792
19793         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19794
19795         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19796
19797         * class.cs (Event.Define): Register event and perform appropriate checks
19798         for error #111.
19799
19800         We define the Add and Remove methods even if the use provides none because
19801         in that case, we provide default implementations ourselves.
19802
19803         Define a private field of the type of the event. This is done by the CSC compiler
19804         and we should be doing it too ;-)
19805
19806         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19807         More methods we use in code we generate.
19808
19809         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19810         is important.
19811
19812         (InitCoreTypes): Update accordingly for the above.
19813
19814         * class.cs (Event.Emit): Generate code for default accessors that we provide
19815
19816         (EmitDefaultMethod): Do the job in the above.
19817
19818         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19819         appropriate place.
19820
19821 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19822
19823         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19824         builders even if we were missing one.
19825
19826         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19827         pass the Basename as our class name instead of the Name.  The
19828         basename will be correctly composed for us.
19829
19830         * parameter.cs (Paramters): Now takes a Location argument.
19831
19832         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19833         make all the code call directly LookupType in RootContext and take
19834         this chance to pass the Location information everywhere.
19835
19836         * Everywhere: pass Location information.
19837
19838 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19839
19840         * class.cs (Constructor.Define): Updated way of detecting the
19841         length of the parameters.
19842
19843         (TypeContainer.DefineType): Use basename as the type name for
19844         nested types.
19845
19846         (TypeContainer.Define): Do not recursively define types here, as
19847         definition is taken care in order by the RootContext.
19848
19849         * tree.cs: Keep track of namespaces in a per-file basis.
19850
19851         * parameter.cs (Parameter.ComputeSignature): Update to use
19852         DeclSpace. 
19853
19854         (Parameters.GetSignature): ditto.
19855
19856         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19857         instead of a TypeContainer.
19858
19859         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19860         resolve names.  Because we need to be resolve in our context, not
19861         our parents.
19862
19863         * driver.cs: Implement response files.
19864
19865         * class.cs (TypeContainer.DefineType): If we are defined, do not
19866         redefine ourselves.
19867
19868         (Event.Emit): Emit the code for add/remove handlers.
19869         (Event.Define): Save the MethodBuilders for add/remove.
19870
19871         * typemanager.cs: Use pair here too.
19872
19873         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19874         DictionaryEntry requires the first argument to be non-null.  
19875
19876         (enum_declaration): Compute full name for registering the
19877         enumeration.
19878
19879         (delegate_declaration): Instead of using
19880         formal_parameter_list, use opt_formal_parameter_list as the list
19881         can be empty.
19882
19883         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19884         (EventParsing): New property that controls whether `add' and
19885         `remove' are returned as tokens or identifiers (for events);
19886
19887 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19888
19889         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19890         use MyEventBuilder only and let it wrap the real builder for us.
19891
19892         (MyEventBuilder): Revamp constructor etc.
19893
19894         Implement all operations that we perform on EventBuilder in precisely the same
19895         way here too.
19896
19897         (FindMembers): Update to use the EventBuilder member.
19898
19899         (Event.Emit): Update accordingly.
19900
19901 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19902
19903         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19904         by calling the appropriate methods.
19905
19906         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19907         useful.
19908
19909         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19910
19911 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19912
19913         * delegate.cs (Delegate.Populate): Check that the return type
19914         and various parameters types are indeed accessible.
19915
19916         * class.cs (Constructor.Define): Same here.
19917
19918         (Field.Define): Ditto.
19919
19920         (Event.Define): Ditto.
19921
19922         (Operator.Define): Check that the underlying Method defined itself
19923         correctly - so it's MethodBuilder should not be null.
19924
19925         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19926         expression happens to be null.
19927
19928         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19929         members but as of now we don't seem to be able to do anything really useful with it.
19930
19931         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19932         not the EventBuilder.
19933
19934 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19935
19936         * cs-tokenizer.cs: Add support for defines.
19937         Add support for #if, #elif, #else, #endif
19938
19939         (eval_var): evaluates a variable.
19940         (eval): stubbed for evaluating functions.
19941
19942         * cs-parser.jay: Pass the defines information
19943
19944         * driver.cs: Add --define command line option.
19945
19946         * decl.cs: Move MemberCore here.
19947
19948         Make it the base class for DeclSpace.  This allows us to catch and
19949         report 108 and 109 for everything now.
19950
19951         * class.cs (TypeContainer.Define): Extract all the members
19952         before populating and emit the warning 108 (new keyword required
19953         to override) instead of having each member implement this.
19954
19955         (MemberCore.Define): New abstract method, we will be using this in
19956         the warning reporting engine in Populate.
19957
19958         (Operator.Define): Adjust to new MemberCore protocol. 
19959
19960         * const.cs (Const): This does not derive from Expression, it is a
19961         temporary object we use to create fields, it is a MemberCore. 
19962
19963         * class.cs (Method.Define): Allow the entry point to be in a
19964         specific class.
19965
19966         * driver.cs: Rewrite the argument handler to clean it up a bit.
19967
19968         * rootcontext.cs: Made it just an auxiliary namespace feature by
19969         making everything static.
19970
19971         * driver.cs: Adapt code to use RootContext type name instead of
19972         instance variable.
19973
19974         * delegate.cs: Remove RootContext argument.
19975
19976         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19977         argument. 
19978
19979         * class.cs (Event.Define): The lookup can fail.
19980
19981         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19982
19983         * expression.cs: Resolve the this instance before invoking the code.
19984
19985 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19986
19987         * cs-parser.jay: Add a production in element_access that allows
19988         the thing to become a "type" reference.  This way we can parse
19989         things like "(string [])" as a type.
19990
19991         Note that this still does not handle the more complex rules of
19992         casts. 
19993
19994
19995         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19996
19997         * ecore.cs: (CopyNewMethods): new utility function used to
19998         assemble the list of methods from running FindMembers.
19999
20000         (MemberLookup): Rework FindMembers so that 
20001
20002 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20003
20004         * class.cs (TypeContainer): Remove Delegates who fail to be
20005         defined.
20006
20007         * delegate.cs (Populate): Verify that we dont get null return
20008         values.   TODO: Check for AsAccessible.
20009
20010         * cs-parser.jay: Use basename to emit error 574 (destructor should
20011         have the same name as container class), not the full name.
20012
20013         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20014         possible representation.  
20015
20016         Also implements integer type suffixes U and L.
20017
20018 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20019
20020         * expression.cs (ArrayCreation.DoResolve): We need to do the
20021         argument resolution *always*.
20022
20023         * decl.cs: Make this hold the namespace.  Hold the root context as
20024         well.
20025         (LookupType): Move here.
20026
20027         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20028
20029         * location.cs (Row, Name): Fixed the code, it was always returning
20030         references to the first file.
20031
20032         * interface.cs: Register properties defined through interfaces.
20033
20034         * driver.cs: Add support for globbing on the command line
20035
20036         * class.cs (Field): Make it derive from MemberCore as well.
20037         (Event): ditto.
20038
20039 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20040
20041         * class.cs (Event::Define): Check that the type of the event is a delegate
20042         type else flag error #66.
20043
20044         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20045         same.
20046
20047         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20048         values of EntryPoint, CharSet etc etc.
20049
20050         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20051
20052         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20053         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20054         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20055         which needs this to do its work.
20056
20057         * ../errors/cs0066.cs : Add.
20058
20059 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20060
20061         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20062         helper functions.
20063
20064         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20065         clears out the parameters field.
20066         (MemberSignatureCompare): Cleanup
20067
20068         (MemberCore): New base class used to share code between MethodCore
20069         and Property.
20070
20071         (RegisterRequiredImplementations) BindingFlags.Public requires
20072         either BindingFlags.Instace or Static.  Use instance here.
20073
20074         (Property): Refactored code to cope better with the full spec.
20075
20076         * parameter.cs (GetParameterInfo): Return an empty array instead
20077         of null on error.
20078
20079         * class.cs (Property): Abstract or extern properties have no bodies.
20080
20081         * parameter.cs (GetParameterInfo): return a zero-sized array.
20082
20083         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20084         method modifier validation to the typecontainer so we can reuse
20085         this on properties.
20086
20087         (MethodCore.ParameterTypes): return an empty sized array of types.
20088
20089         (Property.Define): Test property modifier validity.
20090
20091         Add tests for sealed/override too.
20092
20093         (Method.Emit): abstract or extern methods have no bodies.
20094
20095 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20096
20097         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20098         thing.
20099
20100         (Method::Define, ::Emit): Modify accordingly.
20101
20102         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20103
20104         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20105
20106         * makefile: Pass in /unsafe.
20107
20108 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
20109
20110         * class.cs (MakeKey): Kill routine.
20111
20112         * class.cs (TypeContainer.Define): Correctly define explicit
20113         method implementations (they require the full interface name plus
20114         the method name).
20115
20116         * typemanager.cs: Deply the PtrHashtable here and stop using the
20117         lame keys.  Things work so much better.
20118
20119         This of course broke everyone who depended on `RegisterMethod' to
20120         do the `test for existance' test.  This has to be done elsewhere.
20121
20122         * support.cs (PtrHashtable): A hashtable that avoid comparing with
20123         the object stupid Equals method (because, that like fails all over
20124         the place).  We still do not use it.
20125
20126         * class.cs (TypeContainer.SetRequiredInterface,
20127         TypeContainer.RequireMethods): Killed these two routines and moved
20128         all the functionality to RegisterRequiredImplementations.
20129
20130         (TypeContainer.RegisterRequiredImplementations): This routine now
20131         registers all the implementations required in an array for the
20132         interfaces and abstract methods.  We use an array of structures
20133         which can be computed ahead of time to reduce memory usage and we
20134         also assume that lookups are cheap as most classes will not
20135         implement too many interfaces.
20136
20137         We also avoid creating too many MethodSignatures.
20138
20139         (TypeContainer.IsInterfaceMethod): Update and optionally does not
20140         clear the "pending" bit if we find that there are problems with
20141         the declaration.
20142
20143         (TypeContainer.VerifyPendingMethods): Update to report errors of
20144         methods that look like implementations but are not.
20145
20146         (TypeContainer.Define): Add support for explicit interface method
20147         implementation. 
20148
20149 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
20150
20151         * typemanager.cs: Keep track of the parameters here instead of
20152         being a feature of the TypeContainer.
20153
20154         * class.cs: Drop the registration of parameters here, as
20155         InterfaceMethods are also interface declarations.
20156
20157         * delegate.cs: Register methods with the TypeManager not only with
20158         the TypeContainer.  This code was buggy.
20159
20160         * interface.cs: Full registation here.
20161
20162 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20163
20164         * expression.cs: Remove reducer for binary expressions, it can not
20165         be done this way.
20166
20167         * const.cs: Put here the code that used to go into constant.cs
20168
20169         * constant.cs: Put here the code for constants, this is a new base
20170         class for Literals.
20171
20172         * literal.cs: Make Literal derive from Constant.
20173
20174 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20175
20176         * statement.cs (Return.Emit): Report error 157 if the user
20177         attempts to return from a finally block.
20178
20179         (Return.Emit): Instead of emitting a return, jump to the end of
20180         the function.
20181
20182         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20183         LocalBuilder to store the result of the function.  ReturnLabel is
20184         the target where we jump.
20185
20186
20187 2001-12-09  Radek Doulik  <rodo@ximian.com>
20188
20189         * cs-parser.jay: remember alias in current namespace
20190
20191         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20192         namespaces
20193
20194         * class.cs (LookupAlias): lookup alias in my_namespace
20195
20196         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20197         aliases hashtable
20198         (LookupAlias): lookup alias in this and if needed in parent
20199         namespaces
20200
20201 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20202
20203         * support.cs: 
20204
20205         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20206         making things static.  I need this to avoid passing the
20207         TypeContainer when calling ParameterType.
20208
20209         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20210         that did string manipulation to compute the type and then call
20211         GetType.  Use Parameter.ParameterType instead.
20212
20213         * cs-tokenizer.cs: Consume the suffix for floating values.
20214
20215         * expression.cs (ParameterReference): figure out whether this is a
20216         reference parameter or not.  Kill an extra variable by computing
20217         the arg_idx during emission.
20218
20219         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20220         function that returns whether a parameter is an out/ref value or not.
20221
20222         (Parameter.ParameterType): The type of the parameter (base,
20223         without ref/out applied).
20224
20225         (Parameter.Resolve): Perform resolution here.
20226         (Parameter.ExternalType): The full type (with ref/out applied).
20227
20228         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20229         support for expressions on the using statement.
20230
20231 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20232
20233         * statement.cs (Using.EmitLocalVariableDecls): Split the
20234         localvariable handling of the using statement.
20235
20236         (Block.EmitMeta): Keep track of variable count across blocks.  We
20237         were reusing slots on separate branches of blocks.
20238
20239         (Try.Emit): Emit the general code block, we were not emitting it. 
20240
20241         Check the type of the declaration to be an IDisposable or
20242         something that can be implicity converted to it. 
20243
20244         Emit conversions if required.
20245
20246         * ecore.cs (EmptyExpression): New utility class.
20247         (Expression.ImplicitConversionExists): New utility function.
20248
20249 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20250
20251         * statement.cs (Using): Implement.
20252
20253         * expression.cs (LocalVariableReference): Support read only variables.
20254
20255         * statement.cs: Remove the explicit emit for the Leave opcode.
20256         (VariableInfo): Add a readonly field.
20257
20258 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20259
20260         * ecore.cs (ConvCast): new class used to encapsulate the various
20261         explicit integer conversions that works in both checked and
20262         unchecked contexts.
20263
20264         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20265         properly generate the overflow opcodes.
20266
20267 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20268
20269         * statement.cs: The correct type for the EmptyExpression is the
20270         element_type, not the variable type.  Ravi pointed this out.
20271
20272 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20273
20274         * class.cs (Method::Define): Handle PInvoke methods specially
20275         by using DefinePInvokeMethod instead of the usual one.
20276
20277         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20278         above to do the task of extracting information and defining the method.
20279
20280 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20281
20282         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20283         of the condition for string type.
20284
20285         (Emit): Move that here. 
20286
20287         (ArrayCreation::CheckIndices): Keep string literals in their expression
20288         form.
20289
20290         (EmitDynamicInitializers): Handle strings appropriately.
20291
20292 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20293
20294         * codegen.cs (EmitContext): Replace multiple variables with a
20295         single pointer to the current Switch statement.
20296
20297         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20298         EmitContext.
20299
20300 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20301
20302         * statement.cs 
20303
20304         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20305         default'.
20306
20307         (Foreach.Emit): Foreach on arrays was not setting
20308         up the loop variables (for break/continue).
20309
20310         (GotoCase): Semi-implented.
20311
20312 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20313
20314         * attribute.cs (CheckAttribute): Handle system attributes by using
20315         Attribute.GetAttributes to examine information we need.
20316
20317         (GetValidPlaces): Same here.
20318
20319         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20320
20321         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20322
20323         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20324
20325         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20326
20327         (Method::Emit): Handle the case when we are a PInvoke method.
20328
20329 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20330
20331         * expression.cs: Use ResolveWithSimpleName on compound names.
20332
20333 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20334
20335         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20336         before trying to reduce it.
20337
20338         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20339
20340         * constant.cs (LookupConstantValue): Implement.
20341
20342         (EmitConstant): Use the above in emitting the constant.
20343
20344         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20345         that are user-defined by doing a LookupConstantValue on them.
20346
20347         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20348         too, like above.
20349
20350 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20351
20352         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20353
20354         (BaseAccess.DoResolve): Implement.
20355
20356         (MemberAccess.DoResolve): Split this routine into a
20357         ResolveMemberAccess routine that can be used independently
20358
20359 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20360
20361         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20362         As that share bits of the implementation.  Is returns a boolean,
20363         while As returns the Type that is being probed.
20364
20365 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20366
20367         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20368         instead of a Literal - much easier.
20369
20370         (EnumInTransit): Remove - utterly useless :-)
20371
20372         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20373
20374         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20375
20376         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20377         chain when we have no associated expression.
20378
20379 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20380
20381         * constant.cs (Define): Use Location while reporting the errror.
20382
20383         Also emit a warning when 'new' is used and there is no inherited
20384         member to hide.
20385
20386         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20387         populated.
20388
20389         (LookupEnumValue): Implement to lookup an enum member's value and define it
20390         if necessary.
20391
20392         (Populate): Re-write accordingly to use the above routine.
20393
20394 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20395
20396         * expression.cs (This): Fix prototype for DoResolveLValue to
20397         override the base class DoResolveLValue.
20398
20399         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20400         declarations) 
20401
20402         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20403         (we need to load the address of the field here).  This fixes
20404         test-22. 
20405
20406         (FieldExpr.DoResolveLValue): Call the DoResolve
20407         function to initialize the Instance expression.
20408
20409         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20410         correctly the GetEnumerator operation on a value type.
20411
20412         * cs-parser.jay: Add more simple parsing error catches.
20413
20414         * statement.cs (Switch): Add support for string switches.
20415         Handle null specially.
20416
20417         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20418
20419 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20420
20421         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20422
20423         (declare_local_constant): New helper function.
20424
20425         * statement.cs (AddConstant): Keep a separate record of constants
20426
20427         (IsConstant): Implement to determine if a variable is a constant.
20428
20429         (GetConstantExpression): Implement.
20430
20431         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20432
20433         * statement.cs (IsVariableDefined): Re-write.
20434
20435 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20436
20437         * class.cs (TypeContainer::FindMembers): Look for constants
20438         in the case when we are looking for MemberTypes.Field
20439
20440         * expression.cs (MemberAccess::DoResolve): Check that in the
20441         case we are a FieldExpr and a Literal, we are not being accessed
20442         by an instance reference.
20443
20444         * cs-parser.jay (local_constant_declaration): Implement.
20445
20446         (declaration_statement): Implement for constant declarations.
20447
20448 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20449
20450         * statement.cs (Switch): Catch double defaults.
20451
20452         (Switch): More work on the switch() statement
20453         implementation.  It works for integral values now, need to finish
20454         string support.
20455
20456
20457 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20458
20459         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20460         integer literals into other integer literals.  To be used by
20461         switch. 
20462
20463 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20464
20465         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20466         some memory.
20467
20468         (EmitDynamicInitializers): Cope with the above since we extract data
20469         directly from ArrayData now.
20470
20471         (ExpectInitializers): Keep track of whether initializers are mandatory
20472         or not.
20473
20474         (Bounds): Make it a hashtable to prevent the same dimension being 
20475         recorded for every element in that dimension.
20476
20477         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20478         from being found.
20479
20480         Also fix bug which was causing the indices to be emitted in the reverse
20481         order.
20482
20483 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20484
20485         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20486         unfinished.  They do not work, because the underlying code is
20487         sloppy.
20488
20489 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20490
20491         * cs-parser.jay: Remove bogus fixme.
20492
20493         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20494         on Switch statement.
20495
20496 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20497
20498         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20499         the same. 
20500
20501         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20502         parameter. Apparently, any expression is allowed. 
20503
20504         (ValidateInitializers): Update accordingly.
20505
20506         (CheckIndices): Fix some tricky bugs thanks to recursion.
20507
20508         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20509         I was being completely brain-dead.
20510
20511         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20512         and re-write acordingly.
20513
20514         (DelegateInvocation): Re-write accordingly.
20515
20516         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20517
20518         (MakeByteBlob): Handle types more correctly.
20519
20520         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20521         initialization from expressions but it is incomplete because I am a complete
20522         Dodo :-|
20523
20524 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20525
20526         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20527         on If.  Basically, we have to return `true' (ie, we do return to
20528         our caller) only if both branches of the if return.
20529
20530         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20531         short-circuit operators, handle them as short circuit operators. 
20532
20533         (Cast.DoResolve): Resolve type.
20534         (Cast.Cast): Take an expression as the target type.
20535
20536         * cs-parser.jay (cast_expression): Remove old hack that only
20537         allowed a limited set of types to be handled.  Now we take a
20538         unary_expression and we resolve to a type during semantic
20539         analysis.
20540
20541         Use the grammar productions from Rhys to handle casts (this is
20542         not complete like Rhys syntax yet, we fail to handle that corner
20543         case that C# has regarding (-x), but we will get there.
20544
20545 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20546
20547         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20548         field which is an array type.
20549
20550         * cs-parser.jay (declare_local_variables): Support array initialization too.
20551
20552         * typemanager.cs (MakeKey): Implement.
20553
20554         (everywhere): Use the above appropriately.
20555
20556         * cs-parser.jay (for_statement): Update for array initialization while
20557         declaring variables.
20558
20559         * ecore.cs : The error message was correct, it's the variable's names that
20560         were misleading ;-) Make the code more readable.
20561
20562         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20563         the correct type etc.
20564
20565         (ConvertExplicit): Handle Enum types by examining the underlying type.
20566
20567 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20568
20569         * parameter.cs (GetCallingConvention): Always return
20570         CallingConventions.Standard for now.
20571
20572 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20573
20574         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20575         and `r' after calling DoNumericPromotions.
20576
20577         * ecore.cs: Fix error message (the types were in the wrong order).
20578
20579         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20580         BindingFlags.Instance as well 
20581
20582         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20583         implicit int literal conversion in an empty cast so that we
20584         propagate the right type upstream.
20585
20586         (UnboxCast): new class used to unbox value types.
20587         (Expression.ConvertExplicit): Add explicit type conversions done
20588         by unboxing.
20589
20590         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20591         the target type before applying the implicit LongLiterals to ULong
20592         literal cast.
20593
20594 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20595
20596         * cs-parser.jay (for_statement): Reworked the way For works: now
20597         we declare manually any variables that are introduced in
20598         for_initializer to solve the problem of having out-of-band code
20599         emition (that is what got for broken).
20600
20601         (declaration_statement): Perform the actual variable declaration
20602         that used to be done in local_variable_declaration here.
20603
20604         (local_variable_declaration): Do not declare anything, just pass
20605         the information on a DictionaryEntry
20606
20607 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20608
20609         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20610         re-write of the logic to now make it recursive.
20611
20612         (UpdateIndices): Re-write accordingly.
20613
20614         Store element data in a separate ArrayData list in the above methods.
20615
20616         (MakeByteBlob): Implement to dump the array data into a byte array.
20617
20618 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20619
20620         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20621         into CheckIndices.
20622
20623         * constant.cs (Define): Implement.
20624
20625         (EmitConstant): Re-write fully.
20626
20627         Pass in location info.
20628
20629         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20630         respectively.
20631
20632         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20633         DictionaryEntry since we need location info too.
20634
20635         (constant_declaration): Update accordingly.
20636
20637         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20638         code into another method : UpdateIndices.
20639
20640 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20641
20642         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20643         some type checking etc.
20644
20645 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20646
20647         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20648         bits to provide dimension info if the user skips doing that.
20649
20650         Update second constructor to store the rank correctly.
20651
20652 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20653
20654         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20655         and try to implement.
20656
20657         * ../errors/cs0150.cs : Add.
20658
20659         * ../errors/cs0178.cs : Add.
20660
20661 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20662
20663         * statement.cs: Implement foreach on multi-dimensional arrays. 
20664
20665         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20666         name of the params argument.
20667
20668         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20669         initializing the array.
20670
20671         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20672         we can use this elsewhere.
20673
20674         * statement.cs: Finish implementation of foreach for single
20675         dimension arrays.
20676
20677         * cs-parser.jay: Use an out-of-band stack to pass information
20678         around, I wonder why I need this.
20679
20680         foreach_block: Make the new foreach_block the current_block.
20681
20682         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20683         function used to return a static Parameters structure.  Used for
20684         empty parameters, as those are created very frequently.
20685
20686         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20687
20688 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20689
20690         * interface.cs : Default modifier is private, not public. The
20691         make verify test passes again.
20692
20693 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20694
20695         * support.cs (ReflectionParameters): Fix logic to determine
20696         whether the last parameter is a params one. Test 9 passes again.
20697
20698         * delegate.cs (Populate): Register the builders we define with
20699         RegisterParameterForBuilder. Test 19 passes again.
20700
20701         * cs-parser.jay (property_declaration): Reference $6 instead
20702         of $$ to get at the location.
20703
20704         (indexer_declaration): Similar stuff.
20705
20706         (attribute): Ditto.
20707
20708         * class.cs (Property): Register parameters for the Get and Set methods
20709         if they exist. Test 23 passes again.
20710
20711         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20712         call to EmitArguments as we are sure there aren't any params arguments. 
20713         Test 32 passes again.
20714
20715         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20716         IndexOutOfRangeException. 
20717
20718         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20719         Test 33 now passes again.
20720
20721 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20722
20723         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20724         broke a bunch of things.  Will have to come up with a better way
20725         of tracking locations.
20726
20727         * statement.cs: Implemented foreach for single dimension arrays.
20728
20729 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20730
20731         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20732         an error.  This removes the lookup from the critical path.
20733
20734         * cs-parser.jay: Removed use of temporary_loc, which is completely
20735         broken. 
20736
20737 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20738
20739         * support.cs (ReflectionParameters.ParameterModifier): Report
20740         whether the argument is a PARAMS argument or not.
20741
20742         * class.cs: Set the attribute `ParamArrayAttribute' on the
20743         parameter argument.
20744
20745         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20746         and cons_param_array_attribute (ConstructorInfo for
20747         ParamArrayAttribute)., 
20748
20749         * codegen.cs: Emit the return using the `Return' statement, that
20750         way we can report the error correctly for missing return values. 
20751
20752         * class.cs (Method.Emit): Clean up.
20753
20754         * expression.cs (Argument.Resolve): Take another argument: the
20755         location where this argument is used.  Notice that this is not
20756         part of the "Argument" class as to reduce the size of the
20757         structure (we know the approximate location anyways).
20758
20759         Test if the argument is a variable-reference, if not, then
20760         complain with a 206.
20761
20762         (Argument.Emit): Emit addresses of variables.
20763
20764         (Argument.FullDesc): Simplify.
20765
20766         (Invocation.DoResolve): Update for Argument.Resolve.
20767
20768         (ElementAccess.DoResolve): ditto.
20769
20770         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20771         method should be virtual, as this method is always virtual.
20772
20773         (NewDelegate.DoResolve): Update for Argument.Resolve.
20774
20775         * class.cs (ConstructorInitializer.DoResolve): ditto.
20776
20777         * attribute.cs (Attribute.Resolve): ditto.
20778
20779 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20780
20781         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20782
20783         * expression.cs (ParameterReference): Drop IStackStorage and implement
20784         IAssignMethod instead. 
20785
20786         (LocalVariableReference): ditto.
20787
20788         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20789         IAssignMethod instead. 
20790
20791 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20792
20793         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20794         enumerations that are used in heavily used structures derive from
20795         byte in a laughable and pathetic attempt to reduce memory usage.
20796         This is the kind of pre-optimzations that you should not do at
20797         home without adult supervision.
20798
20799         * expression.cs (UnaryMutator): New class, used to handle ++ and
20800         -- separatedly from the other unary operators.  Cleans up the
20801         code, and kills the ExpressionStatement dependency in Unary.
20802
20803         (Unary): Removed `method' and `Arguments' from this class, making
20804         it smaller, and moving it all to SimpleCall, so I can reuse this
20805         code in other locations and avoid creating a lot of transient data
20806         strucutres when not required.
20807
20808         * cs-parser.jay: Adjust for new changes.
20809
20810 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20811
20812         * enum.cs (Enum.Populate): If there is a failure during
20813         definition, return
20814
20815         * cs-parser.jay (opt_enum_base): we used to catch type errors
20816         here, but this is really incorrect.  The type error should be
20817         catched during semantic analysis.
20818
20819 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20820
20821         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20822         current_local_parameters as expected since I, in my stupidity, had forgotten
20823         to do this :-)
20824
20825         * attribute.cs (GetValidPlaces): Fix stupid bug.
20826
20827         * class.cs (Method::Emit): Perform check on applicability of attributes.
20828
20829         (Constructor::Emit): Ditto.
20830
20831         (Field::Emit): Ditto.
20832
20833         (Field.Location): Store location information.
20834
20835         (Property, Event, Indexer, Operator): Ditto.
20836
20837         * cs-parser.jay (field_declaration): Pass in location for each field.
20838
20839         * ../errors/cs0592.cs : Add.
20840
20841 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20842
20843         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20844
20845         (InitCoreTypes): Update accordingly.
20846
20847         (RegisterAttrType, LookupAttr): Implement.
20848
20849         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20850         info about the same.
20851
20852         (Resolve): Update to populate the above as necessary.
20853
20854         (Error592): Helper.
20855
20856         (GetValidPlaces): Helper to the above.
20857
20858         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20859
20860         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20861
20862 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20863
20864         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20865
20866         * ../errors/cs0617.cs : Add.
20867
20868 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20869
20870         * enum.cs (Emit): Rename to Populate to be more consistent with what
20871         we expect it to do and when exactly it is called.
20872
20873         * class.cs, rootcontext.cs : Update accordingly.
20874
20875         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20876         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20877
20878         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20879
20880         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20881         of a fieldinfo using the above, when dealing with a FieldBuilder.
20882
20883 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20884
20885         * ../errors/cs0031.cs : Add.
20886
20887         * ../errors/cs1008.cs : Add.
20888
20889         * ../errrors/cs0543.cs : Add.
20890
20891         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20892         enum type.
20893
20894         (FindMembers): Implement.
20895
20896         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20897         enums and delegates too.
20898
20899         (enum_types): Rename to builder_to_enum.
20900
20901         (delegate_types): Rename to builder_to_delegate.
20902
20903         * delegate.cs (FindMembers): Implement.
20904
20905 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20906
20907         * typemanager.cs (IsEnumType): Implement.
20908
20909         * enum.cs (Emit): Re-write parts to account for the underlying type
20910         better and perform checking etc.
20911
20912         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20913         of the underlying type.
20914
20915         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20916         value
20917
20918         * enum.cs (error31): Helper to report error #31.
20919
20920         * cs-parser.jay (enum_declaration): Store location of each member too.
20921
20922         * enum.cs (member_to_location): New hashtable. 
20923
20924         (AddEnumMember): Update location hashtable.
20925
20926         (Emit): Use the location of each member while reporting errors.
20927
20928 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20929
20930         * cs-parser.jay: A for_initializer if is a
20931         local_variable_declaration really ammount to have an implicit
20932         block with the variable declaration and no initializer for for.
20933
20934         * statement.cs (For.Emit): Cope with null initializers.
20935
20936         This fixes the infinite loop on for initializers.
20937
20938 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20939
20940         * enum.cs: More cleanup.
20941
20942         * ecore.cs: Remove dead code.
20943
20944         * class.cs (Property.Emit): More simplification.
20945         (Event.Emit): ditto.
20946
20947         Reworked to have less levels of indentation.
20948
20949 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20950
20951         * class.cs (Property): Emit attributes.
20952
20953         (Field): Ditto.
20954
20955         (Event): Ditto.
20956
20957         (Indexer): Ditto.
20958
20959         (Operator): Ditto.
20960
20961         * enum.cs (Emit): Ditto.
20962
20963         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20964         Enums too.
20965
20966         * class.cs (Field, Event, etc.): Move attribute generation into the
20967         Emit method everywhere.
20968
20969         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20970         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20971         as we had no way of defining nested enums !
20972
20973         * rootcontext.cs : Adjust code accordingly.
20974
20975         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20976
20977 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20978
20979         * expression.cs (EvalConstantExpression): Move into ecore.cs
20980
20981         * enum.cs (Enum): Rename some members and make them public and readonly
20982         according to our convention.
20983
20984         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20985         nothing else.
20986
20987         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20988
20989         (Enum::Emit): Write a simple version for now which doesn't try to compute
20990         expressions. I shall modify this to be more robust in just a while.
20991
20992         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20993
20994         (TypeContainer::CloseType): Create the Enum types too.
20995
20996         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20997
20998         * expression.cs (EvalConstantExpression): Get rid of completely.
20999
21000         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21001         user-defined values and other cases.
21002
21003         (IsValidEnumLiteral): Helper function.
21004
21005         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21006         out there in the case we had a literal FieldExpr.
21007
21008         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21009
21010         (Literalize): Revamp a bit to take two arguments.
21011
21012         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21013
21014 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21015
21016         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21017
21018         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21019
21020         (Resolve): Use the above to ensure we have proper initializers.
21021
21022 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21023
21024         * expression.cs (Expression::EvalConstantExpression): New method to 
21025         evaluate constant expressions.
21026
21027         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21028
21029 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21030
21031         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21032         in an array.
21033
21034         (Binary.ResolveOperator): Handle operator != (object a, object b)
21035         and operator == (object a, object b);
21036
21037         (Binary.DoNumericPromotions): Indicate whether the numeric
21038         promotion was possible.
21039
21040         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21041         Implement.  
21042
21043         Made the ArrayAccess implement interface IAssignMethod instead of
21044         IStackStore as the order in which arguments are passed reflects
21045         this.
21046
21047         * assign.cs: Instead of using expr.ExprClass to select the way of
21048         assinging, probe for the IStackStore/IAssignMethod interfaces.
21049
21050         * typemanager.cs: Load InitializeArray definition.
21051
21052         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21053         static data that can be used to initialize arrays. 
21054
21055 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21056
21057         * expression.cs: Handle operator== and operator!= for booleans.
21058
21059         (Conditioal.Reduce): Implement reducer for the ?: operator.
21060
21061         (Conditional.Resolve): Implement dead code elimination.
21062
21063         (Binary.Resolve): Catch string literals and return a new
21064         concatenated string.
21065
21066         (Unary.Reduce): Implement reduction of unary expressions.
21067
21068         * ecore.cs: Split out the expression core handling here.
21069
21070         (Expression.Reduce): New method used to perform constant folding
21071         and CSE.  This is needed to support constant-expressions. 
21072
21073         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21074         targets, and optimize for !x.
21075
21076 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21077
21078         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21079         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21080         set custom atttributes.
21081
21082         * literal.cs (Literal::GetValue): New abstract method to return the actual
21083         value of the literal, cast as an object.
21084
21085         (*Literal): Implement GetValue method.
21086
21087         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21088         expressions to the arraylist but objects of type Argument.
21089
21090         * class.cs (TypeContainer::Emit): Emit our attributes too.
21091
21092         (Method::Emit, Constructor::Emit): Ditto.
21093
21094         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21095         to be ignoring earlier.
21096
21097 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21098
21099         * attribute.cs (AttributeSection::Define): Implement to do the business
21100         of constructing a CustomAttributeBuilder.
21101
21102         (Attribute): New trivial class. Increases readability of code.  
21103
21104         * cs-parser.jay : Update accordingly.
21105
21106         (positional_argument_list, named_argument_list, named_argument): New rules
21107
21108         (attribute_arguments): Use the above so that we are more correct.
21109
21110 2001-11-02  Ravi Pratap  <ravi@ximian.com>
21111
21112         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21113         to perform all checks for a method with a params parameter.
21114
21115         (Invocation::OverloadResolve): Update to use the above method and therefore
21116         cope correctly with params method invocations.
21117
21118         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
21119         params too.
21120
21121         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21122         constructors in our parent too because we can't afford to miss out on 
21123         protected ones ;-)
21124
21125         * attribute.cs (AttributeSection): New name for the class Attribute
21126
21127         Other trivial changes to improve readability.
21128
21129         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21130         use the new class names.
21131
21132 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21133
21134         * class.cs (Method::Define): Complete definition for params types too
21135
21136         (Indexer::Define): Ditto.
21137
21138         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21139         Cope everywhere with a request for info about the array parameter.
21140
21141 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21142
21143         * tree.cs (RecordNamespace): Fix up to check for the correct key.
21144
21145         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
21146         local_variable_type to extract the string corresponding to the type.
21147
21148         (local_variable_type): Fixup the action to use the new helper method.
21149
21150         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21151         go.
21152
21153         * expression.cs : Clean out code which uses the above.
21154
21155 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21156
21157         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21158         and bale out if necessary by returning a false.
21159
21160         (RegisterProperty): Ditto.
21161
21162         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21163         and print out appropriate error messages.
21164
21165         * interface.cs (everywhere): Ditto.
21166
21167         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21168         location to constructor.
21169
21170         * class.cs (Property, Event, Indexer): Update accordingly.
21171
21172         * ../errors/cs111.cs : Added.
21173
21174         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21175         of a method, as laid down by the spec.
21176
21177         (Invocation::OverloadResolve): Use the above method.
21178
21179 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21180
21181         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21182         now take a TypeContainer and a Parameters object.
21183
21184         (ParameterData): Modify return type of ParameterModifier method to be 
21185         Parameter.Modifier and not a string.
21186
21187         (ReflectionParameters, InternalParameters): Update accordingly.
21188
21189         * expression.cs (Argument::GetParameterModifier): Same here.
21190
21191         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21192         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21193         symbol in it at all so maybe this is only for now.
21194
21195 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21196
21197         * support.cs (InternalParameters): Constructor now takes an extra argument 
21198         which is the actual Parameters class.
21199
21200         (ParameterDesc): Update to provide info on ref/out modifiers.
21201
21202         * class.cs (everywhere): Update call to InternalParameters to pass in
21203         the second argument too.
21204
21205         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21206         to return the modifier info [ref/out etc]
21207
21208         (InternalParameters, ReflectionParameters): Implement the above.
21209
21210         * expression.cs (Argument::ParameterModifier): Similar function to return
21211         info about the argument's modifiers.
21212
21213         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21214         too.
21215
21216         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21217         a new SetFormalParameters object which we pass to InternalParameters.
21218
21219 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21220
21221         * expression.cs (NewArray): Merge into the ArrayCreation class.
21222
21223 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21224
21225         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21226         NewUserdefinedArray into one as there wasn't much of a use in having
21227         two separate ones.
21228
21229         * expression.cs (Argument): Change field's name to ArgType from Type.
21230
21231         (Type): New readonly property which returns the proper type, taking into 
21232         account ref/out modifiers.
21233
21234         (everywhere): Adjust code accordingly for the above.
21235
21236         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21237         whether we are emitting for a ref or out parameter.
21238
21239         * expression.cs (Argument::Emit): Use the above field to set the state.
21240
21241         (LocalVariableReference::Emit): Update to honour the flag and emit the
21242         right stuff.
21243
21244         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21245
21246         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21247
21248         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21249
21250         (ReflectionParameters, InternalParameters): Implement the above method.
21251
21252         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21253         reporting errors.
21254
21255         (Invocation::FullMethodDesc): Ditto. 
21256
21257 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21258
21259         * cs-parser.jay: Add extra production for the second form of array
21260         creation. 
21261
21262         * expression.cs (ArrayCreation): Update to reflect the above
21263         change. 
21264
21265         * Small changes to prepare for Array initialization.
21266
21267 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21268
21269         * typemanager.cs (ImplementsInterface): interface might be null;
21270         Deal with this problem;
21271
21272         Also, we do store negative hits on the cache (null values), so use
21273         this instead of calling t.GetInterfaces on the type everytime.
21274
21275 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21276
21277         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21278
21279         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21280         split functionality out into different classes.
21281
21282         (New::FormArrayType): Move into NewBuiltinArray.
21283
21284         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21285         quite useless.
21286
21287         (NewBuiltinArray): New class to handle creation of built-in arrays.
21288
21289         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21290         account creation of one-dimensional arrays.
21291
21292         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21293
21294         (NewUserdefinedArray::DoResolve): Implement.
21295
21296         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21297
21298         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21299         we maintain inside the TypeManager. This is necessary to perform lookups on the
21300         module builder.
21301
21302         (LookupType): Update to perform GetType on the module builders too.     
21303
21304         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21305
21306         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21307
21308 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21309
21310         * expression.cs (New::DoResolve): Implement guts of array creation.
21311
21312         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21313
21314 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21315
21316         * expression.cs: Fix bug I introduced lsat night that broke
21317         Delegates. 
21318
21319         (Expression.Resolve): Report a 246 error (can not resolve name)
21320         if we find a SimpleName in the stream.
21321
21322         (Expression.ResolveLValue): Ditto.
21323
21324         (Expression.ResolveWithSimpleName): This function is a variant of
21325         ResolveName, this one allows SimpleNames to be returned without a
21326         warning.  The only consumer of SimpleNames is MemberAccess
21327
21328 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21329
21330         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21331         might arrive here.  I have my doubts that this is correct.
21332
21333         * statement.cs (Lock): Implement lock statement.
21334
21335         * cs-parser.jay: Small fixes to support `lock' and `using'
21336
21337         * cs-tokenizer.cs: Remove extra space
21338
21339         * driver.cs: New flag --checked, allows to turn on integer math
21340         checking. 
21341
21342         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21343         Threading.Monitor.Exit 
21344
21345 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21346
21347         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21348         Expression Class to be IndexerAccess.
21349
21350         Notice that Indexer::DoResolve sets the eclass to Value.
21351
21352 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21353
21354         * class.cs (TypeContainer::Emit): Emit code for indexers.
21355
21356         * assign.cs (IAssignMethod): New interface implemented by Indexers
21357         and Properties for handling assignment.
21358
21359         (Assign::Emit): Simplify and reuse code. 
21360
21361         * expression.cs (IndexerAccess, PropertyExpr): Implement
21362         IAssignMethod, clean up old code. 
21363
21364 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21365
21366         * typemanager.cs (ImplementsInterface): New method to determine if a type
21367         implements a given interface. Provides a nice cache too.
21368
21369         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21370         method.
21371
21372         (ConvertReferenceExplicit): Ditto.
21373
21374         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21375         various methods, with correct names etc.
21376
21377         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21378         Operator.UnaryNegation.
21379
21380         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21381         we have a unary plus or minus operator.
21382
21383         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21384         UnaryMinus.
21385
21386         * everywhere : update accordingly.
21387
21388         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21389         respectively.
21390
21391         * class.cs (Method::Define): For the case where we are implementing a method
21392         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21393         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21394
21395 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21396
21397         * interface.cs (FindMembers): Implement to work around S.R.E
21398         lameness.
21399
21400         * typemanager.cs (IsInterfaceType): Implement.
21401
21402         (FindMembers): Update to handle interface types too.
21403
21404         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21405         use IsAssignableFrom as that is not correct - it doesn't work.
21406
21407         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21408         and accordingly override EmitStatement.
21409
21410         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21411         using the correct logic :-)
21412
21413 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21414
21415         * ../errors/cs-11.cs : Add to demonstrate error -11 
21416
21417 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21418
21419         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21420         then pass this as a hint to ResolveLValue.
21421
21422         * expression.cs (FieldExpr): Add Location information
21423
21424         (FieldExpr::LValueResolve): Report assignment to readonly
21425         variable. 
21426
21427         (Expression::ExprClassFromMemberInfo): Pass location information.
21428
21429         (Expression::ResolveLValue): Add new method that resolves an
21430         LValue. 
21431
21432         (Expression::DoResolveLValue): Default invocation calls
21433         DoResolve. 
21434
21435         (Indexers): New class used to keep track of indexers in a given
21436         Type. 
21437
21438         (IStackStore): Renamed from LValue, as it did not really describe
21439         what this did.  Also ResolveLValue is gone from this interface and
21440         now is part of Expression.
21441
21442         (ElementAccess): Depending on the element access type
21443
21444         * typemanager.cs: Add `indexer_name_type' as a Core type
21445         (System.Runtime.CompilerServices.IndexerNameAttribute)
21446
21447         * statement.cs (Goto): Take a location.
21448
21449 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21450
21451         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21452         if two delegates are compatible.
21453
21454         (NewDelegate::DoResolve): Update to take care of the case when
21455         we instantiate a delegate from another delegate.
21456
21457         * typemanager.cs (FindMembers): Don't even try to look up members
21458         of Delegate types for now.
21459
21460 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21461
21462         * delegate.cs (NewDelegate): New class to take care of delegate
21463         instantiation.
21464
21465         * expression.cs (New): Split the delegate related code out into 
21466         the NewDelegate class.
21467
21468         * delegate.cs (DelegateInvocation): New class to handle delegate 
21469         invocation.
21470
21471         * expression.cs (Invocation): Split out delegate related code into
21472         the DelegateInvocation class.
21473
21474 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21475
21476         * expression.cs (New::DoResolve): Implement delegate creation fully
21477         and according to the spec.
21478
21479         (New::DoEmit): Update to handle delegates differently.
21480
21481         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21482         because of which we were printing out arguments in reverse order !
21483
21484         * delegate.cs (VerifyMethod): Implement to check if the given method
21485         matches the delegate.
21486
21487         (FullDelegateDesc): Implement.
21488
21489         (VerifyApplicability): Implement.
21490
21491         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21492         delegate invocations too.
21493
21494         (Invocation::Emit): Ditto.
21495
21496         * ../errors/cs1593.cs : Added.
21497
21498         * ../errors/cs1594.cs : Added.
21499
21500         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21501
21502 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21503
21504         * typemanager.cs (intptr_type): Core type for System.IntPtr
21505
21506         (InitCoreTypes): Update for the same.
21507
21508         (iasyncresult_type, asynccallback_type): Ditto.
21509
21510         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21511         correct.
21512
21513         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21514         too.
21515
21516         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21517         the builders for the 4 members of a delegate type :-)
21518
21519         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21520         type.
21521
21522         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21523
21524         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21525
21526 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21527
21528         * statement.cs (Break::Emit): Implement.   
21529         (Continue::Emit): Implement.
21530
21531         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21532         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21533         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21534         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21535         end loop
21536
21537         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21538         properties that track the label for the current loop (begin of the
21539         loop and end of the loop).
21540
21541 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21542
21543         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21544         use of emitting anything at all.
21545
21546         * class.cs, rootcontext.cs : Get rid of calls to the same.
21547
21548         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21549
21550         (Populate): Define the constructor correctly and set the implementation
21551         attributes.
21552
21553         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21554         have been defined.
21555
21556         (AddDelegateType): Implement.
21557
21558         (IsDelegateType): Implement helper method.
21559
21560         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21561
21562         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21563         and accordingly handle it.
21564
21565         * delegate.cs (Populate): Take TypeContainer argument.
21566         Implement bits to define the Invoke method. However, I still haven't figured out
21567         how to take care of the native int bit :-(
21568
21569         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21570         Qualify the name of the delegate, not its return type !
21571
21572         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21573         conversion.
21574
21575         (StandardConversionExists): Checking for array types turns out to be recursive.
21576
21577         (ConvertReferenceExplicit): Implement array conversion.
21578
21579         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21580
21581 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21582
21583         * cs-parser.jay (delegate_declaration): Store the fully qualified
21584         name as it is a type declaration.
21585
21586         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21587         readonly.
21588
21589         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21590         as TypeContainer::DefineType.
21591
21592         (Populate): Method in which all the definition of the various methods (Invoke)
21593         etc is done.
21594
21595         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21596         see.
21597
21598         (CloseDelegate): Finally creates the delegate.
21599
21600         * class.cs (TypeContainer::DefineType): Update to define delegates.
21601         (Populate, Emit and CloseType): Do the same thing here too.
21602
21603         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21604         delegates in all these operations.
21605
21606 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21607
21608         * expression.cs: LocalTemporary: a new expression used to
21609         reference a temporary that has been created.
21610
21611         * assign.cs: Handle PropertyAccess back here, so that we can
21612         provide the proper semantic access to properties.
21613
21614         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21615         a few more explicit conversions. 
21616
21617         * modifiers.cs: `NEW' modifier maps to HideBySig.
21618
21619         * expression.cs (PropertyExpr): Make this into an
21620         ExpressionStatement, and support the EmitStatement code path. 
21621
21622         Perform get/set error checking, clean up the interface.
21623
21624         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21625         them into toplevel access objects.
21626
21627 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21628
21629         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21630         SRE.
21631
21632         * typemanager.cs: Keep track here of our PropertyBuilders again to
21633         work around lameness in SRE.
21634
21635 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21636
21637         * expression.cs (LValue::LValueResolve): New method in the
21638         interface, used to perform a second resolution pass for LValues. 
21639
21640         (This::DoResolve): Catch the use of this in static methods.
21641
21642         (This::LValueResolve): Implement.
21643
21644         (This::Store): Remove warning, assigning to `this' in structures
21645         is 
21646
21647         (Invocation::Emit): Deal with invocation of
21648         methods on value types.  We need to pass the address to structure
21649         methods rather than the object itself.  (The equivalent code to
21650         emit "this" for structures leaves the entire structure on the
21651         stack instead of a pointer to it). 
21652
21653         (ParameterReference::DoResolve): Compute the real index for the
21654         argument based on whether the method takes or not a `this' pointer
21655         (ie, the method is static).
21656
21657         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21658         value types returned from functions when we need to invoke a
21659         method on the sturcture.
21660
21661
21662 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21663
21664         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21665         defining the type in the Modulebuilder or Typebuilder. This is to take
21666         care of nested types which need to be defined on the TypeBuilder using
21667         DefineNestedMethod.
21668
21669         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21670         methods in RootContext, only ported to be part of TypeContainer.
21671
21672         (TypeContainer::GetInterfaceOrClass): Ditto.
21673
21674         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21675
21676         * interface.cs (Interface::DefineInterface): New method. Does exactly
21677         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21678         too.
21679
21680         (Interface::GetInterfaces): Move from RootContext here and port.
21681
21682         (Interface::GetInterfaceByName): Same here.
21683
21684         * rootcontext.cs (ResolveTree): Re-write.
21685
21686         (PopulateTypes): Re-write.
21687
21688         * class.cs (TypeContainer::Populate): Populate nested types too.
21689         (TypeContainer::Emit): Emit nested members too.
21690
21691         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21692         instead just use the name argument passed in as it is already fully
21693         qualified.
21694
21695         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21696         to TypeContainer mapping to see if a type is user-defined.
21697
21698         * class.cs (TypeContainer::CloseType): Implement. 
21699
21700         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21701         the default constructor.
21702
21703         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21704         twice.
21705
21706         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21707
21708         * interface.cs (CloseType): Create the type here.
21709
21710         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21711         the hierarchy.
21712
21713         Remove all the methods which are now in TypeContainer.
21714
21715 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21716
21717         * delegate.cs (Define): Re-write bits to define the delegate
21718         correctly.
21719
21720 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21721
21722         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21723
21724         * expression.cs (ImplicitReferenceConversion): handle null as well
21725         as a source to convert to any reference type.
21726
21727         * statement.cs (Return): Perform any implicit conversions to
21728         expected return type.  
21729
21730         Validate use of return statement.  
21731
21732         * codegen.cs (EmitContext): Pass the expected return type here.
21733
21734         * class.cs (Method, Constructor, Property): Pass expected return
21735         type to EmitContext.
21736
21737 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21738
21739         * expression.cs: Make DoResolve take an EmitContext instead of a
21740         TypeContainer.
21741
21742         Replaced `l' and `location' for `loc', for consistency.
21743
21744         (Error, Warning): Remove unneeded Tc argument.
21745
21746         * assign.cs, literal.cs, constant.cs: Update to new calling
21747         convention. 
21748
21749         * codegen.cs: EmitContext now contains a flag indicating whether
21750         code is being generated in a static method or not.
21751
21752         * cs-parser.jay: DecomposeQI, new function that replaces the old
21753         QualifiedIdentifier.  Now we always decompose the assembled
21754         strings from qualified_identifier productions into a group of
21755         memberaccesses.
21756
21757 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21758
21759         * rootcontext.cs: Deal with field-less struct types correctly now
21760         by passing the size option to Define Type.
21761
21762         * class.cs: Removed hack that created one static field. 
21763
21764 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21765
21766         * statement.cs: Moved most of the code generation here. 
21767
21768 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21769
21770         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21771         seem very right.
21772
21773         (ElementAccess): Remove useless bits for now - keep checks as the spec
21774         says.
21775
21776 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21777
21778         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21779         and start performing checks according to the spec.
21780
21781 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21782
21783         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21784         rank_specifiers instead.
21785
21786         (rank_specifiers): Change the order in which the rank specifiers are stored
21787
21788         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21789
21790         * expression.cs (ElementAccess): Implement the LValue interface too.
21791
21792 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21793
21794         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21795         except that user defined conversions are not included.
21796
21797         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21798         perform the conversion of the return type, if necessary.
21799
21800         (New::DoResolve): Check whether we are creating an array or an object
21801         and accordingly do the needful.
21802
21803         (New::Emit): Same here.
21804
21805         (New::DoResolve): Implement guts of array creation.
21806
21807         (New::FormLookupType): Helper function.
21808
21809 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21810
21811         * codegen.cs: Removed most of the code generation here, and move the
21812         corresponding code generation bits to the statement classes. 
21813
21814         Added support for try/catch/finalize and throw.
21815
21816         * cs-parser.jay: Added support for try/catch/finalize.
21817
21818         * class.cs: Catch static methods having the flags override,
21819         virtual or abstract.
21820
21821         * expression.cs (UserCast): This user cast was not really doing
21822         what it was supposed to do.  Which is to be born in fully resolved
21823         state.  Parts of the resolution were being performed at Emit time! 
21824
21825         Fixed this code.
21826
21827 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21828
21829         * expression.cs: Implicity convert the result from UserCast.
21830
21831 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21832
21833         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21834         prevented it from working correctly. 
21835
21836         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21837         merely ConvertImplicit.
21838
21839 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21840
21841         * typemanager.cs: Make the LookupTypeContainer function static,
21842         and not per-instance.  
21843
21844         * class.cs: Make static FindMembers (the one that takes a Type
21845         argument). 
21846
21847         * codegen.cs: Add EmitForeach here.
21848
21849         * cs-parser.jay: Make foreach a toplevel object instead of the
21850         inline expansion, as we need to perform semantic analysis on it. 
21851
21852 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21853
21854         * expression.cs (Expression::ImplicitUserConversion): Rename to
21855         UserDefinedConversion.
21856
21857         (Expression::UserDefinedConversion): Take an extra argument specifying 
21858         whether we look for explicit user conversions too.
21859
21860         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21861
21862         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21863
21864         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21865         with the appropriate arguments.
21866
21867         * cs-parser.jay (cast_expression): Record location too.
21868
21869         * expression.cs (Cast): Record location info.
21870
21871         (Expression::ConvertExplicit): Take location argument.
21872
21873         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21874         to determine if we are doing explicit conversions.
21875
21876         (UserCast::Emit): Update accordingly.
21877
21878         (Expression::ConvertExplicit): Report an error if everything fails.
21879
21880         * ../errors/cs0030.cs : Add.
21881
21882 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21883
21884         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21885         virtual and newslot bits. 
21886
21887         * class.cs (TypeContainer::RegisterRequiredImplementations):
21888         Record methods we need.
21889
21890         (TypeContainer::MakeKey): Helper function to make keys for
21891         MethodBases, since the Methodbase key is useless.
21892
21893         (TypeContainer::Populate): Call RegisterRequiredImplementations
21894         before defining the methods.   
21895
21896         Create a mapping for method_builders_to_methods ahead of time
21897         instead of inside a tight loop.
21898
21899         (::RequireMethods):  Accept an object as the data to set into the
21900         hashtable so we can report interface vs abstract method mismatch.
21901
21902 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21903
21904         * report.cs: Make all of it static.
21905
21906         * rootcontext.cs: Drop object_type and value_type computations, as
21907         we have those in the TypeManager anyways.
21908
21909         Drop report instance variable too, now it is a global.
21910
21911         * driver.cs: Use try/catch on command line handling.
21912
21913         Add --probe option to debug the error reporting system with a test
21914         suite. 
21915
21916         * report.cs: Add support for exiting program when a probe
21917         condition is reached.
21918
21919 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21920
21921         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21922         we do a forcible conversion regardless of type, to check if 
21923         ForceConversion returns a null.
21924
21925         (Binary::error19): Use location to report error.
21926
21927         (Unary::error23): Use location here too.
21928
21929         * ../errors/cs0019.cs : Check in.
21930
21931         * ../errors/cs0023.cs : Check in.
21932
21933         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21934         case of a non-null MethodInfo object with a length of 0 !
21935
21936         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21937         an applicable member - according to the spec :-)
21938         Also fix logic to find members in base types.
21939
21940         (Unary::ResolveOperator): Same here.
21941
21942         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21943         as I was getting thoroughly confused between this and error19 :-)
21944
21945         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21946         (::FindMostEncompassedType): Implement.
21947         (::FindMostEncompassingType): Implement.
21948         (::StandardConversionExists): Implement.
21949
21950         (UserImplicitCast): Re-vamp. We now need info about most specific
21951         source and target types so that we can do the necessary conversions.
21952
21953         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21954         mathematical union with no duplicates.
21955
21956 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21957
21958         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21959         in order from base classes to child classes, so that we can in
21960         child classes look up in our parent for method names and
21961         attributes (required for handling abstract, virtual, new, override
21962         constructs: we need to instrospect our base class, and if we dont
21963         populate the classes in order, the introspection might be
21964         incorrect.  For example, a method could query its parent before
21965         the parent has any methods and would determine that the parent has
21966         no abstract methods (while it could have had them)).
21967
21968         (RootContext::CreateType): Record the order in which we define the
21969         classes.
21970
21971 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21972
21973         * class.cs (TypeContainer::Populate): Also method definitions can
21974         fail now, keep track of this.
21975
21976         (TypeContainer::FindMembers): Implement support for
21977         DeclaredOnly/noDeclaredOnly flag.
21978
21979         (Constructor::Emit) Return the ConstructorBuilder.
21980
21981         (Method::Emit) Return the MethodBuilder. 
21982         Check for abstract or virtual methods to be public.
21983
21984         * rootcontext.cs (RootContext::CreateType): Register all the
21985         abstract methods required for the class to be complete and the
21986         interface methods that must be implemented. 
21987
21988         * cs-parser.jay: Report error 501 (method requires body if it is
21989         not marked abstract or extern).
21990
21991         * expression.cs (TypeOf::Emit): Implement.
21992
21993         * typemanager.cs: runtime_handle_type, new global type.
21994
21995         * class.cs (Property::Emit): Generate code for properties.
21996
21997 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21998
21999         * expression.cs (Unary::ResolveOperator): Find operators on base type
22000         too - we now conform exactly to the spec.
22001
22002         (Binary::ResolveOperator): Same here.
22003
22004         * class.cs (Operator::Define): Fix minor quirk in the tests.
22005
22006         * ../errors/cs0215.cs : Added.
22007
22008         * ../errors/cs0556.cs : Added.
22009
22010         * ../errors/cs0555.cs : Added.
22011
22012 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22013
22014         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22015         single integer which is really efficient
22016
22017 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22018
22019         *  expression.cs (Expression::ImplicitUserConversion): Use location
22020         even in the case when we are examining True operators.
22021  
22022         * class.cs (Operator::Define): Perform extensive checks to conform
22023         with the rules for operator overloading in the spec.
22024
22025         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22026         some of the other conversions mentioned in the spec.
22027
22028         * typemanager.cs (array_type): New static member for the System.Array built-in
22029         type.
22030
22031         (cloneable_interface): For System.ICloneable interface.
22032
22033         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22034         we start resolving the tree and populating types.
22035
22036         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22037  
22038 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22039
22040         * expression.cs (Expression::ExprClassFromMemberInfo,
22041         Expression::Literalize): Create literal expressions from
22042         FieldInfos which are literals.
22043
22044         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22045         type casts, because they were wrong.  The test suite in tests
22046         caught these ones.
22047
22048         (ImplicitNumericConversion): ushort to ulong requires a widening
22049         cast. 
22050
22051         Int32 constant to long requires widening cast as well.
22052
22053         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22054         for integers because the type on the stack is not i4.
22055
22056 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22057
22058         * expression.cs (report118): require location argument. 
22059
22060         * parameter.cs: Do not dereference potential null value.
22061
22062         * class.cs: Catch methods that lack the `new' keyword when
22063         overriding a name.  Report warnings when `new' is used without
22064         anything being there to override.
22065
22066         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22067
22068         * class.cs: Only add constructor to hashtable if it is non-null
22069         (as now constructors can fail on define).
22070
22071         (TypeManager, Class, Struct): Take location arguments.
22072
22073         Catch field instance initialization in structs as errors.
22074
22075         accepting_filter: a new filter for FindMembers that is static so
22076         that we dont create an instance per invocation.
22077
22078         (Constructor::Define): Catch errors where a struct constructor is
22079         parameterless 
22080
22081         * cs-parser.jay: Pass location information for various new
22082         constructs. 
22083
22084         * delegate.cs (Delegate): take a location argument.
22085
22086         * driver.cs: Do not call EmitCode if there were problesm in the
22087         Definition of the types, as many Builders wont be there. 
22088
22089         * decl.cs (Decl::Decl): Require a location argument.
22090
22091         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22092         into integers, and find the most appropiate integer for it.
22093
22094         * literal.cs: Implement ULongLiteral.
22095
22096         * rootcontext.cs: Provide better information about the location of
22097         failure when CreateType fails.
22098
22099 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22100
22101         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22102         as well.
22103
22104         * expression.cs (Binary::CheckShiftArguments): Add missing type
22105         computation.
22106         (Binary::ResolveOperator): Add type to the logical and and logical
22107         or, Bitwise And/Or and Exclusive Or code paths, it was missing
22108         before.
22109
22110         (Binary::DoNumericPromotions): In the case where either argument
22111         is ulong (and most signed types combined with ulong cause an
22112         error) perform implicit integer constant conversions as well.
22113
22114 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22115
22116         * expression.cs (UserImplicitCast): Method should always be
22117         non-null. 
22118         (Invocation::BetterConversion): Simplified test for IntLiteral.
22119
22120         (Expression::ImplicitNumericConversion): Split this routine out.
22121         Put the code that performs implicit constant integer conversions
22122         here. 
22123
22124         (Expression::Resolve): Become a wrapper around DoResolve so we can
22125         check eclass and type being set after resolve.
22126
22127         (Invocation::Badness): Remove this dead function
22128
22129         (Binary::ResolveOperator): Do not compute the expensive argumnets
22130         unless we have a union for it.
22131
22132         (Probe::Emit): Is needs to do an isinst and then
22133         compare against null.
22134
22135         (::CanConvert): Added Location argument.  If the Location argument
22136         is null (Location.Null), then we do not report errors.  This is
22137         used by the `probe' mechanism of the Explicit conversion.  We do
22138         not want to generate an error for something that the user
22139         explicitly requested to be casted.  But the pipeline for an
22140         explicit cast first tests for potential implicit casts.
22141
22142         So for now, if the Location is null, it means `Probe only' to
22143         avoid adding another argument.   Might have to revise this
22144         strategy later.
22145
22146         (ClassCast): New class used to type cast objects into arbitrary
22147         classes (used in Explicit Reference Conversions).
22148
22149         Implement `as' as well.
22150
22151         Reverted all the patches from Ravi below: they were broken:
22152
22153                 * The use of `level' as a mechanism to stop recursive
22154                   invocations is wrong.  That was there just to catch the
22155                   bug with a strack trace but not as a way of addressing
22156                   the problem.
22157
22158                   To fix the problem we have to *understand* what is going
22159                   on and the interactions and come up with a plan, not
22160                   just get things going.
22161
22162                 * The use of the type conversion cache that I proposed
22163                   last night had an open topic: How does this work across
22164                   protection domains.  A user defined conversion might not
22165                   be public in the location where we are applying the
22166                   conversion, a different conversion might be selected
22167                   (ie, private A->B (better) but public B->A (worse),
22168                   inside A, A->B applies, but outside it, B->A will
22169                   apply).
22170
22171                 * On top of that (ie, even if the above is solved),
22172                   conversions in a cache need to be abstract.  Ie, `To
22173                   convert from an Int to a Short use an OpcodeCast', not
22174                   `To convert from an Int to a Short use the OpcodeCast on
22175                   the variable 5' (which is what this patch was doing).
22176
22177 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22178
22179         * expression.cs (Invocation::ConversionExists): Re-write to use
22180         the conversion cache
22181
22182         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22183         cache all conversions done, not just user-defined ones.
22184
22185         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22186         to determine if a conversion exists instead of acutually trying to 
22187         perform the conversion. It's faster too.
22188
22189         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22190         and only then attempt the implicit conversion.
22191
22192 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22193
22194         * expression.cs (ConvertImplicit): Use a cache for conversions
22195         already found. Check level of recursion and bail out if necessary.
22196
22197 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22198
22199         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22200         Export standard methods that we expect for string operations.
22201
22202         * statement.cs (Block::UsageWarning): Track usage of variables and
22203         report the errors for not used variables.
22204
22205         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22206         operator. 
22207
22208 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22209
22210         * codegen.cs: remove unnneded code 
22211
22212         * expression.cs: Removed BuiltinTypeAccess class
22213
22214         Fix the order in which implicit conversions are
22215         done.  
22216
22217         The previous fixed dropped support for boxed conversions (adding a
22218         test to the test suite now)
22219
22220         (UserImplicitCast::CanConvert): Remove test for source being null,
22221         that code is broken.  We should not feed a null to begin with, if
22222         we do, then we should track the bug where the problem originates
22223         and not try to cover it up here.
22224
22225         Return a resolved expression of type UserImplicitCast on success
22226         rather than true/false.  Ravi: this is what I was talking about,
22227         the pattern is to use a static method as a "constructor" for
22228         objects. 
22229
22230         Also, do not create arguments until the very last minute,
22231         otherwise we always create the arguments even for lookups that
22232         will never be performed. 
22233
22234         (UserImplicitCast::Resolve): Eliminate, objects of type
22235         UserImplicitCast are born in a fully resolved state. 
22236
22237         * typemanager.cs (InitCoreTypes): Init also value_type
22238         (System.ValueType). 
22239
22240         * expression.cs (Cast::Resolve): First resolve the child expression.
22241
22242         (LValue): Add new method AddressOf to be used by
22243         the `&' operator.  
22244
22245         Change the argument of Store to take an EmitContext instead of an
22246         ILGenerator, because things like FieldExpr need to be able to call
22247         their children expression to generate the instance code. 
22248
22249         (Expression::Error, Expression::Warning): Sugar functions for
22250         reporting errors.
22251
22252         (Expression::MemberLookup): Accept a TypeContainer instead of a
22253         Report as the first argument.
22254
22255         (Expression::ResolvePrimary): Killed.  I still want to improve
22256         this as currently the code is just not right.
22257
22258         (Expression::ResolveMemberAccess): Simplify, but it is still
22259         wrong. 
22260
22261         (Unary::Resolve): Catch errors in AddressOf operators.
22262
22263         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22264         index to a byte for the short-version, or the compiler will choose
22265         the wrong Emit call, which generates the wrong data.
22266
22267         (ParameterReference::Emit, ::Store): same.
22268
22269         (FieldExpr::AddressOf): Implement.
22270
22271         * typemanager.cs: TypeManager: made public variable instead of
22272         property.
22273
22274         * driver.cs: document --fatal.
22275
22276         * report.cs (ErrorMessage, WarningMessage): new names for the old
22277         Error and Warning classes.
22278
22279         * cs-parser.jay (member_access): Turn built-in access to types
22280         into a normal simplename
22281
22282 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22283
22284         * expression.cs (Invocation::BetterConversion): Fix to cope
22285         with q being null, since this was introducing a bug.
22286
22287         * expression.cs (ConvertImplicit): Do built-in conversions first.
22288
22289 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22290
22291         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22292
22293 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22294
22295         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22296         I had introduced long ago (what's new ?).
22297
22298         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22299         the work of all the checking. 
22300         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22301         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22302
22303         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22304         that is the right way. 
22305
22306         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22307         overloading resolution. Use everywhere instead of cutting and pasting code.
22308
22309         (Binary::ResolveOperator): Use MakeUnionSet.
22310
22311         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22312         we have to convert to bool types. Not complete yet.
22313
22314 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22315
22316         * typemanager.cs (TypeManager::CSharpName): support ushort.
22317
22318         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22319         to provide an expression that performsn an implicit constant int
22320         conversion (section 6.1.6).
22321         (Expression::ConvertImplicitRequired): Reworked to include
22322         implicit constant expression conversions.
22323
22324         (Expression::ConvertNumericExplicit): Finished.
22325
22326         (Invocation::Emit): If InstanceExpression is null, then it means
22327         that we perform a call on this.
22328
22329 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22330
22331         * expression.cs (Unary::Emit): Remove some dead code.
22332         (Probe): Implement Resolve and Emit for `is'.
22333         (Expression::ConvertImplicitRequired): Attempt to do constant
22334         expression conversions here.  Maybe should be moved to
22335         ConvertImplicit, but I am not sure.
22336         (Expression::ImplicitLongConstantConversionPossible,
22337         Expression::ImplicitIntConstantConversionPossible): New functions
22338         that tell whether is it possible to apply an implicit constant
22339         expression conversion.
22340
22341         (ConvertNumericExplicit): Started work on explicit numeric
22342         conversions.
22343
22344         * cs-parser.jay: Update operator constants.
22345
22346         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22347         (Parameters::GetSignature): Hook up VerifyArgs here.
22348         (Parameters::VerifyArgs): Verifies that no two arguments have the
22349         same name. 
22350
22351         * class.cs (Operator): Update the operator names to reflect the
22352         ones that the spec expects (as we are just stringizing the
22353         operator names).
22354
22355         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22356         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22357         previous usage did only work for our methods.
22358         (Expression::ConvertImplicit): Handle decimal implicit numeric
22359         conversions as well.
22360         (Expression::InternalTypeConstructor): Used to invoke constructors
22361         on internal types for default promotions.
22362
22363         (Unary::Emit): Implement special handling for the pre/post
22364         increment/decrement for overloaded operators, as they need to have
22365         the same semantics as the other operators.
22366
22367         (Binary::ResolveOperator): ditto.
22368         (Invocation::ConversionExists): ditto.
22369         (UserImplicitCast::Resolve): ditto.
22370
22371 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22372
22373         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22374         operator, return after emitting body. Regression tests pass again !
22375
22376         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22377         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22378         (Invocation::OverloadResolve): Ditto.
22379         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22380
22381         * everywhere : update calls to the above methods accordingly.
22382
22383 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22384
22385         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22386
22387         * expression.cs (ExpressionStatement): New base class used for
22388         expressions that can appear in statements, so that we can provide
22389         an alternate path to generate expression that do not leave a value
22390         on the stack.
22391
22392         (Expression::Emit, and all the derivatives): We no longer return
22393         whether a value is left on the stack or not.  Every expression
22394         after being emitted leaves a single value on the stack.
22395
22396         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22397         facilties of ExpressionStatement if possible.
22398
22399         * cs-parser.jay: Update statement_expression.
22400
22401 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22402
22403         * driver.cs: Change the wording of message
22404
22405 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22406
22407         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22408         the type of the expression to the return type of the method if
22409         we have an overloaded operator match ! The regression tests pass again !
22410         (Unary::ResolveOperator): Ditto.
22411
22412         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22413         to find "op_Implicit", not "implicit" ;-)
22414         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22415         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22416
22417         * everywhere : Correct calls to the above accordingly.
22418
22419         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22420         (ConvertImplicit): Do user-defined conversion if it exists.
22421
22422 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22423
22424         * assign.cs: track location.
22425         (Resolve): Use implicit conversions on assignment.
22426
22427         * literal.cs: Oops.  Not good, Emit of short access values should
22428         pass (Bytes) or the wrong argument will be selected.
22429
22430         * expression.cs (Unary::Emit): Emit code for -expr.
22431
22432         (Unary::ResolveOperator): Handle `Substract' for non-constants
22433         (substract from zero from the non-constants).
22434         Deal with Doubles as well. 
22435
22436         (Expression::ConvertImplicitRequired): New routine that reports an
22437         error if no implicit conversion exists. 
22438
22439         (Invocation::OverloadResolve): Store the converted implicit
22440         expressions if we make them
22441
22442 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22443
22444         * class.cs (ConstructorInitializer): Take a Location argument.
22445         (ConstructorBaseInitializer): Same here.
22446         (ConstructorThisInitializer): Same here.
22447
22448         * cs-parser.jay : Update all calls accordingly.
22449
22450         * expression.cs (Unary, Binary, New): Take location argument.
22451         Update accordingly everywhere.
22452
22453         * cs-parser.jay : Update all calls to the above to take a location
22454         argument.
22455
22456         * class.cs : Ditto.
22457
22458 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22459
22460         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22461         (Invocation::BetterConversion): Same here
22462         (Invocation::ConversionExists): Ditto.
22463
22464         (Invocation::ConversionExists): Implement.
22465
22466 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22467
22468         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22469         Also take an additional TypeContainer argument.
22470
22471         * All over : Pass in TypeContainer as argument to OverloadResolve.
22472
22473         * typemanager.cs (CSharpName): Update to check for the string type and return
22474         that too.
22475
22476         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22477         a given method.
22478
22479 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22480
22481         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22482         (Invocation::BetterFunction): Implement.
22483         (Invocation::BetterConversion): Implement.
22484         (Invocation::ConversionExists): Skeleton, no implementation yet.
22485
22486         Okay, things work fine !
22487
22488 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22489
22490         * typemanager.cs: declare and load enum_type, delegate_type and
22491         void_type. 
22492
22493         * expression.cs (Expression::Emit): Now emit returns a value that
22494         tells whether a value is left on the stack or not.  This strategy
22495         might be reveted tomorrow with a mechanism that would address
22496         multiple assignments.
22497         (Expression::report118): Utility routine to report mismatches on
22498         the ExprClass.
22499
22500         (Unary::Report23): Report impossible type/operator combination
22501         utility function.
22502
22503         (Unary::IsIncrementableNumber): Whether the type can be
22504         incremented or decremented with add.
22505         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22506         complemented. 
22507         (Unary::ResolveOperator): Implement ++, !, ~,
22508
22509         (Invocation::Emit): Deal with new Emit convetion.
22510
22511         * All Expression derivatives: Updated their Emit method to return
22512         whether they leave values on the stack or not.
22513
22514         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22515         stack for expressions that are statements. 
22516
22517 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22518
22519         * expression.cs (LValue): New interface.  Must be implemented by
22520         LValue objects.
22521         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22522         LValue interface.
22523
22524         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22525         interface for generating code, simplifies the code.
22526
22527 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22528
22529         * expression.cs (everywhere): Comment out return statements in ::Resolve
22530         methods to avoid the warnings.
22531
22532 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22533
22534         * driver.cs (parse): Report error 2001 if we can not open the
22535         source file.
22536
22537         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22538         not resolve it.
22539
22540         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22541         object. 
22542
22543         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22544         otherwise nested blocks end up with the same index.
22545
22546         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22547
22548         * expression.cs:  Instead of having FIXMEs in the Resolve
22549         functions, throw exceptions so it is obvious that we are facing a
22550         bug. 
22551
22552         * cs-parser.jay (invocation_expression): Pass Location information.
22553
22554         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22555         Use a basename for those routines because .NET does not like paths
22556         on them. 
22557
22558         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22559         already defined.
22560
22561 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22562
22563         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22564         are loading the correct data types (throws an exception if not).
22565         (TypeManager::InitCoreTypes): Use CoreLookupType
22566
22567         * expression.cs (Unary::ResolveOperator): return the child
22568         expression for expressions which are just +expr.
22569         (Unary::ResolveOperator): Return negative literals for -LITERAL
22570         expressions (otherwise they are Unary {Literal}).
22571         (Invocation::Badness): Take into account `Implicit constant
22572         expression conversions'.
22573
22574         * literal.cs (LongLiteral): Implement long literal class.
22575         (IntLiteral): export the `Value' of the intliteral. 
22576
22577 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22578
22579         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22580
22581         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22582         instead of 'Operator'
22583
22584         * expression.cs (Binary::ResolveOperator): Update accordingly.
22585         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22586         and 'Minus'
22587
22588         * cs-parser.jay (unary_expression): Update to use the new names.
22589
22590         * gen-treedump.cs (GetUnary): Same here.
22591
22592         * expression.cs (Unary::Resolve): Implement.
22593         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22594         operators are found instead of making noise ;-)
22595         (Unary::ResolveOperator): New method to do precisely the same thing which
22596         Binary::ResolveOperator does for Binary expressions.
22597         (Unary.method, .Arguments): Add.
22598         (Unary::OperName): Implement.   
22599         (Unary::ForceConversion): Copy and Paste !
22600
22601         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22602         a unary operator.
22603
22604         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22605         for the inbuilt operators. Only overloading works for now ;-)
22606
22607 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22608
22609         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22610         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22611
22612         * expression.cs (This::Emit): Implement. 
22613         (This::Resolve): Implement.
22614         (TypeOf:Resolve): Implement.
22615         (Expression::ResolveSimpleName): Add an implicit this to instance
22616         field references. 
22617         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22618         Bind instance variable to Field expressions.
22619         (FieldExpr::Instance): New field used to track the expression that
22620         represents the object instance.
22621         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22622         binding 
22623         (FieldExpr::Emit): Implement.
22624
22625         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22626         the last instruction contains a return opcode to avoid generating
22627         the last `ret' instruction (this generates correct code, and it is
22628         nice to pass the peverify output).
22629
22630         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22631         initializer for static and instance variables.
22632         (Constructor::Emit): Allow initializer to be null in the case of
22633         static constructors.  Only emit initializer for instance
22634         constructors. 
22635
22636         (TypeContainer::FindMembers): Return a null array if there are no
22637         matches.
22638
22639         Also fix the code for the MemberTypes.Method branch, as it was not
22640         scanning that for operators (or tried to access null variables before).
22641
22642         * assign.cs (Assign::Emit): Handle instance and static fields. 
22643
22644         * TODO: Updated.
22645
22646         * driver.cs: Stop compilation if there are parse errors.
22647
22648         * cs-parser.jay (constructor_declaration): Provide default base
22649         initializer for non-static constructors.
22650         (constructor_declarator): Do not provide a default base
22651         initializers if none was specified.
22652         Catch the fact that constructors should not have parameters.
22653
22654         * class.cs: Do not emit parent class initializers for static
22655         constructors, that should be flagged as an error.
22656
22657 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22658
22659         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22660         Move back code into TypeContainer::Populate.
22661
22662 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22663
22664         * class.cs (TypeContainer::AddConstructor): Fix the check to
22665         compare against Name, not Basename. 
22666         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22667
22668         * cs-parser.jay : Update accordingly.
22669
22670         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22671         for methods, don't forget to look into the operators too.
22672         (RegisterMethodBuilder): Helper method to take care of this for
22673         methods, constructors and operators.
22674         (Operator::Define): Completely revamp.
22675         (Operator.OperatorMethod, MethodName): New fields.
22676         (TypeContainer::Populate): Move the registering of builders into
22677         RegisterMethodBuilder.
22678         (Operator::Emit): Re-write.
22679
22680         * expression.cs (Binary::Emit): Comment out code path to emit method
22681         invocation stuff for the case when we have a user defined operator. I am
22682         just not able to get it right !
22683
22684 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22685
22686         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22687         argument. 
22688
22689         (Expression::MemberLookup): Provide a version that allows to
22690         specify the MemberTypes and BindingFlags. 
22691
22692         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22693         so it was not fetching variable information from outer blocks.
22694
22695         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22696         Beforefieldinit as it was buggy.
22697
22698         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22699         that Ravi put here.  
22700
22701         * class.cs (Constructor::Emit): Only emit if block is not null.
22702         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22703         deal with this by semantically definining it as if the user had
22704         done it.
22705
22706         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22707         constructors as we now "emit" them at a higher level.
22708
22709         (TypeContainer::DefineDefaultConstructor): Used to define the
22710         default constructors if none was provided.
22711
22712         (ConstructorInitializer): Add methods Resolve and Emit. 
22713
22714         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22715
22716 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22717
22718         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22719         the default constructor builder with our hashtable for methodbuilders
22720         to methodcores.
22721
22722         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22723         and argument_count is 0 in which case we have a match.
22724         (Binary::ResolveOperator): More null checking and miscellaneous coding
22725         style cleanup.
22726
22727 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22728
22729         * rootcontext.cs (IsNameSpace): Compare against null.
22730
22731         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22732
22733         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22734         and Unary::Operator.
22735
22736         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22737         accordingly.
22738
22739         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22740         we have overloaded operators.
22741         (Binary::ResolveOperator): Implement the part which does the operator overload
22742         resolution.
22743
22744         * class.cs (Operator::Emit): Implement.
22745         (TypeContainer::Emit): Emit the operators we have too.
22746
22747         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22748         the case when we have a user-defined operator.
22749
22750 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22751
22752         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22753
22754 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22755
22756         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22757         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22758         (Constructor::Emit): Implement.
22759         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22760         if we have no work to do. 
22761         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22762         Emit method.
22763
22764         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22765         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22766
22767         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22768         of parent.parent.
22769
22770 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22771
22772         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22773         in the source.
22774         (Tree::RecordNamespace): Method to do what the name says ;-)
22775         (Tree::Namespaces): Property to get at the namespaces hashtable.
22776
22777         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22778         keep track.
22779
22780         * rootcontext.cs (IsNamespace): Fixed it :-)
22781
22782 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22783
22784         * class.cs (TypeContainer::FindMembers): Add support for
22785         constructors. 
22786         (MethodCore): New class that encapsulates both the shared aspects
22787         of a Constructor and a Method.  
22788         (Method, Constructor): Factored pieces into MethodCore.
22789
22790         * driver.cs: Added --fatal which makes errors throw exceptions.
22791         Load System assembly as well as part of the standard library.
22792
22793         * report.cs: Allow throwing exceptions on errors for debugging.
22794
22795         * modifiers.cs: Do not use `parent', instead use the real type
22796         container to evaluate permission settings.
22797
22798         * class.cs: Put Ravi's patch back in.  He is right, and we will
22799         have to cope with the
22800
22801 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22802
22803         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22804         FamORAssem, not FamANDAssem.
22805
22806 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22807
22808         * driver.cs: Added --parse option that only parses its input files
22809         and terminates.
22810
22811         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22812         incorrect.  IsTopLevel is not used to tell whether an object is
22813         root_types or not (that can be achieved by testing this ==
22814         root_types).  But to see if this is a top-level *class* (not
22815         necessarly our "toplevel" container). 
22816
22817 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22818
22819         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22820         parent instead of a direct call to GetType.
22821
22822 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22823
22824         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22825         Modifiers.TypeAttr. This should just be a call to that method.
22826
22827         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22828         object so that we can determine if we are top-level or not.
22829
22830         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22831         TypeContainer too.
22832
22833         * enum.cs (Enum::Define): Ditto.
22834
22835         * modifiers.cs (FieldAttr): Re-write.
22836
22837         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22838         (TypeContainer::HaveStaticConstructor): New property to provide access
22839         to precisely that info.
22840
22841         * modifiers.cs (MethodAttr): Re-write.
22842         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22843
22844         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22845         of top-level types as claimed.
22846
22847 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22848
22849         * expression.cs (MemberLookup): Fruitless attempt to lookup
22850         constructors.  Maybe I need to emit default constructors?  That
22851         might be it (currently .NET emits this for me automatically).
22852         (Invocation::OverloadResolve): Cope with Arguments == null.
22853         (Invocation::EmitArguments): new function, shared by the new
22854         constructor and us.
22855         (Invocation::Emit): Handle static and instance methods.  Emit
22856         proper call instruction for virtual or non-virtual invocations.
22857         (New::Emit): Implement.
22858         (New::Resolve): Implement.
22859         (MemberAccess:Resolve): Implement.
22860         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22861         to track instances.
22862         (FieldExpr::Resolve): Set type.
22863
22864         * support.cs: Handle empty arguments.
22865                 
22866         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22867         SimpleLookup): Auxiliary routines to help parse a qualifier
22868         identifier.  
22869
22870         Update qualifier_identifier rule.
22871
22872         * codegen.cs: Removed debugging messages.
22873
22874         * class.cs: Make this a global thing, this acts just as a "key" to
22875         objects that we might have around.
22876
22877         (Populate): Only initialize method_builders_to_methods once.
22878
22879         * expression.cs (PropertyExpr): Initialize type from the
22880         PropertyType. 
22881
22882         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22883         Resolve pattern.  Attempt to implicitly convert value to boolean.
22884         Emit code.
22885
22886         * expression.cs: Set the type for the int32/int32 argument case.
22887         (Binary::ResolveOperator): Set the return type to boolean for
22888         comparission operators
22889
22890         * typemanager.cs: Remove debugging print code.
22891
22892         (Invocation::Resolve): resolve type.
22893
22894         * class.cs: Allocate a MemberInfo of the correct size, as the code
22895         elsewhere depends on the test to reflect the correct contents.
22896
22897         (Method::) Keep track of parameters, due to System.Reflection holes
22898
22899         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22900         mapping here.
22901
22902         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22903         of the exact size and return that.
22904
22905         (Class::LookupMethodByBuilder): New function that maps
22906         MethodBuilders to its methods.  Required to locate the information
22907         on methods because System.Reflection bit us again.
22908
22909         * support.cs: New file, contains an interface ParameterData and
22910         two implementations: ReflectionParameters and InternalParameters
22911         used to access Parameter information.  We will need to grow this
22912         as required.
22913
22914         * expression.cs (Invocation::GetParameterData): implement a cache
22915         and a wrapper around the ParameterData creation for methods. 
22916         (Invocation::OverloadResolve): Use new code.
22917
22918 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22919
22920         * class.cs (TypeContainer::EmitField): Remove and move into 
22921         (Field::Define): here and modify accordingly.
22922         (Field.FieldBuilder): New member.
22923         (TypeContainer::Populate): Update accordingly.
22924         (TypeContainer::FindMembers): Implement.
22925
22926 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22927
22928         * statement.cs: (VariableInfo::VariableType): New field to be
22929         initialized with the full type once it is resolved. 
22930
22931 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22932
22933         * parameter.cs (GetParameterInfo): Use a type cache to compute
22934         things only once, and to reuse this information
22935
22936         * expression.cs (LocalVariableReference::Emit): Implement.
22937         (OpcodeCast::Emit): fix.
22938
22939         (ParameterReference::Resolve): Implement.
22940         (ParameterReference::Emit): Implement.
22941
22942         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22943         that are expressions need to stay as Expressions.
22944
22945         * typemanager.cs (CSharpName): Returns the C# name of a type if
22946         possible. 
22947
22948         * expression.cs (Expression::ConvertImplicit): New function that
22949         implements implicit type conversions.
22950
22951         (Expression::ImplicitReferenceConversion): Implements implicit
22952         reference conversions.
22953
22954         (EmptyCast): New type for transparent casts.
22955
22956         (OpcodeCast): New type for casts of types that are performed with
22957         a sequence of bytecodes.
22958
22959         (BoxedCast): New type used for casting value types into reference
22960         types.  Emits a box opcode.
22961
22962         (Binary::DoNumericPromotions): Implements numeric promotions of
22963         and computation of the Binary::Type.
22964
22965         (Binary::EmitBranchable): Optimization.
22966
22967         (Binary::Emit): Implement code emission for expressions.
22968
22969         * typemanager.cs (TypeManager): Added two new core types: sbyte
22970         and byte.
22971
22972 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22973
22974         * class.cs (TypeContainer::FindMembers): Method which does exactly
22975         what Type.FindMembers does, only we don't have to use reflection. No
22976         implementation yet.
22977
22978         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22979         typecontainer objects as we need to get at them.
22980         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22981
22982         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22983         typecontainer object.
22984
22985         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22986         of just a Report object.
22987
22988 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22989
22990         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22991         "remove_"
22992         (TypeContainer::Populate): Now define the delegates of the type too.
22993         (TypeContainer.Delegates): Property to access the list of delegates defined
22994         in the type.
22995
22996         * delegates.cs (Delegate::Define): Implement partially.
22997
22998         * modifiers.cs (TypeAttr): Handle more flags.
22999
23000 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23001
23002         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23003         and not <=
23004         (Operator::Define): Re-write logic to get types by using the LookupType method
23005         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23006         (Indexer::Define): Ditto.
23007         (Event::Define): Ditto.
23008         (Property::Define): Ditto.
23009
23010 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23011
23012         * class.cs (TypeContainer::Populate): Now define operators too. 
23013         (TypeContainer.Operators): New property to access the list of operators
23014         in a type.
23015         (Operator.OperatorMethodBuilder): New member to hold the method builder
23016         for the operator we are defining.
23017         (Operator::Define): Implement.
23018
23019 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23020
23021         * class.cs (Event::Define): Make the prefixes of the accessor methods
23022         addOn_ and removeOn_ 
23023
23024         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23025         of the location being passed in too. Ideally, this should go later since all
23026         error reporting should be done through the Report object.
23027
23028         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23029         (Populate): Iterate thru the indexers we have and define them too.
23030         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23031         for the get and set accessors.
23032         (Indexer::Define): Implement.
23033
23034 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23035
23036         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23037         my previous implementation, did not work.
23038
23039         * typemanager.cs: Add a couple of missing types (the longs).
23040
23041         * literal.cs: Use TypeManager.bool_type instead of getting it.
23042
23043         * expression.cs (EventExpr): New kind of expressions.
23044         (Expressio::ExprClassFromMemberInfo): finish
23045
23046 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23047
23048         * assign.cs: Emit stores to static fields differently.
23049
23050 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23051
23052         * Merge in changes and adjust code to tackle conflicts. Backed out my
23053         code in Assign::Resolve ;-) 
23054
23055 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23056
23057         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23058         instead Report.Error and also pass in the location.
23059         (CSharpParser::Lexer): New readonly property to return the reference
23060         to the Tokenizer object.
23061         (declare_local_variables): Use Report.Error with location instead of plain 
23062         old error.
23063         (CheckDef): Ditto.
23064
23065         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23066         (Operator.CheckBinaryOperator): Ditto.
23067
23068         * cs-parser.jay (operator_declarator): Update accordingly.
23069
23070         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23071         (CheckBinaryOperator): Same here.
23072
23073         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23074         on the name without any prefixes of namespace names etc. This is because we
23075         already might have something already fully qualified like 
23076         'System.Console.WriteLine'
23077
23078         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23079
23080 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23081
23082         * cs-tokenizer.cs (location): Return a string which also contains
23083         the file name.
23084
23085         * expression.cs (ElementAccess): New class for expressions of the
23086         type 'element access.'
23087         (BaseAccess): New class for expressions of the type 'base access.'
23088         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23089         respectively.
23090
23091         * cs-parser.jay (element_access): Implement action.
23092         (base_access): Implement actions.
23093         (checked_expression, unchecked_expression): Implement.
23094
23095         * cs-parser.jay (local_variable_type): Correct and implement.
23096         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23097
23098         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23099
23100         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23101         name and the specifiers.
23102
23103         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23104
23105         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
23106         making them all public ;-)
23107
23108         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23109         class anyways.
23110
23111 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
23112
23113         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23114         PropertyExprs.
23115         (FieldExpr, PropertyExprs): New resolved expressions.
23116         (SimpleName::MemberStaticCheck): Perform static checks for access
23117         to non-static fields on static methods. Maybe this should be
23118         generalized for MemberAccesses. 
23119         (SimpleName::ResolveSimpleName): More work on simple name
23120         resolution. 
23121
23122         * cs-parser.jay (primary_expression/qualified_identifier): track
23123         the parameter index.
23124
23125         * codegen.cs (CodeGen::Save): Catch save exception, report error.
23126         (EmitContext::EmitBoolExpression): Chain to expression generation
23127         instead of temporary hack.
23128         (::EmitStatementExpression): Put generic expression code generation.
23129
23130         * assign.cs (Assign::Emit): Implement variable assignments to
23131         local variables, parameters and fields.
23132
23133 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
23134
23135         * statement.cs (Block::GetVariableInfo): New method, returns the
23136         VariableInfo for a variable name in a block.
23137         (Block::GetVariableType): Implement in terms of GetVariableInfo
23138
23139         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23140         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23141
23142 2001-09-06  Ravi Pratap  <ravi@ximian.com>
23143
23144         * cs-parser.jay (operator_declaration): Continue on my quest : update
23145         to take attributes argument.
23146         (event_declaration): Ditto.
23147         (enum_declaration): Ditto.
23148         (indexer_declaration): Ditto.
23149
23150         * class.cs (Operator::Operator): Update constructor accordingly.
23151         (Event::Event): Ditto.
23152
23153         * delegate.cs (Delegate::Delegate): Same here.
23154
23155         * enum.cs (Enum::Enum): Same here.
23156
23157 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23158
23159         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23160
23161         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23162
23163         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23164         being passed around as an arraylist.
23165         (Attributes::AddAttribute): Method to add attribute sections.
23166
23167         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23168         (struct_declaration): Update accordingly.
23169         (constant_declaration): Update.
23170         (field_declaration): Update.
23171         (method_header): Update.
23172         (fixed_parameter): Update.
23173         (parameter_array): Ditto.
23174         (property_declaration): Ditto.
23175         (destructor_declaration): Ditto.
23176
23177         * class.cs (Struct::Struct): Update constructors accordingly.
23178         (Class::Class): Ditto.
23179         (Field::Field): Ditto.
23180         (Method::Method): Ditto.
23181         (Property::Property): Ditto.
23182         (TypeContainer::OptAttribute): update property's return type.
23183
23184         * interface.cs (Interface.opt_attributes): New member.
23185         (Interface::Interface): Update to take the extra Attributes argument.
23186
23187         * parameter.cs (Parameter::Parameter): Ditto.
23188
23189         * constant.cs (Constant::Constant): Ditto.
23190
23191         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23192         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23193         the attributes as a parameter.
23194         (InterfaceProperty): Update constructor call.
23195         (InterfaceEvent): Ditto.
23196         (InterfaceMethod): Ditto.
23197         (InterfaceIndexer): Ditto.
23198
23199         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23200         pass the attributes too.
23201         (interface_event_declaration): Ditto.
23202         (interface_property_declaration): Ditto.
23203         (interface_method_declaration): Ditto.
23204         (interface_declaration): Ditto.
23205
23206 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23207
23208         * class.cs (Method::Define): Track the "static Main" definition to
23209         create an entry point. 
23210
23211         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23212         EntryPoint if we find it. 
23213
23214         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23215         (EmitContext::ig): Make this variable public.
23216
23217         * driver.cs: Make the default output file be the first file name
23218         with the .exe extension.  
23219
23220         Detect empty compilations
23221
23222         Handle various kinds of output targets.  Handle --target and
23223         rename -t to --dumper.
23224
23225         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23226         methods inherited from Expression return now an Expression.  This
23227         will is used during the tree rewriting as we resolve them during
23228         semantic analysis.
23229
23230         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23231         the spec.  Missing entirely is the information about
23232         accessability of elements of it.
23233
23234         (Expression::ExprClassFromMemberInfo): New constructor for
23235         Expressions that creates a fully initialized Expression based on
23236         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23237         a Type.
23238
23239         (Invocation::Resolve): Begin implementing resolution of invocations.
23240
23241         * literal.cs (StringLiteral):  Implement Emit.
23242
23243 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23244
23245         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23246         member.
23247
23248 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23249
23250         * cs-parser.jay (attribute_arguments): Implement actions.
23251         (attribute): Fix bug in production. Implement action.
23252         (attribute_list): Implement.
23253         (attribute_target): Implement.
23254         (attribute_target_specifier, opt_target_specifier): Implement
23255         (CheckAttributeTarget): New method to check if the attribute target
23256         is valid.
23257         (attribute_section): Implement.
23258         (opt_attributes): Implement.
23259
23260         * attribute.cs : New file to handle attributes.
23261         (Attribute): Class to hold attribute info.
23262
23263         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23264         (attribute_section): Modify production to use 2 different rules to 
23265         achieve the same thing. 1 s/r conflict down !
23266         Clean out commented, useless, non-reducing dimension_separator rules.
23267
23268         * class.cs (TypeContainer.attributes): New member to hold list
23269         of attributes for a type.
23270         (Struct::Struct): Modify to take one more argument, the attribute list.
23271         (Class::Class): Ditto.
23272         (Field::Field): Ditto.
23273         (Method::Method): Ditto.
23274         (Property::Property): Ditto.
23275
23276         * cs-parser.jay (struct_declaration): Update constructor call to
23277         pass in the attributes too.
23278         (class_declaration): Ditto.
23279         (constant_declaration): Ditto.
23280         (field_declaration): Ditto.
23281         (method_header): Ditto.
23282         (fixed_parameter): Ditto.
23283         (parameter_array): Ditto.
23284         (property_declaration): Ditto.
23285
23286         * constant.cs (Constant::Constant): Update constructor similarly.
23287         Use System.Collections.
23288
23289         * parameter.cs (Parameter::Parameter): Update as above.
23290
23291 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23292
23293         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23294         (TypeContainer.delegates): New member to hold list of delegates.
23295
23296         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23297         this time as I seem to be on crack ;-)
23298
23299 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23300
23301         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23302         tell whether an identifier represents a namespace.
23303
23304         * expression.cs (NamespaceExpr): A namespace expression, used only
23305         temporarly during expression resolution.
23306         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23307         utility functions to resolve names on expressions.
23308
23309 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23310
23311         * codegen.cs: Add hook for StatementExpressions. 
23312
23313         * class.cs: Fix inverted test for static flag in methods.
23314
23315 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23316
23317         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23318         to make it coincide with MS' number.
23319         (Operator::CheckBinaryOperator): Ditto.
23320
23321         * ../errors/errors.txt : Remove error numbers added earlier.
23322
23323         * ../errors/cs1019.cs : Test case for error # 1019
23324
23325         * ../errros/cs1020.cs : Test case for error # 1020
23326
23327         * cs-parser.jay : Clean out commented cruft.
23328         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23329         used anywhere - non-reducing rule.
23330         (namespace_declarations): Non-reducing rule - comment out.
23331
23332         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23333         with TypeContainer::AddEnum.
23334
23335         * delegate.cs : New file for delegate handling classes.
23336         (Delegate): Class for declaring delegates.
23337
23338         * makefile : Update.
23339
23340         * cs-parser.jay (delegate_declaration): Implement.
23341
23342 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23343
23344         * class.cs (Event::Define): Implement.
23345         (Event.EventBuilder): New member.
23346
23347         * class.cs (TypeContainer::Populate): Update to define all enums and events
23348         we have.
23349         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23350         readonly fields for all these cases ?
23351
23352 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23353
23354         * class.cs (Property): Revamp to use the convention of making fields readonly.
23355         Accordingly modify code elsewhere.
23356
23357         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23358         the Define method of the Property class.
23359
23360         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23361         trivial bug.
23362         (TypeContainer::Populate): Update to define all the properties we have. Also
23363         define all enumerations.
23364
23365         * enum.cs (Define): Implement.
23366
23367 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23368
23369         * cs-parser.jay (overloadable_operator): The semantic value is an
23370         enum of the Operator class.
23371         (operator_declarator): Implement actions.
23372         (operator_declaration): Implement.
23373
23374         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23375         validity of definitions.
23376         (Operator::CheckBinaryOperator): Static method to check for binary operators
23377         (TypeContainer::AddOperator): New method to add an operator to a type.
23378
23379         * cs-parser.jay (indexer_declaration): Added line to actually call the
23380         AddIndexer method so it gets added ;-)
23381
23382         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23383         already taken care of by the MS compiler ?  
23384
23385 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23386
23387         * class.cs (Operator): New class for operator declarations.
23388         (Operator::OpType): Enum for the various operators.
23389
23390 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23391
23392         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23393         ostensibly handle this in semantic analysis.
23394
23395         * cs-parser.jay (general_catch_clause): Comment out
23396         (specific_catch_clauses, specific_catch_clause): Ditto.
23397         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23398         (catch_args, opt_catch_args): New productions.
23399         (catch_clause): Rewrite to use the new productions above
23400         (catch_clauses): Modify accordingly.
23401         (opt_catch_clauses): New production to use in try_statement
23402         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23403         and re-write the code in the actions to extract the specific and
23404         general catch clauses by being a little smart ;-)
23405
23406         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23407         Hooray, try and catch statements parse fine !
23408
23409 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23410
23411         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23412         string from the hashtable of variables.
23413
23414         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23415         I end up making that mistake ;-)
23416         (catch_clauses): Fixed gross error which made Key and Value of the 
23417         DictionaryEntry the same : $1 !!
23418
23419 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23420
23421         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23422
23423         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23424         when the add and remove accessors are specified. 
23425
23426 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23427
23428         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23429         information about indexer_declarator.
23430         (indexer_declarator): Implement actions.
23431         (parsing_indexer): New local boolean used to keep track of whether
23432         we are parsing indexers or properties. This is necessary because 
23433         implicit_parameters come into picture even for the get accessor in the 
23434         case of an indexer.
23435         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23436
23437         * class.cs (Indexer): New class for indexer declarations.
23438         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23439         (TypeContainer::indexers): New member to hold list of indexers for the
23440         type.
23441
23442 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23443
23444         * cs-parser.jay (add_accessor_declaration): Implement action.
23445         (remove_accessor_declaration): Implement action.
23446         (event_accessors_declaration): Implement
23447         (variable_declarators): swap statements for first rule - trivial.
23448
23449         * class.cs (Event): New class to hold information about event
23450         declarations.
23451         (TypeContainer::AddEvent): New method to add an event to a type
23452         (TypeContainer::events): New member to hold list of events.
23453
23454         * cs-parser.jay (event_declaration): Implement actions.
23455
23456 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23457
23458         * cs-parser.jay (dim_separators): Implement. Make it a string
23459         concatenating all the commas together, just as they appear.
23460         (opt_dim_separators): Modify accordingly
23461         (rank_specifiers): Update accordingly. Basically do the same
23462         thing - instead, collect the brackets here.
23463         (opt_rank_sepcifiers): Modify accordingly.
23464         (array_type): Modify to actually return the complete type string
23465         instead of ignoring the rank_specifiers.
23466         (expression_list): Implement to collect the expressions
23467         (variable_initializer): Implement. We make it a list of expressions
23468         essentially so that we can handle the array_initializer case neatly too.
23469         (variable_initializer_list): Implement.
23470         (array_initializer): Make it a list of variable_initializers
23471         (opt_array_initializer): Modify accordingly.
23472
23473         * expression.cs (New::NType): Add enumeration to help us
23474         keep track of whether we have an object/delegate creation
23475         or an array creation.
23476         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23477         members to hold data about array creation.
23478         (New:New): Modify to update NewType
23479         (New:New): New Overloaded contructor for the array creation
23480         case.
23481
23482         * cs-parser.jay (array_creation_expression): Implement to call
23483         the overloaded New constructor.
23484
23485 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23486
23487         * class.cs (TypeContainer::Constructors): Return member
23488         constructors instead of returning null.
23489
23490 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23491
23492         * typemanager.cs (InitCoreTypes): Initialize the various core
23493         types after we have populated the type manager with the user
23494         defined types (this distinction will be important later while
23495         compiling corlib.dll)
23496
23497         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23498         on Expression Classification.  Now all expressions have a method
23499         `Resolve' and a method `Emit'.
23500
23501         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23502         generation from working.     Also add some temporary debugging
23503         code. 
23504
23505 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23506
23507         * codegen.cs: Lots of code generation pieces.  This is only the
23508         beginning, will continue tomorrow with more touches of polish.  We
23509         handle the fundamentals of if, while, do, for, return.  Others are
23510         trickier and I need to start working on invocations soon.
23511
23512         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23513         s.InitStatement. 
23514
23515         * codegen.cs (EmitContext): New struct, used during code
23516         emission to keep a context.   Most of the code generation will be
23517         here. 
23518
23519         * cs-parser.jay: Add embedded blocks to the list of statements of
23520         this block.  So code generation proceeds in a top down fashion.
23521
23522 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23523
23524         * statement.cs: Add support for multiple child blocks.
23525
23526 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23527
23528         * codegen.cs (EmitCode): New function, will emit the code for a
23529         Block of code given a TypeContainer and its ILGenerator. 
23530
23531         * statement.cs (Block): Standard public readonly optimization.
23532         (Block::Block constructors): Link children. 
23533         (Block::Child): Child Linker.
23534         (Block::EmitVariables): Emits IL variable declarations.
23535
23536         * class.cs: Drop support for MethodGroups here, delay until
23537         Semantic Analysis.
23538         (Method::): Applied the same simplification that I did before, and
23539         move from Properties to public readonly fields.
23540         (Method::ParameterTypes): Returns the parameter types for the
23541         function, and implements a cache that will be useful later when I
23542         do error checking and the semantic analysis on the methods is
23543         performed.
23544         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23545         and made a method, optional argument tells whether this is a class
23546         or a structure to apply the `has-this' bit.
23547         (Method::GetCallingConvention): Implement, returns the calling
23548         convention. 
23549         (Method::Define): Defines the type, a second pass is performed
23550         later to populate the methods.
23551
23552         (Constructor::ParameterTypes): implement a cache similar to the
23553         one on Method::ParameterTypes, useful later when we do semantic
23554         analysis. 
23555
23556         (TypeContainer::EmitMethod):  New method.  Emits methods.
23557
23558         * expression.cs: Removed MethodGroup class from here.
23559
23560         * parameter.cs (Parameters::GetCallingConvention): new method.
23561
23562 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23563
23564         * class.cs (TypeContainer::Populate): Drop RootContext from the
23565         argument. 
23566
23567         (Constructor::CallingConvention): Returns the calling convention.
23568         (Constructor::ParameterTypes): Returns the constructor parameter
23569         types. 
23570
23571         (TypeContainer::AddConstructor): Keep track of default constructor
23572         and the default static constructor.
23573
23574         (Constructor::) Another class that starts using `public readonly'
23575         instead of properties. 
23576
23577         (Constructor::IsDefault): Whether this is a default constructor. 
23578
23579         (Field::) use readonly public fields instead of properties also.
23580
23581         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23582         track of static constructors;  If none is used, turn on
23583         BeforeFieldInit in the TypeAttributes. 
23584
23585         * cs-parser.jay (opt_argument_list): now the return can be null
23586         for the cases where there are no arguments. 
23587
23588         (constructor_declarator): If there is no implicit `base' or
23589         `this', then invoke the default parent constructor. 
23590
23591         * modifiers.cs (MethodAttr): New static function maps a set of
23592         modifiers flags into a MethodAttributes enum
23593         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23594         MethodAttr, TypeAttr to represent the various mappings where the
23595         modifiers are used.
23596         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23597
23598 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23599
23600         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23601         method arguments.
23602
23603         * interface.cs (PopulateIndexer): Implemented the code generator
23604         for interface indexers.
23605
23606 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23607
23608         * interface.cs (InterfaceMemberBase): Now we track the new status
23609         here.  
23610
23611         (PopulateProperty): Implement property population.  Woohoo!  Got
23612         Methods and Properties going today. 
23613
23614         Removed all the properties for interfaces, and replaced them with
23615         `public readonly' fields. 
23616
23617 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23618
23619         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23620         initialize their hashtables/arraylists only when they are needed
23621         instead of doing this always.
23622
23623         * parameter.cs: Handle refs and out parameters.
23624
23625         * cs-parser.jay: Use an ArrayList to construct the arguments
23626         instead of the ParameterCollection, and then cast that to a
23627         Parameter[] array.
23628
23629         * parameter.cs: Drop the use of ParameterCollection and use
23630         instead arrays of Parameters.
23631
23632         (GetParameterInfo): Use the Type, not the Name when resolving
23633         types. 
23634
23635 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23636
23637         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23638         and instead use public readonly fields.
23639
23640         * class.cs: Put back walking code for type containers.
23641
23642 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23643
23644         * class.cs (MakeConstant): Code to define constants.
23645
23646         * rootcontext.cs (LookupType): New function.  Used to locate types 
23647
23648
23649 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23650
23651         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23652         this System.Reflection code is.  Kudos to Microsoft
23653
23654         * typemanager.cs: Implement a type cache and avoid loading all
23655         types at boot time.  Wrap in LookupType the internals.  This made
23656         the compiler so much faster.  Wow.  I rule!
23657
23658         * driver.cs: Make sure we always load mscorlib first (for
23659         debugging purposes, nothing really important).
23660
23661         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23662         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23663
23664         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23665         on namespaces that have been imported using the `using' keyword.
23666
23667         * class.cs (TypeContainer::TypeAttr): Virtualize.
23668         (Class::TypeAttr): Return attributes suitable for this bad boy.
23669         (Struct::TypeAttr): ditto.
23670         Handle nested classes.
23671         (TypeContainer::) Remove all the type visiting code, it is now
23672         replaced with the rootcontext.cs code
23673
23674         * rootcontext.cs (GetClassBases): Added support for structs. 
23675
23676 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23677
23678         * interface.cs, statement.cs, class.cs, parameter.cs,
23679         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23680         Drop use of TypeRefs, and use strings instead.
23681
23682 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23683
23684         * rootcontext.cs: 
23685
23686         * class.cs (Struct::Struct): set the SEALED flags after
23687         checking the modifiers.
23688         (TypeContainer::TypeAttr): new property, returns the
23689         TypeAttributes for a class.  
23690
23691         * cs-parser.jay (type_list): Oops, list production was creating a
23692         new list of base types.
23693
23694         * rootcontext.cs (StdLib): New property.
23695         (GetInterfaceTypeByName): returns an interface by type name, and
23696         encapsulates error handling here.
23697         (GetInterfaces): simplified.
23698         (ResolveTree): Encapsulated all the tree resolution here.
23699         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23700         types. 
23701
23702         * driver.cs: Add support for --nostdlib, to avoid loading the
23703         default assemblies.
23704         (Main): Do not put tree resolution here. 
23705
23706         * rootcontext.cs: Beginning of the class resolution.
23707
23708 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23709
23710         * rootcontext.cs: Provide better error reporting. 
23711
23712         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23713
23714         * rootcontext.cs (CreateInterface): Handle the case where there
23715         are no parent interfaces.
23716
23717         (CloseTypes): Routine to flush types at the end.
23718         (CreateInterface): Track types.
23719         (GetInterfaces): Returns an array of Types from the list of
23720         defined interfaces.
23721
23722         * typemanager.c (AddUserType): Mechanism to track user types (puts
23723         the type on the global type hash, and allows us to close it at the
23724         end). 
23725
23726 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23727
23728         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23729         RecordInterface instead.
23730
23731         * cs-parser.jay: Updated to reflect changes above.
23732
23733         * decl.cs (Definition): Keep track of the TypeBuilder type that
23734         represents this type here.  Not sure we will use it in the long
23735         run, but wont hurt for now.
23736
23737         * driver.cs: Smaller changes to accomodate the new code.
23738
23739         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23740         when done. 
23741
23742         * rootcontext.cs (CreateInterface):  New method, used to create
23743         the System.TypeBuilder type for interfaces.
23744         (ResolveInterfaces): new entry point to resolve the interface
23745         hierarchy. 
23746         (CodeGen): Property, used to keep track of the code generator.
23747
23748 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23749
23750         * cs-parser.jay: Add a second production for delegate_declaration
23751         with `VOID'.
23752
23753         (enum_body): Put an opt_comma here instead of putting it on
23754         enum_body or enum_member_declarations so we can handle trailing
23755         commas on enumeration members.  Gets rid of a shift/reduce.
23756
23757         (type_list): Need a COMMA in the middle.
23758
23759         (indexer_declaration): Tell tokenizer to recognize get/set
23760
23761         * Remove old targets.
23762
23763         * Re-add the parser target.
23764
23765 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23766
23767         * cs-parser.jay: Add precendence rules for a number of operators
23768         ot reduce the number of shift/reduce conflicts in the grammar.
23769
23770 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23771
23772         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23773         and put it here.
23774
23775         Get rid of old crufty code.
23776
23777         * rootcontext.cs: Use this to keep track of the parsed
23778         representation and the defined types available to the program. 
23779
23780         * gen-treedump.cs: adjust for new convention.
23781
23782         * type.cs: Split out the type manager, and the assembly builder
23783         from here. 
23784
23785         * typemanager.cs: the type manager will live here now.
23786
23787         * cil-codegen.cs: And the code generator here. 
23788
23789 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23790
23791         * makefile: Fixed up for easy making.
23792
23793 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23794
23795         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23796         the 
23797
23798         (unary_expression): Expand pre_increment_expression and
23799         post_decrement_expression to reduce a shift/reduce.
23800
23801 2001-07-11  Simon Cozens
23802
23803         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23804
23805         Improve allow_keyword_as_indent name.
23806
23807 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23808
23809         * Adjustments for Beta2. 
23810
23811 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23812
23813         * decl.cs: Added `Define' abstract method.
23814         (InTransit): new property, used to catch recursive definitions. 
23815
23816         * interface.cs: Implement `Define'. 
23817
23818         * modifiers.cs: Map Modifiers.constants to
23819         System.Reflection.TypeAttribute flags.
23820
23821         * class.cs: Keep track of types and user-defined types.
23822         (BuilderInit): New method for creating an assembly
23823         (ResolveType): New function to launch the resolution process, only
23824         used by interfaces for now.
23825
23826         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23827         that are inserted into the name space. 
23828
23829 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23830
23831         * ARGH.  I have screwed up my tree so many times due to the use of
23832         rsync rather than using CVS.  Going to fix this at once. 
23833
23834         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23835         load types.
23836
23837 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23838
23839         * Experiment successful: Use System.Type rather that our own
23840         version of Type.  
23841
23842 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23843
23844         * cs-parser.jay: Removed nsAliases from here.
23845
23846         Use new namespaces, handle `using XXX;' 
23847
23848         * namespace.cs: Reimplemented namespace handling, use a recursive
23849         definition of the class.  Now we can keep track of using clauses
23850         and catch invalid using clauses.
23851
23852 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23853
23854         * gen-treedump.cs: Adapted for all the renaming.
23855
23856         * expression.cs (Expression): this class now has a Type property
23857         which returns an expression Type.
23858
23859         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23860         `Type', as this has a different meaning now in the base
23861
23862 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23863
23864         * interface.cs, class.cs: Removed from all the sources the
23865         references to signature computation, as we can not do method
23866         signature computation during the parsing time, as we are not
23867         trying to solve at that point distinguishing:
23868
23869         class X {
23870                 void a (Blah x) {}
23871                 void a (NS.Blah x) {}
23872         }
23873
23874         Which depending on the context might be valid or not, as we do not
23875         know if Blah is the same thing as NS.Blah at that point.
23876
23877         * Redid everything so the code uses TypeRefs now instead of
23878         Types.  TypeRefs are just temporary type placeholders, that need
23879         to be resolved.  They initially have a pointer to a string and the
23880         current scope in which they are used.  This is used later by the
23881         compiler to resolve the reference to an actual Type. 
23882
23883         * DeclSpace is no longer a CIR.Type, and neither are
23884         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23885         are all DeclSpaces, but no Types. 
23886
23887         * type.cs (TypeRefManager): This implements the TypeRef manager,
23888         which keeps track of all the types that need to be resolved after
23889         the parsing has finished. 
23890
23891 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23892
23893         * ARGH.  We are going to have to store `foreach' as a class rather
23894         than resolving it, as we need to verify error 1579 after name
23895         resolution.   *OR* we could keep a flag that says `This request to
23896         IEnumerator comes from a foreach statement' which we can then use
23897         to generate the error.
23898
23899 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23900
23901         * class.cs (TypeContainer.AddMethod): we now add methods to the
23902         MethodGroup instead of the method hashtable.  
23903
23904         * expression.cs: Add MethodGroup abstraction, which gets us one
23905         step closer to the specification in the way we handle method
23906         declarations.  
23907
23908         * cs-parser.jay (primary_expression): qualified_identifier now
23909         tried to match up an identifier to a local variable reference or
23910         to a parameter reference.
23911
23912         current_local_parameters is now a parser global variable that
23913         points to the current parameters for the block, used during name
23914         lookup.
23915
23916         (property_declaration): Now creates an implicit `value' argument to
23917         the set accessor.
23918
23919 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23920
23921         * parameter.cs: Do not use `param' arguments as part of the
23922         signature, per the spec.
23923
23924 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23925
23926         * decl.cs: Base class for classes, structs and interfaces.  This
23927         is the "Declaration Space" 
23928
23929         * cs-parser.jay: Use CheckDef for checking declaration errors
23930         instead of having one on each function.
23931
23932         * class.cs: Factor out some code for handling error handling in
23933         accordance to the "Declarations" section in the "Basic Concepts"
23934         chapter in the ECMA C# spec.
23935
23936         * interface.cs: Make all interface member classes derive from
23937         InterfaceMemberBase.
23938
23939 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23940
23941         * Many things: all interfaces are parsed and generated in
23942         gen-treedump.  Support for member variables, constructors,
23943         destructors, properties, constants is there.
23944
23945         Beginning of the IL backend, but very little done, just there for
23946         testing purposes. 
23947
23948 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23949
23950         * cs-parser.jay: Fix labeled statement.
23951
23952         * cs-tokenizer.cs (escape): Escape " and ' always.
23953         ref_line, ref_name: keep track of the line/filename as instructed
23954         by #line by the compiler.
23955         Parse #line.
23956
23957 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23958
23959         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23960         to match the values in System.CodeDOM.
23961
23962         Divid renamed to Divide.
23963
23964         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23965         statements. 
23966         (Statements.set): remove.
23967
23968         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23969         statements. 
23970
23971         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23972         falseStatements always have valid values. 
23973
23974         * cs-parser.jay: Use System.CodeDOM now.
23975