In mcs:
[mono.git] / mcs / mcs / ChangeLog
1 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2
3         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
4         (Reset): Update.
5         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
6
7         * typemanager.cs (cons_param_array_attribute): Make private.
8         (Reset): Set it to null.
9         (InitCoreHelpers): Don't initialize it.
10         (ConsParamArrayAttribute): New.  Initialize it as needed.
11         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
12
13 2006-01-31  Miguel de Icaza  <miguel@novell.com>
14
15         * expression.cs: There might be errors reported during the
16         selection of applicable methods.  If there are errors, do not
17         continue execution as it will lead the compiler to crash.
18
19 2006-01-30  Miguel de Icaza  <miguel@novell.com>
20
21         * expression.cs: Member access is not allowed on anonymous
22         methods.  Fixes #77402.
23
24 2006-01-30  Raja R Harinath  <rharinath@novell.com>
25
26         Fix #77401
27         * cs-parser.jay (VariableDeclaration): Don't set
28         current_array_type to null.
29         (field_declaration, event_declaration, declaration_statement):
30         Set it to null here.
31
32 2006-01-28  Raja R Harinath  <harinath@gmail.com>
33
34         * typemanager.cs (GenericParameterPosition): New.
35         * doc.cs: Use it.
36
37 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
38
39         * doc.cs : To process "include" elements, first we should create
40           another list than XmlNodeList, because it could result in node
41           removal, which could result in that the XmlNodeList gives up
42           yielding next node.
43
44           (Also made code identical to gmcs again.)
45
46 2006-01-25  Miguel de Icaza  <miguel@novell.com>
47
48         * ecore.cs: Introduce an error report that we were not catching
49         before, if not silent, we must report the error.  Gonzalo ran into
50         it.
51
52 2006-01-23  Miguel de Icaza  <miguel@novell.com>
53
54         A fix for bug: #76957
55         
56         * iterators.cs (MoveNextMethod.CreateMethodHost): call
57         ComputeMethodHost before creating the method, this is a new
58         requirement. 
59
60         * anonymous.cs (AnonymousContainer): Now we track all the scopes
61         that this method references (RegisterScope).  The actual scope
62         where the method is hosted is computed with the ComputeMethodHost
63         before we create the method.
64
65         Moved the Deepest routine here.
66
67         (AnonymousContainer.ComputeMethodHost): New routine used to
68         compute the proper ScopeInfo that will host the anonymous method.
69
70         (ScopeInfo): Deal with multiple roots.  The problem was that we
71         did not have a unique root where all ScopeInfos could be hanged
72         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
73         of roots.  
74
75         Remove AdjustMethodScope which is now computed at the end.  Remove
76         LinkScope which did a partial link, instead link all ScopeInfos
77         before code generation from the new "LinkScopes" routine. 
78
79         Simplify all the Add* routines as they no longer need to maintain
80         the tree, they just need to record that they are using variables
81         from a ScopeInfo.
82
83         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
84         routines to produce the forest of ScopeInfo trees.
85
86         * class.cs (TypeContainer.AppendMethod): This is just like
87         AddMethod, but ensures that an interface implementation method
88         (IEnumerable.XXX) is not inserted at the beginning of the queue of
89         methods, but at the end.
90
91         We use this functionality to ensure that the generated MoveNext
92         method in the iterator class is resolved/emitted before the
93         enumerator methods created.   
94
95         This is required because the MoveNext method computes the right
96         ScopeInfo for the method.  And the other methods will eventually
97         need to resolve and fetch information computed from the anonymous
98         method. 
99
100 2006-01-21  Raja R Harinath  <harinath@gmail.com>
101             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
102
103         Fix rest of #76995.
104         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
105         the 'aliases' hash.
106         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
107         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
108
109 2006-01-18  Raja R Harinath  <rharinath@novell.com>
110
111         Fix #76656, cs0231-2.cs.
112         * cs-parser.jay (formal_parameter_list): Make error case catch
113         more issues.
114         (parenthesized_expression_0): Add CS1026 check.
115         (invocation_expression): Remove unused { $$ = lexer.Location }.
116
117 2006-01-17  Raja R Harinath  <rharinath@novell.com>
118
119         Fix #76824.
120         * cs-parser.jay (statement_expression): Don't list out the
121         individual statement-expressions.  Convert syntax error into
122         CS0201 check.
123
124 2006-01-16  Raja R Harinath  <rharinath@novell.com>
125
126         Fix #76874.
127         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
128         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
129         CheckIntermediateModification.
130         (FieldExpr.DoResolve): Add new two-argument version that
131         allows us to resolve the InstanceExpression as an lvalue.
132         The one-argument variant is now just a wrapper.
133         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
134         Resolve the lhs as an lvalue if the it has a value type.
135         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
136         from Assign.DoResolve.
137         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
138         resolved as an lvalue.
139         (PropertyExpr.DoResolve): Update.
140         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
141         has a value type.  Move CS1612 check here from
142         CheckIntermediateModification.
143         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
144         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
145         'right_side' of a ResolveLValue on an 'out' argument.
146         (EmptyExpression.LValueMemberAccess): New.  Used as the
147         'right_side' of a propagated ResolveLValue on a value type.
148         (LocalVariableReference.DoResolveBase): Recognize
149         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
150         Add CS1654 check.
151         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
152         EmptyExpression.Null.
153
154 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
155
156         * typemanager.cs : added IsGenericParameter(). In mcs it always
157           return false.
158         * doc.cs : for generic parameters, use GenericParameterPosition,
159           not FullName.
160
161 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
162
163         * expression.cs: Fix Console.WriteLine ((this = x).foo);
164
165 2006-01-12  Miguel de Icaza  <miguel@novell.com>
166
167         This fixes the problem where we used ldfld instead of ldflda to
168         load the "THIS" pointer on captured parameters, when THIS is a
169         value type.  See bug #77205.
170         
171         * iterators.cs (CapturedThisReference.Emit): Pass false to
172         EmitThis (we do not need the address).
173
174         * codegen.cs (EmitThis): it needs to know whether we need the
175         address of `this' or not.  This is used by value types.  
176
177         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
178         every other call passes false.
179
180 2006-01-12  Raja R Harinath  <rharinath@novell.com>
181
182         Fix #77221.
183         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
184         GetOverride.
185         * expression.cs (Invocation.OverloadResolve): Update.
186         (Invocation.DoResolve): Avoid double resolution of invocation.
187
188 2006-01-11  Raja R Harinath  <rharinath@novell.com>
189
190         Fix #77180.
191         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
192         unary negation of floating point types as 0-expr; negation cannot
193         overflow in floating point types.
194
195         Fix #77204.
196         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
197         on operands of 'void' type.
198
199         Fix #77200.
200         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
201         and ExclusiveOr for boolean constants too.
202
203 2006-01-09  Raja R Harinath  <rharinath@novell.com>
204
205         Fix #75636.
206         * expression.cs (Invocation.OverloadResolve): Replace reflected
207         override methods with their base virtual methods, rather than
208         skipping over them.
209         * typemanager.cs (TypeManager.GetOverride): New.
210
211 2006-01-05  Jb Evain  <jbevain@gmail.com>
212
213         * class.cs (Property.Define, Indexer.Define): do not tag the
214         properties as SpecialName | RTSpecialName.
215
216 2006-01-04  Miguel de Icaza  <miguel@novell.com>
217
218         * class.cs (MethodCore.IsDuplicateImplementation): This method was
219         doing a low-level comparission of parameter types.  It was lacking
220         a check for __argslist. 
221
222 2005-12-30  Miguel de Icaza  <miguel@novell.com>
223
224         * expression.cs (ParameterReference.DoResolveBase): Allow
225         reference parameters if they are local to this block. 
226
227         This allows the ref and out parameters of a delegate to be used in
228         an anonymous method, for example:
229
230         delegate void set (out int x);
231
232         set s = delegate (out int x){
233                 x = 0;
234         };
235
236         This is used by functionality introduced late in the C# language.
237         
238         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
239         method that take ref and out parameters. 
240
241         Fixes #77119 which was a late change in the spec.
242
243 2005-12-23  Miguel de Icaza  <miguel@novell.com>
244
245         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
246         parent if its the same scope.  Fixes #77060.
247
248 2005-12-21  Miguel de Icaza  <miguel@novell.com>
249
250         * driver.cs: Report the case of no source files and no -out:
251         argument provided.
252
253 2005-12-20  Raja R Harinath  <rharinath@novell.com>
254
255         Fix #77035.
256         * expression.cs (ComposedCast.GetSignatureForError): Define.
257
258 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
259
260         Fix #76995
261
262         * namespace.cs (NamespaceEntry): Add extern_aliases as a
263         ListDictionary, to contain the ExternAliasEntry entries (in
264         addition to the NamespaceEntry.aliases hashtable). This field is
265         shared between the original entry and its doppelganger (bodyless 
266         copy of it).
267         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
268         extern_aliases field.
269         (NamespaceEntry.Lookup): Move the IsImplicit check after the
270         lookup in extern_aliases.
271
272 2005-12-16  Raja R Harinath  <rharinath@novell.com>
273
274         Fix #77006.
275         * class.cs (TypeContainer.Mark_HasEquals): New.
276         (TypeContainer.Mark_HasGetHashCode): New.
277         (ClassPart): Override them.
278         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
279
280         Fix #77008.
281         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
282         'parent' argument to the base constructor.
283
284         Remove all mention of TypeContainer from decl.cs.
285         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
286         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
287         (DeclSpace.DeclSpace): Likewise.
288         (DeclSpace.DefineMembers): Remove unused argument.
289         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
290         debugging check -- we don't care if the debug code throws an
291         InvalidCastException instead of an InternalErrorException.
292         * class.cs (TypeContainer.DefineMembers): Update to changes.
293         (TypeContainer.DoDefineMembers): Likewise.
294         (TypeContainer.GetMethods): Likewise.
295         (PropertyMember.Define): Likewise.
296         (MemberBase.Parent): New property that forwards to
297         MemberCore.Parent, but ensures that we get a TypeContainer.
298         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
299         (RootContext.PopulateTypes): Likewise.  Remove special case code
300         for !RootContext.StdLib: DefineMembers is idempotent.
301
302 2005-12-14  Miguel de Icaza  <miguel@novell.com>
303
304         * convert.cs (ExplicitConversionCore): Check the return value from
305         ExplicitConversionCore which can return null on failure.  Fixes #76914
306
307 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
308
309         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
310
311 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
312
313         * doc.cs : The search for referenced namespace was insufficient to
314           get global one as it used to do. Fixed bug #76965.
315
316 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
317
318         * doc.cs : check name in cref in the last phase that whether it is
319           namespace or not.
320
321 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
322
323         * cs-tokenizer.cs : reverted the latest change: it somehow broke
324           Mono.C5.
325
326 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
327
328         * doc.cs : so it turned out that we cannot skip override check for 
329           interface members. Fixed bug #76954.
330
331 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
332
333         * cs-tokenizer.cs : fixed bug #75984:
334           - #warning and #error should not be handled when the source line
335             is disabled.
336           - #line is not checked strictly when the source line is disabled.
337           - #define and #undef is on the other hand checked strictly at any
338             state.
339
340 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
341
342         * cs-tokenizer.cs : missing Location (actually, filename) in one of
343           CS1027 report.
344
345 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
346
347         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
348
349         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
350         event initializers.
351         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
352         (FieldBase.Initializer): Initializer is now optional.
353         (EventField.Define): Only event field can have initializer.
354
355         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
356
357         * const.cs (Const): Reuse initializer.
358
359         * cs-parser.jay: Updated after FieldBase changes.
360         Added current_array_type to simplify array initializers.
361
362         * ecore.cs (NullCast.IsDefaultValue): Implemented.
363
364         * expression.cs, iterators.cs: Updated.
365
366         * namespace.cs (NamespaceEntry): Made UsingFound private.
367
368 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
369
370         * parameterCollection.cs: Obsolete, removed.
371         * parser.cs: Obsolete, removed.
372
373 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
374
375         Fix #76849.
376         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
377
378         * enum.cs (Enum.Define): Set obsolete context here.
379
380 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
381
382         * doc.cs :
383           - FindDocumentedMember() now expects 1) paramList as null
384             when "we don't have to check the number of parameters" and
385             2) Type.EmptyTypes when "there is no arguments".
386           - Introduced FoundMember struct to hold the exact type which was
387             used to find the documented member (the above change broke
388             test-xml-044; it might be better just to use DeclaringType than
389             what MS does, like this change does, but it depends on usage.)
390
391 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
392
393         * doc.cs : documented member might be from DeclaringType for nested
394           types. Fixed bug #76782.
395
396 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
397
398         * anonymous.cs: Have the param code handle leaving copies on the
399         stack etc. Allows anonymous params to take part in the assignment
400         code (++, +=, etc). Fixes bug #76550
401
402         * expression.cs: Handle the prepare_for_load/leave_copy by passing
403         it down to the anon code.
404
405         * iterators.cs: Use dummy var here
406
407         * codegen.cs: Handle new vars
408
409 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
410
411         Fix #76849.
412         * class.cs (MethodData.Define): Set proper Obsolete context.
413
414         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
415         obsolete context.
416         (FieldExpr.DoResolve): Ditto.
417
418 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
419
420         Fix #76849.
421         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
422         parent is not obsolete.
423
424 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
425
426         * doc.cs : (FindDocumentedMember) find parameterless members first
427           and get CS0419 in the early stage. Fixed first case of bug #76727.
428
429 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
430
431         Fix #76859.
432         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
433         no error was reported.
434
435         *expression.cs (Binary.DoResolve): left can be null.
436
437 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
438
439         Fix #76783.
440         * class.cs (MethodData.Emit): Parameters should be labeled first.
441
442 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
443
444         Fix #76761.
445         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
446
447 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
448
449         * attribute.cs (AreParametersCompliant): Moved to Parameter.
450
451         * class.cs (MethodCore): Parameter clean up.
452         (IMethodData): Added ParameterInfo.
453         (MethodData): Parameter clean up.
454         (Indexer.Define): Parameter clean up.
455
456         * anonymous.cs,
457         * codegen.cs,
458         * cs-parser.jay,
459         * decl.cs,
460         * doc.cs,
461         * ecore.cs,
462         * flowanalysis.cs,
463         * iterators.cs,
464         * pending.cs,
465         * statement.cs,
466         * typemanager.cs: Parameter clean up.
467
468         * delegate.cs (Define): Get rid of duplicated code.
469
470         * expression.cs (ParameterReference): Removed useless parameters
471         and simplified.
472         (Invocation): Ditto.
473
474         * parameter.cs (ParamsParameter): New class, params specialization.
475         (ArglistParameter): Attemp to separate arglist.
476         (Parameter): Refactored to be reusable and faster.
477         (Parameter.Modifier): Made understandable.
478         (Parameters): Changed to be used as a class for `this' assembly
479         parameters. Refactored to use new specialized classes.
480
481         * support.cs (ParameterData): Added Types property.
482         (InternalParameters): Deleted.
483
484 2005-08-20  Martin Baulig  <martin@ximian.com>
485
486         Merging this patch from GMCS to fix #75867.
487
488         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
489         scope if we don't already have it.
490
491 2005-11-17  Martin Baulig  <martin@ximian.com>
492
493         * anonymous.cs
494         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
495         inherit the scope from our parent.  Fixes #76653.
496
497 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
498
499         * doc.cs : the previous patch does not actually fix the bug.
500           PropertyInfo override check is now implemented and really fixed it.
501         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
502
503 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
504
505         * doc.cs : apply "override filter" also to properties.
506           Fixed bug #76730.
507
508 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
509
510         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
511           no need to check overrides. For classes, omit those results from 
512           interfaces since they must exist in the class. Fixed bug #76726.
513
514 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
515
516         * typemanager.cs : (GetFullNameSignature) differentiate indexers
517           with different parameters. Fixed the second problem in #76685.
518
519 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
520
521         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
522           get expected 'protected' access in CheckValidFamilyAccess()).
523           Fixed bug #76692.
524
525 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
526
527         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
528           Fixed bug #76705.  CS1569 was incorrectly commented out.
529
530 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
531
532         * doc.cs : use Invocation.IsOverride() to do real override check.
533         * expression.cs : made Invocation.IsOverride() internal.
534
535 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
536
537         * doc.cs : use TypeManager.FindMembers() instead of (possible)
538           TypeBuilder.FindMembers() and filter overriden base members out.
539           Fixed bug #76990.
540
541 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
542
543         * doc.cs : ref/out parameters are represented as '@' (instead of
544           '&' in type FullName). Fixed bug #76630 (additionally crefs).
545
546 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
547
548         * doc.cs : when there was no '.' in cref to methods in doc comment,
549           then parameters were missing in the output. Fixed bug #76691.
550
551 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
552
553         * driver.cs : don't output docs when there is an error.
554           Fixed bug #76693.
555
556 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
557
558         * doc.cs :
559           Now it should detect indexers. Fixed primary concern in bug #76685.
560           Fixed CS0419 message to not show the identical member signature in
561           the message.
562
563 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
564
565         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
566           instead of Type.FindMembers() since it does not handle events.
567           Fixed bug #71604.
568
569 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
570
571         * codegen.cs: Fixed typo (speficied -> specified).
572
573 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
574
575         Fix #76369.
576         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
577
578 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
579
580         * attribute.cs: Changed error message.
581
582         * cs-tokenizer.cs: One more check.
583
584 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
585
586         * statement.cs (Block.Resolve): Ignore empty statement.
587
588 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
589
590         * report.cs: Made error/warning methods more strict to avoid
591         their misuse.
592
593         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
594         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
595         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
596         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
597
598 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
599
600         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
601         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
602
603         * class.cs (TypeContainer.IsComImport): New property.
604         (Constructor.Define): Create proper ctor for ComImport types.
605
606         * expression.cs (New.CheckComImport): Fixed.
607
608 2005-11-07  Miguel de Icaza  <miguel@novell.com>
609
610         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
611         that a parameter has been captured does not mean that we do not
612         have to do the rest of the processing.  This fixes the second part
613         of #76592.  If there was another anonymous method capturing
614         values in the past, the Scope would never be set for the second
615         method that captured the same parameter.
616
617         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
618         properly manipulate the stack.   Second part of fix for #76592.
619
620         * expression.cs (New): Add support for invoking "new" on
621         interfaces that have been flagged with the ComImport attribute and
622         the CoClass.  Fixes #76637 
623
624         * statement.cs (Try.DoEmit): When a variable is captured, do not
625         try to emit the vi.LocalBuilder variable as it has been captured.
626         Create a temporary variable and store the results on the
627         FieldBuilder.  Fixes #76642
628
629 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
630
631         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
632
633         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
634
635         * expression.cs (Binary.DoResolve): Added && optimalization.
636     
637         * typemanager.cs (AddUserType): Removed useless argument.
638
639 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
640
641         * statement.cs (Block.variables): Uses ListDictionary.
642
643 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
644
645         Fix #75969.
646         * class.cs (PartialContainer.EmitType): Customized to emit
647         security attributes.
648         (ClassPart.ApplyAttributeBuilder): Transform security attribute
649         for partial classes.
650
651 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
652
653         Fix #76599.
654         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
655         access has to be fixed.
656         
657         * typemanager.cs (IsUnmanagedType): Wrong common field type.
658
659 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
660
661         Fix #76590.
662         * ecore.cs (NullCast.Reduce): Implemented.
663
664         * expression.cs (ArrayCreation.CheckIndices): Correcly check
665         constant type.
666         
667         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
668         properly.
669         (Foreach.Resolve): Catch null properly.
670
671 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
672  
673         * cs-tokenizer.cs: Warning text fix.
674
675         * driver.cs: AllWarningNumbers exposed on public interface.
676
677         * report.cs (): Reviewed warning numbers.
678         (IsValidWarning): Use binary search.
679
680 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
681  
682         * driver.cs: Implemeted resource visibility.
683         (Resources): New class for code sharing between /res: and
684         /linkres:
685  
686 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
687
688         Fix #76568.
689         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
690         folding.
691         
692         * convert (Convert.ImplicitReferenceConversion): NullCast holds
693         contants only.
694         
695         * ecore.cs (NullCast): Child is contant only.
696         
697         * literal.cs (NullLiteral.Reduce): null can be converted to any
698         reference type.
699
700 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
701
702         * driver.cs: Use Encoding.Default as default code page instead
703           of ISO-28591.
704
705 2005-10-27  Raja R Harinath  <rharinath@novell.com>
706
707         Fix #76085.
708         * expression.cs (Invocation.Error_InvalidArguments): Handle
709         __arglist parameters.
710         (Invocation.VerifyArgumentsCompat): Likewise.
711         * support.cs (ReflectionParameters.GetSignatureForError): Print
712         __arglist parameters.
713         (InternalParamters.GetSignatureForError): Likewise.
714         * parameter.cs (Parameters.GetSignatureForError): Likewise.
715
716 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
717
718         * attribute.cs (GetPropertyValue): Made public.
719
720         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
721         Resolve.
722         Add new property WrapNonExceptionThrows to handle 2.0 assembly
723         attribute.
724         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
725         is not defined.
726         
727         * driver.cs: Reflect method name change.
728         
729         * statement.cs (Try.Resolve): Warn when try has both general
730         exception handlers.
731         
732         * typemanager.cs: runtime_compatibility_attr_type new predefined
733         type.
734
735 2005-10-26  Raja R Harinath  <harinath@gmail.com>
736
737         Fix #76419.
738         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
739         treat it as an empty parameter list.
740
741 2005-10-26  Raja R Harinath  <rharinath@novell.com>
742
743         Fix #76271.     
744         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
745         ResolveAsTypeStep silent.
746         * statement.cs (Block.AddConstant): Mark block as used.
747         (Block.ResolveMeta): Avoid piling on error messages
748         if a constant initializer resolution fails.
749
750 2005-10-25  Raja R Harinath  <rharinath@novell.com>
751
752         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
753         Remove.
754         (NamespaceEntry.VerifyAllUsing): New.
755         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
756         behaviour.  Delegates actual resolution of alias to ...
757         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
758         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
759         Update.
760         * driver.cs (Driver.MainDriver): Update.
761         
762         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
763         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
764         property.
765         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
766         Remove.
767         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
768         RootNamespace.DefineNamespacesForAll.
769
770 2005-10-24  Raja R Harinath  <harinath@gmail.com>
771
772         * typemanager.cs (assemblies, external_aliases, modules)
773         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
774         (ComputeNamespaces, GetRootNamespace): Remove extra staging
775         overhead.  Move resposibility ...
776         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
777         * driver.cs, attribute.cs, codegen.cs: Update to changes.
778
779 2005-10-23  Raja R Harinath  <harinath@gmail.com>
780
781         * namespace.cs (RootNamespace.all_namespaces): Renamed from
782         cached_namespaces.  Improve usage.
783         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
784         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
785         Move from GlobalRootNamespace and simplify.
786         (RootNamespace.Global): Make instance variable.
787         (RootNamespace.RootNamespace): Add "alias name" parameter.
788         (GlobalRootNamespace): Simplify drastically.
789         (Namespace.Lookup): Don't use GetNamespace.
790         * typemanager.cs (GetRootNamespace): Rename from
791         ComputeNamespaceForAlias.
792         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
793
794 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
795
796         * anonymous.cs (AnonymousContainer): Don't crash when container
797         doesn't exist.
798
799 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
800
801         * expression.cs (Binary.DoResolve): Warn when comparing same
802         values.
803
804 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
805
806         Fix #76486.
807         * expression.cs (Binary.DoResolve): It looks like there are no
808         convetsion rules in enum context.
809
810 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
811
812         Add support for extern alias qualifiers.
813         * typemanager.cs: Move some LookupTypeReflection code
814         to namespace.cs, to have cleaner code. Added some methods
815         to help us keep track of the extern aliased references.
816         * driver.cs: Add suport for extern alias assemblies on command
817         line and check for their warnings/errors. Also keep track of the
818         extern aliased assemblies.
819         * namespace.cs: Move the global functionality of Namespace
820         to GlobalRootNamespace/RootNamespace. Now the global namespace
821         is GlobalRootNamespace.Globa. Also the code moved from 
822         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
823         Finally added LocalAliasEntry (AliasEntry before) and
824         ExternAliasEntry, to handle alias statements.
825         * cs-parser.jay: Add support in the grammar for extern alias
826         statement.
827         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
828         Update callings to Namespace (now in GlobalRootNamespace).
829
830 2005-10-18  Raja R Harinath  <rharinath@novell.com>
831
832         Fix #76371.
833         * class.cs (TypeContainer.DefineType): Move updating of
834         topological sort earlier in the code.
835         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
836
837 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
838
839         Fix #76273.
840         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
841         
842         * constant.cs (Constant.TryReduce): Moved from Cast class.
843         (Reduce): Made little bit more OO and fixed missing conversions.
844         
845         * ecore.cs (Reduce): Implemented.
846         (Binary.EnumLiftUp): New method to upgrade values to enum values.
847         
848         * literal.cs (Reduce): Implemented.
849         
850         * class.cs: Reverted Miguel's wrong commit.
851
852 2005-10-14  Miguel de Icaza  <miguel@novell.com>
853
854         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
855
856 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
857
858         * cs-parser.jay, expression.cs : CS0214 was missing error location
859           for constants. Fixed bug #76404.
860
861 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
862
863         Fix #76370.
864         * convert.cs (ExplicitConversionCore): Fixed object->enum
865         conversion.
866
867 2005-10-10  Raja R Harinath  <rharinath@novell.com>
868
869         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
870         InstanceExpression.
871         (PropertyExpr.EmitCall): Likewise.
872         * expression.cs (Invocation.EmitArguments): Handle case where
873         arguments == null.
874         (Invocation.EmitCall): Avoid allocating temporary variable if
875         there are no arguments.
876
877 2005-10-07  Raja R Harinath  <rharinath@novell.com>
878
879         Fix #76323.
880         * convert.cs (ImplicitConversionStandard): Move conversion of
881         void* to arbitrary pointer types ...
882         (ExplicitConversionStandard): .. here.
883         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
884         error to always print typenames.
885
886 2005-10-07  Raja R Harinath  <rharinath@novell.com>
887
888         * convert.cs (GetConversionOperator): Rename from
889         GetConversionOperators.  Move operator selection code from ...
890         (UserDefinedConversion): ... here.
891
892 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
893
894         * convert.cs (ExplicitConversionCore): Removed duplicate enum
895         conversion.
896
897 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
898
899         * assign.cs (Assign.DoResolve): Error method changed.
900
901         * cfold.cs (DoConstantNumericPromotions): Error method changed.
902         
903         * const.cs (ResolveValue): Reset in_transit immediately.
904         
905         * constant.cs: Error method changed.
906         
907         * convert.cs: Removed useless location parameter.
908         (ExplicitNumericConversion): Don't do double enum check.
909         (ExplicitConversionCore): Renamed from ExplicitConversion.
910         (ExplicitUnsafe): Extracted from ExplicitConversion.
911         (ExplicitConversion): Uses for error reporting.
912         
913         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
914         error messages.
915         (ResolveBoolean): Uses common error method.
916         (CastToDecimal): Get rid of ec.
917         (CastFromDecimal): Optimized.
918         (ConvCast): Get rid of ec.
919         
920         * enum.cs (ResolveValue): Reset in_transit immediately.
921         (Emit): Return after first error.
922         
923         * expression.cs: Convert changes.
924         
925         * literal.cs: Error method changed.
926         
927         * statement.cs: Error method changed.
928
929 2005-10-03  Raja R Harinath  <rharinath@novell.com>
930
931         * support.cs (SeekableStreamReader.Position): Don't error out when
932         the requested position is just beyond the end of the current
933         buffered data.
934
935 2005-09-28  Raja R Harinath  <rharinath@novell.com>
936
937         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
938         try to keep in sync with the byte count of the underlying Stream.
939         However, this limits us to a window size of 2048 characters: i.e.,
940         the maximum lookahead of our lexer/parser can be 2048 characters.
941
942 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
943
944         Fix #76255.
945         * driver.cs: Fix compilation files with full root path.
946
947 2005-09-25  Miguel de Icaza  <miguel@novell.com>
948
949         * report.cs (SymbolRelatedToPreviousError): Format the output so
950         it does not use an open parenthesis that is never closed. 
951
952         * driver.cs: Follow coding guidelines
953
954 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
955
956         Fix #72930.
957         * const.cs (Const.ResolveValue): Check for assigning non-null
958         value to reference type.
959
960 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
961
962         * anonymous.cs: Implemented ExprClassName.
963         
964         * assign.cs (Assign.DoResolve): Don't chrash when type is not
965         delegate.
966         
967         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
968         check.
969         
970         * class.cs (StaticClass.DefineContainerMembers): Report protected
971         members as error.
972         
973         * codegen.cs: if(ed) PRODUCTION.
974         
975         * convert.cs (Error_CannotImplicitConversion): Better error
976         distinction.
977         
978         * cs-parser.jay: More error checks.
979         
980         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
981         
982         * driver.cs (CSCParseOption): Enabled wrong option check.
983         
984         * ecore.cs (Expression.ExprClassName): Turned to property.
985         (MemberExpr.CheckIntermediateModification): For checking boxed
986         value types     modification.
987         
988         * statement.cs (Fixed.Resolve): Expression type must be
989         convertible to fixed type.
990         (CollectionForeach.GetEnumeratorFilter,TryType):
991         Small refactoring for easier error checking.
992
993 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
994
995         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
996         attributes.
997         
998         * class.cs (GeneratedBaseInitializer): New class for customization
999         compiler generated initializers.
1000         (MemberBase.DoDefine): Check Obsolete attribute here.
1001         (FieldMember.DoDefine): Ditto.
1002         
1003         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1004         constants.
1005         
1006         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1007         (MemberCore.GetObsoleteAttribute): Removed argument.
1008         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1009         (MemberCore.CheckObsoleteType): New helper.
1010         
1011         * delegate.cs,
1012         * enum.cs,
1013         * statement.cs: Updates after MemberCore changes.
1014         
1015         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1016         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1017         
1018         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1019         obsolete attribute for compiler construct.
1020         (As.DoResolve): Cache result.
1021         
1022         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1023
1024 2005-09-26  Raja R Harinath  <rharinath@novell.com>
1025
1026         Fix #76133.
1027         * expression.cs (This.VerifyFixed): In a value type T, the type of
1028         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
1029         value type R, 'this' is treated as a value parameter.
1030
1031 2005-09-22  Miguel de Icaza  <miguel@novell.com>
1032
1033         * statement.cs (Lock): Use the TemporaryVariable class instead of
1034         manually using local variables as those do not work when variables
1035         are captured.
1036
1037         * ecore.cs: Moved the TemporaryVariable class from being a nested
1038         class inside Foreach to be a public class that can be employed in
1039         other places. 
1040
1041 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
1042
1043         * cs-parser.jay: interface_accessors replaced by
1044         accessor_declarations.
1045
1046         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1047         location.
1048         
1049         * statement.cs (GotoCase.Resolve): Convert null constant to
1050         null case.
1051         (SwitchLabel.ResolveAndReduce): Ditto.
1052         (SwitchLabel.NullStringCase): Custom null stamp.
1053         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1054         
1055         typemanager.cs (CSharpSignature): Don't skip first argument
1056         for full names.
1057
1058 2005-09-18  Miguel de Icaza  <miguel@novell.com>
1059
1060         * driver.cs: Set InEmacs based on the environment variable EMACS. 
1061
1062         * location.cs (InEmacs): in this mode, do not report column
1063         location as it confuses Emacs.
1064
1065 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
1066
1067         * cfold.cs, constant.cs, convert.cs, ecore.cs,
1068         expression.cs, iterators.cs, literal.cs: Store constants and
1069         literals location.
1070         
1071         * class.cs (MemberBase.ShortName): Pass location.
1072         
1073         * cs-parser.jay: Some location fixes.
1074         
1075         * ecore.cs (Expression.Location): Made virtual.
1076
1077 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1078
1079         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1080         if the underlying types are the same, otherwise we need to produce
1081         code that will do the proper cast.
1082
1083         This was exposed by Marek's constant rewrite which produced
1084         invalid code for the call site:
1085
1086         enum X : long { a }
1087         void Method (X v) {}
1088
1089         Method ((X) 5)
1090
1091         This fixes test-49.cs
1092
1093 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1094
1095         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1096           Type/Object should be allowed as well. Fixed bug #75968.
1097
1098 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1099
1100         * expression.cs : (Binary.DoResolve): when one is enum constant and
1101           another is constant 0, then return enum one *as enum type*.
1102           Fixed bug 74846.
1103
1104 2005-09-02  Raja R Harinath  <rharinath@novell.com>
1105
1106         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1107         internal.
1108
1109         Fix #75941.
1110         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1111         flow-branching for LocalVariableReferences in case we were invoked
1112         from a MemberAccess.
1113         * expression.cs (LocalVariableReference.VerifyAssigned): New.
1114         Carved out of ...
1115         (LocalVariableReference.DoResolveBase): ... this.
1116         (MemberAccess.Resolve): Do the check that was disabled during
1117         SimpleNameResolve.
1118
1119 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1120
1121         * class.cs :
1122           (PartialContainer.Create): check abstract/sealed/static strictly
1123           but abstract/sealed can exist only at one side. Fixed bug #75883.
1124
1125 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
1126
1127         Fix #75945.
1128         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1129         specified, don't default to UnmanagedType.I4.
1130
1131 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1132
1133         * expression.cs : conditional operator should check possibly
1134           incorrect assign expression. Fixed bug #75946.
1135
1136 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
1137
1138         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
1139           Reverting the change. gmcs is much complex than mcs on this matter.
1140
1141 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
1142
1143         * cs-tokenizer.cs : To read another token ahead of the actual 
1144           consumption, use new SavedToken and cache token instead of moving
1145           back the stream with SeekableStreamReader (it seemed problematic).
1146         * cs-parser.jay,
1147           driver.cs : Thus use StreamReader directly.
1148         * support.cs : Thus removed SeekableStreamReader.
1149
1150 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1151
1152         Fix #75934.
1153         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
1154         (ScopeInfo.EmitScopeType): Use it to construct field names from
1155         names of captured locals.
1156
1157         Fix #75929.
1158         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
1159         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
1160         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
1161         (ExplicitConversion): Remove enum cases already handled by
1162         implicit conversion.  Move implicit conversion check to the beginning.
1163         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
1164         * expression.cs (ArrayCreation.EmitDynamicInitializers):
1165         Don't treat System.Enum as a struct.
1166
1167 2005-08-30  Jb Evain  <jbevain@gmail.com>
1168
1169         * attribute.cs: handles as expression in parameters.
1170
1171 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1172
1173         Fix #75802.
1174         * class.cs (TypeContainer.VerifyClsName): Don't use a
1175         PartialContainer when verifying CLS compliance.
1176         (AbstractPropertyEventMethod): Set Parent here, ...
1177         (PropertyMethod): ... not here.
1178
1179 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
1180
1181         * attribute.cs : escaped attribute name should not be allowed to be
1182           resolved (e.g. @class as classAttribute). Fixed bug #75930.
1183
1184 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1185
1186         Fix #75927.
1187         * convert.cs (ImplicitStandardConversionExists): Allow zero also
1188         when converting a long constant to unsigned long.
1189         * expression.cs (Invocation.OverloadResolve): Add sanity check to
1190         detect where IsApplicable and VerifyArgumentsCompat disagree.
1191
1192 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1193         and Carlos Alberto Cortez  <carlos@unixmexico.org>
1194
1195         Fix #75848.
1196         * class.cs (TypeContainer.CanElideInitializer): New helper.
1197         (TypeContainer.EmitFieldInitializers): Use it to determine if we
1198         can safely emitting the initializer of a field.
1199
1200 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1201
1202         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1203           allowed inside a switch (without loop). Fixed bug #75433.
1204
1205 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
1206
1207         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1208         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1209
1210 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1211
1212         * driver.cs : kinda reverting the default encoding changes (not exact 
1213           revert since I noticed that "codepage:reset" might not work fine).
1214
1215 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1216
1217         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1218           Location. Now getter and setter store location correctly.
1219           (errors/cs0111-12.cs now reports the expected location.)
1220
1221 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1222
1223         * driver.cs : Use default encoding on the environment.
1224           Removed (now that) extra parameter for SeekableStreamReader.
1225         * support.cs : (SeekableStreamReader) third .ctor() argument for
1226           StreamReader is not required (always true). preamble size could
1227           be acquired in simpler and safe way.
1228
1229 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1230
1231         * cs-parser.jay: report CS0642 at warning level 3
1232           and report CS0642 for an if else statement also
1233           fixes bug #74745. Patch by John Luke (and a bit
1234           modified by me).
1235           Removed extra CS0642 warning check for "while",
1236           "for" and "fixed".
1237         * statement.cs: In Block.Resolve(), CS0642 check
1238           is reimplemented to check a sequence of an empty
1239           statement and a block.
1240
1241           Both fix bug #66777.
1242
1243 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
1244
1245         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
1246         detection until I fix it.
1247         
1248         * cs-tokenizer.cs: Changed error message.
1249         
1250         * cs-parser.jay: Fixed 2 error locations.
1251         
1252         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1253         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1254         properties.
1255         
1256         * enum.cs (GetSignatureForError): Fixed.
1257         
1258         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1259         method detection.
1260         
1261         * class.cs,
1262         * typemanager.cs (RegisterProperty): Removed.
1263         
1264         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1265
1266 2005-08-24  Raja R Harinath  <rharinath@novell.com>
1267
1268         Fix #75874.
1269         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1270         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1271
1272 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1273
1274         * expression.cs : tiny fix is required for not warning positive ulong.
1275           See test-441.cs.
1276
1277 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1278
1279         * expression.cs : add CS0652 check for constant and integral
1280           expression. Fixed bug #53974.
1281
1282 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1283
1284         * expression.cs : in DoNumericPromotions(), check if there is implicit
1285           conversion overload for string (to check CS0034). Fixed bug #52492.
1286
1287 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1288
1289         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1290
1291 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1292
1293         * ecore.cs : report location when it is *not* Null.
1294
1295 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1296
1297         * codegen.cs,
1298           ecore.cs,
1299           flowanalysis.cs,
1300           expression.cs:
1301           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1302           correctly. Fixed bug #75721.
1303
1304 2005-08-23  Raja R Harinath  <rharinath@novell.com>
1305
1306         * support.cs (SeekableStreamReader.Position): Avoid an expensive
1307         loop that performs 'min (pos, char_count)'.
1308
1309         Fix #75862.
1310         * expression.cs (Unary.ResolveOperator): Don't discard implicit
1311         converted value in Operator.OnesComplement.
1312
1313 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
1314
1315         * anonymous.cs: If the anon method is pulled into a helper class,
1316         it needs to be `internal' not `private'. Fixes runtime behavior on
1317         msft. bug #75704
1318
1319 2005-08-20  Martin Baulig  <martin@ximian.com>
1320
1321         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1322         scope if we don't already have it.
1323
1324         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1325         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1326         fixes #75867.
1327
1328 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
1329
1330         Fix #75803
1331         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1332         is a partial class.
1333
1334 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
1335
1336         The big constants rewrite
1337         Fix #75746, #75685 and more
1338         As a side effect saved 1MB for MWF ;-)
1339         
1340         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1341         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1342         enum based for corlib compilation.
1343         
1344         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1345         subtractions.
1346         
1347         * class.cs (FixedField.Define): Use ResolveAsConstant.
1348         
1349         * const.cs (IConstant): Interface constants and enums.
1350         (Const.ResolveValue): New method for constant resolvning.
1351         (ExternalConstant): Constants from imported assemblies.
1352         
1353         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1354         conversion; like enums.
1355         (Constant.ToType): Converts this constant to different type.
1356         (Constant.Increment): Adds 1.
1357         
1358         * convert.cs (ImplicitConversionRequired): Simplified.
1359         
1360         * cs-parser.jay: Create EnumMember directly.
1361         
1362         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1363         
1364         * doc.cs (GenerateEnumDocComment): Removed.
1365         
1366         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1367         (ConvertIntLiteral): Removed.
1368         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1369         
1370         * enum.cs (EnumMember): Implement IConstant.
1371         (Enum.IsValidEnumConstant): Removed.
1372         (Enum.GetNextDefaultValue): Removed.
1373         (Enum.FindMembers): Updated.
1374         (Enum.GenerateDocComment): Iterate enum members.
1375         
1376         * expression.cs (Cast.TryReduce): Handle enums correctly.
1377         (New.Constantify): Made public.
1378         (MemberAccess.DoResolve): Removed contant specific if(s).
1379         
1380         * literal.cs (NullLiteral): Implement new abstract methods.
1381         
1382         * statement.cs (GotoCase.Resolve): Use new constant methods.
1383         (SwitchLabel.ResolveAndReduce): Use new constant methods.
1384         
1385         * typemanager.cs (LookupEnum): Removed.
1386         (IsEnumType): Fixed to work with corlib.
1387         (RegisterConstant): Removed.
1388         (LookupConstant): Removed.
1389         (GetConstant): Changed to work with IConstant.
1390
1391 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
1392
1393         * location.cs : Fixed overflown (>255) column number.
1394
1395 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1396
1397         First cut of the qualified-alias-member feature.
1398         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1399         token.
1400         * cs-parser.jay (DOUBLE_COLON): New token.
1401         (namespace_or_type_name): Add rule for recognizing
1402         qualified-alias-members.
1403         (primary_expression): Likewise.
1404         (element_access): Allow QualifiedAliasMember as a possible
1405         type-bearing expression.
1406         (local_variable_type, local_variable_pointer_type): Likewise.
1407         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1408         aliases in the current and enclosing namespace declarations.
1409         (NamespaceEntry.UsingAlias): Add CS0440 warning.
1410         * decl.cs (MemberName.is_double_colon): New.
1411         (MemberName.MemberName): Add new constructor for alias-member.
1412         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1413         * expression.cs (QualifiedAliasMember): New expression type.
1414
1415 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1416
1417         * location.cs : it borked when no argument was specified.
1418
1419 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1420
1421         * location.cs : tiny ToString() format fix.
1422
1423 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1424
1425         * statement.cs : oops, it was missing.
1426
1427 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1428
1429         A set of fixes for precise line/column location.
1430
1431         * location.cs :
1432           "token" field now holds a file/line "delta", a line number offset 
1433           from the segment, and a column number. See also:
1434           http://lists.ximian.com/pipermail/mono-devel-list/2004-
1435           December/009508.html
1436           Removed static IsNull. Use instance IsNull property instead.
1437         * cs-tokenizer.cs :
1438           For some tokens it stores Location. For Identifier it stores
1439           LocatedToken which is a pair of string name and location.
1440           Column numbers are adjusted only at getChar().
1441         * report.cs :
1442           Use Location.ToString() for reporting (it now contains column).
1443         * cs-parser.jay :
1444           Largely modified to use LocatedToken instead of
1445           string (IDENTIFIER), and to acquire Location from some tokens.
1446         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1447           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1448           codegen.cs :
1449           Now MemberName holds Location. DeclSpace.ctor() receives Location
1450           as a parameter. Removed extra parameters to all derived classes.
1451           Replaced Location.IsNull() with instance property.
1452         * assign.cs, expression.cs :
1453           Added .ctor() overload that omits Location.
1454         * attribute.cs :
1455           Added "nameEscaped" flag that indicates the identifier was escaped
1456           in the source file. This fixes bug #57047.
1457
1458 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
1459
1460         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1461         New method, looking for lo-case imported cls type.
1462
1463         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1464         here.
1465
1466         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1467
1468         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1469
1470         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1471         all_imported_types.
1472         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1473
1474         Optimized to save 3.5 MB for SWF compilation.
1475
1476 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1477
1478         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1479         (PartialContainer.Create): Moved logic AddToContainer.
1480         (PartialContainer.MarkForDuplicationCheck): Shares name.
1481         
1482         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1483         place.
1484         
1485         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1486         initialization.
1487         (Namespace.GetSignatureForError): New method.
1488         
1489         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1490         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1491
1492 2005-08-01  Raja R Harinath  <rharinath@novell.com>
1493
1494         Fix #75669.
1495         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1496         member lookup rather than qualifier_type, since qualifier_type can
1497         be null.
1498
1499 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1500
1501         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1502         enum member.
1503
1504 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1505
1506         * statement.cs: Copy the local exception into the exception
1507         captured local.  Fixes 75674
1508
1509 2005-07-31  Raja R Harinath  <harinath@gmail.com>
1510
1511         Fix #75658.
1512         * expression.cs (Invocation.OverloadResolve): Don't report error
1513         CS1501 if error CS1502 has been reported.
1514         (New.DoResolve): Delegate CS1501 reporting to
1515         Invocation.OverloadResolve.
1516
1517         Fix #75656.
1518         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1519         invariant-meaning-in-block property in an enclosing block if
1520         necessary.
1521
1522 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
1523
1524         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1525         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1526         (Switch.CheckSwitch): Just save 50kb for SWF.
1527
1528 2005-07-27  Martin Baulig  <martin@ximian.com>
1529
1530         * anonymous.cs (CaptureContext.AddField): Added
1531         `AnonymousContainer am' argument; compute its toplevel scope if
1532         it's not already computed.  Fixes #75649.
1533
1534 2005-07-26  Raja R Harinath  <rharinath@novell.com>
1535
1536         Fix #75628.
1537         * class.cs (Constructor.Emit): Reset block to null if the block
1538         resolve fails.
1539
1540 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1541
1542         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1543
1544 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1545
1546         * class.cs (MethodData.Define): Check whether accessor implementing
1547         interface is public.
1548
1549         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1550
1551 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
1552
1553         Fix #57245
1554         * namespace.cs (LookupType): Moved same type check to...
1555         
1556         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1557         with the same name.
1558
1559 2005-07-21  Raja R Harinath  <rharinath@novell.com>
1560
1561         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1562         already found a typebuilder.
1563         * class.cs (MethodCore.IsDuplicateImplementation): Compare
1564         MemberNames, not strings.
1565
1566         * const.cs (Error_ExpressionMustBeConst): 
1567         Rename from Error_EpressionMustBeConst.
1568         * const.cs, class.cs, statement.cd: Update.
1569
1570 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
1571
1572         Fix #65573
1573
1574         * const.cs (Const.LookupConstantValue): Report missing contant expression
1575         everytime.
1576         (Error_EpressionMustBeConstant): Only one error method.
1577
1578         * class.cs, statement.c: Updated.
1579
1580 2005-07-20  Raja R Harinath  <rharinath@novell.com>
1581
1582         * statement.cs (Block.Flags): Add back HasVarargs.
1583         (Block.flags): Make protected.
1584         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1585
1586         * typemanager.cs (types, typecontainers, user_types): Remove.
1587         (UserTypes, TypeContainers): Likewise.
1588         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1589         (CleanUp, Reset): Update.
1590         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
1591         (GetNestedType): Use Type.GetNestedType.
1592         (CoreLookupType): Take two arguments, the namespace and the
1593         basename of the type.  Update to use the Namespace.Lookup
1594         mechanism.
1595         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1596         (RealMemberLookup): Use IsNestedChildOf instead of playing with
1597         string concatenation and substring matches.
1598         * class.cs, enum.cs, delegate.cs: Update to changes.
1599
1600 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
1601
1602         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1603         Expression and made virtual.
1604
1605         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1606         (ImplicitStandardConversionExists): Fixed `byte' typo ?
1607
1608         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1609
1610         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1611         error message.
1612
1613         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1614         change.
1615
1616 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
1617
1618         Fix #57707
1619         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1620         AssemblyCultureAttribute is not used on executable.
1621
1622         * rootcontext.cs,
1623         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1624
1625 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1626
1627         Fix #60638.
1628         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1629         New.  Reports CS0252/CS0253.
1630         Mostly taken from preliminary patch by Duncak Mak.
1631         (Binary.DoResolveOperator): Store results of operator lookup.
1632         Use them to detect if we need to warn about unintended reference
1633         comparisons.
1634
1635 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1636
1637         Fix #72969.
1638         * namespace.cs (Namespace.Lookup): Add back location parameter.
1639         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1640         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1641
1642         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1643         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1644         (Namespace.LookupType): ... this.
1645         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1646         of namespaces.
1647         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1648         purported to handle pointers.
1649         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1650         CoreLookupType.
1651
1652 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1653
1654         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1655         type as namespace.
1656
1657 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1658
1659         * namespace.cs (Namespace.Lookup): Drop location parameter.
1660         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1661         (NamespaceEntry.Lookup): ... this.
1662         (NamespaceEntry.Error_AmbiguousTypeReference):
1663         Move here from DeclSpace.
1664         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1665         names ...
1666         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1667         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1668         Move to NamespaceEntry.
1669         * delegate.cs, expression.cs: Update to changes.
1670
1671 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1672
1673         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1674         CheckAttributeType and refactored.
1675         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1676         ResolveAsTypeTerminal error handling.
1677         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1678         handling.
1679         (GetSignatureForError): Print errors in same way.
1680
1681         * class.cs,
1682         * codegen.cs: Reflect attribute GetSignatureForError change.
1683
1684         * ecore.cs,
1685         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1686
1687         * namespace.cs (UsingEntry): Refactored to make fields private.
1688
1689         * assign.cs,
1690         statement.cs: Error_UnexpectedKind has extra parameter.
1691
1692 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1693
1694         * ecore.cs (IAlias): Remove.
1695         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1696         that implement the interface.
1697         * namespace.cs (Namespace): Likewise.
1698         (Namespace.declspaces): Renamed from 'defined_names'.
1699         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1700         DeclSpace instead of an IAlias.
1701         * tree.cs (Tree.AddDecl): Update.
1702
1703 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1704
1705         * statement.cs (Block.Flags); Remove HasVarargs.
1706         (Block.HasVarargs): Move to ToplevelBlock.
1707         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1708         (Block.Variables): Make protected.  Initialize variable hashtable
1709         if necessary.
1710         (Block.AddVariable): Update.
1711         (Block.Resolve): Update to changes.
1712         (ToplevelBlock.HasVarargs): New boolean.
1713         (ToplevelBlock.ThisVariable): Move here from Block.
1714         (ToplevelBlock.AddThisVariable): Likewise.
1715         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1716         * expression.cs (This.ResolveBase): Update to changes.
1717         (ArglistAccess.DoResolve): Likewise.
1718
1719 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1720
1721         Fix #75321
1722         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1723
1724         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1725         not used and not used & assigned.
1726         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1727
1728 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1729
1730         Fix #75053
1731         * expression.cs (Is.DoResolve): null is never provided type.
1732
1733 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1734
1735         Fix #52496
1736         * cs-parser.jay: Less strict event error rule to catch more errors.
1737
1738 2005-07-08  Martin Baulig  <martin@ximian.com>
1739
1740         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1741         gettter (allowed) or setter (not allowed).
1742
1743         * class.cs (Accessor): Implement IIteratorContainer.
1744         (Accessor.Yields): New public field.
1745         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1746         per-accessor basis.
1747
1748         * cs-parser.jay
1749         (get_accessor_declaration, set_accessor_declaration): Set the
1750         `yields' flag on the accessor, not the property.
1751         (property_declaration): Do the iterators check on a per-accessor
1752         basis and not for the whole property.
1753
1754 2005-07-08  Martin Baulig  <martin@ximian.com>
1755
1756         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1757         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1758
1759 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1760
1761         Fix #74975
1762         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1763         (ExtractSecurityPermissionSet): Cope with self referencing security
1764         attributes properly.
1765
1766         * driver.cs (SetOutputFile): Made public property OutputFile.
1767
1768 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1769
1770         Fix #75486.
1771         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1772         has_nonstatic_fields.  Make into a FieldBase pointer.
1773         (TypeContainer.AddField): Add CS0282 check.
1774         (TypeContainer.EmitType): Update.
1775
1776 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1777
1778         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1779         compare if they start with __.
1780
1781 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1782
1783         * statement.cs (Switch.SwitchGoverningType): Only look at
1784         UserCasts that don't need implicit standard conversions to one of
1785         the allowed switch types (Fixes test-322.cs).
1786         (LocalInfo.Resolve): Re-enable sanity-test.
1787
1788 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1789
1790         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1791         
1792         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1793         
1794         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1795
1796 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1797
1798         Fix #75472.
1799         * ecore.cs (SimpleName.GetSignatureForError): Add.
1800         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1801         (MemberAccess.GetSignatureForError): Add.
1802
1803 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1804  
1805         The big error and warning messages review.
1806         
1807         * anonymous.cs,
1808         * assign.cs,
1809         * attribute.cs,
1810         * class.cs,
1811         * codegen.cs,
1812         * convert.cs,
1813         * cs-parser.jay,
1814         * cs-tokenizer.cs,
1815         * decl.cs,
1816         * delegate.cs,
1817         * doc.cs,
1818         * driver.cs,
1819         * ecore.cs,
1820         * enum.cs,
1821         * expression.cs,
1822         * flowanalysis.cs,
1823         * iterators.cs,
1824         * literal.cs,
1825         * location.cs,
1826         * modifiers.cs,
1827         * namespace.cs,
1828         * parameter.cs,
1829         * pending.cs,
1830         * report.cs,
1831         * rootcontext.cs,
1832         * statement.cs,
1833         * support.cs,
1834         * tree.cs,
1835         * typemanager.cs: Updated.
1836         
1837         * class.cs: (MethodCore.SetYields): Moved here to share.
1838         (PropertyMethod.Define): Moved iterator setup here.
1839         
1840         * iterators.cs: Add orig_method to have full access to parent
1841         container.
1842
1843 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1844
1845         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1846         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1847         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1848         variable of struct type.
1849         * expression.cs (Unary.ResolveOperator): Update to change.
1850         (Indirection.VerifyFixed): Likewise.
1851         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1852         (ParameterReference.VerifyFixed): Value parameters are fixed.
1853         (This.VerifyFixed): Treat 'this' as a value parameter.
1854         * statement.cs (LocalInfo.IsFixed): Remove.
1855
1856 2005-07-01  Martin Baulig  <martin@ximian.com>
1857
1858         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1859         `ec.EmitThis ()' to get the correct scope.
1860
1861 2005-07-01  Martin Baulig  <martin@ximian.com>
1862
1863         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1864         instance is a ParameterReference; fixes #75299.
1865
1866 2005-07-01  Martin Baulig  <martin@ximian.com>
1867
1868         Reverted Marek's latest patch (r46725):
1869         - it contains structural changes which are neither mentioned in
1870           the ChangeLog nor explained anywhere; for example the additional
1871           argument of EmitContext's and Iterator's .ctor's and the
1872           TypeContainer.DefineMembers() change.
1873         - structural changes like this should go in in seperate patches
1874           and not be hidden in a huge patch which just seems to affect
1875           warnings and errors.
1876           a big and hard to understand patch.
1877         - it breaks iterators and causes regressions, for instance in
1878           test-iter-03.cs.      
1879
1880 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1881
1882         Fix #75412.
1883         * expression.cs (Indexers.map): Remove.
1884         (Indexers.Append): Filter out inaccessible setters and getters.
1885         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1886
1887         Fix #75283.
1888         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1889         Refactored from ...
1890         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1891         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1892         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1893         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1894
1895 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1896
1897         Fix #75322
1898         * class.cs (FieldBase.GetInitializerExpression): One more field
1899         for backup.
1900
1901 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1902
1903         * pending.cs: Do not define a proxy if the base method is virtual,
1904         it will be picked up by the runtime (bug 75270).
1905
1906 2005-06-08  Martin Baulig  <martin@ximian.com>
1907
1908         The big Iterators rewrite :-)
1909
1910         * iterators.cs: Rewrite this to use the anonymous methods framework.
1911
1912         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1913         before the TypeContainers; see 2test-21.cs.
1914
1915         * class.cs
1916         (TypeContainer.DefineType): Don't create a new EmitContext if we
1917         already have one (this only happens if we're an Iterator).
1918         (TypeContainer.Define): Also call Define() on all our iterators.
1919         (Method.CreateEmitContext): Added support for iterators.
1920
1921         * anonymous.cs
1922         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1923         (AnonymousContainer.CreateMethodHost): Moved here from
1924         AnonymousMethod and made abstract.
1925         (AnonymousContainer.CreateScopeType): New abstract method.
1926         (AnonymousContainer.IsIterator): New public property.
1927         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1928         get the ScopeTypeBuilder rather than manually defining it here. 
1929         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1930         iterators here.
1931
1932         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1933         before RootContext.DefineTypes().
1934
1935         * codegen.cs (EmitContext.RemapToProxy): Removed.
1936         (EmitContext.CurrentAnonymousMethod): Changed type from
1937         AnonymousMethod -> AnonymousContainer.
1938         (EmitContext.ResolveTopBlock): Protect from being called twice.
1939         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1940         (EmitContext.EmitThis): Removed the iterators hacks; use the
1941         anonymous methods framework for that.
1942
1943         * statement.cs
1944         (ToplevelBlock.Container): Make this a property, not a field.
1945         (ToplevelBlock.ReParent): New public method; move the
1946         ToplevelBlock into a new container.
1947         (Foreach.TemporaryVariable): Simplify.
1948
1949 2005-06-05  Martin Baulig  <martin@ximian.com>
1950
1951         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1952         (Block.AddTemporaryVariable): New public method; creates a new
1953         `LocalInfo' for a temporary variable.
1954         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1955         variables here.
1956         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1957         non-iterator variables.
1958
1959 2005-06-05  Martin Baulig  <martin@ximian.com>
1960
1961         * statement.cs (Foreach.TemporaryVariable): Create the
1962         LocalBuilder in the Emit phase and not in Resolve since in some
1963         situations, we don't have an ILGenerator during Resolve; see
1964         2test-19.cs for an example.
1965
1966 2005-06-04  Martin Baulig  <martin@ximian.com>
1967
1968         **** Merged r45395 from GCS ****
1969
1970         The big Foreach rewrite - Part II.
1971
1972         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1973         with `PropertyInfo ienumerator_getcurrent'.
1974
1975         * codegen.cs (VariableStorage): Removed.
1976
1977         * statement.cs
1978         (Foreach): Derive from Statement, not ExceptionStatement.
1979         (Foreach.CollectionForeach): New nested class.  Moved all the code
1980         dealing with collection foreach here.
1981         (Foreach.ForeachHelperMethods): Removed.
1982         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1983
1984 2005-05-23  Martin Baulig  <martin@ximian.com>
1985
1986         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1987         don't need to.  Fix #75014.
1988
1989 2005-05-20  Martin Baulig  <martin@ximian.com>
1990
1991         Merged r44808 from GMCS.
1992
1993         * class.cs (TypeContainer.CircularDepException): Removed.
1994         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1995         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1996         (CS0146) and interface (CS0529) dependencies here.
1997
1998 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1999
2000         * expression.cs (Invocation.EmitCall): Fix initialization
2001         'this_call' to reflect current behaviour.  Fix indentation.
2002
2003         * convert.cs (FindMostEncompassedType): Add two trivial special
2004         cases (number_of_types == 0 || number_of_types == 1).
2005         (FindMostEncompasingType): Likewise.
2006
2007 2005-06-17  Raja R Harinath  <rharinath@novell.com>
2008
2009         Some cleanups preparing for the fix of #75283.
2010         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2011         error testing.
2012         (EventExpr.InstanceResolve): Likewise.
2013         (EventExpr.DoResolve): Remove redundant checks.
2014
2015 2005-06-10  Duncan Mak  <duncan@novell.com>
2016
2017         * cs-tokenizer.cs (process_directives): New flag for controlling
2018         the processing of preprocessor directives.
2019         (x_token): After seeing a '#', return Token.NONE instead of going
2020         to handle_preprocessing_directive() when not processing
2021         directives. This avoids unnecessary processing during the token peek in
2022         is_punct().
2023
2024         This fixes #74939.
2025
2026         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
2027         the existing error reporting methods instead of Report.Error.
2028
2029         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
2030         after Raja's rewrite.
2031
2032 2005-06-08  Miguel de Icaza  <miguel@novell.com>
2033
2034         * class.cs: Small fix.
2035
2036 2005-06-08  Raja R Harinath  <rharinath@novell.com>
2037
2038         Fix #75160.
2039         * class.cs (GetPartialBases): Fix return value check of
2040         part.GetClassBases.
2041
2042 2005-06-07  Raja R Harinath  <rharinath@novell.com>
2043
2044         Ensure that partial classes are registered in their enclosing
2045         namespace.  Initial part of fix of #75160.
2046         * tree.cs (Tree.RecordDecl): Add new namespace argument.
2047         Register declspace with namespace here, not in
2048         DeclSpace.RecordDecl.
2049         * cs-parser.jay: Pass namespace to RecordDecl.
2050         * class.cs (PartialContainer.Create): Likewise.
2051         (ClassPart.DefineType): New sanity-check.  Throws an exception if
2052         called.
2053         * decl.cs (Declspace.RecordDecl): Remove.
2054         * namespace.cs (NamespaceEntry.DefineName): Remove.
2055
2056 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2057
2058         * rootcontext.cs: Reset TargetExt as well.
2059
2060 2005-06-03  Raja R Harinath  <rharinath@novell.com>
2061
2062         * ecore.cs (Expression.Resolve): Emit CS0654 error when
2063         -langversion:ISO-1.
2064
2065 2005-06-02  Raja R Harinath  <rharinath@novell.com>
2066
2067         Fix #75080, cs0119.cs.
2068         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
2069         of ...
2070         (Expression.Resolve): ... this.  Use it.  Remove bogus code
2071         allowing ExprClass.Type and ExprClass.Namespace for
2072         ResolveFlags.VariableOrValue.
2073         (Expression.Resolve) [1-argument variant]: Change default resolve
2074         flags based on language version.
2075         (Expression.Error_UnexpectedKind): Use a simple string array
2076         rather than an ArrayList.
2077         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2078         not ExprClass.Type.
2079         (TypeOfVoid.DoResolve): Likewise.
2080         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
2081         flags argument -- it always has the same value.
2082
2083 2005-05-31  Raja R Harinath  <rharinath@novell.com>
2084
2085         Fix #75081.
2086         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2087         Use it in the error message.
2088         * assign.cs, expression.cs, statement.cs: Update.
2089
2090 2005-05-30  Raja R Harinath  <rharinath@novell.com>
2091
2092         Fix #75088.
2093         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2094         the "almostMatchedMember" case too.
2095         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2096         that failed the accessibility checks to 'almost_match'.
2097
2098 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
2099
2100         * attribute.cs: Use internal MethodBuilder methods to set
2101         ExactSpelling and SetLastError on PInvoke methods, instead
2102         of passing them via charset.  Fixes #75060.
2103
2104 2005-05-27  Raja R Harinath  <rharinath@novell.com>
2105
2106         * parameter.cs (Parameter): Remove TODO comment.
2107         (Parameter.DefineParameter): Remove Location parameter.
2108         (Parameters.LabelParameters): Likewise.
2109         * class.cs (Constructor.Emit): Update to change.
2110         (MethodData.Emit): Likewise.
2111         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
2112         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2113
2114 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
2115
2116         * parameter.cs,
2117           Removed Parameters.Location and added Parameter.Location instead.
2118           Removed Location parameter from Emit() and GetSignature().
2119         * anonymous.cs,
2120           class.cs,
2121           cs-parser.jay,
2122           delegate.cs,
2123           iterators.cs,
2124           statement.cs :
2125           Modified all related calls.
2126
2127 2005-05-26  Raja R Harinath  <rharinath@novell.com>
2128
2129         Improve user-defined conversion handling.
2130         * convert.cs (GetConversionOperators): Rewrite.  Return only the
2131         applicable operators.
2132         (AddConversionOperators): New.  Helper for GetConversionOperators.
2133         (FindMostEncompassedType, FindMostEncompassingType): Verify that
2134         there is only one most encompassed/encompassing type.
2135         (FindMostSpecificSource, FindMostSpecificTarget): Remove
2136         "applicable operator" handling.
2137         (UserConversion): Move cache here from GetConversionOperators.
2138         Directly cache the chosen operator, rather than the whole
2139         MethodGroup.
2140         (ExplicitNumericConversion): Fix buggy implementation of Decimal
2141         case.  Allow conversion of decimal to sbyte and byte too.
2142         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2143         New static methods.  Used to avoid allocating EmptyExpressions in
2144         convert.cs.
2145
2146 2005-05-24  Duncan Mak  <duncan@novell.com>
2147
2148         * ecore.cs (CastFromDecimal): New class for casting a decimal to
2149         another class, used in Convert.ExplicitNumericConversion.
2150         (CastToDecimal): New class, similar to above, but casts to
2151         System.Decimal, used in Convert.ImplicitNumericConversion and also
2152         in explicit convesion from double/float to decimal.
2153
2154         * convert.cs (ImplicitNumericConversion): Handle implicit
2155         conversions to System.Decimal.
2156         (ExplicitNumericConversion): handle explicit conversions to
2157         System.Decimal.
2158
2159         This fixes #68711.
2160         
2161 2005-05-20  Miguel de Icaza  <miguel@novell.com>
2162
2163         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
2164         know the type at this stage, just break through.   Fixes #75008 
2165
2166 2005-05-19  Martin Baulig  <martin@ximian.com>
2167
2168         * delegate.cs
2169         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2170         to disable error reporting.
2171
2172         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2173         here since we don't want to report an error; see the new test-336.cs.
2174
2175 2005-05-19  Raja R Harinath  <rharinath@novell.com>
2176
2177         * statement.cs (ToplevelBlock.GetParameterReference)
2178         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2179         Move here from class Block.
2180         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2181         * expression.cs (ParameterReference.DoResolveBase): Likewise.
2182
2183 2005-05-18  Martin Baulig  <martin@ximian.com>
2184
2185         Fix #74978.
2186
2187         * flowanalysis.cs
2188         (FlowBranching.Reachability): Add non-static public And() and Or()
2189         methods.
2190         (FlowBranchingSwitch): New class; do the `break_origins' thing
2191         like in FlowBranchingLoop.
2192         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2193         reachability, not just locals and parameters.
2194         (FlowBranching.MergeChild): Remove some of the hacks for loop and
2195         switch; MergeBreakOrigins() now takes care of that.
2196
2197 2005-05-18  Martin Baulig  <martin@ximian.com>
2198
2199         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2200         a loop and may leave it, reset the barrier; fixes #74974.
2201
2202 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
2203         
2204         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2205         is back.
2206         
2207         * cs-parser.jay: Catch more lexical errors.
2208         
2209         * report.cs: Add one more Error method.
2210         
2211         * rootcontext.cs,
2212         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2213
2214 2005-05-17  Martin Baulig  <martin@ximian.com>
2215
2216         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
2217         #70970. 
2218
2219 2005-05-16  Raja R Harinath  <rharinath@novell.com>
2220
2221         Fix test-382.cs.  Emit values of decimal constants.
2222         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
2223         Carved out of ...
2224         (TypeContainer.AddField): ... this.
2225         (TypeContainer.EmitFieldInitializers): Allow the list of fields
2226         with initializers to include 'Const's.
2227         (ClassPart.RegisterFieldForInitialization): Forward to
2228         PartialContainer.
2229         * const.cs (Const.Const): Pass initializer to base class.
2230         (Const.Define): In case of decimal constants, register them for
2231         initialization in a static constructor.
2232
2233 2005-05-14  Martin Baulig  <martin@ximian.com>
2234
2235         * statement.cs (Block.Resolve): Correctly handle unreachable code;
2236         do not call ResolveUnreachable() on unreachable statements in
2237         here, see the comment in the source code.
2238
2239 2005-05-13  Raja R Harinath  <rharinath@novell.com>
2240
2241         Fix #74934.
2242         * expression.cs (BinaryResolveOperator): If one of the operands of
2243         an equality comparison is 'null' and the other is a pointer type,
2244         convert the null to a NullPointer.
2245         * convert.cs (ImplicitReferenceConversion): If the expression is a
2246         NullLiteral and the target type is a pointer type, return a
2247         NullPointer instead.
2248         (ImplicitConversionStandard): Likewise.
2249
2250 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
2251         
2252         * cs-parser.jay: Set readonly context based on special constructs.
2253         
2254         * expression.cs (LocalVariableReference.DoResolveBase): Improved
2255         readonly variable error handling.
2256         
2257         * rootcontext.cs (EmitCode): Don't verify members when error
2258         occurred.
2259         
2260         * statement.cs (LocalInfo): Add reaodnly context information.
2261         (SetReadOnlyContext, GetReadOnlyContext): New methods.
2262
2263 2005-05-13  Raja R Harinath  <rharinath@novell.com>
2264
2265         * statement.cs (Block.Resolve): Revert change below.  Modify fix
2266         for #74041 to initialize 'resolved' to false only for explicit
2267         blocks.  Fixes #74873.
2268
2269 2005-05-12  Raja R Harinath  <harinath@gmail.com>
2270
2271         Fix #74920.
2272         * typemanager.cs (unmanaged_enclosing_types): New.
2273         (IsUnmanagedType): Avoid infloops by using
2274         'unmanaged_enclosing_types' to talk with recursive invocations.
2275
2276 2005-05-13  Martin Baulig  <martin@ximian.com>
2277
2278         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
2279         instance variable, not a local.  Fix #74873.
2280         (Block.ResolveUnreachable): Set it to true here.
2281
2282 2005-05-11  Duncan Mak  <duncan@novell.com>
2283
2284         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
2285         continuing to process for 'arg'.
2286         (handle_preprocessing_directive): Check the argument of the #endif
2287         directive and report error CS1025 if there are any trailing
2288         characters.
2289
2290         According to the C# spec, having even whitespace after the #endif
2291         directive is illegal; however, because we call arg.TrimEnd ()
2292         beforehand, we have the same behavior as csc, allowing whitespace
2293         after the directive.
2294
2295         Fixes #74892.
2296
2297 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
2298
2299         Fix #74863.
2300         
2301         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
2302         (Constructor.GetObsoleteAttribute): Implemented correctly.
2303
2304 2005-05-10  Martin Baulig  <martin@ximian.com>
2305
2306         * support.cs (ReflectionParameters.ParameterModifier): Use
2307         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
2308         and `ParameterAttributes.In'.  Fixes #74884.
2309
2310 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
2311
2312         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
2313         
2314         * expression.cs (Argument.GetParameterModifier): Turned to property.
2315         (Invocation.Error_InvalidArguments): Add more descriptive errors.
2316         
2317         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
2318         its C# equivalent.
2319         
2320 2005-05-09  Raja R Harinath  <rharinath@novell.com>
2321
2322         Fix #74852.
2323         * decl.cs (MemberCache.AddMethods): Register override methods,
2324         rather than non-override methods.
2325         * typemanager.cs (RegisterOverride): New.
2326         (IsOverride): Update.
2327
2328 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
2329
2330         Fix #73105.
2331         
2332         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
2333         recursive declaration.
2334         
2335         * statement.cs (Block.ResolveMeta): Report any error in resolving.
2336         
2337 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
2338
2339         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
2340         
2341         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
2342
2343 2005-05-05  Raja R Harinath  <rharinath@novell.com>
2344
2345         Fix #74797.
2346         * decl.cs (DeclSpace.FamilyAccessible): 
2347         Use TypeManager.IsNestedFamilyAccessible.
2348
2349         Fix reopened #64812.
2350         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
2351         internal'.
2352
2353 2005-05-04  Raja R Harinath  <rharinath@novell.com>
2354             Abin Thomas  <projectmonokochi@rediffmail.com>
2355             Anoob V E  <projectmonokochi@rediffmail.com>
2356             Harilal P R  <projectmonokochi@rediffmail.com>
2357
2358         Fix #64812.
2359         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
2360         allow access to all static members.
2361
2362 2005-05-04  Martin Baulig  <martin@ximian.com>
2363
2364         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
2365
2366 2005-05-04  Martin Baulig  <martin@ximian.com>
2367
2368         Fix #74655.
2369
2370         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
2371         section at the end; make things work if `default' is not the last
2372         section.        
2373
2374 2005-05-04  Martin Baulig  <martin@ximian.com>
2375
2376         Fix #70400.
2377
2378         * statement.cs (Switch): Replaced the `got_default' field with a
2379         `default_section' one.
2380         (Switch.CheckSwitch): Set `default_section' here.
2381         (Switch.Resolve): If we're a constant switch and the constant is
2382         not found, use the default section.
2383
2384 2005-05-03  Martin Baulig  <martin@ximian.com>
2385
2386         * expression.cs (ArrayAccess.EmitGetLength): New public method.
2387
2388         * statement.cs (Foreach.ArrayForeach): New nested class.
2389         (Foreach.TemporaryVariable): New nested class.
2390         (Foreach.EmitArrayForeach): Removed; this is now in the new
2391         ArrayForeach class.
2392
2393 2005-05-03  Raja R Harinath  <rharinath@novell.com>
2394
2395         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
2396         more conservative.
2397         (VerifyPendingMethods): Revert change below.
2398
2399         * typemanager.cs (IsOverride, RegisterNonOverride): New.
2400         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2401         that used to trigger warning -28.  Remove warning -28.
2402         * expression.cs (Invocation.OverloadResolve): Use
2403         TypeManager.IsOverride to distinguish override methods.
2404
2405         Fix #74773.
2406         * pending.cs (VerifyPendingMethods): If a base type implements the
2407         requested interface, don't bother checking individual methods of
2408         the base type.  As a side-effect, this prevents the creation of
2409         unnecessary proxies.
2410
2411 2005-05-02  Martin Baulig  <martin@ximian.com>
2412
2413         Fix #70182.
2414
2415         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2416         Also `And' the locals if the old vector is null.
2417         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2418         null; in this case we basically reset all the variables.        
2419
2420 2005-05-02  Martin Baulig  <martin@ximian.com>
2421
2422         Fix #74529.
2423
2424         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2425         Added `FlowBranching branching' argument; always `and' the
2426         variables instead of `or'ing them unless we're an infinite loop.
2427
2428         * statement.cs (While.Resolve): Create a new sibling unless we're
2429         infinite.       
2430
2431 2005-05-02  Martin Baulig  <martin@ximian.com>
2432
2433         Fix #70140.
2434
2435         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2436         arguments; use it instead of creating a new TopLevelBlock.
2437         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2438         our ConstructorInitializer.
2439
2440         * statement.cs
2441         (TopLevelBlock.TopLevelBranching): New public property.
2442         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2443         and create our `TopLevelBranching'.
2444
2445         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2446         anonymous method host, use `block.TopLevelBranching' rather than
2447         creating a new branching.
2448
2449 2005-04-20  Miguel de Icaza  <miguel@novell.com>
2450
2451         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2452         a ScopeInfo, if any of the current children is a child of the new
2453         entry, move those children there.
2454
2455 2005-04-30  Martin Baulig  <martin@ximian.com>
2456
2457         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2458         at the beginning of a SwitchSection.  Fix #73335.
2459
2460 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
2461
2462         Fix #74378
2463         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2464         
2465         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2466         (FieldExpr.DoResolve): Obsolete members are ignored for field
2467         initializers.
2468         
2469 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
2470
2471         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2472         of arrays detection.
2473
2474         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2475         verification.
2476         (Field.VerifyClsCompliance): Volatile fields are not compliant.
2477
2478         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2479         arrays report.
2480
2481 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
2482
2483         * cs-parser.jay: Use the prefered version of -unsafe in error
2484         message.
2485
2486 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
2487
2488         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2489         circumstances.
2490
2491 2005-04-20  John Luke  <john.luke@gmail.com>
2492
2493         * driver.cs: fix typo in error message, --outout to --output
2494
2495 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2496
2497         * codegen.cs (InRefOutArgumentResolving): New field.
2498         
2499         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2500         fields outside contructor.
2501         
2502         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2503         
2504 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2505
2506         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2507         parameter code was not completed ever, so it was not as up-to-date
2508         as local variables.  Must finish it.
2509
2510         The bug fix was to compare the Toplevel of the block, not the
2511         current block.  Thanks for Ben for pointing this out. 
2512
2513 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2514
2515         * decl.cs (AddMethods): Use the declaring type of the problem
2516         method to determine if we want to squash a warning.
2517
2518 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2519
2520         * attribute.cs: Removed debug output.
2521
2522         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2523         
2524         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2525         Report.Stderr.
2526         
2527 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2528
2529         Fix #74481.
2530         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2531         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2532         all null comparisons against reference types.
2533
2534 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2535
2536         Fix# 74565
2537         * class.cs (TypeContainer.CircularDepException) New nested
2538         exception class.
2539         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2540         (TypeContainer.DefineType): Removed error, reset InTransit before
2541         exit.
2542         (Class.DefineType): Throw exception when is in Transit.
2543         Catch exception and report error.
2544         (Struct.DefineType): Throw exception when is in Transit.
2545         Catch exception and report error.
2546         (Interface.DefineType): Throw exception when is in Transit.
2547         Catch exception and report error.
2548
2549         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2550         handle nested exception handlers.
2551
2552         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2553         a catch.
2554
2555         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2556         InFinally and InCatch storage.
2557
2558         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2559         (Catch.Resolve): Set and Restore ec.InCatch.
2560         (Try.Resolve): Set and Restore ec.InFinally.
2561         (Try.HasCatch): True when try has catch.
2562
2563 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2564
2565         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2566           for the same event member, so exclude such cases from warning 419.
2567           Fixed bug #74633.
2568
2569 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2570
2571         * expression.cs (Binary.ResolveOperator): Apply patch from John
2572         Luke to fix bug 59864: operators &, | and ^ on enumerations
2573         require that the same enum type on both sides.
2574
2575         * driver.cs: Add warnings to old flag usage, this is to assist
2576         people who produce Makefiles and hope that the Makefiles will be
2577         used on Windows.
2578
2579         * class.cs (TypeContainer.EmitType): Moved the definition of the
2580         special $PRIVATE$ field from the resolve phase to the Emit phase.
2581         During resolve we do not know if we are a struct with
2582         HasExplicitLayout, we know this only after the attributes for the
2583         type are emitted.
2584
2585         Set the FieldOffset to zero on the dummy field that we create for
2586         the class.   Fixes 74590.
2587
2588 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2589
2590         Fix #73834.
2591         * ecore.cs (PropertyExpr.resolved): New.
2592         (DoResolve): Use it to handle a case of double resolution here.
2593         Handle a case of identical-name-and-type-name.
2594         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2595         resolution by storing the results of expression resolution back
2596         into the "probes" array.
2597
2598 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2599
2600         Fix cs0208-7.cs and cs0208-8.cs.
2601         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2602         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2603         error reporting to point out the reason a struct is not unmanaged.
2604
2605 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2606
2607         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2608           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2609
2610 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2611
2612         Fix #74528.
2613         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2614         IdenticalNameAndTypeName here.
2615         (EventExpr.InstanceResolve): Likewise.
2616
2617 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2618
2619         C# 2.0 DefaultCharSetAttribute implementation
2620         
2621         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2622         which allows us to set GlobalNamespace for every resolve.
2623         (Attribute.ResolveArguments): Cut from Resolve.
2624         (Attribute.GetCharSetValue): Returns CharSet named argument.
2625         (Attribute.DefinePInvokeMethod): Gets default charset from
2626         module settings.
2627         (GlobalAttribute.ResolveAsTypeStep): Override.
2628         (GlobalAttribute.ResolveArguments): Override.
2629         
2630         * class.cs (TypeAttr): Is protected.
2631         
2632         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2633         (ModuleClass.DefaultCharSetType): New memeber.
2634         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2635         
2636         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2637         charset from module.
2638         
2639         * delegate.cs (TypeAttr): Override.
2640         (Delegate.DefineType): Use this TypeAttr.
2641         
2642         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2643         at very early stage (before types are defined) to resolve model
2644         module attributes. It will probably not work with corlib but it
2645         should be ok.
2646         
2647         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2648         charset from module.
2649         
2650         * typemanager.cs (default_charset_type): New type.
2651
2652 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2653
2654         * decl.cs (MemberCache.AddMethods): Don't warn if
2655         System.Object.Finalize has buggy MethodAttributes.
2656
2657         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2658         removed below.
2659
2660 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2661
2662         * doc.cs : detect ambiguous reference to overloaded members.
2663           Fixed bug #71603. MS 1.1 csc does not detect it.
2664
2665 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2666
2667         * doc.cs : delegates must not be referenced with parameters.
2668           Fixed bug #71605.
2669
2670 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2671
2672         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2673
2674 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2675
2676         * driver.cs (MainDriver): Stop processing if the CLS stage found
2677         errors. 
2678
2679         (CompilerCallableEntryPoint.InvokeCompiler): Always
2680         reset after execution;   Take a TextWriter argument for the
2681         output.
2682
2683         * report.cs: Use the error stream instead of hardcoding stderr. 
2684
2685 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2686
2687         * class.cs: Reduce code paths to test, too small of an
2688         optimization to make it worth the extra testing.  Always perform
2689         it. 
2690
2691 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2692
2693         Fix #74510.
2694         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2695         operators that had errors reported on them.
2696
2697 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2698
2699         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2700         argument types.
2701         (Attribute.Resolve): Add named argument type checking.
2702         
2703         * class.cs (FixedField.Define): Use IsPrimitiveType
2704         
2705         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2706         
2707         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2708         unsafe parameter types.
2709         
2710         * statement.cs (Using.ResolveExpression): Add better error description.
2711         
2712         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2713         
2714 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2715
2716         Fix #74484.
2717         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2718         AttributeUsageAttribute in the emitcontext of the attribute class,
2719         not in the emitcontext of the attributable entity it was attached to.
2720         * cs-parser.jay: Use 'current_class', not 'current_container',
2721         when creating a GlobalAttribute.
2722
2723 2005-04-08  Alp Toker  <alp@atoker.com>
2724
2725         * pending.cs: The fix to #58413 failed to compile methods implementing
2726         interfaces with/without params modifiers and vice versa, even though
2727         params modifiers aren't part of the signature. Make the modifier check
2728         less strict as in csc.
2729
2730 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2731             Anoob V E  <projectmonokochi@rediffmail.com>
2732             Harilal P R  <projectmonokochi@rediffmail.com>
2733
2734         Fix #58413.
2735         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2736         modifiers of pending methods.
2737         (PendingImplementation.PendingImplementation): Initialize it.
2738         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2739         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2740         with ParameterData.  Add check for modifiers.
2741         * class.cs (MethodData.Define): Update to changes.
2742
2743 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2744
2745         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2746
2747 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2748
2749         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2750         property.
2751         
2752         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2753         
2754         * rootcontext.cs,
2755         * typemanager.cs: Registered RequiredAttributeAttribute.
2756         
2757 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2758
2759         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2760         Warning CS0169 is back at level 3.
2761         (IMethodData.SetMemberIsUsed): New method.
2762         
2763         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2764         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2765         
2766         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2767
2768         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2769         contants.
2770         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2771         is used.
2772         
2773         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2774         is used.
2775         
2776         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2777         to avoid the problems with nested types.
2778
2779 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2780             Anoob V.E  <projectmonokochi@rediffmail.com>
2781             Harilal P.R  <projectmonokochi@rediffmail.com>
2782             Raja R Harinath  <rharinath@novell.com>
2783
2784         Fix #73820.
2785         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2786         attribute.
2787         * typemanager (GetConstructor): Make public.
2788
2789 2005-04-05  John Luke  <john.luke@gmail.com>
2790             Raja R Harinath  <rharinath@novell.com>
2791
2792         Fix #62232.
2793         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2794         struct too.  Return false quicker in a few cases.
2795         (VerifyUnManaged): Use it.
2796
2797 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2798
2799         Fix #74041.
2800         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2801         not 'unreachable_seen'.
2802
2803 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2804
2805         * attribute.cs (Attribute.GetValue): Removed unused.
2806         
2807         * codegen.cs (CodeGen.TrimExt): Removed unused.
2808         
2809         * cs-parser.jay (output): Removed unused.
2810         
2811         * cs-tokenizer.cs (hex_digits): Removed unused.
2812         
2813         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2814         
2815         * expression.cs (Indirection.LoadExprValue): Removed unused.
2816         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2817         
2818         * iterators.cs (Iterator.param_types): Removed unused.
2819         
2820         * statement.cs (Goto.block): Removed unused.
2821         (ToplevelBlock.did): Removed unused.
2822         (Switch.ResolveConstantSwitch): Removed unused.
2823
2824 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2825
2826         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2827         resetting thingy.
2828
2829 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2830
2831         Fix #74232 and cs0208-3.cs.
2832         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2833         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2834         unmanaged type.  Don't use FieldBuilders when 't' is a
2835         TypeBuilder.  Use ModFlags and MemberType fields.
2836         * class.cs (MemberBase.member_type): Rename from MemberType.
2837         (MemberBase.MemberType): New property.  Determines member_type on
2838         demand.
2839         (MemberBase.DoDefine): Don't initialize MemberType here.
2840         (FieldMember.Define): Likewise.
2841
2842 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2843
2844         Fix #74241
2845         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2846         Attributes are emitted there.
2847         
2848 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2849
2850         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2851         keyword in 'partial enum' too.
2852         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2853         is not allowed).
2854         Report from Kamil Skalski <nazgul@omega.pl>.
2855
2856         Fix #74309.
2857         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2858         have partial containers too.
2859
2860         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2861         in block' checks to Block.CheckInvariantMeaningInBlock.
2862         * statement.cs (Block.GetKnownVariableInfo): Make private.
2863         (Block.IsVariableUsedInChildBlock): Remove.
2864         (Block.IsVariableUsedInBlock): Likewise.
2865         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2866         conflicting declaration.
2867         (Block.AddVariable): Make error messages less long-winded and more
2868         specific.  Show location of conflicting declaration.
2869         * parameter.cs (Parameters.Location): New readonly property.
2870
2871 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2872
2873         Clean up semantics of invoking ResolveMemberAccess.
2874         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2875         can have an instance, ensure that we pass in a non-TypeExpression
2876         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2877         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2878         argument.  Update to changes and simplify.
2879         (FieldExpr.Emitinstance): Remove CS0120 check.
2880         (PropertyExpr.EmitInstance): Likewise.
2881         * expression.cs (Argument.Resolve): Likewise.
2882         (Invocation.DoResolve): Update to changes in semantics of
2883         InstanceExpression.
2884
2885 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2886
2887         Fix #74241
2888         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2889         customization.
2890         
2891         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2892
2893 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2894
2895         Fix difference in behaviour with commandline invocation.
2896         * driver.cs (Driver.Reset): New.
2897         (CompilerCallableEntryPoint): Call it.
2898
2899         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2900         variable" warnings if the boolean expression failed to resolve.
2901
2902 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2903
2904         * attribute.cs: Fix the union of several permissions when some of them
2905         are unrestricted (so the result isn't an unrestricted permission set).
2906         Fix #74036.
2907
2908 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2909
2910         * ecore.cs (MemberExpr): New class.  Convert from interface
2911         IMemberExpr.
2912         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2913         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2914         error checks.
2915         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2916         (MethodGroupExpr.IsExplicitImpl): Remove.
2917         (Expression.GetFieldFromEvent): Remove.
2918         (SimpleName.MemberStaticCheck): Remove.
2919         (SimpleName.DoSimpleNameResolve): Update to changes.
2920         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2921         (MemberAccess.IdenticalNameAndTypeName): Remove.
2922         (MemberAccess.error176): Move to MemberExpr.
2923         (MemberAccess.DoResolve): Update to changes.
2924         (BaseAccess.DoResolve): Likewise.
2925
2926 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2927
2928         C# 2.0 Conditional attribute class implementation
2929         
2930         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2931         Analyzes class whether it has attribute which has ConditionalAttribute
2932         and its condition is not defined.
2933         
2934         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2935         (Class.IsExcluded): New method. Search for at least one defined
2936         condition in ConditionalAttribute of attribute class.
2937
2938 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2939
2940         * ecore.cs (PropertyExpr): Derive from Expression, not
2941         ExpressionStatement.
2942         (PropertyExpr.EmitStatement): Remove.
2943
2944 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2945
2946         Fix #74060.
2947         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2948         internal field "value__" of an enum be private.  The examples for
2949         "value__" that I found on MSDN all used FieldAttributes.Private.
2950
2951         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2952         Don't mention IL method attribute names.
2953
2954         Fix #47991.  Remove a TODO.
2955         * statement.cs (Block.Toplevel): Make into a field.
2956         (Block.Parameters): Move into ToplevelBlock.
2957         (Block.known_variables): Rename from child_variable_names.
2958         (Block.Block): Remove variants that take Parameters.  Initialize
2959         'Toplevel' with the immediately surrounding toplevel block.
2960         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2961         LocalInfo parameter.
2962         (Block.GetKnownVariableInfo): New.
2963         (Block.IsVariableNameUsedInChildBlock): Update.
2964         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2965         the block, even though it may not be in scope.
2966         (Block.AddVariable): Remove Parameters parameter.  Use
2967         Toplevel.Parameters instead.
2968         (Block.AddConstant): Remove Parameters parameter.
2969         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2970         (Block.IsParamaterReference): Likewise.
2971         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2972         (ToplevelBlock.Parameters): New.  Moved from Block.
2973         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2974         initialize Parameters to a non-null value.
2975         * cs-parser.jay: Update to changes.
2976         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2977         simple names that mean different things in the same block.  Use
2978         Block.IsVariableNameUsedInBlock.
2979
2980 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2981
2982         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2983         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2984         GetTypeHandle.  It is possible for a reflected type to derive from
2985         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2986         System.Array during mscorlib compilation).
2987         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2988         contain a method_hash, don't create one either.  Don't create a
2989         deep copy of the base cache's method_hash.
2990         (MemberCache.SetupCache): Rename back from DeepCopy.
2991         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2992         already initialized.  If we see an override function, add its
2993         underlying base virtual function to the member_hash too.
2994
2995         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2996
2997 2005-03-26  Raja R Harinath  <harinath@acm.org>
2998
2999         Fix #73038.
3000         * assign.cs (Assign.DoResolve): When the RHS of an assignment
3001         fails to resolve, ensure that the LHS is still resolved as an
3002         lvalue.
3003
3004 2005-03-25  Raja R Harinath  <harinath@acm.org>
3005
3006         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3007         ec.ContainerType.
3008         (Enum.current_ec): Remove.
3009         (Enum.LookupEnumValue): Remove EmitContext argument.
3010         Just uses the one created during DefineType.
3011         (Enum.FindMembers): Update.
3012         * expression.cs (MemberAccess.DoResolve): Update.
3013
3014 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
3015
3016         * assign.cs (Assign.DoResolve): Check for CS1717 when
3017         source and target are same (uses Equals).
3018
3019         * expression.cs (LocalVariableReference, ParameterReference,
3020         This): Implemented Equals, GetHashCode.
3021
3022         * statement.cs (Block.GetParameterReference): Removed useless
3023         local variable.
3024
3025 2005-03-22  Raja R Harinath  <rharinath@novell.com>
3026
3027         Fix cs0128.cs
3028         * statement.cs (Block.AddVariable): Ensure that we skip implicit
3029         blocks before deciding whether the error is cs0136 or cs0128.
3030
3031         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3032         (using_alias_directive, using_namespace_directive): Pass
3033         MemberName, not an expression to Namespace.UsingAlias and
3034         Namespace.Using.
3035         (MakeName): Use the MemberName of the namespace.
3036         * namespace.cs (Namespace.MemberName): New.
3037         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3038         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3039         Likewise.
3040         * decl.cs (MemberName.Name): Make readonly.
3041         (MemberName.FromDotted): New "constructor".
3042         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3043         (MemberCore.Name): Compute from MemberName on demand.
3044         (MemberCore.SetMemberName): Provide a way to change the
3045         MemberName.
3046         (MemberCore.AddToContainer): Don't take a fullname parameter.
3047         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3048         fully qualified name of the container to the member name.
3049         (TypeContainer.AddToTypeContainer): Use a fully qualified name
3050         only if the type is a member of the root container.
3051         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3052         MemberName.Left rather than searching for an embedded ".".
3053         (PartialContainer.CreatePart): Update to changes in RootContext.
3054         (MemberBase.ShortName): Turn into a property.  Use
3055         MemberCore.SetMemberName.
3056         (MemberBase.ExplicitInterfaceName): Remove.
3057         (MemberBase.UpdateMemberName): Remove.
3058         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3059         (PropertyBase.SetMemberName): New override.
3060         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3061         (Tree.GetDecl): New.
3062         (Tree.AllDecls): Rename from Decls.
3063         * attribute.cs, enum.cs, report.cs: Update to changes.
3064         * driver.cs (MainDriver): Use MemberName.FromDotted on
3065         RootContext.MainClass.
3066
3067 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
3068
3069         * class.cs (FixedField.Define): Check for CS1664 and more sanity
3070         checks.
3071
3072         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3073
3074 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
3075
3076         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3077         property accessor modifiers.
3078
3079         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3080         fixed buffer attribute (CS1716).
3081         (PropertyMethod.HasCustomAccessModifier): When property accessor
3082         has custom modifier.
3083
3084         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3085         modifiers.
3086         (PropertyExpr.DoResolveLValue): Add CS0272.
3087
3088 2005-03-17  Miguel de Icaza  <miguel@novell.com>
3089
3090         * convert.cs: When converting to a pointer, use the proper Conv.U
3091         or Conv.I depending on the source data type.
3092
3093         * cs-tokenizer.cs: Make the size for large decimal constants,
3094         fixes #72957.
3095
3096 2005-03-17  Martin Baulig  <martin@ximian.com>
3097
3098         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3099         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3100
3101 2005-03-17  Martin Baulig  <martin@ximian.com>
3102
3103         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3104         to bool so we can return an error condition.
3105         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3106         returned an error.
3107
3108 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
3109
3110         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
3111         attributes.
3112
3113 2005-03-16  Raja R Harinath  <rharinath@novell.com>
3114
3115         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
3116         Refactor to avoid traversing the list of assemblies, and to avoid
3117         string concatenation.
3118         * typemanager.cs (guid_attr_type): Remove.
3119         (negative_hits, pointers, references): Remove hashes.
3120         (type_hash): New.
3121         (GetConstructedType): New.  Uses type_hash to handle constructed
3122         types (arrays, references, pointers).
3123         (GetReferenceType, GetPointerType): Use it.
3124         (GetNestedType): New.  Uses type_hash to handle nested types of
3125         reflected types.
3126         (LookupType, LookupTypeDirect): Remove.
3127         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
3128         'types' hash and LookupTypeReflection directly.
3129         (params_string, params_object): Use GetConstructedType.
3130         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
3131         top-level types.
3132         (Namespace.Lookup): Use cached_types.
3133         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
3134         provided by old TypeManager.LookupType.
3135         * rootcontext.cs (MakeFQN): Remove.
3136         * decl.cs (DeclSpace.MakeFQN): Likewise.
3137         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
3138         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
3139         TypeManager.GetConstructedType.
3140         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
3141
3142 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
3143
3144         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
3145         indexers.
3146
3147         * cs-parser.jay: Reports CS1527 for any namespace element.
3148
3149         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
3150         Added CS0407.
3151
3152         * expression.cs (ParameterReference.IsAssigned): Changed error to
3153         CS0269.
3154         (Error_WrongNumArguments): Moved CS0245 detection here.
3155
3156         * statement.cs (Return.Resolve): Add CS1622 report.
3157
3158 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
3159
3160         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
3161
3162 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
3163
3164         * attribute.cs expression.cs: Get rid of some allocations.
3165
3166 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
3167
3168         * doc.cs : just eliminate the latest change.
3169
3170 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3171
3172         * doc.cs : commented out the latest change. It breaks xml-030.cs
3173
3174 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3175
3176         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
3177           fail. So invoke CreateType() in FindDocumentedType().
3178
3179 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3180
3181         * cs-tokenizer.cs : added IsKeyword().
3182         * doc.cs : Detect keyword incorrectly used as identifier.
3183           Allow identifiers prefixed by @.
3184
3185 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
3186
3187         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
3188         It caused exception in namespace resolving (again!).
3189         
3190         * class.cs (Class.ctor): Removed exit.
3191         (PropertyMethod.ctor): ditto.
3192         
3193         * codegen.cs (Codegen.Reset): Reset static data.
3194         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
3195         
3196         * cs-tokenizer.cs (Cleanup): Removed.
3197         
3198         * driver.cs (GetSystemDir): Rewrote to one line command.
3199         It caused problem with unloaded dynamic modules.
3200         (UnixParseOption): Removed Exit.
3201         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
3202         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
3203         Now can be mcs used as library.
3204         
3205         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
3206         empty location.
3207         
3208         * location.cs (Reset): Reset static data.
3209         
3210         * namespace.cs (Reset): Reset static data.
3211         
3212         * report.cs (Report.Reset): Reset static data.
3213         
3214         * rootcontext.cs (RootContext.Reset): Reset static data.
3215         
3216         * tree.cs (RootTypes.ctor): Use Location.Null
3217         
3218         * typemanager.cs (TypeManager.Reset): Reset static data.
3219         (CoreLookupType): Removed Exit.
3220         (TypeHandle.Reset): Reset static data.
3221         
3222 2005-03-10  Raja R Harinath  <rharinath@novell.com>
3223
3224         Fix #73516.
3225         * typemanager.cs (ComputeNamespaces): Import namespaces from
3226         referenced modules too.
3227
3228 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3229
3230         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
3231         than '.'.
3232
3233 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3234
3235         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
3236         enclosing DeclSpace.  This ensures that a name-lookup populates
3237         more caches and there are fewer 'TypeExpression's.  Carve out
3238         nested type lookup into ...
3239         (LookupNestedTypeInHierarchy): ... this.
3240
3241 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3242
3243         Clean up a few partial-class semantics.  
3244         Fixes test-357.cs and cs1618-2.cs.
3245         * cs-parser.jay (struct_declaration): Use 'current_class' as
3246         parent of newly-created struct.  Remove call to Register ().
3247         Use 'pop_current_class' to complete handing the current struct.
3248         (interface_declaration): Likewise.
3249         (class_declaration): Likewise.
3250         (enum_declaration): Use 'current_class' as parent of newly created
3251         enum.
3252         (delegate_declaration): Likewise.
3253         (pop_current_class): New function.  This is used to handle closing
3254         up the 'current_class' and 'current_container', and pointing them
3255         to the enclosing class/container.
3256         (CSharpParser): Initialize 'current_class' too.
3257         * decl.cs (MemberCore): Add check for invariant: a partial
3258         container is not a parsed entity, and thus does not enclose any
3259         parsed members.
3260         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
3261         (DeclSpace.BaseTypeExpr): Use it.
3262         (DeclSpace.LookupType): Add check for invariant.
3263         * class.cs (TypeContainer): Add check for invariant: a nested
3264         class should have the same NamespaceEntry as its enclosing class.
3265         (TypeContainer.EmitFieldInitializers): Make virtual.
3266         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
3267         MemberCore.
3268         (TypeContainer.Register): Remove.
3269         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
3270         null.  Use TypeResolveEmitContext for resolving base types and
3271         interfaces.  Move initialization of Parts.TypeBuilder here from
3272         ...
3273         (TypeContainer.DefineNestedTypes): ... here.
3274         (PartialContainer): Take a Namespace not a NamespaceEntry.
3275         (PartialContainer.Create): Don't use Register.  Call the
3276         appropriate Add... function directly.
3277         (ClassPart): Take both the PartialContainer and the enclosing
3278         class as constructor arguments.
3279         (ClassPart.EmitFieldInitializers): Override.
3280         (ClassPart.PartFindNestedTypes): Remove.
3281         (FieldBase.GetInitializerExpression): Resolve the initializer
3282         expression in the emit context of the enclosing class.
3283         * tree.cs (RootTypes): Remove Register ().
3284         
3285 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
3286
3287         * cs-parser.jay: Removed CS0134.
3288         
3289         * driver.cs: Removed CS1901.
3290         
3291         * expression.cs (SizeOf.DoResolve): Don't report CS0233
3292         for predefined types.
3293
3294 2005-03-07  Duncan Mak  <duncan@novell.com>
3295
3296         * codegen.cs (Save):  Catch UnauthorizedAccessException as
3297         well. Fixes bug #73454.
3298
3299 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
3300
3301         * cs-tokenizer.cs (xtoken): Add CS1035.
3302         
3303         * class.cs (MethodData.Define): Add CS0683.
3304         (FieldMember.ctor): Add CS0681.
3305
3306 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3307
3308         * ecore.cs (SimpleName.DoResolve): Rename from
3309         SimpleName.DoResolveAllowStatic.
3310         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
3311         Pass 'intermediate' flag to MemberStaticCheck.
3312         (SimpleName.MemberStaticCheck): Skip "static check" only in case
3313         of "intermediate" lookups via MemberAccess.
3314         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
3315         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
3316
3317 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3318
3319         Fix #73394.
3320         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
3321         slipped in because of variable names that are identical to a
3322         builtin type's BCL equivalent ('string String;', 'int Int32;').
3323         (PropertyExpr.EmitInstance): Likewise.
3324
3325 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
3326
3327         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
3328         
3329         * report.cs (warning_ignore_table): Made public.
3330
3331 2005-03-04  Raja R Harinath  <rharinath@novell.com>
3332
3333         Fix #73282.
3334         * class.cs (MethodData.Emit): Pass 'container' to
3335         container.GetObsoleteAttribute instead of 'container.Parent'.
3336
3337 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
3338
3339         * cs-parser.jay: Add 1534 error test.
3340
3341         * iterators.cs (Yield.CheckContext): Add error 1629.
3342         (Iterator.ctor): Save unsafe modifier.
3343         (MoveNextMethod.DoEmit): Restore unsafe context.
3344
3345         * namespace.cs (UsingAlias): Better error message.
3346
3347 2005-03-03  Dan Winship  <danw@novell.com>
3348
3349         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
3350         the warning message [#73219]
3351
3352 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3353
3354         Fix compile with MCS 1.0.0.0.
3355         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
3356         w_restore to not depend on string constant folding.
3357
3358 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3359
3360         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
3361         CS0246 check to users who passed 'silent = false'.
3362         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
3363         check.
3364         (SimpleName.SimpleNameResolve): Update.
3365         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
3366         (MemberAccess.IdenticalNameAndTypeName): Update.
3367         * doc.cs (FindDocumentedTypeNonArray): Update.
3368
3369 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
3370
3371         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3372         * parameters.cs (ComputeAndDefineParameters): Remove.
3373         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3374         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3375         Use GetParameterInfo.
3376
3377 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
3378
3379         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3380
3381 2005-03-02  Raja R Harinath  <rharinath@novell.com>
3382
3383         Unify DeclSpace.LookupType and DeclSpace.FindType.
3384         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
3385         is in charge of defining nested types on demand.
3386         (DeclSpace.LookupType): Use it when the current_type is a
3387         TypeBuilder.  Use LookupTypeDirect for reflected types.
3388         (DeclSpace.FindType): Remove.
3389         (DeclSpace.LookupInterfaceOrClass): Likewise.
3390         (DeclSpace.DefineTypeAndParents): Likewise.
3391         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3392         DeclSpace.LookupType.
3393         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3394         * typemanager.cs (LookupType): Simplify.
3395         (AddUserType): Remove type from negative_hits.
3396         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3397         * class.cs (TypeContainer.FindMembers): Move handling of nested
3398         types ...
3399         (TypeContainer.FindMembers_NestedTypes): ... here.
3400         (TypeContainer.FindNestedType): Implement override.
3401         (ClassPart.FindNestedType): Delegate to PartialContainer.
3402         (ClassPart.PartFindNestedType): Looks up the nested types of the
3403         part alone.
3404
3405 2005-03-02  Martin Baulig  <martin@ximian.com>
3406
3407         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3408         static constructor in static classes.
3409
3410 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
3411
3412         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3413         sizeParamIndex is not specified.
3414
3415 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
3416
3417         Fix #73117
3418         * report.cs (WarningMessage.IsEnabled): Missing null check.
3419
3420 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3421
3422         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3423         in the fields and not in the properties.
3424
3425 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
3426
3427         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
3428         fields as well.
3429
3430 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3431
3432         * attribute.cs: Small refactoring (improved robustness).
3433         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3434         (ValidateGuid): Removed.
3435         (Resolve): Removed referenced to above mentioned.
3436         (GetAttributeUsage): Made private and changed to work without
3437         class assistance.
3438         (GetIndexerAttributeValue): Don't crash.
3439         (GetConditionalAttributeValue): Ditto.
3440         (GetClsCompliantAttributeValue): Ditto.
3441         (ExtractSecurityPermissionSet): All attributes exceptions are
3442         error 648.
3443         (GetPropertyValue): New helper.
3444         (GetMethodImplOptions): New method.
3445         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3446         some missing properties.
3447         
3448         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3449         (Method.ApplyAttributeBuilder): Updated.
3450         
3451         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3452         exception.
3453
3454 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3455
3456         Fix #73052.
3457         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3458         non-simple types (array, pointer, reference).
3459
3460 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3461
3462         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3463
3464         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3465         for operators.
3466         (Method.CheckBase): Catch wrong destructor here.
3467         (MethodData.Define): Add errors 550, 668.
3468
3469         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3470
3471         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3472
3473         * pending.cs (VerifyPendingMethods): Add error 551.
3474
3475         * typemanager.cs (CSharpName): Next error report helper.
3476
3477 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3478
3479         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3480         attributes. Removed useless attribute double check.
3481         It saves almost 2MBs for corlib.
3482
3483 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3484
3485         Fix #72924.
3486         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3487         called twice in case of error.
3488
3489 2005-02-23  Chris Toshok  <toshok@ximian.com>
3490
3491         Fix compiler portions of #72827.
3492         * statement.cs (Block.Emit): call Begin/EndScope on the
3493         EmitContext instead of the ILGenerator.
3494
3495         * codegen.cs (EmitContext.BeginScope): new method, call
3496         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3497         we have one.)
3498         (EmitContext.BeginScope): same, but EndScope and CloseScope
3499
3500         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3501         offset and call the superclass's OpenScope(int) with it.
3502         (SymbolWriter.CloseScope): get the current il
3503         offset and call superclass's CloseScope(int) with it.
3504
3505 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3506
3507         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3508         CS1677 for out and ref as well.
3509
3510         * class.cs (Method.Define): Add error CS1599 detection.
3511         
3512         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3513         
3514         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3515         
3516         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3517         
3518         * support.cs.cs (ModifierDesc): New helper method.
3519
3520 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3521             Abin Thomas  <projectmonokochi@rediffmail.com>
3522             Anoob V E  <projectmonokochi@rediffmail.com>
3523             Harilal P R  <projectmonokochi@rediffmail.com>
3524
3525         Fix #57851, #72718.
3526         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3527         MemberLookup (used for error reporting) actually returns a result.
3528         Fix error report number (122, not 112).
3529
3530 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3531             Anoob V E  <projectmonokochi@rediffmail.com>
3532             Harilal P R  <projectmonokochi@rediffmail.com>
3533
3534         Fix #71134.
3535         * pending.cs (PendingImplementation.GetAbstractMethods):
3536         Find NonPublic members too.
3537
3538 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3539
3540         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3541         Fixed error 217.
3542         
3543         * class.cs (MethodCore.CheckMethodAgainstBase):
3544         Add error 239 report.
3545
3546 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3547
3548         Fix #68955.
3549         * expression.cs (Invocation.IsApplicable): Make public.
3550         (Invocation.IsParamsMethodApplicable): Likewise.
3551         * delegate.cs (Delegate.VerifyApplicability): Don't use
3552         Invocation.VerifyArgumentCompat for parameter applicability
3553         testing.  Use Invocation.IsApplicable and
3554         Invocation.IsParamsMethodApplicable.
3555
3556 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3557
3558         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3559         
3560         * class.cs (Operator.Define): Add error 217 report.
3561         
3562 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3563
3564         * namespace.cs (UsingEntry.Resolve): Undo change below.
3565
3566 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3567
3568         Fix #72756.
3569         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3570         disable the error message when the extended MemberLookup also
3571         fails.
3572         (Expression.MemberLookupFinal): Update.
3573         (SimpleName.DoSimpleNameResolve): Update.
3574         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3575         Don't use MemberLookupFinal.
3576         (New.DoResolve): Update.
3577         (BaseAccess.CommonResolve): Update.
3578
3579 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3580
3581         Fix #72732.
3582         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3583         occured previously, don't resolve again.
3584
3585 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3586
3587         Fix #69949
3588         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3589         argument. Call ResolveAttributeUsage for unresolved.
3590         when types doesn't match ctor arguments.
3591         
3592         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3593         for nested attribute classes.
3594         (Class.attribute_usage): Removed.
3595         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3596         for attribute class.
3597         
3598         * ecore.cs (IsAttribute): Removed.
3599         
3600         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3601         
3602         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3603         now normal types.
3604         (attribute_types): Removed.
3605         (EmitCode): Global attributes are emited as the latest.
3606
3607 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3608
3609         * class.cs (EmitFieldInitializers): Don't emit field initializer
3610         for default values when optimilization is on.
3611         
3612         * constant.cs (Constant.IsDefaultValue): New property.
3613         
3614         * driver.cs: Add /optimize handling.
3615         
3616         * constant.cs,
3617         * ecore.cs,
3618         * literal.cs: Implement new IsDefaultValue property.
3619         
3620         * rootcontext.cs (Optimize): New field, holds /optimize option.
3621
3622 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3623
3624         Fix crasher in re-opened #72347.
3625         * namespace.cs (Namespace.Lookup): Return null if
3626         DeclSpace.DefineType returns null.
3627
3628         Fix #72678.
3629         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3630
3631 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3632
3633         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3634         now returns null if it cannot resolve to an lvalue.
3635         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3636         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3637         returned null.  Remove check for SimpleName.
3638         (EventExpr.DoResolveLValue): New.
3639         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3640         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3641         error from ...
3642         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3643         avoid CS0131 error.
3644         (Unary.ResolveOperator): Move CS0211 check ...
3645         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3646         CS0131 error.
3647         (Unary.DoResolveLValue): Simplify.
3648         (AddressOf.DoResolveLValue): New.
3649         (ArrayAccess.DoResolveLValue): New.
3650
3651 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3652
3653         * attribute.cs (Attribute.Resolve): Add arguments casting for
3654         when types doesn't match ctor arguments.
3655
3656 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3657
3658         Fix parts of #63202.
3659         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3660         lookup of operator in base type.  Ensure that all checks happen
3661         when the operator resolves to an "op_..." method.
3662
3663 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3664
3665         Fix #71992.
3666         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3667         'ignore_cs0104' parameter.  Pass it to ...
3668         (NamespaceEntry.Lookup): ... this.
3669         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3670         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3671         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3672         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3673         Update.  Request that cs0104 errors be ignored.
3674         (ComposedCast.ResolveAsTypeStep): Update.
3675
3676 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3677
3678         Fix #59209.
3679         * expression.cs (Invocation.BetterFunction): Remove support for
3680         comparing virtual functions and their overrides.
3681         (Invocation.IsOverride): New.
3682         (Invocation.OverloadResolve): Don't consider 'override' functions
3683         during candidate selection.  Store them in a lookaside list.
3684         If the selected method is a 'virtual' function, use the list to
3685         find any overrides that are closer to the LHS type.
3686
3687 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3688
3689         * expression.cs (New.DoResolve): Add complex core type reduction.
3690         (New.Constantify): Converts complex core type syntax like 'new int ()'
3691         to simple constant.
3692         
3693 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3694
3695         * decl.cs (EntryType.EntryType): New constructor to create an
3696         updated copy of a cache entry.
3697         (MemberCache.AddMethods): Use it.
3698         (MemberCache.ClearDeclaredOnly): Remove.
3699         (MemberCache.MemberCache): Update.
3700
3701 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3702
3703         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3704         variable.  This one is represents the actual low-level declaration
3705         of the method, as opposed to the semantic level `IsStatic'.   
3706
3707         An anonymous method which is hosted into a static method might be
3708         actually an instance method.  IsStatic would reflect the
3709         container, while MethodIsStatic represents the actual code
3710         generated.
3711
3712         * expression.cs (ParameterReference): Use the new MethodIsStatic
3713         instead of IsStatic.
3714
3715         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3716         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3717         set on the current EmitContext. 
3718
3719         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3720         resolve our casted expression as an LValue.  This triggers the
3721         proper LValue processing that is later required by Assign.
3722
3723         This fixes 72347.
3724
3725         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3726
3727 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3728
3729         C# 2.0 Fixed buffer implementation
3730
3731         * anonymous.cs: Update after RegisterHelperClass renaming.
3732
3733         * attribute.cs (AttributeTester.fixed_buffer_cache):
3734         Cache of external fixed buffers.
3735         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3736         implementation if field is fixed buffer else null.
3737
3738         * class.cs
3739         (TypeContainer.AddField): Accept FieldMember instead of Field.
3740         (FieldBase.IsFieldClsCompliant): Extracted code from
3741         VerifyClsCompliance descendant customization.
3742         (FixedField): New class handles fixed buffer fields.
3743         (FixedFieldExternal): Keeps information about imported fixed
3744         buffer.
3745         (IFixedField): Make access to internal or external fixed buffer
3746         same.
3747
3748         * cs-parser.jay: Add fixed buffer parsing.
3749
3750         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3751         buffer.
3752
3753         * expression.cs (Indirection): Extended implementation to accept
3754         fixed buffer field.
3755         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3756         (ElementAccess.MakePointerAccess): Get type as parameter.
3757         (DoResolve): Add fixed buffer field expression conversion.
3758         (DoResolveLValue): Ditto.
3759         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3760         (ArrayPtr): Derives from FixedBufferPtr.
3761         (ArrayPtr.Emit): Add extra emit for array elements.
3762
3763         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3764
3765         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3766         for compiler generated types.
3767         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3768
3769         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3770         and consume less memory.
3771         (Fixed.Resolve): Add fixed buffer case.
3772
3773         * typemanager.cs (compiler_generated_attr_ctor,
3774         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3775         (HasElementType): Add our own implementation to work on every
3776         runtime.
3777
3778 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3779
3780         * anonymous.cs (CaptureContext): Track whether `this' has been
3781         referenced.   
3782
3783         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3784         only captured `this' if it was implicitly done (instance
3785         methods/variables were used). 
3786
3787         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3788         `this' must be captured.
3789
3790 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3791  
3792         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3793         is null it means that there has been no need to capture anything,
3794         so we just create a sibling.
3795
3796         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3797
3798         Just a partial fix.  The other half is fairly elusive.
3799         
3800 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3801
3802         Fix #52586, cs0121-4.cs.
3803         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3804         and return a hashtable.
3805         (MemberCache.ClearDeclaredOnly): New.
3806         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3807         the method_hash of a base type too.
3808         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3809         type methods.  Overwrite entries with the same MethodHandle so
3810         that the ReflectedType is correct.  The process leaves in base
3811         virtual functions and their overrides as distinct entries.
3812         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3813         matters since it was boxed in a ArrayList before.
3814         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3815         modifier.
3816         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3817         case of a virtual function and its override (choose the overload
3818         as better).
3819         (Invocation.OverloadResolve): Avoid 'override' members during
3820         'applicable_type' calculation.
3821
3822 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3823
3824         Combine two near-redundant caches.
3825         * typemanager.cs (method_params): Rename from method_internal_params.
3826         (TypeManager.GetParameterData): New.  Replace
3827         Invocation.GetParameterData.
3828         (TypeManager.LookupParametersByBuilder): Remove.
3829         * expression.cs (Invocation.method_parameter_cache): Remove.
3830         (Invocation.GetParameterData): Remove.
3831         Update to changes.
3832         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3833         Update to changes.
3834
3835 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3836
3837         Fix #72015.
3838         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3839         TypeManager.multicast_delegate_type is null, resolve it by looking
3840         up "System.MulticastDelegate".
3841         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3842
3843 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3844             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3845             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3846
3847         Fix cs0164.cs.
3848         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3849         (LabeledStatement.AddReference): New.  Set 'referenced'.
3850         (Goto.Resolve): Use it.
3851
3852 2005-02-05  John Luke  <john.luke@gmail.com>
3853
3854         * driver.cs: remove duplicate -doc line in Usage ()
3855
3856 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3857
3858         * location.cs (Location.AddFile): Fix CS2002 error report.
3859
3860 2005-02-02  Martin Baulig  <martin@ximian.com>
3861
3862         * delegate.cs (Delegate.DefineType): Report an internal error if
3863         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3864         details.        
3865
3866 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3867
3868         Fix a crasher in a variant of #31984.
3869         * const.cs (Constant.CheckBase): New override that defers the
3870         new-or-override check in case the base type hasn't been populated
3871         yet.
3872         (Constant.Define): Ensure the new-or-override check is performed.
3873
3874 2005-02-01  Duncan Mak  <duncan@ximian.com>
3875
3876         * const.cs (LookupConstantValue): Check that `ce' is not null
3877         before calling GetValue ().
3878
3879 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3880
3881         Fix test-334.cs (#69519).
3882         * cs-parser.jay (using_alias_directive): Pass in an expression to
3883         NamespaceEntry.UsingAlias.
3884         (using_namespace_directive): Pass in an expression to
3885         NamespaceEntry.Using.
3886         (namespace_name): Don't flatten to a string.
3887         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3888         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3889         ResolveAsTypeStep.
3890         (NamespaceEntry.UsingEntry): Likewise.
3891         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3892         changes.
3893         (NamespaceEntry.LookupForUsing): Remove.
3894         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3895         names.
3896         (NamespaceEntry.Lookup): Remove support for dotted names.
3897
3898 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3899
3900         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3901         split into two.
3902         (NamespaceEntry.ImplicitParent): Compute on demand.
3903         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3904         parallels the current.
3905         (NamespaceEntry.LookupForUsing): Use it.
3906         (NamespaceEntry.Lookup): If the current namespace-entry is
3907         implicit, don't search aliases and using tables.
3908
3909 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3910
3911         Fix #31984.
3912         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3913         BaseCache here.
3914         (TypeContainer.BaseCache): Compute on demand.
3915         (TypeContainer.FindMembers): Define constants and types if they're
3916         not already created.
3917         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3918         check.
3919         * const.cs (Constant.Define): Make idempotent.
3920
3921 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3922
3923         * pending.cs: Produce better code (no nops produced by using Ldarg
3924         + value).
3925         
3926         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3927         i - 1' it should be arg + 1.
3928
3929         Fixes bug #71819.
3930
3931 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3932
3933         * attribute.cs (Attribute.CheckAttributeType): Make private
3934         non-virtual.
3935         (Attribute.ResolveType): Make virtual.
3936         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3937         handling of RootContext.Tree.Types.
3938
3939 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3940
3941         Update attribute-handling to use the SimpleName/MemberAccess
3942         mechanisms.
3943         * cs-parser.jay (attribute): Pass in an expression to the
3944         constructors of Attribute and GlobalAttribute.
3945         * attribute.cs (Attribute): Take an expression for the name.
3946         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3947         passed in attribute name expression.
3948         (Attribute.CheckAttributeType): Use it.
3949         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3950         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3951         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3952         argument to prevent error messages if the lookup fails.
3953
3954 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3955
3956         * expression.cs (Indirection): Implemented IVariable interface
3957         to support indirection in AddressOf operator.
3958         (PointerArithmetic.Emit): Add optimalization for case where
3959         result can be precomputed.
3960
3961 2005-01-26  Martin Baulig  <martin@ximian.com>
3962
3963         * class.cs (TypeContainer.AttributeTargets): Return the correct
3964         AttributeTargets depending on our `Kind' instead of throwing an
3965         exception; fixes #71632.
3966
3967 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3968
3969         Fix #71257
3970         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3971         constant members.
3972
3973 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3974
3975         Fix #71602.
3976         * expression.cs (MemberAccess.DoResolve): Don't complain with
3977         cs0572 when the LHS of a member access has identical name and type
3978         name.
3979
3980 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3981
3982         Fix #71651, #71675
3983         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3984         CreatePermission.
3985         Create custom PermissionSet only for PermissionSetAttribute.
3986
3987 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3988
3989         Fix #71649
3990         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3991         delegates in static class.
3992
3993 2005-01-24  Martin Baulig  <martin@ximian.com>
3994
3995         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3996         merging an implicit block, just use its reachability.
3997
3998         * statement.cs (Block.Resolve): Make the unreachable code check
3999         work wrt. implicit blocks; see test-337 from #63842.
4000
4001 2005-01-21  Alp Toker  <alp@atoker.com>
4002  
4003         * cs-parser.jay: destructor_declaration's container is PartialContainer
4004         not Class when partial types are used, so use Kind prop instead of
4005         'is'.
4006         
4007 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
4008
4009         * cs-parser.jay: Improve error reporting when an interface
4010         declares new types.
4011
4012 2005-01-20  Dick Porter  <dick@ximian.com>
4013
4014         * support.cs: SeekableStreamReader fix from Sandor Dobos
4015         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
4016         chars are read.  Fixes bug 70369.
4017
4018 2005-01-20  Raja R Harinath  <rharinath@novell.com>
4019
4020         * cs-parser.jay (catch_clause): Simplify current_block handling
4021         somewhat.
4022
4023 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
4024
4025         * convert.cs (ImplicitStandardConversionExists): Synchronize the
4026         code with ImplicitStandardConversion to handle the implicit
4027         conversion of method groups into valid delegate invocations. 
4028
4029         The problem is that in parameter handling we were using this code
4030         path.  Fixes bug #64698
4031
4032 2005-01-19  Raja R Harinath  <rharinath@novell.com>
4033
4034         * cs-parser.jay: Fix several infelicities.
4035         - Avoid assigning to the parser value stack.  Code like 
4036           '$3 = null' is unclean.  Synthesize a value for the code block
4037           instead. 
4038         - Avoid using oob_stack for storing location information.  Use ...
4039         (_mark_): ... this.  New (empty) rule.  Saves the current location
4040         in $$.
4041         (foreach_statement): Avoid using oob_stack for current_block
4042         handling.  Use technique used in for_statement and
4043         using_statement.  Synthesize a value for the code block to store
4044         additional intermediate information.
4045
4046 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
4047
4048         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
4049         of a different type is only allowed to private fields of a
4050         containing type, not on fields of a base class.
4051
4052         See test-174.cs and error cs0122-9.cs
4053
4054 2005-01-13  Raja R Harinath  <rharinath@novell.com>
4055
4056         Fix test-335.cs (bug #58126).
4057         * cs-parser.jay (argument): Split out non-expression parts of the
4058         rule into 'non_simple_argument'.
4059         (invocation_expression): Support parenthesized invocations with
4060         multiple arguments, and with single non-simple arguments.
4061
4062 2005-01-13  Raja R Harinath  <rharinath@novell.com>
4063
4064         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
4065         places.
4066
4067 2005-01-12  Raja R Harinath  <rharinath@novell.com>
4068
4069         Fix cs0038-1.cs, cs1640-6.cs.
4070         * ecore.cs (Expression.Resolve): Remove special-case for
4071         SimpleName in error-handling.
4072         (Expression.almostMatchedMembers): Relax access permission to
4073         protected.
4074         (Expression.MemberLookupFailed): Handle duplicates in
4075         almostMatchedMembers list.
4076         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
4077         * expression.cs (New.DoResolve): Report CS1540 for more cases.
4078         * typemanager.cs (GetFullNameSignature): Use the MethodBase
4079         overload if the passed in MemberInfo is a MethodBase.
4080
4081 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
4082
4083         Fix #70749
4084         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
4085         for non-CAS & merge permission sets properly.
4086
4087 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4088
4089         Improve standard-compliance of simple name and member access 
4090         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
4091         * ecore.cs (FullNamedExpression): New abstract base class 
4092         for Namespaces and TypeExpressions.
4093         (ResolveFlags.SimpleName): Remove.
4094         (SimpleName): Remove support for dotted names.
4095         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
4096         DeclSpace.FindType and DeclSpace.LookupType.
4097         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
4098         (Expression.ExprClassName): Make member function.
4099         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
4100         a namespace.  Remove creation of dotted "SimpleName"s.
4101         (MemberAccess.DoResolve): Likewise.
4102         * decl.cs (DeclSpace.Cache): Make private.
4103         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
4104         (DeclSpace.FindType): Update.
4105         (DeclSpace.LookupType): Move here from RootContext.  Return a 
4106         FullNamedExpression.
4107         * namespace.cs (Namespace): Derive from FullNamedExpression
4108         so that it can be part of expression resolution.
4109         (Namespace.Lookup): Return an FullNamedExpression.
4110         (NamespaceEntry.LookupAlias): Lookup aliases only in current
4111         namespace.
4112         * rootcontext.cs (NamespaceLookup): Remove.
4113         (LookupType): Move to DeclSpace.
4114         * attribute.cs (CheckAttributeType): Update.
4115         * doc.cs (FindDocumentedType): Remove allowAlias argument.
4116         (FindDocumentedTypeNonArray): Likewise.
4117
4118 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4119
4120         Fix cs0509.cs, cs1632.cs.
4121         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
4122         is the same as IsInterface.
4123         (TypeContainer.GetClassBases): Likewise.
4124         * statement.cs (LabeledStatement.ig): New field.
4125         (LabeledStatement.LabelTarget): Save ILGenerator which created the
4126         label.
4127         (LabeledStatement.DoEmit): Check that the label was created with
4128         the same ILGenerator.
4129
4130 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4131
4132         Fix #71058
4133         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
4134         accessors to its properties.
4135
4136         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
4137         from accessors to property.
4138         
4139 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4140
4141         Fix #70722
4142         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
4143         only for overrides.
4144         
4145 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
4146
4147         * attribute.cs: Check for null and empty strings.  
4148
4149         I have lost another battle to Paolo.
4150
4151 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
4152
4153         Fix #70942
4154         * class.cs (PropertyMethod): Set Parent field in ctors.
4155         (SetMethod.InternalParameters): Add unsafe switch hack.
4156         Override MarkForDuplicationCheck where it is appropriate.
4157
4158         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
4159         It says whether container allows members with the same name.
4160         Base default is no.
4161         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
4162         Removed is_method parameter.
4163
4164 2005-01-06  Duncan Mak  <duncan@ximian.com>
4165
4166         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
4167         because the previous change led to incorrect reporting of CS1032
4168         ("Cannot define/undefine preprocessor symbols after first token in
4169         file"). Instead of using `tokens_seen' as the only flag that
4170         triggers CS1040, introduce `comments_seen'. This new flag is used
4171         to signify having seen comments on the current line, so it is
4172         unset after a newline.
4173
4174 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4175
4176         * doc.cs : When searching for a type, find nested type too.
4177           This fixes bug #71040.
4178
4179 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4180
4181         * doc.cs :
4182           - Warn missing member comment on those classes which also does not
4183             have doc comments. Fixed bug #71041.
4184           - Don't warn missing doc comment on default constructor.
4185             Fixed bug #71042.
4186
4187 2005-01-06  Duncan Mak  <duncan@ximian.com>
4188
4189         * cs-tokenizer.cs (xtoken): After handling traditional C-style
4190         comments, set `tokens_seen' to true. This allows us to detect
4191         misplaced preprocessor directives (i.e. not at the beginning of
4192         the a line, nor after whitespaces). In that case, report error
4193         CS1040. This fixes bug #56460.
4194
4195         * cs-parser.jay (interface_member_declaration): Add checks for
4196         IsExplicitImpl, and report CS0541 error if an interface member is
4197         defined as an explicit interface declaration.
4198
4199 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
4200
4201         Fix #70817
4202         * class.cs (PropertyMethod): Set Parent field in ctors.
4203         (SetMethod.InternalParameters): Add unsafe switch hack.
4204         
4205         * decl.cs (MemberCore.Parent): Cannot be readonly.
4206
4207 2005-01-06  Raja R Harinath  <rharinath@novell.com>
4208
4209         * decl.cs (DeclSpace.ResolveType): Remove.
4210         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4211         Merge in code from ...
4212         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
4213         * class.cs, enum.cs: Update to changes.
4214
4215 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
4216
4217         * anonymous.cs: Ensure that we init the scope of our parent if it
4218         has not been initialized yet.
4219
4220 2004-12-30  Duncan Mak  <duncan@ximian.com>
4221
4222         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4223         if field.FieldBuilder is null. Fixes #70758.
4224
4225         * convert.cs: Fixed some typos and updated some of the comments.
4226         (ImplicitStandardConversionExists):
4227         (TryImplicitIntConversion): If `target_type' is an interface and
4228         the type of `ic' implements this interface, return true or a new
4229         BoxedCast instead of null. This fixes #70468.
4230
4231 2004-12-29  Duncan Mak  <duncan@ximian.com>
4232
4233         * expression.cs (Argument.Emit): Check that Expr is
4234         IMemoryLocation before casting to it, and report CS1510 otherwise.
4235
4236         This fixes #70402.
4237
4238 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
4239
4240         * statement.cs (Block.ThisVariable): remove the recursion here, to
4241         make the --profile more sane.
4242
4243 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
4244
4245         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4246         assembly, by JB Evain.
4247
4248 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4249
4250         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
4251           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4252         "parent" refers to enclosing type/class.  "base" refers to superclass.
4253
4254 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4255
4256         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4257         Ensure that we only have GlobalAttributes.
4258         * attribute.cs (Attribute.Emit): Make non-virtual.
4259         (GlobalAttribute.Emit): Remove.
4260         (Attribute.Resolve): Make virtual.
4261         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
4262         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4263         the argument. Don't create one.
4264         (Attribute.GetObsoleteAttribute): Likewise.
4265         (Attribute.GetClsCompliantAttributeValue): Likewise.
4266         * class.cs, decl.cs: Update to changes.
4267
4268 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
4269
4270         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4271         
4272         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4273         
4274         * statement.cs (Foreach.Resolve): Add error 186 report.
4275
4276 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
4277
4278         * expression.cs (Conditional.DoResolve): Add warning 429.
4279         
4280         * statement.cs (If.Resolve): Add warning 665.
4281
4282 2004-12-16  Raja R Harinath  <rharinath@novell.com>
4283
4284         New invariant: RootContext.Tree.Types.NamespaceEntry == null
4285         except when in the parser, and in GlobalAttribute.
4286         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4287         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4288         RootContext.Tree.Types.NamespaceEntry once work is done.
4289         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
4290         and resets RootContext.Tree.Types.NamespaceEntry.
4291
4292 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
4293
4294         * cs-parser.jay: Don't create a block for every variable.
4295
4296 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
4297
4298         * location.cs: Provide extra information.
4299
4300         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4301         variables from the captured environment, it is the ldarg_0.
4302
4303 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4304
4305         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4306         find a conclusion.
4307         
4308         * class.cs: Changed warning level for 169 to avoid developer
4309         displeasure from warning flooding. It will be changed back when they
4310         fix most of current BCL warnings.
4311         
4312         * RootContext.cs: Pushed default WarningLevel to 3.
4313         
4314         * statement.cs: Removed unused variable.
4315
4316 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4317
4318         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4319         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4320         Add error 502 report.
4321         (StaticClass.DefineType): Add error 441 report.
4322         (Class.AllowedModifiersProp): New virtual property as temporary
4323         extension to AllowedModifiers.
4324         (Class.DefineType): Add error 418 report. Moved ModFlags check here
4325         to share implementation with StaticClass and don't call virtual
4326         methods from ctor.
4327         
4328         * driver.cs (MainDriver): Add error 1558 test.
4329
4330         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4331         report. Moved error 36 test here.
4332
4333         * statement.cs (Throw.Resolve): Add error 724 report.
4334
4335         * typemanager.cs: Add out_attribute_type core type.
4336         
4337 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
4338
4339         * class.cs (TypeContainer.VerifyClsCompliance): Add error
4340         3018 report.
4341         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4342
4343         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4344         3017 report.
4345         
4346         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4347
4348         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
4349         Add error 3023 report.
4350         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4351
4352         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4353         implementation.
4354
4355 2004-12-12  John Luke  <john.luke@gmail.com>
4356
4357         * driver.cs (AddArgs): take -- into account when
4358         adding arguments, fixes bug 65710 
4359
4360 2004-12-12  Martin Baulig  <martin@ximian.com>
4361
4362         * expression.cs (Unary.TryReduceNegative): Added support for
4363         SByteConstant and ByteConstant.
4364         (Unary.Reduce): Check error values from TryReduceNegative().
4365
4366 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
4367
4368         * attributes.cs (Attribute.Resolve): Avoid multiple error report
4369         and report exception as error 182.
4370
4371 2004-12-10  Raja R Harinath  <rharinath@novell.com>
4372
4373         * driver.cs (Main): Fix message when there are warnings.
4374
4375 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
4376
4377         * delegate.cs: Fixed my fix from yesterday, sorry about that.
4378
4379 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
4380
4381         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
4382         Reduced number of warnings.
4383         
4384         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4385
4386 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
4387
4388         * driver.cs: Removed message.
4389
4390         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4391
4392 2004-12-08    <vargaz@freemail.hu>
4393
4394         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4395
4396 2004-12-08  Martin Baulig  <martin@ximian.com>
4397
4398         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4399         instead of a CS3002 for properties and indexer.
4400
4401 2004-12-08  Martin Baulig  <martin@ximian.com>
4402
4403         * decl.cs (MemberName.ToString): Make this work again.
4404
4405 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4406
4407         * attribute.cs (Resolve): Add error 591 detection.
4408
4409         * class.cs (FieldMember.Define): Add error 1547 detection.
4410         (Indexer.Define): Add error 620 detection.
4411         (Operator.Define): Add error 590 detection.
4412
4413         * ecore.cs: Missing argument for error 79.
4414
4415         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4416         detection.
4417
4418 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4419
4420         Fix #70106
4421         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4422         only.
4423
4424 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4425
4426         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4427           Some operator comments were suppressed.
4428         * doc.cs : Implicit/explicit operator name in doc comments are like
4429           "op_Explicit(type)~returnType", so added suffix handling.
4430
4431 2004-12-07  Martin Baulig  <martin@ximian.com>
4432
4433         * decl.cs
4434         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4435         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4436         (DeclSpace.ec): New protected field; store the EmitContext here.
4437         (DeclSpace.EmitContext): New public property; moved here from
4438         `TypeContainer'.
4439         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4440         EmitContext.
4441
4442         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4443         (Enum.Emit): Don't create a new EmitContext.
4444
4445         * delegate.cs (Delegate.DefineType): Always create the
4446         EmitContext.
4447
4448         * iterators.cs (Iterators.DefineIterator): Create a new
4449         EmitContext and store it in `ec'.
4450
4451 2004-08-24  Martin Baulig  <martin@ximian.com>
4452
4453         * typemanager.cs
4454         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
4455         this for accessibility checks.
4456         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
4457         IsNestedFamilyAccessible.
4458         (TypeManager.IsSubclassOf): New method, do what the name actually
4459         says.   
4460
4461 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4462
4463         Fix crash on cs0657-17.cs.
4464         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4465         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4466         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4467         the case where the NamespaceEntry gets overwritten.
4468
4469 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4470
4471         Fixed #69195, #56821
4472         * ecore.cs (ResolveBoolean): Tiny refactoring.
4473
4474         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4475         of right expression resolving when left is false constant and
4476         operator is LogicalAnd OR true constant and operator is LogicalOr.
4477
4478         * statement.cs (ResolveUnreachable): Always reports warning.
4479
4480 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4481
4482         * class.cs: Distinguish between 1721 and 1722 (just a little help
4483         for the programmer).
4484
4485 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4486
4487         * delegate.cs: Only allow this on new versions of the language. 
4488
4489 2004-12-02  Duncan Mak  <duncan@ximian.com>
4490
4491         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4492         Expression class.
4493         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4494         here as a static method. Take an additional bool out parameter
4495         `must_do_cs1540_check' for signaling to InstanceResolve.
4496         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4497         member field from PropertyExpr class and made it an argument of
4498         the method instead.
4499         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4500         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4501         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4502         and `remove_accessor' as well as InstanceResolve: report CS0122
4503         where applicable.
4504
4505         Fixes #70129.
4506
4507 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4508
4509         Fix test-327.cs, test-328.cs, and put in early infrastructure
4510         for eventually fixing #52697.
4511         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4512         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4513         from other methods.
4514         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4515         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4516         (VerifyUsing, error246): Update.
4517         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4518         'NamespaceEntry.LookupNamespaceOrType'.
4519
4520 2004-12-03  Martin Baulig  <martin@ximian.com>
4521
4522         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4523         method as our child, call AnonymousMethod.Compatible() on it.
4524
4525 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4526
4527         Disable XML documentation support in 'basic' profile.
4528         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
4529         Redirect XmlElement to System.Object.
4530         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
4531         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
4532         * mcs.exe.sources: Add doc-bootstrap.cs.
4533         * doc-bootstrap.cs: New file.  Contains empty stub implementation
4534         of doc.cs.
4535
4536 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4537
4538         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4539           comments are allowed.
4540
4541 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4542
4543         * delegate.cs: Add checks for subtypes in paramaters and return values
4544         in VerifyMethod () to add support for Covariance/Contravariance
4545         in delegates.
4546         
4547 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4548
4549         * report.cs: Remove extra closing parenthesis.
4550
4551         * convert.cs (Error_CannotImplicitConversion): If the name of the
4552         types are the same, provide some extra information.
4553
4554         * class.cs (FieldBase): Use an unused bit field from the field to
4555         encode the `has_offset' property from the FieldMember.  This saves
4556         a couple of Ks on bootstrap compilation.
4557
4558         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4559         method as our child, return the AnonymousMethod resolved
4560         expression.
4561
4562         * expression.cs (New.DoResolve): Allow return values from
4563         NewDelegate to also include AnonymousMethods.
4564
4565         Fixes #70150.
4566
4567 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4568
4569         Fix bug #70102
4570         * attribute.cs (Resolve): Improved implementation of params
4571         attribute arguments.
4572
4573         * support.cs (ParameterData): Add HasParams to be faster.
4574
4575 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4576
4577         all things are for /doc support:
4578
4579         * doc.cs: new file that supports XML documentation generation.
4580         * mcs.exe.sources: added doc.cs.
4581         * driver.cs:
4582           Handle /doc command line option.
4583           Report error 2006 instead of 5 for missing file name for /doc.
4584           Generate XML documentation when required, after type resolution.
4585         * cs-tokenizer.cs:
4586           Added support for picking up documentation (/// and /** ... */),
4587           including a new XmlCommentState enumeration.
4588         * cs-parser.jay:
4589           Added lines to fill Documentation element for field, constant,
4590           property, indexer, method, constructor, destructor, operator, event
4591           and class, struct, interface, delegate, enum.
4592           Added lines to warn incorrect comment.
4593         * rootcontext.cs :
4594           Added Documentation field (passed only when /doc was specified).
4595         * decl.cs:
4596           Added DocComment, DocCommentHeader, GenerateDocComment() and
4597           OnGenerateDocComment() and some supporting private members for
4598           /doc feature to MemberCore.
4599         * class.cs:
4600           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4601         * delegate.cs:
4602           Added overriden DocCommentHeader.
4603         * enum.cs:
4604           Added overriden DocCommentHeader and GenerateDocComment().
4605
4606 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4607
4608         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4609         unwrapping the enumeration values, chain to
4610         DoConstantNumericPromotions again, so we can promote things to the
4611         fundamental types (takes care of enums that are bytes, sbytes).
4612
4613         Fixes bug #62054.
4614
4615 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4616
4617         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4618         Fix long-standing bug in type-lookup.  Use FindType instead of
4619         LookupType when ec.ResolvingTypeTree.
4620         (Attribute.ResolveType, Attribute.Resolve)
4621         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4622         Update to changes.
4623         (Attributes.Search): Remove internal version.  Update.
4624         (Attributes.SearchMulti): Update.
4625         (Attributes.GetClsCompliantAttribute): Remove.
4626         (Attributes.GetIndexerNameAttribute): Remove.
4627         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4628         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4629         * class.cs (Indexer.Define): Likewise.
4630
4631 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4632
4633         Fix bug #68790
4634         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4635         MarshallByReference members access.
4636
4637         * expression.cs: Use CheckMarshallByRefAccess;
4638         Better error CS0197 message.
4639
4640         * report.cs: Print whole related error message.
4641
4642 2004-11-30  Raja R Harinath  <rharinath@novell.com>
4643
4644         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
4645         the current directory to help debugging.
4646
4647 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4648
4649         * class (GetClassBases): Better error 60 report.
4650         (EventProperty): Disabled warning 67 detection.
4651
4652 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4653
4654         Fix bug #60324
4655         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4656
4657         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4658         precise values.
4659
4660 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4661
4662         Fix bug #49488
4663         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4664
4665         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4666
4667 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4668
4669         * attribute.cs (Attribute.Resolve): Refine error reporting and
4670         report a cs0117 if the identifier does not exist, to distinguish
4671         from 0617 which is a miss-use of the actual identifier.
4672
4673         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4674         between cs0070 and cs0079.
4675
4676         * class.cs (MemberBase.DoDefine): When reporting a wrong
4677         accessibility level, we use MethodCore to compare instead of
4678         Method (this was a regression in some refactoring effort).
4679
4680         So now we correctly report cs0056 again.
4681
4682         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4683         testing the target_type (which was known to be object_type) and
4684         not the source type (which is anonymous_method).
4685
4686         Fixed reporting of error cs1660.
4687
4688         * expression.cs (UserCast.Source): Expose the underlying cast.
4689
4690         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4691         allowed types to find a match to int32 first (most common).
4692
4693         In addition, it ignores any ImplicitUserConversions that did an
4694         internal implicit conversion (as the switch statement allows only
4695         one integral conversion to exist).
4696
4697         * class.cs (PartialContainer.Create): rename `name' to
4698         `member_name' for clarity.  Then replace the string calls with a
4699         call to MemberName.GetPartialName, as now using
4700         MemberName.ToString is an error (this is due to the side effects
4701         it had, that were fixed in the past).
4702
4703         This will restore the error reporting on a number of partial class
4704         errors that were missusing this (and getting an exception as a
4705         results, which is now just a plain textual warning, because
4706         yyparse debug output would crash otherwise).
4707
4708 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4709
4710         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4711
4712 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4713
4714         * rootcontext.cs (LookupType): Make sure to cache lookups that
4715         don't give us a negative result. This saves about 5% of corlib
4716         compilation time.
4717
4718 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4719
4720         * report.cs (AbstractMessage.Print): messages are sent to stderr
4721
4722         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4723         non-interface in the list of interfaces (at this point, either
4724         parent was properly set, or a base class is being listed in the
4725         interfaces section).
4726
4727         This flags error 1722, and resolves the crash from bug 69259.
4728
4729 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4730
4731         * statement.cs (Using.EmitExpressionFinally): make this work right
4732         for valuetypes. Fixes 69926.
4733
4734 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4735
4736         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4737         converted to an enum" here, before we try to change the underlying
4738         type.  This code exists, but it is a different code path than the
4739         one used while encoding constants.
4740
4741         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4742         old bug: when converting from the null literal to a pointer,
4743         return an EmptyCast, not the NullLiteral.
4744
4745         This fixes #69921, the recent null_type changes probably made this
4746         bug more prominent.
4747
4748         (ImplicitReferenceConversionExists): In addition, resynchronized
4749         the code here, so it matches the same code in
4750         ImplicitReferenceConversionExists for the `from any class-type S
4751         to any interface-type T'.
4752         
4753
4754 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4755
4756         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4757
4758 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4759
4760         * cs-parser.jay: Use verbosity accordingly. 
4761
4762 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4763
4764         * expression.cs (Unary.ResolveOperator): Do not report warning;
4765         AddressOf reads from variable.
4766         
4767         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4768
4769 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4770
4771         Fix bug #69462
4772
4773         * attribute.cs (Attributable): Removed CheckTargets.
4774         (Attributes.Emit): Explicit attribute targets are tested here.
4775
4776         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4777         not enabled for interfaces.
4778
4779         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4780         (GetAssemblyName): Ouch next bug there.
4781
4782 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4783
4784         * expression.cs: Error 275 added.
4785         
4786 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4787
4788         Fix bug #69177 (Implemented decimal constant support)
4789
4790         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4791         (BinaryFold): Add DecimalConstant.
4792
4793         * const.cs (Define): Decimal constant 
4794         (is not constant.
4795         (ChangeType): Add decimal type handling.
4796         (LookupConstantValue): Don't set value for decimal type but
4797         emit DecimalConstantAttribute. Needed for constant optimization.
4798
4799         * constant.cs (ToDecimal): New method.
4800         (ConvertToDecimal): New method.
4801         (IntConstant): Implemented ConvertToDecimal.
4802         (DecimalConstant.Emit): Emit optimized version for decimals in
4803         int range.
4804
4805         * expression.cs (ResolveOperator): Changed order of constant
4806         reduction to work correctly with native types which have
4807         overloaded operators.
4808         (ResolveMemberAccess): Extract constant value from attribute
4809         for decimal type.
4810
4811         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4812
4813         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4814         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4815         (ChangeType): Decimal is special.
4816         (TypeToCoreType): Add decimal type.
4817
4818 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4819
4820         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4821         decimal types.
4822
4823 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4824
4825         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4826         test cs1667-5.cs.
4827
4828 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4829
4830         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4831
4832         * pending.cs (PendingImplementation): Grab only interfaces.
4833
4834 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4835
4836         * statement.cs (ForeachHelperMethods): Add location member and
4837         error 202 detection.
4838
4839 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4840
4841         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4842         automatically handled by executable.make.
4843         (PROGRAM): Make profile-specific.
4844
4845 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4846
4847         * expression.cs (DoResolveBase): Fixed wrong warning for out
4848         variables.
4849
4850 2004-11-18  Martin Baulig  <martin@ximian.com>
4851
4852         Merged latest changes into gmcs.  Please keep this comment in
4853         here, it makes it easier for me to see what changed in MCS since
4854         the last time I merged.
4855
4856 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4857
4858         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4859         (TypeHandle.GetMemberCache): New.
4860         (TypeHandle.TypeHandle): Update.
4861         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4862         (TypeManager.LookupParentInterfacesCache):
4863         Rename from LookupInterfaceCache.  Optimize slightly.
4864         (TypeManager.MemberLookup_FindMembers): Update.
4865         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4866         multi-type variant.
4867         (AddCacheContents): Rename from AddHashtable.
4868         * class.cs (TypeContainer.parent_container): Remove.
4869         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4870         (TypeContainer.DoDefineMembers): Don't initialize it.
4871         Update to name changes.
4872         
4873 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4874
4875         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4876         that factors the code to check access modifiers on override.  
4877
4878         (PropertyBase): Use the code here.
4879
4880         Patch from Lluis S'anchez, fixes bug #69361.
4881
4882 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4883
4884         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4885         routine that is used to report the use of a captured variable
4886         whose address has been taken.
4887
4888         There are two checks: one when variables are being captured and
4889         the other check is when the address of a variable is taken. 
4890         
4891         (because an anonymous methods might be resolved before *or* after
4892         the address has been taken) and 
4893
4894         * expression.cs (Conditional.DoResolve): Remove the special
4895         casing that Martin added to trueExpr and falseExpr being both
4896         NullLiteral.  We get the right behavior now just by introducing
4897         the null_type into the compiler. 
4898
4899         * convert.cs (ExplicitConversion): Change the code to use
4900         null_type instead of testing `expr is NullLiteral'.
4901         (ImplicitConversionStandard): use null_type too.
4902         (ImplicitReferenceConversionExists): use null_type too.
4903         (ImplicitReferenceConversion): use null_type too.
4904
4905         * literal.cs: The type of `NullLiteral' is now null_type instead
4906         of object_type. 
4907         (Resolve): Set the type here.
4908
4909         * typemanager.cs: Introduce null_type.
4910
4911 2004-11-17  Martin Baulig  <martin@ximian.com>
4912
4913         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4914         direction, like FindMembers() does.  Fixes #69546, testcase is in
4915         test-315.cs.    
4916
4917 2004-11-16  Martin Baulig  <martin@ximian.com>
4918
4919         This is based on a patch from Marek Safar, see bug #69082.
4920         Fixes bugs #63705 and #67130.
4921
4922         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4923         method; create a MemberCache for an interface type and cache the
4924         result.
4925
4926         * decl.cs (IMemberContainer.ParentContainer): Removed.
4927         (IMemberContainer.ParentCache): New property.
4928         (MemberCache.SetupCacheForInterface): Removed.
4929         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4930         to create a cache for an interface's "parent".
4931
4932         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4933         interfaces too.
4934
4935 2004-11-16  Martin Baulig  <martin@ximian.com>
4936
4937         Merged back from gmcs; these changes already went into gmcs a
4938         couple of weeks ago.
4939
4940         * typemanager.cs
4941         (TypeManager.AddUserType): Removed the `ifaces' argument.
4942         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4943         `TypeExpr []'.
4944         (TypeManager.AddUserInterface): Removed.
4945         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4946         `TypeExpr []'.
4947         (TypeManager.GetInterfaces): Likewise.
4948         (TypeManager.GetExplicitInterfaces): Likewise.
4949
4950         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4951
4952         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4953         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4954
4955 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4956
4957         * statement.cs: Avoid adding bools to a hashtable.
4958
4959 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4960
4961         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4962         calling an unsafe method from a safe location.
4963
4964 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4965
4966         Fix #69167
4967         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4968
4969 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4970
4971         * namespace.cs (VerifyUsing): use GetPartialName instead of
4972         ToString. 
4973
4974 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4975
4976         * statement.cs (Return.Resolve): Fix regression in typo: if
4977         `in_exc', we have to request a NeedReturnLabel, this was a typo
4978         introduced in the anonymous method check-in.  Fixes #69131.
4979
4980         * Indexers were using the ShortName when defining themselves,
4981         causing a regression in the compiler bootstrap when applying the
4982         patch from 2004-11-02 (first part), now they use their full name
4983         and the bug is gone.
4984
4985 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4986
4987         * driver.cs: Strip the path from the names of embedded resources. Fixes
4988         #68519.
4989
4990 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4991
4992         Fix error message regression: cs0104-2.cs.
4993         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4994         (AliasEntry.Resolve): Update.
4995         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4996         'silent' flag.
4997         (RootContext.LookupType): Update.
4998
4999 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
5000
5001         * cs-parser.jay: Add support for handling accessor modifiers
5002         * class: Add support port accessor modifiers and error checking,
5003         define PropertyMethod.Define as virtual (not abstract anymore)
5004         * ecore.cs: Add checking for proeprties access with access modifiers
5005         * iterators.cs: Modify Accessor constructor call based in the modified
5006         constructor
5007 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
5008
5009         * expression.cs (StringConcat): Handle being called twice,
5010         as when we have a concat in a field init with more than two
5011         ctors in the class
5012
5013 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
5014
5015         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5016         special case explicit implementations, we should always produce
5017         the .property or .event declaration.
5018         
5019         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5020         since it will not return correct data if people use this
5021         unresolved in the presence of using statements (see test-313).
5022
5023         * class.cs (MethodData.Define): If we are an explicit interface
5024         implementation, set the method name to the full name of the
5025         interface plus the name of the method.  
5026
5027         Notice that using the method.MethodName.GetFullName() does not
5028         work, as it will only contain the name as declared on the source
5029         file (it can be a shorthand in the presence of using statements)
5030         and not the fully qualifed type name, for example:
5031
5032         using System;
5033
5034         class D : ICloneable {
5035                 object ICloneable.Clone ()  {
5036                 }
5037         }
5038
5039         Would produce a method called `ICloneable.Clone' instead of
5040         `System.ICloneable.Clone'.
5041
5042         * namespace.cs (Alias.Resolve): Use GetPartialName.
5043         
5044 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5045
5046         * cs-parser.jay: Add error 1055 report.
5047
5048 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
5049
5050         * assign.cs (Assign.DoResolve): Only do the transform of
5051         assignment into a New if the types are compatible, if not, fall
5052         through and let the implicit code deal with the errors and with
5053         the necessary conversions. 
5054
5055 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5056
5057         * cs-parser.jay: Add error 1031 report.
5058
5059         * cs-tokenizer.cs: Add location for error 1038.
5060
5061 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5062
5063         * cs-parser.jay: Add error 1016 report.
5064
5065 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5066
5067         * cs-parser.jay: Add errors 1575,1611 report.
5068
5069 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5070
5071         * cs-parser.jay: Add error 1001 report.
5072
5073 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5074
5075         Fix #68850
5076         * attribute.cs (GetMarshal): Add method argument for
5077         caller identification.
5078
5079         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5080         agument for GetMarshal and RuntimeMissingSupport.
5081
5082 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5083
5084         * attribute.cs (ExtractSecurityPermissionSet): Removed
5085         TypeManager.code_access_permission_type.
5086
5087         * typemanager.cs: Removed TypeManager.code_access_permission_type.
5088
5089 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
5090
5091         * expression.cs (LocalVariableReference.DoResolveLValue): Check
5092         for obsolete use of a variable here.   Fixes regression on errors
5093         cs0619-25 and cs0619-26.
5094
5095 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
5096
5097         Fix #62358, implemented security attribute encoding.
5098
5099         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5100         Tests permitted SecurityAction for assembly or other types.
5101         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5102         data from SecurityPermissionAttribute to PermisionSet class.
5103
5104         * class.cs (ApplyAttributeBuilder): Added special handling
5105         for System.Security.Permissions.SecurityAttribute based types.
5106
5107         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5108         special handling for System.Security.Permissions.SecurityAttribute
5109         based types.
5110
5111         * enum.cs (ApplyAttributeBuilder): Added special handling
5112         for System.Security.Permissions.SecurityAttribute based types.
5113
5114         * parameter.cs (ApplyAttributeBuilder): Added special handling
5115         for System.Security.Permissions.SecurityAttribute based types.
5116
5117         * rootcontext.cs: Next 2 core types.
5118
5119         * typemanager.cs (TypeManager.security_permission_attr_type):
5120         Built in type for the SecurityPermission Attribute.
5121         (code_access_permission_type): Build in type.
5122
5123 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
5124
5125         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5126         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5127         all of this information into
5128         EmitContext.EmitCapturedVariableInstance.
5129         
5130         * codegen.cs (EmitCapturedVariableInstance): move here the
5131         funcionality of emitting an ldarg.0 in the presence of a
5132         remapping.   This centralizes the instance emit code.
5133
5134         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5135         then emit a load of this: it means that we have reached the
5136         topmost ScopeInfo: the one that contains the pointer to the
5137         instance of the class hosting the anonymous method.
5138
5139         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5140         captures to the topmost CaptureContext.
5141
5142 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
5143
5144         * expression.cs (LocalVariableReference): Move the knowledge about
5145         the iterators into codegen's EmitCapturedVariableInstance.
5146
5147 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
5148
5149         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5150         all code paths return a value from an anonymous method (it is the
5151         same as the 161 error, but for anonymous methods).
5152
5153 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
5154
5155         The introduction of anonymous methods in the compiler changed
5156         various ways of doing things in the compiler.  The most
5157         significant one is the hard split between the resolution phase
5158         and the emission phases of the compiler.
5159
5160         For instance, routines that referenced local variables no
5161         longer can safely create temporary variables during the
5162         resolution phase: they must do so from the emission phase,
5163         since the variable might have been "captured", hence access to
5164         it can not be done with the local-variable operations from the runtime.
5165         
5166         * statement.cs 
5167
5168         (Block.Flags): New flag `IsTopLevel' to indicate that this block
5169         is a toplevel block.
5170
5171         (ToplevelBlock): A new kind of Block, these are the blocks that
5172         are created by the parser for all toplevel method bodies.  These
5173         include methods, accessors and anonymous methods.
5174
5175         These contain some extra information not found in regular blocks:
5176         A pointer to an optional CaptureContext (for tracking captured
5177         local variables and parameters).  A pointer to the parent
5178         ToplevelBlock.
5179         
5180         (Return.Resolve): Catch missmatches when returning a value from an
5181         anonymous method (error 1662).
5182         Invoke NeedReturnLabel from the Resolve phase instead of the emit
5183         phase.
5184
5185         (Break.Resolve): ditto.
5186
5187         (SwitchLabel): instead of defining the labels during the
5188         resolution phase, we now turned the public ILLabel and ILLabelCode
5189         labels into methods called GetILLabelCode() and GetILLabel() that
5190         only define the label during the Emit phase.
5191
5192         (GotoCase): Track the SwitchLabel instead of the computed label
5193         (its contained therein).  Emit the code by using
5194         SwitchLabel.GetILLabelCode ().
5195
5196         (LocalInfo.Flags.Captured): A new flag has been introduce to track
5197         whether the Local has been captured or not.
5198
5199         (LocalInfo.IsCaptured): New property, used to tell whether the
5200         local has been captured.
5201         
5202         * anonymous.cs: Vastly updated to contain the anonymous method
5203         support.
5204
5205         The main classes here are: CaptureContext which tracks any
5206         captured information for a toplevel block and ScopeInfo used to
5207         track the activation frames for various local variables.   
5208
5209         Each toplevel block has an optional capture context associated
5210         with it.  When a method contains an anonymous method both the
5211         toplevel method and the anonymous method will create a capture
5212         context.   When variables or parameters are captured, they are
5213         recorded on the CaptureContext that owns them, for example:
5214
5215         void Demo () {
5216              int a;
5217              MyDelegate d = delegate {
5218                  a = 1;
5219              }
5220         }
5221
5222         Here `a' will be recorded as captured on the toplevel
5223         CapturedContext, the inner captured context will not have anything
5224         (it will only have data if local variables or parameters from it
5225         are captured in a nested anonymous method.
5226
5227         The ScopeInfo is used to track the activation frames for local
5228         variables, for example:
5229
5230         for (int i = 0; i < 10; i++)
5231                 for (int j = 0; j < 10; j++){
5232                    MyDelegate d = delegate {
5233                         call (i, j);
5234                    }
5235                 }
5236
5237         At runtime this captures a single captured variable `i', but it
5238         captures 10 different versions of the variable `j'.  The variable
5239         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5240         recorded on a child.  
5241
5242         The toplevel ScopeInfo will also track information like the `this'
5243         pointer if instance variables were referenced (this is necessary
5244         as the anonymous method lives inside a nested class in the host
5245         type of the method). 
5246
5247         (AnonymousMethod): Expanded to track the Toplevel, implement
5248         `AnonymousMethod.Compatible' to tell whether an anonymous method
5249         can be converted to a target delegate type. 
5250
5251         The routine now also produces the anonymous method content
5252
5253         (AnonymousDelegate): A helper class that derives from
5254         DelegateCreation, this is used to generate the code necessary to
5255         produce the delegate for the anonymous method that was created. 
5256
5257         * assign.cs: API adjustments for new changes in
5258         Convert.ImplicitStandardConversionExists.
5259
5260         * class.cs: Adjustments to cope with the fact that now toplevel
5261         blocks are of type `ToplevelBlock'. 
5262
5263         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5264         insteda of standard blocks.
5265
5266         Flag errors if params arguments are passed to anonymous methods.
5267
5268         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5269         `CurrentAnonymousMethod' which points to the current Anonymous
5270         Method.  The variable points to the AnonymousMethod class that
5271         holds the code being compiled.  It is set in the new EmitContext
5272         created for the anonymous method.
5273
5274         (EmitContext.Phase): Introduce a variable and an enumeration to
5275         assist in enforcing some rules about when and where we are allowed
5276         to invoke certain methods (EmitContext.NeedsReturnLabel is the
5277         only one that enfonces this right now).
5278
5279         (EmitContext.HaveCaptureInfo): new helper method that returns
5280         whether we have a CapturedContext initialized.
5281
5282         (EmitContext.CaptureVariable): New method used to register that a
5283         LocalInfo must be flagged for capturing. 
5284
5285         (EmitContext.CapturedParameter): New method used to register that a
5286         parameters must be flagged for capturing. 
5287         
5288         (EmitContext.CapturedField): New method used to register that a
5289         field must be flagged for capturing. 
5290
5291         (EmitContext.HaveCapturedVariables,
5292         EmitContext.HaveCapturedFields): Return whether there are captured
5293         variables or fields. 
5294
5295         (EmitContext.EmitMethodHostInstance): This is used to emit the
5296         instance for the anonymous method.  The instance might be null
5297         (static methods), this (for anonymous methods that capture nothing
5298         and happen to live side-by-side with the current method body) or a
5299         more complicated expression if the method has a CaptureContext.
5300
5301         (EmitContext.EmitTopBlock): Routine that drives the emission of
5302         code: it will first resolve the top block, then emit any metadata
5303         and then emit the code.  The split is done so that we can extract
5304         any anonymous methods and flag any captured variables/parameters.
5305         
5306         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5307         during this phase, the ILGenerator should not be used as labels
5308         and local variables declared here might not be accessible to any
5309         code that is part of an anonymous method.  
5310
5311         Exceptions to this include the temporary variables that are
5312         created by some statements internally for holding temporary
5313         variables. 
5314         
5315         (EmitContext.EmitMeta): New routine, in charge of emitting all the
5316         metadata for a cb
5317
5318         (EmitContext.TemporaryReturn): This method is typically called
5319         from the Emit phase, and its the only place where we allow the
5320         ReturnLabel to be defined other than the EmitMeta.  The reason is
5321         that otherwise we would have to duplicate a lot of logic in the
5322         Resolve phases of various methods that today is on the Emit
5323         phase. 
5324
5325         (EmitContext.NeedReturnLabel): This no longer creates the label,
5326         as the ILGenerator is not valid during the resolve phase.
5327
5328         (EmitContext.EmitThis): Extended the knowledge in this class to
5329         work in anonymous methods in addition to iterators. 
5330
5331         (EmitContext.EmitCapturedVariableInstance): This emits whatever
5332         code is necessary on the stack to access the instance to a local
5333         variable (the variable will be accessed as a field).
5334
5335         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5336         EmitContext.EmitAddressOfParameter): Routines to support
5337         parameters (not completed at this point). 
5338         
5339         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
5340         will also remove the parameters.
5341
5342         * convert.cs (Convert): Define a `ConstantEC' which points to a
5343         null.  This is just to prefity some code that uses
5344         ImplicitStandardConversion code and do not have an EmitContext
5345         handy.
5346
5347         The idea is to flag explicitly that at that point in time, it is
5348         known that the conversion will not trigger the delegate checking
5349         code in implicit conversions (which requires a valid
5350         EmitContext). 
5351
5352         Everywhere: pass new EmitContext parameter since
5353         ImplicitStandardConversionExists now requires it to check for
5354         anonymous method conversions. 
5355
5356         (Convert.ImplicitStandardConversionExists): If the type of an
5357         expression is the anonymous_method_type, and the type is a
5358         delegate, we invoke the AnonymousMethod.Compatible method to check
5359         whether an implicit conversion is possible. 
5360
5361         (Convert.ImplicitConversionStandard): Only do implicit method
5362         group conversions if the language level is not ISO_1.
5363
5364         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5365         MethodInfo for the Invoke method.  used by Delegate and
5366         AnonymousDelegate.
5367
5368         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5369         method conversions if the target type is a delegate.
5370
5371         Removed extra debugging nops.
5372
5373         (LocalVariableReference): Turn the `local_info' into a public
5374         field. 
5375
5376         Add `prepared' field, the same hack used for FieldExprs to cope
5377         with composed assignments, as Local variables do not necessarily
5378         operate purely on the stack as they used to: they can be captured
5379         fields. 
5380
5381         Add `temp' for a temporary result, like fields.
5382
5383         Refactor DoResolve and DoResolveLValue into DoResolveBase.
5384
5385         It now copes with Local variables that are captured and emits the
5386         proper instance variable to load it from a field in the captured
5387         case. 
5388
5389         (ParameterReference.DoResolveBase): During the resolve phase,
5390         capture parameters if we are in an anonymous method.
5391
5392         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5393         anonymous method, use the EmitContext helper routines to emit the
5394         parameter reference.
5395
5396         * iterators.cs: Set RemapToProxy to true/false during the
5397         EmitDispose class.
5398
5399         * parameters.cs (GetParameterByName): New helper method. 
5400
5401         * typemanager.cs (anonymous_method_type) a new type that
5402         represents an anonyous method.  This is always an internal type,
5403         used as a fencepost to test against the anonymous-methodness of an
5404         expression. 
5405         
5406 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5407
5408         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5409         561 report.
5410         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5411
5412 2004-10-18  Martin Baulig  <martin@ximian.com>
5413
5414         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5415         `Type' directly, but call ResolveType() on it.
5416         (Catch.Resolve): Likewise.
5417         (Foreach.Resolve): Likewise.
5418
5419 2004-10-18  Martin Baulig  <martin@ximian.com>
5420
5421         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5422         `Type' directly, but call ResolveType() on it.
5423         (Probe.DoResolve): Likewise.
5424         (ArrayCreation.LookupType): Likewise.
5425         (TypeOf.DoResolve): Likewise.
5426         (SizeOf.DoResolve): Likewise.
5427
5428 2004-10-18  Martin Baulig  <martin@ximian.com>
5429
5430         * expression.cs (Invocation.BetterFunction): Put back
5431         TypeManager.TypeToCoreType().
5432
5433 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5434
5435         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5436         the ResolveType.
5437
5438 2004-10-18  Martin Baulig  <martin@ximian.com>
5439
5440         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
5441         `Type' directly, but call ResolveType() on it.
5442
5443 2004-10-18  Martin Baulig  <martin@ximian.com>
5444
5445         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5446         `Type' directly, but call ResolveType() on it.
5447         (MemberBase.DoDefine): Likewise.
5448
5449         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5450         `Type' directly, but call ResolveType() on it.
5451         (ComposedCast.DoResolveAsTypeStep): Likewise.
5452
5453         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5454         `Type' directly, but call ResolveType() on it.
5455
5456 2004-10-17  John Luke  <john.luke@gmail.com>
5457
5458         * class.cs (Operator.GetSignatureForError): use CSharpName
5459
5460         * parameter.cs (Parameter.GetSignatureForError): Returns
5461         correct name even if was not defined.
5462
5463 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5464
5465         Fix #65816.
5466         * class.cs (TypeContainer.EmitContext): New property.
5467         (DefineNestedTypes): Create an emitcontext for each part.
5468         (MethodCore.DoDefineParameters): Use container's emitcontext.
5469         Pass type array to InternalParameters.
5470         (MemberBase.DoDefine): Use container's emitcontext.
5471         (FieldMember.Define): Likewise.
5472         (Event.Define): Likewise.
5473         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5474         Pass type array to InternalParameters.
5475         (SetIndexerMethod.GetParameterInfo): Likewise.
5476         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5477         * delegate.cs (Define): Pass emitcontext to
5478         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5479         array to InternalParameters.
5480         * expression.cs (ParameterReference.DoResolveBase): Pass
5481         emitcontext to GetParameterInfo.
5482         (ComposedCast.DoResolveAsTypeStep): Remove check on
5483         ec.ResolvingTypeTree.
5484         * parameter.cs (Parameter.Resolve): Change argument to
5485         EmitContext.  Use ResolveAsTypeTerminal.
5486         (Parameter.GetSignature): Change argument to EmitContext.
5487         (Parameters.ComputeSignature): Likewise.
5488         (Parameters.ComputeParameterTypes): Likewise.
5489         (Parameters.GetParameterInfo): Likewise.
5490         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5491         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5492         * support.cs (InternalParameters..ctor): Remove variant that takes
5493         a DeclSpace.
5494         * typemanager.cs (system_intptr_expr): New.
5495         (InitExpressionTypes): Initialize it.
5496
5497 2004-10-12  Chris Toshok  <toshok@ximian.com>
5498
5499         * cs-parser.jay: fix location for try_statement and catch_clause.
5500
5501 2004-10-11  Martin Baulig  <martin@ximian.com>
5502
5503         * report.cs: Don't make --fatal abort on warnings, we have
5504         -warnaserror for that.
5505
5506 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5507
5508         More DeclSpace.ResolveType avoidance.
5509         * decl.cs (MemberCore.InUnsafe): New property.
5510         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5511         with newly created EmitContext.
5512         (FieldMember.Define): Likewise.
5513         * delegate.cs (Delegate.Define): Likewise.
5514         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5515         only if normal name-lookup fails.
5516         (TypeExpr.DoResolve): Enable error-checking.
5517         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5518         (SizeOf.DoResolve): Likewise.
5519         (ComposedCast.DoResolveAsTypeStep): Likewise.
5520         (StackAlloc.DoResolve): Likewise.
5521         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5522         (Block.Unsafe): New property.
5523         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5524         (Unsafe): Set 'unsafe' flag of contained block.
5525         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5526         (Fixed.Resolve): Likewise.
5527         (Catch.Resolve): Likewise.
5528         (Using.ResolveLocalVariableDecls): Likewise.
5529         (Foreach.Resolve): Likewise.
5530
5531 2004-10-05  John Luke <john.luke@gmail.com>
5532
5533         * cs-parser.jay: add location to error CS0175
5534
5535 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5536
5537         * ecore.cs (Expression.Constantity): Add support for turning null
5538         into a constant.
5539
5540         * const.cs (Const.Define): Allow constants to be reference types
5541         as long as the value is Null.
5542
5543 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5544
5545         * namespace.cs (NamespaceEntry.Using): No matter which warning
5546         level is set, check if this namespace name has already been added.
5547
5548 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5549
5550         * expression.cs: reftype [!=]= null should always use br[true,false].
5551         # 67410
5552
5553 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5554
5555         Fix #67108
5556         * attribute.cs: Enum conversion moved to 
5557         GetAttributeArgumentExpression to be applied to the all
5558         expressions.
5559
5560 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5561
5562         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5563         * class.c (TypeContainer.DefineType): Flag error if
5564         base types aren't accessible due to access permissions.
5565         * decl.cs (DeclSpace.ResolveType): Move logic to
5566         Expression.ResolveAsTypeTerminal.
5567         (DeclSpace.ResolveTypeExpr): Thin layer over
5568         Expression.ResolveAsTypeTerminal.
5569         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5570         Refactor code into NestedAccess.  Use it.
5571         (DeclSpace.NestedAccess): New.
5572         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5573         argument to silence errors.  Check access permissions.
5574         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5575         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5576         (Cast.DoResolve): Likewise.
5577         (New.DoResolve): Likewise.
5578         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5579         (TypeOf.DoResolve): Likewise.
5580
5581         * expression.cs (Invocation.BetterConversion): Return the Type of
5582         the better conversion.  Implement section 14.4.2.3 more faithfully.
5583         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5584         section 14.4.2.2 explicit.
5585         (Invocation.OverloadResolve): Update.
5586         (Invocation): Remove is_base field.
5587         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5588         (Invocation.Emit): Likewise.
5589
5590 2004-09-27  Raja R Harinath  <rharinath@novell.com>
5591
5592         * README: Update to changes.
5593
5594 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5595
5596         * cs-parser.jay: Reverted 642 warning fix.
5597
5598 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5599
5600         Fix bug #66615
5601         * decl.cs (FindMemberWithSameName): Indexer can have more than
5602         1 argument.
5603
5604 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5605
5606         * expression.cs (LocalVariableReference.DoResolveLValue):
5607         Do not report warning 219 for out values.
5608         (EmptyExpression.Null): New member to avoid extra allocations.
5609
5610 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5611
5612         * cs-parser.jay: Fix wrong warning 642 report.
5613
5614         * cs-tokenizer.cs (CheckNextToken): New helper;
5615         Inspect next character if is same as expected.
5616
5617 2004-09-23  Martin Baulig  <martin@ximian.com>
5618
5619         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5620         (Convert.ImplicitReferenceConversionExists): Likewise.
5621
5622 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5623
5624         * class.cs (Operator.Define): Add error 448 and 559 report.
5625
5626 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5627
5628         * class.cs (MemberBase.IsTypePermitted): New protected
5629         method for checking error CS0610.
5630
5631 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5632
5633         * class.cs (TypeContainer.HasExplicitLayout): New property
5634         Returns whether container has StructLayout attribute set Explicit.
5635         (FieldMember): New abstract class for consts and fields.
5636         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5637         (Field): Reuse FieldMember.
5638
5639         * const.cs (Const): Reuse FieldMember.
5640
5641         * rootcontext.cs: EmitConstants call moved to class.
5642
5643 2004-09-22  Martin Baulig  <martin@ximian.com>
5644
5645         Thanks to Peter Sestoft for this bug report.
5646
5647         * expression.cs (Conditional): If both the `trueExpr' and the
5648         `falseExpr' is a NullLiteral, return a NullLiteral.
5649
5650 2004-09-22  Martin Baulig  <martin@ximian.com>
5651
5652         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5653         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5654         for the "get_Current" call.
5655
5656 2004-09-22  Martin Baulig  <martin@ximian.com>
5657
5658         Marek and me just fixed one of our oldest bugs: #28562 :-)
5659
5660         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5661
5662         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5663         we're an EnumConstant, just return that.
5664         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5665         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5666         to get the value which'll actually be written into the attribute.
5667         However, we have to use GetValue() to access the attribute's value
5668         in the compiler.        
5669
5670 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5671
5672         * constant.cs (Constant.IsNegative): New abstract property
5673         IsNegative.
5674
5675         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5676         (StackAlloc.DoResolve): Reused IsNegative.
5677
5678 2004-09-21  Martin Baulig  <martin@ximian.com>
5679
5680         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5681         if we're used in an iterator, we may be called from different
5682         methods.
5683
5684         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5685         we actually have an exception block.
5686
5687 2004-09-20  John Luke <jluke@cfl.rr.com>
5688
5689         * class.cs, cs-parser.jay: Improve the error report for 1520:
5690         report the actual line where the error happens, not where the
5691         class was declared.
5692
5693         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5694         Pass location information that was available elsewhere.
5695
5696 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
5697
5698         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5699         runtime to delay sign assemblies.
5700
5701 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5702
5703         * cs-parser.jay: Do not report the stack trace, this is barely
5704         used nowadays.
5705
5706 2004-08-22  John Luke  <john.luke@gmail.com>
5707  
5708         * driver.cs : check that a resource id is not already used
5709         before adding it, report CS1508 if it is, bug #63637
5710
5711 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5712
5713         * ecore.cs: Removed dead code.
5714
5715 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5716
5717         * class.cs: Do not report warning CS0067 on the interfaces.
5718
5719 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5720
5721         * cs-parser.jay: Add error 504 report.
5722
5723 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5724
5725         * rootcontext.cs: WarningLevel is 4 by default now.
5726
5727         * statement.cs (Fixed.Resolve): Do not null
5728         VariableInfo.
5729
5730 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5731
5732         Fixed bug #55780
5733         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5734         deep search when property is not virtual.
5735         (PropertyExpr.ResolveAccessors): Make one call for both
5736         accessors.
5737
5738 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5739
5740         Fixed bug #65766
5741         * statement.cs: Error 152 report constains also location.
5742
5743 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5744
5745         Fixed bug #65766
5746         * const.cs: Explicitly set constant as static.
5747
5748 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5749
5750         Fixed bug #64226
5751         * cs-parser.jay: Add error 1017 report.
5752
5753 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5754
5755         Fixed bug #59980, #64224
5756         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5757
5758         * typemanager.cs (IsSpecialMethod): Simplified
5759
5760 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5761
5762         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5763         condition with better params.
5764
5765 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5766
5767         Fixed bug #65238
5768         * attribute.cs (Resolve): Property has to have both
5769         accessors.
5770
5771 2004-09-14  Martin Baulig  <martin@ximian.com>
5772
5773         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5774
5775 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5776
5777         Fixed bug #61902
5778         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5779         called and is obsolete then this member suppress message
5780         when call is inside next [Obsolete] method or type.
5781
5782         * expression.cs: Use TestObsoleteMethodUsage member.
5783
5784 2004-09-14  Martin Baulig  <martin@ximian.com>
5785
5786         * cs-parser.jay: Sync a bit with the GMCS version.
5787
5788 2004-09-14  Martin Baulig  <martin@ximian.com>
5789
5790         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5791         (CSharpParser.yacc_verbose_flag): New public field.
5792
5793         * genericparser.cs: Removed.
5794
5795 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5796
5797         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5798
5799 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5800
5801         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5802
5803 2004-09-10  Martin Baulig  <martin@ximian.com>
5804
5805         Backported my MemberName changes from GMCS into MCS.
5806
5807         - we are now using a special `MemberName' class instead of using
5808         strings; in GMCS, the `MemberName' also contains the type
5809         arguments.
5810
5811         - changed the grammar rules a bit:
5812           * the old `member_name' is now a `namespace_or_type_name':
5813             The rule is that we use `namespace_or_type_name' everywhere
5814             where we expect either a "member name" (GetEnumerator) or a
5815             "member name" with an explicit interface name
5816             (IEnumerable.GetEnumerator).
5817             In GMCS, the explicit interface name may include type arguments
5818             (IEnumerable<T>.GetEnumerator).
5819           * we use `member_name' instead of just `IDENTIFIER' for
5820             "member names":
5821             The rule is that we use `member_name' wherever a member may
5822             have type parameters in GMCS.       
5823
5824         * decl.cs (MemberName): New public class.
5825         (MemberCore.MemberName): New public readonly field.
5826         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5827         (DeclSpace): Likewise.
5828
5829         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5830         * enum.cs (Enum.ctor): Likewise.
5831
5832         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5833         MemberName.     
5834         (AliasEntry.ctor): Take a MemberName, not an Expression.
5835         (AliasEntry.UsingAlias): Likewise.
5836
5837         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5838         (IMethodData.MemberName): Changed type from string to MemberName.
5839         (MemberBase.ExplicitInterfaceName): Likewise.
5840         (AbstractPropertyEventMethod.SetupName): Make this private.
5841         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5842         argument; compute the member name here.
5843         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5844         on the `member.MemberName' and the `prefix'.
5845
5846         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5847         not `type_name'.
5848         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5849         thus, we get a `MemberName' instead of a `string'.  These
5850         declarations may have type parameters in GMCS.
5851         (interface_method_declaration, delegate_declaration): Likewise.
5852         (class_declaration, interface_declaration): Likewise.
5853         (method_header): Use `namespace_or_type_name' instead of
5854         `member_name'.  We may be an explicit interface implementation.
5855         (property_declaration, event_declaration): Likewise.
5856         (member_name): This is now just an `IDENTIFIER', not a
5857         `namespace_or_type_name'.
5858         (type_name, interface_type): Removed.
5859         (namespace_or_type_name): Return a MemberName, not an Expression.
5860         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5861         call GetTypeExpression() on the MemberName to get an expression.
5862         (IndexerDeclaration.interface_type): Changed type from string to
5863         MemberName.
5864         (MakeName): Operate on MemberName's instead of string's.
5865
5866 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5867
5868         Fix bug #55770.
5869         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5870         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5871         lookup to avoid symbols introduced by 'using'.
5872         * rootcontext.cs (NamespaceLookup): Update.
5873
5874 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5875
5876         * class.cs (TypeContainer.DoDefineMembers): Do not call
5877         DefineDefaultConstructor for static classes.
5878
5879 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5880
5881         * attribute.cs (Attribute.Resolve): Add error 653 report.
5882
5883         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5884         report.
5885         (Method.ApplyAttributeBuilder): Add error 685 report.
5886         (Operator.Define): Add error 564 report.
5887
5888         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5889
5890         * expression.cs (Invocation.DoResolve): Add error
5891         245 and 250 report.
5892
5893         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5894         error 674 report.
5895
5896 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5897
5898         * class.cs (ConstructorInitializer.Resolve):
5899         Wrong error number (515->516).
5900
5901 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5902
5903         * class.cs (Indexer.Define): Add error 631 report.
5904
5905 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5906
5907         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5908
5909 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5910
5911         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5912
5913 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5914
5915         * cs-parser.jay: Added error CS0241 report.
5916
5917 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5918
5919         * cs-parser.jay (fixed_statement): Introduce a scope for the
5920         declaration in the 'fixed' statement.
5921
5922 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5923
5924         * cs-parser.jay: Added CS0230 error report.
5925
5926 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5927
5928         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5929
5930 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5931
5932         * expression.cs (Argument.Resolve): Added error CS0192 and
5933         CS0199 report.
5934
5935 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5936
5937         C# 2.0 #pragma warning feature
5938
5939         * cs-tokenizer.cs (PreProcessPragma): New method; 
5940         Handles #pragma directive.
5941
5942         * report.cs (WarningRegions): New class; Support
5943         class for #pragma warning directive. It tests whether
5944         warning is enabled for a given line.
5945
5946 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5947
5948         * const.cs: Add more descriptive error report, tahnks to
5949         Sebastien. 
5950
5951 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5952
5953         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5954
5955 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5956
5957         * expression.cs: Apply patch from Ben: Remove dead code from
5958         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5959         as that code just threw an exception anwyays.
5960
5961         * const.cs: Remove the call to the turnintoconstant, for details
5962         see bug: #63144
5963         
5964         * literal.cs: The type of the null-literal is the null type;  So
5965         we use a placeholder type (literal.cs:System.Null, defined here)
5966         for it.
5967
5968         * expression.cs (Conditional.DoResolve): Remove some old code that
5969         is no longer needed, conversions have been fixed.
5970
5971         (ArrayCreationExpression.DoResolve): Return false if we fail to
5972         resolve the inner expression.
5973
5974 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5975
5976         Fix test-290.cs.
5977         * cs-parser.jay (delegate_declaration): Record a delegate
5978         declaration as a type declaration.
5979         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5980
5981 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5982
5983         * parameter.cs: Do not crash if the type can not be resolved. 
5984
5985         * expression.cs: Report errors with unsafe pointers, fixes #64896
5986
5987 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5988
5989         * expression.cs: Pointer arith always needs to do a conv.i
5990         if the operand is a long. fix 65320
5991
5992 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5993
5994         Fixed cs0619-37.cs, cs0619-38.cs
5995
5996         * enum.cs (GetObsoleteAttribute): Removed.
5997
5998         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5999         on Enum member is double staged. The first is tested member
6000         and then enum.
6001
6002 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6003
6004         Fixed #56986, #63631, #65231
6005
6006         * class.cs: (TypeContainer.AddToMemberContainer): New method,
6007         adds member to name container.
6008         (TypeContainer.AddToTypeContainer): New method, adds type to
6009         name container.
6010         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6011         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6012         AddOperator): Simplified by reusing AddToMemberContainer.
6013         (TypeContainer.UserDefinedStaticConstructor): Changed to property
6014         instead of field.
6015         (Method.CheckForDuplications): Fixed implementation to test all
6016         possibilities.
6017         (MemberBase): Detection whether member is explicit interface
6018         implementation is now in constructor.
6019         (MemberBase.UpdateMemberName): Handles IndexerName.
6020         (Accessor): Changed to keep also location information.
6021         (AbstractPropertyEventMethod): Is derived from MemberCore.
6022         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6023         will be emited or not.
6024         (PropertyBase.AreAccessorsDuplicateImplementation):
6025         Tests whether accessors are not in collision with some method.
6026         (Operator): Is derived from MethodCore to simplify common
6027         operations.
6028
6029         * decl.cs (Flags.TestMethodDuplication): Test for duplication
6030         must be performed.
6031         (DeclSpace.AddToContainer): Adds the member to defined_names
6032         table. It tests for duplications and enclosing name conflicts.
6033
6034         * enum.cs (EnumMember): Clean up to reuse the base structures
6035
6036 2004-09-03  Martin Baulig  <martin@ximian.com>
6037
6038         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6039         into TypeContainer, to make partial classes work again.
6040
6041 2004-09-03  Martin Baulig  <martin@ximian.com>
6042
6043         * rootcontext.cs (RootContext.V2): Removed.
6044
6045 2004-03-23  Martin Baulig  <martin@ximian.com>
6046
6047         * expression.cs (Invocation.OverloadResolve): Added `bool
6048         may_fail' argument and use it instead of the Location.IsNull() hack.
6049
6050 2004-09-03  Martin Baulig  <martin@ximian.com>
6051
6052         Merged latest changes into gmcs.  Please keep this comment in
6053         here, it makes it easier for me to see what changed in MCS since
6054         the last time I merged.
6055
6056 2004-09-03  Raja R Harinath  <rharinath@novell.com>
6057
6058         Fix #61128.
6059         * expression.cs (BetterConversion): Don't allow either conversion 
6060         to be null.  Remove redundant implicit conversion test when 'q ==
6061         null' -- when this function is invoked, we already know that the
6062         implicit conversion exists.
6063         (BetterFunction): Assume that 'best' is non-null.  Remove
6064         redundant reimplementation of IsApplicable when 'best' is null.
6065         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6066         number of arguments.
6067         (IsAncestralType): Extract from OverloadResolve.
6068         (OverloadResolve): Make robust to the MethodGroupExpr being
6069         unsorted.  Implement all the logic of Section 14.5.5.1, and
6070         support overloading of methods from multiple applicable types.
6071         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
6072
6073         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6074         (RealError, Warning): Append type of report to related symbol.
6075
6076 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
6077
6078         * enum.cs: Fixed CLS-Compliance checks for enum members.
6079         Error tests cs3008-8.cs, cs3014-8.cs
6080
6081 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6082
6083         Fixed bug #62342, #63102
6084         * class.cs: ImplementIndexer uses member.IsExplicitImpl
6085         like ImplementMethod.
6086
6087 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6088
6089         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6090         Fixed bug #65170.
6091
6092 2004-09-02  Martin Baulig  <martin@ximian.com>
6093
6094         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6095         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6096         on the MethodBase.
6097
6098 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
6099
6100         C# 2.0 Static classes implemented
6101
6102         * class.cs (TypeContainer): instance_constructors,
6103         initialized_fields, initialized_static_fields,
6104         default_constructor, base_inteface_types are protected to be
6105         accessible from StaticClass.
6106         (TypeContainer.DefineDefaultConstructor): New virtual method
6107         for custom default constructor generating
6108         (StaticClass): New class to handle "Static classes" feature.
6109
6110         * cs-parser.jay: Handle static keyword on class like instance
6111         of StaticClass.
6112
6113         * driver.cs: Added "/langversion" command line switch with two
6114         options (iso-1, default).
6115
6116 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
6117
6118         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6119
6120 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
6121
6122         * delegate.cs: Style.
6123
6124 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6125
6126         * delegate.cs: Add seperate instance expr field for miguel.
6127
6128 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6129
6130         * PointerArithmetic (Resolve): make sure we are not doing
6131         pointer arith on void*. Also, make sure we are resolved
6132         by not setting eclass until resolve.
6133
6134         All callers: Make sure that PointerArithmetic gets resolved.
6135
6136 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6137
6138         * ArrayCreation (LookupType): If the type does not resolve 
6139         to an array, give an error.
6140
6141 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
6142
6143         * statement.cs (Try.Resolve): Fixed bug #64222
6144
6145 2004-08-27  Martin Baulig  <martin@ximian.com>
6146
6147         * class.cs
6148         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6149         crash here.     
6150
6151 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6152
6153         * ecore.cs (Constantify): Get underlying type via
6154         System.Enum.GetUnderlyingType to avoid StackOverflow on the
6155         Windows in special cases.
6156
6157 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6158
6159         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6160         for obtaining also private methods.
6161         (GetRemoveMethod): Used GetRemoveMethod (true)
6162         for obtaining also private methods.
6163
6164 2004-08-24  Martin Baulig  <martin@ximian.com>
6165
6166         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6167         MethodAttributes.HideBySig for operators.
6168
6169 2004-08-23  Martin Baulig  <martin@ximian.com>
6170
6171         Back to the old error reporting system :-)
6172
6173         * report.cs (Message): Removed.
6174         (Report.MessageData, ErrorData, WarningData): Removed.
6175         (Report.Error, Warning): Back to the old system.
6176
6177 2004-08-23  Martin Baulig  <martin@ximian.com>
6178
6179         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6180
6181         * class.cs (TypeContainer.ParentContainer): New public virtual
6182         method; replaces the explicit interface implementation.
6183         (ClassPart.ParentContainer): Override.
6184
6185 2004-08-23  Martin Baulig  <martin@ximian.com>
6186
6187         * statement.cs (Switch): Added support for constant switches; see
6188         #59428 or test-285.cs.
6189
6190 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6191
6192         Fixed bug #62740.
6193         * statement.cs (GetEnumeratorFilter): Removed useless
6194         logic because C# specs is strict. GetEnumerator must be
6195         public.
6196
6197 2004-08-22  Martin Baulig  <martin@ximian.com>
6198
6199         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6200         a switch and may break, reset the barrier.  Fixes #59867.
6201
6202 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6203
6204         CLS-Compliance speed up (~5% for corlib)
6205
6206         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6207         New method. Tests container for CLS-Compliant names
6208
6209         * class.cs (TypeContainer.VerifyClsName): New method.
6210         Checks whether container name is CLS Compliant.
6211         (Constructor): Implements IMethodData.
6212
6213         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6214         low-case table for CLS Compliance test.
6215         (MemberCache.VerifyClsParameterConflict): New method.
6216         Checks method parameters for CS3006 error.
6217
6218         * enum.cs (EnumMember): Is derived from MemberCore.
6219         (Enum.VerifyClsName): Optimized for better performance.
6220
6221 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6222
6223         * report.cs: Renamed Error_T to Error and changed all
6224         references.
6225
6226 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6227
6228         * class.cs (TypeContainer.IndexerArrayList): New inner class
6229         container for indexers.
6230         (TypeContainer.DefaultIndexerName): New constant for default
6231         indexer name. Replaced all "Item" with this constant.
6232         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6233
6234         * typemanager.cs (TypeManager.default_member_ctor): Cache here
6235         DefaultMemberAttribute constructor.
6236
6237 2004-08-05  Martin Baulig  <martin@ximian.com>
6238
6239         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6240         Fix bug #59429.
6241
6242 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
6243
6244         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6245         multi platforms problem.
6246
6247         * compiler.csproj: Included shared files.
6248
6249 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6250
6251         Fix bug 60333, 55971 in the more general way
6252         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6253         Added arg_type argument for constant conversion.
6254         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6255
6256 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6257
6258         Fix bug #59760
6259         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
6260         OperatorArrayList, MethodCoreArrayList for typecontainer
6261         containers. Changed class member types to these new types.
6262         (MethodArrayList.DefineMembers): Added test for CS0659.
6263
6264 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
6265
6266         * cfold.cs: Synchronize the folding with the code in expression.cs
6267         Binary.DoNumericPromotions for uint operands.
6268
6269         * attribute.cs: Revert patch from Raja, it introduced a regression
6270         while building Blam-1.2.1 (hard to isolate a test case).
6271
6272 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6273
6274         Fix for #55382
6275         * class.cs:
6276         (TypeContainer.Define): Renamed to DefineContainerMembers because of
6277         name collision.
6278         (MethodCore.parent_method): New member. The method we're overriding
6279         if this is an override method.
6280         (MethodCore.CheckBase): Moved from Method class and made common.
6281         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6282         private.
6283         (MethodCore.CheckForDuplications): New abstract method. For custom
6284         member duplication search in a container
6285         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6286         method and its return type.
6287         (Event.conflict_symbol): New member. Symbol with same name in the
6288         parent class.
6289
6290         * decl.cs:
6291         (MemberCache.FindMemberWithSameName): New method. The method
6292         is looking for conflict with inherited symbols.
6293
6294 2004-08-04  Martin Baulig  <martin@ximian.com>
6295
6296         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6297
6298         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6299
6300 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6301
6302         * report.cs (Message): New enum for better error, warning reference in
6303         the code.
6304         (MessageData): New inner abstract class. It generally handles printing of
6305         error and warning messages.
6306         Removed unused Error, Warning, Message methods.
6307
6308 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6309
6310         Fix for cs0592-8.cs test
6311         * attribute.cs
6312         (Attributable.ValidAttributeTargets): Made public.
6313         (Attribute.ExplicitTarget): New member for explicit target value.
6314         (Attribute.CheckTargets): Now we translate explicit attribute
6315         target to Target here.
6316
6317 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
6318
6319         * ecore.cs (MethodGroupExpr): new IsBase property.
6320
6321         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6322
6323         * delegate.cs (DelegateCreation): store a MethodGroupExpr
6324         rather than an instance expr.
6325
6326         (DelegateCreation.Emit): Use the method group rather than
6327         the instance expression. Also, if you have base.Foo as the
6328         method for a delegate, make sure to emit ldftn, not ldftnvirt.
6329
6330         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
6331
6332         (NewDelegate.DoResolve): Only check for the existance of Invoke
6333         if the method is going to be needed. Use MethodGroupExpr.
6334
6335         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
6336
6337         * expression.cs: For pointer arith., make sure to use
6338         the size of the type, not the size of the pointer to
6339         the type.
6340
6341 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6342
6343         Fix for #60722
6344         * class.cs (Class): Added error CS0502 test.
6345
6346 2004-08-03  John Luke  <jluke@cfl.rr.com>
6347             Raja R Harinath  <rharinath@novell.com>
6348
6349         Fix for #60997.
6350         * attribute.cs (Attribute.complained_before): New flag.
6351         (Attribute.ResolveType, Attribute.Resolve),
6352         (Attribute.DefinePInvokeMethod): Set it.
6353         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6354         
6355 2004-08-03  Martin Baulig  <martin@ximian.com>
6356
6357         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6358         use a user-defined operator; we still need to do numeric
6359         promotions in case one argument is a builtin type and the other
6360         one has an implicit conversion to that type.  Fixes #62322.
6361
6362 2004-08-02  Martin Baulig  <martin@ximian.com>
6363
6364         * statement.cs (LocalInfo.Flags): Added `IsThis'.
6365         (LocalInfo.IsThis): New public property.
6366         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6367
6368 2004-08-01  Martin Baulig  <martin@ximian.com>
6369
6370         * class.cs (TypeContainer.GetClassBases): Don't set the default
6371         here since we may get called from GetPartialBases().
6372         (TypeContainer.DefineType): If GetClassBases() didn't return a
6373         parent, use the default one.
6374
6375 2004-07-30  Duncan Mak  <duncan@ximian.com>
6376
6377         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
6378
6379 2004-07-30  Martin Baulig  <martin@ximian.com>
6380
6381         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6382
6383         * class.cs (SourceMethod): New public class, derive from the
6384         symbol writer's ISourceMethod.
6385         (Method): Use the new symbol writer API.
6386
6387         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6388         as argument and use the new symbol writer.
6389
6390         * location.cs
6391         (SourceFile): Implement the symbol writer's ISourceFile.
6392         (Location.SymbolDocument): Removed.
6393         (Location.SourceFile): New public property.
6394
6395         * symbolwriter.cs: Use the new symbol writer API.
6396
6397 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6398
6399         * Makefile (install-local): Remove.  Functionality moved to
6400         executable.make.
6401
6402 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6403
6404         * Makefile: Install mcs.exe.config file together with mcs.exe.
6405         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6406         correct runtime version.
6407         
6408 2004-07-25  Martin Baulig  <martin@ximian.com>
6409
6410         * class.cs
6411         (TypeContainer.RegisterOrder): Removed, this was unused.
6412         (TypeContainer, interface_order): Removed.
6413         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6414         TypeContainer as argument since we can also be called with a
6415         `PartialContainer' for a partial class/struct/interface.
6416         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6417         of checking whether we're an `Interface' - we could be a
6418         `PartialContainer'.
6419         (PartialContainer.Register): Override; call
6420         AddClass()/AddStruct()/AddInterface() on our parent.
6421
6422         * cs-parser.jay (interface_member_declaration): Add things to the
6423         `current_container', not the `current_class'.
6424
6425         * rootcontext.cs (RegisterOrder): The overloaded version which
6426         takes an `Interface' was unused, removed.
6427
6428         * typemanager.cs (TypeManager.LookupInterface): Return a
6429         `TypeContainer', not an `Interface'.
6430         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6431         contain a `PartialContainer' for an interface, so check it's
6432         `Kind' to figure out what it is.
6433
6434 2004-07-25  Martin Baulig  <martin@ximian.com>
6435
6436         * class.cs (Class.DefaultTypeAttributes): New public constant.
6437         (Struct.DefaultTypeAttributes): Likewise.
6438         (Interface.DefaultTypeAttributes): Likewise.
6439         (PartialContainer.TypeAttr): Override this and add the
6440         DefaultTypeAttributes.
6441
6442 2004-07-25  Martin Baulig  <martin@ximian.com>
6443
6444         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6445         we can just use the `Parent' field instead.
6446
6447 2004-07-25  Martin Baulig  <martin@ximian.com>
6448
6449         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6450
6451 2004-07-25  Martin Baulig  <martin@ximian.com>
6452
6453         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6454         our parts before defining any methods.
6455         (TypeContainer.VerifyImplements): Make this virtual.
6456         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6457         on our PartialContainer.
6458
6459 2004-07-25  Martin Baulig  <martin@ximian.com>
6460
6461         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6462
6463         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6464         argument, we can just use the `Parent' field instead.
6465
6466         * class.cs
6467         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6468         (MemberBase.DoDefine): Likewise.
6469
6470 2004-07-24  Martin Baulig  <martin@ximian.com>
6471
6472         * decl.cs (MemberCore.Parent): New public field.
6473         (DeclSpace.Parent): Moved to MemberCore.
6474
6475         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6476         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6477         parent's .ctor.
6478         (FieldBase, Field, Operator): Likewise.
6479         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6480         (EventField, Event): Likewise.
6481
6482 2004-07-23  Martin Baulig  <martin@ximian.com>
6483
6484         * class.cs (PartialContainer): New public class.
6485         (ClassPart): New public class.
6486         (TypeContainer): Added support for partial classes.
6487         (TypeContainer.GetClassBases): Splitted some of the functionality
6488         out into GetNormalBases() and GetPartialBases().
6489
6490         * cs-tokenizer.cs (Token.PARTIAL): New token.
6491         (Tokenizer.consume_identifier): Added some hacks to recognize
6492         `partial', but only if it's immediately followed by `class',
6493         `struct' or `interface'.
6494
6495         * cs-parser.jay: Added support for partial clases.
6496
6497 2004-07-23  Martin Baulig  <martin@ximian.com>
6498
6499         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6500         a `DeclSpace' and also made it readonly.
6501         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6502         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6503         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6504
6505         * cs-parser.jay: Pass the `current_class', not the
6506         `current_container' (at the moment, this is still the same thing)
6507         to a new Method, Property, Event, Indexer or Constructor.
6508
6509 2004-07-23  Martin Baulig  <martin@ximian.com>
6510
6511         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6512         and removed the `current_interface' one.
6513         (struct_declaration, class_declaration, interface_declaration):
6514         Set `current_class' to the newly created class/struct/interface;
6515         set their `Bases' and call Register() before parsing their body.
6516
6517 2004-07-23  Martin Baulig  <martin@ximian.com>
6518
6519         * class.cs (Kind): New public enum.
6520         (TypeContainer): Made this class abstract.
6521         (TypeContainer.Kind): New public readonly field.
6522         (TypeContainer.CheckDef): New public method; moved here from
6523         cs-parser.jay.
6524         (TypeContainer.Register): New public abstract method.
6525         (TypeContainer.GetPendingImplementations): New public abstract
6526         method.
6527         (TypeContainer.GetClassBases): Removed the `is_class' and
6528         `is_iface' parameters.
6529         (TypeContainer.DefineNestedTypes): Formerly known as
6530         DoDefineType().
6531         (ClassOrStruct): Made this class abstract.
6532
6533         * tree.cs (RootTypes): New public type. 
6534
6535 2004-07-20  Martin Baulig  <martin@ximian.com>
6536
6537         * tree.cs (Tree.RecordNamespace): Removed.
6538         (Tree.Namespaces): Removed.
6539
6540         * rootcontext.cs (RootContext.IsNamespace): Removed.
6541
6542         * cs-parser.jay (namespace_declaration): Just create a new
6543         NamespaceEntry here.
6544
6545 2004-07-20  Martin Baulig  <martin@ximian.com>
6546
6547         * statement.cs (ExceptionStatement): New abstract class.  This is
6548         now used as a base class for everyone who's using `finally'.
6549         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
6550         our local variables before using them.
6551
6552         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
6553         virtual method.  This is used by Yield.Resolve() to "steal" an
6554         outer block's `finally' clauses.
6555         (FlowBranchingException): The .ctor now takes an ExceptionStatement
6556         argument.
6557
6558         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
6559         version which takes an ExceptionStatement.  This version must be
6560         used to create exception branchings.
6561
6562         * iterator.cs
6563         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
6564         (Iterator.EmitMoveNext): Added exception support; protect the
6565         block with a `fault' clause, properly handle 'finally' clauses.
6566         (Iterator.EmitDispose): Run all the `finally' clauses here.
6567
6568 2004-07-20  Martin Baulig  <martin@ximian.com>
6569
6570         * iterator.cs: This is the first of a set of changes in the
6571         iterator code.  Match the spec more closely: if we're an
6572         IEnumerable, then GetEnumerator() must be called.  The first time
6573         GetEnumerator() is called, it returns the current instance; all
6574         subsequent invocations (if any) must create a copy.
6575
6576 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
6577
6578         * expression.cs: Resolve the constant expression before returning
6579         it. 
6580
6581 2004-07-19  Martin Baulig  <martin@ximian.com>
6582
6583         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
6584         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
6585         the return type of the new EmitContext.
6586
6587 2004-07-18  Martin Baulig  <martin@ximian.com>
6588
6589         * class.cs (Property.Define): Fix iterators.
6590
6591         * iterators.cs (Iterator.Define): Moved the
6592         `container.AddInterator (this)' call here from the .ctor; only do
6593         it if we resolved successfully.
6594
6595 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
6596
6597         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
6598         `true' for preprocessing directives that we parse.  The return
6599         value indicates whether we should return to regular tokenizing or
6600         not, not whether it was parsed successfully.
6601
6602         In the past if we were in: #if false ... #line #endif, we would
6603         resume parsing after `#line'.  See bug 61604.
6604
6605         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
6606         building: IsEnumType should return true only for enums, not for
6607         enums or System.Enum itself.  This fixes #61593.
6608
6609         Likely what happened is that corlib was wrong: mcs depended on
6610         this bug in some places.  The bug got fixed, we had to add the
6611         hack, which caused bug 61593.
6612
6613         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
6614         that was a workaround for the older conditions.
6615
6616 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
6617
6618         * assign.cs: IAssignMethod has a new interface, as documented
6619         inline. All assignment code now uses this new api.
6620
6621         * ecore.cs, expression.cs: All classes which implement
6622         IAssignMethod now use the new interface.
6623
6624         * expression.cs (Invocation): add a hack to EmitCall so that
6625         IndexerAccess can be the target of a compound assignment without
6626         evaluating its arguments twice.
6627
6628         * statement.cs: Handle changes in Invocation api.
6629
6630 2004-07-16  Martin Baulig  <martin@ximian.com>
6631
6632         * iterators.cs: Rewrote this.  We're now using one single Proxy
6633         class for both the IEnumerable and the IEnumerator interface and
6634         `Iterator' derives from Class so we can use the high-level API.
6635
6636         * class.cs (TypeContainer.AddIterator): New method.
6637         (TypeContainer.DoDefineType): New protected virtual method, which
6638         is called from DefineType().
6639         (TypeContainer.DoDefineMembers): Call DefineType() and
6640         DefineMembers() on all our iterators.
6641         (TypeContainer.Emit): Call Emit() on all our iterators.
6642         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6643
6644         * codegen.cs (EmitContext.CurrentIterator): New public field.
6645
6646 2004-07-15  Martin Baulig  <martin@ximian.com>
6647
6648         * typemanager.cs
6649         (TypeManager.not_supported_exception_type): New type.   
6650
6651 2004-07-14  Martin Baulig  <martin@ximian.com>
6652
6653         * iterators.cs: Use real error numbers.
6654
6655 2004-07-14  Martin Baulig  <martin@ximian.com>
6656
6657         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6658         requires this to be a System.Collection.IEnumerable and not a
6659         class implementing that interface.
6660         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6661
6662 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6663
6664         * class.cs: Fixed previous fix, it broke some error tests.
6665
6666 2004-07-12  Martin Baulig  <martin@ximian.com>
6667
6668         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6669         Fixes #61293.
6670
6671 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6672
6673         * assign.cs (LocalTemporary): Add new argument: is_address,If
6674         `is_address' is true, then the value that we store is the address
6675         to the real value, and not the value itself.
6676         
6677         * ecore.cs (PropertyExpr): use the new local temporary
6678         stuff to allow us to handle X.Y += z (where X is a struct)
6679
6680 2004-07-08  Martin Baulig  <martin@ximian.com>
6681
6682         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6683         not always return, just like we're doing in Using.Resolve().
6684
6685 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6686
6687         * cs-parser.jay (fixed_statement): flag this as Pinned.
6688
6689 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6690
6691         * typemanager.cs (TypeManager): Removed MakePinned method, this
6692         mechanism is replaced with the .NET 2.x compatible mechanism of
6693         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6694
6695         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6696         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6697         `IsFixed' property which has a different meaning.
6698
6699 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6700
6701         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6702         visible from inside a nested class, not just the names of the
6703         immediately enclosing class.
6704         Fix for bug #60730.
6705
6706 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6707
6708         * expression.cs (BetterConversion): Remove buggy special-case
6709         handling of "implicit constant expression conversions".  At this
6710         point, we already know that the conversion is possible -- we're
6711         only checking to see which is better.
6712
6713 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6714
6715         * cs-parser.jay: Added error CS0210 test.
6716
6717 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6718
6719         * cs-parser.jay: Added error CS0134 test.
6720
6721 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6722
6723         Fix bug #52507
6724         * cs-parser.jay: Added error CS0145 test.
6725
6726 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6727
6728         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6729
6730 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6731         
6732         * expression.cs (StackAlloc.Resolve): The argument may not
6733         be a constant; deal with this case.
6734         
6735 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6736
6737         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6738         GetIndexerAttributeValue.
6739         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6740
6741         * class.cs (Indexer.Define): Added error tests for CS0415,
6742         CS0609.
6743
6744 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6745
6746         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6747         property code.
6748
6749 2004-06-23  Martin Baulig  <martin@ximian.com>
6750
6751         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6752         neither return nor throw, reset the barrier as well.  Fixes #60457.
6753
6754 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6755
6756         * class.cs : EventAttributes is now set to None by default.
6757           This fixes bug #60459.
6758
6759 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6760
6761         Fix bug #60219
6762         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6763         Don't throw exception but return null (it's sufficient now).
6764
6765 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6766
6767         * typemanager.cs (GetArgumentTypes): Faster implementation.
6768
6769 2004-06-18  Martin Baulig  <martin@ximian.com>
6770
6771         * attribute.cs (Attribute.Resolve): Check whether we're an
6772         EmptyCast which a Constant child.  Fixes #60333.
6773
6774 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6775
6776         * statement.cs (EmitCollectionForeach): Account for the fact that
6777         not all valuetypes are in areas which we can take the address of.
6778         For these variables, we store to a temporary variable. Also, make
6779         sure that we dont emit a `callvirt' on a valuetype method.
6780
6781 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6782
6783         * expression.cs (StackAlloc.DoReSolve): Added test for
6784         negative parameter (CS0247).
6785
6786 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6787
6788         Fix bug #59792
6789         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6790
6791 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6792
6793         Fix bug #59781
6794         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6795         ulong.
6796
6797 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6798
6799         Fix bug #58254 & cs1555.cs, cs1556.cs
6800         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6801
6802 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6803
6804         * cs-parser.jay: Added error CS1669 test for indexers.
6805
6806 2004-06-11  Martin Baulig  <martin@ximian.com>
6807
6808         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6809         call this twice: for params and varargs methods.
6810
6811 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6812
6813         * class.cs:
6814         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6815
6816 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6817
6818         * attribute.cs (Attribute.GetValidTargets): Made public.
6819
6820         * class.cs: 
6821         (AbstractPropertyEventMethod): New class for better code sharing.
6822         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6823         CS1667 report.
6824         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6825
6826 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6827
6828         Fix bug #59477.
6829         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6830         that the call to Resolve is part of a MemberAccess.
6831         (Expression.Resolve): Use it for SimpleName resolution.
6832         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6833         Add 'intermediate' boolean argument.
6834         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6835         error message when the SimpleName can be resolved ambiguously
6836         between an expression and a type.
6837         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6838         public.
6839         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6840         call on the left-side.
6841
6842 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6843
6844         * class.cs:
6845         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6846
6847 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6848
6849         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6850
6851 2004-06-11  Martin Baulig  <martin@ximian.com>
6852
6853         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6854         varargs methods if applicable.
6855
6856 2004-06-11  Martin Baulig  <martin@ximian.com>
6857
6858         * expression.cs (Invocation.EmitCall): Don't use
6859         `method.CallingConvention == CallingConventions.VarArgs' since the
6860         method could also have `CallingConventions.HasThis'.
6861
6862 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6863
6864         * class.cs (Event.GetSignatureForError): Implemented.
6865         Fixed crash in error test cs3010.cs
6866
6867 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6868
6869         * cs-tokenizer.cs: Change the way we track __arglist to be
6870         consistent with the other keywords.
6871
6872 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6873
6874         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6875         tomorrow.
6876
6877 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6878
6879         * codegen.cs: Check that all referenced assemblies have a strongname
6880         before strongnaming the compiled assembly. If not report error CS1577.
6881         Fix bug #56563. Patch by Jackson Harper.
6882         * typemanager.cs: Added a method to return all referenced assemblies.
6883         Fix bug #56563. Patch by Jackson Harper.
6884
6885 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6886
6887         * class.cs:
6888         (Method.ApplyAttributeBuilder): Moved and added conditional
6889         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6890
6891         * delegate.cs:
6892         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6893
6894 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6895
6896         Fixed #59640
6897         * class.cs: (EventField.attribute_targets): Changed default target.
6898
6899 2004-06-08  Martin Baulig  <martin@ximian.com>
6900
6901         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6902
6903 2004-06-08  Martin Baulig  <martin@ximian.com>
6904
6905         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6906
6907 2004-06-07  Martin Baulig  <martin@ximian.com>
6908
6909         Added support for varargs methods.
6910
6911         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6912         keyword.
6913
6914         * cs-parser.jay: Added support for `__arglist'.
6915
6916         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6917
6918         * expression.cs (Argument.AType): Added `ArgList'.
6919         (Invocation): Added support for varargs methods.
6920         (ArglistAccess): New public class.
6921         (Arglist): New public class.
6922
6923         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6924
6925         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6926         a method's top-level block if the method has varargs.
6927
6928         * support.cs (ReflectionParameters, InternalParameters): Added
6929         support for varargs methods.    
6930
6931 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6932
6933         * class.cs: Provide location in indexer error report.
6934
6935         * driver.cs: Use standard names.
6936
6937         * namespace.cs: Catch the use of using after a namespace has been
6938         declared also on using aliases.
6939
6940 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6941
6942         Bug #50820.
6943         * typemanager.cs (closure_private_ok, closure_invocation_type)
6944         (closure_qualifier_type, closure_invocation_assembly)
6945         (FilterWithClosure): Move to ...
6946         (Closure): New internal nested class.
6947         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6948         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6949         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6950         (MemberLookup, MemberLookupFailed): Use it.
6951         * expression.cs (New.DoResolve): Treat the lookup for the
6952         constructor as being qualified by the 'new'ed type.
6953         (Indexers.GetIndexersForTypeOrInterface): Update.
6954
6955 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6956
6957         * attribute.cs
6958         (GetConditionalAttributeValue): New method. Returns
6959         condition of ConditionalAttribute.
6960         (SearchMulti): New method.  Returns all attributes of type 't'.
6961         Use it when attribute is AllowMultiple = true.
6962         (IsConditionalMethodExcluded): New method.
6963
6964         * class.cs
6965         (Method.IsExcluded): Implemented. Returns true if method has conditional
6966         attribute and the conditions is not defined (method is excluded).
6967         (IMethodData): Extended interface for ConditionalAttribute support.
6968         (PropertyMethod.IsExcluded): Implemented.
6969
6970         * decl.cs
6971         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6972
6973         * expression.cs
6974         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6975         on the method.
6976
6977 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6978
6979         * expression.cs (ArrayCreationExpression): Make this just an
6980         `expression'. It can't be a statement, so the code here was
6981         dead.
6982
6983 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6984
6985         Fixed #59072
6986         * typemanager.cs (GetFullNameSignature): New method for
6987         MethodBase types.
6988
6989 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6990
6991         Fixed #56452
6992         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6993         Use this method when MethodBuilder is null.
6994         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6995         Added test for error CS0626 (MONO reports error for this situation).
6996         (IMethodData.GetSignatureForError): Extended interface.
6997
6998 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6999
7000         * attribute.cs
7001         (AttributeTester.GetObsoleteAttribute): Returns instance of
7002         ObsoleteAttribute when type is obsolete.
7003
7004         * class.cs
7005         (TypeContainer.VerifyObsoleteAttribute): Override.
7006         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7007         (MethodCode.VerifyObsoleteAttribute): Override.
7008         (MemberBase.VerifyObsoleteAttribute): Override.
7009
7010         * decl.cs
7011         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7012         and report proper error.
7013
7014         *delegate.cs
7015         Delegate.VerifyObsoleteAttribute): Override.
7016
7017         * ecore.cs
7018         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7019         and report proper error.
7020         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7021
7022         * enum.cs
7023         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7024         and enum member.
7025
7026         * expression.cs
7027         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7028         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7029         Added test for ObsoleteAttribute.
7030
7031         * statement.cs
7032         (Catch): Derived from Statement.
7033
7034 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
7035  
7036         Fixed bug #59071 & cs0160.cs
7037  
7038         * statement.cs (Try.Resolve): Check here whether order of catch
7039         clauses matches their dependencies.
7040
7041 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
7042
7043         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
7044         caused a regression: #59343.  Referencing nested classes from an
7045         assembly stopped working.
7046
7047 2004-05-31  Martin Baulig  <martin@ximian.com>
7048
7049         MCS is now frozen for beta 2.
7050
7051 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7052
7053         * convert.cs: add a trivial cache for overload operator resolution.
7054
7055 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7056
7057         * decl.cs: If possible, use lookuptypedirect here. We can only do
7058         this if there is no `.' after the namespace. Avoids using
7059         LookupType, which does lots of slow processing.
7060         (FindNestedType) New method, does what it says :-).
7061         * namespace.cs: use LookupTypeDirect.
7062         * rootcontext.cs: use membercache, if possible.
7063         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7064
7065 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7066
7067         * expression.cs:
7068         According to the spec, 
7069
7070         In a member access of the form E.I, if E is a single identifier,
7071         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7072         field, property, localvariable, or parameter with the same type as
7073         the meaning of E as a type-name (§3.8), then both possible
7074         meanings of E are permitted.
7075
7076         We did not check that E as a simple-name had the same type as E as
7077         a type name.
7078
7079         This trivial check gives us 5-7% on bootstrap time.
7080
7081 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7082
7083         * expression.cs (Invocation.OverloadResolve): Avoid the
7084         use of hashtables and boxing here by allocating on demand.
7085
7086 2004-05-30  Martin Baulig  <martin@ximian.com>
7087
7088         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7089         we're doing a silent lookup.  Don't try to lookup nested types in
7090         TypeManager.object_type (thanks to Ben Maurer).
7091
7092 2004-05-30  Martin Baulig  <martin@ximian.com>
7093
7094         Committing a patch from Ben Maurer.
7095
7096         * rootcontext.cs (RootContext.LookupType): Cache negative results.
7097
7098 2004-05-29  Martin Baulig  <martin@ximian.com>
7099
7100         * class.cs (IMethodData.ShouldIgnore): New method.
7101
7102         * typemanager.cs (TypeManager.MethodFlags): Don't take a
7103         `Location' argument, we don't need it anywhere.  Use
7104         `IMethodData.ShouldIgnore ()' instead of
7105         `MethodData.GetMethodFlags ()'.
7106         (TypeManager.AddMethod): Removed.
7107         (TypeManager.AddMethod2): Renamed to AddMethod.
7108
7109 2004-05-29  Martin Baulig  <martin@ximian.com>
7110
7111         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7112
7113         * convert.cs (Convert.ImplicitReferenceConversion): If we're
7114         converting from a class type S to an interface type and we already
7115         have an object on the stack, don't box it again.  Fixes #52578.
7116
7117 2004-05-29  Martin Baulig  <martin@ximian.com>
7118
7119         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7120         Added support for `params' parameters.  Fixes #59267.
7121
7122 2004-05-29  Martin Baulig  <martin@ximian.com>
7123
7124         * literal.cs (NullPointer): Provide a private .ctor which sets
7125         `type' to TypeManager.object_type.  Fixes #59048.
7126
7127 2004-05-29  Martin Baulig  <martin@ximian.com>
7128
7129         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7130         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
7131
7132         * ecore.cs (EventExpr.instance_expr): Make the field private.
7133
7134 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
7135
7136         Fixed bug #50080 & cs0214-2.cs
7137         * expression.cs (Cast.DoResolve): Check unsafe context here.
7138         
7139         * statement.cs (Resolve.DoResolve): Likewise.
7140
7141 2004-05-26  Martin Baulig  <martin@ximian.com>
7142
7143         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7144
7145         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7146         (RootContext.LookupType): Pass down the `silent' flag.
7147
7148 2004-05-25  Martin Baulig  <martin@ximian.com>
7149
7150         * expression.cs
7151         (MethodGroupExpr.IdenticalTypeName): New public property.
7152         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7153         expression actually refers to a type.
7154
7155 2004-05-25  Martin Baulig  <martin@ximian.com>
7156
7157         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7158         for #56176 and made it actually work.
7159
7160 2004-05-25  Martin Baulig  <martin@ximian.com>
7161
7162         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7163         (FieldExpr, PropertyExpr): Override and implement
7164         CacheTemporaries.  Fixes #52279.
7165
7166 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
7167
7168         * location.cs: In the new compiler listing a file twice is a
7169         warning, not an error.
7170
7171 2004-05-24  Martin Baulig  <martin@ximian.com>
7172
7173         * enum.cs (Enum.DefineType): For the `BaseType' to be a
7174         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
7175
7176 2004-05-24  Martin Baulig  <martin@ximian.com>
7177
7178         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7179         walking the `using' list.  Fixes #53921.
7180
7181 2004-05-24  Martin Baulig  <martin@ximian.com>
7182
7183         * const.cs (Const.LookupConstantValue): Added support for
7184         EmptyCast's; fixes #55251.
7185
7186 2004-05-24  Martin Baulig  <martin@ximian.com>
7187
7188         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7189         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7190         which does the CS0135 check.  The reason is that we first need to
7191         check whether the variable actually exists.
7192
7193 2004-05-24  Martin Baulig  <martin@ximian.com>
7194
7195         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7196         than RootContext.LookupType() to find the explicit interface
7197         type.  Fixes #58584.
7198
7199 2004-05-24  Raja R Harinath  <rharinath@novell.com>
7200
7201         * Makefile: Simplify.  Use executable.make.
7202         * mcs.exe.sources: New file.  List of sources of mcs.exe.
7203
7204 2004-05-24  Anders Carlsson  <andersca@gnome.org>
7205
7206         * decl.cs:
7207         * enum.cs:
7208         Use the invariant culture when doing String.Compare for CLS case
7209         sensitivity.
7210         
7211 2004-05-23  Martin Baulig  <martin@ximian.com>
7212
7213         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7214         don't have any dots.  Fixes #52622, added cs0246-8.cs.
7215
7216         * namespace.cs (NamespaceEntry.Lookup): Likewise.
7217         
7218 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7219
7220         * class.cs (MemberBase.Define): Reuse MemberType member for 
7221         resolved type. Other methods can use it too.
7222
7223 2004-05-23  Martin Baulig  <martin@ximian.com>
7224
7225         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7226         the variable also exists in the current block (otherwise, we need
7227         to report a CS0103).  Fixes #58670.
7228
7229 2004-05-23  Martin Baulig  <martin@ximian.com>
7230
7231         * flowanalysis.cs (Reachability.Reachable): Compute this
7232         on-the-fly rather than storing it as a field.
7233
7234 2004-05-23  Martin Baulig  <martin@ximian.com>
7235
7236         * flowanalysis.cs (Reachability.And): Manually compute the
7237         resulting `barrier' from the reachability.      
7238        
7239 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7240
7241         Fix bug #57835
7242         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7243         instance of ObsoleteAttribute when symbol is obsolete.
7244
7245         * class.cs
7246         (IMethodData): Extended interface for ObsoleteAttribute support.
7247
7248 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7249
7250         * attribute.cs: Fix bug #55970
7251
7252 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7253
7254         Fix bug #52705
7255         * attribute.cs
7256         (GetObsoleteAttribute): New method. Creates the instance of
7257         ObsoleteAttribute.
7258         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7259         ObsoleteAttribute when member is obsolete.
7260         (AttributeTester.Report_ObsoleteMessage): Common method for
7261         Obsolete error/warning reporting.
7262
7263         * class.cs
7264         (TypeContainer.base_classs_type): New member for storing parent type.
7265
7266         * decl.cs
7267         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7268         for this MemberCore.
7269
7270 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7271
7272         * attribute.cs, const.cs: Fix bug #58590
7273
7274 2004-05-21  Martin Baulig  <martin@ximian.com>
7275
7276         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7277         out parameters if the end of the method is unreachable.  Fixes
7278         #58098. 
7279
7280 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7281
7282         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7283         Hari was right, why extra method.
7284
7285 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7286
7287         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7288
7289 2004-05-20  Martin Baulig  <martin@ximian.com>
7290
7291         Merged this back from gmcs to keep the differences to a minumum.
7292
7293         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
7294         instead of a Declspace.
7295         (Attribute.ResolveType): Likewise.
7296         (Attributes.Search): Likewise.
7297         (Attributes.Contains): Likewise.
7298         (Attributes.GetClsCompliantAttribute): Likewise.
7299
7300         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
7301         argument.
7302         (MethodData.ApplyAttributes): Take an EmitContext instead of a
7303         DeclSpace.
7304
7305 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
7306
7307         Fix bug #58688 (MCS does not report error when the same attribute
7308         is assigned twice)
7309
7310         * attribute.cs (Attribute.Emit): Distinction between null and default.
7311
7312 2004-05-19  Raja R Harinath  <rharinath@novell.com>
7313
7314         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7315         of a top-level attribute without an attribute target.
7316         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
7317         Make non-static.
7318         (Attribute.Conditional_GetConditionName), 
7319         (Attribute.Obsolete_GetObsoleteMessage): Update.
7320         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
7321         part of ScanForIndexerName.
7322         (Attribute.CanIgnoreInvalidAttribute): New function.
7323         (Attribute.ScanForIndexerName): Move to ...
7324         (Attributes.ScanForIndexerName): ... here.
7325         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7326         (Attributes.Search): New internal variant that can choose not to
7327         complain if types aren't resolved.  The original signature now
7328         complains.
7329         (Attributes.GetClsCompliantAttribute): Use internal variant, with
7330         complaints suppressed.
7331         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7332         only if it not useful.
7333         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7334         top-level for attributes that are shared between the assembly
7335         and a top-level class.
7336         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7337         * class.cs: Update to reflect changes.
7338         (DefineIndexers): Fuse loops.
7339         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
7340         a couple more variants of attribute names.
7341
7342 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
7343
7344         Fix bug #52585 (Implemented explicit attribute declaration)
7345
7346         * attribute.cs:
7347         (Attributable.ValidAttributeTargets): New abstract method. It gets
7348         list of valid attribute targets for explicit target declaration.
7349         (Attribute.Target): It holds target itself.
7350         (AttributeSection): Removed.
7351         (Attribute.CheckTargets): New method. It checks whether attribute
7352         target is valid for the current element.
7353
7354         * class.cs:
7355         (EventProperty): New class. For events that are declared like
7356         property (with add and remove accessors).
7357         (EventField): New class. For events that are declared like field.
7358         class.cs
7359
7360         * cs-parser.jay: Implemented explicit attribute target declaration.
7361
7362         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
7363         Override ValidAttributeTargets.
7364
7365         * parameter.cs:
7366         (ReturnParameter): Class for applying custom attributes on 
7367         the return type.
7368         (ParameterAtribute): New class. Class for applying custom
7369         attributes on the parameter type.
7370
7371 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
7372
7373         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7374         definitions. 
7375
7376         (Method): Allow UNSAFE here.
7377
7378         * modifiers.cs: Support unsafe reporting.
7379
7380 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
7381
7382         * decl.cs: Fix bug #58478.
7383
7384 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7385
7386         * statement.cs: When checking for unreachable code on an EmptyStatement,
7387         set the location. Fixes bug #58488.
7388
7389 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
7390
7391         * driver.cs: Add -pkg handling.
7392
7393         From Gonzalo: UseShelLExecute=false
7394
7395 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7396
7397         * attribute.cs:
7398         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7399         for attribute.
7400         (Attribute.IsClsCompliaceRequired): Moved to base for better
7401         accesibility.
7402         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7403         when attribute is AttributeUsageAttribute.
7404         (Attribute.GetValidTargets): Simplified.
7405         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7406         attribute for this type.
7407         (Attribute.ApplyAttributes): Method renamed to Emit and make
7408         non-static.
7409         (GlobalAttributeSection): New class for special handling of global
7410         attributes (assembly, module).
7411         (AttributeSection.Emit): New method.
7412
7413         * class.cs: Implemented Attributable abstract methods.
7414         (MethodCore.LabelParameters): Moved to Parameter class.
7415         (Accessor): Is back simple class.
7416         (PropertyMethod): Implemented Attributable abstract class.
7417         (DelegateMethod): Implemented Attributable abstract class.
7418         (Event): New constructor for disctintion between normal Event
7419         and Event with accessors.
7420
7421         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7422
7423         * codegen.cs, const.cs, decl.cs, delegate.cs:
7424         (CommonAssemblyModulClass): Implemented Attributable abstract class
7425         and simplified.
7426
7427         * enum.cs: Implement IAttributeSupport interface.
7428         (EnumMember): New class for emum members. Implemented Attributable
7429         abstract class
7430
7431         * parameter.cs:
7432         (ParameterBase): Is abstract.
7433         (ReturnParameter): New class for easier [return:] attribute handling.
7434
7435         * typemanager.cs: Removed builder_to_attr.
7436
7437 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7438
7439         Fix bug #57151.
7440         * attribute.cs (Attribute.GetPositionalValue): New function.
7441         * class.cs (TypeContainer.VerifyMembers): New function.
7442         (TypeContainer.Emit): Use it.
7443         (ClassOrStruct): New base class for Class and Struct.
7444         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7445         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7446         class.
7447         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7448         then each non-static field should have a FieldOffset attribute.
7449         Otherwise, none of the fields should have a FieldOffset attribute.
7450         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7451         and FieldOffset attributes.
7452         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7453         (TypeManager.field_offset_attribute_type): New core types.
7454         (TypeManager.InitCoreTypes): Initialize them.
7455
7456 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7457
7458         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7459         Return correct type.
7460         From bug #58270.
7461
7462 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7463
7464         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7465         be implicitly converted to ulong.
7466         
7467         * expression.cs: The logic for allowing operator &, | and ^ worked
7468         was wrong, it worked before because we did not report an error in
7469         an else branch.  Fixes 57895.
7470
7471         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7472         allow volatile fields to be reference types.
7473
7474 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7475
7476         * driver.cs: Add support for /debug-
7477
7478 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7479
7480         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7481         Add a 'complain' parameter to silence errors.
7482         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7483         silently overlooked type-resolutions.
7484         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7485         to reflect changes.
7486         (Attributes.Search): New function.
7487         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7488         (Attributes.GetAttributeFullName): Remove hack.
7489         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7490         Update to reflect changes.
7491         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7492         Use Attributes.Search instead of nested loops.
7493
7494 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7495
7496         * decl.cs:
7497         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7498         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7499         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7500
7501         * report.cs: (Report.Warning): Renamed to Warning_T because of
7502         parameter collision.
7503
7504 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7505
7506         * expression.cs (MemberAccess.ResolveMemberAccess):
7507         Exit with non-zero status after Report.Error.
7508         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7509         Likewise.
7510         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7511
7512 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7513
7514         * support.cs: Don't hang when the file is empty.
7515
7516 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7517
7518         * support.cs: In SeekableStreamReader, compute the preamble size of the
7519           underlying stream. Position changes should take into account that initial
7520           count of bytes.
7521
7522 2004-05-03  Todd Berman  <tberman@sevenl.net>
7523
7524         * driver.cs: remove unused GetSysVersion function.
7525
7526 2004-05-03  Todd Berman  <tberman@sevenl.net>
7527
7528         * driver.cs: Remove the hack from saturday, as well as the hack
7529         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7530         link_paths to get that bit proper.
7531
7532 2004-05-01  Todd Berman  <tberman@sevenl.net>
7533
7534         * driver.cs: Try a LoadFrom before a Load, this checks the current
7535         path. This is currently a bug in mono that is be fixed, however, this
7536         provides a workaround for now. This will be removed when the bug
7537         is fixed.
7538
7539 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7540
7541         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7542         incomplete key pairs (#57941).
7543
7544 2004-05-01  Todd Berman  <tberman@sevenl.net>
7545
7546         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7547         from the GAC
7548
7549 2004-04-30  Jackson Harper  <jackson@ximian.com>
7550
7551         * codegen.cs: Open keys readonly.
7552         
7553 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7554
7555         * typemanager.cs: don't report cyclic struct layout when a struct
7556         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7557         which has 2 Pango.Rectangle fields.
7558
7559 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7560
7561         * expression.cs: Handle IntPtr comparisons with IL code
7562         rather than a method call.
7563
7564 2004-04-29  Martin Baulig  <martin@ximian.com>
7565
7566         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7567         the list of PropertyInfo's in class hierarchy and find the
7568         accessor.  Fixes #56013.
7569
7570 2004-04-29  Martin Baulig  <martin@ximian.com>
7571
7572         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7573
7574 2004-04-29  Martin Baulig  <martin@ximian.com>
7575
7576         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7577
7578         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7579
7580 2004-04-29  Martin Baulig  <martin@ximian.com>
7581
7582         * class.cs (ConstructorInitializer.Resolve): Check whether the
7583         parent .ctor is accessible.  Fixes #52146.
7584
7585 2004-04-29  Martin Baulig  <martin@ximian.com>
7586
7587         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7588
7589         * statement.cs (Using.EmitLocalVariableDecls): Use
7590         TypeManager.idisposable_type, not typeof (IDisposable).
7591         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7592
7593 2004-04-29  Martin Baulig  <martin@ximian.com>
7594
7595         * class.cs (Event.Define): Don't emit the field and don't set
7596         RTSpecialName and SpecialName for events on interfaces.  Fixes
7597         #57703. 
7598
7599 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7600
7601         Refactor Attribute.ApplyAttributes.
7602         * attribute.cs (Attributable): New base class for objects that can
7603         have Attributes applied on them.
7604         (Attribute): Make AttributeUsage fields public.
7605         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7606         (Attribute.IsInternalCall): New property.
7607         (Attribute.UsageAttr): Convert to a public read-only property.
7608         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7609         (Attribute.ResolveType, Attribute.Resolve)
7610         (Attribute.ScanForIndexerName): Update to reflect changes.
7611         (Attribute.CheckAttributeTarget): Re-format.
7612         (Attribute.ApplyAttributes): Refactor, to various
7613         Attributable.ApplyAttributeBuilder methods.
7614         * decl.cs (MemberCore): Make Attributable.
7615         * class.cs (Accessor): Make Attributable.
7616         (MethodData.ApplyAttributes): Use proper attribute types, not
7617         attribute names.
7618         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7619         (TypeContainer.ApplyAttributeBuilder)
7620         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7621         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7622         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7623         (Operator.ApplyAttributeBuilder): New factored-out methods.
7624         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7625         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7626         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7627         * parameter.cs (ParameterBase): New Attributable base class
7628         that can also represent Return types.
7629         (Parameter): Update to the changes.
7630
7631 2004-04-29  Jackson Harper  <jackson@ximian.com>
7632
7633         * driver.cs: Prefer the corlib system version when looking for
7634         assemblies in the GAC. This is still a hack, but its a better hack
7635         now.
7636         
7637 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7638
7639         * decl.cs, enum.cs: Improved error 3005 reporting.
7640   
7641         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7642         (related_symbols): New private member for list of symbols
7643         related to reported error/warning.
7644         
7645         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7646
7647 2004-04-29  Martin Baulig  <martin@ximian.com>
7648
7649         * ecore.cs (Expression.Constantify): If we're an enum and
7650         TypeManager.TypeToCoreType() doesn't give us another type, use
7651         t.UnderlyingSystemType.  Fixes #56178.  
7652
7653 2004-04-29  Martin Baulig  <martin@ximian.com>
7654
7655         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7656         interfaces and for each interface, only add members directly
7657         declared in that interface.  Fixes #53255.
7658
7659 2004-04-28  Martin Baulig  <martin@ximian.com>
7660
7661         * expression.cs (ConditionalLogicalOperator): Use a temporary
7662         variable for `left' to avoid that we evaluate it more than once;
7663         bug #52588.
7664
7665 2004-04-28  Martin Baulig  <martin@ximian.com>
7666
7667         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7668         `void[]' (CS1547).
7669
7670 2004-04-28  Martin Baulig  <martin@ximian.com>
7671
7672         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7673         void (CS1547).
7674
7675         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7676         whether the type is not void (CS1547).
7677
7678 2004-04-28  Martin Baulig  <martin@ximian.com>
7679
7680         * expression.cs (Unary.DoResolveLValue): Override this and report
7681         CS0131 for anything but Operator.Indirection.
7682
7683 2004-04-28  Martin Baulig  <martin@ximian.com>
7684
7685         Committing a patch from Ben Maurer; see bug #50820.
7686
7687         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7688         check for classes.
7689
7690         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7691         classes.        
7692
7693 2004-04-28  Martin Baulig  <martin@ximian.com>
7694
7695         Committing a patch from Ben Maurer; see bug #50820.
7696
7697         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7698         check for classes.
7699
7700         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7701         classes.        
7702
7703 2004-04-28  Martin Baulig  <martin@ximian.com>
7704
7705         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7706         (Block.AddLabel): Call DoLookupLabel() to only search in the
7707         current block.
7708
7709 2004-04-28  Martin Baulig  <martin@ximian.com>
7710
7711         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7712         comparing StringConstants and NullLiterals in Equality and Inequality.
7713
7714 2004-04-28  Jackson Harper  <jackson@ximian.com>
7715
7716         * driver.cs: Attempt to load referenced assemblies from the
7717         GAC. This is the quick and dirty version of this method that
7718         doesnt take into account versions and just takes the first
7719         canidate found. Will be good enough for now as we will not have more
7720         then one version installed into the GAC until I update this method.
7721
7722 2004-04-28  Martin Baulig  <martin@ximian.com>
7723
7724         * typemanager.cs (TypeManager.CheckStructCycles): New public
7725         static method to check for cycles in the struct layout.
7726
7727         * rootcontext.cs (RootContext.PopulateTypes): Call
7728         TypeManager.CheckStructCycles() for each TypeContainer.
7729         [Note: We only need to visit each type once.]
7730
7731 2004-04-28  Martin Baulig  <martin@ximian.com>
7732
7733         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7734
7735         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7736         success and added `out object value'.  Use a `bool resolved' field
7737         to check whether we've already been called rather than
7738         `ConstantValue != null' since this breaks for NullLiterals.
7739
7740 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7741
7742         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7743         setting of this flag, since the 'set' method may be non-public.
7744
7745 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7746
7747         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7748         check on current_vector.Block.
7749
7750 2004-04-27  Martin Baulig  <martin@ximian.com>
7751
7752         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7753         a field initializer.  Fixes #56459.
7754
7755 2004-04-27  Martin Baulig  <martin@ximian.com>
7756
7757         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7758         we're not attempting to use an indexer.  Fixes #52154.
7759
7760 2004-04-27  Martin Baulig  <martin@ximian.com>
7761
7762         * statement.cs (Return): Don't create a return label if we don't
7763         need it; reverts my change from January 20th.  Thanks to Ben
7764         Maurer for this.
7765
7766 2004-04-27  Martin Baulig  <martin@ximian.com>
7767
7768         According to the spec, `goto' can only leave a nested scope, but
7769         never enter it.
7770
7771         * statement.cs (Block.LookupLabel): Only lookup in the current
7772         block, don't recurse into parent or child blocks.
7773         (Block.AddLabel): Check in parent and child blocks, report
7774         CS0140/CS0158 if we find a duplicate.
7775         (Block): Removed this indexer for label lookups.
7776         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7777         this already does the error reporting for us.
7778
7779         * flowanalysis.cs
7780         (FlowBranching.UsageVector.Block): New public variable; may be null.
7781         (FlowBranching.CreateSibling): Added `Block' argument.
7782         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7783         label for the target of a `goto' and check whether we're not
7784         leaving a `finally'.
7785
7786 2004-04-27  Martin Baulig  <martin@ximian.com>
7787
7788         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7789         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7790         just for returns).
7791
7792 2004-04-27  Martin Baulig  <martin@ximian.com>
7793
7794         * statement.cs (Block.AddLabel): Also check for implicit blocks
7795         and added a CS0158 check.
7796
7797 2004-04-27  Martin Baulig  <martin@ximian.com>
7798
7799         * flowanalysis.cs (FlowBranchingLoop): New class.
7800         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7801         UsageVector's instead of an ArrayList.
7802         (FlowBranching.Label): Likewise.
7803         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7804         (FlowBranching.AddBreakVector): New method.
7805
7806 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7807
7808         * attribute.cs: Small regression fix: only convert the type if we
7809         the type is different, fixes System.Drawing build.
7810
7811 2004-04-27  Martin Baulig  <martin@ximian.com>
7812
7813         * attribute.cs (Attribute.Resolve): If we have a constant value
7814         for a named field or property, implicity convert it to the correct
7815         type.
7816
7817 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7818
7819         * statement.cs (Block.Block): Implicit blocks share
7820         'child_variable_names' fields with parent blocks.
7821         (Block.AddChildVariableNames): Remove.
7822         (Block.AddVariable): Mark variable as "used by a child block" in
7823         every surrounding block.
7824         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7825         been used in a child block, complain about violation of "Invariant
7826         meaning in blocks" rule.
7827         * cs-parser.jay (declare_local_variables): Don't use
7828         AddChildVariableNames.
7829         (foreach_statement): Don't create an implicit block: 'foreach'
7830         introduces a scope.
7831
7832 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7833
7834         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7835         converting from 0L to ulong.  Fixes 57522.
7836
7837 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7838
7839         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7840         derived class hides via 'new' keyword field from base class (test-242.cs).
7841         TODO: Handle this in the more general way.
7842         
7843         * class.cs (CheckBase): Ditto.
7844
7845 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7846
7847         * decl.cs (caching_flags): New member for storing cached values
7848         as bit flags.
7849         (MemberCore.Flags): New enum where bit flags for caching_flags
7850         are defined.
7851         (MemberCore.cls_compliance): Moved to caching_flags.
7852         (DeclSpace.Created): Moved to caching_flags.
7853
7854         * class.cs: Use caching_flags instead of DeclSpace.Created
7855         
7856 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7857
7858         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7859         if we are only a derived class, not a nested class.
7860
7861         * typemanager.cs: Same as above, but do this at the MemberLookup
7862         level (used by field and methods, properties are handled in
7863         PropertyExpr).   Allow for the qualified access if we are a nested
7864         method. 
7865
7866 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7867
7868         * class.cs: Refactoring.
7869         (IMethodData): New inteface; Holds links to parent members
7870         to avoid member duplication (reduced memory allocation).
7871         (Method): Implemented IMethodData interface.
7872         (PropertyBase): New inner classes for get/set methods.
7873         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7874         (Event): New inner classes for add/remove methods.
7875         (Event.DelegateMethod): Implemented IMethodData interface.
7876
7877         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7878         EmitContext (related to class.cs refactoring).
7879
7880 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7881
7882         * delegate.cs (Delegate.VerifyApplicability): If the number of
7883         arguments are the same as the number of parameters, first try to
7884         verify applicability ignoring  any 'params' modifier on the last
7885         parameter.
7886         Fixes #56442.
7887
7888 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7889
7890         * class.cs (TypeContainer.AddIndexer): Use
7891         'ExplicitInterfaceName' to determine if interface name was
7892         explicitly specified.  'InterfaceType' is not initialized at this time.
7893         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7894         Indexers array is already in the required order.  Initialize
7895         'IndexerName' only if there are normal indexers.
7896         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7897         (TypeContainer.Emit): Emit DefaultMember attribute only if
7898         IndexerName is initialized.
7899         Fixes #56300.
7900
7901 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7902
7903         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7904         Fixes #57007
7905
7906 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7907
7908         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7909         attributes.
7910         Fix for #56456.
7911
7912         * attribute.cs (Attribute.Resolve): Check for duplicate named
7913         attributes.
7914         Fix for #56463.
7915
7916 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7917
7918         * iterators.cs (MarkYield): track whether we are in an exception,
7919         and generate code accordingly.  Use a temporary value to store the
7920         result for our state.
7921
7922         I had ignored a bit the interaction of try/catch with iterators
7923         since their behavior was not entirely obvious, but now it is
7924         possible to verify that our behavior is the same as MS .NET 2.0
7925
7926         Fixes 54814
7927
7928 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7929
7930         * iterators.cs: Avoid creating temporaries if there is no work to
7931         do. 
7932
7933         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7934         Enumerations, use TypeManager.EnumToUnderlying and call
7935         recursively. 
7936
7937         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7938         bug #57013
7939
7940         (This.Emit): Use EmitContext.EmitThis to emit our
7941         instance variable.
7942
7943         (This.EmitAssign): Ditto.
7944
7945         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7946         codepaths, we will move all the functionality into
7947         Mono.CSharp.This 
7948
7949         (FieldExpr.EmitAssign): Ditto.
7950
7951         This fixes several hidden bugs that I uncovered while doing a code
7952         review of this today.
7953
7954         * codegen.cs (EmitThis): reworked so the semantics are more clear
7955         and also support value types "this" instances.
7956
7957         * iterators.cs: Changed so that for iterators in value types, we
7958         do not pass the value type as a parameter.  
7959
7960         Initialization of the enumerator helpers is now done in the caller
7961         instead of passing the parameters to the constructors and having
7962         the constructor set the fields.
7963
7964         The fields have now `assembly' visibility instead of private.
7965
7966 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7967
7968         * expression.cs (Argument.Resolve): Check if fields passed as ref
7969         or out are contained in a MarshalByRefObject.
7970
7971         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7972         another compiler type.
7973
7974 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7975
7976         * class.cs (Indexer.Define): use the new name checking method.
7977         Also, return false on an error.
7978         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7979         (is_identifier_[start/part]_character): make static.
7980
7981 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7982
7983         * expression.cs (Binary.ResolveOperator): Do no append strings
7984         twice: since we can be invoked more than once (array evaluation)
7985         on the same concatenation, take care of this here.  Based on a fix
7986         from Ben (bug #56454)
7987
7988 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7989
7990         * codegen.cs: Fix another case where CS1548 must be reported (when 
7991         delay-sign isn't specified and no private is available #56564). Fix
7992         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7993         error when MCS is used on the MS runtime and we need to delay-sign 
7994         (which seems unsupported by AssemblyBuilder - see #56621).
7995
7996 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7997
7998         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7999         (TypeManager.ComputeNamespaces): Faster implementation for
8000         Microsoft runtime.
8001
8002         * compiler.csproj: Updated AssemblyName to mcs.
8003
8004 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
8005
8006         * rootcontext.cs: Add new types to the boot resolution.
8007
8008         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8009         MulticastDelegate is not allowed.
8010
8011         * typemanager.cs: Add new types to lookup: System.TypedReference
8012         and ArgIterator.
8013
8014         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8015         check for TypedReference or ArgIterator, they are not allowed. 
8016
8017         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8018         makes us properly catch 1510 in some conditions (see bug 56016 for
8019         details). 
8020
8021 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
8022
8023         * CryptoConvert.cs: update from corlib version
8024         with endian fixes.
8025
8026 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
8027
8028         * class.cs (Indexer.Define): Check indexername declaration
8029
8030 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
8031
8032         * attribute.cs (IsClsCompliant): Fixed problem with handling
8033         all three states (compliant, not-compliant, undetected).
8034
8035 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
8036
8037         * attribute.cs (Attribute): Location is now public.
8038         (Resolve): Store resolved arguments (pos_values) in attribute class.
8039         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8040         (GetClsCompliantAttributeValue): New method that gets
8041         CLSCompliantAttribute value.
8042         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8043         if exists else null.
8044         (AttributeTester): New class for CLS-Compliant verification routines.
8045
8046         * class.cs (Emit): Add CLS-Compliant verification.
8047         (Method.GetSignatureForError): Implemented.
8048         (Constructor.GetSignatureForError): Implemented
8049         (Constructor.HasCompliantArgs): Returns if constructor has
8050         CLS-Compliant arguments.
8051         (Constructor.Emit): Override.
8052         (Construcor.IsIdentifierClsCompliant): New method; For constructors
8053         is needed to test only parameters.
8054         (FieldBase.GetSignatureForError): Implemented.
8055         (TypeContainer): New member for storing base interfaces.
8056         (TypeContainer.FindMembers): Search in base interfaces too.
8057
8058         * codegen.cs (GetClsComplianceAttribute): New method that gets
8059         assembly or module CLSCompliantAttribute value.
8060         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8061         for assembly.
8062         (ModuleClass.Emit): Add error 3012 test.
8063
8064         * const.cs (Emit): Override and call base for CLS-Compliant tests.
8065
8066         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8067         state for all decl types.
8068         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8069         if CLS-Compliant tests are required.
8070         (IsClsCompliaceRequired): New method. Analyze whether code
8071         must be CLS-Compliant.
8072         (IsExposedFromAssembly): New method. Returns true when MemberCore
8073         is exposed from assembly.
8074         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8075         value or gets cached value.
8076         (HasClsCompliantAttribute): New method. Returns true if MemberCore
8077         is explicitly marked with CLSCompliantAttribute.
8078         (IsIdentifierClsCompliant): New abstract method. This method is
8079         used to testing error 3005.
8080         (IsIdentifierAndParamClsCompliant): New method. Common helper method
8081         for identifier and parameters CLS-Compliant testing.
8082         (VerifyClsCompliance): New method. The main virtual method for
8083         CLS-Compliant verifications.
8084         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8085         null. I don't know why is null (too many public members !).
8086         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8087         and get value of first CLSCompliantAttribute that found.
8088
8089         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8090         (VerifyClsCompliance): Override and add extra tests.
8091
8092         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8093         clscheck- disable CLS-Compliant verification event if assembly is has
8094         CLSCompliantAttribute(true).
8095
8096         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8097         ApllyAttribute is now called in emit section as in the other cases.
8098         Possible future Emit integration.
8099         (IsIdentifierClsCompliant): New override.
8100         (VerifyClsCompliance): New override.
8101         (GetEnumeratorName): Returns full enum name.
8102
8103         * parameter.cs (GetSignatureForError): Implemented.
8104
8105         * report.cs (WarningData): New struct for Warning message information.
8106         (LocationOfPreviousError): New method.
8107         (Warning): New method. Reports warning based on the warning table.
8108         (Error_T): New method. Reports error based on the error table.
8109
8110         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8111         verifications are done here.
8112
8113         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8114
8115         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8116         CLSCompliantAttribute.
8117         (all_imported_types): New member holds all imported types from other
8118         assemblies.
8119         (LoadAllImportedTypes): New method fills static table with exported types
8120         from all referenced assemblies.
8121         (Modules): New property returns all assembly modules.
8122
8123 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
8124
8125         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8126         throwing a parser error.
8127
8128         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8129         which removes the hardcoded get_/set_ prefixes for properties, as
8130         IL allows for the properties to be named something else.  
8131
8132         Bug #56013
8133
8134         * expression.cs: Do not override operand before we know if it is
8135         non-null.  Fix 56207
8136
8137 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8138
8139         * typemanager.cs: support for pinned variables.
8140
8141 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8142
8143         * decl.cs, typemanager.cs: Avoid using an arraylist
8144         as a buffer if there is only one result set.
8145
8146 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8147
8148         * expression.cs: Make sure you cant call a static method
8149         with an instance expression, bug #56174.
8150
8151 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
8152
8153         * class.cs (IsDuplicateImplementation): Improve error reporting to
8154         flag 663 (method only differs in parameter modifier).
8155
8156         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8157         in preprocessor directives.
8158
8159         * location.cs (LookupFile): Allow for the empty path.
8160
8161         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
8162         better approach for some of that patch, but its failing with the
8163         CharSet enumeration.  For now try/catch will do.
8164
8165         * typemanager.cs: Do not crash if a struct does not have fields.
8166         Fixes 56150.
8167
8168 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8169
8170         * expression.cs: cs0213, cant fix a fixed expression.
8171         fixes 50231.
8172
8173 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8174
8175         * cs-parser.jay: detect invalid embeded statements gracefully.
8176         bug #51113.
8177
8178 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8179
8180         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8181         As a regex:
8182         s/
8183         the invocation type may not be a subclass of the tye of the item/
8184         The type of the item must be a subclass of the invocation item.
8185         /g
8186
8187         Fixes bug #50820.
8188
8189 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
8190
8191         * attribute.cs: Added methods to get a string and a bool from an
8192         attribute. Required to information from AssemblyKeyFileAttribute,
8193         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8194         * codegen.cs: Modified AssemblyName creation to include support for
8195         strongnames. Catch additional exceptions to report them as CS1548.
8196         * compiler.csproj: Updated include CryptoConvert.cs.
8197         * compiler.csproj.user: Removed file - user specific configuration.
8198         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
8199         Mono.Security assembly. The original class is maintained and tested in
8200         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8201         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8202         like CSC 8.0 (C# v2) supports.
8203         * Makefile: Added CryptoConvert.cs to mcs sources.
8204         * rootcontext.cs: Added new options for strongnames.
8205
8206 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
8207
8208         * driver.cs: For --expect-error, report error code `2'
8209         if the program compiled with no errors, error code `1' if
8210         it compiled with an error other than the one expected.
8211
8212 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
8213
8214         * compiler.csproj: Updated for Visual Studio .NET 2003.
8215         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8216         * compiler.sln: Updated for Visual Studio .NET 2003.
8217
8218 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
8219
8220         * expression.cs: Fix bug #47234. We basically need to apply the
8221         rule that we prefer the conversion of null to a reference type
8222         when faced with a conversion to 'object' (csc behaviour).
8223
8224 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8225
8226         * statement.cs: Shorter form for foreach, eliminates
8227         a local variable. r=Martin.
8228
8229 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8230
8231         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8232         checks if we can use brtrue/brfalse to test for 0.
8233         * expression.cs: use the above in the test for using brtrue/brfalse.
8234         cleanup code a bit.
8235
8236 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8237
8238         * expression.cs: Rewrite string concat stuff. Benefits:
8239
8240         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8241         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8242         rather than a concat chain.
8243
8244         * typemanager.cs: Add lookups for more concat overloads.
8245
8246 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8247
8248         * expression.cs: Emit shorter il code for array init.
8249
8250         newarr
8251         dup
8252         // set 1
8253
8254         // set 2
8255
8256         newarr
8257         stloc.x
8258
8259         ldloc.x
8260         // set 1
8261
8262         ldloc.x
8263         // set 2
8264
8265 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
8266
8267         * statement.cs: Before, two switch blocks would be merged if the
8268         total size of the blocks (end_item - begin_item + 1) was less than
8269         two times the combined sizes of the blocks.
8270
8271         Now, it will only merge if after the merge at least half of the
8272         slots are filled.
8273
8274         fixes 55885.
8275
8276 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
8277
8278         * class.cs : csc build fix for GetMethods(). See bug #52503.
8279
8280 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
8281
8282         * expression.cs: Make sure fp comparisons work with NaN.
8283         This fixes bug #54303. Mig approved this patch a long
8284         time ago, but we were not able to test b/c the runtime
8285         had a related bug.
8286
8287 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
8288
8289         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
8290
8291 2004-03-19  Martin Baulig  <martin@ximian.com>
8292
8293         * class.cs (MemberCore.IsDuplicateImplementation): Report the
8294         error here and not in our caller.
8295
8296 2004-03-19  Martin Baulig  <martin@ximian.com>
8297
8298         * interface.cs: Completely killed this file.
8299         (Interface): We're now a TypeContainer and live in class.cs.
8300
8301         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8302         argument; we're now also called for interfaces.
8303         (TypeContainer.DefineMembers): Allow this method being called
8304         multiple times.
8305         (TypeContainer.GetMethods): New public method; formerly known as
8306         Interface.GetMethod().  This is used by PendingImplementation.
8307         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8308         it's now private and non-static.
8309         (Interface): Moved this here; it's now implemented similar to
8310         Class and Struct.
8311         (Method, Property, Event, Indexer): Added `bool is_interface'
8312         argument to their .ctor's.
8313         (MemberBase.IsInterface): New public field.
8314
8315         * cs-parser.jay: Create normal Method, Property, Event, Indexer
8316         instances instead of InterfaceMethod, InterfaceProperty, etc.
8317         (opt_interface_base): Removed; we now use `opt_class_base' instead.
8318         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8319
8320 2004-03-19  Martin Baulig  <martin@ximian.com>
8321
8322         * class.cs (MethodCore.IsDuplicateImplementation): New private
8323         method which does the CS0111 checking.
8324         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8325         Use IsDuplicateImplementation().
8326
8327 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8328
8329         * decl.cs (FindMemberToOverride): New method to find the correct
8330         method or property to override in the base class.
8331         * class.cs
8332             - Make Method/Property use the above method to find the
8333               version in the base class.
8334             - Remove the InheritableMemberSignatureCompare as it is now
8335               dead code.
8336
8337         This patch makes large code bases much faster to compile, as it is
8338         O(n) rather than O(n^2) to do this validation.
8339
8340         Also, it fixes bug 52458 which is that nested classes are not
8341         taken into account when finding the base class member.
8342
8343         Reviewed/Approved by Martin.
8344
8345 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8346
8347         * interface.cs: In all interface classes removed redundant
8348         member initialization.
8349
8350 2004-03-16  Martin Baulig  <martin@ximian.com>
8351
8352         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8353
8354 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8355
8356         * decl.cs (DefineTypeAndParents): New helper method to define a
8357         type's containers before the type itself is defined;  This is a
8358         bug exposed by the recent changes to Windows.Forms when an
8359         implemented interface was defined inside a class that had not been
8360         built yet.   
8361
8362         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8363
8364         (Check): Loop correctly to report errors modifiers
8365         (UNSAFE was not in the loop, since it was the same as TOP).
8366
8367         * interface.cs: Every interface member now takes a ModFlags,
8368         instead of a "is_new" bool, which we set on the base MemberCore. 
8369
8370         Every place where we called "UnsafeOk" in the interface, now we
8371         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8372         the unsafe settings from the member declaration instead of the
8373         container interface. 
8374
8375         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8376
8377         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8378         `set_indexer_name' to the pending bits (one per type).
8379
8380         We fixed a bug today that was picking the wrong method to
8381         override, since for properties the existing InterfaceMethod code
8382         basically ignored the method name.  Now we make sure that the
8383         method name is one of the valid indexer names.
8384
8385 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8386  
8387         * support.cs (SeekableStreamReader): Keep track of stream byte
8388         positions and don't mix them with character offsets to the buffer.
8389
8390         Patch from Gustavo Giráldez
8391
8392 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8393
8394         * interface.cs (InterfaceSetGetBase): Removed double member
8395         initialization, base class does it as well.
8396
8397 2004-03-13  Martin Baulig  <martin@ximian.com>
8398
8399         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8400         when compiling corlib.
8401
8402 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8403
8404         * convert.cs (ExplicitConversion): We were reporting an error on
8405         certain conversions (object_type source to a value type, when the
8406         expression was `null') before we had a chance to pass it through
8407         the user defined conversions.
8408
8409         * driver.cs: Replace / and \ in resource specifications to dots.
8410         Fixes 50752
8411
8412         * class.cs: Add check for duplicate operators.  Fixes 52477
8413
8414 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8415
8416         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8417         that are in the middle of the statements, not only at the end.
8418         Fixes #54987
8419
8420         * class.cs (TypeContainer.AddField): No longer set the
8421         `HaveStaticConstructor' flag, now we call it
8422         `UserDefineStaticConstructor' to diferentiate the slightly
8423         semantic difference.
8424
8425         The situation is that we were not adding BeforeFieldInit (from
8426         Modifiers.TypeAttr) to classes that could have it.
8427         BeforeFieldInit should be set to classes that have no static
8428         constructor. 
8429
8430         See:
8431
8432         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8433
8434         And most importantly Zoltan's comment:
8435
8436         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8437
8438         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8439          before its static fields are used', i.e. initialization does not need
8440          to be triggered by the first access to the type. Setting this flag
8441          helps the JIT to compile better code, since it can run the static
8442          constructor at JIT time, and does not need to generate code to call it
8443          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8444          this flag for lots of classes like String. 
8445          
8446          csc sets this flag if the type does not have an explicit static 
8447          constructor. The reasoning seems to be that if there are only static
8448          initalizers for a type, and no static constructor, then the programmer
8449          does not care when this initialization happens, so beforefieldinit
8450          can be used.
8451          
8452          This bug prevents the AOT compiler from being usable, since it 
8453          generates so many calls to mono_runtime_class_init that the AOT code
8454          is much slower than the JITted code. The JITted code is faster, 
8455          because it does not generate these calls if the vtable is type is
8456          already initialized, which is true in the majority of cases. But the
8457          AOT compiler can't do this."
8458
8459 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8460
8461         * class.cs (MethodData.Emit): Refactor the code so symbolic
8462         information is generated for destructors;  For some reasons we
8463         were taking a code path that did not generate symbolic information
8464         before. 
8465
8466 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8467
8468         * class.cs: Create a Constructor.CheckBase method that
8469         takes care of all validation type code. The method
8470         contains some code that was moved from Define.
8471
8472         It also includes new code that checks for duplicate ctors.
8473         This fixes bug #55148.
8474
8475 2004-03-09  Joshua Tauberer <tauberer@for.net>
8476
8477         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8478         a { ... }-style array creation invokes EmitStaticInitializers
8479         which is not good for reference-type arrays.  String, decimal
8480         and now null constants (NullCast) are not counted toward
8481         static initializers.
8482
8483 2004-03-05  Martin Baulig  <martin@ximian.com>
8484
8485         * location.cs (SourceFile.HasLineDirective): New public field;
8486         specifies whether the file contains or is referenced by a "#line"
8487         directive.
8488         (Location.DefineSymbolDocuments): Ignore source files which
8489         either contain or are referenced by a "#line" directive.        
8490
8491 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8492
8493         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8494         direct access to our parent, so check the method inline there.
8495
8496 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8497
8498         * expression.cs (Invocation.EmitCall): Miguel's last commit
8499         caused a regression. If you had:
8500
8501             T t = null;
8502             t.Foo ();
8503
8504         In Foo the implict this would be null.
8505
8506 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8507
8508         * expression.cs (Invocation.EmitCall): If the method is not
8509         virtual, do not emit a CallVirt to it, use Call.
8510
8511         * typemanager.cs (GetFullNameSignature): Improve the method to
8512         cope with ".ctor" and replace it with the type name.
8513
8514         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8515         as an argument the ConstructorBuilder where it is being defined,
8516         to catch the recursive constructor invocations.
8517
8518 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8519
8520         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8521         routines to check if a type is an enumerable/enumerator allow
8522         classes that implement the IEnumerable or IEnumerator interfaces.
8523
8524         * class.cs (Property, Operator): Implement IIteratorContainer, and
8525         implement SetYields.
8526
8527         (Property.Define): Do the block swapping for get_methods in the
8528         context of iterators.   We need to check if Properties also
8529         include indexers or not.
8530
8531         (Operator): Assign the Block before invoking the
8532         OperatorMethod.Define, so we can trigger the Iterator code
8533         replacement. 
8534
8535         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8536         Property and Operator classes are not created when we parse the
8537         declarator but until we have the block completed, so we use a
8538         singleton SimpleIteratorContainer.Simple to flag whether the
8539         SetYields has been invoked.
8540
8541         We propagate this setting then to the Property or the Operator to
8542         allow the `yield' to function.
8543
8544 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8545
8546         * codegen.cs: Implemented attribute support for modules.
8547         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8548         Assembly/Module functionality.
8549
8550         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8551         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8552         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8553
8554 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8555
8556         * interface.cs (FindMembers): The operation is performed on all base
8557         interfaces and not only on the first. It is required for future CLS Compliance patch.
8558
8559 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8560
8561         * statement.cs, codegen.cs:
8562         This patch deals with patterns such as:
8563
8564         public class List : IEnumerable {
8565
8566                 public MyEnumerator GetEnumerator () {
8567                         return new MyEnumerator(this);
8568                 }
8569
8570                 IEnumerator IEnumerable.GetEnumerator () {
8571                         ...
8572                 }
8573                 
8574                 public struct MyEnumerator : IEnumerator {
8575                         ...
8576                 }
8577         }
8578
8579         Before, there were a few things we did wrong:
8580         1) we would emit callvirt on a struct, which is illegal
8581         2) we emited ldarg when we needed to emit ldarga
8582         3) we would mistakenly call the interface methods on an enumerator
8583         type that derived from IEnumerator and was in another assembly. For example:
8584
8585         public class MyEnumerator : IEnumerator
8586
8587         Would have the interface methods called, even if there were public impls of the
8588         method. In a struct, this lead to invalid IL code.
8589
8590 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8591
8592         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8593           renamed to Emit.
8594
8595         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8596
8597 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8598
8599         * cs-parser.jay: Fix small regression: we were not testing V2
8600         compiler features correctly.
8601
8602         * interface.cs: If the emit context is null, then create one
8603
8604 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8605
8606         * decl.cs (GetSignatureForError): New virtual method to get full name
8607           for error messages.
8608
8609         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8610           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8611
8612         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8613           Duplicated members and code in these classes has been removed.
8614           Better encapsulation in these classes.
8615
8616 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8617
8618         * assign.cs (Assign.DoResolve): When dealing with compound
8619         assignments, there is a new rule in ECMA C# 2.4 (might have been
8620         there before, but it is documented here) that states that in:
8621
8622         a op= b;
8623
8624         If b is of type int, and the `op' is a shift-operator, then the
8625         above is evaluated as:
8626
8627         a = (int) a op b 
8628
8629         * expression.cs (Binary.ResolveOperator): Instead of testing for
8630         int/uint/long/ulong, try to implicitly convert to any of those
8631         types and use that in pointer arithmetic.
8632
8633         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8634         method to print information for from the type, not from the
8635         null-method we were given.
8636
8637 2004-02-01  Duncan Mak  <duncan@ximian.com>
8638
8639         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8640         parsing for cmd, fixes bug #53694.
8641
8642 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8643
8644         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8645         in the member name duplication tests. Property and operator name duplication
8646         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8647
8648 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8649
8650         * interface.cs (PopulateMethod): Fixed crash when interface method
8651         returns not existing type (error test cs0246-3.cs).
8652
8653 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8654
8655         * cs-parser.jay (interface_accessors): Re-write actions to also
8656         store attributes attached to get and set methods. Fix spelling
8657         while at it.
8658
8659         (inteface_property_declaration): Modify accordingly.
8660
8661         (InterfaceAccessorInfo): New helper class to store information to pass
8662         around between rules that use interface_accessors.
8663
8664         * interface.cs (Emit): Apply attributes on the get and set
8665         accessors of properties and indexers too.
8666
8667         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8668         right MethodBuilder when applying attributes to the get and set accessors.
8669
8670 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8671
8672         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8673
8674 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8675
8676         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8677
8678 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8679
8680         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8681         changes that treat `yield' specially when present before `break'
8682         or `return' tokens.
8683
8684         * cs-tokenizer.cs: yield is no longer a keyword.
8685
8686 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8687
8688         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8689         setting for default constructors.
8690         For default constructors are almost every time set wrong Modifier. The
8691         generated IL code has been alright. But inside mcs this values was
8692         wrong and this was reason why several of my CLS Compliance tests
8693         failed.
8694
8695 2004-01-22  Martin Baulig  <martin@ximian.com>
8696
8697         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8698         not a QualifiedIdentifier.  This is what `type_name_expression'
8699         was previously doing.
8700         (type_name_expression): Removed; the code is now in
8701         `namespace_or_type_name'.
8702         (qualified_identifier): Removed, use `namespace_or_type_name'
8703         instead.
8704         (QualifiedIdentifier): Removed this class.      
8705
8706 2004-01-22  Martin Baulig  <martin@ximian.com>
8707
8708         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8709         not a string as alias name.
8710
8711 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8712
8713         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8714         #52730 bug, and instead compute correctly the need to use a
8715         temporary variable when requesting an address based on the
8716         static/instace modified of the field and the constructor.
8717  
8718 2004-01-21  Martin Baulig  <martin@ximian.com>
8719
8720         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8721         class and namespace before looking up aliases.  Fixes #52517.
8722
8723 2004-01-21  Martin Baulig  <martin@ximian.com>
8724
8725         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8726         assinged in a 'try'; fixes exception4.cs.
8727
8728 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8729         * class.cs : Implemented parameter-less constructor for TypeContainer
8730
8731         * decl.cs: Attributes are now stored here. New property OptAttributes
8732
8733         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8734
8735         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8736
8737 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8738
8739         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8740           (CSharpSignature): New method for indexer and property signature.
8741
8742 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8743
8744         * pending.cs (IsVirtualFilter): Faster implementation.
8745
8746 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8747
8748         * typemanager.cs: Avoid inclusion of same assembly more than once.
8749
8750 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8751
8752         * cs-parser.jay: Fixed problem where the last assembly attribute
8753           has been applied also to following declaration (class, struct, etc.)
8754           
8755 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8756
8757         * class.cs: Added error CS0538, CS0539 reporting.
8758         Fixed crash on Microsoft runtime when field type is void.
8759
8760         * cs-parser.jay: Added error CS0537 reporting.
8761
8762         * pending.cs: Added error CS0535 reporting.
8763         Improved error report for errors CS0536, CS0534.
8764
8765 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8766
8767         Merge a few bits from the Anonymous Method MCS tree.
8768
8769         * statement.cs (ToplevelBlock): New class for toplevel methods,
8770         will hold anonymous methods, lifted variables.
8771
8772         * cs-parser.jay: Create toplevel blocks for delegates and for
8773         regular blocks of code. 
8774
8775 2004-01-20  Martin Baulig  <martin@ximian.com>
8776
8777         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8778         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8779         and `NeedExplicitReturn'; added `IsLastStatement'.
8780         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8781         have a `ReturnLabel' or we're not unreachable.
8782
8783         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8784         child's reachability; don't just override ours with it.  Fixes
8785         #58058 (lluis's example).
8786         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8787         InFinally(), InLoop(), InSwitch() and
8788         BreakCrossesTryCatchBoundary() methods.
8789
8790         * statement.cs (Return): Do all error checking in Resolve().
8791         Unless we are the last statement in a top-level block, always
8792         create a return label and jump to it.
8793         (Break, Continue): Do all error checking in Resolve(); also make
8794         sure we aren't leaving a `finally'.
8795         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8796         statement in a top-level block.
8797         (Block.Flags): Added `IsDestructor'.
8798         (Block.IsDestructor): New public property.
8799
8800 2004-01-20  Martin Baulig  <martin@ximian.com>
8801
8802         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8803
8804 2004-01-20  Martin Baulig  <martin@ximian.com>
8805
8806         * statement.cs (Statement.ResolveUnreachable): New public method.
8807         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8808         (Block.Resolve): Resolve unreachable statements.
8809
8810 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8811
8812         * expression.cs: We need to fix the case where we do
8813         not have a temp variable here.
8814
8815         * assign.cs: Only expression compound assignments need
8816         temporary variables.
8817
8818 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8819
8820         * flowanalysis.cs: Reduce memory allocation in a few ways:
8821           - A block with no variables should not allocate a bit
8822             vector for itself.
8823           - A method with no out parameters does not need any tracking
8824             for assignment of the parameters, so we need not allocate
8825             any data for it.
8826           - The arrays:
8827                 public readonly Type[] VariableTypes;
8828                 public readonly string[] VariableNames;
8829             Are redundant. The data is already stored in the variable
8830             map, so we need not allocate another array for it.
8831           - We need to add alot of checks for if (params | locals) == null
8832             due to the first two changes.
8833
8834 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8835
8836         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8837         implement IMemoryLocation, we store a copy on a local variable and
8838         take the address of it.  Patch from Benjamin Jemlich
8839
8840         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8841         to use a special "type_name_expression" rule which reduces the
8842         number of "QualifiedIdentifier" classes created, and instead
8843         directly creates MemberAccess expressions.
8844
8845 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8846
8847         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8848         that fixes #52853.  Null literal assignment to ValueType
8849
8850         * class.cs (MethodData.Emit): Instead of checking the name of the
8851         method to determine if its a destructor, create a new derived
8852         class from Method called Destructor, and test for that.  
8853
8854         * cs-parser.jay: Create a Destructor object instead of a Method.  
8855
8856         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8857
8858         Fixes: 52933
8859
8860 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8861
8862         * expression.cs (Binary.ResolveOperator): Perform an implicit
8863         conversion from MethodGroups to their delegate types on the
8864         Addition operation.
8865
8866         * delegate.cs: Introduce a new class DelegateCreation that is the
8867         base class for `NewDelegate' and `ImplicitDelegateCreation',
8868         factor some code in here.
8869
8870         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8871         conversion from MethodGroups to compatible delegate types. 
8872
8873         * ecore.cs (Expression.Resolve): Do not flag error 654
8874         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8875         we allow conversions from MethodGroups to delegate types now.
8876
8877         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8878         assignments in v2 either.
8879
8880 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8881
8882         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8883         static read-only fields in ctors.
8884
8885         Applied patch from Benjamin Jemlich 
8886
8887         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8888
8889 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8890
8891         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8892         here to return true, as they can be used like this:
8893
8894                 (XXX) int.MEMBER ()
8895
8896         Fixed 49836 and all the other dups
8897
8898 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8899
8900         * driver.cs: Implement /win32res and /win32icon.
8901
8902 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8903
8904         * cs-parser.jay: Add a rule to improve error handling for the
8905         common mistake of placing modifiers after the type.
8906
8907 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8908
8909         * cs-parser.jay (interface_event_declaration): Catch
8910         initialization of events on interfaces, and report cs0068
8911
8912         * cs-parser.jay (interface_event_declaration): Catch
8913         initialization of events. 
8914
8915         * ecore.cs: Better report missing constructors.
8916
8917         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8918         the error reporting done in the wrong place.  Fix.
8919
8920         * expression.cs (Binary.ResolveOperator): Catch the 
8921         operator + (E x, E y) error earlier, and later allow for implicit
8922         conversions in operator +/- (E e, U x) from U to the underlying
8923         type of E.
8924
8925         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8926         52596, if the container class is abstract, the default constructor
8927         is protected otherwise its public (before, we were always public).
8928
8929         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8930         fixed statement.
8931
8932         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8933         Jemlich that fixes bug #52597, MCS was generating invalid code for
8934         idisposable structs.   Thanks to Ben for following up with this
8935         bug as well.
8936
8937 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8938
8939         * driver.cs: Allow assemblies without code to be generated, fixes
8940         52230.
8941
8942 2004-01-07  Nick Drochak <ndrochak@gol.com>
8943
8944         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8945
8946 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8947
8948         * cs-parser.jay: Add rules to improve error reporting if fields or
8949         methods are declared at the namespace level (error 116)
8950
8951         * Add rules to catch event add/remove
8952
8953 2004-01-04  David Sheldon <dave-mono@earth.li>
8954
8955   * expression.cs: Added matching ")" to error message for 
8956   CS0077
8957
8958 2004-01-03 Todd Berman <tberman@gentoo.org>
8959
8960         * ecore.cs, attribute.cs:
8961         Applying fix from #52429.
8962
8963 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8964
8965         * ecore.cs, expression.cs, statement.cs:
8966         Total rewrite of how we handle branching. We
8967         now handle complex boolean expressions with fewer
8968         jumps. As well if (x == 0) no longer emits a ceq.
8969
8970         if (x is Foo) is much faster now, because we generate
8971         better code.
8972
8973         Overall, we get a pretty big improvement on our benchmark
8974         tests. The code we generate is smaller and more readable.
8975
8976         I did a full two-stage bootstrap. The patch was reviewed
8977         by Martin and Miguel.
8978
8979 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8980
8981         * cs-parser.jay: Make primary_expression not take a QI.
8982         we dont need this because the member_access rule covers
8983         us here. So we replace the rule with just IDENTIFIER.
8984
8985         This has two good effects. First, we remove a s/r conflict.
8986         Second, we allocate many fewer QualifiedIdentifier objects.
8987
8988 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8989
8990         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8991         set the correct information via SRE. This prevents
8992         hanging on the MS runtime. Fixes #29374.
8993
8994 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8995
8996         * convert.cs: correctly handle conversions to value types
8997         from Enum and ValueType as unboxing conversions.
8998
8999         Fixes bug #52569. Patch by Benjamin Jemlich.
9000
9001 2004-01-02  Ravi Pratap  <ravi@ximian.com>
9002
9003         * expression.cs (BetterConversion): Prefer int -> uint
9004         over int -> ulong (csc's behaviour). This fixed bug #52046.
9005
9006 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9007
9008         * decl.cs (MemberCache.FindMembers): now returns a
9009         MemberInfo [].
9010
9011         * typemanager.cs: In general, go with with ^^.
9012         (CopyNewMethods): take an IList.
9013         (RealMemberLookup): Only allocate an arraylist
9014         if we copy from two sets of methods.
9015
9016         This change basically does two things:
9017         1) Fewer array lists allocated due to CopyNewMethods.
9018         2) the explicit cast in MemberList costed ALOT.
9019
9020 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
9021
9022         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9023         a hashtable to avoid needless string allocations when an identifier is
9024         used more than once (the common case).
9025
9026 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9027
9028         * pending.cs: MS's TypeBuilder.GetInterfaces ()
9029         is broken, it will not return anything. So, we
9030         have to use the information we have in mcs to
9031         do the task.
9032
9033         * typemanager.cs: Add a cache for GetInterfaces,
9034         since this will now be used more often (due to ^^)
9035
9036         (GetExplicitInterfaces) New method that gets the
9037         declared, not effective, interfaces on a type
9038         builder (eg, if you have interface IFoo, interface
9039         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9040         { IBar }.
9041
9042         This patch makes MCS able to bootstrap itself on
9043         Windows again.
9044
9045 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9046
9047         * expression.cs: Remove the Nop's that Miguel put
9048         in by mistake.
9049
9050 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9051
9052         * report.cs, codegen.cs: Give the real stack trace to
9053         the error when an exception is thrown.
9054
9055 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9056
9057         * decl.cs: only allocate hashtables for ifaces if 
9058         it is an iface!
9059
9060 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9061
9062         * expression.cs: fix the error from cs0121-2.cs
9063         (a parent interface has two child interfaces that
9064         have a function with the same name and 0 params
9065         and the function is called through the parent).
9066
9067 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9068
9069         * class.cs, rootcontext.cs, typmanager.cs: do not
9070         leak pointers.
9071
9072 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9073
9074         * codegen.cs: remove stack for the ec flow branching.
9075         It is already a linked list, so no need.
9076
9077 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9078
9079         * Makefile: Allow custom profiler here.
9080
9081 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9082
9083         * typemanager.cs (LookupType):
9084           - Use a static char [], because split takes
9085             a param array for args, so it was allocating
9086             every time.
9087           - Do not store true in a hashtable, it boxes.
9088
9089 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9090
9091         * flowanalysis.cs: bytify common enums.
9092
9093 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9094
9095         * modifiers.cs: Add a new set of flags for the
9096         flags allowed on explicit interface impls.
9097         * cs-parser.jay: catch the use of modifiers in
9098         interfaces correctly.
9099         * class.cs: catch private void IFoo.Blah ().
9100
9101         All related to bug #50572.
9102
9103 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9104
9105         * decl.cs: Rewrite the consistant accessability checking.
9106         Accessability is not linear, it must be implemented in
9107         a tableish way. Fixes #49704.
9108
9109 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9110
9111         * expression.cs: Handle negation in a checked context.
9112         We must use subtraction from zero. Fixes #38674.
9113
9114 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9115
9116         * class.cs: Ignore static void main in DLLs.
9117         * rootcontext.cs: Handle the target type here,
9118         since we are have to access it from class.cs
9119         * driver.cs: account for the above.
9120
9121 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9122
9123         * report.cs: Give line numbers and files if available.
9124
9125 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
9126
9127         * driver.cs: Implement /addmodule.
9128
9129         * typemanager.cs:  Change 'modules' field so it now contains Modules not
9130         ModuleBuilders.
9131
9132 2003-12-20  Martin Baulig  <martin@ximian.com>
9133
9134         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9135         (FieldBase.IsAssigned): Removed this field.
9136         (FieldBase.SetAssigned): New public method.
9137         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9138
9139 2003-12-20  Martin Baulig  <martin@ximian.com>
9140
9141         * expression.cs (LocalVariableReference.DoResolve): Don't set
9142         `vi.Used' if we're called from DoResolveLValue().
9143
9144         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9145         returns the usage vector it just merged into the current one -
9146         pass this one to UsageWarning().
9147         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9148         of the `EmitContext', don't call this recursively on our children.
9149
9150 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
9151
9152         * driver.cs: Implement /target:module.
9153
9154 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
9155
9156         * support.cs (CharArrayHashtable): New helper class.
9157
9158         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
9159         char arrays, not strings, so we can avoid creating a string in
9160         consume_identifier if the identifier is a keyword.
9161
9162 2003-12-16  Martin Baulig  <martin@ximian.com>
9163
9164         * statement.cs (LocalInfo.Assigned): Removed this property.
9165         (LocalInfo.Flags): Removed `Assigned'.
9166         (LocalInfo.IsAssigned): New public method; takes the EmitContext
9167         and uses flow analysis.
9168         (Block.UsageWarning): Made this method private.
9169         (Block.Resolve): Call UsageWarning() if appropriate.
9170
9171         * expression.cs (LocalVariableReference.DoResolve): Always set
9172         LocalInfo.Used here.
9173
9174 2003-12-13  Martin Baulig  <martin@ximian.com>
9175
9176         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9177         any value here; we're now using flow analysis to figure out
9178         whether a statement/block returns a value.
9179
9180 2003-12-13  Martin Baulig  <martin@ximian.com>
9181
9182         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9183         working again.
9184         (FlowBranching.MergeFinally): Don't call
9185         `branching.CheckOutParameters()' here, this is called in
9186         MergeTopBlock().
9187         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9188         when adding the `finally' vector.       
9189
9190 2003-12-13  Martin Baulig  <martin@ximian.com>
9191
9192         * flowanalysis.cs
9193         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9194         actually work and also fix #48962.
9195
9196 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9197
9198         * decl.cs: Do not check System.Object for nested types,
9199         since we know it does not have any. Big bang for buck:
9200
9201         BEFORE:
9202            Run 1:   8.35 seconds
9203            Run 2:   8.32 seconds
9204            corlib:  17.99 seconds
9205         AFTER:
9206            Run 1:   8.17 seconds
9207            Run 2:   8.17 seconds
9208            corlib:  17.39 seconds
9209
9210 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9211
9212         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9213         time we are returning 0 members, so we save alot here.
9214
9215 2003-12-11  Martin Baulig  <martin@ximian.com>
9216
9217         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9218         `MergeChild()', also just take the `FlowBranching' as argument;
9219         call Merge() on it and return the result.
9220         (FlowBranching.Merge): We don't need to do anything if we just
9221         have one sibling.
9222
9223 2003-12-11  Martin Baulig  <martin@ximian.com>
9224
9225         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9226         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
9227         Maurer for this idea.
9228
9229 2003-12-11  Martin Baulig  <martin@ximian.com>
9230
9231         * flowanalysis.cs (MergeResult): This class is now gone; we now
9232         use the `UsageVector' for this.  The reason for this is that if a
9233         branching just has one sibling, we don't need to "merge" them at
9234         all - that's the next step to do.
9235         (FlowBranching.Merge): We now return a `UsageVector' instead of a
9236         `MergeResult'.
9237
9238 2003-12-11  Martin Baulig  <martin@ximian.com>
9239
9240         Reworked flow analyis and made it more precise and bug-free.  The
9241         most important change is that we're now using a special `Reachability'
9242         class instead of having "magic" meanings of `FlowReturns'.  I'll
9243         do some more cleanups and optimizations and also add some more
9244         documentation this week.
9245
9246         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9247         largely reworked this class.
9248         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9249         the new `Reachability' class instead of having "magic" values here.
9250         (FlowBranching): We're now using an instance of `Reachability'
9251         instead of having separate `Returns', `Breaks' etc. fields.
9252
9253         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9254         based on flow analysis; ignore the return value of block.Emit ().
9255
9256 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
9257
9258         * driver.cs typemanager.cs: Find the mono extensions to corlib even
9259         if they are private.
9260
9261 2003-12-09  Martin Baulig  <martin@ximian.com>
9262
9263         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9264         call them directly on the UsageVector.
9265
9266 2003-12-09  Martin Baulig  <martin@ximian.com>
9267
9268         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9269         Changed return type from `FlowReturns' to `Reachability'.
9270
9271 2003-12-09  Martin Baulig  <martin@ximian.com>
9272
9273         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9274         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9275         `Reachable' fields with a single `Reachability' one.
9276
9277 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9278
9279         * class.cs (FindMembers): Remove foreach's.
9280
9281         Bootstrap times:
9282
9283         BEFORE
9284                 Run 1:   8.74 seconds
9285                 Run 2:   8.71 seconds
9286
9287         AFTER
9288                 Run 1:   8.64 seconds
9289                 Run 2:   8.58 seconds
9290
9291
9292 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9293
9294         * cs-parser.jay:
9295         * gen-treedump.cs:
9296         * statement.cs:
9297         This patch does a few things:
9298                 1. EmptyStatement is now a singleton, so it is never reallocated.
9299                 2. All blah is EmptyStatement constructs have been changed to
9300                    blah == EmptyStatement.Value, which is much faster and valid
9301                    now that EmptyStatement is a singleton.
9302                 3. When resolving a block, rather than allocating a new array for
9303                    the non-empty statements, empty statements are replaced with
9304                    EmptyStatement.Value
9305                 4. Some recursive functions have been made non-recursive.
9306         Mainly the performance impact is from (3), however (1) and (2) are needed for
9307         this to work. (4) does not make a big difference in normal situations, however
9308         it makes the profile look saner.
9309
9310         Bootstrap times:
9311
9312         BEFORE
9313         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9314         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9315         Total memory allocated: 56397 KB
9316
9317         AFTER
9318         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9319         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9320         Total memory allocated: 55666 KB
9321
9322 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9323
9324         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9325         than the hashtable in a hashtable version
9326
9327         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9328         we always end up concating a string. This results in a huge perf
9329         loss, because many strings have to be tracked by the GC. In this
9330         patch, we first use a hashtable that works with two keys, so that
9331         the strings do not need to be concat'ed.
9332
9333         Bootstrap times:
9334         BEFORE
9335                 Run 1:   8.74 seconds
9336                 Run 2:   8.71 seconds
9337
9338         AFTER
9339                 Run 1:   8.65 seconds
9340                 Run 2:   8.56 seconds
9341
9342 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9343
9344         * Makefile: Add a new target `do-time' that does a quick and simple
9345         profile, leaving easy to parse output.
9346
9347 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9348
9349         * codegen.cs (Init): Create the dynamic assembly with 
9350         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9351
9352 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9353
9354         * support.cs: Make the PtrHashtable use only one
9355         instance of its comparer.
9356
9357 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9358
9359         * typemanager.cs: Fix lookup of GetNamespaces.
9360
9361 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9362
9363         * expression.cs: Removed redundant line.
9364
9365         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9366         ArrayLists, use for loops with bounds.  
9367
9368         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9369         arraylist.
9370
9371         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9372         arraylists, use for loop with bounds.
9373
9374         The above three changes give us a 0.071 second performance
9375         improvement out of 3.294 seconds down to 3.223.  On my machine
9376         the above changes reduced the memory usage by 1,387 KB during
9377         compiler bootstrap.
9378
9379         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9380         QualifiedIdentifiers.  Before we created a new string through
9381         concatenation, and mostly later on, the result would be
9382         manipulated by DecomposeQI through string manipulation.
9383
9384         This reduced the compiler memory usage for bootstrapping from
9385         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9386         compile times in 0.05 seconds.
9387
9388 2003-11-28  Dick Porter  <dick@ximian.com>
9389
9390         * support.cs: Do string compares with the Invariant culture.
9391
9392         * rootcontext.cs: 
9393         * gen-treedump.cs: 
9394         * expression.cs: 
9395         * driver.cs: 
9396         * decl.cs: 
9397         * codegen.cs: 
9398         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9399         the comparison is done with the Invariant culture.
9400
9401 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9402
9403         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9404         GetEnumerator method.
9405
9406         (ProbeCollectionType): Iterate starting at the most specific type
9407         upwards looking for a GetEnumerator
9408
9409         * expression.cs: Shift count can be up to 31 for int/uint and 63
9410         for long/ulong.
9411
9412 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9413
9414         * statement.cs (Block.LookupLabel): Also look for the label on the
9415         children blocks.  Use a hash table to keep track of visited
9416         nodes. 
9417
9418         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9419         we actually did transform the other operand, otherwise fall back
9420         to the common codepath that casts to long.
9421
9422         * cs-tokenizer.cs: Use the same code pattern as the int case.
9423         Maybe I should do the parsing myself, and avoid depending on the
9424         Parse routines to get this done.
9425
9426 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9427
9428         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9429         which fixes bug 51347.  This time test it.
9430
9431         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9432         attributes for example can not tell the difference between these.
9433         The difference was only a syntax feature of the language. 
9434
9435         * attribute.cs: Apply attributes to delegates.
9436
9437         * delegate.cs: Call the apply attributes method.
9438
9439 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9440
9441         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9442         comparing 0 vs Byte.MinValue, not the value
9443
9444         (ImplicitConversionRequired): When reporting a conversion error,
9445         use error 31 to print out the constant error instead of the
9446         simpler 29.
9447
9448         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9449         which fixes bug 51347.
9450
9451 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9452
9453         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9454         which fixes the -warnaserror command line option.
9455
9456 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9457
9458         * cfold.cs (DoNumericPromotions): During constant folding of
9459         additions on UIntConstant, special case intconstants with
9460         IntConstants like we do on the expression binary operator. 
9461
9462 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9463
9464         * convert.cs (ImplicitReferenceConversion): We were missing a case
9465         (System.Enum are not value types or class types, so we need to
9466         classify them separatedly).
9467
9468         * driver.cs: We do not support error 2007.
9469
9470 2003-11-12 Jackson Harper <jackson@ximian.com>
9471
9472         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9473         system directory. Also use the full file name so users can
9474         libraries names mscorlib-o-tron.dll in a non system dir.
9475
9476 2003-11-10  Martin Baulig  <martin@ximian.com>
9477
9478         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9479         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9480         calling `ResolveType()' on them, directly assign their `Type'.
9481
9482 2003-11-08  Martin Baulig  <martin@ximian.com>
9483
9484         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9485         return value and the `out parent' parameter.
9486         (TypeContainer.DefineType): Moved the CS0644 check into
9487         GetClassBases().  Don't pass the interface types to the
9488         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9489         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9490
9491         * ecore.cs (TypeExpr.IsAttribute): New property.
9492         (TypeExpr.GetInterfaces): New method.
9493
9494         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9495         TypeExpr instead of a Type.
9496         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9497         (Interface.DefineType): Don't pass the interface types to the
9498         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9499         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9500
9501         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9502         instead of a `Type[]'.
9503         (TypeManager.RegisterBuilder): Likewise.
9504         (TypeManager.AddUserInterface): Likewise.
9505         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9506         `Type[]' and also return a `TypeExpr[]'.
9507         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9508
9509 2003-11-08  Martin Baulig  <martin@ximian.com>
9510
9511         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9512         Expression.     
9513
9514 2003-11-08  Martin Baulig  <martin@ximian.com>
9515
9516         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9517         TypeManager.ResolveExpressionTypes().
9518
9519         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9520         instead of an Expression.
9521         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9522         (TypeExpression): New public class; formerly known as `TypeExpr'.
9523
9524         * expression.cs (ComposedCast): Derive from TypeExpr.
9525
9526         * typemanager.cs (TypeManager.system_*_expr): These are now
9527         TypExpr's instead of Expression's.
9528         (TypeManager.ResolveExpressionTypes): New public static function;
9529         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9530         of them.        
9531
9532 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9533
9534         * expression.cs (New.DoResolve): Do not dereference value that
9535         might be a null return.
9536
9537         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9538         sure that the constant value has the right type.  Fixes an
9539         unreported bug, similar to 50425.
9540
9541         * const.cs (Const.LookupConstantValue): Call
9542         ImplicitStandardConversionExists before doing a conversion to
9543         avoid havng the TypeManager.ChangeType do conversions.
9544
9545         Reduced the number of casts used
9546
9547         (Const.ChangeType): New routine to enable reuse of the constant
9548         type changing code from statement.
9549
9550         * typemanager.cs (ChangeType): Move common initialization to
9551         static global variables.
9552
9553         Fixes #50425.
9554
9555         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9556         every value type to go through, even if it was void.  Fix that. 
9557
9558         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9559         character of the define, and the is_identifier_part_character for
9560         the rest of the string.
9561
9562 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9563
9564         * expression.cs (UnaryMutator.EmitCode): When I updated
9565         LocalVariableReference.DoResolve, I overdid it, and dropped an
9566         optimization done on local variable references.
9567
9568 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9569
9570         * ecore.cs: Convert the return from Ldlen into an int.
9571
9572 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9573
9574         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9575         the accessibility, this is a special case for toplevel non-public
9576         classes (internal for instance).
9577
9578 2003-10-20  Nick Drochak <ndrochak@gol.com>
9579
9580         * ecore.cs: Fix typo and build.  Needed another right paren.
9581
9582 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9583
9584         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9585         `internal' case regular and protected, but not allowing protected
9586         to be evaluated later.  Bug 49840
9587
9588 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9589
9590         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9591         to kb.Nlast, and not the kb.nFirst to isolate the switch
9592         statement.
9593
9594         Extract the underlying type, so enumerations of long/ulong are
9595         treated like long/ulong.
9596
9597 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9598
9599         * expression.cs (New): Overload the meaning of RequestedType to
9600         track the possible creation of the NewDelegate type, since
9601         DoResolve is invoked more than once for new constructors on field
9602         initialization.
9603
9604         See bugs: #48800 and #37014
9605
9606         * cs-parser.jay (declare_local_constants): Take an arraylist
9607         instead of a single constant.
9608
9609         (local_constant_declaration): It should take a
9610         constant_declarators, not a constant_declarator.  Fixes 49487
9611
9612         * convert.cs: Fix error report.
9613
9614 2003-10-13 Jackson Harper <jackson@ximian.com>
9615
9616         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9617         bug #49611
9618
9619 2003-10-09  Martin Baulig  <martin@ximian.com>
9620
9621         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9622         to the .ctor.
9623         (MethodCore.DoDefineParameters): Removed the TypeContainer
9624         argument; use the DeclSpace which was passed to the .ctor instead.
9625         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9626         TypeContainer; we only need a DeclSpace here.
9627
9628 2003-10-09  Martin Baulig  <martin@ximian.com>
9629
9630         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9631         to the .ctor.
9632         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9633         EmitContext's .ctor.    
9634
9635 2003-10-09  Martin Baulig  <martin@ximian.com>
9636
9637         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9638         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9639         AsAccessible(), moved them as well.
9640
9641         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9642
9643 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9644
9645         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9646
9647 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9648
9649         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9650         generation for >=, as spotted by Paolo, bug 48679.  
9651         Patch from David Waite.
9652
9653         * cs-tokenizer.cs: Add handling for #pragma.
9654
9655         * cs-parser.jay: Allow for both yield and yield return in the
9656         syntax.  The anti-cobolization of C# fight will go on!
9657
9658         * class.cs (TypeBuilder.DefineType): Catch error condition here
9659         (Parent.DefineType erroring out and returning null).
9660
9661         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9662         coping with enumerations variables, we were mistakenly processing
9663         them as a regular value type instead of built-in types.  Fixes the
9664         bug #48063
9665
9666         * typemanager.cs (IsBuiltinOrEnum): New method.
9667
9668 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9669
9670         * cs-parser.jay: Upgrade: yield now needs the return clause.
9671
9672 2003-09-19  Martin Baulig  <martin@ximian.com>
9673
9674         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9675         `MemberCache parent' argument.  Normally, an interface doesn't
9676         have a parent type except System.Object, but we use this in gmcs
9677         for generic type parameters.
9678
9679 2003-09-18  Martin Baulig  <martin@ximian.com>
9680
9681         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9682         on `type.IsInterface'; don't check whether the type has a parent
9683         to determine whether it's an interface.
9684
9685 2003-09-15  Martin Baulig  <martin@ximian.com>
9686
9687         * class.cs (TypeContainer.DefineType): Added an error flag to
9688         avoid reporting duplicate CS0146's ("class definition is
9689         circular.").
9690
9691         * driver.cs (Driver.MainDriver): Abort if
9692         RootContext.ResolveTree() reported any errors.
9693
9694 2003-09-07  Martin Baulig  <martin@ximian.com>
9695
9696         * report.cs (Error, Warning): Added overloaded versions which take
9697         a `params object[] args' and call String.Format().
9698
9699 2003-09-07  Martin Baulig  <martin@ximian.com>
9700
9701         * decl.cs (DeclSpace..ctor): Don't call
9702         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9703         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9704         (DeclSpace.RecordDecl): New method.
9705
9706         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9707
9708 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9709
9710         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9711         value attributes to be applied to ParameterBuilders.
9712
9713         * class.cs (MethodCore.LabelParameters): Make static and more
9714         generic so that it can be used from other places - like interface
9715         methods, for instance.
9716
9717         * interface.cs (Interface.Emit): Call LabelParameters before
9718         emitting attributes on the InterfaceMethod.
9719
9720 2003-08-26  Martin Baulig  <martin@ximian.com>
9721
9722         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9723         resolving aliases; fixes #47927.
9724
9725 2003-08-26  Martin Baulig  <martin@ximian.com>
9726
9727         * statement.cs (Using.DoResolve): This is internally emitting a
9728         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9729         do not always return.  Fixes #47681.
9730
9731 2003-08-26  Martin Baulig  <martin@ximian.com>
9732
9733         * decl.cs (MemberCore): Moved WarningNotHiding(),
9734         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9735         into MemberBase.
9736         (AdditionResult): Make this nested in DeclSpace.
9737         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9738         argument; call NamespaceEntry.Define() unless we're nested in a
9739         class or struct.
9740
9741         * namespace.cs (Namespace.DefineName): New public function.  This
9742         is called from DeclSpace's .ctor to add 
9743         (Namespace.Lookup): Include DeclSpaces in the lookup.
9744
9745         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9746
9747         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9748
9749 2003-08-25  Martin Baulig  <martin@ximian.com>
9750
9751         * convert.cs (Convert.ExplicitReferenceConversion): When
9752         converting from an interface type to a class, unbox if the target
9753         type is a struct type.  Fixes #47822.
9754
9755 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9756
9757         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9758         #47854.
9759
9760 2003-08-22  Martin Baulig  <martin@ximian.com>
9761
9762         * class.cs (TypeManager.DefineType): When defining a nested type,
9763         call DefineType() on our parent; fixes #47801.
9764
9765 2003-08-22  Martin Baulig  <martin@ximian.com>
9766
9767         * class.cs (MethodData.Define): While checking if a method is an
9768         interface implementation, improve the test a bit more to fix #47654.
9769
9770 2003-08-22  Martin Baulig  <martin@ximian.com>
9771
9772         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9773         correctly; fixes #47722.
9774
9775 2003-08-22  Martin Baulig  <martin@ximian.com>
9776
9777         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9778         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9779
9780         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9781
9782 2003-08-22  Martin Baulig  <martin@ximian.com>
9783
9784         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9785         can only be assigned in static constructors.  Fixes #47161.
9786
9787 2003-08-22  Martin Baulig  <martin@ximian.com>
9788
9789         Rewrote and improved the flow analysis code.
9790
9791         * flowbranching.cs (FlowBranching): Make this class abstract.
9792         (FlowBranching.CreateBranching): New static function to create a
9793         new flow branching.
9794         (FlowBranchingBlock, FlowBranchingException): New classes.
9795         (FlowBranching.UsageVector.Type): New public readonly field.
9796         (FlowBranching.UsageVector.Breaks): Removed the setter.
9797         (FlowBranching.UsageVector.Returns): Removed the setter.
9798         (FlowBranching.UsageVector): Added Break(), Return(),
9799         NeverReachable() and Throw() methods to modify the reachability.
9800         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9801         done by FlowBranching.Merge().
9802         (FlowBranching.UsageVector.MergeChild): New method; merges the
9803         merge result into the current vector.
9804         (FlowBranching.Merge): New abstract method to merge a branching.
9805
9806 2003-08-12  Martin Baulig  <martin@ximian.com>
9807
9808         * expression.cs (Indirection.CacheTemporaries): Create the
9809         LocalTemporary with the pointer type, not its element type.
9810
9811 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9812
9813         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9814         token was a keyword or not.
9815
9816         Add `error' options where an IDENTIFIER was expected;  Provide
9817         CheckToken and CheckIdentifierToken convenience error reporting
9818         functions. 
9819
9820         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9821
9822         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9823         NameSpaceEntry NameSpaceEntry.
9824
9825         (LookupInterfaceOrClass): Avoid creating a full qualified name
9826         from namespace and name: avoid doing lookups when we know the
9827         namespace is non-existant.   Use new Tree.LookupByNamespace which
9828         looks up DeclSpaces based on their namespace, name pair.
9829
9830         * driver.cs: Provide a new `parser verbose' to display the
9831         exception thrown during parsing.  This is turned off by default
9832         now, so the output of a failure from mcs is more graceful.
9833
9834         * namespace.cs: Track all the namespaces defined in a hashtable
9835         for quick lookup.
9836
9837         (IsNamespace): New method
9838
9839 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9840
9841         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9842         we know that we need to concatenate (full typename can never be
9843         null). 
9844
9845         * class.cs: ditto.
9846
9847         * statement.cs: Use a bitfield;  Do not initialize to null things
9848         which are done by the constructor by default.
9849
9850         * cs-parser.jay: bug fix, parameter was 4, not 3.
9851
9852         * expression.cs: Just use the property;
9853
9854         * statement.cs: No need for GetVariableInfo method.
9855
9856 2003-08-08  Martin Baulig  <martin@ximian.com>
9857
9858         * flowanalysis.cs (FlowReturns): This is now nested in the
9859         `FlowBranching' class.
9860         (MyBitVector): Moved this here from statement.cs.
9861         (FlowBranching.SiblingType): New enum type.
9862         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9863
9864 2003-08-07  Martin Baulig  <martin@ximian.com>
9865
9866         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9867         `FlowBranching' class and called `BranchingType'.
9868
9869 2003-08-07  Martin Baulig  <martin@ximian.com>
9870
9871         * flowanalysis.cs: Moved all the control flow analysis code into
9872         its own file.
9873
9874 2003-08-07  Martin Baulig  <martin@ximian.com>
9875
9876         * assign.cs (Assign.DoResolve): `target' must either be an
9877         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9878         #37319.
9879
9880 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9881
9882         * expression.cs (BinaryMethod): This kind of expression is created by the
9883         Binary class if it determines that the operator has to be handled
9884         by a method.
9885
9886         (BinaryDelegate): This kind of expression is created if we are
9887         dealing with a + or - operator on delegates.
9888
9889         (Binary): remove method, argumetns, and DelegateOperator: when
9890         dealing with methods, 
9891
9892         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9893
9894         * statement.cs (Block): use bitfields for the three extra booleans
9895         we had in use.   Remove unused topblock parameter.
9896
9897         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9898
9899         * assign.cs: Drop extra unneeded tests.
9900
9901 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9902
9903         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9904
9905         * statement.cs (Foreach): Use VariableStorage instead of
9906         LocalBuilders.   
9907
9908         * codegen.cs (VariableStorage): New class used by clients that
9909         require a variable stored: locals or fields for variables that
9910         need to live across yield.
9911
9912         Maybe provide a convenience api for EmitThis+EmitLoad?
9913
9914         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9915         these bad boys.
9916
9917 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9918
9919         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9920         RemapParameterLValue): New methods that are used to turn a
9921         precomputed FieldInfo into an expression like this:
9922
9923                 instance.FieldInfo
9924
9925         The idea is to use this instead of making LocalVariableReference
9926         have more than one meaning.
9927
9928         * cs-parser.jay: Add error production to BASE.
9929
9930         * ecore.cs: Deal with TypeManager.GetField returning null, which
9931         is now a valid return value.
9932
9933         (FieldExprNoAddress): New expression for Fields whose address can
9934         not be taken.
9935
9936         * expression.cs (LocalVariableReference): During the resolve
9937         phases, create new expressions if we are in a remapping context.
9938         Remove code that dealt with remapping here.
9939
9940         (ParameterReference): same.
9941
9942         (ProxyInstance): New expression, like the `This' expression, but
9943         it is born fully resolved.  We know what we are doing, so remove
9944         the errors that are targeted to user-provided uses of `this'.
9945
9946         * statement.cs (Foreach): our variable is now stored as an
9947         Expression;  During resolution, follow the protocol, dont just
9948         assume it will return this.
9949
9950 2003-08-06  Martin Baulig  <martin@ximian.com>
9951
9952         * support.cs (SeekableStreamReader.cs): New public class.
9953
9954         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9955         SeekableStreamReader instead of the normal StreamReader.
9956
9957 2003-08-04  Martin Baulig  <martin@ximian.com>
9958
9959         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9960         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9961         deambiguate casts and delegate invocations.
9962         (parenthesized_expression): Use the new tokens to ensure this is
9963         not a cast of method invocation.
9964
9965         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9966         when reading a `)' and Deambiguate_CloseParens () was previously
9967         called.
9968
9969         * expression.cs (ParenthesizedExpression): New class.  This is
9970         just used for the CS0075 test.
9971         (Binary.DoResolve): Check for CS0075.   
9972
9973 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9974
9975         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9976         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9977         reference comparison.
9978
9979         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9980         examine the ReturnType for equality - this is necessary in the
9981         cases of implicit and explicit operators whose signature also
9982         includes the return type.
9983
9984 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9985
9986         * namespace.cs: Cache the result of the namespace computation,
9987         instead of computing it every time.
9988
9989 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9990
9991         * decl.cs: Use a global arraylist that we reuse over invocations
9992         to avoid excesive memory consumption.  Reduces memory usage on an
9993         mcs compile by one meg (45 average).
9994
9995         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9996         private, work around that.
9997
9998 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9999
10000         * literal.cs (IntLiteral): Define Zero and One static literals. 
10001
10002         * cs-parser.jay (integer_literal): use static literals to reduce
10003         memory usage for the most used literals (0, 1 and -1).  211kb
10004         reduced in memory usage.
10005
10006         Replace all calls to `new ArrayList' with `new
10007         ArrayList(4)' which is a good average number for most allocations,
10008         and also requires only 16 bytes of memory for its buffer by
10009         default. 
10010
10011         This reduced MCS memory usage in seven megabytes for the RSS after
10012         bootstrapping.
10013
10014 2003-07-28  Ravi Pratap  <ravi@ximian.com>
10015
10016         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10017         handle params methods the correct way by forming only one
10018         applicable set with params and normal methods in them. Earlier we
10019         were looking at params methods only if we found no normal methods
10020         which was not the correct thing to do.
10021
10022         (Invocation.BetterFunction): Take separate arguments indicating
10023         when candidate and the best method are params methods in their
10024         expanded form.
10025
10026         This fixes bugs #43367 and #46199.
10027
10028         * attribute.cs: Documentation updates.
10029
10030         (CheckAttribute): Rename to CheckAttributeTarget.
10031         (GetValidPlaces): Rename to GetValidTargets.
10032
10033         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10034         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10035
10036         Fixes bug #44468.
10037
10038 2003-07-28  Martin Baulig  <martin@ximian.com>
10039
10040         * class.cs (TypeContainer.DefineMembers): Use the base type's full
10041         name when looking up the base class of a nested class.  Fixes #46977.
10042
10043 2003-07-26  Martin Baulig  <martin@ximian.com>
10044
10045         * expression.cs (Indexers.Indexer): New nested struct; contains
10046         getter, setter and the indexer's type.
10047         (Indexers.Properties): This is now an ArrayList of
10048         Indexers.Indexer's.
10049         (IndexerAccess.DoResolveLValue): Correctly set the type if the
10050         indexer doesn't have any getters.
10051
10052         * assign.cs (Assign.DoResolve): Also do the implicit conversions
10053         for embedded property and indexer assignments.
10054
10055 2003-07-26  Martin Baulig  <martin@ximian.com>
10056
10057         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
10058         preprocessor directive is not the first non-whitespace character
10059         on a line.
10060
10061 2003-07-26  Martin Baulig  <martin@ximian.com>
10062
10063         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
10064         namespace parsing, follow the spec more closely.
10065
10066         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
10067         NamespaceEntry.Lookup().
10068
10069 2003-07-25  Martin Baulig  <martin@ximian.com>
10070
10071         * MethodCore.cs (OverridesSomething): New public field; it's set
10072         from TypeContainer.DefineMembers if this method overrides
10073         something (which doesn't need to be a method).  Fix #39462.
10074
10075 2003-07-25  Ravi Pratap  <ravi@ximian.com>
10076
10077         * typemanager.cs (GetMembers): Ensure that the list of members is
10078         reversed. This keeps things in sync.
10079
10080         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
10081         find an AttributeUsage attribute.
10082
10083         * expression.cs (Invocation.OverloadResolve): Perform the check
10084         which disallows Invoke to be directly called on a Delegate.
10085
10086         (Error_InvokeOnDelegate): Report error cs1533.
10087
10088 2003-07-25  Martin Baulig  <martin@ximian.com>
10089
10090         * expression.cs (Indexers.GetIndexersForType): Only look in the
10091         interface hierarchy if the requested type is already an
10092         interface.  Fixes #46788 while keeping #46502 fixed.
10093
10094 2003-07-25  Martin Baulig  <martin@ximian.com>
10095
10096         * class.cs (TypeContainer.DefineMembers): Check whether all
10097         readonly fields have been assigned and report warning CS0649 if
10098         not.
10099
10100         * statement.cs (LocalInfo.IsFixed): Always return true if this is
10101         a valuetype.
10102
10103 2003-07-24  Ravi Pratap  <ravi@ximian.com>
10104
10105         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
10106         returned from GetMethods to make things consistent with the
10107         assumptions MCS makes about ordering of methods.
10108
10109         This should comprehensively fix bug #45127 and it does :-)
10110
10111         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
10112         ordering is actually reverse.
10113
10114         * Clean up some debug messages I left lying around.
10115
10116         * interface.cs (Populate*): Get rid of code which emits attributes
10117         since the stage in which we emit attributes is the 'Emit' stage,
10118         not the define stage.
10119
10120         (Emit): Move attribute emission for interface members here.
10121
10122 2003-07-22  Ravi Pratap  <ravi@ximian.com>
10123
10124         * expression.cs (Invocation.OverloadResolve): Follow the spec more
10125         closely: we eliminate methods in base types when we have an
10126         applicable method in a top-level type.
10127
10128         Please see section 14.5.5.1 for an exact description of what goes
10129         on. 
10130
10131         This fixes bug #45127 and a host of other related to corlib compilation.
10132
10133         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10134         array is the method corresponding to the top-level type (this is
10135         because of the changes made to icall.c) so we change this
10136         accordingly.
10137
10138         (MethodGroupExpr.Name): This too.
10139
10140         * typemanager.cs (GetElementType): New method which does the right
10141         thing when compiling corlib. 
10142
10143         * everywhere: Make use of the above in the relevant places.
10144
10145 2003-07-22  Martin Baulig  <martin@ximian.com>
10146
10147         * cs-parser.jay (invocation_expression): Moved
10148         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10149         `cast_expression', but create a InvocationOrCast which later
10150         resolves to either an Invocation or a Cast.
10151
10152         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10153         method; call this before EmitStatement() to make sure that this
10154         expression can be used as a statement.
10155
10156         * expression.cs (InvocationOrCast): New class; resolves to either
10157         an Invocation or a Cast.
10158
10159         * statement.cs (StatementExpression): Call ResolveStatement() on
10160         the ExpressionStatement before emitting it.
10161
10162 2003-07-21  Martin Baulig  <martin@ximian.com>
10163
10164         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10165         `ref' and `out' attributes match; fixes #46220.
10166         (MemberAccess.ResolveMemberAccess): You can't reference a type
10167         through an expression; fixes #33180.
10168         (Indexers.GetIndexersForType): Don't return the indexers from
10169         interfaces the class implements; fixes #46502.
10170
10171 2003-07-21  Martin Baulig  <martin@ximian.com>
10172
10173         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10174         CS0661 checks; fixes bug #30442.
10175
10176 2003-07-21  Martin Baulig  <martin@ximian.com>
10177
10178         * decl.cs (AdditionResult): Added `Error'.
10179
10180         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10181
10182         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
10183         makes cs0031.cs actually work.
10184
10185 2003-07-20  Martin Baulig  <martin@ximian.com>
10186
10187         * namespace.cs: Fixed that bug which caused a crash when compiling
10188         the debugger's GUI.
10189
10190 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10191
10192         * typemanager.cs (LookupTypeReflection): Never expose types which
10193         are NotPublic, NestedPrivate, NestedAssembly, or
10194         NestedFamANDAssem.  We used to return these, and later do a check
10195         that would report a meaningful error, but the problem is that we
10196         would not get the real match, if there was a name override.
10197
10198 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
10199
10200         * namespace.cs (Namespace, Name): Do not compute the namespace
10201         name dynamically, compute it in the constructor.  This reduced
10202         memory usage by 1697 KB.
10203
10204         * driver.cs: Use --pause to pause at the end.
10205
10206 2003-07-17  Peter Williams  <peter@newton.cx>
10207
10208         * Makefile: Change the name of the test target so that it doesn't
10209         conflict with the recursive test target.
10210
10211 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
10212
10213         * expression.cs (LocalVariableReference.Emit, EmitAssign,
10214         AddressOf): Do not use EmitThis, that was wrong, use the actual
10215         this pointer.
10216
10217 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
10218
10219         * class.cs (MethodData.Define): While checking if a method is an
10220         interface implementation, improve the test: If we are not public
10221         (use new test here: use the computed MethodAttributes directly,
10222         instead of the parsed modifier flags) check if the `implementing'
10223         method comes from an interface or not.
10224
10225         * pending.cs (VerifyPendingMethods): Slightly better error
10226         message.
10227
10228         * makefile: add test target that does the mcs bootstrap.
10229
10230 2003-07-16  Ravi Pratap  <ravi@ximian.com>
10231
10232         * interface.cs (Define): Do nothing here since there are no
10233         members to populate etc. Move the attribute emission out of here
10234         since this was just totally the wrong place to put it. Attribute
10235         application happens during the 'Emit' phase, not in the 'Define'
10236         phase.
10237
10238         (Emit): Add this method and move the attribute emission here
10239
10240         * rootcontext.cs (EmitCode): Call the Emit method on interface
10241         types too.
10242
10243 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10244
10245         * expression.cs (OverloadResolve): Report error only if Location
10246         is not 'Null' which means that there was a probe going on.
10247
10248 2003-07-14  Martin Baulig  <martin@ximian.com>
10249
10250         * expression.cs (ConditionalLogicalOperator): New public class to
10251         implement user defined conditional logical operators.
10252         This is section 14.11.2 in the spec and bug #40505.
10253
10254 2003-07-14  Martin Baulig  <martin@ximian.com>
10255
10256         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10257
10258 2003-07-14  Martin Baulig  <martin@ximian.com>
10259
10260         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10261
10262         * ecore.cs (IVariable.VerifyFixed): New interface method.
10263
10264         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10265         operator, check whether the variable is actually fixed.  Fixes bug
10266         #36055.  Set a variable definitely assigned when taking its
10267         address as required by the spec.
10268
10269         * statement.cs (LocalInfo.IsFixed): New field.
10270         (LocalInfo.MakePinned): Set `IsFixed' to true.
10271
10272 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10273
10274         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10275         for .ctors, ensure that we only ask for members declared in the
10276         attribute type (BindingFlags.DeclaredOnly).
10277
10278         Fixes bug #43632.
10279
10280         * expression.cs (Error_WrongNumArguments): Report error 1501
10281         correctly the way CSC does.
10282
10283 2003-07-13  Martin Baulig  <martin@ximian.com>
10284
10285         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10286         lookup on the fully qualified name, to make things like "X.X" work
10287         where "X.X" is a fully qualified type name, but we also have a
10288         namespace "X" in the using list.  Fixes #41975.
10289
10290 2003-07-13  Martin Baulig  <martin@ximian.com>
10291
10292         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10293         function. If we're a CompoundAssign, we need to create an embedded
10294         CompoundAssign, not an embedded Assign.
10295         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10296         Fixes #45854.
10297
10298 2003-07-13  Martin Baulig  <martin@ximian.com>
10299
10300         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10301         work to fix bug #46088.
10302
10303 2003-07-13  Ravi Pratap <ravi@ximian.com>
10304
10305         * class.cs (Operator.Emit): Do not emit attributes here - it is
10306         taken care of by the Method class that we delegate too. This takes
10307         care of bug #45876.
10308
10309 2003-07-10  Martin Baulig  <martin@ximian.com>
10310
10311         * expression.cs (TypeOfVoid): New class.
10312         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10313
10314 2003-07-10  Martin Baulig  <martin@ximian.com>
10315
10316         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10317         bug #35957.
10318
10319 2003-07-10  Martin Baulig  <martin@ximian.com>
10320
10321         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10322         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10323
10324         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10325
10326         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10327
10328 2003-07-10  Martin Baulig  <martin@ximian.com>
10329
10330         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10331         of decimal.  Fixes #42850.
10332
10333         NOTE: I also fixed the created byte blob, but this doesn't work on
10334         the MS runtime and csc never produces any byte blobs for decimal
10335         arrays.
10336
10337 2003-07-10  Martin Baulig  <martin@ximian.com>
10338
10339         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10340         structs; fixes #32068.
10341         (Block.AddChildVariableNames): Fixed #44302.
10342
10343 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10344
10345         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10346
10347 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10348
10349         * attribute.cs: And this test is onger needed.
10350
10351 2003-07-08  Martin Baulig  <martin@ximian.com>
10352
10353         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10354         inaccessible types.  Fixes #36313.
10355
10356         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10357
10358         * namespace.cs (NamespaceEntry): Create implicit entries for all
10359         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10360         implicit entries for N1.N2 and N1.
10361
10362 2003-07-08  Martin Baulig  <martin@ximian.com>
10363
10364         Rewrote the handling of namespaces to fix a lot of the issues
10365         wrt. `using' aliases etc.
10366
10367         * namespace.cs (Namespace): Splitted this class into a
10368         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10369
10370         * typemanager.cs (TypeManager.IsNamespace): Removed.
10371         (TypeManager.ComputeNamespaces): Only compute namespaces from
10372         loaded assemblies here, not the namespaces from the assembly we're
10373         currently compiling.
10374
10375 2003-07-08  Martin Baulig  <martin@ximian.com>
10376
10377         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10378
10379 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10380
10381         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10382         already fixed it.  
10383
10384         I thought about the memory savings here, but LookupTypeReflection
10385         is used under already very constrained scenarios.  Compiling
10386         corlib or mcs only exposes one hit, so it would not really reduce
10387         any memory consumption.
10388
10389 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10390
10391         * typemanager.cs: fixes bug #45889 by only adding public types from
10392         other assemblies to the list of known types.
10393
10394 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10395
10396         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10397         on the type we resolved.
10398
10399 2003-07-05  Martin Baulig  <martin@ximian.com>
10400
10401         * pending.cs (PendingImplementation.ParentImplements): Don't
10402         create the proxy if the parent is abstract.
10403
10404         * class.cs (TypeContainer.DefineIndexers): Process explicit
10405         interface implementations first.  Fixes #37714.
10406
10407 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10408
10409         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10410         defined recursively;  but since we modify the input parameters
10411         (left is set to `this' temporarily), we reset this value if the
10412         left_is_explicit is false, which gives the original semantics to
10413         the code.  
10414
10415         * literal.cs (NullPointer): new class used to represent a null
10416         literal in a pointer context.
10417
10418         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10419         type is a pointer, use a NullPointer object instead of a
10420         NullLiteral.   Closes 43687
10421
10422         (ExplicitConversion): Convert pointer values using
10423         the conv opcode to the proper type.
10424
10425         * ecore.cs (New): change ValueTypeVariable property into a method,
10426         that returns whether the valuetype is suitable for being used.
10427
10428         * expression.cs (Binary.DoNumericPromotions): Only return if we
10429         the int constant was a valid uint, and we can return both left and
10430         right as uints.  If not, we continue processing, to trigger the
10431         type conversion.  This fixes 39018.
10432
10433         * statement.cs (Block.EmitMeta): During constant resolution, set
10434         the CurrentBlock property on the emitcontext, so that we resolve
10435         constants propertly.
10436
10437 2003-07-02  Martin Baulig  <martin@ximian.com>
10438
10439         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10440         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10441
10442         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10443         than emitting it here.
10444
10445         * statement.cs: Fixed some more flow analysis bugs.
10446
10447 2003-07-02  Martin Baulig  <martin@ximian.com>
10448
10449         * class.cs (MethodData.Define): When implementing interface
10450         methods, set Final unless we're Virtual.
10451
10452         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10453         check work for interface methods.
10454
10455 2003-07-01  Martin Baulig  <martin@ximian.com>
10456
10457         * ecore.cs (EmitContext.This): Replaced this property with a
10458         GetThis() method which takes a Location argument.  This ensures
10459         that we get the correct error location for a CS0188.
10460
10461 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10462
10463         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10464         ImplicitStandardConversion.
10465
10466         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10467
10468 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10469
10470         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10471         optimization.
10472
10473 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10474
10475         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10476         constructors.
10477
10478         (MethodData.Define): Turn off initlocals for unsafe methods.
10479
10480 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10481
10482         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10483         complete;  Fixes #37521.
10484
10485         * delegate.cs: Use Modifiers.TypeAttr to compute the
10486         TypeAttributes, instead of rolling our own.  This makes the flags
10487         correct for the delegates.
10488
10489 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10490
10491         * class.cs (Constructor.Define): Set the private flag for static
10492         constructors as well.
10493
10494         * cs-parser.jay (statement_expression): Set the return value to
10495         null, to avoid a crash when we catch an error.
10496
10497 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10498
10499         * cs-parser.jay: Applied patch from Jackson that adds support for
10500         extern and unsafe modifiers to destructor declarations.
10501
10502         * expression.cs: Report error 21 if the user is trying to index a
10503         System.Array.
10504
10505         * driver.cs: Add an error message, suggested by the bug report.
10506
10507         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10508         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10509
10510 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10511
10512         * namespace.cs: Add some information to reduce FAQs.
10513
10514 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10515
10516         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10517         underlying enumeration types.  Fixes #43915.
10518
10519         * expression.cs: Treat ushort/short as legal values to be used in
10520         bitwise operations.
10521
10522 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10523
10524         * delegate.cs: transfer custom attributes for paramenters from
10525         the delegate declaration to Invoke and BeginInvoke.
10526
10527 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10528
10529         * attribute.cs: handle custom marshalers and emit marshal info
10530         for fields, too.
10531
10532 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10533
10534         * makefile.gnu: Added anonymous.cs to the compiler sources.
10535
10536 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10537
10538         * iterators.cs: Change the name of the proxy class to include two
10539         underscores.
10540
10541         * cs-parser.jay: Update grammar to include anonymous methods.
10542
10543         * anonymous.cs: new file.
10544
10545 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10546
10547         * class.cs (Field.Define): Add missing test for pointers and
10548         safety. 
10549
10550 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10551
10552         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10553         we use the stobj opcode.
10554
10555         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10556         since it wasn't the correct fix. 
10557
10558         It still is puzzling that we are required to use stobj for IntPtr
10559         which seems to be a ValueType.
10560
10561 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10562
10563         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10564         during regular simple name resolution.   Now, the trick is that
10565         instead of returning for processing the simplename, we do a
10566         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10567         contextual lookup type).   If a match is found, return that, if
10568         not, return for further composition.
10569
10570         This fixes long-standing 30485.
10571
10572         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10573         using the address to initialize an object, do an Stobj instead of
10574         using the regular Stelem.
10575
10576         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10577         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10578         Because if we are a BaseIndexerAccess that value will be true.
10579         Fixes 43643.
10580
10581         * statement.cs (GotoCase.Resolve): Return after reporting an
10582         error, do not attempt to continue. 
10583
10584         * expression.cs (PointerArithmetic.Emit): If our operand is a
10585         long, convert our constants to match the operand before
10586         multiplying.  Convert to I type before adding.   Fixes 43670.
10587
10588 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10589
10590         * enum.cs (ImplicitConversionExists) : Rename to
10591         ImplicitEnumConversionExists to remove ambiguity. 
10592
10593         * ecore.cs (NullCast): New type of cast expression class which
10594         basically is very similar to EmptyCast with the difference being
10595         it still is a constant since it is used only to cast a null to
10596         something else
10597         (eg. (string) null)
10598
10599         * convert.cs (ImplicitReferenceConversion): When casting a null
10600         literal, we return a NullCast.
10601
10602         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10603         should be around anymore.
10604
10605         The renaming (reported was slightly wrong). Corrections:
10606
10607         ConvertImplicitStandard -> ImplicitConversionStandard
10608         ConvertExplicitStandard -> ExplicitConversionStandard
10609
10610         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10611         before passing them in !
10612
10613         * convert.cs (ImplicitConversionStandard): When comparing for
10614         equal expr and target types, ensure that expr is not a
10615         NullLiteral.
10616
10617         In general, we must not be checking (expr_type ==
10618         target_type) in the top level conversion methods
10619         (ImplicitConversion, ExplicitConversion etc). This checking is
10620         done in the methods that they delegate to.
10621
10622 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10623
10624         * convert.cs: Move Error_CannotConvertType,
10625         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10626         ImplicitNumericConversion, ImplicitConversionExists,
10627         ImplicitUserConversionExists, StandardConversionExists,
10628         FindMostEncompassedType, FindMostSpecificSource,
10629         FindMostSpecificTarget, ImplicitUserConversion,
10630         ExplicitUserConversion, GetConversionOperators,
10631         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10632         TryImplicitIntConversion, Error_CannotConvertImplicit,
10633         ConvertImplicitRequired, ConvertNumericExplicit,
10634         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10635         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10636         its own file.
10637
10638         Perform the following renames:
10639
10640         StandardConversionExists -> ImplicitStandardConversionExists
10641         ConvertImplicit -> ImplicitConversion
10642         ConvertImplicitStandard -> ImplicitStandardConversion
10643         TryImplicitIntConversion -> ImplicitIntConversion
10644         ConvertImplicitRequired -> ImplicitConversionRequired
10645         ConvertNumericExplicit -> ExplicitNumericConversion
10646         ConvertReferenceExplicit -> ExplicitReferenceConversion
10647         ConvertExplicit -> ExplicitConversion
10648         ConvertExplicitStandard -> ExplicitStandardConversion
10649
10650 2003-05-19  Martin Baulig  <martin@ximian.com>
10651
10652         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10653         (TypeInfo): Added support for structs having structs as fields.
10654
10655         * ecore.cs (FieldExpr): Implement IVariable.
10656         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10657         VariableInfo for the field.
10658
10659 2003-05-18  Martin Baulig  <martin@ximian.com>
10660
10661         * expression.cs (This.DoResolve): Report a CS0027 if we're
10662         emitting a field initializer.
10663
10664 2003-05-18  Martin Baulig  <martin@ximian.com>
10665
10666         * expression.cs (This.ResolveBase): New public function.
10667         (This.DoResolve): Check for CS0188.
10668
10669         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10670         This.Resolve().
10671
10672         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10673         `instance_expression' to null if we don't have any non-static
10674         methods.
10675
10676 2003-05-18  Martin Baulig  <martin@ximian.com>
10677
10678         Reworked the way how local variables and parameters are handled by
10679         the flow analysis code.
10680
10681         * statement.cs (TypeInfo, VariableMap): New public classes.
10682         (VariableInfo): New public class.  This is now responsible for
10683         checking whether a variable has been assigned.  It is used for
10684         parameters and local variables.
10685         (Block.EmitMeta): Take the InternalParameters as argument; compute
10686         the layout of the flow vectors here.
10687         (Block.LocalMap, Block.ParameterMap): New public properties.
10688         (FlowBranching): The .ctor doesn't get the InternalParameters
10689         anymore since Block.EmitMeta() now computes the layout of the flow
10690         vector.
10691         (MyStructInfo): This class is now known as `StructInfo' and nested
10692         in `TypeInfo'; we don't access this directly anymore.
10693
10694         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10695         property and removed IsAssigned(), IsFieldAssigned(),
10696         SetAssigned() and SetFieldAssigned(); we now call them on the
10697         VariableInfo so we don't need to duplicate this code everywhere.
10698
10699         * expression.cs (ParameterReference): Added `Block block' argument
10700         to the .ctor.
10701         (LocalVariableReference, ParameterReference, This): The new
10702         VariableInfo class is now responsible for all the definite
10703         assignment stuff.
10704
10705         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10706         IsParameterAssigned, SetParameterAssigned): Removed.
10707
10708 2003-05-18  Martin Baulig  <martin@ximian.com>
10709
10710         * typemanager.cs (InitCoreTypes): Try calling
10711         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10712         the 3-args-version.  Corlib now also needs our `void_type'.
10713         (GetMethod): Added overloaded version which takes an optional
10714         `bool report_errors' to allow lookups of optional methods.
10715
10716 2003-05-12  Martin Baulig  <martin@ximian.com>
10717
10718         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10719         only used for locals and not for parameters.
10720
10721 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10722
10723         * support.cs (InternalParameters.ParameterType): Return the
10724         ExternalType of the parameter.
10725
10726         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10727         they were unused.
10728
10729 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10730
10731         * class.cs (MethodData.Define): Do not set the `newslot' on
10732         interface members, if they are also flagged as "override".
10733
10734         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10735         better code for ++i and i++.  This only works for static fields
10736         and local variables.
10737
10738         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10739         want to pull the DeclSpace out of the builder_to_declspace instead
10740         of the TypeBuilder (like in TypeContainer.FindMembers).
10741
10742         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10743         instead of LookupTypeContainer.  Fixes the crash on .NET for
10744         looking up interface members.
10745
10746         * const.cs: Create our own emit context during the Definition
10747         stage, so that constants are evaluated in the proper context, when
10748         a recursive definition happens.
10749
10750 2003-05-11  Martin Baulig  <martin@ximian.com>
10751
10752         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10753         new block for a switch section.
10754         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10755         the adding/lookup in the switch block.  Fixes #39828.
10756
10757 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10758
10759         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10760         functionality: I needed to convert the data after I had performed
10761         the add/sub operation into the operands type size.
10762
10763         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10764         pass the type for the box operation, otherwise the resulting
10765         object would have been of type object.
10766
10767         (BoxedCast): Add constructor to specify the type to box as.
10768
10769 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10770
10771         * iterators.cs: I was reusing the `count' variable inadvertently,
10772         take steps to not allow this to happen.
10773
10774 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10775
10776         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10777         by creating an array at the point where the params starts and
10778         putting all those arguments there, then adjusting the size of the
10779         array.
10780
10781 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10782
10783         * expression.cs (New.AddressOf): Implement interface
10784         IMemoryLocation.  This is used when the `new' operator is used in
10785         the context of an invocation to a method on a value type.
10786
10787         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10788         example. 
10789
10790         * namespace.cs: Also check the using aliases here.
10791
10792         * driver.cs: Move the test for using validity after the types have
10793         been entered, so we do a single pass that also includes the using
10794         aliases. 
10795
10796         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10797         in the regular case.   CreateSiblingForFinally is doing extra
10798         error checking.
10799
10800         * attribute.cs (GetAttributeArgumentExpression): Store the result
10801         on an out value, and use the return value to indicate failure
10802         instead of using null (which is a valid return for Constant.GetValue).
10803
10804         * statement.cs: Perform the analysis flow for the increment
10805         portion after the statement, because this will be the real flow of
10806         execution.  Fixes #42385
10807
10808         * codegen.cs (EmitContext.EmitArgument,
10809         EmitContext.EmitStoreArgument): New helper functions when the
10810         RemapToProxy flag is set.
10811
10812         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10813         function.
10814
10815         Add support for remapping parameters. 
10816
10817         * iterators.cs: Propagate parameter values;  Store parameter
10818         values in the proxy classes.
10819
10820 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10821
10822         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10823         need a proxy reference;  I do not know what I was thinking
10824
10825         * cs-parser.jay (constructor_initializer): catch another error,
10826         and display nice message.
10827
10828         (field_declaration): catch void field declaration
10829         to flag a better error. 
10830
10831         * class.cs (MemberBase.CheckBase): Report an error instead of a
10832         warning if a new protected member is declared in a struct. 
10833         (Field.Define): catch the error of readonly/volatile.
10834
10835         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10836
10837         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10838         volatile variable is taken
10839
10840 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10841
10842         * statement.cs (Fixed.Resolve): Report an error if we are not in
10843         an unsafe context.
10844
10845 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10846
10847         * typemanager.cs: reuse the code that handles type clashes for
10848         delegates and enumerations.
10849
10850         * class.cs (Report28): Always report.
10851
10852         * expression.cs (EncodeAsAttribute): Allow nulls here.
10853
10854 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10855
10856         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10857         the functionality for testing whether an expression is valid for
10858         an attribute here.  Also handle the case of arrays of elements
10859         being stored. 
10860
10861         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10862         encoding a linear array into an array of objects that are suitable
10863         to be passed to an CustomAttributeBuilder.
10864
10865         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10866
10867         * ecore.cs: (FieldExpr): Handle field remapping here.
10868
10869         * iteratators.cs: Pass the instance variable (if the method is an
10870         instance method) to the constructors, so we can access the field
10871         variables on the class.
10872
10873         TODO: Test this with structs.  I think the THIS variable on
10874         structs might have to be a pointer, and not a refenrece
10875
10876 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10877
10878         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10879         local variables to fields in a proxy class.
10880
10881         * iterators.cs (PopulateProxy): Rename our internal fields to
10882         <XXX>.  
10883         Create a <THIS> field if we are an instance method, so we can
10884         reference our parent container variables.
10885         (MapVariable): Called back from the EmitContext code to enter a
10886         new variable to field mapping into the proxy class (we just create
10887         a FieldBuilder).
10888
10889         * expression.cs
10890         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10891         for using the remapped locals to fields.
10892
10893         I placed the code here, because that gives the same semantics to
10894         local variables, and only changes the Emit code.
10895
10896         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10897         statements inside iterators.
10898         (VariableInfo): Add a FieldBuilder for the cases when we are
10899         remapping local variables to fields in a proxy class
10900
10901         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10902         current_block != null.
10903
10904         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10905         not cope with strings, as it has been moved to the
10906         TableSwitchEmit.  Fixed bug in switch generation.
10907
10908         * expression.cs (New.DoResolve): Provide more context for the user
10909         when reporting an error.
10910
10911         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10912         pointers. 
10913
10914         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10915         check the permissions for it.  Note than in a type-resolution
10916         context the check was already present in DeclSpace.ResolveType,
10917         but was missing from the MemberAccess.
10918
10919         (ArrayCreation.CheckIndices): warn if the user has
10920         more nested levels of expressions, but there are no more
10921         dimensions specified.  Avoids crash on bug 41906.
10922
10923 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10924
10925         * statement.cs (Block): replace Implicit bool, for a generic
10926         flags.   
10927         New flag: `Unchecked'.  This is used during the EmitMeta phase
10928         (which is out-of-line with the regular Resolve/Emit process for a
10929         statement, as this is done ahead of time, but still gets a chance
10930         to call constant resolve).
10931
10932         (Block.Flags): new enum for adding a new flag.
10933
10934         (Block.EmitMeta): track the state of unchecked.
10935
10936         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10937         to enable constant resolution to work there as well.
10938
10939 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10940
10941         * typemanager.cs (ienumerable_type): Also look up
10942         System.Collections.IEnumerable. 
10943
10944 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10945
10946         TODO: Test more than one conditional per method.
10947
10948         * class.cs (Indexer.Define): Report the location where the user is
10949         referencing the unsupported feature.
10950
10951         (MethodData): Overload the use of `conditionals' to
10952         minimize the creation of needless ArrayLists.   This saves roughly
10953         212kb on my machine.
10954
10955         (Method): Implement the new IIteratorContainer interface.
10956         (Method.SetYields): Implement the method by setting the ModFlags
10957         to contain METHOD_YIELDS.
10958
10959         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10960         which just got set to null.
10961
10962         * iterators.cs: New file.
10963
10964         (Yield, YieldBreak): New statements.
10965
10966         * statement.cs (Return.Resolve): Flag an error if we are used in
10967         an iterator method.
10968
10969         * codegen.cs (InIterator): New flag set if the code is being
10970         compiled in an iterator method.
10971
10972         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10973         internal modifier, and we just use it to avoid adding extra
10974         fields, as this is seldom used.  
10975
10976         * cs-parser.jay: Add yield_statement (yield and yield break).
10977
10978         * driver.cs: New flag -v2 to turn on version 2 features. 
10979
10980         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10981         hashtable when v2 is enabled.
10982
10983 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10984
10985         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10986         there is already a namespace defined with this name.
10987
10988         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10989         people upgraded their corlibs.
10990
10991         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10992         always use fully qualified types, no need to use the compiler
10993         front end.
10994
10995         (TypeManager.IsNamespace): Use binarysearch.
10996
10997         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10998         AddDelegate): I did not quite use the new IsValid API properly: I
10999         have to pass the short-name and the fullname.  I was passing only
11000         the basename instead of the fullname sometimes. 
11001
11002         (TypeContainer.DefineType): call NamespaceClash.
11003
11004         * interface.cs (Interface.DefineType): use NamespaceClash before
11005         defining the type.
11006
11007         * delegate.cs (Delegate.DefineType): use NamespaceClash before
11008         defining the type.
11009
11010         * enum.cs: (Enum.DefineType): use NamespaceClash before
11011         defining the type.
11012
11013         * typemanager.cs (: 3-line patch that gives us some tasty 11%
11014         speed increase.  First, use the negative_hits cache when we get a
11015         negative.  Second, add the type with its full original name
11016         instead of the new . and + encoded name (reflection uses + to
11017         separate type from a nested type).  Use LookupTypeReflection
11018         directly which bypasses the type->name hashtable (that we already
11019         know does not contain the type.
11020
11021         * decl.cs (DeclSpace.ResolveTypeExpr): track the
11022         location/container type. 
11023
11024         * driver.cs: When passing utf8, use directly the UTF8Encoding.
11025
11026 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
11027
11028         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11029
11030         * delegate.cs (NewDelegate.Resolve): Test whether an instance
11031         method is being referenced in the method group from a static
11032         context, and report error 120 if so.
11033
11034         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11035         Error118. 
11036
11037         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11038         is created, we create the A namespace).
11039
11040         * cs-parser.jay: A namespace also introduces a DeclarationFound.
11041         Fixes #41591
11042
11043 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
11044
11045         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11046         invocation to ModuleBuilder.GetType with the same values will
11047         return a new type instance, so we need to cache its return
11048         values. 
11049
11050         * expression.cs (Binary.ResolveOperator): Only allow the compare
11051         operators on enums if they are of the same type.
11052
11053         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11054         types of ValueType on their own case.  Before we were giving them
11055         the same treatment as objects.
11056
11057         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11058         fullname.  Short name is used to compare against container name.
11059         Fullname is used to check against defined namespace names.
11060
11061         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11062         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11063
11064         (Method.CheckBase): Call parent.
11065         (MemberBase.CheckBase): Check for protected members on sealed
11066         classes.
11067         (PropertyBase.CheckBase): Call parent.
11068         (Field.Define): Call parent.
11069
11070         * report.cs: Negative error codes are now mapped to 8000 - code,
11071         so that the display is render more nicely.
11072
11073         * typemanager.cs: Do not use try/catch, instead report a regular
11074         error. 
11075
11076         (GetPointerType, GetReferenceType): These methods provide
11077         mechanisms to obtain the T* and T& from a T.  We had the code
11078         previously scattered around the code base, and it also used
11079         TypeManager.LookupType that would go through plenty of caches.
11080         This one goes directly to the type source.
11081
11082         In some places we did the Type.GetType followed by
11083         ModuleBuilder.GetType, but not in others, so this unifies the
11084         processing as well.
11085
11086         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11087         statements now that we have namespace information.
11088
11089         * typemanager.cs (IsNamespace): New method, returns whether the
11090         string presented is a namespace or not.
11091
11092         (ComputeNamespaces): New public entry point, computes the list of
11093         available namespaces, using the GetNamespaces API call in Mono, or
11094         the slower version in MS.NET.   
11095
11096         Now before we start the semantic analysis phase, we have a
11097         complete list of namespaces including everything that the user has
11098         provided.
11099
11100         Deleted old code to cache namespaces in .nsc files.
11101
11102 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
11103
11104         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11105         class/struct location definition Location for the implicit
11106         constructor location.
11107
11108         (Operator.Define): Use the location of the operator for the
11109         implicit Method definition.
11110
11111         (Constructor.Emit): use the constructor location for the implicit
11112         base initializer constructor.
11113
11114         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
11115         and the Expression class now contains two new methods:
11116
11117         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
11118         isolate type lookup from the rest of the resolution process.
11119
11120         Since we use Expressions to hold type definitions due to the way
11121         we parse the input we have historically overloaded Resolve to
11122         perform the Type lookups if a special flag is passed.  Now this is
11123         eliminated and two methods take their place. 
11124
11125         The differences in the two methods between xStep and xTerminal is
11126         that xStep is involved in our current lookup system that uses
11127         SimpleNames to compose a name, while xTerminal is used just to
11128         catch the case where the simplename lookup failed.
11129
11130 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
11131
11132         * expression.cs (ResolveMemberAccess): Remove redundant code.
11133         TypeExpr expressions are always born fully resolved.
11134
11135         * interface.cs (PopulateMethod): Do not lookup the types twice.
11136         We were doing it once during SemanticAnalysis and once during
11137         PopulateMethod.
11138
11139         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11140         in local variable type definitions, were being returned as a
11141         SimpleName (we decomposed everything into a string), that is
11142         because primary_expression was being used instead of a type in the
11143         grammar (reduce/reduce conflicts).
11144
11145         The part that was wrong is that we converted the expression into a
11146         string (an oversimplification in one hand, compounded with primary
11147         expressions doing string concatenation).
11148
11149         So things like:
11150
11151         A.B.C [] x;
11152
11153         Would return "A.B.C[]" as a SimpleName.  This stopped things like
11154         using clauses from working on this particular context.  And a type
11155         was being matched directly against "A.B.C[]".
11156
11157         We now use the correct approach, and allow for ComposedCast to be
11158         part of the unary expression.  So the "A.B.C []" become a composed
11159         cast of "A.B.C" (as a nested group of MemberAccess with a
11160         SimpleName at the end) plus the rank composition "[]". 
11161
11162         Also fixes 35567
11163
11164 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
11165
11166         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11167         for the access level checking.
11168
11169         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
11170         `TypeContainer container', because I kept getting confused when I
11171         was debugging this code.
11172
11173         * expression.cs (Indexers): Instead of tracking getters/setters,
11174         we now track them in parallel.  We create one arraylist less, but
11175         most importantly it is possible now for the LValue code to find a
11176         matching get for a set.
11177
11178         (IndexerAccess.DoResolveLValue): Update the code.
11179         GetIndexersForType has been modified already to extract all the
11180         indexers from a type.  The code assumed it did not.
11181
11182         Also make the code set the correct return type for the indexer.
11183         This was fixed a long time ago for properties, but was missing for
11184         indexers.  It used to be void_type.
11185
11186         (Binary.Emit): Test first for doubles instead of
11187         floats, as they are more common.
11188
11189         (Binary.EmitBranchable): Use the .un version of the branch opcodes
11190         when dealing with floats and the <=, >= operators.  This fixes bug
11191         #39314 
11192
11193         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11194         to load the array value by emitting a load on the foreach variable
11195         type.  This was incorrect.  
11196
11197         We now emit the code to load an element using the the array
11198         variable type, and then we emit the conversion operator.
11199
11200         Fixed #40176
11201
11202 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
11203
11204         * attribute.cs: Avoid allocation of ArrayLists in the common case.
11205
11206 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
11207
11208         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11209         test for protection before we test for signatures. 
11210
11211         (MethodSignature.ToString): implement.
11212
11213         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11214         to the case where we reduced into a LongConstant.
11215
11216         * decl.cs (CheckAccessLevel): If the type is an array, we can not
11217         depend on whether the information is acurrate, because the
11218         Microsoft runtime will always claim that the array type is public,
11219         regardless of the real state.
11220
11221         If the type is a pointer, another problem happens: the type is
11222         reported as non-public in Microsoft.  
11223
11224         In both cases we have to call CheckAccessLevel recursively with
11225         the underlying type as the argument to be tested.
11226
11227 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
11228
11229         * assign.cs (Assign.Emit): If we are dealing with a compound
11230         assignment expression, we should use the code path that stores the
11231         intermediate result in a temporary value.  This fixes #40903.
11232
11233         *expression.cs (Indirection.ToString): Provide ToString method for
11234         debugging. 
11235
11236 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
11237
11238         * class.cs: Null out fields holding references to Block objects so
11239         they can be garbage collected.
11240
11241         * expression.cs (OverloadResolve): Remove unused local.
11242
11243 2003-04-07  Martin Baulig  <martin@ximian.com>
11244
11245         * codegen.cs (EmitContext.CurrentFile): New public field.
11246         (EmitContext.Mark): Use the CurrentFile to check whether the
11247         location is in the correct file.
11248         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11249
11250 2003-04-07  Martin Baulig  <martin@ximian.com>
11251
11252         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11253
11254         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11255         location.  [FIXME: The location argument which gets passed to this
11256         method is sometimes wrong!]
11257
11258 2003-04-07  Nick Drochak <ndrochak@gol.com>
11259
11260         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11261
11262 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11263
11264         * expression.cs (Indirection.EmitAssign): We were using the
11265         temporary, but returning immediately instead of continuing the
11266         EmitAssing flow.
11267
11268 2003-04-06  Martin Baulig  <martin@ximian.com>
11269
11270         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11271         if it's a nested child, but also deriving from the outer class.
11272         See test 190.cs.
11273
11274         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11275         nested child, but also deriving from the outer class.  See
11276         test-190.cs.
11277         (FilterWithClosure): We may access private members of the outer
11278         class if we're a nested child and deriving from the outer class.
11279         (RealMemberLookup): Only set `closure_private_ok' if the
11280         `original_bf' contained BindingFlags.NonPublic.
11281
11282 2003-04-05  Martin Baulig  <martin@ximian.com>
11283
11284         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
11285
11286 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11287
11288         * class.cs (Event.Define): Do not allow abstract events to have
11289         initializers. 
11290
11291 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11292
11293         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11294         block in event declarations.
11295
11296         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11297         value type, get its address.
11298
11299         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11300         leaving a class on the stack instead of a boolean value (int
11301         0/1).  Change the code so we compare against null, and then the
11302         result against zero.
11303
11304         * class.cs (TypeContainer.GetClassBases): We were checking for the
11305         parent class being sealed too late.
11306
11307         * expression.cs (Binary.Emit): For <= and >= when dealing with
11308         floating point values, use cgt.un and clt.un instead of cgt and
11309         clt alone.
11310
11311 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11312
11313         * statement.cs: Apply the same optimization as MS: skip the 
11314         GetEnumerator returning an IEnumerator, and use the one returning a 
11315         CharEnumerator instead. This allows us to avoid the try-finally block 
11316         and the boxing.
11317
11318 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11319
11320         * cs-parser.jay: Attributes cannot be applied to
11321                          namespaces. Fixes #40473
11322
11323 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11324
11325         * class.cs:
11326         (Add*): check if the name is valid using the full name for constants,
11327         fields, properties and events.
11328
11329 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11330
11331         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11332         char constants to be part of the enumeration.
11333
11334         * expression.cs (Conditional.DoResolve): Add support for operator
11335         true. Implements the missing functionality from 14.12
11336
11337         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11338         operator true/false as required by the spec.
11339
11340         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11341         implicit conversion to boolean.
11342
11343         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11344         also one where the type implements `operator true'. 
11345
11346         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11347         get an expression that will invoke operator true based on an
11348         expression.  
11349
11350         (GetConversionOperators): Removed the hack that called op_True
11351         here.  
11352
11353         (Expression.ResolveBoolean): Move this from Statement.
11354
11355 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11356
11357         * ecore.cs (FieldExpr): do not allow initialization of initonly
11358         fields on derived classes
11359
11360 2003-03-13  Martin Baulig  <martin@ximian.com>
11361
11362         * statement.cs (Block.Emit): Call ig.BeginScope() and
11363         ig.EndScope() when compiling with debugging info; call
11364         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11365
11366 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11367
11368         * expression.cs (Indexers): Do not construct immediately, allow
11369         for new members to be appended as we go.  Fixes 38143
11370
11371 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11372
11373         * expression.cs: save/restore context when resolving an unchecked
11374         expression.
11375
11376 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11377
11378         * cfold.cs: Catch division by zero in modulus operator during
11379         constant folding.
11380
11381 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11382
11383         * interface.cs (Interface.DefineMembers): Avoid defining members
11384         twice. 
11385
11386 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11387
11388         * driver.cs: handle the +/- options for -noconfig
11389
11390         * statement.cs (Unckeched.Resolve): Also track the state of
11391         unchecked in the Resolve phase.
11392
11393 2003-02-27  Martin Baulig  <martin@ximian.com>
11394
11395         * ecore.cs (Expression.MemberLookup): Don't create a
11396         MethodGroupExpr for something which is not a method.  Fixes #38291.
11397
11398 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11399
11400         * class.cs (MemberBase.CheckParameters): Also check that the type
11401         is unmanaged if it is a pointer.
11402
11403         * expression.cs (SizeOf.Resolve): Add location information.
11404
11405         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11406         a managed type is declared.
11407
11408         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11409         parameter modifiers as well.  Fixes bug 38606
11410
11411         * class.cs: Very sad.  Am backing out the speed up changes
11412         introduced by the ArrayList -> Array in the TypeContainer, as they
11413         were not actually that much faster, and introduced a bug (no error
11414         reports on duplicated methods).
11415
11416         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11417         source first, this will guarantee that we have a valid expression
11418         before calling in lower levels functions that will require a
11419         resolved object.  Then use this original_source in the
11420         target.ResolveLValue instead of the original source that was
11421         passed to us.
11422
11423         Another change.  Use target.Resolve instead of LValueResolve.
11424         Although we are resolving for LValues, we will let the Assign code
11425         take care of that (it will be called again from Resolve).  This
11426         basically allows code like this:
11427
11428         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11429         class Y { void A (X x) { x [0] += o; }
11430
11431         The problem was that the indexer was trying to resolve for
11432         set_Item (idx, object o) and never finding one.  The real set_Item
11433         was set_Item (idx, X).  By delaying the process we get the right
11434         semantics. 
11435
11436         Fixes bug 36505
11437
11438 2003-02-23  Martin Baulig  <martin@ximian.com>
11439
11440         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11441         while calling DoEmit ().
11442
11443         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11444         source files; if you use the #line directive inside a method, the
11445         compiler stops emitting line numbers for the debugger until it
11446         reaches the end of the method or another #line directive which
11447         restores the original file.
11448
11449 2003-02-23  Martin Baulig  <martin@ximian.com>
11450
11451         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11452
11453 2003-02-23  Martin Baulig  <martin@ximian.com>
11454
11455         * statement.cs (Block.AddChildVariableNames): We need to call this
11456         recursively, not just for our immediate children.
11457
11458 2003-02-23  Martin Baulig  <martin@ximian.com>
11459
11460         * class.cs (Event.Define): Always make the field private, like csc does.
11461
11462         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11463         actually work, fixes bug #37521.
11464
11465 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11466
11467         * delegate.cs: When creating the various temporary "Parameters"
11468         classes, make sure that we call the ComputeAndDefineParameterTypes
11469         on those new parameters (just like we do with the formal ones), to
11470         allow them to be resolved in the context of the DeclSpace.
11471
11472         This fixes the bug that Dick observed in Bugzilla #38530.
11473
11474 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11475
11476         * expression.cs (ResolveMemberAccess): When resolving a constant,
11477         do not attempt to pull a constant if the value was not able to
11478         generate a valid constant.
11479
11480         * const.cs (LookupConstantValue): Do not report more errors than required.
11481
11482 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11483
11484         * expression.cs: fixes bug #38328.
11485
11486 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11487
11488         * class.cs: Changed all the various members that can be part of a
11489         class from being an ArrayList to be an Array of the right type.
11490         During the DefineType type_list, interface_list, delegate_list and
11491         enum_list are turned into types, interfaces, delegates and enums
11492         arrays.  
11493
11494         And during the member population, indexer_list, event_list,
11495         constant_list, field_list, instance_constructor_list, method_list,
11496         operator_list and property_list are turned into their real arrays.
11497
11498         Although we could probably perform this operation earlier, for
11499         good error reporting we need to keep the lists and remove the
11500         lists for longer than required.
11501
11502         This optimization was triggered by Paolo profiling the compiler
11503         speed on the output of `gen-sample-program.pl' perl script. 
11504
11505         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11506         not crash in methods like MemberLookupFailed that use this field.  
11507
11508         This problem arises when the compiler fails to resolve a type
11509         during interface type definition for example.
11510
11511 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11512
11513         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11514         inherit from System.Object, so we have to stop at null, not only
11515         when reaching System.Object.
11516
11517 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11518
11519         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11520         DeclaredOnly because the parent indexer might have had a different
11521         name, but did not loop until the top of the hierarchy was reached.
11522
11523         The problem this one fixes is 35492: when a class implemented an
11524         indexer from an interface, we were getting the interface method
11525         (which was abstract) and we were flagging an error (can not invoke
11526         abstract method).
11527
11528         This also keeps bug 33089 functioning, and test-148 functioning.
11529
11530         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11531         out if a method is special is to see if it is declared in a
11532         property or event, or whether it is one of the predefined operator
11533         names.   This should fix correctly #36804.
11534
11535 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11536
11537         The goal here is to remove the dependency on EmptyCast.Peel ().
11538         Killing it completely.
11539
11540         The problem is that currently in a number of places where
11541         constants are expected, we have to "probe" for an EmptyCast, and
11542         Peel, which is not the correct thing to do, as this will be
11543         repetitive and will likely lead to errors. 
11544
11545         The idea is to remove any EmptyCasts that are used in casts that
11546         can be reduced to constants, so we only have to cope with
11547         constants. 
11548
11549         This bug hunt was triggered by Bug 37363 and the desire to remove
11550         the duplicate pattern where we were "peeling" emptycasts to check
11551         whether they were constants.  Now constants will always be
11552         constants.
11553
11554         * ecore.cs: Use an enumconstant here instead of wrapping with
11555         EmptyCast.  
11556
11557         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11558         throwing me off.  By handling this we can get rid of a few hacks.
11559
11560         * statement.cs (Switch): Removed Peel() code.
11561
11562 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11563
11564         * class.cs: Location information for error 508
11565
11566         * expression.cs (New.DoResolve): Add a guard against double
11567         resolution of an expression.  
11568
11569         The New DoResolve might be called twice when initializing field
11570         expressions (see EmitFieldInitializers, the call to
11571         GetInitializerExpression will perform a resolve on the expression,
11572         and later the assign will trigger another resolution
11573
11574         This leads to bugs (#37014)
11575
11576         * delegate.cs: The signature for EndInvoke should contain any ref
11577         or out parameters as well.  We were not doing this in the past. 
11578
11579         * class.cs (Field.Define): Do not overwrite the type definition
11580         inside the `volatile' group.  Turns out that volatile enumerations
11581         were changing the type here to perform a validity test, which
11582         broke conversions. 
11583
11584 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11585
11586         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11587         and structs, we do not want to load the instance variable
11588
11589         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11590         enum_type has to be handled like an object reference (implicit
11591         conversions exists from this to object), but the regular IsClass
11592         and IsValueType tests will never return true for this one.
11593
11594         Also we use TypeManager.IsValueType instead of type.IsValueType,
11595         just for consistency with the rest of the code (this is only
11596         needed if we ever use the construct exposed by test-180.cs inside
11597         corlib, which we dont today).
11598
11599 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11600
11601         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11602         just InternalCall.
11603
11604 2003-02-09  Martin Baulig  <martin@ximian.com>
11605
11606         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11607         (Namespace.DefineNamespaces): New static public method; this is
11608         called when we're compiling with debugging to add all namespaces
11609         to the symbol file.
11610
11611         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11612         pass it to the Namespace's .ctor.
11613
11614         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11615         and MethodBase arguments; pass the namespace ID to the symwriter;
11616         pass the MethodBase instead of the token to the symwriter.
11617         (SymbolWriter.DefineNamespace): New method to add a namespace to
11618         the symbol file.
11619
11620 2003-02-09  Martin Baulig  <martin@ximian.com>
11621
11622         * symbolwriter.cs: New file.  This is a wrapper around
11623         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11624         methods here in near future.
11625
11626 2003-02-09  Martin Baulig  <martin@ximian.com>
11627
11628         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11629         ILGenerator.MarkSequencePoint() which are actually used by the
11630         symbol writer.
11631
11632 2003-02-09  Martin Baulig  <martin@ximian.com>
11633
11634         * location.cs (SourceFile): New public sealed class.  This
11635         contains the name and an index which is used in the location's token.
11636         (Location): Reserve an appropriate number of bits in the token for
11637         the source file instead of walking over that list, this gives us a
11638         really huge performance improvement when compiling with debugging.
11639
11640         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11641         `SourceFile' argument instead of a string.
11642         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11643         but don't parse/tokenize here, we need to generate the list of all
11644         source files before we do that.
11645         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11646         the files.
11647
11648         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11649         instead of a string.
11650
11651         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11652         of a string.
11653
11654 2003-02-09  Martin Baulig  <martin@ximian.com>
11655
11656         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11657         filename on `#line default'.
11658
11659 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11660
11661         * statement.cs: don't clear the pinned var when the fixed statement
11662         returns from the method (fixes bug#37752).
11663
11664 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11665
11666         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11667         to IsValueType.
11668
11669 2003-02-07  Martin Baulig  <martin@ximian.com>
11670
11671         * driver.cs: Removed the `--debug-args' command line argument.
11672
11673         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11674         automatically by the AsssemblyBuilder.
11675         (CodeGen.InitializeSymbolWriter): We don't need to call any
11676         initialization function on the symbol writer anymore.  This method
11677         doesn't take any arguments.
11678
11679 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11680
11681         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11682         from referenced assemblies as well.
11683
11684 2003-02-02  Martin Baulig  <martin@ximian.com>
11685
11686         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11687
11688 2003-02-02  Martin Baulig  <martin@ximian.com>
11689
11690         * class.cs (Constructor.Emit): Open the symbol writer before
11691         emitting the constructor initializer.
11692         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11693         single-stepping through constructor initializers.
11694
11695 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11696
11697         * class.cs: Handle error 549: do not allow virtual methods in
11698         sealed classes. 
11699
11700 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11701
11702         * decl.cs: Check access levels when resolving types
11703
11704 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11705
11706         * statement.cs: Add parameters and locals set in catch blocks that might 
11707         return to set vector
11708
11709 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11710
11711         * class.cs (Operator): Set the SpecialName flags for operators.
11712
11713         * expression.cs (Invocation.DoResolve): Only block calls to
11714         accessors and operators on SpecialName methods.
11715
11716         (Cast.TryReduce): Handle conversions from char constants.
11717
11718
11719 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11720
11721         * statement.cs: small memory and time optimization in FlowBranching.
11722
11723 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11724
11725         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11726         problem that the last fix but in the other sid (Set).
11727
11728         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11729         access when there is no indexer in the hierarchy.
11730
11731 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11732
11733         * class.cs: Combine some if statements.
11734
11735 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11736
11737         * driver.cs: fixed bug #37187.
11738
11739 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11740
11741         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11742         any indexer, it's needed to build a list with all the indexers in the
11743         hierarchy (AllGetters), else we have problems. Fixes #35653.
11744
11745 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11746
11747         * class.cs (MethodData.Define): It is wrong for an interface
11748         implementation to be static in both cases: explicit and implicit.
11749         We were only handling this in one case.
11750
11751         Improve the if situation there to not have negations.
11752
11753         * class.cs (Field.Define): Turns out that we do not need to check
11754         the unsafe bit on field definition, only on usage.  Remove the test.
11755
11756 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11757
11758         * driver.cs: use assembly.Location instead of Codebase (the latest
11759         patch made mcs fail when using MS assemblies).
11760
11761 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11762
11763         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11764         get the path to *corlib.dll.
11765
11766 2003-01-21  Nick Drochak <ndrochak@gol.com>
11767
11768         * cs-tokenizer.cs:
11769         * pending.cs:
11770         * typemanager.cs: Remove compiler warnings
11771
11772 2003-01-20  Duncan Mak  <duncan@ximian.com>
11773
11774         * AssemblyInfo.cs: Bump the version number to 0.19.
11775
11776 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11777
11778         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11779
11780 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11781
11782         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11783
11784 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11785
11786         * cs-parser.jay: Small fix: we were not comparing the constructor
11787         name correctly.   Thanks to Zoltan for the initial pointer.
11788
11789 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11790
11791         * cs-tokenizer.cs: Set file name when specified with #line
11792
11793 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11794
11795         * cs-parser.jay: Only perform the constructor checks here if we
11796         are named like the class;  This will help provider a better
11797         error.  The constructor path is taken when a type definition is
11798         not found, but most likely the user forgot to add the type, so
11799         report that rather than the constructor error.
11800
11801 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11802
11803         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11804         allocations.
11805
11806 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11807
11808         * cs-parser.jay: Add cleanup call.
11809
11810 2003-01-13  Duncan Mak  <duncan@ximian.com>
11811
11812         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11813         consistent with other methods.
11814
11815 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11816
11817         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11818
11819 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11820
11821         * attribute.cs: only set GuidAttr to true when we have a
11822         GuidAttribute.
11823
11824 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11825
11826         * ecore.cs:
11827         * expression.cs:
11828         * typemanager.cs: fixes to allow mcs compile corlib with the new
11829         Type.IsSubclassOf fix.
11830
11831 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11832
11833         * expression.cs (LocalVariableReference.DoResolve): Classify a
11834         constant as a value, not as a variable.   Also, set the type for
11835         the variable.
11836
11837         * cs-parser.jay (fixed_statement): take a type instead of a
11838         pointer_type, so we can produce a better error message later.
11839
11840         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11841         as an error.  
11842
11843         (For.DoEmit): Make inifinite loops have a
11844         non-conditional branch back.
11845
11846         (Fixed.DoEmit): First populate the pinned variables, then emit the
11847         statement, then clear the variables.  Before I was emitting the
11848         code once for each fixed piece.
11849
11850
11851 2003-01-08  Martin Baulig  <martin@ximian.com>
11852
11853         * statement.cs (FlowBranching.MergeChild): A break in a
11854         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11855
11856 2003-01-08  Martin Baulig  <martin@ximian.com>
11857
11858         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11859         lives in the same number space than `param_map'.  Fixes #36154.
11860
11861 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11862
11863         * cs-parser.jay (constructor_declaration): Set the
11864         Constructor.ModFlags before probing for it.  This makes the
11865         compiler report 514, 515 and 132 (the code was there, but got
11866         broken). 
11867
11868         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11869         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11870         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11871
11872 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11873
11874         * enum.cs: create the enum static fields using the enum type.
11875
11876 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11877
11878         * class.cs: don't try to create the ParamBuilder for the return
11879         type if it's not needed (and handle it breaking for the ms runtime
11880         anyway).
11881
11882 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11883
11884         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11885
11886 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11887
11888         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11889         the command.   This showed up while compiling the JANET source
11890         code, which used \r as its only newline separator.
11891
11892 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11893
11894         * class.cs (Method.Define): If we are an operator (because it
11895         reuses our code), then set the SpecialName and HideBySig.  #36128
11896
11897 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11898
11899         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11900         exception, report error 120 `object reference required'.
11901
11902         * driver.cs: Add --pause option, used during to measure the size
11903         of the process as it goes with --timestamp.
11904
11905         * expression.cs (Invocation.DoResolve): Do not allow methods with
11906         SpecialName to be invoked.
11907
11908 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11909
11910         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11911         number before adding it.
11912
11913 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11914
11915         * ecore.cs (StandardImplicitConversion): When in an unsafe
11916         context, we allow conversion between void * to any other pointer
11917         type. This fixes bug #35973.
11918
11919 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11920
11921         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11922         is not thrown when extensionless outputs are used 
11923
11924 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11925
11926         * rootcontext.cs: fixed compilation of corlib.
11927
11928 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11929
11930         * attribute.cs (Attributes.Contains): Add new method.
11931
11932         * class.cs (MethodCore.LabelParameters): if the parameter is an
11933         `out' parameter, check that no attribute `[In]' has been passed.
11934
11935         * enum.cs: Handle the `value__' name in an enumeration.
11936
11937 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11938
11939         * decl.cs: Added special case to allow overrides on "protected
11940         internal" methods
11941
11942 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11943
11944         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11945         since it makes much more sense.
11946
11947         (Attributes.ctor): Don't require a Location parameter.
11948
11949         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11950
11951         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11952         since we already have that information per attribute.
11953
11954         * everywhere : make appropriate changes.
11955
11956         * class.cs (LabelParameters): Write the code which actually
11957         applies attributes to the return type. We can't do this on the MS
11958         .NET runtime so we flag a warning in the case an exception is
11959         thrown.
11960
11961 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11962
11963         * const.cs: Handle implicit null conversions here too.
11964
11965 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11966
11967         * class.cs (MethodCore.LabelParameters): Remove the extra
11968         Type [] parameter since it is completely unnecessary. Instead
11969         pass in the method's attributes so that we can extract
11970         the "return" attribute.
11971
11972 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11973
11974         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11975         of ignoring it and letting the compile continue.
11976
11977         * typemanager.cs (ChangeType): use an extra argument to return an
11978         error condition instead of throwing an exception.
11979
11980 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11981
11982         * expression.cs (Unary.TryReduce): mimic the code for the regular
11983         code path.  Perform an implicit cast in the cases where we can
11984         implicitly convert to one of the integral types, and then reduce
11985         based on that constant.   This fixes bug #35483.
11986
11987 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11988
11989         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11990
11991 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11992
11993         * namespace.cs: fixed bug #35489.
11994
11995 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11996
11997         * class.cs: Remove some dead code.
11998
11999         * cs-parser.jay: Estimate the number of methods needed
12000         (RootContext.MethodCount);
12001
12002         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12003         numbers instead of StringBuilders.
12004
12005         * support.cs (PtrHashtable): Add constructor with initial size;
12006         We can now reduce reallocations of the method table.
12007
12008 2002-12-10  Ravi Pratap  <ravi@ximian.com>
12009
12010         * attribute.cs (ApplyAttributes): Keep track of the emitted
12011         attributes on a per-target basis. This fixes bug #35413.
12012
12013 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
12014
12015         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12016         default to the Windows 1252 encoding.
12017
12018         (UnixParseOption): Support version, thanks to Alp for the missing
12019         pointer. 
12020
12021         * AssemblyInfo.cs: Add nice assembly information.
12022
12023         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12024         (bug 35169).
12025
12026         * cs-parser.jay: Allow a trailing comma before the close bracked
12027         in the attribute_section production.
12028
12029         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12030         address of the instance was being taken, I will take this out,
12031         because we take the address of the object immediately here.
12032
12033 2002-12-09  Ravi Pratap  <ravi@ximian.com>
12034
12035         * typemanager.cs (AreMultipleAllowed): Take care of the most
12036         obvious case where attribute type is not in the current assembly -
12037         stupid me ;-)
12038
12039 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
12040
12041         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12042         definitions, instead of doing that afterwards.  
12043
12044         Also we use a nice little hack, depending on the constructor, we
12045         know if we are a "composed" name or a simple name.  Hence, we
12046         avoid the IndexOf test, and we avoid 
12047
12048         * codegen.cs: Add code to assist in a bug reporter to track down
12049         the source of a compiler crash. 
12050
12051 2002-12-07  Ravi Pratap  <ravi@ximian.com>
12052
12053         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12054         types have been emitted for a given element and flag an error
12055         if something which does not have AllowMultiple set is used more
12056         than once.
12057
12058         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12059         attribute types and their corresponding AllowMultiple properties
12060
12061         (AreMultipleAllowed): Check the property for a given type.
12062
12063         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12064         property in the case we have a TypeContainer.
12065
12066         (Attributes.AddAttribute): Detect duplicates and just skip on
12067         adding them. This trivial fix catches a pretty gross error in our
12068         attribute emission - global attributes were being emitted twice!
12069
12070         Bugzilla bug #33187 is now fixed.
12071
12072 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
12073
12074         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12075         instead of pp_and).
12076
12077         * expression.cs (Binary.ResolveOperator): I can only use the
12078         Concat (string, string, string) and Concat (string, string,
12079         string, string) if the child is actually a concatenation of
12080         strings. 
12081
12082 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
12083
12084         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12085         context where we need a 2-character lookahead.
12086
12087         * pending.cs (PendingImplementation): Rework so we can keep track
12088         of interface types all the time, and flag those which were
12089         implemented by parents as optional.
12090
12091 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
12092
12093         * expression.cs (Binary.ResolveOperator): Use
12094         String.Concat(string,string,string) or
12095         String.Concat(string,string,string,string) when possible. 
12096
12097         * typemanager: More helper methods.
12098
12099
12100 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12101
12102         * pending.cs: remove the bogus return from GetMissingInterfaces()
12103         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12104
12105 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12106
12107         * namespace.cs: avoid duplicated 'using xxx' being added to
12108         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12109         when we get more than one 'using' statement for the same namespace.
12110         Report a CS0105 warning for it.
12111
12112 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
12113
12114         * cs-tokenizer.cs (consume_identifier): use read directly, instead
12115         of calling getChar/putback, uses internal knowledge of it.    
12116
12117         (xtoken): Reorder tokenizer so most common patterns are checked
12118         first.  This reduces the compilation time in another 5% (from 8.11s
12119         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12120
12121         The parsing time is 22% of the compilation in mcs, and from that
12122         64% is spent on the tokenization process.  
12123
12124         I tried using a binary search for keywords, but this is slower
12125         than the hashtable.  Another option would be to do a couple of
12126         things:
12127
12128                 * Not use a StringBuilder, instead use an array of chars,
12129                   with a set value.  Notice that this way we could catch
12130                   the 645 error without having to do it *afterwards*.
12131
12132                 * We could write a hand-parser to avoid the hashtable
12133                   compares altogether.
12134
12135         The identifier consumption process takes 37% of the tokenization
12136         time.  Another 15% is spent on is_number.  56% of the time spent
12137         on is_number is spent on Int64.Parse:
12138
12139                 * We could probably choose based on the string length to
12140                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
12141                   computations. 
12142
12143         Another 3% is spend on wrapping `xtoken' in the `token' function.
12144
12145         Handle 0xa0 as whitespace (#34752)
12146
12147 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
12148
12149         * typemanager.cs (IsCLRType): New routine to tell whether a type
12150         is one of the builtin types.  
12151
12152         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
12153         typecode in more places instead of doing pointer comparissions.
12154         We could leverage some knowledge about the way the typecodes are
12155         laid out.
12156
12157         New code to cache namespaces in assemblies, it is currently not
12158         invoked, to be used soon.
12159
12160         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12161
12162         * expression.cs (Binary.ResolveOperator): specially handle
12163         strings, and do not perform user-defined operator overloading for
12164         built-in types.
12165
12166 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
12167
12168         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12169         internalcall as it is a pretty simple operation;  Avoid whenever
12170         possible to call Char.IsLetter.
12171
12172         (consume_identifier): Cut by half the number of
12173         hashtable calls by merging the is_keyword and GetKeyword behavior.
12174
12175         Do not short-circuit, because if we do, we
12176         report errors (ie, #if false && true would produce an invalid
12177         directive error);
12178
12179
12180 2002-11-24  Martin Baulig  <martin@ximian.com>
12181
12182         * expression.cs (Cast.TryReduce): If we're in checked syntax,
12183         check constant ranges and report a CS0221.  Fixes #33186.
12184
12185 2002-11-24  Martin Baulig  <martin@ximian.com>
12186
12187         * cs-parser.jay: Make this work for uninitialized variable
12188         declarations in the `for' initializer.  Fixes #32416.
12189
12190 2002-11-24  Martin Baulig  <martin@ximian.com>
12191
12192         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12193         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
12194
12195 2002-11-24  Martin Baulig  <martin@ximian.com>
12196
12197         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12198         argument; if true, we also check for user-defined conversions.
12199         This is only needed if both arguments are of a user-defined type.
12200         Fixes #30443, added test-175.cs.
12201         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12202
12203         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12204
12205 2002-11-24  Martin Baulig  <martin@ximian.com>
12206
12207         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12208         function to get the store opcode.
12209         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12210         only emit the Ldelema if the store opcode is Stobj.  You must run
12211         both test-34 and test-167 to test this.  Fixes #34529.
12212
12213 2002-11-23  Martin Baulig  <martin@ximian.com>
12214
12215         * ecore.cs (Expression.MemberLookup): Added additional
12216         `qualifier_type' argument which is used when we're being called
12217         from MemberAccess.DoResolve() and null if we're called from a
12218         SimpleName lookup.
12219         (Expression.MemberLookupFailed): New method to report errors; this
12220         does the CS1540 check and reports the correct error message.
12221
12222         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12223         argument for the CS1540 check and redone the way how we're dealing
12224         with private members.  See the comment in the source code for details.
12225         (FilterWithClosure): Reverted this back to revision 1.197; renamed
12226         `closure_start_type' to `closure_qualifier_type' and check whether
12227         it's not null.  It was not this filter being broken, it was just
12228         being called with the wrong arguments.
12229
12230         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12231         and pass it the correct `qualifier_type'; this also does the error
12232         handling for us.
12233
12234 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
12235
12236         * expression.cs (Invocation.EmitParams): If the we are dealing
12237         with a non-built-in value type, load its address as well.
12238
12239         (ArrayCreation): Use a a pretty constant instead
12240         of the hardcoded value 2.   Use 6 instead of 2 for the number of
12241         static initializers.  
12242
12243         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12244         because they are not really value types, just glorified integers. 
12245
12246         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12247
12248         * ecore.cs: Remove redundant code for enumerations, make them use
12249         the same code path as everything else, fixes the casting issue
12250         with enumerations in Windows.Forms.
12251
12252         * attribute.cs: Do only cast to string if it is a string, the
12253         validation happens later.
12254
12255         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12256         people upgrade their corlibs.
12257
12258         * ecore.cs: Oops, enumerations were not following the entire code path
12259
12260 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12261
12262         * typemanager.cs (FilterWithClosure): Commented out the test for
12263         1540 in typemanager.cs, as it has problems when accessing
12264         protected methods from a parent class (see test-174.cs). 
12265
12266         * attribute.cs (Attribute.ValidateGuid): new method.
12267         (Attribute.Resolve): Use above.
12268
12269 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12270
12271         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12272
12273         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12274         handling for enumerations, as we only needed the TypeContainer
12275         functionality to begin with (this is required for the fix below to
12276         work for enums that reference constants in a container class for
12277         example). 
12278
12279         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12280
12281         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12282         a valid TypeBuilder to perform lookups on.o
12283
12284         * class.cs (InheritableMemberSignatureCompare): Use true in the
12285         call to GetGetMethod and GetSetMethod, because we are comparing
12286         the signature, and we need to get the methods *even* if they are
12287         private. 
12288
12289         (PropertyBase.CheckBase): ditto.
12290
12291         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12292         GotoCase.Resolve): Use Peel on EmpytCasts.
12293
12294         * ecore.cs (EmptyCast): drop child, add Peel method.
12295
12296 2002-11-17  Martin Baulig  <martin@ximian.com>
12297
12298         * ecore.cs (EmptyCast.Child): New public property.
12299
12300         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12301         label resolved to an EmptyCast.  Fixes #34162.
12302         (GotoCase.Resolve): Likewise.
12303         (Block.EmitMeta): Likewise.
12304
12305 2002-11-17  Martin Baulig  <martin@ximian.com>
12306
12307         * expression.cs (Invocation.BetterConversion): Prefer int over
12308         uint; short over ushort; long over ulong for integer literals.
12309         Use ImplicitConversionExists instead of StandardConversionExists
12310         since we also need to check for user-defined implicit conversions.
12311         Fixes #34165.  Added test-173.cs.
12312
12313 2002-11-16  Martin Baulig  <martin@ximian.com>
12314
12315         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12316         with the `true' and `false' literals.  Fixes #33151.
12317
12318 2002-11-16  Martin Baulig  <martin@ximian.com>
12319
12320         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12321         October 22nd; don't do the cs1540 check for static members.
12322
12323         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12324         now using our own filter here and doing the cs1540 check again.
12325
12326 2002-11-16  Martin Baulig  <martin@ximian.com>
12327
12328         * support.cs (InternalParameters): Don't crash if we don't have
12329         any fixed parameters.  Fixes #33532.
12330
12331 2002-11-16  Martin Baulig  <martin@ximian.com>
12332
12333         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12334         when looking up static methods to make this work on Windows.
12335         Fixes #33773.
12336
12337 2002-11-16  Martin Baulig  <martin@ximian.com>
12338
12339         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12340         a setter rather than using PropertyInfo.CanWrite.
12341
12342 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12343
12344         * class.cs: Allow acces to block member by subclasses. Fixes build
12345         breaker.
12346
12347 2002-11-14  Martin Baulig  <martin@ximian.com>
12348
12349         * class.cs (Constructor.Emit): Added the extern/block check.
12350         Fixes bug #33678.
12351
12352 2002-11-14  Martin Baulig  <martin@ximian.com>
12353
12354         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12355         iteration while looking for indexers, this is needed because the
12356         indexer may have a different name in our base classes.  Fixed the
12357         error reporting (no indexers at all, not get accessor, no
12358         overloaded match).  Fixes bug #33089.
12359         (IndexerAccess.DoResolveLValue): Likewise.
12360
12361 2002-11-14  Martin Baulig  <martin@ximian.com>
12362
12363         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12364         indexers.  Fixes the first part of bug #33089.
12365         (MethodSignature.InheritableMemberSignatureCompare): Added support
12366         for properties.
12367
12368 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12369
12370         * attribute.cs (Attribute.Resolve): Catch the
12371         NullReferenceException and report it since it isn't supposed to
12372         happen. 
12373
12374 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12375
12376         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12377         LogicalOr and LogicalAnd that can benefit from recursively
12378         handling EmitBranchable.  The code now should be nice for Paolo.
12379
12380 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12381
12382         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12383         the Type lookups, as we perform quite a number of lookups on
12384         non-Types.  This can be removed once we can deterministically tell
12385         whether we have a type or a namespace in advance.
12386
12387         But this might require special hacks from our corlib.
12388
12389         * TODO: updated.
12390
12391         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12392         and double which avoids a conversion from an integer to a double.
12393
12394         * expression.cs: tiny optimization, avoid calling IsConstant,
12395         because it effectively performs the lookup twice.
12396
12397 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12398
12399         But a bogus return here to keep the semantics of the old code
12400         until the Mono runtime is fixed.
12401
12402         * pending.cs (GetMissingInterfaces): New method used to remove all
12403         the interfaces that are already implemented by our parent
12404         classes from the list of pending methods. 
12405
12406         * interface.cs: Add checks for calls after ResolveTypeExpr.
12407
12408 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12409
12410         * class.cs (Class.Emit): Report warning 67: event not used if the
12411         warning level is beyond 3.
12412
12413         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12414         being a NullLiteral.
12415
12416         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12417         specifiers. 
12418
12419         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12420         path that might fail if a type can not be resolved.
12421
12422         * expression.cs (Binary.Emit): Emit unsigned versions of the
12423         operators. 
12424
12425         * driver.cs: use error 5.
12426
12427 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12428
12429         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12430
12431 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12432
12433         * cs-parser.jay (switch_section): A beautiful patch from Martin
12434         Baulig that fixed 33094.
12435
12436 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12437
12438         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12439         Check whether the base is abstract and report an error if so.
12440
12441         * expression.cs (IndexerAccess.DoResolveLValue,
12442         IndexerAccess.DoResolve): ditto. 
12443
12444         (Invocation.DoResolve): ditto.
12445
12446         (Invocation.FullMethodDesc): Improve the report string.
12447
12448         * statement.cs (Block): Eliminate IsVariableDefined as it is
12449         basically just a wrapper for GetVariableInfo.
12450
12451         * ecore.cs (SimpleName): Use new 
12452
12453         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12454         type, as we return the actual parameter ref/unref state on a
12455         different call.
12456
12457 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12458
12459         * support.cs: Return proper flags REF/OUT fixing the previous
12460         commit.  
12461
12462         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12463         not used to mean `ref' but `ref or out' in ParameterReference
12464
12465         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12466         full type signature instead of calling TypeManger.CSharpName
12467         ourselves. 
12468
12469         * support.cs (InternalParameters.ParameterDesc): Do not compare
12470         directly to the modflags, because REF/OUT will actually be bitsets
12471         if set. 
12472
12473         * delegate.cs (VerifyMethod): Check also the modifiers.
12474
12475         * cs-tokenizer.cs: Fix bug where floating point values with an
12476         exponent where a sign was missing was ignored.
12477
12478         * driver.cs: Allow multiple assemblies to be specified in a single
12479         /r: argument
12480
12481 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12482
12483         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12484         because identifiers after a parenthesis would end up in this kind
12485         of production, and we needed to desamiguate it for having casts
12486         like:
12487
12488                 (UserDefinedType *) xxx
12489
12490 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12491
12492         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12493         we should set on the Bindingflags.NonPublic, but not turn on
12494         private_ok.  private_ok controls whether a Private member is
12495         returned (this is chekced on the filter routine), while the
12496         BindingFlags.NonPublic just controls whether private/protected
12497         will be allowed.   This fixes the problem part of the problem of
12498         private properties being allowed to be used in derived classes.
12499
12500         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12501         so we can call the children DoResolveLValue method (this will
12502         properly signal errors on lvalue assignments to base properties)
12503
12504         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12505         getter are null, and we have a property info, we know that this
12506         happened because the lookup failed, so we report an error 122 for
12507         protection level violation.
12508
12509         We also silently return if setter and getter are null in the
12510         resolve functions, this condition only happens if we have flagged
12511         the error before.  This is the other half of the problem. 
12512
12513         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12514         not have accessibility information, that is why we were returning
12515         true in the filter function in typemanager.cs.
12516
12517         To properly report 122 (property is inaccessible because of its
12518         protection level) correctly, we report this error in ResolveAccess
12519         by failing if both the setter and the getter are lacking (ie, the
12520         lookup failed). 
12521
12522         DoResolve and DoLResolve have been modified to check for both
12523         setter/getter being null and returning silently, the reason being
12524         that I did not want to put the knowledge about this error in upper
12525         layers, like:
12526
12527         int old = Report.Errors;
12528         x = new PropertyExpr (...);
12529         if (old != Report.Errors)
12530                 return null;
12531         else
12532                 return x;
12533
12534         So the property expr is returned, but it is invalid, so the error
12535         will be flagged during the resolve process. 
12536
12537         * class.cs: Remove InheritablePropertySignatureCompare from the
12538         class, as we no longer depend on the property signature to compute
12539         whether it is possible to implement a method or not.
12540
12541         The reason is that calling PropertyInfo.GetGetMethod will return
12542         null (in .NET, in Mono it works, and we should change this), in
12543         cases where the Get Method does not exist in that particular
12544         class.
12545
12546         So this code:
12547
12548         class X { public virtual int A { get { return 1; } } }
12549         class Y : X { }
12550         class Z : Y { public override int A { get { return 2; } } }
12551
12552         Would fail in Z because the parent (Y) would not have the property
12553         defined.  So we avoid this completely now (because the alternative
12554         fix was ugly and slow), and we now depend exclusively on the
12555         method names.
12556
12557         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12558         reference method, instead of using the property.
12559
12560         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12561         routines are gone now.
12562
12563         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12564         names, they were incorrectly named.
12565
12566         * cs-tokenizer.cs: Return are more gentle token on failure. 
12567
12568         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12569         had an out-of-sync index variable, which caused it to remove from
12570         the list of pending methods the wrong method sometimes.
12571
12572 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12573
12574         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12575         CanWrite, because those refer to this particular instance of the
12576         property, and do not take into account the fact that we can
12577         override single members of a property.
12578
12579         Constructor requires an EmitContext.  The resolution process does
12580         not happen here, but we need to compute the accessors before,
12581         because the resolution does not always happen for properties.
12582
12583         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12584         subclass, before we did not update this flag, but we did update
12585         bindingflags. 
12586
12587         (GetAccessors): Drop this routine, as it did not work in the
12588         presence of partially overwritten set/get methods. 
12589
12590         Notice that this broke the cs1540 detection, but that will require
12591         more thinking. 
12592
12593 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12594
12595         * class.cs:
12596         * codegen.cs:
12597         * driver.cs: issue a warning instead of an error if we don't support
12598         debugging for the platform. Also ignore a couple of errors that may
12599         arise when trying to write the symbols. Undo my previous patch.
12600
12601 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12602
12603         * driver.cs: ignore /debug switch except for Unix platforms.
12604
12605 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12606
12607         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12608
12609 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12610
12611         * driver.cs: Do not make mcs-debug conditional, so we do not break
12612         builds that use it.
12613
12614         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12615         review this patch.  But basically after all the children variables
12616         have been merged, the value of "Breaks" was not being set to
12617         new_breaks for Switch blocks.  I think that it should be set after
12618         it has executed.  Currently I set this to the value of new_breaks,
12619         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12620         conservative, but I do not understand this code very well.
12621
12622         I did not break anything in the build, so that is good ;-)
12623
12624         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12625
12626 2002-10-20  Mark Crichton  <crichton@gimp.org>
12627
12628         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12629
12630 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12631
12632         * cfold.cs: Fixed compile blocker.
12633
12634 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12635
12636         * driver.cs: I was chekcing the key, not the file.
12637
12638 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12639
12640         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12641         message that we were generating - we just need to silently return
12642         a null.
12643
12644 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12645
12646         * class.cs (Event.Define): Change my previous commit, as this
12647         breaks the debugger.  This is a temporary hack, as it seems like
12648         the compiler is generating events incorrectly to begin with.
12649
12650         * expression.cs (Binary.ResolveOperator): Added support for 
12651         "U operator - (E x, E y)"
12652
12653         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12654         y)".
12655
12656         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12657         init-only variables, but this path did not take into account that
12658         there might be also instance readonly variables.  Correct this
12659         problem. 
12660
12661         This fixes bug 32253
12662
12663         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12664         delegates as well.
12665
12666         * driver.cs: Change the extension for modules to `netmodule'
12667
12668         * cs-parser.jay: Improved slightly the location tracking for
12669         the debugger symbols.
12670
12671         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12672         modifiers that were specified instead of the hardcoded value
12673         (FamAndAssem).  This was basically ignoring the static modifier,
12674         and others.  Fixes 32429.
12675
12676         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12677         fixed a bug in the process (32476)
12678
12679         * expression.cs (ArrayAccess.EmitAssign): Patch from
12680         hwang_rob@yahoo.ca that fixes bug 31834.3
12681
12682 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12683
12684         * driver.cs: Make the module extension .netmodule.
12685
12686 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12687
12688         * driver.cs: Report an error if the resource file is not found
12689         instead of crashing.
12690
12691         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12692         false, like Emit does.
12693
12694 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12695
12696         * typemanager.cs: Remove unused private member.  Also reported mcs
12697         bug to report this as a warning like csc.
12698
12699 2002-10-15  Martin Baulig  <martin@gnome.org>
12700
12701         * statement.cs (Statement.Emit): Made this a virtual method; emits
12702         the line number info and calls DoEmit().
12703         (Statement.DoEmit): New protected abstract method, formerly knows
12704         as Statement.Emit().
12705
12706         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12707
12708 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12709
12710         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12711         have fixed a remaining problem: not every AddXXXX was adding a
12712         fully qualified name.  
12713
12714         Now everyone registers a fully qualified name in the DeclSpace as
12715         being defined instead of the partial name.  
12716
12717         Downsides: we are slower than we need to be due to the excess
12718         copies and the names being registered this way.  
12719
12720         The reason for this is that we currently depend (on the corlib
12721         bootstrap for instance) that types are fully qualified, because
12722         we dump all the types in the namespace, and we should really have
12723         types inserted into the proper namespace, so we can only store the
12724         basenames in the defined_names array.
12725
12726 2002-10-10  Martin Baulig  <martin@gnome.org>
12727
12728         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12729         from bug #31834, see the bug report for a testcase which is
12730         miscompiled.
12731
12732 2002-10-10  Martin Baulig  <martin@gnome.org>
12733
12734         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12735         flow analysis code for this.
12736
12737         * statement.cs (Do, While, For): Tell the flow analysis code about
12738         infinite loops.
12739         (FlowBranching.UsageVector): Added support for infinite loops.
12740         (Block.Resolve): Moved the dead code elimination here and use flow
12741         analysis to do it.
12742
12743 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12744
12745         * class.cs (Field.Define): Catch cycles on struct type
12746         definitions. 
12747
12748         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12749         fields if the fields are static.  We only need to check instance
12750         fields. 
12751
12752         * expression.cs (As.DoResolve): Test for reference type.
12753
12754         * statement.cs (Using.ResolveExpression): Use
12755         ConvertImplicitRequired, not ConvertImplicit which reports an
12756         error on failture
12757         (Using.ResolveLocalVariableDecls): ditto.
12758
12759         * expression.cs (Binary.ResolveOperator): Report errors in a few
12760         places where we had to.
12761
12762         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12763
12764 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12765
12766         * expression.cs: Use StoreFromPtr instead of extracting the type
12767         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12768
12769         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12770         an enumeration value to a System.Enum, but System.Enum is not a
12771         value type, but an class type, so we need to box.
12772
12773         (Expression.ConvertExplicit): One codepath could return
12774         errors but not flag them.  Fix this.  Fixes #31853
12775
12776         * parameter.cs (Resolve): Do not allow void as a parameter type.
12777
12778 2002-10-06  Martin Baulig  <martin@gnome.org>
12779
12780         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12781         if it's a class type and not a struct.  Fixes #31815.
12782
12783 2002-10-06  Martin Baulig  <martin@gnome.org>
12784
12785         * statement.cs: Reworked the flow analysis code a bit to make it
12786         usable for dead code elimination.
12787
12788 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12789
12790         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12791
12792 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12793
12794         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12795         to fix the test 165, will investigate deeper.
12796
12797 2002-10-04  Martin Baulig  <martin@gnome.org>
12798
12799         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12800         finally blocks actually work.
12801         (Try.Resolve): We don't need to create a sibling for `finally' if
12802         there is no finally block.
12803
12804 2002-10-04  Martin Baulig  <martin@gnome.org>
12805
12806         * class.cs (Constructor.Define): The default accessibility for a
12807         non-default constructor is private, not public.
12808
12809 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12810
12811         * class.cs (Constructor): Make AllowedModifiers public, add
12812         EXTERN.
12813
12814         * cs-parser.jay: Perform the modifiers test here, as the
12815         constructor for the Constructor class usually receives a zero
12816         because of the way we create it (first we create, later we
12817         customize, and we were never checking the modifiers).
12818
12819         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12820         is a version of LookupTypeReflection that includes the type-name
12821         cache.  This can be used as a fast path for functions that know
12822         the fully qualified name and are only calling into *.GetType() to
12823         obtain a composed type.
12824
12825         This is also used by TypeManager.LookupType during its type
12826         composition.
12827
12828         (LookupType): We now also track the real type name, as sometimes
12829         we can get a quey for the real type name from things like
12830         ComposedCast.  This fixes bug 31422.
12831
12832         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12833         complete type fullname, it does not have to go through the type
12834         resolution system to obtain the composed version of the type (for
12835         obtaining arrays or pointers).
12836
12837         (Conditional.Emit): Use the EmitBoolExpression to
12838         generate nicer code, as requested by Paolo.
12839
12840         (ArrayCreation.CheckIndices): Use the patch from
12841         hwang_rob@yahoo.ca to validate the array initializers. 
12842
12843 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12844
12845         * class.cs (ConstructorInitializer.Emit): simplify code by using
12846         Invocation.EmitCall, and at the same time, fix the bugs in calling
12847         parent constructors that took variable arguments. 
12848
12849         * ecore.cs (Expression.ConvertNumericExplicit,
12850         Expression.ImplicitNumericConversion): Remove the code that
12851         manually wrapped decimal (InternalTypeConstructor call is now gone
12852         as well).
12853
12854         * expression.cs (Cast.TryReduce): Also handle decimal types when
12855         trying to perform a constant fold on the type.
12856
12857         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12858
12859         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12860         that only turned off an error report, and did nothing else. 
12861
12862 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12863
12864         * driver.cs: Handle and ignore /fullpaths
12865
12866 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12867
12868         * expression.cs (Binary.ResolveOperator): Catch the case where
12869         DoNumericPromotions returns true, 
12870
12871         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12872
12873 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12874
12875         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12876         report error 70.
12877
12878 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12879
12880         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12881         conversion exists, but it is also required that the conversion be
12882         performed.  This manifested in "(Type64Enum) 2".  
12883
12884         * class.cs (TypeManager.AddMethod): The fix is not to change
12885         AddEnum, because that one was using a fully qualified name (every
12886         DeclSpace derivative does), but to change the AddMethod routine
12887         that was using an un-namespaced name.  This now correctly reports
12888         the duplicated name.
12889
12890         Revert patch until I can properly fix it.  The issue
12891         is that we have a shared Type space across all namespaces
12892         currently, which is wrong.
12893
12894         Options include making the Namespace a DeclSpace, and merge
12895         current_namespace/current_container in the parser.
12896
12897 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12898
12899         * cs-parser.jay: Improve error reporting when we get a different
12900         kind of expression in local_variable_type and
12901         local_variable_pointer_type. 
12902
12903         Propagate this to avoid missleading errors being reported.
12904
12905         * ecore.cs (ImplicitReferenceConversion): treat
12906         TypeManager.value_type as a target just like object_type.   As
12907         code like this:
12908
12909         ValueType v = 1;
12910
12911         Is valid, and needs to result in the int 1 being boxed before it
12912         is assigned to the value type v.
12913
12914         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12915         to validate the enumeration name.
12916
12917         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12918         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12919         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12920
12921         * ecore.cs (TryImplicitIntConversion): When doing an
12922         implicit-enumeration-conversion, check if the type is 64-bits and
12923         perform a conversion before passing to EnumConstant.
12924
12925 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12926
12927         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12928         report ambiguous type references.  Unlike the MS version, we
12929         report what the ambiguity is.   Innovation at work ;-)
12930
12931         (DeclSpace.FindType): Require a location argument to
12932         display when we display an ambiguous error.
12933
12934         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12935
12936         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12937
12938         * expression.cs (EmitDynamicInitializers): Apply patch from
12939         hwang_rob@yahoo.ca that fixes the order in which we emit our
12940         initializers. 
12941
12942 2002-09-21  Martin Baulig  <martin@gnome.org>
12943
12944         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12945         delegate takes no arguments.
12946
12947 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12948
12949         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12950         from integers.
12951
12952         * expression.cs: Extract the underlying type.
12953
12954         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12955
12956         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12957
12958 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12959
12960         * class.cs (TypeContainer.DefineType): We can not use the nice
12961         PackingSize with the size set to 1 DefineType method, because it
12962         will not allow us to define the interfaces that the struct
12963         implements.
12964
12965         This completes the fixing of bug 27287
12966
12967         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12968         means also structs.  This fixes part of the problem. 
12969         (Expresion.ImplicitReferenceConversionExists): ditto.
12970
12971         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12972         error if there were no errors reported during the type lookup
12973         process, to avoid duplicates or redundant errors.  Without this
12974         you would get an ambiguous errors plus a type not found.  We have
12975         beaten the user enough with the first error.  
12976
12977         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12978         reference. 
12979
12980         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12981         during the resolution process, stop the lookup, this avoids
12982         repeated error reports (same error twice).
12983
12984         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12985
12986         * typemanager.cs (LookupType): Redo the type lookup code to match
12987         the needs of System.Reflection.  
12988
12989         The issue is that System.Reflection requires references to nested
12990         types to begin with a "+" sign instead of a dot.  So toplevel
12991         types look like: "NameSpace.TopLevelClass", and nested ones look
12992         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12993         levels. 
12994
12995 2002-09-19  Martin Baulig  <martin@gnome.org>
12996
12997         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12998         says that a method always returns or always throws an exception,
12999         don't report the CS0161.
13000
13001         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13002         set `Returns = new_returns'.
13003
13004 2002-09-19  Martin Baulig  <martin@gnome.org>
13005
13006         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13007         to an enum constant, check for a CS0176.
13008
13009 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
13010
13011         * class.cs (TypeContainer.CheckPairedOperators): Now we check
13012         for operators that must be in pairs and report errors.
13013
13014         * ecore.cs (SimpleName.DoResolveType): During the initial type
13015         resolution process, when we define types recursively, we must
13016         check first for types in our current scope before we perform
13017         lookups in the enclosing scopes.
13018
13019         * expression.cs (MakeByteBlob): Handle Decimal blobs.
13020
13021         (Invocation.VerifyArgumentsCompat): Call
13022         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13023         I thought we were supposed to always call this, but there are a
13024         few places in the code where we dont do it.
13025
13026 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
13027
13028         * driver.cs: Add support in -linkres and -resource to specify the
13029         name of the identifier.
13030
13031 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13032
13033         * ecore.cs (StandardConversionExists): Sync with the conversion
13034         code: allow anything-* to void* conversions.
13035
13036         (FindMostSpecificSource): Use an Expression argument
13037         instead of a Type, because we might be handed over a Literal which
13038         gets a few more implicit conversions that plain types do not.  So
13039         this information was being lost.
13040
13041         Also, we drop the temporary type-holder expression when not
13042         required.
13043
13044 2002-09-17  Martin Baulig  <martin@gnome.org>
13045
13046         * class.cs (PropertyBase.CheckBase): Don't check the base class if
13047         this is an explicit interface implementation.
13048
13049 2002-09-17  Martin Baulig  <martin@gnome.org>
13050
13051         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13052         different `IndexerName' attributes.
13053
13054         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13055         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13056         virtual CommonResolve().
13057
13058 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13059
13060         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13061         and convert that to the UnderlyingType.
13062
13063         * statement.cs (Foreach.Resolve): Indexers are just like variables
13064         or PropertyAccesses.
13065
13066         * cs-tokenizer.cs (consume_string): Track line numbers and columns
13067         inside quoted strings, we were not doing this before.
13068
13069 2002-09-16  Martin Baulig  <martin@gnome.org>
13070
13071         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13072         resolve it.  This is needed for the definite assignment check of the
13073         instance expression, fixes bug #29846.
13074         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13075
13076 2002-09-16  Nick Drochak  <ndrochak@gol.com>
13077
13078         * parameter.cs: Fix compile error.  Cannot reference static member
13079         from an instance object.  Is this an mcs bug?
13080
13081 2002-09-14  Martin Baulig  <martin@gnome.org>
13082
13083         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13084         multiple times.  Fixes bug #30295, added test-166.cs.
13085
13086 2002-09-14  Martin Baulig  <martin@gnome.org>
13087
13088         * statement.cs (Block.Emit): Don't emit unreachable code.
13089         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13090         `break' statements.
13091         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13092
13093 2002-09-14  Martin Baulig  <martin@gnome.org>
13094
13095         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13096         is set.
13097
13098 2002-09-14  Martin Baulig  <martin@gnome.org>
13099
13100         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13101         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13102         be false on the ms runtime.
13103
13104 2002-09-13  Martin Baulig  <martin@gnome.org>
13105
13106         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13107         the CS0038 error message.
13108
13109 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
13110
13111         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13112         constant inside, return it.
13113
13114 2002-09-12  Martin Baulig  <martin@gnome.org>
13115
13116         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13117         implicit conversion can be done between enum types.
13118
13119         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13120         check whether an implicit conversion to the current enum's UnderlyingType
13121         exists and report an error if not.
13122
13123         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13124         without debugging support.
13125
13126         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13127         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
13128
13129 2002-09-12  Martin Baulig  <martin@gnome.org>
13130
13131         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13132
13133         * ecore.cs (IMemberExpr.DeclaringType): New property.
13134         (SimpleName.SimpleNameResolve): Check whether we're accessing a
13135         nonstatic member of an outer type (CS0038).
13136
13137 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
13138
13139         * driver.cs: Activate the using-error detector at warning level
13140         4 (at least for MS-compatible APIs).
13141
13142         * namespace.cs (VerifyUsing): Small buglett fix.
13143
13144         * pending.cs (PendingImplementation): pass the container pointer. 
13145
13146         * interface.cs (GetMethods): Allow for recursive definition.  Long
13147         term, I would like to move every type to support recursive
13148         definitions, not the current ordering mechanism that we have right
13149         now.
13150
13151         The situation is this: Attributes are handled before interfaces,
13152         so we can apply attributes to interfaces.  But some attributes
13153         implement interfaces, we will now handle the simple cases
13154         (recursive definitions will just get an error).  
13155
13156         * parameter.cs: Only invalidate types at the end if we fail to
13157         lookup all types.  
13158
13159 2002-09-09  Martin Baulig  <martin@gnome.org>
13160
13161         * ecore.cs (PropertyExpr.Emit): Also check for
13162         TypeManager.system_int_array_get_length so this'll also work when
13163         compiling corlib.  Fixes #30003.
13164
13165 2002-09-09  Martin Baulig  <martin@gnome.org>
13166
13167         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13168         and throw an exception if we can't get the type's size.  Fixed #30040,
13169         added test-165.cs.
13170
13171 2002-09-09  Martin Baulig  <martin@gnome.org>
13172
13173         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13174
13175         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13176         context.  Fixes bug #30027.
13177
13178         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13179         virtual functions.  Fixes bug #30043, added test-164.cs.
13180
13181 2002-09-08  Ravi Pratap  <ravi@ximian.com>
13182
13183         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13184
13185 2002-09-08  Nick Drochak  <ndrochak@gol.com>
13186
13187         * driver.cs: Use an object to get the windows codepage since it's not a
13188         static property.
13189
13190 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
13191
13192         * statement.cs (For.Emit): for infinite loops (test == null)
13193         return whether there is a break inside, not always "true".
13194
13195         * namespace.cs (UsingEntry): New struct to hold the name of the
13196         using definition, the location where it is defined, and whether it
13197         has been used in a successful type lookup.
13198
13199         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13200         strings.
13201
13202         * decl.cs: ditto.
13203
13204 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13205
13206         * attribute.cs : Fix incorrect code which relied on catching
13207         a NullReferenceException to detect a null being passed in
13208         where an object was expected.
13209
13210 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
13211
13212         * statement.cs (Try): flag the catch variable as assigned
13213
13214         * expression.cs (Cast): Simplified by using ResolveType instead of
13215         manually resolving.
13216
13217         * statement.cs (Catch): Fix bug by using ResolveType.
13218
13219 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13220
13221         * expression.cs (BetterConversion): Special case for when we have
13222         a NullLiteral as the argument and we have to choose between string
13223         and object types - we choose string the way csc does.
13224
13225         * attribute.cs (Attribute.Resolve): Catch the
13226         NullReferenceException and report error #182 since the Mono
13227         runtime no more has the bug and having this exception raised means
13228         we tried to select a constructor which takes an object and is
13229         passed a null.
13230
13231 2002-09-05  Ravi Pratap  <ravi@ximian.com>
13232
13233         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13234         message (1502, 1503) when we can't locate a method after overload
13235         resolution. This is much more informative and closes the bug
13236         Miguel reported.
13237
13238         * interface.cs (PopulateMethod): Return if there are no argument
13239         types. Fixes a NullReferenceException bug.
13240
13241         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13242         expressions too. Previously we were checking only in one place for
13243         positional arguments leaving out named arguments.
13244
13245         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13246         type to the enum type is not allowed. Remove code corresponding to
13247         that.
13248
13249         (ConvertNumericExplicit): Allow explicit conversions from
13250         the underlying type to enum type. This precisely follows the spec
13251         and closes a bug filed by Gonzalo.
13252
13253 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13254
13255         * compiler.csproj:
13256         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13257
13258 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13259
13260         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13261         it was important that we stored the right value after the
13262         reduction in `converted'.
13263
13264 2002-09-04  Martin Baulig  <martin@gnome.org>
13265
13266         * location.cs (Location.SymbolDocument): Use full pathnames for the
13267         source files.
13268
13269 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13270
13271         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13272         of the expression resolve mechanism, because that will catch the
13273         SimpleName error failures.
13274
13275         (Conditional): If we can not resolve the
13276         expression, return, do not crash.
13277
13278 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13279
13280         * cs-tokenizer.cs:
13281         (location): display token name instead of its number.
13282
13283 2002-08-28  Martin Baulig  <martin@gnome.org>
13284
13285         * expression.cs (Binary.ResolveOperator): Don't silently return
13286         but return an error if an operator cannot be applied between two
13287         enum types.
13288
13289 2002-08-28  Martin Baulig  <martin@gnome.org>
13290
13291         * class.cs (Constructor.Define): Set the permission attributes
13292         correctly instead of making all constructors public.
13293
13294 2002-08-28  Martin Baulig  <martin@gnome.org>
13295
13296         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13297         for private members before reporting a CS0103; if we find anything,
13298         it's a CS0122.
13299
13300 2002-08-28  Martin Baulig  <martin@gnome.org>
13301
13302         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13303         to check whether `closure_start_type == closure_invocation_type',
13304         we also need to check whether `m.DeclaringType == closure_invocation_type'
13305         before bypassing the permission checks.  We might be accessing
13306         protected/private members from the base class.
13307         (TypeManager.RealMemberLookup): Only set private_ok if private
13308         members were requested via BindingFlags.NonPublic.
13309
13310         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13311
13312         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13313         MethodGroupExpr.IsExplicitImpl if appropriate.
13314         (Invocation.DoResolve): Don't report the CS0120 for explicit
13315         interface implementations.
13316
13317 2002-08-27  Martin Baulig  <martin@gnome.org>
13318
13319         * expression.cs (Invocation.DoResolve): If this is a static
13320         method and we don't have an InstanceExpression, we must report
13321         a CS0120.
13322
13323 2002-08-25  Martin Baulig  <martin@gnome.org>
13324
13325         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13326         `==' between a valuetype and an object.
13327
13328 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13329
13330         * ecore.cs (TypeExpr): Provide a ToString method.
13331
13332 2002-08-24  Martin Baulig  <martin@gnome.org>
13333
13334         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13335         now called proggie.dbg and it's a binary file.
13336
13337 2002-08-23  Martin Baulig  <martin@gnome.org>
13338
13339         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13340
13341 2002-08-23  Martin Baulig  <martin@gnome.org>
13342
13343         * struct.cs (MyStructInfo.ctor): Make this work with empty
13344         structs; it's not allowed to use foreach() on null.
13345
13346 2002-08-23  Martin Baulig  <martin@gnome.org>
13347
13348         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13349         writer the full pathname of the generated assembly.
13350
13351 2002-08-23  Martin Baulig  <martin@gnome.org>
13352
13353         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13354         A `finally' block never returns or breaks; improved handling of
13355         unreachable code.
13356
13357 2002-08-23  Martin Baulig  <martin@gnome.org>
13358
13359         * statement.cs (Throw.Resolve): Allow `throw null'.
13360
13361 2002-08-23  Martin Baulig  <martin@gnome.org>
13362
13363         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13364         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13365         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13366         MemberLookup would return a wrong event if this is an explicit
13367         interface implementation and the class has an event with the same
13368         name.
13369
13370 2002-08-23  Martin Baulig  <martin@gnome.org>
13371
13372         * statement.cs (Block.AddChildVariableNames): New public method.
13373         (Block.AddChildVariableName): Likewise.
13374         (Block.IsVariableNameUsedInChildBlock): Likewise.
13375         (Block.AddVariable): Check whether a variable name has already
13376         been used in a child block.
13377
13378         * cs-parser.jay (declare_local_variables): Mark all variable names
13379         from the current block as being used in a child block in the
13380         implicit block.
13381
13382 2002-08-23  Martin Baulig  <martin@gnome.org>
13383
13384         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13385         find the symbol writer.
13386
13387         * driver.cs: csc also allows the arguments to /define being
13388         separated by commas, not only by semicolons.
13389
13390 2002-08-23  Martin Baulig  <martin@gnome.org>
13391
13392         * interface.cs (Interface.GetMembers): Added static check for events.
13393
13394 2002-08-15  Martin Baulig  <martin@gnome.org>
13395
13396         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13397         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13398
13399         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13400         why the MethodData.EmitDestructor() change was necessary.
13401
13402 2002-08-20  Martin Baulig  <martin@gnome.org>
13403
13404         * class.cs (TypeContainer.FindMembers): Added static check for events.
13405
13406         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13407
13408         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13409         use Type.GetEvents(), not Type.FindMembers().
13410
13411 2002-08-20  Martin Baulig  <martin@gnome.org>
13412
13413         * decl.cs (MemberCache): Added a special method cache which will
13414         be used for method-only searched.  This ensures that a method
13415         search will return a MethodInfo with the correct ReflectedType for
13416         inherited methods.      
13417
13418 2002-08-20  Martin Baulig  <martin@gnome.org>
13419
13420         * decl.cs (DeclSpace.FindMembers): Made this public.
13421
13422 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13423
13424         * delegate.cs: fixed build on windows.
13425         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13426
13427 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13428
13429         * ecore.cs (StandardConversionExists): Return a false
13430         if we are trying to convert the void type to anything else
13431         since that is not allowed.
13432
13433         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13434         we flag error 70 in the event an event is trying to be accessed
13435         directly from outside the declaring type.
13436
13437 2002-08-20  Martin Baulig  <martin@gnome.org>
13438
13439         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13440         MemberCache from typemanager.cs to decl.cs.
13441
13442 2002-08-19  Martin Baulig  <martin@gnome.org>
13443
13444         * class.cs (TypeContainer): Implement IMemberContainer.
13445         (TypeContainer.DefineMembers): Create the MemberCache.
13446         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13447         return public members if BindingFlags.Public was given, check
13448         whether members are static.
13449
13450 2002-08-16  Martin Baulig  <martin@gnome.org>
13451
13452         * decl.cs (DeclSpace.Define): Splitted this in Define and
13453         DefineMembers.  DefineMembers is called first and initializes the
13454         MemberCache.
13455
13456         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13457         DefineMembers() on all our DeclSpaces.
13458
13459         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13460         but call DefineMembers() on all nested interfaces.  We call their
13461         Define() in our new Define() function.
13462
13463         * interface.cs (Interface): Implement IMemberContainer.
13464         (Interface.Define): Moved all code except the attribute stuf to
13465         DefineMembers().
13466         (Interface.DefineMembers): Initialize the member cache.
13467
13468         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13469         need this anymore since we can use MemberCache.FindMembers directly.
13470
13471 2002-08-19  Martin Baulig  <martin@gnome.org>
13472
13473         * typemanager.cs (MemberCache): When creating the cache for an
13474         interface type, add all inherited members.
13475         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13476         to `out bool used_cache' and documented it.
13477         (TypeManager.MemberLookup): If we already used the cache in the first
13478         iteration, we don't need to do the interfaces check.
13479
13480 2002-08-19  Martin Baulig  <martin@gnome.org>
13481
13482         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13483         here from IMemberFinder and don't implement this interface anymore.
13484         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13485
13486         * typemanager.cs (IMemberFinder): This interface is now only used by
13487         classes which actually support the member cache.
13488         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13489         since we only put DeclSpaces into this Hashtable.
13490         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13491         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13492
13493 2002-08-16  Martin Baulig  <martin@gnome.org>
13494
13495         * typemanager.cs (ICachingMemberFinder): Removed.
13496         (IMemberFinder.MemberCache): New property.
13497         (TypeManager.FindMembers): Merged this with RealFindMembers().
13498         This function will never be called from TypeManager.MemberLookup()
13499         so we can't use the cache here, just the IMemberFinder.
13500         (TypeManager.MemberLookup_FindMembers): Check whether the
13501         IMemberFinder has a MemberCache and call the cache's FindMembers
13502         function.
13503         (MemberCache): Rewrote larger parts of this yet another time and
13504         cleaned it up a bit.
13505
13506 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13507
13508         * driver.cs (LoadArgs): Support quoting.
13509
13510         (Usage): Show the CSC-like command line arguments.
13511
13512         Improved a few error messages.
13513
13514 2002-08-15  Martin Baulig  <martin@gnome.org>
13515
13516         * typemanager.cs (IMemberContainer.Type): New property.
13517         (IMemberContainer.IsInterface): New property.
13518
13519         The following changes are conditional to BROKEN_RUNTIME, which is
13520         defined at the top of the file.
13521
13522         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13523         class'es members, but add all members from TypeHandle.ObjectType
13524         if we're an interface.
13525         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13526         is the current type.
13527         (MemberCache.CacheEntry.Container): Removed this field.
13528         (TypeHandle.GetMembers): Include inherited members.
13529
13530 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13531
13532         * typemanager.cs: fixed compilation and added a comment on a field that
13533         is never used.
13534
13535 2002-08-15  Martin Baulig  <martin@gnome.org>
13536
13537         * class.cs (ConstructorInitializer.Resolve): In the
13538         Expression.MemberLookup call, use the queried_type as
13539         invocation_type.
13540
13541         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13542         declared' attribute, it's always true.
13543         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13544         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13545         temporary wrapper for FindMembers which tells MemberLookup whether
13546         members from the base classes are included in the return value.
13547         This will go away soon.
13548         (TypeManager.MemberLookup): Use this temporary hack here; once the
13549         new MemberCache is completed, we don't need to do the DeclaredOnly
13550         looping here anymore since the MemberCache will take care of this.
13551         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13552         (MemberCache): When creating the MemberCache for a class, get
13553         members from the current class and all its base classes.
13554         (MemberCache.CacheEntry.Container): New field.  This is a
13555         temporary hack until the Mono runtime is fixed to distinguish
13556         between ReflectedType and DeclaringType.  It allows us to use MCS
13557         with both the MS runtime and the unfixed Mono runtime without
13558         problems and without accecting performance.
13559         (MemberCache.SearchMembers): The DeclaredOnly looping from
13560         TypeManager.MemberLookup is now done here.      
13561
13562 2002-08-14  Martin Baulig  <martin@gnome.org>
13563
13564         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13565         Type.GetFields on dynamic types but get the fields from the
13566         corresponding TypeContainer.
13567         (MyStructInfo.GetStructInfo): Added check for enum types.
13568
13569         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13570         (MemberList.SyncRoot): Implemented.
13571         (TypeManager.FilterWithClosure): No need to check permissions if
13572         closure_start_type == closure_invocation_type, don't crash if
13573         closure_invocation_type is null.
13574
13575 2002-08-13  Martin Baulig  <martin@gnome.org>
13576
13577         Rewrote TypeContainer.FindMembers to use a member cache.  This
13578         gives us a speed increase of about 35% for the self-hosting MCS
13579         build and of about 15-20% for the class libs (both on GNU/Linux).
13580
13581         * report.cs (Timer): New class to get enhanced profiling.  This
13582         whole class is "TIMER" conditional since it remarkably slows down
13583         compilation speed.
13584
13585         * class.cs (MemberList): New class.  This is an IList wrapper
13586         which we're now using instead of passing MemberInfo[]'s around to
13587         avoid copying this array unnecessarily.
13588         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13589         (ICachingMemberFinder, IMemberContainer): New interface.
13590         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13591         has already been checked, otherwise use it for the name comparision.
13592         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13593         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13594         if possible.  Returns a MemberList, not a MemberInfo [].
13595         (TypeHandle): New class, implements IMemberContainer.  We create
13596         one instance of this class per type, it contains a MemberCache
13597         which is used to do the member lookups.
13598         (MemberCache): New class.  Each instance of this class contains
13599         all members of a type and a name-based hash table.
13600         (MemberCache.FindMembers): This is our new member lookup
13601         function.  First, it looks up all members of the requested name in
13602         the hash table.  Then, it walks this list and sorts out all
13603         applicable members and returns them.
13604
13605 2002-08-13  Martin Baulig  <martin@gnome.org>
13606
13607         In addition to a nice code cleanup, this gives us a performance
13608         increase of about 1.4% on GNU/Linux - not much, but it's already
13609         half a second for the self-hosting MCS compilation.
13610
13611         * typemanager.cs (IMemberFinder): New interface.  It is used by
13612         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13613         Enum, Delegate or Interface.
13614         (TypeManager.finder_to_member_finder): New PtrHashtable.
13615         (TypeManager.finder_to_container): Removed.
13616         (TypeManager.finder_to_delegate): Removed.
13617         (TypeManager.finder_to_interface): Removed.
13618         (TypeManager.finder_to_enum): Removed.
13619
13620         * interface.cs (Interface): Implement IMemberFinder.
13621
13622         * delegate.cs (Delegate): Implement IMemberFinder.
13623
13624         * enum.cs (Enum): Implement IMemberFinder.
13625
13626         * class.cs (TypeContainer): Implement IMemberFinder.
13627
13628 2002-08-12  Martin Baulig  <martin@gnome.org>
13629
13630         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13631
13632 2002-08-12  Martin Baulig  <martin@gnome.org>
13633
13634         * ecore.cs (ITypeExpression): New interface for expressions which
13635         resolve to a type.
13636         (TypeExpression): Renamed to TypeLookupExpression.
13637         (Expression.DoResolve): If we're doing a types-only lookup, the
13638         expression must implement the ITypeExpression interface and we
13639         call DoResolveType() on it.
13640         (SimpleName): Implement the new ITypeExpression interface.
13641         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13642         hack, the situation that we're only looking up types can't happen
13643         anymore when this method is called.  Moved the type lookup code to
13644         DoResolveType() and call it.
13645         (SimpleName.DoResolveType): This ITypeExpression interface method
13646         is now doing the types-only lookup.
13647         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13648         (ResolveFlags): Added MaskExprClass.
13649
13650         * expression.cs (MemberAccess): Implement the ITypeExpression
13651         interface.
13652         (MemberAccess.DoResolve): Added support for a types-only lookup
13653         when we're called via ITypeExpression.DoResolveType().
13654         (ComposedCast): Implement the ITypeExpression interface.
13655
13656         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13657         Expression.Resolve() with ResolveFlags.Type instead.
13658
13659 2002-08-12  Martin Baulig  <martin@gnome.org>
13660
13661         * interface.cs (Interface.Define): Apply attributes.
13662
13663         * attribute.cs (Attribute.ApplyAttributes): Added support for
13664         interface attributes.
13665
13666 2002-08-11  Martin Baulig  <martin@gnome.org>
13667
13668         * statement.cs (Block.Emit): Only check the "this" variable if we
13669         do not always throw an exception.
13670
13671         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13672         whether the property has a set accessor.
13673
13674 2002-08-11  Martin Baulig  <martin@gnome.org>
13675
13676         Added control flow analysis support for structs.
13677
13678         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13679         with control flow analysis turned off.
13680         (IVariable): New interface.
13681         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13682         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13683         (FieldExpr.DoResolve): Resolve the instance expression with flow
13684         analysis turned off and do the definite assignment check after the
13685         resolving when we know what the expression will resolve to.
13686
13687         * expression.cs (LocalVariableReference, ParameterReference):
13688         Implement the new IVariable interface, only call the flow analysis
13689         code if ec.DoFlowAnalysis is true.
13690         (This): Added constructor which takes a Block argument.  Implement
13691         the new IVariable interface.
13692         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13693         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13694         This does the definite assignment checks for struct members.
13695
13696         * class.cs (Constructor.Emit): If this is a non-static `struct'
13697         constructor which doesn't have any initializer, call
13698         Block.AddThisVariable() to tell the flow analysis code that all
13699         struct elements must be initialized before control returns from
13700         the constructor.
13701
13702         * statement.cs (MyStructInfo): New public class.
13703         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13704         argument to this indexer.  If non-zero, check an individual struct
13705         member, not the whole struct.
13706         (FlowBranching.CheckOutParameters): Check struct members.
13707         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13708         overloaded versions of these methods which take an additional
13709         `int field_idx' argument to check struct members.
13710         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13711         overloaded versions of these methods which take an additional
13712         `string field_name' argument to check struct member.s
13713         (VariableInfo): Implement the IVariable interface.
13714         (VariableInfo.StructInfo): New public property.  Returns the
13715         MyStructInfo instance of the variable if it's a struct or null.
13716         (Block.AddThisVariable): New public method.  This is called from
13717         Constructor.Emit() for non-static `struct' constructor which do
13718         not have any initializer.  It creates a special variable for the
13719         "this" instance variable which will be checked by the flow
13720         analysis code to ensure that all of the struct's fields are
13721         initialized before control returns from the constructor.
13722         (UsageVector): Added support for struct members.  If a
13723         variable/parameter is a struct with N members, we reserve a slot
13724         in the usage vector for each member.  A struct is considered fully
13725         initialized if either the struct itself (slot 0) or all its
13726         members are initialized.
13727
13728 2002-08-08  Martin Baulig  <martin@gnome.org>
13729
13730         * driver.cs (Driver.MainDriver): Only report an error CS5001
13731         if there were no compilation errors.
13732
13733         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13734         `UnsafeContext' property to determine whether the parent is in
13735         unsafe context rather than checking the parent's ModFlags:
13736         classes nested in an unsafe class are unsafe as well.
13737
13738 2002-08-08  Martin Baulig  <martin@gnome.org>
13739
13740         * statement.cs (UsageVector.MergeChildren): Distinguish between
13741         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13742         we return.  Added test17() and test18() to test-154.cs.
13743
13744 2002-08-08  Martin Baulig  <martin@gnome.org>
13745
13746         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13747         Family access, make sure the invoking type isn't a subclass of the
13748         queried type (that'd be a CS1540).
13749
13750         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13751         this method which takes an additional `Type invocation_type'.
13752
13753         * expression.cs (BaseAccess.DoResolve): Use the base type as
13754         invocation and query type.
13755         (MemberAccess.DoResolve): If the lookup failed and we're about to
13756         report a CS0122, try a lookup with the ec.ContainerType - if this
13757         succeeds, we must report a CS1540.
13758
13759 2002-08-08  Martin Baulig  <martin@gnome.org>
13760
13761         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13762         (MethodGroupExpr): Implement the IMemberExpr interface.
13763
13764         * expression (MemberAccess.ResolveMemberAccess): No need to have
13765         any special code for MethodGroupExprs anymore, they're now
13766         IMemberExprs.   
13767
13768 2002-08-08  Martin Baulig  <martin@gnome.org>
13769
13770         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13771         Family, FamANDAssem and FamORAssem permissions.
13772         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13773
13774 2002-08-08  Martin Baulig  <martin@gnome.org>
13775
13776         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13777         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13778         or loop block.
13779
13780 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13781
13782         * driver.cs: implemented /resource option to embed managed resources.
13783
13784 2002-08-07  Martin Baulig  <martin@gnome.org>
13785
13786         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13787         (FieldBase.HasFieldInitializer): New public property.
13788         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13789         returns the field initializer and makes sure it is only resolved once.
13790         (TypeContainer.EmitFieldInitializers): Call
13791         FieldBase.GetInitializerExpression to get the initializer, this ensures
13792         that it isn't resolved multiple times.
13793
13794         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13795         the resolving process (SimpleName/MemberLookup) that we're currently
13796         emitting a field initializer (which must not access any instance members,
13797         this is an error CS0236).
13798
13799         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13800         argument, if the `IsFieldInitializer' flag is set, we must report and
13801         error CS0236 and not an error CS0120.   
13802
13803 2002-08-07  Martin Baulig  <martin@gnome.org>
13804
13805         * ecore.cs (IMemberExpr): New public interface.
13806         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13807         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13808         if the expression is an IMemberExpr.
13809
13810         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13811         to be null, implicitly default to `this' if we're non-static in
13812         this case.  Simplified the code a lot by using the new IMemberExpr
13813         interface.  Also fixed bug #28176 here.
13814
13815 2002-08-06  Martin Baulig  <martin@gnome.org>
13816
13817         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13818         ParameterReferences during semantic analysis so that we can do a
13819         type-only search when resolving Cast, TypeOf and SizeOf.
13820         (block): Pass the `current_local_parameters' to the Block's
13821         constructor.
13822
13823         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13824         argument to the constructor.
13825         (ConstructorInitializer.Resolve): Create a temporary implicit
13826         block with the parameters.
13827
13828         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13829         references here if we aren't doing a type-only search.
13830
13831         * statement.cs (Block): Added constructor which takes a
13832         `Parameters parameters' argument.
13833         (Block.Parameters): New public property.
13834
13835         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13836         to `Parameters' and made it public readonly.
13837
13838 2002-08-06  Martin Baulig  <martin@gnome.org>
13839
13840         * ecore.cs (Expression.Warning): Made this public as well.
13841
13842         * report.cs (Report.Debug): Print the contents of collections.
13843
13844 2002-08-06  Martin Baulig  <martin@gnome.org>
13845
13846         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13847         used to tell Resolve() which kinds of expressions it may return.
13848         (Expression.Resolve): Added overloaded version of this method which
13849         takes a `ResolveFlags flags' argument.  This can be used to tell
13850         Resolve() which kinds of expressions it may return.  Reports a
13851         CS0118 on error.
13852         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13853         ResolveFlags.SimpleName.
13854         (Expression.Error118): Added overloaded version of this method which
13855         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13856         which kinds of expressions are allowed.
13857
13858         * expression.cs (Argument.ResolveMethodGroup): New public method.
13859         Resolves an argument, but allows a MethodGroup to be returned.
13860         This is used when invoking a delegate.
13861
13862         * TODO: Updated a bit.
13863
13864 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13865
13866         Fixed compilation with csc.
13867
13868         * ecore.cs: Expression.Error made public. Is this correct? Should
13869         Warning be made public too?
13870
13871         * expression.cs: use ea.Location instead of ea.loc.
13872         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13873
13874 2002-08-06  Martin Baulig  <martin@gnome.org>
13875
13876         * ecore.cs (Expression.loc): Moved the location here instead of
13877         duplicating it in all derived classes.
13878         (Expression.Location): New public property.
13879         (Expression.Error, Expression.Warning): Made them non-static and
13880         removed the location argument.
13881         (Expression.Warning): Added overloaded version which takes an
13882         `int level' argument.
13883         (Expression.Error118): Make this non-static and removed the
13884         expression and location arguments.
13885         (TypeExpr): Added location argument to the constructor.
13886
13887         * expression.cs (StaticCallExpr): Added location argument to
13888         the constructor.
13889         (Indirection, PointerArithmetic): Likewise.
13890         (CheckedExpr, UnCheckedExpr): Likewise.
13891         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13892         (StringPtr): Likewise.
13893
13894
13895 2002-08-05  Martin Baulig  <martin@gnome.org>
13896
13897         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13898
13899         * assign.cs (Assign.DoResolve): Check whether the source
13900         expression is a value or variable.
13901
13902         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13903         while resolving the corresponding blocks.
13904
13905         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13906         an error, don't silently return null.
13907
13908         * statement.cs (Block.AddVariable): Do the error reporting here
13909         and distinguish between CS0128 and CS0136.
13910         (Block.DoResolve): Report all unused labels (warning CS0164).
13911         (LabeledStatement): Pass the location to the constructor.
13912         (LabeledStatement.HasBeenReferenced): New property.
13913         (LabeledStatement.Resolve): Set it to true here.
13914
13915         * statement.cs (Return.Emit): Return success even after reporting
13916         a type mismatch error (CS0126 or CS0127), this is what csc does and
13917         it avoids confusing the users with any consecutive errors.
13918
13919 2002-08-05  Martin Baulig  <martin@gnome.org>
13920
13921         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13922
13923         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13924
13925         * expression.cs (MemberAccess.DoResolve): Silently return if an
13926         error has already been reported.
13927
13928         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13929         error has already been reported.
13930
13931 2002-08-05  Martin Baulig  <martin@gnome.org>
13932
13933         * statement.cs (UsageVector): Only initialize the `parameters'
13934         vector if we actually have any "out" parameters.
13935
13936 2002-08-05  Martin Baulig  <martin@gnome.org>
13937
13938         * expression.cs (Binary.ResolveOperator): When combining delegates,
13939         they must have the same type.
13940
13941 2002-08-05  Martin Baulig  <martin@gnome.org>
13942
13943         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13944         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13945         work with the ms runtime and we also don't need it: if we're a
13946         PropertyBuilder and not in the `indexer_arguments' hash, then we
13947         are a property and not an indexer.
13948
13949         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13950         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13951         since the latter one doesn't work with the ms runtime.
13952
13953 2002-08-03  Martin Baulig  <martin@gnome.org>
13954
13955         Fixed bugs #27998 and #22735.
13956
13957         * class.cs (Method.IsOperator): New public field.
13958         (Method.CheckBase): Report CS0111 if there's already a method
13959         with the same parameters in the current class.  Report CS0508 when
13960         attempting to change the return type of an inherited method.
13961         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13962         and it's not marked abstract or extern.
13963         (PropertyBase): New abstract base class for Property and Indexer.
13964         (PropertyBase.CheckBase): Moved here from Property and made it work
13965         for indexers.
13966         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13967         the same so we can reuse it there.
13968         (Property, Indexer): Derive from PropertyBase.
13969         (MethodSignature.inheritable_property_signature_filter): New delegate
13970         to find properties and indexers.
13971
13972         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13973         argument and improved error reporting.
13974
13975         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13976         EmptyReadOnlyParameters and made it a property.
13977
13978         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13979         version of this method which takes a `PropertyInfo indexer'.
13980         (TypeManager.RegisterIndexer): New method.
13981
13982         * class.cs: Added myself as author of this file :-)
13983
13984 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13985
13986         * class.cs: fixed compilation on windoze.
13987
13988 2002-08-03  Martin Baulig  <martin@gnome.org>
13989
13990         * interface.cs (Interface.GetInterfaceBases): Check whether all
13991         base interfaces are at least as accessible than the current one.
13992
13993         * class.cs (TypeContainer.GetClassBases): Check whether base types
13994         are at least as accessible than the current type.
13995         (TypeContainer.AsAccessible): Implemented and made non-static.
13996         (MemberBase.CheckParameters): Report errors if the accessibility
13997         checks fail.
13998
13999         * delegate.cs (Delegate.Delegate): The default visibility is
14000         internal for top-level types and private for nested types.
14001         (Delegate.Define): Report errors if the accessibility checks fail.
14002
14003         * enum.cs (Enum.Enum): The default visibility is internal for
14004         top-level types and private for nested types.
14005         (Enum.DefineType): Compute the correct visibility.
14006
14007         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14008         function which takes a `bool is_toplevel' instead of a TypeContainer.
14009
14010         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14011         builtin type.
14012
14013 2002-08-02  Martin Baulig  <martin@gnome.org>
14014
14015         * expression.cs (LocalVariableReferenc): Added constructor which
14016         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14017         (LocalVariableReference.IsReadOnly): New property.
14018         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14019         variable is readonly, use our own readonly flag to do this; you can
14020         use the new constructor to get a writable reference to a read-only
14021         variable.
14022
14023         * cs-parser.jay (foreach_statement, using_statement): Get a writable
14024         reference to the local variable.
14025
14026 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
14027
14028         * rootcontext.cs (ResolveCore): Also include System.Exception
14029
14030         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14031         we reach an EmptyStatement.
14032
14033         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14034         is also fine.
14035
14036         * expression.cs (Binary.ResolveOperator): Check error result in
14037         two places.
14038
14039         use brtrue/brfalse directly and avoid compares to null.
14040
14041 2002-08-02  Martin Baulig  <martin@gnome.org>
14042
14043         * class.cs (TypeContainer.Define): Define all nested interfaces here.
14044         Fixes bug #28407, added test-155.cs.
14045
14046 2002-08-01  Martin Baulig  <martin@gnome.org>
14047
14048         * class.cs (Event.EmitDefaultMethod): Make this work with static
14049         events.  Fixes #28311, added verify-3.cs.
14050
14051 2002-08-01  Martin Baulig  <martin@gnome.org>
14052
14053         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14054         `is_disposable' fields.
14055         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14056         `hm.is_disposable' if we're using the collection pattern.
14057         (Foreach.EmitCollectionForeach): Use the correct type for the
14058         enumerator's local variable, only emit the try/finally block if
14059         necessary (fixes #27713).
14060
14061 2002-08-01  Martin Baulig  <martin@gnome.org>
14062
14063         * ecore.cs (Expression.report118): Renamed to Error118 and made
14064         it public static.
14065
14066         * statement.cs (Throw.Resolve): Check whether the expression is of
14067         the correct type (CS0118) and whether the type derives from
14068         System.Exception (CS0155).
14069         (Catch.Resolve): New method.  Do the type lookup here and check
14070         whether it derives from System.Exception (CS0155).
14071         (Catch.CatchType, Catch.IsGeneral): New public properties.
14072
14073         * typemanager.cs (TypeManager.exception_type): Added.
14074
14075 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
14076
14077         * driver.cs: Updated About function.
14078
14079 2002-07-31  Martin Baulig  <martin@gnome.org>
14080
14081         Implemented Control Flow Analysis.
14082
14083         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14084         (EmitContext.CurrentBranching): Added.
14085         (EmitContext.StartFlowBranching): Added.
14086         (EmitContext.EndFlowBranching): Added.
14087         (EmitContext.KillFlowBranching): Added.
14088         (EmitContext.IsVariableAssigned): Added.
14089         (EmitContext.SetVariableAssigned): Added.
14090         (EmitContext.IsParameterAssigned): Added.
14091         (EmitContext.SetParameterAssigned): Added.
14092         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14093         Added control flow analysis stuff here.
14094
14095         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14096         resolve the expression as lvalue.
14097         (LocalVariableReference.DoResolve): Check whether the variable has
14098         already been assigned.
14099         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14100         the parameter as assigned here.
14101         (ParameterReference.DoResolve): Check whether the parameter has already
14102         been assigned.
14103         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14104         expression as lvalue.
14105
14106         * statement.cs (FlowBranching): New class for the flow analysis code.
14107         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14108         (LabeledStatement.IsDefined): New public property.
14109         (LabeledStatement.AddUsageVector): New public method to tell flow
14110         analyis that the label may be reached via a forward jump.
14111         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14112         flow analysis.
14113         (VariableInfo.Number): New public field.  This is used by flow analysis
14114         to number all locals of a block.
14115         (Block.CountVariables): New public property.  This is the number of
14116         local variables in this block (including the locals from all parent
14117         blocks).
14118         (Block.EmitMeta): Number all the variables.
14119
14120         * statement.cs: Added flow analysis support to all classes.
14121
14122 2002-07-31  Martin Baulig  <martin@gnome.org>
14123
14124         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14125         To get debugging messages, compile mcs with /define:MCS_DEBUG and
14126         then use this argument.
14127
14128         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14129
14130         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14131         use this to specify /define options.
14132
14133 2002-07-29  Martin Baulig  <martin@gnome.org>
14134
14135         * statement.cs (Fixed): Moved all code that does variable lookups
14136         and resolvings from Emit to Resolve.
14137
14138         * statement.cs (For): Moved all code that does variable lookups
14139         and resolvings from Emit to Resolve.
14140
14141         * statement.cs (Using): Moved all code that does variable lookups
14142         and resolvings from Emit to Resolve.
14143
14144 2002-07-29  Martin Baulig  <martin@gnome.org>
14145
14146         * attribute.cs (Attribute.Resolve): Explicitly catch a
14147         System.NullReferenceException when creating the
14148         CustromAttributeBuilder and report a different warning message.
14149
14150 2002-07-29  Martin Baulig  <martin@gnome.org>
14151
14152         * support.cs (ParameterData.ParameterName): Added method to
14153         get the name of a parameter.
14154
14155         * typemanager.cs (TypeManager.IsValueType): New public method.
14156
14157 2002-07-29  Martin Baulig  <martin@gnome.org>
14158
14159         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
14160         is a flag which specifies that it's either ref or out.
14161         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14162         the out parameter to `out Parameter.Modifier mod', also set the
14163         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14164
14165         * support.cs (InternalParameters.ParameterModifier): Distinguish
14166         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14167         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14168
14169         * expression.cs (Argument.GetParameterModifier): Distinguish
14170         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14171         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14172
14173 2002-07-29  Martin Baulig  <martin@gnome.org>
14174
14175         * expression.cs (ParameterReference.ParameterReference): Added
14176         `Location loc' argument to the constructor.
14177
14178         * cs-parser.jay: Pass location to ParameterReference.
14179
14180 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
14181
14182         * statement.cs (Try): Initialize the location.
14183
14184         * cs-parser.jay: pass location to Try.
14185
14186         * expression.cs (Unary.Reduce): Change the prototype to return
14187         whether a constant fold could be performed or not.  The result is
14188         returned in an out parameters.  In the case of Indirection and
14189         AddressOf, we want to perform the full tests.
14190
14191 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
14192
14193         * statement.cs (Statement.Emit): Flag dead code.
14194
14195 2002-07-27  Andrew Birkett  <andy@nobugs.org>
14196
14197         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14198
14199 2002-07-27  Martin Baulig  <martin@gnome.org>
14200
14201         * class.cs (MethodData.Define): Put back call to
14202         TypeManager.AddMethod(), accidentally commented this out.
14203
14204         * report.cs (Debug): New public method to print debugging information,
14205         this is `[Conditional ("DEBUG")]'.
14206
14207 2002-07-26  Martin Baulig  <martin@gnome.org>
14208
14209         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14210         (switch_statement): Push the current_block to the switch_stack and
14211         pop it again when we're done with the switch.
14212         (switch_section): The new block is a child of the current_block.
14213         Fixes bug #24007, added test-152.cs.
14214
14215 2002-07-27  Martin Baulig  <martin@gnome.org>
14216
14217         * expression.cs (Invocation.EmitArguments): When calling a varargs
14218         function with only its fixed arguments, we need to pass an empty
14219         array.
14220
14221 2002-07-27  Martin Baulig  <martin@gnome.org>
14222
14223         Mono 0.13 has been released.
14224
14225 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
14226
14227         * driver.cs: Rename --resource to --linkres, because that is what
14228         we do currently, we dont support --resource yet.
14229
14230         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14231
14232 2002-07-25  Martin Baulig  <martin@gnome.org>
14233
14234         * class.cs (MethodData): New public class.  This is a `method builder'
14235         class for a method or one accessor of a Property/Indexer/Event.
14236         (MethodData.GetMethodFlags): Moved here from MemberBase.
14237         (MethodData.ApplyAttributes): Likewise.
14238         (MethodData.ApplyObsoleteAttribute): Likewise.
14239         (MethodData.ApplyConditionalAttribute): Likewise.
14240         (MethodData.ApplyDllImportAttribute): Likewise.
14241         (MethodData.CheckAbstractAndExternal): Likewise.
14242         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14243         (MethodData.Emit): Formerly known as Method.Emit().
14244         (MemberBase): Moved everything which was specific to a single
14245         accessor/method to MethodData.
14246         (Method): Create a new MethodData and call Define() and Emit() on it.
14247         (Property, Indexer, Event): Create a new MethodData objects for each
14248         accessor and call Define() and Emit() on them.
14249
14250 2002-07-25  Martin Baulig  <martin@gnome.org>
14251
14252         Made MethodCore derive from MemberBase to reuse the code from there.
14253         MemberBase now also checks for attributes.
14254
14255         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14256         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14257         as virtual.
14258         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14259         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14260         (MemberBase.ApplyAttributes): New virtual method; applies the
14261         attributes to a method or accessor.
14262         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14263         (MemberBase.ApplyConditionalAttribute): Likewise.
14264         (MemberBase.ApplyDllImportAttribute): Likewise.
14265         (MemberBase.CheckAbstractAndExternal): Likewise.
14266         (MethodCore.ParameterTypes): This is now a property instead of a
14267         method, it's initialized from DoDefineParameters().
14268         (MethodCore.ParameterInfo): Removed the set accessor.
14269         (MethodCore.DoDefineParameters): New protected virtual method to
14270         initialize ParameterTypes and ParameterInfo.
14271         (Method.GetReturnType): We can now simply return the MemberType.
14272         (Method.GetMethodFlags): Override the MemberBase version and add
14273         the conditional flags.
14274         (Method.CheckBase): Moved some code from Define() here, call
14275         DoDefineParameters() here.
14276         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14277         here to avoid some larger code duplication.
14278         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14279         ensure that abstract and external accessors don't declare a body.
14280
14281         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14282         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14283         lookup in the attribute's parent classes, so we need to abort as soon
14284         as we found the first match.
14285         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14286         the attribute has no arguments.
14287
14288         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14289         of a Method.
14290
14291 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14292
14293         * cs-parser.jay: reverted previous patch.
14294
14295 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14296
14297         * cs-parser.jay: fixed bug #22119.
14298
14299 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14300
14301         * attribute.cs: fixed compilation. The error was:
14302         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14303         be assigned to before control leaves the current method."
14304         [FIXME:  Filed as bug #28186: MCS must report this error.]
14305
14306 2002-07-25  Martin Baulig  <martin@gnome.org>
14307
14308         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14309         method to pull the condition name ouf of a Conditional attribute.
14310         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14311         the obsolete message and error flag out of an Obsolete attribute.
14312
14313         * class.cs (Method.GetMethodFlags): New public method to get the
14314         TypeManager.MethodFlags for this method.
14315         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14316         private methods.
14317         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14318         if we're overriding a virtual function, set the new private variable
14319         `parent_method'; call the new TypeManager.AddMethod().
14320
14321         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14322         the MethodBuilder and the Method in a PtrHashtable.
14323         (TypeManager.builder_to_method): Added for this purpose.
14324         (TypeManager.MethodFlags): Added IsObsoleteError.
14325         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14326         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14327         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14328         the message from the attribute.
14329
14330 2002-07-24  Martin Baulig  <martin@gnome.org>
14331
14332         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14333         preprocessor directives, ensure that the argument to #define/#undef is
14334         exactly one identifier and that it's actually an identifier.
14335
14336         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14337         did not work ....
14338
14339 2002-07-24  Martin Baulig  <martin@gnome.org>
14340
14341         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14342         initialize it to TypeManager.object_type in the constructor.
14343         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14344         of the `hm.get_current' method if we're using the collection pattern.
14345         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14346         for the explicit conversion to make it work when we're using the collection
14347         pattern and the `Current' property has a different return type than `object'.
14348         Fixes #27713.
14349
14350 2002-07-24  Martin Baulig  <martin@gnome.org>
14351
14352         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14353         does not match, but don't report any errors.  This method is called in
14354         order for all methods in a MethodGroupExpr until a matching method is
14355         found, so we don't want to bail out if the first method doesn't match.
14356         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14357         matches, report the 123.  Fixes #28070.
14358
14359 2002-07-24  Martin Baulig  <martin@gnome.org>
14360
14361         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14362         TypeManager.TypeToCoreType() to the top of the method so the
14363         following equality checks will work.  Fixes #28107.
14364
14365 2002-07-24  Martin Baulig  <martin@gnome.org>
14366
14367         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14368         operand is of type uint, and the other operand is of type sbyte,
14369         short or int, the operands are converted to type long." -
14370         Actually do what this comment already told us.  Fixes bug #28106,
14371         added test-150.cs.
14372
14373 2002-07-24  Martin Baulig  <martin@gnome.org>
14374
14375         * class.cs (MethodBase): New abstract class.  This is now a base
14376         class for Property, Indexer and Event to avoid some code duplication
14377         in their Define() and DefineMethods() methods.
14378         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14379         generic methods for Define() and DefineMethods().
14380         (FieldBase): Derive from MemberBase, not MemberCore.
14381         (Property): Derive from MemberBase, not MemberCore.
14382         (Property.DefineMethod): Moved all the code from this method to the
14383         new MethodBase.DefineAccessor(), just call it with appropriate
14384         argumetnts.
14385         (Property.Define): Call the new Property.DoDefine(), this does some
14386         sanity checks and we don't need to duplicate the code everywhere.
14387         (Event): Derive from MemberBase, not MemberCore.
14388         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14389         accessors, this will also make them work with interface events.
14390         (Indexer): Derive from MemberBase, not MemberCore.
14391         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14392         (Indexer.Define): Use the new MethodBase functions.
14393
14394         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14395         argument to the constructor.
14396         (Interface.FindMembers): Added support for interface events.
14397         (Interface.PopluateEvent): Implemented.
14398
14399         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14400
14401 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14402
14403         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14404         but this is required to check for a method name being the same as
14405         the containing class.  
14406
14407         Handle this now.
14408
14409 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14410
14411         * interface.cs: initialize variable.
14412
14413 2002-07-23  Martin Baulig  <martin@gnome.org>
14414
14415         Implemented the IndexerName attribute in interfaces.
14416
14417         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14418         name if this is an explicit interface implementation.
14419         (Indexer.InterfaceIndexerName): New public variable.  If we're
14420         implementing an interface indexer, this is the IndexerName in that
14421         interface.  Otherwise, it's the IndexerName.
14422         (Indexer.DefineMethod): If we're implementing interface indexer,
14423         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14424         and Pending.ImplementIndexer methods.
14425         (Indexer.Define): Also define the PropertyBuilder if we're
14426         implementing an interface indexer and this is neither an explicit
14427         interface implementation nor do the IndexerName match the one in
14428         the interface.
14429
14430         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14431         If a method is defined here, then we always need to create a proxy
14432         for it.  This is used when implementing interface indexers.
14433         (Pending.IsInterfaceIndexer): New public method.
14434         (Pending.ImplementIndexer): New public method.
14435         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14436         This is used when implementing interface indexers to define a proxy
14437         if necessary.
14438         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14439         define a proxy if necessary.
14440
14441         * interface.cs (Interface.IndexerName): New public variable.
14442         (Interface.PopulateIndexer): Set the IndexerName.
14443         (Interface.DefineIndexers): New private method.  Populate all the
14444         indexers and make sure their IndexerNames match.
14445
14446         * typemanager.cs (IndexerPropertyName): Added support for interface
14447         indexers.
14448
14449 2002-07-22  Martin Baulig  <martin@gnome.org>
14450
14451         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14452         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14453         ret if HasReturnLabel.
14454         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14455         variables.
14456
14457         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14458         and set the ec.LoopBeginTryCatchLevel.
14459         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14460         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14461         the current ec.TryCatchLevel, the branch goes out of an exception
14462         block.  In this case, we need to use Leave and not Br.
14463
14464 2002-07-22  Martin Baulig  <martin@gnome.org>
14465
14466         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14467         block unless the block does not always return or it is contained in
14468         another try { ... } catch { ... } block.  Fixes bug #26506.
14469         Added verify-1.cs to the test suite.
14470
14471 2002-07-22  Martin Baulig  <martin@gnome.org>
14472
14473         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14474         then we do not always return.  Fixes bug #24985.
14475
14476 2002-07-22  Martin Baulig  <martin@gnome.org>
14477
14478         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14479         lookup on a per-class level; ie. walk up the class hierarchy until we
14480         found at least one applicable method, then choose the best among them.
14481         Fixes bug #24463 and test-29.cs.
14482
14483 2002-07-22  Martin Baulig  <martin@gnome.org>
14484
14485         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14486         return types of the methods.  The return type is not part of the
14487         signature and we must not check it to make the `new' modifier work.
14488         Fixes bug #27999, also added test-147.cs.
14489         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14490
14491         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14492         on the method's return type.
14493
14494 2002-07-21  Martin Baulig  <martin@gnome.org>
14495
14496         * assign.cs: Make this work if the rightmost source is a constant and
14497         we need to do an implicit type conversion.  Also adding a few more tests
14498         to test-38.cs which should have caught this.
14499
14500         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14501         target in the makefile for this.  The makefile.gnu is primarily intended
14502         for end-users who don't want to debug the compiler.
14503
14504 2002-07-21  Martin Baulig  <martin@gnome.org>
14505
14506         * assign.cs: Improved the Assign class so it can now handle embedded
14507         assignments (X = Y = Z = something).  As a side-effect this'll now also
14508         consume less local variables.  test-38.cs now passes with MCS, added
14509         a few new test cases to that test.
14510
14511 2002-07-20  Martin Baulig  <martin@gnome.org>
14512
14513         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14514         instructions.  Fixes bug #27977, also added test-146.cs.
14515
14516 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14517
14518         * cs-tokenizer.cs: fixed getHex ().
14519
14520 2002-07-19  Martin Baulig  <martin@gnome.org>
14521
14522         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14523         not Type.GetType() to lookup the array type.  This is needed when
14524         we're constructing an array of a user-defined type.
14525         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14526         single-dimensional arrays, but also for single-dimensial arrays of
14527         type decimal.
14528
14529 2002-07-19  Martin Baulig  <martin@gnome.org>
14530
14531         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14532         this function is called, it's not allowed to share LocalBuilders
14533         among ILGenerators.
14534
14535 2002-07-19  Martin Baulig  <martin@gnome.org>
14536
14537         * expression.cs (Argument.Resolve): Report an error 118 when trying
14538         to pass a type as argument.
14539
14540 2002-07-18  Martin Baulig  <martin@gnome.org>
14541
14542         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14543         Conv_R_Un for the signed `long' type.
14544
14545 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14546
14547         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14548         `expr' for the temporary result, as that will fail if we do
14549         multiple resolves on the same expression.
14550
14551 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14552
14553         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14554         ec.TypeContainer for looking up aliases. 
14555
14556         * class.cs (TypeContainer): Remove LookupAlias from here.
14557
14558         * decl.cs (DeclSpace); Move here.
14559
14560 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14561
14562         * class.cs (FindMembers): Only call filter if the constructor
14563         bulider is not null.
14564
14565         Also handle delegates in `NestedTypes' now.  Now we will perform
14566         type lookups using the standard resolution process.  This also
14567         fixes a bug.
14568
14569         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14570         This uses Expressions (the limited kind that can be parsed by the
14571         tree) instead of strings.
14572
14573         * expression.cs (ComposedCast.ToString): Implement, used to flag
14574         errors since now we have to render expressions.
14575
14576         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14577         FormArrayType. 
14578
14579         * ecore.cs (SimpleName.ToString): ditto.
14580
14581         * cs-parser.jay: Instead of using strings to assemble types, use
14582         Expressions to assemble the type (using SimpleName, ComposedCast,
14583         MemberAccess).  This should fix the type lookups in declarations,
14584         because we were using a different code path for this.
14585
14586         * statement.cs (Block.Resolve): Continue processing statements
14587         even when there is an error.
14588
14589 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14590
14591         * class.cs (Event.Define): Also remove the `remove' method from
14592         the list of pending items.
14593
14594         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14595         generate more compact code. 
14596
14597 2002-07-17  Martin Baulig  <martin@gnome.org>
14598
14599         * const.cs (Const.LookupConstantValue): Add support for constant
14600         `unchecked' and `checked' expressions.
14601         Also adding test case test-140.cs for this.
14602
14603 2002-07-17  Martin Baulig  <martin@gnome.org>
14604
14605         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14606         check whether mi.ReturnType implements the IEnumerator interface; the
14607         `==' and the IsAssignableFrom() will fail in this situation.
14608
14609 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14610
14611         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14612         here too.
14613
14614 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14615
14616         * expression.cs: fixed bug #27811.
14617
14618 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14619
14620         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14621         Molaro: when we are a ref, the value already contains a pointer
14622         value, do not take the address of it.
14623
14624 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14625         * removed mb-parser.jay and mb-tokenizer.cs
14626
14627 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14628
14629         * expression.cs: check against the building corlib void type.
14630
14631 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14632
14633         * ecore.cs: fix for valuetype static readonly fields: when 
14634         initializing them, we need their address, not the address of a copy.
14635
14636 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14637
14638         * typemanager.cs: register also enum_type in corlib.
14639
14640 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14641
14642         * class.cs: allow calling this (but not base) initializers in structs.
14643
14644 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14645
14646         * ecore.cs: make sure we compare against the building base types
14647         in GetTypeSize ().
14648
14649 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14650
14651         * typemanager.cs: fix TypeToCoreType() to handle void and object
14652         (corlib gets no more typerefs after this change).
14653
14654 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14655
14656         * expression.cs (ArrayCreation.EmitArrayArguments): use
14657         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14658
14659         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14660         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14661         array indexes, the runtime actually forbids them.
14662
14663         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14664         for array arguments here.
14665
14666         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14667         instead of the default for ValueTypes.
14668
14669         (New.DoEmit): Use IsValueType instead of
14670         IsSubclassOf (value_type)
14671         (New.DoResolve): ditto.
14672         (Invocation.EmitCall): ditto.
14673
14674         * assign.cs (Assign): ditto.
14675
14676         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14677         Statements *are* currently doing part of their resolution during
14678         Emit.  
14679
14680         Expressions do always resolve during resolve, but statements are
14681         only required to propagate resolution to their children.
14682
14683 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14684
14685         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14686
14687         (LoadAssembly): Do not add the dll if it is already specified
14688
14689         (MainDriver): Add the System directory to the link path at the end,
14690         after all the other -L arguments. 
14691
14692         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14693         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14694         ldelem.u1) and using the opposite for sbytes.
14695
14696         This fixes Digger, and we can finally run it.
14697
14698         * driver.cs (UnixParseOption): Move the option parsing here.  
14699         (CSCParseOption): Implement CSC-like parsing of options.
14700
14701         We now support both modes of operation, the old Unix way, and the
14702         new CSC-like way.  This should help those who wanted to make cross
14703         platform makefiles.
14704
14705         The only thing broken is that /r:, /reference: and /lib: are not
14706         implemented, because I want to make those have the same semantics
14707         as the CSC compiler has, and kill once and for all the confussion
14708         around this.   Will be doing this tomorrow.
14709
14710         * statement.cs (Unsafe.Resolve): The state is checked during
14711         resolve, not emit, so we have to set the flags for IsUnsfe here.
14712
14713 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14714
14715         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14716         not catch the Error_ObjectRefRequired in SimpleName (as it is
14717         possible to have a class/instance variable name that later gets
14718         deambiguated), we have to check this here.      
14719
14720 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14721
14722         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14723         make static and put into Expression.
14724
14725         (Event.Define): Register the private field of the event with the 
14726         TypeManager so that GetFieldFromEvent can get at it.
14727
14728         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14729         keep track of the private field associated with an event which
14730         has no accessors.
14731
14732         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14733         private field.
14734
14735         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14736
14737 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14738
14739         * expression.cs (Binary.EmitBranchable): this routine emits the
14740         Binary expression in a branchable context.  This basically means:
14741         we need to branch somewhere, not just get the value on the stack.
14742
14743         This works together with Statement.EmitBoolExpression.
14744
14745         * statement.cs (Statement.EmitBoolExpression): Use
14746         EmitBranchable. 
14747
14748 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14749
14750         * statement.cs (For): Reduce the number of jumps in loops.
14751
14752         (For): Implement loop inversion for the For statement.
14753
14754         (Break): We can be breaking out of a Try/Catch controlled section
14755         (foreach might have an implicit try/catch clause), so we need to
14756         use Leave instead of Br.
14757
14758         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14759         now).  If the instace expression supports IMemoryLocation, we use
14760         the AddressOf method from the IMemoryLocation to extract the
14761         address instead of emitting the instance.
14762
14763         This showed up with `This', as we were emitting the instance
14764         always (Emit) instead of the Address of This.  Particularly
14765         interesting when This is a value type, as we dont want the Emit
14766         effect (which was to load the object).
14767
14768 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14769
14770         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14771
14772         * statement.cs (Checked): Set the CheckedState during the resolve
14773         process too, as the ConvCast operations track the checked state on
14774         the resolve process, and not emit.
14775
14776         * cs-parser.jay (namespace_member_declaration): Flag that we have
14777         found a declaration when we do.  This is used to flag error 1529
14778
14779         * driver.cs: Report ok when we display the help only.
14780
14781 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14782
14783         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14784
14785 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14786
14787         * cs-tokenizer.cs (define): We also have to track locally the
14788         defines.  AllDefines is just used for the Conditional Attribute,
14789         but we also need the local defines for the current source code. 
14790
14791 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14792
14793         * statement.cs (While, For, Do): These loops can exit through a
14794         Break statement, use this information to tell whether the
14795         statement is the last piece of code.
14796
14797         (Break): Flag that we break.
14798
14799         * codegen.cs (EmitContexts): New `Breaks' state variable.
14800
14801 2002-07-03  Martin Baulig  <martin@gnome.org>
14802
14803         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14804         modifiers in method declarations in structs.  Otherwise, you won't
14805         be able to override things like Object.Equals().
14806
14807 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14808
14809         * class.cs (Method, Property, Indexer): Do not allow the public
14810         modifier to be used in explicit interface implementations.
14811
14812         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14813         override modifiers in method declarations in structs
14814
14815 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14816
14817         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14818         integer or real overflow, report an error
14819
14820 2002-07-02  Martin Baulig  <martin@gnome.org>
14821
14822         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14823         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14824         to tell the runtime about our newly created System.Object and
14825         System.ValueType types.
14826
14827 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14828
14829         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14830         struct instead of Ldarg/Starg.
14831
14832 2002-07-02  Martin Baulig  <martin@gnome.org>
14833
14834         * expression.cs (Indirection.Indirection): Call
14835         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14836
14837 2002-07-02  Martin Baulig  <martin@gnome.org>
14838
14839         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14840         ValueType, call TypeManager.TypeToCoreType() on it.
14841         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14842         the OpCodes.Newarr argument.
14843
14844 2002-07-02  Martin Baulig  <martin@gnome.org>
14845
14846         * expression.cs (Invocation.EmitCall): When compiling corlib,
14847         replace all calls to the system's System.Array type to calls to
14848         the newly created one.
14849
14850         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14851         System.Array methods.
14852         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14853         from the system's System.Array type which must be replaced.
14854
14855 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14856
14857         * typemanager.cs: load unverifiable_code_ctor so we can build
14858         corlib using the correct type. Avoid using GetTypeCode() with
14859         TypeBuilders.
14860         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14861         TypeManager.object_type to allow building corlib.
14862
14863 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14864
14865         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14866
14867 2002-07-01  Martin Baulig  <martin@gnome.org>
14868
14869         * class.cs: Make the last change actually work, we need to check
14870         whether `ifaces != null' to avoid a crash.
14871
14872 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14873
14874         * class.cs: when we build structs without fields that implement
14875         interfaces, we need to add the interfaces separately, since there is
14876         no API to both set the size and add the interfaces at type creation
14877         time.
14878
14879 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14880
14881         * expression.cs: the dimension arguments to the array constructors
14882         need to be converted if they are a long.
14883
14884 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14885
14886         * class.cs: don't emit ldarg.0 if there is no parent constructor
14887         (fixes showstopper for corlib).
14888
14889 2002-06-29  Martin Baulig  <martin@gnome.org>
14890
14891         MCS now compiles corlib on GNU/Linux :-)
14892
14893         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14894         ie. check for MethodImplOptions.InternalCall.
14895
14896         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14897         and TypeManager.attribute_type are null, so we must explicitly check
14898         whether parent is not null to find out whether it's an attribute type.
14899         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14900         and SetBuilder, not only if the property is neither abstract nor external.
14901         This is necessary to set the MethodImplOptions on the accessor methods.
14902         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14903         SetBuilder, see Property.Emit().
14904
14905         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14906         populate "System.Object", "System.ValueType" and "System.Attribute" since
14907         they've already been populated from BootCorlib_PopulateCoreTypes().
14908
14909 2002-06-29  Martin Baulig  <martin@gnome.org>
14910
14911         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14912         is the NullLiteral, we also need to make sure that target_type is not
14913         an enum type.   
14914
14915 2002-06-29  Martin Baulig  <martin@gnome.org>
14916
14917         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14918         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14919         before calling BootstrapCorlib_ResolveDelegate ().
14920
14921 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14922
14923         * statement.cs: fixed build-breaker. All tests passed ok.
14924
14925 2002-06-27  Martin Baulig  <martin@gnome.org>
14926
14927         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14928         for System.Decimal when compiling corlib.
14929
14930 2002-06-27  Martin Baulig  <martin@gnome.org>
14931
14932         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14933         switch blocks which contain nothing but a default clause.
14934
14935 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14936
14937        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14938
14939 2002-06-27  Martin Baulig  <martin@gnome.org>
14940
14941         * ecore.cs (PropertyExpr.PropertyExpr): Call
14942         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14943
14944         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14945         is already a TypeBuilder.
14946
14947 2002-06-27  Martin Baulig  <martin@gnome.org>
14948
14949         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14950         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14951         the "from an array-type to System.Array" case.  This makes it work
14952         when compiling corlib.
14953
14954 2002-06-27  Martin Baulig  <martin@gnome.org>
14955
14956         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14957         non-static PropertyExpr, set its InstanceExpression.  This makes
14958         the `ICollection.Count' property work in System/Array.cs.
14959
14960 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14961
14962         * driver.cs: Made error handling more consistent.  Errors now
14963         tracked by Report class, so many methods which used to return int
14964         now return void.  Main() now prints success/failure and 
14965         errors/warnings message.
14966
14967         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14968         the magic number return values (123 and 124).  Now, if the
14969         expected error occurs, the compiler exits with success (exit value
14970         0).  If the compilation completes without seeing that particular
14971         error, the compiler exits with failure (exit value 1).  The
14972         makefile in mcs/errors has been changed to handle the new behaviour.
14973
14974         * report.cs: Made 'expected error' number a property and renamed
14975         it from 'Probe' to 'ExpectedError'.
14976
14977         * genericparser.cs: Removed error handling support, since it is
14978         now all done by Report class.
14979
14980         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14981         class, so parse() no longer returns an int.
14982
14983         * namespace.cs: Use Report.Error instead of GenericParser.error
14984
14985 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14986
14987         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14988         TypeContainer.AddOperator): At the front of the list put the
14989         explicit implementations, so they get resolved/defined first. 
14990
14991 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14992
14993         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14994         interface type is implemented by this TypeContainer.  Used during
14995         explicit interface implementation.
14996
14997         (Property.Define, Indexer.Define, Method.Define): Validate that
14998         the given interface in the explicit implementation is one of the
14999         base classes for the containing type.
15000
15001         Also if we are explicitly implementing an interface, but there is
15002         no match in the pending implementation table, report an error.
15003
15004         (Property.Define): Only define the property if we are
15005         not explicitly implementing a property from an interface.  Use the
15006         correct name also for those properties (the same CSC uses,
15007         although that is really not needed).
15008
15009         (Property.Emit): Do not emit attributes for explicitly implemented
15010         properties, as there is no TypeBuilder.
15011
15012         (Indexer.Emit): ditto.
15013
15014         Hiding then means that we do not really *implement* a pending
15015         implementation, which makes code fail.
15016
15017 2002-06-22  Martin Baulig  <martin@gnome.org>
15018
15019         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15020         the return value of Object.GetType().  [FIXME: we need to do this whenever
15021         we get a type back from the reflection library].
15022
15023 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15024
15025         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15026
15027 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
15028
15029         * attribute.cs: Return null if we can not look up the type.
15030
15031         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15032         the interface types found.
15033
15034         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15035         interface types found.
15036
15037         * typemanager.cs (GetInterfaces): Make this routine returns alll
15038         the interfaces and work around the lame differences between
15039         System.Type and System.Reflection.Emit.TypeBuilder in the results
15040         result for GetInterfaces.
15041
15042         (ExpandInterfaces): Given an array of interface types, expand and
15043         eliminate repeated ocurrences of an interface.  This expands in
15044         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15045         be IA, IB, IC.
15046
15047 2002-06-21  Martin Baulig  <martin@gnome.org>
15048
15049         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15050         on System.Enum.
15051
15052 2002-06-21  Martin Baulig  <martin@gnome.org>
15053
15054         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
15055         and called with one of the core types, return the corresponding typebuilder for
15056         that type.
15057
15058         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15059         element type.
15060
15061 2002-06-21  Martin Baulig  <martin@gnome.org>
15062
15063         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15064         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15065         (Expression.ConvertReferenceExplicit): Likewise.
15066
15067         * expression.cs (ElementAccess.DoResolve): Likewise.
15068         (ElementAccess.DoResolveLValue): Likewise.
15069
15070 2002-06-10  Martin Baulig  <martin@gnome.org>
15071
15072         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15073         add the "value" parameter to the parameter list.
15074
15075         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15076         to our caller.
15077
15078 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
15079
15080         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15081         the argument to an int, uint, long or ulong, per the spec.  Also
15082         catch negative constants in array creation.
15083
15084 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15085
15086         * class.cs: do not allow the same interface to appear twice in
15087         the definition list.
15088
15089 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15090
15091         * ecore.cs: don't use ldlen with System.Array.
15092
15093 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15094
15095         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15096
15097 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15098
15099         * modifiers.cs: produce correct field attributes for protected
15100         internal. Easy fix so miguel can work on ther harder stuff:-)
15101
15102 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
15103
15104         * pending.cs: New file.  Move the code from class.cs here.
15105         Support clearning the pending flag for all methods (when not doing
15106         explicit interface implementation).
15107
15108 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15109
15110         * rootcontext.cs: added a couple more types needed to bootstrap.
15111
15112 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
15113
15114         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15115         constructor in the type, instead of any constructor in the type
15116         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
15117         a bug in the Mono runtime when applying the params attribute). 
15118
15119 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
15120         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15121
15122 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
15123
15124         * expression.cs (Unary.ResolveOperator): Use TypeManager
15125         to resolve the type.
15126
15127 2002-06-13  Ravi Pratap  <ravi@ximian.com>
15128
15129         * cs-parser.jay (enum_member_declaration): Pass in the attributes
15130         attached.
15131
15132         * enum.cs (AddEnumMember): Add support to store the attributes associated 
15133         with each member too.
15134
15135         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15136         field builders too - this takes care of the enum member case.
15137
15138 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
15139
15140         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15141         address-of operator on both value types and pointers.
15142
15143 2002-06-10  Martin Baulig  <martin@gnome.org>
15144
15145         * interface.cs (Interface.PopulateIndexer): Add the indexer's
15146         PropertyBuilder to the `property_builders' list.
15147
15148         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15149         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15150         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
15151         find any indexers which are inherited from an interface.
15152
15153 2002-06-09  Martin Baulig  <martin@gnome.org>
15154
15155         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15156         the same type as the constant if necessary.  There's also a test-130.cs
15157         for this.
15158
15159         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15160
15161         * typemanager.cs (TypeManager.ChangeType): Previously known as
15162         Enum.ChangeEnumType().
15163
15164 2002-06-09  Martin Baulig  <martin@gnome.org>
15165
15166         * expression.cs (Cast.TryReduce): Added support for consts.
15167
15168 2002-06-08  Ravi Pratap  <ravi@ximian.com>
15169
15170         * class.cs (Accessor): Hold attributes information so we can pass
15171         it along.
15172
15173         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15174         Modify to pass in attributes attached to the methods.
15175
15176         (add_accessor_declaration, remove_accessor_declaration): Ditto.
15177
15178         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15179         to handle the Accessor kind :-)
15180
15181         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15182
15183 2002-06-08  Martin Baulig  <martin@gnome.org>
15184
15185         * expression.cs (Unary.TryReduceNegative): Added support for
15186         ULongConstants.
15187
15188 2002-06-08  Martin Baulig  <martin@gnome.org>
15189
15190         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15191         name can't be found in the `defined_names' - the caller will do a
15192         MemberLookup in this case and thus find methods in System.Enum
15193         such as Enum.IsDefined().
15194
15195 2002-06-08  Martin Baulig  <martin@gnome.org>
15196
15197         * enum.cs (Enum.ChangeEnumType): This is a custom version of
15198         Convert.ChangeType() which works with TypeBuilder created types.
15199         (Enum.LookupEnumValue, Enum.Define): Use it here.
15200
15201         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15202         `TypeBuilder.BaseType != null' check.
15203         (TypeContainer.FindMembers): Only lookup parent members if we
15204         actually have a parent.
15205         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15206         (ConstructorInitializer.Resolve): Likewise.
15207
15208         * interface.cs (Interface.FindMembers): Added
15209         `TypeBuilder.BaseType != null' check.
15210
15211         * rootcontext.cs (RootContext.ResolveCore): Added
15212         "System.Runtime.CompilerServices.IndexerNameAttribute" to
15213         classes_second_stage.
15214
15215         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15216         debug_type and trace_type when compiling with --nostdlib.       
15217
15218 2002-06-07  Martin Baulig  <martin@gnome.org>
15219
15220         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15221         (AddField): Set it to true when adding a non-static field.
15222         (DefineType): Use `have_nonstatic_fields' to find out whether we
15223         have non-static fields, not `Fields != null'.
15224
15225 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
15226
15227         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15228         dereferencing a null on the static-field code path)
15229
15230 2002-05-30  Martin Baulig  <martin@gnome.org>
15231
15232         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15233         to take command line arguments.  Use reflection to call the new
15234         custom `Initialize' function on the symbol writer and pass it the
15235         command line arguments.
15236
15237         * driver.cs (--debug-args): New command line argument to pass command
15238         line arguments to the symbol writer.
15239
15240 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
15241
15242         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15243         the target type for indexers and properties.  Thanks to Joe for
15244         catching this.
15245
15246 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15247
15248         * typemanager.cs (MethodFlags): returns the method flags
15249         (Obsolete/ShouldIgnore) that control warning emission and whether
15250         the invocation should be made, or ignored. 
15251
15252         * expression.cs (Invocation.Emit): Remove previous hack, we should
15253         not do this on matching a base type, we should do this based on an attribute
15254
15255         Only emit calls to System.Diagnostics.Debug and
15256         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15257         on the command line.
15258
15259         * rootcontext.cs: Global settings for tracing and debugging.
15260
15261         * cs-tokenizer.cs (define): New utility function to track
15262         defines.   Set the global settings for TRACE and DEBUG if found.
15263
15264 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15265
15266         * interface.cs (Populate*): Pass in the TypeContainer as well as
15267         the DeclSpace as parameters so that we can create EmitContexts and
15268         then use that to apply attributes etc.
15269
15270         (PopulateMethod, PopulateEvent, PopulateProperty)
15271         (PopulateIndexer): Apply attributes everywhere.
15272
15273         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15274         etc.
15275
15276         (ApplyAttributes): Update accordingly.
15277
15278         We now apply interface attributes for all members too.
15279
15280 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15281
15282         * class.cs (Indexer.Define); Correctly check if we are explicit
15283         implementation (instead of checking the Name for a ".", we
15284         directly look up if the InterfaceType was specified).
15285
15286         Delay the creation of the PropertyBuilder.
15287
15288         Only create the PropertyBuilder if we are not an explicit
15289         interface implementation.   This means that explicit interface
15290         implementation members do not participate in regular function
15291         lookups, and hence fixes another major ambiguity problem in
15292         overload resolution (that was the visible effect).
15293
15294         (DefineMethod): Return whether we are doing an interface
15295         implementation. 
15296
15297         * typemanager.cs: Temporary hack until we get attributes in
15298         interfaces (Ravi is working on that) and we get IndexerName
15299         support in interfaces.
15300
15301         * interface.cs: Register the indexers as properties.
15302
15303         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15304         warning, I have verified that this is a bug in the .NET runtime
15305         (JavaScript suffers of the same problem).
15306
15307         * typemanager.cs (MemberLookup): When looking up members for
15308         interfaces, the parent of an interface is the implicit
15309         System.Object (so we succeed in searches of Object methods in an
15310         interface method invocation.  Example:  IEnumerable x;  x.ToString
15311         ()) 
15312
15313 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15314
15315         * class.cs (Event): Events should also register if they do
15316         implement the methods that an interface requires.
15317
15318         * typemanager.cs (MemberLookup); use the new GetInterfaces
15319         method. 
15320
15321         (GetInterfaces): The code used to lookup interfaces for a type is
15322         used in more than one place, factor it here. 
15323
15324         * driver.cs: Track the errors at the bottom of the file, we kept
15325         on going.
15326
15327         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15328         instance if the method we are calling is static!
15329
15330 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15331
15332         * attribute.cs (ApplyAttributes): Make this function filter out
15333         the IndexerName attribute (as that attribute in reality is never
15334         applied) and return the string constant for the IndexerName
15335         attribute. 
15336
15337         * class.cs (TypeContainer.Emit): Validate that all the indexers
15338         have the same IndexerName attribute, and if so, set the
15339         DefaultName attribute on the class. 
15340
15341         * typemanager.cs: The return value might contain other stuff (not
15342         only methods).  For instance, consider a method with an "Item"
15343         property and an Item method.
15344
15345         * class.cs: If there is a problem with the parameter types,
15346         return. 
15347
15348 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15349
15350         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15351         looks at user defined conversion after making a call to 
15352         StandardConversionExists - we need this for overload resolution.
15353
15354         * expression.cs : Update accordingly the various method calls.
15355
15356         This fixes 2 bugs filed against implicit user defined conversions 
15357
15358 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15359
15360         * statement.cs: Track the result of the assignment.
15361
15362 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15363
15364         * expression.cs (MemberAccess): Improved error reporting for
15365         inaccessible members.
15366
15367 2002-05-22  Martin Baulig  <martin@gnome.org>
15368
15369         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15370         itself with debugging support.
15371
15372 2002-05-22  Martin Baulig  <martin@gnome.org>
15373
15374         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15375         Removed, this isn't needed anymore.
15376
15377 2002-05-20  Martin Baulig  <martin@gnome.org>
15378
15379         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15380         be underlying type for an enum.
15381
15382 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15383
15384         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15385         that splits out the loading of just the core types.
15386
15387         * rootcontext.cs (ResolveCore): Split the struct resolution in
15388         two, so we can load the enumeration underlying types before any
15389         enums are used.
15390
15391         * expression.cs (Is): Bandaid until we fix properly Switch (see
15392         bug #24985 for details).
15393
15394         * typemanager.cs (ImplementsInterface): The hashtable will contain
15395         a null if there are no interfaces implemented.
15396
15397 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15398
15399         * cs-parser.jay (indexer_declarator): It is fine to have array
15400         parameters
15401
15402 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15403
15404         * typemanager.cs: (RegisterBuilder): New function used to register
15405         TypeBuilders that implement interfaces.  Since
15406         TypeBuilder.GetInterfaces (as usual) does not work with lame
15407         Reflection.Emit. 
15408         (AddUserType): register interfaces.
15409
15410         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15411         dealing with TypeBuilder.  Also, arrays are showing up as
15412         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15413         methods can not be invoked on them!
15414
15415         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15416         (ImplicitReferenceConversionExists): Split out from
15417         StandardConversionExists. 
15418
15419         * expression.cs (As): We were only implementing one of the three
15420         cases for the as operator.  We now implement them all.
15421         (Is): Implement the various other cases for Is as well.
15422
15423         * typemanager.cs (CACHE): New define used to control if we want or
15424         not the FindMembers cache.  Seems to have a negative impact on
15425         performance currently
15426
15427         (MemberLookup): Nested types have full acess to
15428         enclosing type members
15429
15430         Remove code that coped with instance/static returns for events, we
15431         now catch this in RealFindMembers.
15432
15433         (RealFindMembers): only perform static lookup if the instance
15434         lookup did not return a type or an event.  
15435
15436 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15437
15438         * assign.cs (CompoundAssign): We pass more semantic information
15439         now to Compound Assignments than we did before: now we have all
15440         the information at hand, and now we resolve the target *before* we
15441         do the expression expansion, which allows the "CacheValue" method
15442         to have the effect we intended (before, a [x] += 1 would generate
15443         two differen ArrayAccess expressions from the ElementAccess,
15444         during the resolution process).
15445
15446         (CompoundAssign.DoResolve): Resolve target and original_source here.
15447
15448 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15449
15450         * expression.cs (ArrayAccess): dropped debugging information. 
15451
15452         * typemanager.cs: Small bug fix: I was always returning i_members,
15453         instead of one of i_members or s_members (depending on which had
15454         the content).
15455
15456         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15457         method is invoked before any code generation takes place, and it
15458         is a mechanism to inform that the expression will be invoked more
15459         than once, and that the method should use temporary values to
15460         avoid having side effects
15461
15462         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15463
15464         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15465         implementation.
15466
15467         * expression.cs (Indirection, ArrayAccess): Add support for
15468         CacheTemporaries in these two bad boys. 
15469
15470         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15471         ldobj or ldind_ref.  
15472         (StoreFromPtr): Handle stobj as well.
15473
15474         * expression.cs (UnaryMutator): Share more code.
15475
15476         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15477         down: I was not tracking the Filter function as well, which
15478         was affecting the results of the cache.
15479
15480 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15481
15482         * attribute.cs: Remove the hack to handle the CharSet property on
15483         StructLayouts. 
15484
15485 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15486
15487         * attribute.cs (DoResolve): More uglyness, we now only try to
15488         resolve the attribute partially, to extract the CharSet
15489         information (only if we are a StructLayout attribute).  Otherwise 
15490
15491         (GetExtraTypeInfo): Add some code to conditionally kill in the
15492         future this.   I am more and more convinced that the .NET
15493         framework has special code to handle the attribute setting on
15494         certain elements.
15495
15496         * expression.cs (IsParamsMethodApplicable): Revert my previous
15497         foreach change here, it was wrong.
15498
15499 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15500
15501         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15502         (pp_expr): do not abort on unknown input, just return.
15503         (eval): abort if there are pending chars.
15504
15505         * attribute.cs (Attribute.Resolve): Positional parameters are
15506         optional.  Deal with that case.
15507
15508         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15509         the Ansi/Unicode/Auto information for the type.
15510
15511         (TypeContainer.DefineType): instantiate the EmitContext here, as
15512         we will be using it during the type definition (to resolve
15513         attributes) and during the emit phase.
15514
15515         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15516         to pull type information out of the attributes
15517
15518         (Attribute.Resolve): track the constructor builder, and allow for
15519         multiple invocations (structs and classes will use this).
15520
15521         * ecore.cs (MemberLookupFinal): new version with all the
15522         parameters customizable.
15523
15524         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15525         constructors.  Return if the result value is null (as the error
15526         would have been flagged already by MemberLookupFinal)
15527
15528         Do not allow instances of abstract classes or interfaces to be
15529         created.
15530
15531         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15532         We have to compare the assembly property here when dealing with
15533         FamANDAssem and Assembly access modifiers, because we might be
15534         creating an assembly from *modules* (that means that we are not
15535         getting TypeBuilders for types defined in other modules that are
15536         part of this assembly).
15537
15538         (Method.Emit): If the method is marked abstract and has a body,
15539         emit an error. 
15540
15541         (TypeContainer.DefineMembers): If both the defined member and the
15542         parent name match are methods, then do not emit any warnings: let
15543         the Method.Define routine take care of flagging warnings.  But if
15544         there is a mismatch (method overrides something else, or method is
15545         overriwritten by something, then emit warning).
15546
15547         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15548         set to null, this means `do not check for the return type on the
15549         signature'. 
15550
15551         (Method.Define): set the return type for the method signature to
15552         null, so that we get methods with the same name and parameters and
15553         different return types.  This is used to flag warning 114 (you are
15554         hiding a method, and you probably want to use the new/override
15555         keywords instead).
15556
15557         * typemanager.cs (MemberLookup): Implemented proper access
15558         control, closing a long standing set of bug reports.  The problem
15559         was that the Framework only has two bits: Public and NonPublic,
15560         and NonPublic includes private and protected methods, but we need
15561         to enforce the FamANDAssem, FamOrAssem and Family. 
15562
15563 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15564
15565         * statement.cs (GotoCase): Return true: Ammounts to giving up
15566         knowledge on whether we return or not, and letting the other case
15567         be responsible for it.
15568
15569 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15570
15571         * driver.cs: Do not load directories for each file processed, only
15572         do it if there is a pattern.
15573
15574         * ecore.cs: Report readonly assigns here as well, as we might have
15575         been resolved only by MemberAccess.
15576
15577         (SimpleName.SimpleNameResolve): Also be useful for LValue
15578         resolution.   We need this to propagate assign to local readonly variables
15579
15580         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15581         do not want to reuse potential criteria memory.
15582
15583         * class.cs (MyEventBuilder): Set reflected_type;
15584
15585         * ecore.cs (Constantify): Added support for constifying bools.
15586
15587         (RootContext.LookupType): Added a cache for values looked up in
15588         the declaration space.
15589
15590         * typemanager.cs (FindMembers): Now is a front-end to
15591         RealFindMembers, and provides a two-level hashtable-based cache to
15592         the request.  
15593
15594         15% performance improvement: from 22.5 to 19.2 seconds.
15595
15596         * expression.cs (IsParamsMethodApplicable): use foreach.
15597         (Invocation.DoResolve): ditto.
15598         (New.DoResolve): ditto.
15599         (ArrayCreation.DoResolve): ditto.
15600
15601         * ecore.cs (FindMostEncompassingType): use foreach.
15602
15603         * delegate.cs (NewDelegate.DoResolve): Use foreach
15604
15605         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15606         (RemoveMethods): use foreach.
15607
15608         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15609         nested foreach statements instead of for, and also break out of
15610         the inner loop once a match is found.
15611
15612         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15613
15614 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15615
15616         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15617         we actually unwrap the expression to allow for extra information
15618         to be extracted. 
15619
15620         * expression.cs: Use Shr_Un on unsigned operations. 
15621
15622 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15623
15624         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15625         applicable operators was not being considered correctly. This closes
15626         the bug Miguel reported.
15627
15628 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15629
15630         * attribute.cs: check that the type derives from System.Attribute
15631         and report the correct error in that case (moved the duplicate code to
15632         its own method, too).
15633
15634 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15635
15636         * attribute.cs: lookup attribute type name as the spec says: first the
15637         bare attribute name and then name + "Attribute" (nant compiles with
15638         mcs after this fix).
15639
15640 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15643         Because of the way we parse things, we should try to see if a
15644         UIntConstant can fit in an integer.
15645
15646 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15647
15648         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15649         when we are in an explicit context.
15650
15651         (ConvertReferenceExplicit): When converting from Iface type S to Class
15652         T make sure the rules are implemented as an OR.
15653
15654         * parameter.cs (ParameterType): Make it a property for now although the
15655         purpose really isn't anything immediate.
15656
15657         * expression.cs (Is*Applicable): Do better checking on the parameter type
15658         of a ref/out parameter. The ones from the system assemblies are already 
15659         marked with the correct type so we don't need to do any correction.
15660
15661         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15662         the object type is standard too so include that.
15663
15664 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15665
15666         * ecore.cs (StandardConversionExists): Augment with missing code:
15667         deal with IntConstant, LongConstants and Enumerations.
15668
15669         * assign.cs: Report the error, instead of failing silently
15670
15671         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15672         typecontainer that they are declared, because the
15673         typecontainer/namespace will have the list of using clauses that
15674         need to be applied.
15675
15676         Assembly Attributes were escaping the normal registration
15677         mechanism. 
15678
15679         (EmitCode): Apply attributes within an EmitContext that represents
15680         the container they were declared on.
15681
15682         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15683
15684 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15685
15686         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15687         Revamp completely - make much cleaner as we now operate only
15688         on a set of Types.
15689
15690         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15691         to implement the logic detailed in the spec more correctly.
15692
15693         (UserDefinedConversion): Update accordingly.
15694
15695 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15696
15697         * statement.cs: Return flow analysis information up.
15698
15699         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15700         and the default.
15701
15702         (token): Do not consume an extra character before calling
15703         decimal_digits.
15704
15705 2002-05-06  Piers Haken <piersh@friskit.com>
15706
15707         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15708
15709 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15710
15711         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15712         EmitContext during the instance constructor initializer
15713         resolution, to stop access to instance variables.
15714
15715         This is mandated by the spec, last paragraph of the `constructor
15716         initializers' section. 
15717
15718 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15719
15720         * cs-parser.jay, class.cs (Accessor): new class used to represent
15721         an accessor (get or set).  In the past we used `null' to represent
15722         a missing accessor.  But this is ambiguous because there was no
15723         way to tell in abstract indexers/properties if one of them was
15724         specified.
15725
15726         Now there is a way of addressing that.
15727
15728         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15729         instead of FindMembers.
15730
15731         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15732         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15733
15734         * attribute.cs: Treat indexers and properties as the same in terms
15735         of applying attributes
15736
15737         * ecore.cs (FindMostEncompassedType): Use statically initialized
15738         EmptyExpressions()s like we do elsewhere to avoid creating useless
15739         objects (and we take this out of the tight loop).
15740
15741         (GetConversionOperators): Move the code to extract the actual
15742         operators to a separate routine to clean things up.
15743
15744 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15745
15746         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15747         events are always registered FieldBuilders.
15748
15749         * class.cs (FieldBase): New class shared by Fields 
15750
15751         * delegate.cs: If we are a toplevel delegate, use our full name.
15752         If we are a nested delegate, then only use our tail name.
15753
15754 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15755
15756         * expression.cs (IsApplicable): Ensure that we add the "&" to
15757         ref/out types before comparing it with the type of the argument.
15758
15759         (IsParamsMethodApplicable): Ditto.
15760
15761         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15762         silly me ;-)
15763
15764         * delegate.cs : Handle the case when we have more than one applicable
15765         method. Flag an error only when we finish checking all.
15766
15767 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15768
15769         * expression.cs: Add support for boolean static initializers.
15770
15771 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15772
15773         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15774
15775         * parameter.cs (ComputeParameterTypes,
15776         ComputeAndDefineParameterTypes): Better error handling: now we
15777         clear the `types' cache if we fail during any of the type lookups.
15778         We also return the status code correctly to our caller
15779
15780         * delegate.cs: If we fail to define a delegate, abort the extra
15781         steps. 
15782
15783         * expression.cs (Binary.ResolveOperator): for
15784         operator==(object,object) and operator !=(object, object) we also
15785         have to verify that there is an implicit conversion from one to
15786         the other.
15787
15788         (ArrayAccess.DoResolve): Array Access can operate on
15789         non-variables. 
15790
15791 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15792
15793         * assign.cs (CompoundAssign): A new class used as a "flag" that
15794         the assignment actually is happening as part of a compound
15795         assignment operator.
15796
15797         During compound assignment, a few new rules exist to enable things
15798         like:
15799
15800         byte b |= 1 + 2
15801
15802         From the spec:
15803
15804         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15805         to the type of x) if y is implicitly convertible to the type of x,
15806         and the operator is a builtin operator and the return type of the
15807         operator is explicitly convertible to the type of x. 
15808
15809         * rootcontext.cs: Reset warning level to 2.  4 catches various
15810         "interesting" features in mcs, we must clean this up at some
15811         point, but currently am trying to kill other bugs ;-)
15812
15813         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15814         in container classes as well.  
15815
15816         * expression.cs (Binary.ResolveOperator): Handle string case
15817         before anything else (as operator overloading does emit an error
15818         before doing anything else).
15819
15820         This code could go away when we move to a table driven model, but
15821         i could not come up with a good plan last night.
15822
15823 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15824
15825         * typemanager.cs (CSharpName): reimplementation using regex.
15826         * class.cs: added null check for fields in Emit
15827         * rootcontext.cs: set warninglevel to 4
15828
15829 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15830
15831         * typemanager.cs (CSharpName): reimplemented with Lupus
15832         suggestion.
15833
15834 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15835
15836         * statement.cs (If): correclty implement Resolve, because we were
15837         not catching sem errors in there.  The same process is needed
15838         everywhere else. 
15839         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15840
15841
15842         (Statement.Warning_DeadCodeFound): Factorize code.
15843         (While): Report dead code here too.
15844
15845         (Statement): Added Resolve virtual method to allow
15846         for resolution split from the emit code.
15847
15848 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15849
15850         * statement.cs (EmitBoolExpression): No longer try to resolve the
15851         expression here.    
15852         (MakeBoolean): New utility function that resolve, implicitly
15853         converts to boolean and tags the expression. 
15854
15855
15856         (If, Do): Implement dead code elimination.
15857         (While): Implement loop inversion
15858
15859         (Do, While, For, If): Resolve the expression prior to calling our
15860         code generation.
15861
15862 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15863
15864         * class.cs:
15865           - added method Report28 (warning: program has more than one entry point)
15866           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15867           - modified method Method.Define, the part at the end of the method
15868
15869         * rootcontext.cs: added static public Location EntryPointLocation;
15870           
15871         * ../errors/cs0028.cs : Add test case for the above warning.              
15872
15873         * typemanager.cs:
15874           - modified method CSharpName to allow arrays of primitive type to
15875             be printed nicely (e.g. instead of System.Int32[][] it now prints
15876             int[][])
15877           - added method CSharpSignature: returns the signature of a method
15878             in string format to be used in reporting errors, warnings, etc.
15879
15880         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15881         with String.Empty.
15882
15883 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15884
15885         * delegate.cs (Define): Fix extremely silly bug where I was
15886         setting the type of the 'object' parameter of the BeginInvoke
15887         method to System.IAsyncResult instead of System.Object ;-)
15888
15889 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15890
15891         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15892         here. 
15893
15894         (Constructor.Emit): return if we fail to initialize the
15895         constructor.  Another door closed!  
15896
15897         * expression.cs (New.DoResolve): Improve error message (from -6 to
15898         1501).  Use DeclaredOnly lookup to find the exact constructor.
15899
15900         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15901         loop.  This is useful.
15902
15903         * cs-parser.jay: Adjust the default parameters so that destructors
15904         have the proper signature.
15905
15906 2002-04-26  Martin Baulig  <martin@gnome.org>
15907
15908         * driver.cs (LoadAssembly): If `assembly' contains any characters
15909         which are only valid in path names and not in assembly names
15910         (currently slash, backslash and point), use Assembly.LoadFrom ()
15911         instead of Assembly.Load () on the `assembly' (before iteration
15912         over the link_paths).
15913
15914 2002-04-26  Martin Baulig  <martin@gnome.org>
15915
15916         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15917
15918 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15919
15920         * class.cs (Property): use the new typemanager.MemberLookup
15921
15922         (TypeContainer.MemberLookup): Implement using the
15923         TypeManager.MemberLookup now. 
15924
15925         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15926         and return MemberInfos, so that these can be used without an
15927         EmitContext (what we had before).
15928
15929 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15930
15931         * expression.cs: Fix the case where the argument to params if the
15932         type of the params.  I omitted handling this before.   Fixed
15933
15934 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15935
15936         * driver.cs: Call BootCorlib_PopulateCoreType
15937
15938         * class.cs (Property.CheckBase): Check for properties only, not
15939         for all members. 
15940
15941         * interface.cs: Temporary hack: try/catch around the
15942         CustomAttributeBuilder, because I am getting an exception that I
15943         do not understand.
15944
15945         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15946         types whose definitions are required to be there (attributes are
15947         defined before standard types).
15948
15949         Compute definitions as we boot the various types, as they are used
15950         immediately (value_type class will need object_type, but if we do
15951         not initialize object_type, we will pass a null, which will let
15952         the runtime pick the System.Object from the existing corlib, which
15953         is not what we want).
15954
15955 2002-04-22  Patrik Torstensson <totte@labs2.com>
15956
15957         * cs-tokenizer.cs: fixed a number of trim() issues.
15958
15959 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15960
15961         * expression.cs (Argument.Type): Ensure that we return the correct
15962         type when we have out or ref parameters [in which case we 
15963         append a "&"].
15964
15965 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15966
15967         * class.cs (Property, Indexer): Allow extern modifier in there. 
15968
15969         * typemanager.cs (InitBaseTypes): Initializes object_type and
15970         value_type, since those will be used early on during the bootstrap
15971         process to compile corlib.
15972
15973         (InitCoreTypes): Move code from here to InitBaseTypes.
15974
15975 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15976
15977         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15978         single-dimension arrays as using the ldlen opcode.  
15979
15980         Daniel Lewis discovered this optimization.  
15981
15982         * typemanager.cs: Add signature for System.Array::get_Length
15983
15984 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15985
15986         * statement.cs: report the error when the foreach does not apply to an
15987         array nor a collection.
15988
15989 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15990
15991         * expression.cs: Add implicit conversions to the operator ~.
15992
15993         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15994
15995         * typemanager.cs: Locate the decimal constructor.
15996
15997 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15998
15999         * attribute.cs: use the new property of TypeOf.
16000         * expression.cs: added 'get' property around typearg.
16001
16002         These changes fix a build breaker reported by NickD. Is this the
16003         correct way to fix?  If not, please, revert my changes and make it
16004         work :-).
16005
16006 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
16007
16008         * attribute.cs: Add support for typeof in attribute invocations.
16009         I am not sure that this is right though.
16010
16011 2002-04-14  Duncan Mak  <duncan@ximian.com>
16012
16013         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16014         Binary.Operator.Division case.
16015
16016 2002-04-13  Ravi Pratap  <ravi@ximian.com>
16017
16018         * class.cs (DefineType): Ensure that we do a proper check on
16019         attribute types and also register it with the TypeManager.
16020
16021         (TypeContainer.Targets): The default for attribute types is
16022         AttributeTargets.All.
16023
16024         * attribute.cs (ApplyAttributes): Registering the attribute type
16025         is done elsewhere, not when we discover we have a Usage attribute.
16026
16027 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16028
16029         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16030         and get rid of is_delegate parameter.
16031
16032         * everywhere : update.
16033
16034 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16035
16036         * cs-parser.jay (compilation_unit): Revamp completely to use
16037         some new ideas that I got from Rhys' grammar to solve the problems
16038         with assembly level attributes.
16039
16040         (outer_declaration): New grammar production.
16041
16042         (attribute_sections): Add.
16043
16044         (opt_attributes): Base on attribute_sections
16045
16046         (namespace_declaration): Allow opt_attributes to tackle the case
16047         when we have assembly level attributes - we are clever in this
16048         regard now ;-)
16049
16050         * attribute.cs (ApplyAttributes): Do not worry about assembly 
16051         attributes in the non-global context.
16052
16053         * rootcontext.cs (AddGlobalAttributes): Go back to using this
16054         instead of SetGlobalAttributes.
16055
16056         * class.cs, rootcontext.cs : Ensure we define and generate 
16057         attribute types before anything else.
16058
16059         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16060         and flag the new error -20 for the case when the attribute type
16061         does not have valid targets specified. csc does not catch this.
16062
16063         * ../errors/errors.txt : update for error # -20
16064
16065 2002-04-11  Ravi Pratap  <ravi@ximian.com>
16066
16067         * support.cs (InternalParameters.ParameterModifier): Do some null
16068         checking and return sane values.
16069
16070         * class.cs (Method.Define): If we are a PInvoke method, ensure
16071         that we are static and extern. Report error # 601
16072
16073         * ../errors/cs0601.cs : Add test case for the above error.
16074
16075 2002-04-07  Ravi Pratap  <ravi@ximian.com>
16076
16077         * rootcontext.cs (attribute_types): We need to keep type of
16078         all attribute types separately and emit code for them first.
16079
16080         (RegisterAttribute) : Implement.
16081
16082         * class.cs (DefineType): Check if the current Type is a custom
16083         attribute type and register it accordingly.
16084
16085         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16086         adding the first attribute twice and rename to
16087
16088         (SetGlobalAttributes): this.
16089
16090         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16091         lookups.
16092
16093         * attribute.cs (ApplyAttributes): Take an additional argument telling us
16094         if we are processing global arguments. Hmm, I am unsure of this.
16095
16096 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16097
16098         * expression.cs: added static array of strings to avoid calling
16099         Enum.ToString () for Operator in Binary. Significant recover of
16100         performance.
16101
16102 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
16103
16104         * class.cs (FindMembers): Allow the Builders of the various
16105         members to be null.  If they are skip them.  This only happens
16106         during the PInvoke declaration.
16107
16108 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
16109
16110         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16111         failure, so we do not keep going afterwards.
16112
16113         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16114         wanted to pass `false' as the `is_delegate' argument.  If this is
16115         the case, why not use delegate_type == null to mean `is_delegate =
16116         false' and anything else as is_delegate = true.
16117
16118 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
16119
16120         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16121         code for the section, not the beginning of the tests.
16122
16123 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
16124
16125         * cfold.cs: Handle operator + (Enum x, Underlying x) 
16126
16127         * expression.cs (Binary): same.  Warn about errors where we have
16128         Enum/Enum in operator + as well.
16129
16130 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
16131
16132         * statement.cs:
16133                 - added support for switch(bool)
16134                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16135                 - add TableSwitchEmit() to handle table-based switch statements
16136
16137 2002-04-05  Ravi Pratap  <ravi@ximian.com>
16138
16139         * expression.cs (Invocation.OverloadResolve): Factor out code which
16140         does parameter compatibility checking with arguments so that we can 
16141         re-use the code even from Delegate.VerifyApplicability
16142
16143         (VerifyArgumentsCompat): Move above code here.
16144
16145         * delegate.cs (VerifyApplicability): Get rid of duplicate code
16146         and instead make a call to the above method.
16147
16148 2002-03-31  Ravi Pratap  <ravi@ximian.com>
16149
16150         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16151         We use it to keep track of classes which are attribute types.
16152
16153 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
16154
16155         * delegate.cs (Delegate.Define): Correctly define the types in the
16156         presence of fixed and array parameters.
16157
16158         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16159         doing FindMembers.
16160
16161         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16162         include NonPublic after the first iteration.
16163
16164         * class.cs (Indexer.CheckBase): Only check if both parents are
16165         non-null. 
16166
16167         * cs-parser.jay (accessor_body): If empty, set to null.
16168
16169         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16170         same code path here to resolve constants names that we did have in
16171         MemberAccess.DoResolve.  There is too much code duplicated here.
16172
16173 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
16174
16175         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16176
16177         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16178         to MakeUnionSet.
16179
16180         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16181         tokens, numbers and strings.
16182
16183         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16184         parenthesis.
16185
16186         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16187         asyncronous parameters and the regular parameters.  
16188
16189         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16190         specify the target directory.
16191
16192         * expression.cs: (This.DoResolve): Simplify
16193         (As.Emit): Optimize, do not generate IsInst if the expression is
16194         always of the given type.
16195
16196         (Is.DoResolve): Bug fix, we were reporting both always/never for
16197         the is expression.
16198
16199         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16200         creating too many unnecessary arrays.
16201
16202 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
16203
16204         * class.cs (EmitFieldInitializer): Use Assign expression to assign
16205         fields instead of rolling our own initializer.   Takes care of all
16206         implicit conversions, and drops unnecessary static checks/argument.
16207
16208 2002-03-31  Dick Porter  <dick@ximian.com>
16209
16210         * driver.cs: use the GetDirectories() return values properly, and
16211         use "/" as path separator.
16212
16213 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
16214
16215         * expression.cs (Unary): Optimize - - expr into expr.
16216         (Binary): Optimize a + (-b) into a -b.
16217
16218         * codegen.cs (CodeGen): Made all methods static.
16219
16220 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
16221
16222         * rootcontext.cs: 
16223
16224         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16225         TypeBuilder property.
16226
16227         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16228         instead. 
16229
16230         * tree.cs: Removed the various RecordXXXX, and replaced with a
16231         single RecordDecl.  Removed all the accessor methods, and just
16232         left a single access point Type 
16233
16234         * enum.cs: Rename DefineEnum to DefineType.
16235
16236         * decl.cs: New abstract method `DefineType' used to unify the
16237         Defines for Enumerations, Interfaces, TypeContainers and
16238         Delegates.
16239
16240         (FindType): Moved LookupInterfaceOrClass here.  Moved the
16241         LookupBaseClasses method that used to live in class.cs and
16242         interface.cs here, and renamed to FindType.
16243
16244         * delegate.cs: Implement DefineType.  Take advantage of the
16245         refactored pattern for locating the parent builder without taking
16246         the parent_builder argument (which we know does not work if we are
16247         nested, and triggering a toplevel definition).
16248
16249 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16250
16251         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16252         accessibility of a member has changed during override and report
16253         an error if so.
16254
16255         * class.cs (Method.Define, Property.Define): Only complain on
16256         overrides if the method is private, any other accessibility is
16257         fine (and since we just checked the permission is the same, we are
16258         good to go).
16259
16260         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16261         and elif are processed always.  The other pre-processing
16262         directives are only processed if we are "taking" the path
16263
16264 2002-03-29  Martin Baulig  <martin@gnome.org>
16265
16266         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16267         current location is not Null.
16268
16269         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16270         a separate method so we can profile it.
16271
16272         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16273         `span.Seconds' are just seconds, but no minutes or hours.
16274         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16275
16276 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16277
16278         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16279         Remove the gratuitous set of Final:
16280
16281                                 // If an interface implementation, then we can set Final.
16282                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16283                                     implementing.DeclaringType.IsInterface)
16284                                         flags |= MethodAttributes.Final;
16285
16286         I do not know what I was smoking when I used that.
16287
16288
16289         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16290         step into fixing the name resolution issues for delegates and
16291         unifying the toplevel name resolution.
16292
16293 2002-03-28  Martin Baulig  <martin@gnome.org>
16294
16295         * class.cs (Method.Emit): If we have a symbol writer, call its
16296         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16297         tell it about the current method.
16298
16299         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16300         writer that we're going to emit the first byte of IL code for a new
16301         statement (a new source line).
16302         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16303         EmitContext.Mark() before emitting any code.
16304
16305         * location.cs (SymbolDocument): Return null when we're Null.
16306
16307         * statement.cs (Statement): Moved the `Location loc' variable here.
16308         (Statement.EmitBoolExpression): If we have a symbol writer, call
16309         ec.Mark() before emitting any code to tell it that we're at the
16310         beginning of a new statement.
16311         (StatementExpression): Added `Location' argument to the constructor.
16312         (Block): Added public readonly variable `StartLocation' and public
16313         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16314         (Block): Added constructor which takes a start and end location.
16315         (Block.SetEndLocation): New method. This sets the end location.
16316         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16317         local variables we create.
16318         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16319         each statement and do also mark the begin and end of the block.
16320
16321         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16322         tell it the current lexer.Location, use Location.Null for the end of the
16323         block.
16324         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16325         current block, set its end location using SetEndLocation().
16326         (statement_expression): StatementExpression constructor now takes the
16327         lexer.Location as additional argument.
16328         (for_statement, declare_local_variables): Likewise.
16329         (declare_local_variables): When creating a new implicit block, use the
16330         new Block constructor and pass it the lexer.Location.
16331
16332 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16333
16334         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16335         members also on the parent interfaces recursively.
16336
16337 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16338
16339         * report.cs: Use new formats, since Gonzalo finished the missing
16340         bits. 
16341
16342         * expression.cs (Binary.ResolveOperator): added missing operator|
16343         operator& and operator^ for bool/bool.
16344
16345         * cs-parser.jay: CheckDef now takes a Location argument that is
16346         used to report errors more precisly (instead of reporting the end
16347         of a definition, we try to track something which is a lot closer
16348         to the source of the problem).
16349
16350         * cs-tokenizer.cs: Track global token use, so we can properly flag
16351         the use of #define/#undef after the first token has been seen.
16352
16353         Also, rename the reportXXXX to Error_DescriptiveName
16354
16355         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16356         TypeContainer, so that Enum and Interface can use this too.
16357
16358         * class.cs (TypeContainer.LookupInterfaceOrClass,
16359         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16360         `builder' argument.  Typically this was used to pass the parent
16361         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16362         the definition).  
16363
16364         The problem is that a nested class could trigger the definition of
16365         a toplevel class, and the builder would be obviously wrong in that
16366         case. 
16367
16368         So we drop this argument, and we compute dynamically the
16369         TypeBuilder/ModuleBuilder (the correct information was available
16370         to us anyways from DeclSpace.Parent)
16371
16372         * interface.cs (Interface.DefineInterface): Drop builder
16373         parameter cleanup like class.cs
16374
16375         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16376         like class.cs
16377
16378         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16379         values. 
16380
16381         (Try.Emit): Propagate the returns value from the statement.
16382
16383         (Return.Emit): Even if we are leavning 
16384
16385         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16386
16387         * modifiers.cs: Fix the computation of MethodAttributes flags.
16388
16389 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16390
16391         * driver.cs: allow compilation of files that start with '/'.
16392         Add a default case when checking the argument of --target.
16393
16394 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16395
16396         * interface.cs: Implement the same search algorithm for types in
16397         the interface code.
16398
16399         * delegate.cs: Do not allow multiple definition.
16400
16401         * Recovered ChangeLog that got accidentally amputated
16402
16403         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16404
16405         * rootcontext.cs: Load manually enum to allow core classes to
16406         contain enumerations.
16407
16408         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16409         Update to new static methods in TypeManager.
16410
16411         * typemanager.cs (GetMethod, GetConstructor): Use our
16412         implementation of FindMembers to find the members, since during
16413         corlib compilation, the types are TypeBuilders and GetMethod and
16414         GetConstructor do not work.
16415
16416         Make all methods in TypeManager static.
16417
16418         (InitCodeHelpers): Split the functionality from
16419         the InitCodeTypes function.
16420
16421         * driver.cs: Call InitCodeHelpers after we have populated the
16422         types. 
16423
16424         * cs-parser.jay (delegate_declaration): we did not used to compute
16425         the delegate name correctly for void delegates.
16426
16427 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16428
16429         * rootcontext.cs (RootContext): Init the interface_resolve_order
16430         and type_container_resolve_order always.
16431
16432         (ResolveCore, BootstrapCorlib_ResolveClass,
16433         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16434         compiler when compiling with --nostdlib
16435
16436         * class.cs (TypeContainer.DefineType): Check that our parent is
16437         not null.  This test is most important when we are bootstraping
16438         the core types.
16439
16440         * codegen.cs: Split out the symbol writing code.
16441
16442 2002-03-25  Martin Baulig  <martin@gnome.org>
16443
16444         * driver.cs (-g): Made -g an alias for --debug.
16445
16446 2002-03-24  Martin Baulig  <martin@gnome.org>
16447
16448         * codegen.cs (SymbolWriter): New public variable. Returns the
16449         current symbol writer.
16450         (CodeGen): Added `bool want_debugging_support' argument to the
16451          constructor. If true, tell the ModuleBuild that we want debugging
16452         support and ask it for the ISymbolWriter.
16453         (Save): If we have a symbol writer, call it's Close() method after
16454         saving the assembly.
16455
16456         * driver.c (--debug): New command line argument to create a
16457         debugger information file.
16458
16459         * location.cs (SymbolDocument): New public property. Returns an
16460         ISymbolDocumentWriter object for the current source file or null
16461         if we don't have a symbol writer.
16462
16463 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16464
16465         * driver.cs (LoadAssembly): Correctly return when all the paths
16466         have been tried and not before.
16467
16468         * statement.cs (Switch.Emit): return the actual coverage for this
16469         statement (returns/not-returns)
16470
16471         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16472         switch of the statement if we are the last switch section.  That
16473         kills two problems: try/catch problems (we used to emit an empty
16474         nop at the end) and switch statements where all branches would
16475         return. 
16476
16477 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16478
16479         * driver.cs: Add default assemblies (the equivalent to the
16480         Microsoft CSC.RSP file)
16481
16482         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16483         also update tokens_seen and set it to false.
16484
16485         * driver.cs: Implement --recurse for Mike.
16486
16487         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16488         correctly splitting out the paths.
16489
16490 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16491
16492         * interface.cs (Interface.PopulateProperty): Instead of using
16493         `parent' as the declaration space for the set parameters, use
16494         `this' 
16495
16496         * support.cs (InternalParameters): InternalParameters constructor
16497         takes a DeclSpace instead of a TypeContainer.
16498
16499         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16500         types are being initialized, load the address of it before calling
16501         the function.  
16502
16503         (New): Provide a mechanism to disable the generation of local
16504         value type temporaries when the caller will be providing us with
16505         an address to store it.
16506
16507         (ArrayCreation.EmitDynamicInitializers): Use it.
16508
16509 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16510
16511         * expression.cs (Invocation.EmitArguments): Only probe for array
16512         property if there is more than one argument.  Sorry about that.
16513
16514         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16515         empty param arrays.
16516
16517         * class.cs (Method.LabelParameters): Fix incorrect code path that
16518         prevented the `ParamArrayAttribute' from being applied to the
16519         params attribute.
16520
16521 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16522
16523         * support.cs (ReflectionParameters): Correctly compute whether the
16524         last argument is a params array.  Fixes the problem with
16525         string.Split ('a')
16526
16527         * typemanager.cs: Make the assemblies array always be non-null
16528         (empty, but non-null)
16529
16530         * tree.cs (RecordDecl): New function that abstracts the recording
16531         of names.  This reports error 101, and provides a pointer to the
16532         previous declaration.  Fixes a crash in the compiler.
16533
16534         * cs-parser.jay (constructor_declaration): Update to new grammar,
16535         and provide a constructor_body that can be empty.
16536
16537 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16538
16539         * driver.cs: Add support for --resources.
16540
16541         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16542         Make all types for the various array helper methods be integer.
16543
16544         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16545         CheckState to ConvCast.
16546
16547         (ConvCast): Now it takes a `checked' state argument, to avoid
16548         depending on the emit context for the conversion, and just using
16549         the resolve time setting.
16550
16551         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16552         instead of Invocation.EmitArguments.  We do not emit the original
16553         arguments, instead we emit those which have been converted to
16554         unsigned int expressions.
16555
16556         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16557
16558         * codegen.cs: ditto.
16559
16560         * expression.cs (LocalVariableReference): Drop the use of the
16561         Store function that depended on the variable index.
16562
16563         * statement.cs (VariableInfo): Drop the `Idx' property from this
16564         class, as this is not taking into account the indexes for
16565         temporaries tat we generate during the execution, getting the
16566         indexes wrong.
16567
16568         * class.cs: First emit class initializers, then call the parent
16569         constructor. 
16570
16571         * expression.cs (Binary): Fix opcode emision.
16572         (UnaryMutator.EmitCode): Support checked code generation
16573
16574         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16575         matches for events for both the Static and Instance scans,
16576         pointing to the same element.   Fix that.
16577
16578 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16579
16580         * rootcontext.cs (ResolveTree): Always set the
16581         interface_resolve_order, because nested interfaces will be calling
16582         into us.
16583
16584         * class.cs (GetInterfaceOrClass): Track the same resolution
16585         process used by TypeManager.LookupType.  This fixes the nested
16586         type lookups in class declarations (separate path from
16587         LookupType). 
16588
16589         (TypeContainer.DefineType): Also define nested interfaces.
16590         (TypeContainer.RegisterOrder): New public function used to
16591         register the order in which child interfaces need to be closed.
16592
16593         Nested interfaces need to be closed after their parents have been
16594         created. 
16595
16596         * interface.cs (InterfaceAttr): Put all the logic for computing
16597         the interface attribute here. 
16598
16599         (DefineInterface): Register our interface order with the
16600         RootContext or with the TypeContainer depending on the case.
16601
16602 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16603
16604         * cs-parser.jay: rework foreach statement to work with the new
16605         changes to the policy on SimpleNames.
16606
16607         * report.cs: support Stacktrace on warnings as well.
16608
16609         * makefile: drop --unsafe and /unsafe from the compile.
16610
16611 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16612
16613         * ecore.cs (StandardConversionExists): Modify to take an Expression
16614         as the first parameter. Ensure we do null -> reference type conversion
16615         checking.
16616
16617         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16618         temporary Expression objects.
16619
16620 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16621
16622         * interface.cs: workaround bug in method overloading resolution
16623         (there is already a bugzilla bug for it).
16624
16625 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16626
16627         We could also solve this problem by having a separate path for
16628         performing type lookups, instead of DoResolve, we could have a
16629         ResolveType entry point, and only participating pieces of the
16630         production (simplename, deref, array) would implement this. 
16631
16632         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16633         signal SimpleName to only resolve type names and not attempt to
16634         resolve anything else.
16635
16636         * expression.cs (Cast): Set the flag.
16637
16638         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16639
16640         * class.cs: Only report 108 if there is no `new' modifier.
16641
16642         * cs-parser.jay: rework foreach statement to work with the new
16643         changes to the policy on SimpleNames.
16644
16645         * report.cs: support Stacktrace on warnings as well.
16646
16647         * makefile: drop --unsafe and /unsafe from the compile.
16648
16649 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16650
16651         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16652         lookups here, instead of doing that at parse time.  This means
16653         that our grammar will not introduce `LocalVariableReferences' as
16654         expressions at this point.  That solves the problem of code like
16655         this:
16656
16657         class X {
16658            static void Main ()
16659            { int X = 1;
16660             { X x = null }}}
16661
16662         This is only half the fix.  The full fix requires parameters to
16663         also be handled in this way.
16664
16665         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16666         makes the use more obvious of the DeclSpace.  The
16667         ec.TypeContainer.TypeBuilder is now only used to pull the
16668         TypeBuilder for it.
16669
16670         My theory is that I can get rid of the TypeBuilder completely from
16671         the EmitContext, and have typecasts where it is used (from
16672         DeclSpace to where it matters).  
16673
16674         The only pending problem is that the code that implements Aliases
16675         is on TypeContainer, and probably should go in DeclSpace.
16676
16677         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16678         lookups here, instead of doing that at parse time.  This means
16679         that our grammar will not introduce `LocalVariableReferences' as
16680         expressions at this point.  That solves the problem of code like
16681         this:
16682
16683         class X {
16684            static void Main ()
16685            { int X = 1;
16686             { X x = null }}}
16687
16688         This is only half the fix.  The full fix requires parameters to
16689         also be handled in this way.
16690
16691         * class.cs (Property.DefineMethod): When implementing an interface
16692         method, set newslot, when implementing an abstract method, do not
16693         set the flag (before we tried never setting it, or always setting
16694         it, which is the difference).
16695         (Indexer.DefineMethod): same.
16696         (Method.DefineMethod): same.
16697
16698         * ecore.cs: Only set the status used flag if we get back a Field.
16699
16700         * attribute.cs: Temporary hack, so Paolo can keep working.
16701
16702 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16703
16704         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16705         the unmanaged type in the case we have a MarshalAs attribute.
16706
16707         (Resolve): Handle the case when we are parsing the special MarshalAs
16708         attribute [we need to store the unmanaged type to use later]
16709
16710         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16711         MarshalAs Attribute.
16712
16713         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16714         on parameters and accordingly set the marshalling info.
16715
16716 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16717
16718         * class.cs: Optimizing slightly by removing redundant code after
16719         we switched to the `NoTypes' return value.
16720         (Property.DefineMethod): use NoTypes here too.
16721
16722         This fixes the bug I introduced in my last batch of changes.
16723
16724 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16725
16726         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16727
16728         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16729         Enums since those are types too. 
16730
16731         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16732
16733         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16734         thanks to a call during the lookup process.
16735
16736 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16737
16738         * statement.cs (Foreach): Lots of work to accomodate a particular
16739         kind of foreach statement that I had not kept in mind.  It is
16740         possible to have foreachs on classes that provide a GetEnumerator
16741         method that return objects that implement the "pattern" for using
16742         a foreach, there is no need to support GetEnumerator
16743         specifically. 
16744
16745         This is needed to compile nant.
16746
16747         * decl.cs: Only report 114 if the member is not `Finalize' and if
16748         the warning level is at least 2.
16749
16750         * class.cs: Moved the compare function from Method to
16751         MethodSignature. 
16752
16753         (MethodSignature.InheritableMemberSignatureCompare): Add new
16754         filter function that is used to extract inheritable methods from a
16755         class. 
16756
16757         (Method.Define): Use the new `inheritable_method_signature_filter'
16758         delegate
16759
16760         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16761         command. 
16762
16763 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16764
16765         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16766
16767         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16768
16769         * expression.cs: Pass location information to
16770         ConvertImplicitStandard. 
16771
16772         * class.cs: Added debugging code to track return values from
16773         interfaces. 
16774
16775 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16776
16777         * expression.cs (Is.DoResolve): If either side of the `is' is an
16778         interface, do not flag the warning.
16779
16780         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16781         for interfaces
16782
16783         * report.cs: Allow for --fatal to be used with --probe.
16784
16785         * typemanager.cs (NoTypes): Move the definition for the empty Type
16786         array here. 
16787
16788         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16789         properties. 
16790         (TypeContainer.DefineProxy): New function used to proxy to parent
16791         implementations when implementing interfaces.
16792         (TypeContainer.ParentImplements): used to lookup if our parent
16793         implements a public function that is required by an interface.
16794         (TypeContainer.VerifyPendingMethods): Hook this up.
16795
16796         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16797         `modules' and `assemblies' arraylists into arrays.  We only grow
16798         these are the very early start up of the program, so this improves
16799         the speedof LookupType (nicely measured).
16800
16801         * expression.cs (MakeByteBlob): Replaced unsafe code with
16802         BitConverter, as suggested by Paolo.
16803
16804         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16805         folding of string concatenation, but if either side is a string,
16806         and the other is not, then return null, and let the runtime use
16807         the concatenation on the string plus the object (using
16808         `Object.ToString'). 
16809
16810 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16811
16812         Constant Folding has been implemented now.
16813
16814         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16815         the error instead on types that are not supported in one's
16816         complement. 
16817
16818         * constant.cs (Constant and all children): New set of functions to
16819         perform implict and explicit conversions.
16820
16821         * ecore.cs (EnumConstant): Implement the new functions to perform
16822         conversion by proxying to the child expression.
16823
16824         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16825         own separate setting that can not be turned off from the command
16826         line using --unchecked or --checked and is only controlled using
16827         the checked/unchecked statements and expressions.  This setting is
16828         used by the constant folder to flag errors.
16829
16830         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16831         ConstantCheckState as well.   
16832
16833         During Resolve, they also have to flag the state, because the
16834         constant folder runs completely in the Resolve phase.
16835
16836         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16837         well.
16838
16839 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16840
16841         * cfold.cs: New file, this file contains the constant folder.
16842
16843         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16844         argument to track whether we are using the resulting address to
16845         load or store a value and provide better error messages. 
16846
16847         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16848         new AddressOf arguments.
16849
16850         * statement.cs (Foreach.EmitCollectionForeach): Update
16851
16852         * expression.cs (Argument.Emit): Call AddressOf with proper
16853         arguments to track usage.
16854
16855         (New.DoEmit): Call AddressOf with new arguments.
16856
16857         (Unary.Emit): Adjust AddressOf call.
16858
16859 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16860
16861         * cs-parser.jay (member_access): Change the case for pre-defined types
16862         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16863         this suggestion.
16864
16865         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16866         a method body.
16867
16868         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16869         essentially like methods and apply attributes like MethodImplOptions to them too.
16870
16871         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16872         not being null.
16873
16874         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16875         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16876         is the DeclSpace.
16877
16878         * Update code everywhere accordingly.
16879
16880         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16881
16882         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16883
16884 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16885
16886         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16887         try performing lookups against those instead of jumping straight into using
16888         the 'using' clauses.
16889
16890         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16891
16892         (LookupType): Perform lookups in implicit parents too.
16893
16894         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16895         sequence as RootContext.LookupType. 
16896
16897         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16898         the various cases of namespace lookups into this method.
16899
16900 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16901
16902         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16903         in positional arguments)
16904
16905         * class.cs (Operator): Update the AllowedModifiers to contain
16906         extern. 
16907
16908         * cs-parser.jay: Update operator declaration to allow for the
16909         operator body to be empty.
16910
16911         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16912         values. 
16913
16914 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16915
16916         * class.cs (Method.Emit): Label parameters.
16917
16918         * driver.cs: Return 1 or 0 as the program exit code.
16919
16920 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16921
16922         * expression.cs: Special case the `null' object when trying to
16923         auto-compute the type, as anything can be explicitly converted to
16924         that. 
16925
16926         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16927         spotting this Paolo.
16928
16929         (Expression.ImplicitNumericConversion): Perform comparissions of
16930         the type using the underlying type in the case of an enumeration
16931         rather than using the enumeration type for the compare.
16932
16933         Cope with the underlying == type case, which is not possible to
16934         catch before. 
16935
16936         (Expression.ConvertNumericExplicit): Perform comparissions of
16937         the type using the underlying type in the case of an enumeration
16938         rather than using the enumeration type for the compare.
16939
16940         * driver.cs: If the user does not supply an extension, assume .exe
16941
16942         * cs-parser.jay (if_statement): Rewrote so that we can track the
16943         location for the if statement.
16944
16945         * expression.cs (Binary.ConstantFold): Only concat strings when
16946         the operation is "+", not everything ;-)
16947
16948         * statement.cs (Statement.EmitBoolExpression): Take a location
16949         argument. 
16950         (If, While, Do): Track location.
16951
16952         * expression.cs (Binary.ResolveOperator): In the object + string
16953         case, I was missing a call to ConvertImplicit
16954
16955 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16956
16957         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16958         Location arguments. Ensure we use RootContext.LookupType to do our work
16959         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16960
16961         * interface.cs (PopulateMethod): Handle the type of the parameter being
16962         null gracefully.
16963
16964         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16965         have a params method with no fixed arguments and a call is made with no
16966         arguments.
16967
16968 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16969
16970         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16971         the verbatim-string-literal
16972
16973         * support.cs (InternalParameters.ParameterModifier): handle null
16974         fixed parameters.
16975         (InternalParameters.ParameterType): ditto.
16976
16977         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16978         duplicating the name of the variable parameter.
16979         (GetParameterByName): Fix bug where we were not looking up array
16980         paramters if they were the only present (thanks Paolo!).
16981         (GetParameterInfo): We only have an empty set of types if both
16982         fixed and array are set to null.
16983         (GetParameterInfo-idx): Handle FixedParameter == null
16984
16985         * cs-parser.jay: Handle the case where there is no catch
16986         statements (missing null test).
16987
16988 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16989
16990         * driver.cs (MainDriver): Be conservative on our command line
16991         handling.
16992
16993         Catch DirectoryNotFoundException when calling GetFiles.
16994
16995         (SplitPathAndPattern): Used to split the input specification into
16996         a path and a pattern that we can feed to Directory.GetFiles.
16997
16998 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16999
17000         * statement.cs (Fixed): Implement the last case of the Fixed
17001         statement (string handling).
17002
17003         * expression.cs (StringPtr): New class used to return a char * to
17004         a string;  Used by the Fixed statement.
17005
17006         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
17007
17008         * expression.cs (Binary.ResolveOperator): Remove redundant
17009         MemberLookup pn parent type.
17010         Optimize union call, we do not need a union if the types are the same.
17011         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17012         type.
17013
17014         Specialize the use of MemberLookup everywhere, instead of using
17015         the default settings. 
17016
17017         (StackAlloc): Implement stackalloc keyword.
17018
17019         * cs-parser.jay: Add rule to parse stackalloc.
17020
17021         * driver.cs: Handle /h, /help, /?
17022
17023         * expression.cs (MakeByteBlob): Removed the hacks we had in place
17024         before we supported unsafe code.
17025
17026         * makefile: add --unsafe to the self compilation of mcs.
17027
17028 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
17029
17030         * expression.cs (PointerArithmetic): New class that is used to
17031         perform pointer arithmetic.
17032         (Binary.Resolve): Handle pointer arithmetic
17033         Handle pointer comparission.
17034         (ArrayPtr): Utility expression class that is used to take the
17035         address of an array.
17036
17037         (ElementAccess): Implement array access for pointers
17038
17039         * statement.cs (Fixed): Implement fixed statement for arrays, we
17040         are missing one more case before we are done.
17041
17042         * expression.cs (Indirection): Implement EmitAssign and set the
17043         ExprClass to Variable.  This allows pointer dereferences to be
17044         treated as variables, and to have values assigned to them.
17045
17046         * ecore.cs (Expression.StoreFromPtr): New utility function to
17047         store values dereferencing.
17048
17049 2002-02-20  Ravi Pratap  <ravi@ximian.com>
17050
17051         * expression.cs (Binary.ResolveOperator): Ensure that we are
17052         not trying to operate on a void type - this fixes the reported
17053         bug.
17054
17055         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17056         the parent implementation is sealed.
17057
17058         * ../errors/cs0239.cs : Add.
17059
17060         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17061
17062         * typemanager.cs (unverifiable_code_type): Corresponds to 
17063         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17064         which have unsafe code in them.
17065
17066         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
17067         unsafe context.
17068
17069 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
17070
17071         * cs-tokenizer.cs: Add support for @"litreal strings"
17072
17073         Make tokenizer accept pre-processor directives
17074         on any column (remove the old C-like limitation). 
17075
17076         * rootcontext.cs (EmitCode): Emit any global attributes.
17077         (AddGlobalAttributes): Used to keep track of assembly attributes. 
17078
17079         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17080
17081         * cs-parser.jay: Add support for global attributes.  
17082
17083 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
17084
17085         * expression.cs (Indirection): New helper class.  Unary will
17086         create Indirection classes to be able to implement the
17087         IMemoryLocation interface on it.
17088
17089 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
17090
17091         * cs-parser.jay (fixed_statement): reference the right statement.
17092
17093         * statement.cs (Fixed.Emit): Finish implementing the fixed
17094         statement for the &x case.
17095
17096 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
17097
17098         * class.cs (Property.Define, Method.Define): Remove newslot when
17099         `implementing'.  
17100
17101         * modifiers.cs: My use of NewSlot when `Abstract' was set was
17102         wrong.  NewSlot should only be used if the `new' keyword is present.
17103
17104         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17105         locating our system dir.  Sorry about this.
17106
17107 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17108
17109         * driver.cs (GetSystemDir): Compute correctly the location of our
17110         system assemblies.  I was using the compiler directory instead of
17111         the library directory.
17112
17113 2002-02-13  Ravi Pratap  <ravi@ximian.com>
17114
17115         * expression.cs (BetterFunction): Put back in what Miguel commented out
17116         since it is the correct fix. The problem is elsewhere ;-)
17117
17118         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17119         parameters of the parms method are themselves compatible or not !
17120
17121         (StandardConversionExists): Fix very dangerous bug where we were forgetting
17122         to check that a class implements an interface before saying that an implicit
17123         conversion was allowed. Use ImplementsInterface to do the checking.
17124
17125 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17126
17127         * class.cs (Method.Define): Track whether we are an explicit
17128         implementation or not.  And only call DefineMethodOverride if we
17129         are an explicit implementation.
17130
17131         (Property.DefineMethod): Ditto.
17132
17133 2002-02-11  Ravi Pratap  <ravi@ximian.com>
17134
17135         * expression.cs (BetterFunction): Catch hideous bug which was
17136          preventing us from detecting ambiguous calls due to implicit casts i.e
17137         cs0121.
17138
17139 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
17140
17141         * support.cs (Pair): Remove un-needed method.  I figured why I was
17142         getting the error in cs-parser.jay, the variable in a foreach loop
17143         is readonly, and the compiler does not really treat this as a variable.
17144
17145         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
17146         instead of EQUALS in grammar.  
17147
17148         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17149
17150         * expression.cs (Unary.DoResolve): Check whether the argument is
17151         managed or not.
17152
17153 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
17154
17155         * support.cs: Api for Pair to set a value.  Despite the fact that
17156         the variables are public the MS C# compiler refuses to compile
17157         code that accesses the field if the variable is part of a foreach
17158         statement. 
17159
17160         * statement.cs (Fixed): Begin implementation of the fixed
17161         statement.
17162
17163         (Block.AddVariable): Return the VariableInfo on success and null
17164         on failure instead of true/false. 
17165
17166         * cs-parser.jay (foreach): Catch errors on variables already
17167         defined (we were ignoring this value before) and properly unwind
17168         the block hierarchy
17169
17170         (fixed_statement): grammar for the fixed statement.
17171
17172 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
17173
17174         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17175         pointer types to be incretemented.
17176
17177         (SizeOf): Implement.
17178
17179         * cs-parser.jay (pointer_member_access): Implement
17180         expr->IDENTIFIER production.
17181
17182         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17183         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17184         on safe contexts.
17185
17186         (Unary): Implement indirection.
17187
17188         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17189         use in non-unsafe context).
17190
17191         (SimpleName.DoResolve): Check for pointers in field access on safe
17192         contexts. 
17193
17194         (Expression.LoadFromPtr): Factor the load-indirect code in this
17195         function.  This was duplicated in UnboxCast and ParameterReference
17196
17197 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
17198
17199         * expression.cs (ComposedCast): report an error if a pointer cast
17200         is used in a safe region.
17201
17202         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17203         pointer type casts in unsafe context.
17204
17205         * codegen.cs (EmitContext): Set up IsUnsafe.
17206
17207         * cs-parser.jay (non_expression_type): Add productions for pointer
17208         casts. 
17209
17210         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17211         code.  We should not use force into static mode if the method is
17212         not virtual.  Fixes bug in MIS
17213
17214         * statement.cs (Do.Emit, While.Emit, For.Emit,
17215         Statement.EmitBoolExpression): Add support to Do and While to
17216         propagate infinite loop as `I do return' semantics.
17217
17218         Improve the For case to also test for boolean constants.
17219
17220         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17221         to the list of attributes we can add.
17222
17223         Remove `EmitContext' argument.
17224
17225         * class.cs (Method.Define): Apply parameter attributes.
17226         (Constructor.Define): Apply parameter attributes.
17227         (MethodCore.LabelParameters): Move here the core of labeling
17228         parameters. 
17229
17230         * support.cs (ReflectionParameters.ParameterModifier,
17231         InternalParameters.ParameterModifier): Use IsByRef on the type and
17232         only return the OUT bit for these parameters instead of in/out/ref
17233         flags.
17234
17235         This is because I miss-understood things.  The ParameterInfo.IsIn
17236         and IsOut represent whether the parameter has the [In] and [Out]
17237         attributes set.  
17238
17239 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
17240
17241         * ecore.cs (FieldExpr.Emit): Release temporaries.
17242
17243         * assign.cs (LocalTemporary.Release): new function.
17244
17245         * codegen.cs (EmitContext.GetTemporaryStorage,
17246         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17247         temporary storage.  Now we can "put back" localbuilders when we
17248         are done with them
17249
17250 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17251
17252         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17253         need to make a copy of the variable to generate verifiable code.
17254
17255 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17256
17257         * driver.cs: Compute dynamically the system directory.
17258
17259         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17260         Slower, but more generally useful.  Used by the abstract
17261         registering implementation. 
17262
17263         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17264         the rules for the special rule on Type/instances.  First check if
17265         we have the same name, and if so, try that special static path
17266         rather than the instance path.
17267
17268 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17269
17270         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17271         for, while and if.
17272
17273         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17274         Enum, ValueType, Delegate or Array for non-corlib compiles.
17275
17276         * cs-tokenizer.cs: Catch long identifiers (645)
17277
17278         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17279         piece of code.
17280
17281         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17282         fix, we were returning too early, so we were not registering
17283         pending methods from abstract classes.
17284
17285         Do not register pending methods if the class is abstract.
17286
17287         * expression.cs (Conditional.DoResolve): Report circular implicit
17288         conversions when we neecd to compute it for conditional
17289         expressions. 
17290
17291         (Is.DoResolve): If the expression is always of the provided type,
17292         flag warning 183.  If the expression can not ever be of the
17293         provided type flag warning 184.
17294
17295         * class.cs: Catch 169 as well.
17296
17297         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17298         read. 
17299
17300 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17301
17302         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17303
17304 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17305
17306         * interface.cs: (PopulateMethod): Check for pointers being defined
17307         only if the unsafe context is active.
17308         (PopulateProperty): ditto.
17309         (PopulateIndexer): ditto.
17310
17311         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17312         specified.  If pointers are present, make sure that they are
17313         present in an unsafe context.
17314         (Constructor, Constructor.Define): ditto.
17315         (Field, Field.Define): ditto.
17316         (Property, Property.Define): ditto.
17317         (Event, Event.Define): ditto.
17318
17319         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17320         hashtable if there are classes or structs defined.
17321
17322         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17323         code, as the constant resolution moved.
17324
17325         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17326         the metadata, so we can flag error 133. 
17327
17328         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17329         pointer is being declared in an unsafe context.
17330
17331 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17332
17333         * modifiers.cs (Modifiers.Check): Require a Location argument.
17334         Report error 227 for Unsafe use.
17335
17336         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17337
17338         * statement.cs (For.Emit): If the test is null, then report that
17339         we do `return', as we wont reach anything afterwards.
17340
17341         (Switch.SwitchGoverningType): Track the expression that matched
17342         the conversion.
17343
17344         * driver.cs: Allow negative numbers as an error code to flag.
17345
17346         * cs-parser.jay: Handle 1551.
17347
17348         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17349
17350 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17351
17352         * cs-parser.jay: Report 1518 (type declaration can only contain
17353         class, struct, interface, enum or delegate)
17354
17355         (switch_label): Report 1523 (keywords `case' or `default' must
17356         preced code)
17357
17358         (opt_switch_sections): Report 1522 (empty switch)
17359
17360         * driver.cs: Report 1515 (response file specified multiple times)
17361         Report 1516 (Source file specified multiple times).
17362
17363         * expression.cs (Argument.Resolve): Signal 1510
17364
17365         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17366         access not allowed in static code)
17367
17368 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17369
17370         * typemanager.cs (IsPointerType): Utility method which we are going
17371         to need a lot.
17372
17373         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17374         the object type, so we take care of that.
17375
17376         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17377
17378         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17379         added to non-params parameters :-)
17380
17381         * typemanager.cs (CSharpName): Include 'void' type too. 
17382
17383         (void_ptr_type): Include in the set of core types.
17384
17385         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17386         duplicating code.
17387
17388         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17389         an unsafe context.
17390
17391         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17392         completely forgotten about it.
17393
17394 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17395
17396         * cs-parser.jay (pointer_type): Add. This begins our implementation
17397         of parsing rules for unsafe code.
17398
17399         (unsafe_statement): Implement.
17400
17401         (embedded_statement): Modify to include the above.
17402
17403         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17404
17405         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17406         if the current context is an unsafe one.
17407
17408         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17409         are handled differently, we need separate rules for them.
17410
17411         (local_variable_declaration): Update to use local_variable_pointer_type
17412         to allow variable declarations of unmanaged pointer types.
17413
17414         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17415         in unsafe contexts.
17416
17417         * ../errors/cs0214.cs : Add.
17418
17419 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17420
17421         * makefile: remove 'response' file when cleaning.
17422
17423 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17424
17425         * cs-parser.jay: Report 1524.
17426
17427 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17428
17429         * typemanager.cs (RegisterMethod): drop checking if we have
17430         registered this from here
17431
17432 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17433
17434         * class.cs (Method.EmitDestructor): Implement calling our base
17435         destructor. 
17436
17437         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17438         value of InFinally.
17439
17440         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17441         this routine and will wrap the call in a try/catch block.  Deal
17442         with the case.
17443
17444 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17445
17446         * ecore.cs (Expression.MemberLookup): instead of taking a
17447         parameter `same_type' that was used to tell whether we could
17448         access private members we compute our containing type from the
17449         EmitContext.
17450
17451         (FieldExpr): Added partial support for volatile fields.  This does
17452         not work for volatile fields exposed from assemblies, as I can not
17453         figure out how to extract the modreq from it.
17454
17455         Updated all the source files to use this.
17456
17457         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17458         because it is referenced by MemberLookup very often. 
17459
17460 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17461
17462         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17463         TypeBuilder.GetCustomAttributes to retrieve what we need.
17464
17465         Get rid of redundant default_member_attr_type as this is the same as
17466         default_member_type which already exists.
17467
17468         * interface.cs, attribute.cs : Update accordingly.
17469
17470 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17471
17472         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17473         work for TYpeBuilders though.  Ravi, can you please fix this?
17474
17475         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17476
17477         * expression.cs (Argument.Emit): Handle the case of ref objects
17478         being passed to ref functions;  
17479
17480         (ParameterReference.EmitLoad): Loads the content of the pointer
17481         without dereferencing.
17482
17483 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17484
17485         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17486
17487 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17488
17489         * class.cs (Indexer.DefineMethod): Incorporate the interface
17490         type in the name of the method if we are doing explicit interface
17491         implementation.
17492
17493         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17494
17495         (BetterConversion): Fix extremely trivial bug where we were referring to
17496         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17497         again !
17498
17499         * ../errors/bug16.cs : Add although we have fixed it.
17500
17501 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17502
17503         * expression.cs (BaseIndexer): Begin implementation.
17504
17505         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17506
17507         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17508         production directly to remove a shift/reduce, and implement
17509         explicit interface implementation.
17510
17511         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17512         after a floating point suffix.
17513
17514         * expression.cs (DoNumericPromotions): Improved the conversion for
17515         uint/uint.  If we have a constant, we avoid doing a typecast to a
17516         larger type.
17517
17518         * class.cs (Indexer): Implement explicit interface implementation
17519         for indexers.
17520
17521 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17522
17523         * class.cs: make the default instance constructor public and hidebysig.
17524
17525 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17526
17527         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17528         so we can call it from elsewhere.
17529
17530         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17531         we emit it internally if the class has a defined indexer; otherwise the user
17532         emits it by decorating the class definition with the DefaultMemberAttribute.
17533
17534         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17535         attribute is not used on a type which defines an indexer.
17536
17537         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17538         character when we skip whitespace.
17539
17540         * ../errors/cs0646.cs : Add.
17541
17542 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17543
17544         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17545         again. 
17546
17547         * makefile: Add practical target `mcs3.exe' which builds the third
17548         generation compiler. 
17549
17550         * expression.cs (New): Fix structures constructor calling.
17551
17552         * class.cs (Property, Method, Indexer): Emit Final flag on the
17553         method if we are an interface implementation and we are not
17554         abstract. 
17555
17556         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17557         whether this property is referencing a `base' method.
17558
17559         * expression.cs (Invocation.EmitCall): take an extra argument:
17560         is_base, this is used to determine whether the `call' or
17561         `callvirt' opcode should be used.
17562
17563
17564         * delegate.cs: update EmitCall.
17565
17566         * class.cs (Method.Define): Set NewSlot for the cases where we are
17567         not implementing an interface method.
17568
17569         (Property.Define): ditto.
17570
17571 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17572
17573         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17574         'r'.  Allows mcs to parse itself fully.
17575
17576 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17577
17578         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17579         of the number of initializers that require the InitializeArray method.
17580
17581         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17582         update the above field where necessary.
17583
17584         (MakeByteBlob): Update accordingly.
17585
17586         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17587         greater than 2.
17588
17589         (EmitDynamicInitializers): Update in accordance with the new optimization.
17590
17591         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17592         same OpCode applies.
17593
17594         * cs-parser.jay : Fix some glaring errors I introduced.
17595
17596 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17597
17598         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17599         so that we can check for name clashes there too.
17600
17601         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17602         for interface indexers.
17603
17604         * interfaces.cs (Define): Emit the default member attribute.
17605
17606         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17607         variable was being referred to while setting the value ;-)
17608
17609 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17610
17611         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17612         byte-by-byte information when we know the data is zero.
17613
17614         Make the block always a multiple of 4, because
17615         DefineInitializedData has a bug.
17616
17617         * assign.cs: Fix, we should assign from the temporary, not from
17618         the source. 
17619
17620         * expression.cs (MakeByteBlob): Fix my incorrect code.
17621
17622 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17623
17624         * typemanager.cs (EnumToUnderlying): This function is used to get
17625         the underlying type from an enumeration, because it does not
17626         always work. 
17627
17628         * constant.cs: Use the I4_S form for values between -128 and 127.
17629
17630         * statement.cs (Block.LookupLabel): Looks up a label.
17631         (Block): Drop support for labeled blocks.
17632
17633         (LabeledStatement): New kind of statement that represents a label
17634         only.
17635
17636         (Goto): Finally implement this bad boy.
17637
17638         * cs-parser.jay: Update to reflect new mechanism to implement
17639         labels.
17640
17641 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17642
17643         * codegen.cs (EmitContext.This): a codegen property that keeps the
17644         a single instance of this instead of creating many different this
17645         instances. 
17646
17647         * delegate.cs (Delegate.DoResolve): Update to use the property;
17648
17649         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17650
17651         * expression.cs (BaseAccess.DoResolve): Ditto.
17652
17653 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17654
17655         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17656         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17657
17658         (InitCoreTypes): Update accordingly.
17659
17660         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17661         so we can quickly store the state.
17662
17663         (ApplyAttributes): Set the correct implementation flags
17664         for InternalCall methods.
17665
17666 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17667
17668         * expression.cs (EmitCall): if a method is not virtual, then do
17669         not use callvirt on it.
17670
17671         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17672         user defined stuff) requires the use of stobj, which takes an
17673         address on the stack instead of an array and an index.  So emit
17674         the Ldelema operation for it.
17675
17676         (EmitStoreOpcode): Use stobj for valuetypes.
17677
17678         (UnaryMutator.EmitCode): Use the right 1 value depending on
17679         whether we are dealing with int64/uint64, float or doubles.
17680
17681         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17682         constructors that I implemented last night.
17683
17684         (Constructor.IsDefault): Fix to work properly for static
17685         constructors.
17686
17687         * cs-parser.jay (CheckDef): report method signature errors.
17688         Update error number 103 to be 132.
17689
17690         * decl.cs: New AdditionResult enumeration value: MethodExists.
17691         Although we do this check for methods later on in the semantic
17692         analysis, catching repeated default constructors is so easy that
17693         we catch these here. 
17694
17695         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17696         promotions code.
17697
17698         (ParameterReference.EmitAssign, Emit): handle
17699         bools as bytes.
17700
17701         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17702         (ArrayAccess.EmitStoreOpcode): ditto.
17703
17704         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17705
17706         * expression.cs (MakeByteBlob): Complete all the missing types
17707         (uint, short, ushort, byte, sbyte)
17708
17709         * class.cs: Only init instance field initializers on instance
17710         constructors. 
17711
17712         Rename `constructors' to instance_constructors. 
17713
17714         (TypeContainer.AddConstructor): Only add constructors to the list
17715         if it is not static.
17716
17717         Make sure that we handle default_static_constructor independently
17718         everywhere where we handle instance_constructors
17719
17720 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17721
17722         * class.cs: Do not lookup or create a base initializer for a
17723         static constructor.
17724
17725         (ConstructorInitializer.Resolve): use the proper type to lookup
17726         for constructors.
17727
17728         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17729
17730         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17731         in DeclSpace. 
17732
17733         * decl.cs: CloseType is now an virtual method, the default
17734         implementation just closes this type.
17735
17736 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17737
17738         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17739         to PreserveSig by default. Also emit HideBySig on such methods.
17740
17741         Basically, set the defaults to standard values.
17742
17743         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17744         argument, if candidate is better, it can't be worse than the best !
17745
17746         (Invocation): Re-write bits to differentiate between methods being
17747         applicable in their expanded form and their normal form - for params
17748         methods of course.
17749
17750         Get rid of use_standard everywhere as only standard conversions are allowed
17751         in overload resolution. 
17752
17753         More spec conformance.
17754
17755 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17756
17757         * driver.cs: Add --timestamp, to see where the compiler spends
17758         most of its time.
17759
17760         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17761         `this' in static code.
17762
17763         (SimpleName.DoResolve): Implement in terms of a helper function
17764         that allows static-references to be passed upstream to
17765         MemberAccess.
17766
17767         (Expression.ResolveWithSimpleName): Resolve specially simple
17768         names when called by MemberAccess to implement the special
17769         semantics. 
17770
17771         (Expression.ImplicitReferenceConversion): Handle conversions from
17772         Null to reference types before others, as Null's type is
17773         System.Object. 
17774
17775         * expression.cs (Invocation.EmitCall): Handle the special case of
17776         calling methods declared on a reference type from a ValueType
17777         (Base classes System.Object and System.Enum)
17778
17779         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17780         the left hand side is a TypeExpr, not on every enumeration. 
17781
17782         (Binary.Resolve): If types are reference types, then do a cast to
17783         object on operators != and == of both arguments.
17784
17785         * typemanager.cs (FindMembers): Extract instance and static
17786         members if requested.
17787
17788         * interface.cs (PopulateProperty): Use void_type instead of null
17789         as the return type for the setter method.
17790
17791         (PopulateIndexer): ditto.
17792
17793 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17794
17795         * support.cs (ReflectionParameters): Fix minor bug where we
17796         were examining the wrong parameter for the ParamArray attribute.
17797
17798         Cope with requests for the type of the parameter at position
17799         greater than the params parameter's. We now return the element
17800         type of the params array as that makes more sense.
17801
17802         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17803         accordingly as we no longer have to extract the element type
17804         ourselves.
17805
17806         (Invocation.OverloadResolve): Update.
17807
17808 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17809
17810         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17811         against IEnumerator, test whether the return value is a descendant
17812         of the IEnumerator interface.
17813
17814         * class.cs (Indexer.Define): Use an auxiliary method to implement
17815         the other bits of the method definition.  Begin support for
17816         explicit interface implementation.
17817
17818         (Property.DefineMethod): Use TypeManager.void_type instead of null
17819         for an empty return value.
17820
17821 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17822
17823         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17824         dealing with a FieldExpr which is composed of a FieldBuilder, in
17825         the code path we did extract the constant, but we should have
17826         obtained the underlying value to be able to cast it (otherwise we
17827         end up in an infinite loop, this is what Ravi was running into).
17828
17829         (ArrayCreation.UpdateIndices): Arrays might be empty.
17830
17831         (MemberAccess.ResolveMemberAccess): Add support for section
17832         14.5.4.1 that deals with the special case of E.I when E is a type
17833         and something else, that I can be a reference to a static member.
17834
17835         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17836         handle a particular array type to create byte blobs, it is just
17837         something we dont generate byteblobs for.
17838
17839         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17840         arguments. 
17841
17842         * location.cs (Push): remove the key from the hashtable that we
17843         are about to add.   This happens for empty files.
17844
17845         * driver.cs: Dispose files after we have parsed them.
17846
17847         (tokenize): new function that only runs the tokenizer on its
17848         input, for speed testing.
17849
17850 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17851
17852         * class.cs (Event.Define): Define the private field only if there
17853         are no accessors defined.
17854
17855         * expression.cs (ResolveMemberAccess): If there is no associated
17856         field with the event, that means we have an event defined with its
17857         own accessors and we should flag error cs0070 since transforming
17858         ourselves into a field is not valid in that case.
17859
17860         * ecore.cs (SimpleName.DoResolve): Same as above.
17861
17862         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17863         and charset to sane values.
17864
17865 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17866
17867         * assign.cs (DoResolve): Perform check on events only if they 
17868         are being accessed outside the declaring type.
17869
17870         * cs-parser.jay (event_declarations): Update rules to correctly
17871         set the type of the implicit parameter etc.
17872
17873         (add_accessor, remove_accessor): Set current local parameters.
17874
17875         * expression.cs (Binary): For delegate addition and subtraction,
17876         cast the return value from the method into the appropriate delegate
17877         type.
17878
17879 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17880
17881         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17882         of these as the workaround is unnecessary.
17883
17884         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17885         delegate data - none of that is needed at all.
17886
17887         Re-write bits to extract the instance expression and the delegate method
17888         correctly.
17889
17890         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17891         on delegates too.
17892
17893         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17894         of attaching attributes instead of duplicating code everywhere.
17895
17896         * everywhere : Update code to do attribute emission using the above method.
17897
17898 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17899
17900         * expression.cs (IsParamsMethodApplicable): if there are not
17901         parameters, return immediately.
17902
17903         * ecore.cs: The 0 literal can be implicity converted to an enum
17904         type. 
17905
17906         (SimpleName.DoResolve): First lookup the type, then lookup the
17907         members. 
17908
17909         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17910         want to get its address.  If the InstanceExpression is not
17911         addressable, store the result in a temporary variable, then get
17912         the address of it.
17913
17914         * codegen.cs: Only display 219 errors on warning level or above. 
17915
17916         * expression.cs (ArrayAccess): Make it implement the
17917         IMemoryLocation interface.
17918
17919         (Binary.DoResolve): handle the operator == (object a, object b)
17920         and operator != (object a, object b) without incurring into a
17921         BoxedCast (because 5 != o should never be performed).
17922
17923         Handle binary enumerator operators.
17924
17925         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17926         value type, otherwise use Ldelem_ref.
17927
17928         Use precomputed names;
17929
17930         (AddressOf): Implement address of
17931
17932         * cs-parser.jay (labeled_statement): Fix recursive block
17933         addition by reworking the production.
17934
17935         * expression.cs (New.DoEmit): New has a special case:
17936                 
17937                  If we are dealing with a ValueType, we have a few
17938                  situations to deal with:
17939                 
17940                     * The target of New is a ValueType variable, that is
17941                       easy, we just pass this as the variable reference
17942                 
17943                     * The target of New is being passed as an argument,
17944                       to a boxing operation or a function that takes a
17945                       ValueType.
17946                 
17947                       In this case, we need to create a temporary variable
17948                       that is the argument of New.
17949
17950
17951 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17952
17953         * rootcontext.cs (LookupType): Check that current_type is not null before
17954         going about looking at nested types.
17955
17956         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17957         not implement the IAssignMethod interface any more.
17958
17959         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17960         where we tranform them into FieldExprs if they are being resolved from within
17961         the declaring type.
17962
17963         * ecore.cs (SimpleName.DoResolve): Do the same here.
17964
17965         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17966
17967         * ../errors/bug10.cs : Add.
17968
17969         * ../errors/cs0070.cs : Add.
17970
17971         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17972
17973         * assign.cs : Get rid of EventIsLocal everywhere.
17974
17975 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17976
17977         * ecore.cs (ConvertIntLiteral): finished the implementation.
17978
17979         * statement.cs (SwitchLabel): Convert the value we are using as a
17980         key before looking up the table.
17981
17982 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17983
17984         * codegen.cs (EmitTopBlock): Require a Location argument now.
17985
17986         * cs-parser.jay (constructor_declarator): We need to setup
17987         current_local_parameters before we parse the
17988         opt_constructor_initializer, to allow the variables to be bound
17989         to the constructor arguments.
17990
17991         * rootcontext.cs (LookupType): First lookup nested classes in our
17992         class and our parents before we go looking outside our class.
17993
17994         * expression.cs (ConstantFold): Extract/debox the values at the
17995         beginnning. 
17996
17997         * rootcontext.cs (EmitCode): Resolve the constants first before we
17998         resolve the types.  This is not really needed, but it helps debugging.
17999
18000         * statement.cs: report location.
18001
18002         * cs-parser.jay: pass location to throw statement.
18003
18004         * driver.cs: Small bug fix.
18005
18006         * report.cs: Updated format to be 4-zero filled digits.
18007
18008 2001-12-22  Ravi Pratap  <ravi@ximian.com>
18009
18010         * expression.cs (CheckIndices): Fix minor bug where the wrong
18011         variable was being referred to ;-)
18012
18013         (DoEmit): Do not call EmitStaticInitializers when the 
18014         underlying type is System.Object.
18015
18016 2001-12-21  Ravi Pratap  <ravi@ximian.com>
18017
18018         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18019         and do the usual workaround for SRE.
18020
18021         * class.cs (MyEventBuilder.EventType): New member to get at the type
18022         of the event, quickly.
18023
18024         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18025
18026         * assign.cs (Assign.DoResolve): Handle the case when the target
18027         is an EventExpr and perform the necessary checks.
18028
18029         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18030         interface.
18031
18032         (SimpleName.MemberStaticCheck): Include check for EventExpr.
18033
18034         (EventExpr): Set the type in the constructor itself since we 
18035         are meant to be born fully resolved.
18036
18037         (EventExpr.Define): Revert code I wrote earlier.
18038                 
18039         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18040         instance expression is null. The instance expression is a This in that case
18041         or a null, depending on whether it is a static method or not.
18042
18043         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18044         refers to more than one method.
18045
18046         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18047         and accordingly flag errors.
18048
18049 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18050
18051         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18052
18053 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18054
18055         * location.cs (ToString): Provide useful rutine.
18056
18057 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18058
18059         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18060         objects, return the actual integral boxed.
18061
18062         * statement.cs (SwitchLabel): define an ILLabel for each
18063         SwitchLabel. 
18064
18065         (Switch.CheckSwitch): If the value is a Literal, extract
18066         the underlying literal.
18067
18068         Also in the unused hashtable we had, add the SwitchLabel so we can
18069         quickly look this value up.
18070
18071         * constant.cs: Implement a bunch of new constants.  Rewrite
18072         Literal based on this.  Made changes everywhere to adapt to this.
18073
18074         * expression.cs (Expression.MakeByteBlob): Optimize routine by
18075         dereferencing array only once, and also copes with enumrations.
18076
18077         bytes are two bytes wide, not one.
18078
18079         (Cast): Perform constant conversions.
18080
18081         * ecore.cs (TryImplicitIntConversion): Return literals instead of
18082         wrappers to the literals here.
18083
18084         * expression.cs (DoNumericPromotions): long literals can converted
18085         to ulong implicity (this is taken care of elsewhere, but I was
18086         missing this spot).
18087
18088         * ecore.cs (Expression.Literalize): Make the return type Literal,
18089         to improve type checking.
18090
18091         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18092
18093 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18094
18095         * literal.cs: Revert code from ravi that checked the bounds.  The
18096         bounds are sane by the definition of the type itself. 
18097
18098         * typemanager.cs: Fix implementation of ImplementsInterface.  We
18099         need to actually look up in our parent hierarchy for interfaces
18100         implemented. 
18101
18102         * const.cs: Use the underlying type for enumerations
18103
18104         * delegate.cs: Compute the basename for the delegate creation,
18105         that should fix the delegate test case, and restore the correct
18106         Type Lookup semantics in rootcontext
18107
18108         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
18109         referencing a nested type with the Reflection API is using the "+"
18110         sign. 
18111
18112         * cs-parser.jay: Do not require EOF token at the end.
18113
18114 2001-12-20  Ravi Pratap  <ravi@ximian.com>
18115
18116         * rootcontext.cs (LookupType): Concatenate type names with
18117         a '.' instead of a '+' The test suite passes again.
18118
18119         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18120         field of the enumeration.
18121
18122         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18123         the case when the member is an EventExpr.
18124
18125         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18126         static has an associated instance expression.
18127
18128         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18129
18130         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18131
18132         * class.cs (Event.Define): Register event and perform appropriate checks
18133         for error #111.
18134
18135         We define the Add and Remove methods even if the use provides none because
18136         in that case, we provide default implementations ourselves.
18137
18138         Define a private field of the type of the event. This is done by the CSC compiler
18139         and we should be doing it too ;-)
18140
18141         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18142         More methods we use in code we generate.
18143
18144         (multicast_delegate_type, delegate_type): Two separate types since the distinction
18145         is important.
18146
18147         (InitCoreTypes): Update accordingly for the above.
18148
18149         * class.cs (Event.Emit): Generate code for default accessors that we provide
18150
18151         (EmitDefaultMethod): Do the job in the above.
18152
18153         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
18154         appropriate place.
18155
18156 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18157
18158         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18159         builders even if we were missing one.
18160
18161         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18162         pass the Basename as our class name instead of the Name.  The
18163         basename will be correctly composed for us.
18164
18165         * parameter.cs (Paramters): Now takes a Location argument.
18166
18167         * decl.cs (DeclSpace.LookupType): Removed convenience function and
18168         make all the code call directly LookupType in RootContext and take
18169         this chance to pass the Location information everywhere.
18170
18171         * Everywhere: pass Location information.
18172
18173 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
18174
18175         * class.cs (Constructor.Define): Updated way of detecting the
18176         length of the parameters.
18177
18178         (TypeContainer.DefineType): Use basename as the type name for
18179         nested types.
18180
18181         (TypeContainer.Define): Do not recursively define types here, as
18182         definition is taken care in order by the RootContext.
18183
18184         * tree.cs: Keep track of namespaces in a per-file basis.
18185
18186         * parameter.cs (Parameter.ComputeSignature): Update to use
18187         DeclSpace. 
18188
18189         (Parameters.GetSignature): ditto.
18190
18191         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18192         instead of a TypeContainer.
18193
18194         (Interface.SemanticAnalysis): Use `this' instead of our parent to
18195         resolve names.  Because we need to be resolve in our context, not
18196         our parents.
18197
18198         * driver.cs: Implement response files.
18199
18200         * class.cs (TypeContainer.DefineType): If we are defined, do not
18201         redefine ourselves.
18202
18203         (Event.Emit): Emit the code for add/remove handlers.
18204         (Event.Define): Save the MethodBuilders for add/remove.
18205
18206         * typemanager.cs: Use pair here too.
18207
18208         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18209         DictionaryEntry requires the first argument to be non-null.  
18210
18211         (enum_declaration): Compute full name for registering the
18212         enumeration.
18213
18214         (delegate_declaration): Instead of using
18215         formal_parameter_list, use opt_formal_parameter_list as the list
18216         can be empty.
18217
18218         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18219         (EventParsing): New property that controls whether `add' and
18220         `remove' are returned as tokens or identifiers (for events);
18221
18222 2001-12-19  Ravi Pratap  <ravi@ximian.com>
18223
18224         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18225         use MyEventBuilder only and let it wrap the real builder for us.
18226
18227         (MyEventBuilder): Revamp constructor etc.
18228
18229         Implement all operations that we perform on EventBuilder in precisely the same
18230         way here too.
18231
18232         (FindMembers): Update to use the EventBuilder member.
18233
18234         (Event.Emit): Update accordingly.
18235
18236 2001-12-18  Ravi Pratap  <ravi@ximian.com>
18237
18238         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18239         by calling the appropriate methods.
18240
18241         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18242         useful.
18243
18244         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18245
18246 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18247
18248         * delegate.cs (Delegate.Populate): Check that the return type
18249         and various parameters types are indeed accessible.
18250
18251         * class.cs (Constructor.Define): Same here.
18252
18253         (Field.Define): Ditto.
18254
18255         (Event.Define): Ditto.
18256
18257         (Operator.Define): Check that the underlying Method defined itself
18258         correctly - so it's MethodBuilder should not be null.
18259
18260         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18261         expression happens to be null.
18262
18263         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18264         members but as of now we don't seem to be able to do anything really useful with it.
18265
18266         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18267         not the EventBuilder.
18268
18269 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18270
18271         * cs-tokenizer.cs: Add support for defines.
18272         Add support for #if, #elif, #else, #endif
18273
18274         (eval_var): evaluates a variable.
18275         (eval): stubbed for evaluating functions.
18276
18277         * cs-parser.jay: Pass the defines information
18278
18279         * driver.cs: Add --define command line option.
18280
18281         * decl.cs: Move MemberCore here.
18282
18283         Make it the base class for DeclSpace.  This allows us to catch and
18284         report 108 and 109 for everything now.
18285
18286         * class.cs (TypeContainer.Define): Extract all the members
18287         before populating and emit the warning 108 (new keyword required
18288         to override) instead of having each member implement this.
18289
18290         (MemberCore.Define): New abstract method, we will be using this in
18291         the warning reporting engine in Populate.
18292
18293         (Operator.Define): Adjust to new MemberCore protocol. 
18294
18295         * const.cs (Const): This does not derive from Expression, it is a
18296         temporary object we use to create fields, it is a MemberCore. 
18297
18298         * class.cs (Method.Define): Allow the entry point to be in a
18299         specific class.
18300
18301         * driver.cs: Rewrite the argument handler to clean it up a bit.
18302
18303         * rootcontext.cs: Made it just an auxiliary namespace feature by
18304         making everything static.
18305
18306         * driver.cs: Adapt code to use RootContext type name instead of
18307         instance variable.
18308
18309         * delegate.cs: Remove RootContext argument.
18310
18311         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18312         argument. 
18313
18314         * class.cs (Event.Define): The lookup can fail.
18315
18316         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18317
18318         * expression.cs: Resolve the this instance before invoking the code.
18319
18320 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18321
18322         * cs-parser.jay: Add a production in element_access that allows
18323         the thing to become a "type" reference.  This way we can parse
18324         things like "(string [])" as a type.
18325
18326         Note that this still does not handle the more complex rules of
18327         casts. 
18328
18329
18330         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18331
18332         * ecore.cs: (CopyNewMethods): new utility function used to
18333         assemble the list of methods from running FindMembers.
18334
18335         (MemberLookup): Rework FindMembers so that 
18336
18337 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18338
18339         * class.cs (TypeContainer): Remove Delegates who fail to be
18340         defined.
18341
18342         * delegate.cs (Populate): Verify that we dont get null return
18343         values.   TODO: Check for AsAccessible.
18344
18345         * cs-parser.jay: Use basename to emit error 574 (destructor should
18346         have the same name as container class), not the full name.
18347
18348         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18349         possible representation.  
18350
18351         Also implements integer type suffixes U and L.
18352
18353 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18354
18355         * expression.cs (ArrayCreation.DoResolve): We need to do the
18356         argument resolution *always*.
18357
18358         * decl.cs: Make this hold the namespace.  Hold the root context as
18359         well.
18360         (LookupType): Move here.
18361
18362         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18363
18364         * location.cs (Row, Name): Fixed the code, it was always returning
18365         references to the first file.
18366
18367         * interface.cs: Register properties defined through interfaces.
18368
18369         * driver.cs: Add support for globbing on the command line
18370
18371         * class.cs (Field): Make it derive from MemberCore as well.
18372         (Event): ditto.
18373
18374 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18375
18376         * class.cs (Event::Define): Check that the type of the event is a delegate
18377         type else flag error #66.
18378
18379         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18380         same.
18381
18382         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18383         values of EntryPoint, CharSet etc etc.
18384
18385         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18386
18387         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18388         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18389         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18390         which needs this to do its work.
18391
18392         * ../errors/cs0066.cs : Add.
18393
18394 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18395
18396         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18397         helper functions.
18398
18399         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18400         clears out the parameters field.
18401         (MemberSignatureCompare): Cleanup
18402
18403         (MemberCore): New base class used to share code between MethodCore
18404         and Property.
18405
18406         (RegisterRequiredImplementations) BindingFlags.Public requires
18407         either BindingFlags.Instace or Static.  Use instance here.
18408
18409         (Property): Refactored code to cope better with the full spec.
18410
18411         * parameter.cs (GetParameterInfo): Return an empty array instead
18412         of null on error.
18413
18414         * class.cs (Property): Abstract or extern properties have no bodies.
18415
18416         * parameter.cs (GetParameterInfo): return a zero-sized array.
18417
18418         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18419         method modifier validation to the typecontainer so we can reuse
18420         this on properties.
18421
18422         (MethodCore.ParameterTypes): return an empty sized array of types.
18423
18424         (Property.Define): Test property modifier validity.
18425
18426         Add tests for sealed/override too.
18427
18428         (Method.Emit): abstract or extern methods have no bodies.
18429
18430 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18431
18432         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18433         thing.
18434
18435         (Method::Define, ::Emit): Modify accordingly.
18436
18437         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18438
18439         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18440
18441         * makefile: Pass in /unsafe.
18442
18443 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18444
18445         * class.cs (MakeKey): Kill routine.
18446
18447         * class.cs (TypeContainer.Define): Correctly define explicit
18448         method implementations (they require the full interface name plus
18449         the method name).
18450
18451         * typemanager.cs: Deply the PtrHashtable here and stop using the
18452         lame keys.  Things work so much better.
18453
18454         This of course broke everyone who depended on `RegisterMethod' to
18455         do the `test for existance' test.  This has to be done elsewhere.
18456
18457         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18458         the object stupid Equals method (because, that like fails all over
18459         the place).  We still do not use it.
18460
18461         * class.cs (TypeContainer.SetRequiredInterface,
18462         TypeContainer.RequireMethods): Killed these two routines and moved
18463         all the functionality to RegisterRequiredImplementations.
18464
18465         (TypeContainer.RegisterRequiredImplementations): This routine now
18466         registers all the implementations required in an array for the
18467         interfaces and abstract methods.  We use an array of structures
18468         which can be computed ahead of time to reduce memory usage and we
18469         also assume that lookups are cheap as most classes will not
18470         implement too many interfaces.
18471
18472         We also avoid creating too many MethodSignatures.
18473
18474         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18475         clear the "pending" bit if we find that there are problems with
18476         the declaration.
18477
18478         (TypeContainer.VerifyPendingMethods): Update to report errors of
18479         methods that look like implementations but are not.
18480
18481         (TypeContainer.Define): Add support for explicit interface method
18482         implementation. 
18483
18484 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18485
18486         * typemanager.cs: Keep track of the parameters here instead of
18487         being a feature of the TypeContainer.
18488
18489         * class.cs: Drop the registration of parameters here, as
18490         InterfaceMethods are also interface declarations.
18491
18492         * delegate.cs: Register methods with the TypeManager not only with
18493         the TypeContainer.  This code was buggy.
18494
18495         * interface.cs: Full registation here.
18496
18497 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18498
18499         * expression.cs: Remove reducer for binary expressions, it can not
18500         be done this way.
18501
18502         * const.cs: Put here the code that used to go into constant.cs
18503
18504         * constant.cs: Put here the code for constants, this is a new base
18505         class for Literals.
18506
18507         * literal.cs: Make Literal derive from Constant.
18508
18509 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18510
18511         * statement.cs (Return.Emit): Report error 157 if the user
18512         attempts to return from a finally block.
18513
18514         (Return.Emit): Instead of emitting a return, jump to the end of
18515         the function.
18516
18517         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18518         LocalBuilder to store the result of the function.  ReturnLabel is
18519         the target where we jump.
18520
18521
18522 2001-12-09  Radek Doulik  <rodo@ximian.com>
18523
18524         * cs-parser.jay: remember alias in current namespace
18525
18526         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18527         namespaces
18528
18529         * class.cs (LookupAlias): lookup alias in my_namespace
18530
18531         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18532         aliases hashtable
18533         (LookupAlias): lookup alias in this and if needed in parent
18534         namespaces
18535
18536 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18537
18538         * support.cs: 
18539
18540         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18541         making things static.  I need this to avoid passing the
18542         TypeContainer when calling ParameterType.
18543
18544         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18545         that did string manipulation to compute the type and then call
18546         GetType.  Use Parameter.ParameterType instead.
18547
18548         * cs-tokenizer.cs: Consume the suffix for floating values.
18549
18550         * expression.cs (ParameterReference): figure out whether this is a
18551         reference parameter or not.  Kill an extra variable by computing
18552         the arg_idx during emission.
18553
18554         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18555         function that returns whether a parameter is an out/ref value or not.
18556
18557         (Parameter.ParameterType): The type of the parameter (base,
18558         without ref/out applied).
18559
18560         (Parameter.Resolve): Perform resolution here.
18561         (Parameter.ExternalType): The full type (with ref/out applied).
18562
18563         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18564         support for expressions on the using statement.
18565
18566 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18567
18568         * statement.cs (Using.EmitLocalVariableDecls): Split the
18569         localvariable handling of the using statement.
18570
18571         (Block.EmitMeta): Keep track of variable count across blocks.  We
18572         were reusing slots on separate branches of blocks.
18573
18574         (Try.Emit): Emit the general code block, we were not emitting it. 
18575
18576         Check the type of the declaration to be an IDisposable or
18577         something that can be implicity converted to it. 
18578
18579         Emit conversions if required.
18580
18581         * ecore.cs (EmptyExpression): New utility class.
18582         (Expression.ImplicitConversionExists): New utility function.
18583
18584 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18585
18586         * statement.cs (Using): Implement.
18587
18588         * expression.cs (LocalVariableReference): Support read only variables.
18589
18590         * statement.cs: Remove the explicit emit for the Leave opcode.
18591         (VariableInfo): Add a readonly field.
18592
18593 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18594
18595         * ecore.cs (ConvCast): new class used to encapsulate the various
18596         explicit integer conversions that works in both checked and
18597         unchecked contexts.
18598
18599         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18600         properly generate the overflow opcodes.
18601
18602 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18603
18604         * statement.cs: The correct type for the EmptyExpression is the
18605         element_type, not the variable type.  Ravi pointed this out.
18606
18607 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18608
18609         * class.cs (Method::Define): Handle PInvoke methods specially
18610         by using DefinePInvokeMethod instead of the usual one.
18611
18612         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18613         above to do the task of extracting information and defining the method.
18614
18615 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18616
18617         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18618         of the condition for string type.
18619
18620         (Emit): Move that here. 
18621
18622         (ArrayCreation::CheckIndices): Keep string literals in their expression
18623         form.
18624
18625         (EmitDynamicInitializers): Handle strings appropriately.
18626
18627 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18628
18629         * codegen.cs (EmitContext): Replace multiple variables with a
18630         single pointer to the current Switch statement.
18631
18632         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18633         EmitContext.
18634
18635 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18636
18637         * statement.cs 
18638
18639         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18640         default'.
18641
18642         (Foreach.Emit): Foreach on arrays was not setting
18643         up the loop variables (for break/continue).
18644
18645         (GotoCase): Semi-implented.
18646
18647 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18648
18649         * attribute.cs (CheckAttribute): Handle system attributes by using
18650         Attribute.GetAttributes to examine information we need.
18651
18652         (GetValidPlaces): Same here.
18653
18654         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18655
18656         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18657
18658         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18659
18660         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18661
18662         (Method::Emit): Handle the case when we are a PInvoke method.
18663
18664 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18665
18666         * expression.cs: Use ResolveWithSimpleName on compound names.
18667
18668 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18669
18670         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18671         before trying to reduce it.
18672
18673         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18674
18675         * constant.cs (LookupConstantValue): Implement.
18676
18677         (EmitConstant): Use the above in emitting the constant.
18678
18679         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18680         that are user-defined by doing a LookupConstantValue on them.
18681
18682         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18683         too, like above.
18684
18685 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18686
18687         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18688
18689         (BaseAccess.DoResolve): Implement.
18690
18691         (MemberAccess.DoResolve): Split this routine into a
18692         ResolveMemberAccess routine that can be used independently
18693
18694 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18695
18696         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18697         As that share bits of the implementation.  Is returns a boolean,
18698         while As returns the Type that is being probed.
18699
18700 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18701
18702         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18703         instead of a Literal - much easier.
18704
18705         (EnumInTransit): Remove - utterly useless :-)
18706
18707         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18708
18709         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18710
18711         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18712         chain when we have no associated expression.
18713
18714 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18715
18716         * constant.cs (Define): Use Location while reporting the errror.
18717
18718         Also emit a warning when 'new' is used and there is no inherited
18719         member to hide.
18720
18721         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18722         populated.
18723
18724         (LookupEnumValue): Implement to lookup an enum member's value and define it
18725         if necessary.
18726
18727         (Populate): Re-write accordingly to use the above routine.
18728
18729 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18730
18731         * expression.cs (This): Fix prototype for DoResolveLValue to
18732         override the base class DoResolveLValue.
18733
18734         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18735         declarations) 
18736
18737         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18738         (we need to load the address of the field here).  This fixes
18739         test-22. 
18740
18741         (FieldExpr.DoResolveLValue): Call the DoResolve
18742         function to initialize the Instance expression.
18743
18744         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18745         correctly the GetEnumerator operation on a value type.
18746
18747         * cs-parser.jay: Add more simple parsing error catches.
18748
18749         * statement.cs (Switch): Add support for string switches.
18750         Handle null specially.
18751
18752         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18753
18754 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18755
18756         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18757
18758         (declare_local_constant): New helper function.
18759
18760         * statement.cs (AddConstant): Keep a separate record of constants
18761
18762         (IsConstant): Implement to determine if a variable is a constant.
18763
18764         (GetConstantExpression): Implement.
18765
18766         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18767
18768         * statement.cs (IsVariableDefined): Re-write.
18769
18770 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18771
18772         * class.cs (TypeContainer::FindMembers): Look for constants
18773         in the case when we are looking for MemberTypes.Field
18774
18775         * expression.cs (MemberAccess::DoResolve): Check that in the
18776         case we are a FieldExpr and a Literal, we are not being accessed
18777         by an instance reference.
18778
18779         * cs-parser.jay (local_constant_declaration): Implement.
18780
18781         (declaration_statement): Implement for constant declarations.
18782
18783 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18784
18785         * statement.cs (Switch): Catch double defaults.
18786
18787         (Switch): More work on the switch() statement
18788         implementation.  It works for integral values now, need to finish
18789         string support.
18790
18791
18792 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18793
18794         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18795         integer literals into other integer literals.  To be used by
18796         switch. 
18797
18798 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18799
18800         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18801         some memory.
18802
18803         (EmitDynamicInitializers): Cope with the above since we extract data
18804         directly from ArrayData now.
18805
18806         (ExpectInitializers): Keep track of whether initializers are mandatory
18807         or not.
18808
18809         (Bounds): Make it a hashtable to prevent the same dimension being 
18810         recorded for every element in that dimension.
18811
18812         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18813         from being found.
18814
18815         Also fix bug which was causing the indices to be emitted in the reverse
18816         order.
18817
18818 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18819
18820         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18821         unfinished.  They do not work, because the underlying code is
18822         sloppy.
18823
18824 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18825
18826         * cs-parser.jay: Remove bogus fixme.
18827
18828         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18829         on Switch statement.
18830
18831 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18832
18833         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18834         the same. 
18835
18836         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18837         parameter. Apparently, any expression is allowed. 
18838
18839         (ValidateInitializers): Update accordingly.
18840
18841         (CheckIndices): Fix some tricky bugs thanks to recursion.
18842
18843         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18844         I was being completely brain-dead.
18845
18846         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18847         and re-write acordingly.
18848
18849         (DelegateInvocation): Re-write accordingly.
18850
18851         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18852
18853         (MakeByteBlob): Handle types more correctly.
18854
18855         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18856         initialization from expressions but it is incomplete because I am a complete
18857         Dodo :-|
18858
18859 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18860
18861         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18862         on If.  Basically, we have to return `true' (ie, we do return to
18863         our caller) only if both branches of the if return.
18864
18865         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18866         short-circuit operators, handle them as short circuit operators. 
18867
18868         (Cast.DoResolve): Resolve type.
18869         (Cast.Cast): Take an expression as the target type.
18870
18871         * cs-parser.jay (cast_expression): Remove old hack that only
18872         allowed a limited set of types to be handled.  Now we take a
18873         unary_expression and we resolve to a type during semantic
18874         analysis.
18875
18876         Use the grammar productions from Rhys to handle casts (this is
18877         not complete like Rhys syntax yet, we fail to handle that corner
18878         case that C# has regarding (-x), but we will get there.
18879
18880 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18881
18882         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18883         field which is an array type.
18884
18885         * cs-parser.jay (declare_local_variables): Support array initialization too.
18886
18887         * typemanager.cs (MakeKey): Implement.
18888
18889         (everywhere): Use the above appropriately.
18890
18891         * cs-parser.jay (for_statement): Update for array initialization while
18892         declaring variables.
18893
18894         * ecore.cs : The error message was correct, it's the variable's names that
18895         were misleading ;-) Make the code more readable.
18896
18897         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18898         the correct type etc.
18899
18900         (ConvertExplicit): Handle Enum types by examining the underlying type.
18901
18902 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18903
18904         * parameter.cs (GetCallingConvention): Always return
18905         CallingConventions.Standard for now.
18906
18907 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18908
18909         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18910         and `r' after calling DoNumericPromotions.
18911
18912         * ecore.cs: Fix error message (the types were in the wrong order).
18913
18914         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18915         BindingFlags.Instance as well 
18916
18917         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18918         implicit int literal conversion in an empty cast so that we
18919         propagate the right type upstream.
18920
18921         (UnboxCast): new class used to unbox value types.
18922         (Expression.ConvertExplicit): Add explicit type conversions done
18923         by unboxing.
18924
18925         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18926         the target type before applying the implicit LongLiterals to ULong
18927         literal cast.
18928
18929 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18930
18931         * cs-parser.jay (for_statement): Reworked the way For works: now
18932         we declare manually any variables that are introduced in
18933         for_initializer to solve the problem of having out-of-band code
18934         emition (that is what got for broken).
18935
18936         (declaration_statement): Perform the actual variable declaration
18937         that used to be done in local_variable_declaration here.
18938
18939         (local_variable_declaration): Do not declare anything, just pass
18940         the information on a DictionaryEntry
18941
18942 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18943
18944         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18945         re-write of the logic to now make it recursive.
18946
18947         (UpdateIndices): Re-write accordingly.
18948
18949         Store element data in a separate ArrayData list in the above methods.
18950
18951         (MakeByteBlob): Implement to dump the array data into a byte array.
18952
18953 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18954
18955         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18956         into CheckIndices.
18957
18958         * constant.cs (Define): Implement.
18959
18960         (EmitConstant): Re-write fully.
18961
18962         Pass in location info.
18963
18964         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18965         respectively.
18966
18967         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18968         DictionaryEntry since we need location info too.
18969
18970         (constant_declaration): Update accordingly.
18971
18972         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18973         code into another method : UpdateIndices.
18974
18975 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18976
18977         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18978         some type checking etc.
18979
18980 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18981
18982         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18983         bits to provide dimension info if the user skips doing that.
18984
18985         Update second constructor to store the rank correctly.
18986
18987 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18988
18989         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18990         and try to implement.
18991
18992         * ../errors/cs0150.cs : Add.
18993
18994         * ../errors/cs0178.cs : Add.
18995
18996 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18997
18998         * statement.cs: Implement foreach on multi-dimensional arrays. 
18999
19000         * parameter.cs (Parameters.GetParameterByName): Also lookup the
19001         name of the params argument.
19002
19003         * expression.cs: Use EmitStoreOpcode to get the right opcode while
19004         initializing the array.
19005
19006         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19007         we can use this elsewhere.
19008
19009         * statement.cs: Finish implementation of foreach for single
19010         dimension arrays.
19011
19012         * cs-parser.jay: Use an out-of-band stack to pass information
19013         around, I wonder why I need this.
19014
19015         foreach_block: Make the new foreach_block the current_block.
19016
19017         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19018         function used to return a static Parameters structure.  Used for
19019         empty parameters, as those are created very frequently.
19020
19021         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19022
19023 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19024
19025         * interface.cs : Default modifier is private, not public. The
19026         make verify test passes again.
19027
19028 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19029
19030         * support.cs (ReflectionParameters): Fix logic to determine
19031         whether the last parameter is a params one. Test 9 passes again.
19032
19033         * delegate.cs (Populate): Register the builders we define with
19034         RegisterParameterForBuilder. Test 19 passes again.
19035
19036         * cs-parser.jay (property_declaration): Reference $6 instead
19037         of $$ to get at the location.
19038
19039         (indexer_declaration): Similar stuff.
19040
19041         (attribute): Ditto.
19042
19043         * class.cs (Property): Register parameters for the Get and Set methods
19044         if they exist. Test 23 passes again.
19045
19046         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19047         call to EmitArguments as we are sure there aren't any params arguments. 
19048         Test 32 passes again.
19049
19050         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19051         IndexOutOfRangeException. 
19052
19053         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19054         Test 33 now passes again.
19055
19056 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
19057
19058         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19059         broke a bunch of things.  Will have to come up with a better way
19060         of tracking locations.
19061
19062         * statement.cs: Implemented foreach for single dimension arrays.
19063
19064 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19065
19066         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19067         an error.  This removes the lookup from the critical path.
19068
19069         * cs-parser.jay: Removed use of temporary_loc, which is completely
19070         broken. 
19071
19072 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
19073
19074         * support.cs (ReflectionParameters.ParameterModifier): Report
19075         whether the argument is a PARAMS argument or not.
19076
19077         * class.cs: Set the attribute `ParamArrayAttribute' on the
19078         parameter argument.
19079
19080         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19081         and cons_param_array_attribute (ConstructorInfo for
19082         ParamArrayAttribute)., 
19083
19084         * codegen.cs: Emit the return using the `Return' statement, that
19085         way we can report the error correctly for missing return values. 
19086
19087         * class.cs (Method.Emit): Clean up.
19088
19089         * expression.cs (Argument.Resolve): Take another argument: the
19090         location where this argument is used.  Notice that this is not
19091         part of the "Argument" class as to reduce the size of the
19092         structure (we know the approximate location anyways).
19093
19094         Test if the argument is a variable-reference, if not, then
19095         complain with a 206.
19096
19097         (Argument.Emit): Emit addresses of variables.
19098
19099         (Argument.FullDesc): Simplify.
19100
19101         (Invocation.DoResolve): Update for Argument.Resolve.
19102
19103         (ElementAccess.DoResolve): ditto.
19104
19105         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19106         method should be virtual, as this method is always virtual.
19107
19108         (NewDelegate.DoResolve): Update for Argument.Resolve.
19109
19110         * class.cs (ConstructorInitializer.DoResolve): ditto.
19111
19112         * attribute.cs (Attribute.Resolve): ditto.
19113
19114 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
19115
19116         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19117
19118         * expression.cs (ParameterReference): Drop IStackStorage and implement
19119         IAssignMethod instead. 
19120
19121         (LocalVariableReference): ditto.
19122
19123         * ecore.cs (FieldExpr): Drop IStackStorage and implement
19124         IAssignMethod instead. 
19125
19126 2001-11-13  Miguel de Icaza <miguel@ximian.com>
19127
19128         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19129         enumerations that are used in heavily used structures derive from
19130         byte in a laughable and pathetic attempt to reduce memory usage.
19131         This is the kind of pre-optimzations that you should not do at
19132         home without adult supervision.
19133
19134         * expression.cs (UnaryMutator): New class, used to handle ++ and
19135         -- separatedly from the other unary operators.  Cleans up the
19136         code, and kills the ExpressionStatement dependency in Unary.
19137
19138         (Unary): Removed `method' and `Arguments' from this class, making
19139         it smaller, and moving it all to SimpleCall, so I can reuse this
19140         code in other locations and avoid creating a lot of transient data
19141         strucutres when not required.
19142
19143         * cs-parser.jay: Adjust for new changes.
19144
19145 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
19146
19147         * enum.cs (Enum.Populate): If there is a failure during
19148         definition, return
19149
19150         * cs-parser.jay (opt_enum_base): we used to catch type errors
19151         here, but this is really incorrect.  The type error should be
19152         catched during semantic analysis.
19153
19154 2001-12-11  Ravi Pratap  <ravi@ximian.com>
19155
19156         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19157         current_local_parameters as expected since I, in my stupidity, had forgotten
19158         to do this :-)
19159
19160         * attribute.cs (GetValidPlaces): Fix stupid bug.
19161
19162         * class.cs (Method::Emit): Perform check on applicability of attributes.
19163
19164         (Constructor::Emit): Ditto.
19165
19166         (Field::Emit): Ditto.
19167
19168         (Field.Location): Store location information.
19169
19170         (Property, Event, Indexer, Operator): Ditto.
19171
19172         * cs-parser.jay (field_declaration): Pass in location for each field.
19173
19174         * ../errors/cs0592.cs : Add.
19175
19176 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19177
19178         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19179
19180         (InitCoreTypes): Update accordingly.
19181
19182         (RegisterAttrType, LookupAttr): Implement.
19183
19184         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19185         info about the same.
19186
19187         (Resolve): Update to populate the above as necessary.
19188
19189         (Error592): Helper.
19190
19191         (GetValidPlaces): Helper to the above.
19192
19193         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19194
19195         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19196
19197 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19198
19199         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19200
19201         * ../errors/cs0617.cs : Add.
19202
19203 2001-11-11  Ravi Pratap  <ravi@ximian.com>
19204
19205         * enum.cs (Emit): Rename to Populate to be more consistent with what
19206         we expect it to do and when exactly it is called.
19207
19208         * class.cs, rootcontext.cs : Update accordingly.
19209
19210         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19211         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19212
19213         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19214
19215         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19216         of a fieldinfo using the above, when dealing with a FieldBuilder.
19217
19218 2001-11-10  Ravi Pratap  <ravi@ximian.com>
19219
19220         * ../errors/cs0031.cs : Add.
19221
19222         * ../errors/cs1008.cs : Add.
19223
19224         * ../errrors/cs0543.cs : Add.
19225
19226         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19227         enum type.
19228
19229         (FindMembers): Implement.
19230
19231         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19232         enums and delegates too.
19233
19234         (enum_types): Rename to builder_to_enum.
19235
19236         (delegate_types): Rename to builder_to_delegate.
19237
19238         * delegate.cs (FindMembers): Implement.
19239
19240 2001-11-09  Ravi Pratap  <ravi@ximian.com>
19241
19242         * typemanager.cs (IsEnumType): Implement.
19243
19244         * enum.cs (Emit): Re-write parts to account for the underlying type
19245         better and perform checking etc.
19246
19247         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19248         of the underlying type.
19249
19250         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19251         value
19252
19253         * enum.cs (error31): Helper to report error #31.
19254
19255         * cs-parser.jay (enum_declaration): Store location of each member too.
19256
19257         * enum.cs (member_to_location): New hashtable. 
19258
19259         (AddEnumMember): Update location hashtable.
19260
19261         (Emit): Use the location of each member while reporting errors.
19262
19263 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19264
19265         * cs-parser.jay: A for_initializer if is a
19266         local_variable_declaration really ammount to have an implicit
19267         block with the variable declaration and no initializer for for.
19268
19269         * statement.cs (For.Emit): Cope with null initializers.
19270
19271         This fixes the infinite loop on for initializers.
19272
19273 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19274
19275         * enum.cs: More cleanup.
19276
19277         * ecore.cs: Remove dead code.
19278
19279         * class.cs (Property.Emit): More simplification.
19280         (Event.Emit): ditto.
19281
19282         Reworked to have less levels of indentation.
19283
19284 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19285
19286         * class.cs (Property): Emit attributes.
19287
19288         (Field): Ditto.
19289
19290         (Event): Ditto.
19291
19292         (Indexer): Ditto.
19293
19294         (Operator): Ditto.
19295
19296         * enum.cs (Emit): Ditto.
19297
19298         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19299         Enums too.
19300
19301         * class.cs (Field, Event, etc.): Move attribute generation into the
19302         Emit method everywhere.
19303
19304         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19305         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19306         as we had no way of defining nested enums !
19307
19308         * rootcontext.cs : Adjust code accordingly.
19309
19310         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19311
19312 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19313
19314         * expression.cs (EvalConstantExpression): Move into ecore.cs
19315
19316         * enum.cs (Enum): Rename some members and make them public and readonly
19317         according to our convention.
19318
19319         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19320         nothing else.
19321
19322         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19323
19324         (Enum::Emit): Write a simple version for now which doesn't try to compute
19325         expressions. I shall modify this to be more robust in just a while.
19326
19327         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19328
19329         (TypeContainer::CloseType): Create the Enum types too.
19330
19331         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19332
19333         * expression.cs (EvalConstantExpression): Get rid of completely.
19334
19335         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19336         user-defined values and other cases.
19337
19338         (IsValidEnumLiteral): Helper function.
19339
19340         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19341         out there in the case we had a literal FieldExpr.
19342
19343         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19344
19345         (Literalize): Revamp a bit to take two arguments.
19346
19347         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19348
19349 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19350
19351         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19352
19353         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19354
19355         (Resolve): Use the above to ensure we have proper initializers.
19356
19357 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19358
19359         * expression.cs (Expression::EvalConstantExpression): New method to 
19360         evaluate constant expressions.
19361
19362         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19363
19364 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19365
19366         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19367         in an array.
19368
19369         (Binary.ResolveOperator): Handle operator != (object a, object b)
19370         and operator == (object a, object b);
19371
19372         (Binary.DoNumericPromotions): Indicate whether the numeric
19373         promotion was possible.
19374
19375         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19376         Implement.  
19377
19378         Made the ArrayAccess implement interface IAssignMethod instead of
19379         IStackStore as the order in which arguments are passed reflects
19380         this.
19381
19382         * assign.cs: Instead of using expr.ExprClass to select the way of
19383         assinging, probe for the IStackStore/IAssignMethod interfaces.
19384
19385         * typemanager.cs: Load InitializeArray definition.
19386
19387         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19388         static data that can be used to initialize arrays. 
19389
19390 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19391
19392         * expression.cs: Handle operator== and operator!= for booleans.
19393
19394         (Conditioal.Reduce): Implement reducer for the ?: operator.
19395
19396         (Conditional.Resolve): Implement dead code elimination.
19397
19398         (Binary.Resolve): Catch string literals and return a new
19399         concatenated string.
19400
19401         (Unary.Reduce): Implement reduction of unary expressions.
19402
19403         * ecore.cs: Split out the expression core handling here.
19404
19405         (Expression.Reduce): New method used to perform constant folding
19406         and CSE.  This is needed to support constant-expressions. 
19407
19408         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19409         targets, and optimize for !x.
19410
19411 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19412
19413         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19414         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19415         set custom atttributes.
19416
19417         * literal.cs (Literal::GetValue): New abstract method to return the actual
19418         value of the literal, cast as an object.
19419
19420         (*Literal): Implement GetValue method.
19421
19422         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19423         expressions to the arraylist but objects of type Argument.
19424
19425         * class.cs (TypeContainer::Emit): Emit our attributes too.
19426
19427         (Method::Emit, Constructor::Emit): Ditto.
19428
19429         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19430         to be ignoring earlier.
19431
19432 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19433
19434         * attribute.cs (AttributeSection::Define): Implement to do the business
19435         of constructing a CustomAttributeBuilder.
19436
19437         (Attribute): New trivial class. Increases readability of code.  
19438
19439         * cs-parser.jay : Update accordingly.
19440
19441         (positional_argument_list, named_argument_list, named_argument): New rules
19442
19443         (attribute_arguments): Use the above so that we are more correct.
19444
19445 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19446
19447         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19448         to perform all checks for a method with a params parameter.
19449
19450         (Invocation::OverloadResolve): Update to use the above method and therefore
19451         cope correctly with params method invocations.
19452
19453         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19454         params too.
19455
19456         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19457         constructors in our parent too because we can't afford to miss out on 
19458         protected ones ;-)
19459
19460         * attribute.cs (AttributeSection): New name for the class Attribute
19461
19462         Other trivial changes to improve readability.
19463
19464         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19465         use the new class names.
19466
19467 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19468
19469         * class.cs (Method::Define): Complete definition for params types too
19470
19471         (Indexer::Define): Ditto.
19472
19473         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19474         Cope everywhere with a request for info about the array parameter.
19475
19476 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19477
19478         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19479
19480         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19481         local_variable_type to extract the string corresponding to the type.
19482
19483         (local_variable_type): Fixup the action to use the new helper method.
19484
19485         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19486         go.
19487
19488         * expression.cs : Clean out code which uses the above.
19489
19490 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19491
19492         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19493         and bale out if necessary by returning a false.
19494
19495         (RegisterProperty): Ditto.
19496
19497         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19498         and print out appropriate error messages.
19499
19500         * interface.cs (everywhere): Ditto.
19501
19502         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19503         location to constructor.
19504
19505         * class.cs (Property, Event, Indexer): Update accordingly.
19506
19507         * ../errors/cs111.cs : Added.
19508
19509         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19510         of a method, as laid down by the spec.
19511
19512         (Invocation::OverloadResolve): Use the above method.
19513
19514 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19515
19516         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19517         now take a TypeContainer and a Parameters object.
19518
19519         (ParameterData): Modify return type of ParameterModifier method to be 
19520         Parameter.Modifier and not a string.
19521
19522         (ReflectionParameters, InternalParameters): Update accordingly.
19523
19524         * expression.cs (Argument::GetParameterModifier): Same here.
19525
19526         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19527         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19528         symbol in it at all so maybe this is only for now.
19529
19530 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19531
19532         * support.cs (InternalParameters): Constructor now takes an extra argument 
19533         which is the actual Parameters class.
19534
19535         (ParameterDesc): Update to provide info on ref/out modifiers.
19536
19537         * class.cs (everywhere): Update call to InternalParameters to pass in
19538         the second argument too.
19539
19540         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19541         to return the modifier info [ref/out etc]
19542
19543         (InternalParameters, ReflectionParameters): Implement the above.
19544
19545         * expression.cs (Argument::ParameterModifier): Similar function to return
19546         info about the argument's modifiers.
19547
19548         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19549         too.
19550
19551         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19552         a new SetFormalParameters object which we pass to InternalParameters.
19553
19554 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19555
19556         * expression.cs (NewArray): Merge into the ArrayCreation class.
19557
19558 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19559
19560         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19561         NewUserdefinedArray into one as there wasn't much of a use in having
19562         two separate ones.
19563
19564         * expression.cs (Argument): Change field's name to ArgType from Type.
19565
19566         (Type): New readonly property which returns the proper type, taking into 
19567         account ref/out modifiers.
19568
19569         (everywhere): Adjust code accordingly for the above.
19570
19571         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19572         whether we are emitting for a ref or out parameter.
19573
19574         * expression.cs (Argument::Emit): Use the above field to set the state.
19575
19576         (LocalVariableReference::Emit): Update to honour the flag and emit the
19577         right stuff.
19578
19579         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19580
19581         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19582
19583         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19584
19585         (ReflectionParameters, InternalParameters): Implement the above method.
19586
19587         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19588         reporting errors.
19589
19590         (Invocation::FullMethodDesc): Ditto. 
19591
19592 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19593
19594         * cs-parser.jay: Add extra production for the second form of array
19595         creation. 
19596
19597         * expression.cs (ArrayCreation): Update to reflect the above
19598         change. 
19599
19600         * Small changes to prepare for Array initialization.
19601
19602 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19603
19604         * typemanager.cs (ImplementsInterface): interface might be null;
19605         Deal with this problem;
19606
19607         Also, we do store negative hits on the cache (null values), so use
19608         this instead of calling t.GetInterfaces on the type everytime.
19609
19610 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19611
19612         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19613
19614         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19615         split functionality out into different classes.
19616
19617         (New::FormArrayType): Move into NewBuiltinArray.
19618
19619         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19620         quite useless.
19621
19622         (NewBuiltinArray): New class to handle creation of built-in arrays.
19623
19624         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19625         account creation of one-dimensional arrays.
19626
19627         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19628
19629         (NewUserdefinedArray::DoResolve): Implement.
19630
19631         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19632
19633         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19634         we maintain inside the TypeManager. This is necessary to perform lookups on the
19635         module builder.
19636
19637         (LookupType): Update to perform GetType on the module builders too.     
19638
19639         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19640
19641         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19642
19643 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19644
19645         * expression.cs (New::DoResolve): Implement guts of array creation.
19646
19647         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19648
19649 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19650
19651         * expression.cs: Fix bug I introduced lsat night that broke
19652         Delegates. 
19653
19654         (Expression.Resolve): Report a 246 error (can not resolve name)
19655         if we find a SimpleName in the stream.
19656
19657         (Expression.ResolveLValue): Ditto.
19658
19659         (Expression.ResolveWithSimpleName): This function is a variant of
19660         ResolveName, this one allows SimpleNames to be returned without a
19661         warning.  The only consumer of SimpleNames is MemberAccess
19662
19663 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19664
19665         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19666         might arrive here.  I have my doubts that this is correct.
19667
19668         * statement.cs (Lock): Implement lock statement.
19669
19670         * cs-parser.jay: Small fixes to support `lock' and `using'
19671
19672         * cs-tokenizer.cs: Remove extra space
19673
19674         * driver.cs: New flag --checked, allows to turn on integer math
19675         checking. 
19676
19677         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19678         Threading.Monitor.Exit 
19679
19680 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19681
19682         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19683         Expression Class to be IndexerAccess.
19684
19685         Notice that Indexer::DoResolve sets the eclass to Value.
19686
19687 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19688
19689         * class.cs (TypeContainer::Emit): Emit code for indexers.
19690
19691         * assign.cs (IAssignMethod): New interface implemented by Indexers
19692         and Properties for handling assignment.
19693
19694         (Assign::Emit): Simplify and reuse code. 
19695
19696         * expression.cs (IndexerAccess, PropertyExpr): Implement
19697         IAssignMethod, clean up old code. 
19698
19699 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19700
19701         * typemanager.cs (ImplementsInterface): New method to determine if a type
19702         implements a given interface. Provides a nice cache too.
19703
19704         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19705         method.
19706
19707         (ConvertReferenceExplicit): Ditto.
19708
19709         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19710         various methods, with correct names etc.
19711
19712         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19713         Operator.UnaryNegation.
19714
19715         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19716         we have a unary plus or minus operator.
19717
19718         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19719         UnaryMinus.
19720
19721         * everywhere : update accordingly.
19722
19723         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19724         respectively.
19725
19726         * class.cs (Method::Define): For the case where we are implementing a method
19727         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19728         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19729
19730 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19731
19732         * interface.cs (FindMembers): Implement to work around S.R.E
19733         lameness.
19734
19735         * typemanager.cs (IsInterfaceType): Implement.
19736
19737         (FindMembers): Update to handle interface types too.
19738
19739         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19740         use IsAssignableFrom as that is not correct - it doesn't work.
19741
19742         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19743         and accordingly override EmitStatement.
19744
19745         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19746         using the correct logic :-)
19747
19748 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19749
19750         * ../errors/cs-11.cs : Add to demonstrate error -11 
19751
19752 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19753
19754         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19755         then pass this as a hint to ResolveLValue.
19756
19757         * expression.cs (FieldExpr): Add Location information
19758
19759         (FieldExpr::LValueResolve): Report assignment to readonly
19760         variable. 
19761
19762         (Expression::ExprClassFromMemberInfo): Pass location information.
19763
19764         (Expression::ResolveLValue): Add new method that resolves an
19765         LValue. 
19766
19767         (Expression::DoResolveLValue): Default invocation calls
19768         DoResolve. 
19769
19770         (Indexers): New class used to keep track of indexers in a given
19771         Type. 
19772
19773         (IStackStore): Renamed from LValue, as it did not really describe
19774         what this did.  Also ResolveLValue is gone from this interface and
19775         now is part of Expression.
19776
19777         (ElementAccess): Depending on the element access type
19778
19779         * typemanager.cs: Add `indexer_name_type' as a Core type
19780         (System.Runtime.CompilerServices.IndexerNameAttribute)
19781
19782         * statement.cs (Goto): Take a location.
19783
19784 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19785
19786         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19787         if two delegates are compatible.
19788
19789         (NewDelegate::DoResolve): Update to take care of the case when
19790         we instantiate a delegate from another delegate.
19791
19792         * typemanager.cs (FindMembers): Don't even try to look up members
19793         of Delegate types for now.
19794
19795 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19796
19797         * delegate.cs (NewDelegate): New class to take care of delegate
19798         instantiation.
19799
19800         * expression.cs (New): Split the delegate related code out into 
19801         the NewDelegate class.
19802
19803         * delegate.cs (DelegateInvocation): New class to handle delegate 
19804         invocation.
19805
19806         * expression.cs (Invocation): Split out delegate related code into
19807         the DelegateInvocation class.
19808
19809 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19810
19811         * expression.cs (New::DoResolve): Implement delegate creation fully
19812         and according to the spec.
19813
19814         (New::DoEmit): Update to handle delegates differently.
19815
19816         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19817         because of which we were printing out arguments in reverse order !
19818
19819         * delegate.cs (VerifyMethod): Implement to check if the given method
19820         matches the delegate.
19821
19822         (FullDelegateDesc): Implement.
19823
19824         (VerifyApplicability): Implement.
19825
19826         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19827         delegate invocations too.
19828
19829         (Invocation::Emit): Ditto.
19830
19831         * ../errors/cs1593.cs : Added.
19832
19833         * ../errors/cs1594.cs : Added.
19834
19835         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19836
19837 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19838
19839         * typemanager.cs (intptr_type): Core type for System.IntPtr
19840
19841         (InitCoreTypes): Update for the same.
19842
19843         (iasyncresult_type, asynccallback_type): Ditto.
19844
19845         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19846         correct.
19847
19848         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19849         too.
19850
19851         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19852         the builders for the 4 members of a delegate type :-)
19853
19854         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19855         type.
19856
19857         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19858
19859         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19860
19861 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19862
19863         * statement.cs (Break::Emit): Implement.   
19864         (Continue::Emit): Implement.
19865
19866         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19867         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19868         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19869         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19870         end loop
19871
19872         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19873         properties that track the label for the current loop (begin of the
19874         loop and end of the loop).
19875
19876 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19877
19878         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19879         use of emitting anything at all.
19880
19881         * class.cs, rootcontext.cs : Get rid of calls to the same.
19882
19883         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19884
19885         (Populate): Define the constructor correctly and set the implementation
19886         attributes.
19887
19888         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19889         have been defined.
19890
19891         (AddDelegateType): Implement.
19892
19893         (IsDelegateType): Implement helper method.
19894
19895         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19896
19897         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19898         and accordingly handle it.
19899
19900         * delegate.cs (Populate): Take TypeContainer argument.
19901         Implement bits to define the Invoke method. However, I still haven't figured out
19902         how to take care of the native int bit :-(
19903
19904         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19905         Qualify the name of the delegate, not its return type !
19906
19907         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19908         conversion.
19909
19910         (StandardConversionExists): Checking for array types turns out to be recursive.
19911
19912         (ConvertReferenceExplicit): Implement array conversion.
19913
19914         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19915
19916 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19917
19918         * cs-parser.jay (delegate_declaration): Store the fully qualified
19919         name as it is a type declaration.
19920
19921         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19922         readonly.
19923
19924         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19925         as TypeContainer::DefineType.
19926
19927         (Populate): Method in which all the definition of the various methods (Invoke)
19928         etc is done.
19929
19930         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19931         see.
19932
19933         (CloseDelegate): Finally creates the delegate.
19934
19935         * class.cs (TypeContainer::DefineType): Update to define delegates.
19936         (Populate, Emit and CloseType): Do the same thing here too.
19937
19938         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19939         delegates in all these operations.
19940
19941 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19942
19943         * expression.cs: LocalTemporary: a new expression used to
19944         reference a temporary that has been created.
19945
19946         * assign.cs: Handle PropertyAccess back here, so that we can
19947         provide the proper semantic access to properties.
19948
19949         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19950         a few more explicit conversions. 
19951
19952         * modifiers.cs: `NEW' modifier maps to HideBySig.
19953
19954         * expression.cs (PropertyExpr): Make this into an
19955         ExpressionStatement, and support the EmitStatement code path. 
19956
19957         Perform get/set error checking, clean up the interface.
19958
19959         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19960         them into toplevel access objects.
19961
19962 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19963
19964         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19965         SRE.
19966
19967         * typemanager.cs: Keep track here of our PropertyBuilders again to
19968         work around lameness in SRE.
19969
19970 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19971
19972         * expression.cs (LValue::LValueResolve): New method in the
19973         interface, used to perform a second resolution pass for LValues. 
19974
19975         (This::DoResolve): Catch the use of this in static methods.
19976
19977         (This::LValueResolve): Implement.
19978
19979         (This::Store): Remove warning, assigning to `this' in structures
19980         is 
19981
19982         (Invocation::Emit): Deal with invocation of
19983         methods on value types.  We need to pass the address to structure
19984         methods rather than the object itself.  (The equivalent code to
19985         emit "this" for structures leaves the entire structure on the
19986         stack instead of a pointer to it). 
19987
19988         (ParameterReference::DoResolve): Compute the real index for the
19989         argument based on whether the method takes or not a `this' pointer
19990         (ie, the method is static).
19991
19992         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19993         value types returned from functions when we need to invoke a
19994         method on the sturcture.
19995
19996
19997 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19998
19999         * class.cs (TypeContainer::DefineType): Method to actually do the business of
20000         defining the type in the Modulebuilder or Typebuilder. This is to take
20001         care of nested types which need to be defined on the TypeBuilder using
20002         DefineNestedMethod.
20003
20004         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
20005         methods in RootContext, only ported to be part of TypeContainer.
20006
20007         (TypeContainer::GetInterfaceOrClass): Ditto.
20008
20009         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20010
20011         * interface.cs (Interface::DefineInterface): New method. Does exactly
20012         what RootContext.CreateInterface did earlier, only it takes care of nested types 
20013         too.
20014
20015         (Interface::GetInterfaces): Move from RootContext here and port.
20016
20017         (Interface::GetInterfaceByName): Same here.
20018
20019         * rootcontext.cs (ResolveTree): Re-write.
20020
20021         (PopulateTypes): Re-write.
20022
20023         * class.cs (TypeContainer::Populate): Populate nested types too.
20024         (TypeContainer::Emit): Emit nested members too.
20025
20026         * typemanager.cs (AddUserType): Do not make use of the FullName property,
20027         instead just use the name argument passed in as it is already fully
20028         qualified.
20029
20030         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20031         to TypeContainer mapping to see if a type is user-defined.
20032
20033         * class.cs (TypeContainer::CloseType): Implement. 
20034
20035         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20036         the default constructor.
20037
20038         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20039         twice.
20040
20041         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20042
20043         * interface.cs (CloseType): Create the type here.
20044
20045         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20046         the hierarchy.
20047
20048         Remove all the methods which are now in TypeContainer.
20049
20050 2001-10-10  Ravi Pratap  <ravi@ximian.com>
20051
20052         * delegate.cs (Define): Re-write bits to define the delegate
20053         correctly.
20054
20055 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
20056
20057         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20058
20059         * expression.cs (ImplicitReferenceConversion): handle null as well
20060         as a source to convert to any reference type.
20061
20062         * statement.cs (Return): Perform any implicit conversions to
20063         expected return type.  
20064
20065         Validate use of return statement.  
20066
20067         * codegen.cs (EmitContext): Pass the expected return type here.
20068
20069         * class.cs (Method, Constructor, Property): Pass expected return
20070         type to EmitContext.
20071
20072 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
20073
20074         * expression.cs: Make DoResolve take an EmitContext instead of a
20075         TypeContainer.
20076
20077         Replaced `l' and `location' for `loc', for consistency.
20078
20079         (Error, Warning): Remove unneeded Tc argument.
20080
20081         * assign.cs, literal.cs, constant.cs: Update to new calling
20082         convention. 
20083
20084         * codegen.cs: EmitContext now contains a flag indicating whether
20085         code is being generated in a static method or not.
20086
20087         * cs-parser.jay: DecomposeQI, new function that replaces the old
20088         QualifiedIdentifier.  Now we always decompose the assembled
20089         strings from qualified_identifier productions into a group of
20090         memberaccesses.
20091
20092 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
20093
20094         * rootcontext.cs: Deal with field-less struct types correctly now
20095         by passing the size option to Define Type.
20096
20097         * class.cs: Removed hack that created one static field. 
20098
20099 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20100
20101         * statement.cs: Moved most of the code generation here. 
20102
20103 2001-10-09  Ravi Pratap  <ravi@ximian.com>
20104
20105         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20106         seem very right.
20107
20108         (ElementAccess): Remove useless bits for now - keep checks as the spec
20109         says.
20110
20111 2001-10-08  Ravi Pratap  <ravi@ximian.com>
20112
20113         * expression.cs (ElementAccess::DoResolve): Remove my crap code
20114         and start performing checks according to the spec.
20115
20116 2001-10-07  Ravi Pratap  <ravi@ximian.com>
20117
20118         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20119         rank_specifiers instead.
20120
20121         (rank_specifiers): Change the order in which the rank specifiers are stored
20122
20123         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20124
20125         * expression.cs (ElementAccess): Implement the LValue interface too.
20126
20127 2001-10-06  Ravi Pratap  <ravi@ximian.com>
20128
20129         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20130         except that user defined conversions are not included.
20131
20132         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
20133         perform the conversion of the return type, if necessary.
20134
20135         (New::DoResolve): Check whether we are creating an array or an object
20136         and accordingly do the needful.
20137
20138         (New::Emit): Same here.
20139
20140         (New::DoResolve): Implement guts of array creation.
20141
20142         (New::FormLookupType): Helper function.
20143
20144 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20145
20146         * codegen.cs: Removed most of the code generation here, and move the
20147         corresponding code generation bits to the statement classes. 
20148
20149         Added support for try/catch/finalize and throw.
20150
20151         * cs-parser.jay: Added support for try/catch/finalize.
20152
20153         * class.cs: Catch static methods having the flags override,
20154         virtual or abstract.
20155
20156         * expression.cs (UserCast): This user cast was not really doing
20157         what it was supposed to do.  Which is to be born in fully resolved
20158         state.  Parts of the resolution were being performed at Emit time! 
20159
20160         Fixed this code.
20161
20162 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20163
20164         * expression.cs: Implicity convert the result from UserCast.
20165
20166 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20167
20168         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20169         prevented it from working correctly. 
20170
20171         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20172         merely ConvertImplicit.
20173
20174 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20175
20176         * typemanager.cs: Make the LookupTypeContainer function static,
20177         and not per-instance.  
20178
20179         * class.cs: Make static FindMembers (the one that takes a Type
20180         argument). 
20181
20182         * codegen.cs: Add EmitForeach here.
20183
20184         * cs-parser.jay: Make foreach a toplevel object instead of the
20185         inline expansion, as we need to perform semantic analysis on it. 
20186
20187 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20188
20189         * expression.cs (Expression::ImplicitUserConversion): Rename to
20190         UserDefinedConversion.
20191
20192         (Expression::UserDefinedConversion): Take an extra argument specifying 
20193         whether we look for explicit user conversions too.
20194
20195         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20196
20197         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20198
20199         (ExplicitUserConversion): Make it a call to UserDefinedConversion
20200         with the appropriate arguments.
20201
20202         * cs-parser.jay (cast_expression): Record location too.
20203
20204         * expression.cs (Cast): Record location info.
20205
20206         (Expression::ConvertExplicit): Take location argument.
20207
20208         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20209         to determine if we are doing explicit conversions.
20210
20211         (UserCast::Emit): Update accordingly.
20212
20213         (Expression::ConvertExplicit): Report an error if everything fails.
20214
20215         * ../errors/cs0030.cs : Add.
20216
20217 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
20218
20219         * modifiers.cs: If the ABSTRACT keyword is present, also set the
20220         virtual and newslot bits. 
20221
20222         * class.cs (TypeContainer::RegisterRequiredImplementations):
20223         Record methods we need.
20224
20225         (TypeContainer::MakeKey): Helper function to make keys for
20226         MethodBases, since the Methodbase key is useless.
20227
20228         (TypeContainer::Populate): Call RegisterRequiredImplementations
20229         before defining the methods.   
20230
20231         Create a mapping for method_builders_to_methods ahead of time
20232         instead of inside a tight loop.
20233
20234         (::RequireMethods):  Accept an object as the data to set into the
20235         hashtable so we can report interface vs abstract method mismatch.
20236
20237 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20238
20239         * report.cs: Make all of it static.
20240
20241         * rootcontext.cs: Drop object_type and value_type computations, as
20242         we have those in the TypeManager anyways.
20243
20244         Drop report instance variable too, now it is a global.
20245
20246         * driver.cs: Use try/catch on command line handling.
20247
20248         Add --probe option to debug the error reporting system with a test
20249         suite. 
20250
20251         * report.cs: Add support for exiting program when a probe
20252         condition is reached.
20253
20254 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20255
20256         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20257         we do a forcible conversion regardless of type, to check if 
20258         ForceConversion returns a null.
20259
20260         (Binary::error19): Use location to report error.
20261
20262         (Unary::error23): Use location here too.
20263
20264         * ../errors/cs0019.cs : Check in.
20265
20266         * ../errors/cs0023.cs : Check in.
20267
20268         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20269         case of a non-null MethodInfo object with a length of 0 !
20270
20271         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20272         an applicable member - according to the spec :-)
20273         Also fix logic to find members in base types.
20274
20275         (Unary::ResolveOperator): Same here.
20276
20277         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20278         as I was getting thoroughly confused between this and error19 :-)
20279
20280         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20281         (::FindMostEncompassedType): Implement.
20282         (::FindMostEncompassingType): Implement.
20283         (::StandardConversionExists): Implement.
20284
20285         (UserImplicitCast): Re-vamp. We now need info about most specific
20286         source and target types so that we can do the necessary conversions.
20287
20288         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20289         mathematical union with no duplicates.
20290
20291 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20292
20293         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20294         in order from base classes to child classes, so that we can in
20295         child classes look up in our parent for method names and
20296         attributes (required for handling abstract, virtual, new, override
20297         constructs: we need to instrospect our base class, and if we dont
20298         populate the classes in order, the introspection might be
20299         incorrect.  For example, a method could query its parent before
20300         the parent has any methods and would determine that the parent has
20301         no abstract methods (while it could have had them)).
20302
20303         (RootContext::CreateType): Record the order in which we define the
20304         classes.
20305
20306 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20307
20308         * class.cs (TypeContainer::Populate): Also method definitions can
20309         fail now, keep track of this.
20310
20311         (TypeContainer::FindMembers): Implement support for
20312         DeclaredOnly/noDeclaredOnly flag.
20313
20314         (Constructor::Emit) Return the ConstructorBuilder.
20315
20316         (Method::Emit) Return the MethodBuilder. 
20317         Check for abstract or virtual methods to be public.
20318
20319         * rootcontext.cs (RootContext::CreateType): Register all the
20320         abstract methods required for the class to be complete and the
20321         interface methods that must be implemented. 
20322
20323         * cs-parser.jay: Report error 501 (method requires body if it is
20324         not marked abstract or extern).
20325
20326         * expression.cs (TypeOf::Emit): Implement.
20327
20328         * typemanager.cs: runtime_handle_type, new global type.
20329
20330         * class.cs (Property::Emit): Generate code for properties.
20331
20332 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20333
20334         * expression.cs (Unary::ResolveOperator): Find operators on base type
20335         too - we now conform exactly to the spec.
20336
20337         (Binary::ResolveOperator): Same here.
20338
20339         * class.cs (Operator::Define): Fix minor quirk in the tests.
20340
20341         * ../errors/cs0215.cs : Added.
20342
20343         * ../errors/cs0556.cs : Added.
20344
20345         * ../errors/cs0555.cs : Added.
20346
20347 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20348
20349         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20350         single integer which is really efficient
20351
20352 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20353
20354         *  expression.cs (Expression::ImplicitUserConversion): Use location
20355         even in the case when we are examining True operators.
20356  
20357         * class.cs (Operator::Define): Perform extensive checks to conform
20358         with the rules for operator overloading in the spec.
20359
20360         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20361         some of the other conversions mentioned in the spec.
20362
20363         * typemanager.cs (array_type): New static member for the System.Array built-in
20364         type.
20365
20366         (cloneable_interface): For System.ICloneable interface.
20367
20368         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20369         we start resolving the tree and populating types.
20370
20371         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20372  
20373 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20374
20375         * expression.cs (Expression::ExprClassFromMemberInfo,
20376         Expression::Literalize): Create literal expressions from
20377         FieldInfos which are literals.
20378
20379         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20380         type casts, because they were wrong.  The test suite in tests
20381         caught these ones.
20382
20383         (ImplicitNumericConversion): ushort to ulong requires a widening
20384         cast. 
20385
20386         Int32 constant to long requires widening cast as well.
20387
20388         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20389         for integers because the type on the stack is not i4.
20390
20391 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20392
20393         * expression.cs (report118): require location argument. 
20394
20395         * parameter.cs: Do not dereference potential null value.
20396
20397         * class.cs: Catch methods that lack the `new' keyword when
20398         overriding a name.  Report warnings when `new' is used without
20399         anything being there to override.
20400
20401         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20402
20403         * class.cs: Only add constructor to hashtable if it is non-null
20404         (as now constructors can fail on define).
20405
20406         (TypeManager, Class, Struct): Take location arguments.
20407
20408         Catch field instance initialization in structs as errors.
20409
20410         accepting_filter: a new filter for FindMembers that is static so
20411         that we dont create an instance per invocation.
20412
20413         (Constructor::Define): Catch errors where a struct constructor is
20414         parameterless 
20415
20416         * cs-parser.jay: Pass location information for various new
20417         constructs. 
20418
20419         * delegate.cs (Delegate): take a location argument.
20420
20421         * driver.cs: Do not call EmitCode if there were problesm in the
20422         Definition of the types, as many Builders wont be there. 
20423
20424         * decl.cs (Decl::Decl): Require a location argument.
20425
20426         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20427         into integers, and find the most appropiate integer for it.
20428
20429         * literal.cs: Implement ULongLiteral.
20430
20431         * rootcontext.cs: Provide better information about the location of
20432         failure when CreateType fails.
20433
20434 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20435
20436         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20437         as well.
20438
20439         * expression.cs (Binary::CheckShiftArguments): Add missing type
20440         computation.
20441         (Binary::ResolveOperator): Add type to the logical and and logical
20442         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20443         before.
20444
20445         (Binary::DoNumericPromotions): In the case where either argument
20446         is ulong (and most signed types combined with ulong cause an
20447         error) perform implicit integer constant conversions as well.
20448
20449 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20450
20451         * expression.cs (UserImplicitCast): Method should always be
20452         non-null. 
20453         (Invocation::BetterConversion): Simplified test for IntLiteral.
20454
20455         (Expression::ImplicitNumericConversion): Split this routine out.
20456         Put the code that performs implicit constant integer conversions
20457         here. 
20458
20459         (Expression::Resolve): Become a wrapper around DoResolve so we can
20460         check eclass and type being set after resolve.
20461
20462         (Invocation::Badness): Remove this dead function
20463
20464         (Binary::ResolveOperator): Do not compute the expensive argumnets
20465         unless we have a union for it.
20466
20467         (Probe::Emit): Is needs to do an isinst and then
20468         compare against null.
20469
20470         (::CanConvert): Added Location argument.  If the Location argument
20471         is null (Location.Null), then we do not report errors.  This is
20472         used by the `probe' mechanism of the Explicit conversion.  We do
20473         not want to generate an error for something that the user
20474         explicitly requested to be casted.  But the pipeline for an
20475         explicit cast first tests for potential implicit casts.
20476
20477         So for now, if the Location is null, it means `Probe only' to
20478         avoid adding another argument.   Might have to revise this
20479         strategy later.
20480
20481         (ClassCast): New class used to type cast objects into arbitrary
20482         classes (used in Explicit Reference Conversions).
20483
20484         Implement `as' as well.
20485
20486         Reverted all the patches from Ravi below: they were broken:
20487
20488                 * The use of `level' as a mechanism to stop recursive
20489                   invocations is wrong.  That was there just to catch the
20490                   bug with a strack trace but not as a way of addressing
20491                   the problem.
20492
20493                   To fix the problem we have to *understand* what is going
20494                   on and the interactions and come up with a plan, not
20495                   just get things going.
20496
20497                 * The use of the type conversion cache that I proposed
20498                   last night had an open topic: How does this work across
20499                   protection domains.  A user defined conversion might not
20500                   be public in the location where we are applying the
20501                   conversion, a different conversion might be selected
20502                   (ie, private A->B (better) but public B->A (worse),
20503                   inside A, A->B applies, but outside it, B->A will
20504                   apply).
20505
20506                 * On top of that (ie, even if the above is solved),
20507                   conversions in a cache need to be abstract.  Ie, `To
20508                   convert from an Int to a Short use an OpcodeCast', not
20509                   `To convert from an Int to a Short use the OpcodeCast on
20510                   the variable 5' (which is what this patch was doing).
20511
20512 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20513
20514         * expression.cs (Invocation::ConversionExists): Re-write to use
20515         the conversion cache
20516
20517         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20518         cache all conversions done, not just user-defined ones.
20519
20520         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20521         to determine if a conversion exists instead of acutually trying to 
20522         perform the conversion. It's faster too.
20523
20524         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20525         and only then attempt the implicit conversion.
20526
20527 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20528
20529         * expression.cs (ConvertImplicit): Use a cache for conversions
20530         already found. Check level of recursion and bail out if necessary.
20531
20532 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20533
20534         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20535         Export standard methods that we expect for string operations.
20536
20537         * statement.cs (Block::UsageWarning): Track usage of variables and
20538         report the errors for not used variables.
20539
20540         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20541         operator. 
20542
20543 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20544
20545         * codegen.cs: remove unnneded code 
20546
20547         * expression.cs: Removed BuiltinTypeAccess class
20548
20549         Fix the order in which implicit conversions are
20550         done.  
20551
20552         The previous fixed dropped support for boxed conversions (adding a
20553         test to the test suite now)
20554
20555         (UserImplicitCast::CanConvert): Remove test for source being null,
20556         that code is broken.  We should not feed a null to begin with, if
20557         we do, then we should track the bug where the problem originates
20558         and not try to cover it up here.
20559
20560         Return a resolved expression of type UserImplicitCast on success
20561         rather than true/false.  Ravi: this is what I was talking about,
20562         the pattern is to use a static method as a "constructor" for
20563         objects. 
20564
20565         Also, do not create arguments until the very last minute,
20566         otherwise we always create the arguments even for lookups that
20567         will never be performed. 
20568
20569         (UserImplicitCast::Resolve): Eliminate, objects of type
20570         UserImplicitCast are born in a fully resolved state. 
20571
20572         * typemanager.cs (InitCoreTypes): Init also value_type
20573         (System.ValueType). 
20574
20575         * expression.cs (Cast::Resolve): First resolve the child expression.
20576
20577         (LValue): Add new method AddressOf to be used by
20578         the `&' operator.  
20579
20580         Change the argument of Store to take an EmitContext instead of an
20581         ILGenerator, because things like FieldExpr need to be able to call
20582         their children expression to generate the instance code. 
20583
20584         (Expression::Error, Expression::Warning): Sugar functions for
20585         reporting errors.
20586
20587         (Expression::MemberLookup): Accept a TypeContainer instead of a
20588         Report as the first argument.
20589
20590         (Expression::ResolvePrimary): Killed.  I still want to improve
20591         this as currently the code is just not right.
20592
20593         (Expression::ResolveMemberAccess): Simplify, but it is still
20594         wrong. 
20595
20596         (Unary::Resolve): Catch errors in AddressOf operators.
20597
20598         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20599         index to a byte for the short-version, or the compiler will choose
20600         the wrong Emit call, which generates the wrong data.
20601
20602         (ParameterReference::Emit, ::Store): same.
20603
20604         (FieldExpr::AddressOf): Implement.
20605
20606         * typemanager.cs: TypeManager: made public variable instead of
20607         property.
20608
20609         * driver.cs: document --fatal.
20610
20611         * report.cs (ErrorMessage, WarningMessage): new names for the old
20612         Error and Warning classes.
20613
20614         * cs-parser.jay (member_access): Turn built-in access to types
20615         into a normal simplename
20616
20617 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20618
20619         * expression.cs (Invocation::BetterConversion): Fix to cope
20620         with q being null, since this was introducing a bug.
20621
20622         * expression.cs (ConvertImplicit): Do built-in conversions first.
20623
20624 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20625
20626         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20627
20628 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20629
20630         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20631         I had introduced long ago (what's new ?).
20632
20633         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20634         the work of all the checking. 
20635         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20636         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20637
20638         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20639         that is the right way. 
20640
20641         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20642         overloading resolution. Use everywhere instead of cutting and pasting code.
20643
20644         (Binary::ResolveOperator): Use MakeUnionSet.
20645
20646         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20647         we have to convert to bool types. Not complete yet.
20648
20649 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20650
20651         * typemanager.cs (TypeManager::CSharpName): support ushort.
20652
20653         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20654         to provide an expression that performsn an implicit constant int
20655         conversion (section 6.1.6).
20656         (Expression::ConvertImplicitRequired): Reworked to include
20657         implicit constant expression conversions.
20658
20659         (Expression::ConvertNumericExplicit): Finished.
20660
20661         (Invocation::Emit): If InstanceExpression is null, then it means
20662         that we perform a call on this.
20663
20664 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20665
20666         * expression.cs (Unary::Emit): Remove some dead code.
20667         (Probe): Implement Resolve and Emit for `is'.
20668         (Expression::ConvertImplicitRequired): Attempt to do constant
20669         expression conversions here.  Maybe should be moved to
20670         ConvertImplicit, but I am not sure.
20671         (Expression::ImplicitLongConstantConversionPossible,
20672         Expression::ImplicitIntConstantConversionPossible): New functions
20673         that tell whether is it possible to apply an implicit constant
20674         expression conversion.
20675
20676         (ConvertNumericExplicit): Started work on explicit numeric
20677         conversions.
20678
20679         * cs-parser.jay: Update operator constants.
20680
20681         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20682         (Parameters::GetSignature): Hook up VerifyArgs here.
20683         (Parameters::VerifyArgs): Verifies that no two arguments have the
20684         same name. 
20685
20686         * class.cs (Operator): Update the operator names to reflect the
20687         ones that the spec expects (as we are just stringizing the
20688         operator names).
20689
20690         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20691         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20692         previous usage did only work for our methods.
20693         (Expression::ConvertImplicit): Handle decimal implicit numeric
20694         conversions as well.
20695         (Expression::InternalTypeConstructor): Used to invoke constructors
20696         on internal types for default promotions.
20697
20698         (Unary::Emit): Implement special handling for the pre/post
20699         increment/decrement for overloaded operators, as they need to have
20700         the same semantics as the other operators.
20701
20702         (Binary::ResolveOperator): ditto.
20703         (Invocation::ConversionExists): ditto.
20704         (UserImplicitCast::Resolve): ditto.
20705
20706 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20707
20708         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20709         operator, return after emitting body. Regression tests pass again !
20710
20711         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20712         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20713         (Invocation::OverloadResolve): Ditto.
20714         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20715
20716         * everywhere : update calls to the above methods accordingly.
20717
20718 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20719
20720         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20721
20722         * expression.cs (ExpressionStatement): New base class used for
20723         expressions that can appear in statements, so that we can provide
20724         an alternate path to generate expression that do not leave a value
20725         on the stack.
20726
20727         (Expression::Emit, and all the derivatives): We no longer return
20728         whether a value is left on the stack or not.  Every expression
20729         after being emitted leaves a single value on the stack.
20730
20731         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20732         facilties of ExpressionStatement if possible.
20733
20734         * cs-parser.jay: Update statement_expression.
20735
20736 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20737
20738         * driver.cs: Change the wording of message
20739
20740 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20741
20742         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20743         the type of the expression to the return type of the method if
20744         we have an overloaded operator match ! The regression tests pass again !
20745         (Unary::ResolveOperator): Ditto.
20746
20747         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20748         to find "op_Implicit", not "implicit" ;-)
20749         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20750         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20751
20752         * everywhere : Correct calls to the above accordingly.
20753
20754         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20755         (ConvertImplicit): Do user-defined conversion if it exists.
20756
20757 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20758
20759         * assign.cs: track location.
20760         (Resolve): Use implicit conversions on assignment.
20761
20762         * literal.cs: Oops.  Not good, Emit of short access values should
20763         pass (Bytes) or the wrong argument will be selected.
20764
20765         * expression.cs (Unary::Emit): Emit code for -expr.
20766
20767         (Unary::ResolveOperator): Handle `Substract' for non-constants
20768         (substract from zero from the non-constants).
20769         Deal with Doubles as well. 
20770
20771         (Expression::ConvertImplicitRequired): New routine that reports an
20772         error if no implicit conversion exists. 
20773
20774         (Invocation::OverloadResolve): Store the converted implicit
20775         expressions if we make them
20776
20777 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20778
20779         * class.cs (ConstructorInitializer): Take a Location argument.
20780         (ConstructorBaseInitializer): Same here.
20781         (ConstructorThisInitializer): Same here.
20782
20783         * cs-parser.jay : Update all calls accordingly.
20784
20785         * expression.cs (Unary, Binary, New): Take location argument.
20786         Update accordingly everywhere.
20787
20788         * cs-parser.jay : Update all calls to the above to take a location
20789         argument.
20790
20791         * class.cs : Ditto.
20792
20793 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20794
20795         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20796         (Invocation::BetterConversion): Same here
20797         (Invocation::ConversionExists): Ditto.
20798
20799         (Invocation::ConversionExists): Implement.
20800
20801 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20802
20803         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20804         Also take an additional TypeContainer argument.
20805
20806         * All over : Pass in TypeContainer as argument to OverloadResolve.
20807
20808         * typemanager.cs (CSharpName): Update to check for the string type and return
20809         that too.
20810
20811         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20812         a given method.
20813
20814 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20815
20816         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20817         (Invocation::BetterFunction): Implement.
20818         (Invocation::BetterConversion): Implement.
20819         (Invocation::ConversionExists): Skeleton, no implementation yet.
20820
20821         Okay, things work fine !
20822
20823 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20824
20825         * typemanager.cs: declare and load enum_type, delegate_type and
20826         void_type. 
20827
20828         * expression.cs (Expression::Emit): Now emit returns a value that
20829         tells whether a value is left on the stack or not.  This strategy
20830         might be reveted tomorrow with a mechanism that would address
20831         multiple assignments.
20832         (Expression::report118): Utility routine to report mismatches on
20833         the ExprClass.
20834
20835         (Unary::Report23): Report impossible type/operator combination
20836         utility function.
20837
20838         (Unary::IsIncrementableNumber): Whether the type can be
20839         incremented or decremented with add.
20840         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20841         complemented. 
20842         (Unary::ResolveOperator): Implement ++, !, ~,
20843
20844         (Invocation::Emit): Deal with new Emit convetion.
20845
20846         * All Expression derivatives: Updated their Emit method to return
20847         whether they leave values on the stack or not.
20848
20849         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20850         stack for expressions that are statements. 
20851
20852 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20853
20854         * expression.cs (LValue): New interface.  Must be implemented by
20855         LValue objects.
20856         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20857         LValue interface.
20858
20859         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20860         interface for generating code, simplifies the code.
20861
20862 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20863
20864         * expression.cs (everywhere): Comment out return statements in ::Resolve
20865         methods to avoid the warnings.
20866
20867 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20868
20869         * driver.cs (parse): Report error 2001 if we can not open the
20870         source file.
20871
20872         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20873         not resolve it.
20874
20875         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20876         object. 
20877
20878         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20879         otherwise nested blocks end up with the same index.
20880
20881         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20882
20883         * expression.cs:  Instead of having FIXMEs in the Resolve
20884         functions, throw exceptions so it is obvious that we are facing a
20885         bug. 
20886
20887         * cs-parser.jay (invocation_expression): Pass Location information.
20888
20889         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20890         Use a basename for those routines because .NET does not like paths
20891         on them. 
20892
20893         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20894         already defined.
20895
20896 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20897
20898         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20899         are loading the correct data types (throws an exception if not).
20900         (TypeManager::InitCoreTypes): Use CoreLookupType
20901
20902         * expression.cs (Unary::ResolveOperator): return the child
20903         expression for expressions which are just +expr.
20904         (Unary::ResolveOperator): Return negative literals for -LITERAL
20905         expressions (otherwise they are Unary {Literal}).
20906         (Invocation::Badness): Take into account `Implicit constant
20907         expression conversions'.
20908
20909         * literal.cs (LongLiteral): Implement long literal class.
20910         (IntLiteral): export the `Value' of the intliteral. 
20911
20912 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20913
20914         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20915
20916         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20917         instead of 'Operator'
20918
20919         * expression.cs (Binary::ResolveOperator): Update accordingly.
20920         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20921         and 'Minus'
20922
20923         * cs-parser.jay (unary_expression): Update to use the new names.
20924
20925         * gen-treedump.cs (GetUnary): Same here.
20926
20927         * expression.cs (Unary::Resolve): Implement.
20928         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20929         operators are found instead of making noise ;-)
20930         (Unary::ResolveOperator): New method to do precisely the same thing which
20931         Binary::ResolveOperator does for Binary expressions.
20932         (Unary.method, .Arguments): Add.
20933         (Unary::OperName): Implement.   
20934         (Unary::ForceConversion): Copy and Paste !
20935
20936         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20937         a unary operator.
20938
20939         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20940         for the inbuilt operators. Only overloading works for now ;-)
20941
20942 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20943
20944         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20945         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20946
20947         * expression.cs (This::Emit): Implement. 
20948         (This::Resolve): Implement.
20949         (TypeOf:Resolve): Implement.
20950         (Expression::ResolveSimpleName): Add an implicit this to instance
20951         field references. 
20952         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20953         Bind instance variable to Field expressions.
20954         (FieldExpr::Instance): New field used to track the expression that
20955         represents the object instance.
20956         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20957         binding 
20958         (FieldExpr::Emit): Implement.
20959
20960         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20961         the last instruction contains a return opcode to avoid generating
20962         the last `ret' instruction (this generates correct code, and it is
20963         nice to pass the peverify output).
20964
20965         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20966         initializer for static and instance variables.
20967         (Constructor::Emit): Allow initializer to be null in the case of
20968         static constructors.  Only emit initializer for instance
20969         constructors. 
20970
20971         (TypeContainer::FindMembers): Return a null array if there are no
20972         matches.
20973
20974         Also fix the code for the MemberTypes.Method branch, as it was not
20975         scanning that for operators (or tried to access null variables before).
20976
20977         * assign.cs (Assign::Emit): Handle instance and static fields. 
20978
20979         * TODO: Updated.
20980
20981         * driver.cs: Stop compilation if there are parse errors.
20982
20983         * cs-parser.jay (constructor_declaration): Provide default base
20984         initializer for non-static constructors.
20985         (constructor_declarator): Do not provide a default base
20986         initializers if none was specified.
20987         Catch the fact that constructors should not have parameters.
20988
20989         * class.cs: Do not emit parent class initializers for static
20990         constructors, that should be flagged as an error.
20991
20992 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20993
20994         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20995         Move back code into TypeContainer::Populate.
20996
20997 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20998
20999         * class.cs (TypeContainer::AddConstructor): Fix the check to
21000         compare against Name, not Basename. 
21001         (Operator::OpType): Change Plus and Minus to Add and Subtract.
21002
21003         * cs-parser.jay : Update accordingly.
21004
21005         * class.cs (TypeContainer::FindMembers): For the case where we are searching
21006         for methods, don't forget to look into the operators too.
21007         (RegisterMethodBuilder): Helper method to take care of this for
21008         methods, constructors and operators.
21009         (Operator::Define): Completely revamp.
21010         (Operator.OperatorMethod, MethodName): New fields.
21011         (TypeContainer::Populate): Move the registering of builders into
21012         RegisterMethodBuilder.
21013         (Operator::Emit): Re-write.
21014
21015         * expression.cs (Binary::Emit): Comment out code path to emit method
21016         invocation stuff for the case when we have a user defined operator. I am
21017         just not able to get it right !
21018
21019 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21020
21021         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21022         argument. 
21023
21024         (Expression::MemberLookup): Provide a version that allows to
21025         specify the MemberTypes and BindingFlags. 
21026
21027         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21028         so it was not fetching variable information from outer blocks.
21029
21030         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21031         Beforefieldinit as it was buggy.
21032
21033         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21034         that Ravi put here.  
21035
21036         * class.cs (Constructor::Emit): Only emit if block is not null.
21037         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21038         deal with this by semantically definining it as if the user had
21039         done it.
21040
21041         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21042         constructors as we now "emit" them at a higher level.
21043
21044         (TypeContainer::DefineDefaultConstructor): Used to define the
21045         default constructors if none was provided.
21046
21047         (ConstructorInitializer): Add methods Resolve and Emit. 
21048
21049         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21050
21051 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21052
21053         * class.cs (TypeContainer::EmitDefaultConstructor): Register
21054         the default constructor builder with our hashtable for methodbuilders
21055         to methodcores.
21056
21057         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21058         and argument_count is 0 in which case we have a match.
21059         (Binary::ResolveOperator): More null checking and miscellaneous coding
21060         style cleanup.
21061
21062 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21063
21064         * rootcontext.cs (IsNameSpace): Compare against null.
21065
21066         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21067
21068         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21069         and Unary::Operator.
21070
21071         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21072         accordingly.
21073
21074         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21075         we have overloaded operators.
21076         (Binary::ResolveOperator): Implement the part which does the operator overload
21077         resolution.
21078
21079         * class.cs (Operator::Emit): Implement.
21080         (TypeContainer::Emit): Emit the operators we have too.
21081
21082         * expression.cs (Binary::Emit): Update to emit the appropriate code for
21083         the case when we have a user-defined operator.
21084
21085 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21086
21087         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21088
21089 2001-09-16  Ravi Pratap  <ravi@ximian.com>
21090
21091         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21092         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21093         (Constructor::Emit): Implement.
21094         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21095         if we have no work to do. 
21096         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
21097         Emit method.
21098
21099         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21100         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21101
21102         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21103         of parent.parent.
21104
21105 2001-09-15  Ravi Pratap  <ravi@ximian.com>
21106
21107         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21108         in the source.
21109         (Tree::RecordNamespace): Method to do what the name says ;-)
21110         (Tree::Namespaces): Property to get at the namespaces hashtable.
21111
21112         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
21113         keep track.
21114
21115         * rootcontext.cs (IsNamespace): Fixed it :-)
21116
21117 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21118
21119         * class.cs (TypeContainer::FindMembers): Add support for
21120         constructors. 
21121         (MethodCore): New class that encapsulates both the shared aspects
21122         of a Constructor and a Method.  
21123         (Method, Constructor): Factored pieces into MethodCore.
21124
21125         * driver.cs: Added --fatal which makes errors throw exceptions.
21126         Load System assembly as well as part of the standard library.
21127
21128         * report.cs: Allow throwing exceptions on errors for debugging.
21129
21130         * modifiers.cs: Do not use `parent', instead use the real type
21131         container to evaluate permission settings.
21132
21133         * class.cs: Put Ravi's patch back in.  He is right, and we will
21134         have to cope with the
21135
21136 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21137
21138         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21139         FamORAssem, not FamANDAssem.
21140
21141 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21142
21143         * driver.cs: Added --parse option that only parses its input files
21144         and terminates.
21145
21146         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
21147         incorrect.  IsTopLevel is not used to tell whether an object is
21148         root_types or not (that can be achieved by testing this ==
21149         root_types).  But to see if this is a top-level *class* (not
21150         necessarly our "toplevel" container). 
21151
21152 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21153
21154         * enum.cs (Enum::Define): Modify to call the Lookup method on the
21155         parent instead of a direct call to GetType.
21156
21157 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21158
21159         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21160         Modifiers.TypeAttr. This should just be a call to that method.
21161
21162         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21163         object so that we can determine if we are top-level or not.
21164
21165         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
21166         TypeContainer too.
21167
21168         * enum.cs (Enum::Define): Ditto.
21169
21170         * modifiers.cs (FieldAttr): Re-write.
21171
21172         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21173         (TypeContainer::HaveStaticConstructor): New property to provide access
21174         to precisely that info.
21175
21176         * modifiers.cs (MethodAttr): Re-write.
21177         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21178
21179         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21180         of top-level types as claimed.
21181
21182 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21183
21184         * expression.cs (MemberLookup): Fruitless attempt to lookup
21185         constructors.  Maybe I need to emit default constructors?  That
21186         might be it (currently .NET emits this for me automatically).
21187         (Invocation::OverloadResolve): Cope with Arguments == null.
21188         (Invocation::EmitArguments): new function, shared by the new
21189         constructor and us.
21190         (Invocation::Emit): Handle static and instance methods.  Emit
21191         proper call instruction for virtual or non-virtual invocations.
21192         (New::Emit): Implement.
21193         (New::Resolve): Implement.
21194         (MemberAccess:Resolve): Implement.
21195         (MethodGroupExpr::InstanceExpression): used conforming to the spec
21196         to track instances.
21197         (FieldExpr::Resolve): Set type.
21198
21199         * support.cs: Handle empty arguments.
21200                 
21201         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21202         SimpleLookup): Auxiliary routines to help parse a qualifier
21203         identifier.  
21204
21205         Update qualifier_identifier rule.
21206
21207         * codegen.cs: Removed debugging messages.
21208
21209         * class.cs: Make this a global thing, this acts just as a "key" to
21210         objects that we might have around.
21211
21212         (Populate): Only initialize method_builders_to_methods once.
21213
21214         * expression.cs (PropertyExpr): Initialize type from the
21215         PropertyType. 
21216
21217         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21218         Resolve pattern.  Attempt to implicitly convert value to boolean.
21219         Emit code.
21220
21221         * expression.cs: Set the type for the int32/int32 argument case.
21222         (Binary::ResolveOperator): Set the return type to boolean for
21223         comparission operators
21224
21225         * typemanager.cs: Remove debugging print code.
21226
21227         (Invocation::Resolve): resolve type.
21228
21229         * class.cs: Allocate a MemberInfo of the correct size, as the code
21230         elsewhere depends on the test to reflect the correct contents.
21231
21232         (Method::) Keep track of parameters, due to System.Reflection holes
21233
21234         (TypeContainer::Populate): Keep track of MethodBuilders to Method
21235         mapping here.
21236
21237         (TypeContainer::FindMembers): Use ArrayList and then copy an array
21238         of the exact size and return that.
21239
21240         (Class::LookupMethodByBuilder): New function that maps
21241         MethodBuilders to its methods.  Required to locate the information
21242         on methods because System.Reflection bit us again.
21243
21244         * support.cs: New file, contains an interface ParameterData and
21245         two implementations: ReflectionParameters and InternalParameters
21246         used to access Parameter information.  We will need to grow this
21247         as required.
21248
21249         * expression.cs (Invocation::GetParameterData): implement a cache
21250         and a wrapper around the ParameterData creation for methods. 
21251         (Invocation::OverloadResolve): Use new code.
21252
21253 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21254
21255         * class.cs (TypeContainer::EmitField): Remove and move into 
21256         (Field::Define): here and modify accordingly.
21257         (Field.FieldBuilder): New member.
21258         (TypeContainer::Populate): Update accordingly.
21259         (TypeContainer::FindMembers): Implement.
21260
21261 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21262
21263         * statement.cs: (VariableInfo::VariableType): New field to be
21264         initialized with the full type once it is resolved. 
21265
21266 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21267
21268         * parameter.cs (GetParameterInfo): Use a type cache to compute
21269         things only once, and to reuse this information
21270
21271         * expression.cs (LocalVariableReference::Emit): Implement.
21272         (OpcodeCast::Emit): fix.
21273
21274         (ParameterReference::Resolve): Implement.
21275         (ParameterReference::Emit): Implement.
21276
21277         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21278         that are expressions need to stay as Expressions.
21279
21280         * typemanager.cs (CSharpName): Returns the C# name of a type if
21281         possible. 
21282
21283         * expression.cs (Expression::ConvertImplicit): New function that
21284         implements implicit type conversions.
21285
21286         (Expression::ImplicitReferenceConversion): Implements implicit
21287         reference conversions.
21288
21289         (EmptyCast): New type for transparent casts.
21290
21291         (OpcodeCast): New type for casts of types that are performed with
21292         a sequence of bytecodes.
21293
21294         (BoxedCast): New type used for casting value types into reference
21295         types.  Emits a box opcode.
21296
21297         (Binary::DoNumericPromotions): Implements numeric promotions of
21298         and computation of the Binary::Type.
21299
21300         (Binary::EmitBranchable): Optimization.
21301
21302         (Binary::Emit): Implement code emission for expressions.
21303
21304         * typemanager.cs (TypeManager): Added two new core types: sbyte
21305         and byte.
21306
21307 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21308
21309         * class.cs (TypeContainer::FindMembers): Method which does exactly
21310         what Type.FindMembers does, only we don't have to use reflection. No
21311         implementation yet.
21312
21313         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21314         typecontainer objects as we need to get at them.
21315         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21316
21317         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21318         typecontainer object.
21319
21320         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21321         of just a Report object.
21322
21323 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21324
21325         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21326         "remove_"
21327         (TypeContainer::Populate): Now define the delegates of the type too.
21328         (TypeContainer.Delegates): Property to access the list of delegates defined
21329         in the type.
21330
21331         * delegates.cs (Delegate::Define): Implement partially.
21332
21333         * modifiers.cs (TypeAttr): Handle more flags.
21334
21335 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21336
21337         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21338         and not <=
21339         (Operator::Define): Re-write logic to get types by using the LookupType method
21340         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21341         (Indexer::Define): Ditto.
21342         (Event::Define): Ditto.
21343         (Property::Define): Ditto.
21344
21345 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21346
21347         * class.cs (TypeContainer::Populate): Now define operators too. 
21348         (TypeContainer.Operators): New property to access the list of operators
21349         in a type.
21350         (Operator.OperatorMethodBuilder): New member to hold the method builder
21351         for the operator we are defining.
21352         (Operator::Define): Implement.
21353
21354 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21355
21356         * class.cs (Event::Define): Make the prefixes of the accessor methods
21357         addOn_ and removeOn_ 
21358
21359         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21360         of the location being passed in too. Ideally, this should go later since all
21361         error reporting should be done through the Report object.
21362
21363         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21364         (Populate): Iterate thru the indexers we have and define them too.
21365         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21366         for the get and set accessors.
21367         (Indexer::Define): Implement.
21368
21369 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21370
21371         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21372         my previous implementation, did not work.
21373
21374         * typemanager.cs: Add a couple of missing types (the longs).
21375
21376         * literal.cs: Use TypeManager.bool_type instead of getting it.
21377
21378         * expression.cs (EventExpr): New kind of expressions.
21379         (Expressio::ExprClassFromMemberInfo): finish
21380
21381 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21382
21383         * assign.cs: Emit stores to static fields differently.
21384
21385 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21386
21387         * Merge in changes and adjust code to tackle conflicts. Backed out my
21388         code in Assign::Resolve ;-) 
21389
21390 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21391
21392         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21393         instead Report.Error and also pass in the location.
21394         (CSharpParser::Lexer): New readonly property to return the reference
21395         to the Tokenizer object.
21396         (declare_local_variables): Use Report.Error with location instead of plain 
21397         old error.
21398         (CheckDef): Ditto.
21399
21400         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21401         (Operator.CheckBinaryOperator): Ditto.
21402
21403         * cs-parser.jay (operator_declarator): Update accordingly.
21404
21405         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21406         (CheckBinaryOperator): Same here.
21407
21408         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21409         on the name without any prefixes of namespace names etc. This is because we
21410         already might have something already fully qualified like 
21411         'System.Console.WriteLine'
21412
21413         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21414
21415 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21416
21417         * cs-tokenizer.cs (location): Return a string which also contains
21418         the file name.
21419
21420         * expression.cs (ElementAccess): New class for expressions of the
21421         type 'element access.'
21422         (BaseAccess): New class for expressions of the type 'base access.'
21423         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21424         respectively.
21425
21426         * cs-parser.jay (element_access): Implement action.
21427         (base_access): Implement actions.
21428         (checked_expression, unchecked_expression): Implement.
21429
21430         * cs-parser.jay (local_variable_type): Correct and implement.
21431         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21432
21433         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21434
21435         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21436         name and the specifiers.
21437
21438         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21439
21440         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21441         making them all public ;-)
21442
21443         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21444         class anyways.
21445
21446 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21447
21448         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21449         PropertyExprs.
21450         (FieldExpr, PropertyExprs): New resolved expressions.
21451         (SimpleName::MemberStaticCheck): Perform static checks for access
21452         to non-static fields on static methods. Maybe this should be
21453         generalized for MemberAccesses. 
21454         (SimpleName::ResolveSimpleName): More work on simple name
21455         resolution. 
21456
21457         * cs-parser.jay (primary_expression/qualified_identifier): track
21458         the parameter index.
21459
21460         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21461         (EmitContext::EmitBoolExpression): Chain to expression generation
21462         instead of temporary hack.
21463         (::EmitStatementExpression): Put generic expression code generation.
21464
21465         * assign.cs (Assign::Emit): Implement variable assignments to
21466         local variables, parameters and fields.
21467
21468 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21469
21470         * statement.cs (Block::GetVariableInfo): New method, returns the
21471         VariableInfo for a variable name in a block.
21472         (Block::GetVariableType): Implement in terms of GetVariableInfo
21473
21474         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21475         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21476
21477 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21478
21479         * cs-parser.jay (operator_declaration): Continue on my quest : update
21480         to take attributes argument.
21481         (event_declaration): Ditto.
21482         (enum_declaration): Ditto.
21483         (indexer_declaration): Ditto.
21484
21485         * class.cs (Operator::Operator): Update constructor accordingly.
21486         (Event::Event): Ditto.
21487
21488         * delegate.cs (Delegate::Delegate): Same here.
21489
21490         * enum.cs (Enum::Enum): Same here.
21491
21492 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21493
21494         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21495
21496         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21497
21498         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21499         being passed around as an arraylist.
21500         (Attributes::AddAttribute): Method to add attribute sections.
21501
21502         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21503         (struct_declaration): Update accordingly.
21504         (constant_declaration): Update.
21505         (field_declaration): Update.
21506         (method_header): Update.
21507         (fixed_parameter): Update.
21508         (parameter_array): Ditto.
21509         (property_declaration): Ditto.
21510         (destructor_declaration): Ditto.
21511
21512         * class.cs (Struct::Struct): Update constructors accordingly.
21513         (Class::Class): Ditto.
21514         (Field::Field): Ditto.
21515         (Method::Method): Ditto.
21516         (Property::Property): Ditto.
21517         (TypeContainer::OptAttribute): update property's return type.
21518
21519         * interface.cs (Interface.opt_attributes): New member.
21520         (Interface::Interface): Update to take the extra Attributes argument.
21521
21522         * parameter.cs (Parameter::Parameter): Ditto.
21523
21524         * constant.cs (Constant::Constant): Ditto.
21525
21526         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21527         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21528         the attributes as a parameter.
21529         (InterfaceProperty): Update constructor call.
21530         (InterfaceEvent): Ditto.
21531         (InterfaceMethod): Ditto.
21532         (InterfaceIndexer): Ditto.
21533
21534         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21535         pass the attributes too.
21536         (interface_event_declaration): Ditto.
21537         (interface_property_declaration): Ditto.
21538         (interface_method_declaration): Ditto.
21539         (interface_declaration): Ditto.
21540
21541 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21542
21543         * class.cs (Method::Define): Track the "static Main" definition to
21544         create an entry point. 
21545
21546         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21547         EntryPoint if we find it. 
21548
21549         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21550         (EmitContext::ig): Make this variable public.
21551
21552         * driver.cs: Make the default output file be the first file name
21553         with the .exe extension.  
21554
21555         Detect empty compilations
21556
21557         Handle various kinds of output targets.  Handle --target and
21558         rename -t to --dumper.
21559
21560         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21561         methods inherited from Expression return now an Expression.  This
21562         will is used during the tree rewriting as we resolve them during
21563         semantic analysis.
21564
21565         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21566         the spec.  Missing entirely is the information about
21567         accessability of elements of it.
21568
21569         (Expression::ExprClassFromMemberInfo): New constructor for
21570         Expressions that creates a fully initialized Expression based on
21571         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21572         a Type.
21573
21574         (Invocation::Resolve): Begin implementing resolution of invocations.
21575
21576         * literal.cs (StringLiteral):  Implement Emit.
21577
21578 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21579
21580         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21581         member.
21582
21583 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21584
21585         * cs-parser.jay (attribute_arguments): Implement actions.
21586         (attribute): Fix bug in production. Implement action.
21587         (attribute_list): Implement.
21588         (attribute_target): Implement.
21589         (attribute_target_specifier, opt_target_specifier): Implement
21590         (CheckAttributeTarget): New method to check if the attribute target
21591         is valid.
21592         (attribute_section): Implement.
21593         (opt_attributes): Implement.
21594
21595         * attribute.cs : New file to handle attributes.
21596         (Attribute): Class to hold attribute info.
21597
21598         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21599         (attribute_section): Modify production to use 2 different rules to 
21600         achieve the same thing. 1 s/r conflict down !
21601         Clean out commented, useless, non-reducing dimension_separator rules.
21602
21603         * class.cs (TypeContainer.attributes): New member to hold list
21604         of attributes for a type.
21605         (Struct::Struct): Modify to take one more argument, the attribute list.
21606         (Class::Class): Ditto.
21607         (Field::Field): Ditto.
21608         (Method::Method): Ditto.
21609         (Property::Property): Ditto.
21610
21611         * cs-parser.jay (struct_declaration): Update constructor call to
21612         pass in the attributes too.
21613         (class_declaration): Ditto.
21614         (constant_declaration): Ditto.
21615         (field_declaration): Ditto.
21616         (method_header): Ditto.
21617         (fixed_parameter): Ditto.
21618         (parameter_array): Ditto.
21619         (property_declaration): Ditto.
21620
21621         * constant.cs (Constant::Constant): Update constructor similarly.
21622         Use System.Collections.
21623
21624         * parameter.cs (Parameter::Parameter): Update as above.
21625
21626 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21627
21628         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21629         (TypeContainer.delegates): New member to hold list of delegates.
21630
21631         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21632         this time as I seem to be on crack ;-)
21633
21634 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21635
21636         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21637         tell whether an identifier represents a namespace.
21638
21639         * expression.cs (NamespaceExpr): A namespace expression, used only
21640         temporarly during expression resolution.
21641         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21642         utility functions to resolve names on expressions.
21643
21644 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21645
21646         * codegen.cs: Add hook for StatementExpressions. 
21647
21648         * class.cs: Fix inverted test for static flag in methods.
21649
21650 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21651
21652         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21653         to make it coincide with MS' number.
21654         (Operator::CheckBinaryOperator): Ditto.
21655
21656         * ../errors/errors.txt : Remove error numbers added earlier.
21657
21658         * ../errors/cs1019.cs : Test case for error # 1019
21659
21660         * ../errros/cs1020.cs : Test case for error # 1020
21661
21662         * cs-parser.jay : Clean out commented cruft.
21663         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21664         used anywhere - non-reducing rule.
21665         (namespace_declarations): Non-reducing rule - comment out.
21666
21667         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21668         with TypeContainer::AddEnum.
21669
21670         * delegate.cs : New file for delegate handling classes.
21671         (Delegate): Class for declaring delegates.
21672
21673         * makefile : Update.
21674
21675         * cs-parser.jay (delegate_declaration): Implement.
21676
21677 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21678
21679         * class.cs (Event::Define): Implement.
21680         (Event.EventBuilder): New member.
21681
21682         * class.cs (TypeContainer::Populate): Update to define all enums and events
21683         we have.
21684         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21685         readonly fields for all these cases ?
21686
21687 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21688
21689         * class.cs (Property): Revamp to use the convention of making fields readonly.
21690         Accordingly modify code elsewhere.
21691
21692         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21693         the Define method of the Property class.
21694
21695         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21696         trivial bug.
21697         (TypeContainer::Populate): Update to define all the properties we have. Also
21698         define all enumerations.
21699
21700         * enum.cs (Define): Implement.
21701
21702 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21703
21704         * cs-parser.jay (overloadable_operator): The semantic value is an
21705         enum of the Operator class.
21706         (operator_declarator): Implement actions.
21707         (operator_declaration): Implement.
21708
21709         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21710         validity of definitions.
21711         (Operator::CheckBinaryOperator): Static method to check for binary operators
21712         (TypeContainer::AddOperator): New method to add an operator to a type.
21713
21714         * cs-parser.jay (indexer_declaration): Added line to actually call the
21715         AddIndexer method so it gets added ;-)
21716
21717         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21718         already taken care of by the MS compiler ?  
21719
21720 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21721
21722         * class.cs (Operator): New class for operator declarations.
21723         (Operator::OpType): Enum for the various operators.
21724
21725 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21726
21727         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21728         ostensibly handle this in semantic analysis.
21729
21730         * cs-parser.jay (general_catch_clause): Comment out
21731         (specific_catch_clauses, specific_catch_clause): Ditto.
21732         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21733         (catch_args, opt_catch_args): New productions.
21734         (catch_clause): Rewrite to use the new productions above
21735         (catch_clauses): Modify accordingly.
21736         (opt_catch_clauses): New production to use in try_statement
21737         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21738         and re-write the code in the actions to extract the specific and
21739         general catch clauses by being a little smart ;-)
21740
21741         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21742         Hooray, try and catch statements parse fine !
21743
21744 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21745
21746         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21747         string from the hashtable of variables.
21748
21749         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21750         I end up making that mistake ;-)
21751         (catch_clauses): Fixed gross error which made Key and Value of the 
21752         DictionaryEntry the same : $1 !!
21753
21754 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21755
21756         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21757
21758         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21759         when the add and remove accessors are specified. 
21760
21761 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21762
21763         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21764         information about indexer_declarator.
21765         (indexer_declarator): Implement actions.
21766         (parsing_indexer): New local boolean used to keep track of whether
21767         we are parsing indexers or properties. This is necessary because 
21768         implicit_parameters come into picture even for the get accessor in the 
21769         case of an indexer.
21770         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21771
21772         * class.cs (Indexer): New class for indexer declarations.
21773         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21774         (TypeContainer::indexers): New member to hold list of indexers for the
21775         type.
21776
21777 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21778
21779         * cs-parser.jay (add_accessor_declaration): Implement action.
21780         (remove_accessor_declaration): Implement action.
21781         (event_accessors_declaration): Implement
21782         (variable_declarators): swap statements for first rule - trivial.
21783
21784         * class.cs (Event): New class to hold information about event
21785         declarations.
21786         (TypeContainer::AddEvent): New method to add an event to a type
21787         (TypeContainer::events): New member to hold list of events.
21788
21789         * cs-parser.jay (event_declaration): Implement actions.
21790
21791 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21792
21793         * cs-parser.jay (dim_separators): Implement. Make it a string
21794         concatenating all the commas together, just as they appear.
21795         (opt_dim_separators): Modify accordingly
21796         (rank_specifiers): Update accordingly. Basically do the same
21797         thing - instead, collect the brackets here.
21798         (opt_rank_sepcifiers): Modify accordingly.
21799         (array_type): Modify to actually return the complete type string
21800         instead of ignoring the rank_specifiers.
21801         (expression_list): Implement to collect the expressions
21802         (variable_initializer): Implement. We make it a list of expressions
21803         essentially so that we can handle the array_initializer case neatly too.
21804         (variable_initializer_list): Implement.
21805         (array_initializer): Make it a list of variable_initializers
21806         (opt_array_initializer): Modify accordingly.
21807
21808         * expression.cs (New::NType): Add enumeration to help us
21809         keep track of whether we have an object/delegate creation
21810         or an array creation.
21811         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21812         members to hold data about array creation.
21813         (New:New): Modify to update NewType
21814         (New:New): New Overloaded contructor for the array creation
21815         case.
21816
21817         * cs-parser.jay (array_creation_expression): Implement to call
21818         the overloaded New constructor.
21819
21820 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21821
21822         * class.cs (TypeContainer::Constructors): Return member
21823         constructors instead of returning null.
21824
21825 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21826
21827         * typemanager.cs (InitCoreTypes): Initialize the various core
21828         types after we have populated the type manager with the user
21829         defined types (this distinction will be important later while
21830         compiling corlib.dll)
21831
21832         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21833         on Expression Classification.  Now all expressions have a method
21834         `Resolve' and a method `Emit'.
21835
21836         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21837         generation from working.     Also add some temporary debugging
21838         code. 
21839
21840 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21841
21842         * codegen.cs: Lots of code generation pieces.  This is only the
21843         beginning, will continue tomorrow with more touches of polish.  We
21844         handle the fundamentals of if, while, do, for, return.  Others are
21845         trickier and I need to start working on invocations soon.
21846
21847         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21848         s.InitStatement. 
21849
21850         * codegen.cs (EmitContext): New struct, used during code
21851         emission to keep a context.   Most of the code generation will be
21852         here. 
21853
21854         * cs-parser.jay: Add embedded blocks to the list of statements of
21855         this block.  So code generation proceeds in a top down fashion.
21856
21857 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21858
21859         * statement.cs: Add support for multiple child blocks.
21860
21861 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21862
21863         * codegen.cs (EmitCode): New function, will emit the code for a
21864         Block of code given a TypeContainer and its ILGenerator. 
21865
21866         * statement.cs (Block): Standard public readonly optimization.
21867         (Block::Block constructors): Link children. 
21868         (Block::Child): Child Linker.
21869         (Block::EmitVariables): Emits IL variable declarations.
21870
21871         * class.cs: Drop support for MethodGroups here, delay until
21872         Semantic Analysis.
21873         (Method::): Applied the same simplification that I did before, and
21874         move from Properties to public readonly fields.
21875         (Method::ParameterTypes): Returns the parameter types for the
21876         function, and implements a cache that will be useful later when I
21877         do error checking and the semantic analysis on the methods is
21878         performed.
21879         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21880         and made a method, optional argument tells whether this is a class
21881         or a structure to apply the `has-this' bit.
21882         (Method::GetCallingConvention): Implement, returns the calling
21883         convention. 
21884         (Method::Define): Defines the type, a second pass is performed
21885         later to populate the methods.
21886
21887         (Constructor::ParameterTypes): implement a cache similar to the
21888         one on Method::ParameterTypes, useful later when we do semantic
21889         analysis. 
21890
21891         (TypeContainer::EmitMethod):  New method.  Emits methods.
21892
21893         * expression.cs: Removed MethodGroup class from here.
21894
21895         * parameter.cs (Parameters::GetCallingConvention): new method.
21896
21897 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21898
21899         * class.cs (TypeContainer::Populate): Drop RootContext from the
21900         argument. 
21901
21902         (Constructor::CallingConvention): Returns the calling convention.
21903         (Constructor::ParameterTypes): Returns the constructor parameter
21904         types. 
21905
21906         (TypeContainer::AddConstructor): Keep track of default constructor
21907         and the default static constructor.
21908
21909         (Constructor::) Another class that starts using `public readonly'
21910         instead of properties. 
21911
21912         (Constructor::IsDefault): Whether this is a default constructor. 
21913
21914         (Field::) use readonly public fields instead of properties also.
21915
21916         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21917         track of static constructors;  If none is used, turn on
21918         BeforeFieldInit in the TypeAttributes. 
21919
21920         * cs-parser.jay (opt_argument_list): now the return can be null
21921         for the cases where there are no arguments. 
21922
21923         (constructor_declarator): If there is no implicit `base' or
21924         `this', then invoke the default parent constructor. 
21925
21926         * modifiers.cs (MethodAttr): New static function maps a set of
21927         modifiers flags into a MethodAttributes enum
21928         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21929         MethodAttr, TypeAttr to represent the various mappings where the
21930         modifiers are used.
21931         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21932
21933 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21934
21935         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21936         method arguments.
21937
21938         * interface.cs (PopulateIndexer): Implemented the code generator
21939         for interface indexers.
21940
21941 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21942
21943         * interface.cs (InterfaceMemberBase): Now we track the new status
21944         here.  
21945
21946         (PopulateProperty): Implement property population.  Woohoo!  Got
21947         Methods and Properties going today. 
21948
21949         Removed all the properties for interfaces, and replaced them with
21950         `public readonly' fields. 
21951
21952 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21953
21954         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21955         initialize their hashtables/arraylists only when they are needed
21956         instead of doing this always.
21957
21958         * parameter.cs: Handle refs and out parameters.
21959
21960         * cs-parser.jay: Use an ArrayList to construct the arguments
21961         instead of the ParameterCollection, and then cast that to a
21962         Parameter[] array.
21963
21964         * parameter.cs: Drop the use of ParameterCollection and use
21965         instead arrays of Parameters.
21966
21967         (GetParameterInfo): Use the Type, not the Name when resolving
21968         types. 
21969
21970 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21971
21972         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21973         and instead use public readonly fields.
21974
21975         * class.cs: Put back walking code for type containers.
21976
21977 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21978
21979         * class.cs (MakeConstant): Code to define constants.
21980
21981         * rootcontext.cs (LookupType): New function.  Used to locate types 
21982
21983
21984 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21985
21986         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21987         this System.Reflection code is.  Kudos to Microsoft
21988
21989         * typemanager.cs: Implement a type cache and avoid loading all
21990         types at boot time.  Wrap in LookupType the internals.  This made
21991         the compiler so much faster.  Wow.  I rule!
21992
21993         * driver.cs: Make sure we always load mscorlib first (for
21994         debugging purposes, nothing really important).
21995
21996         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21997         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21998
21999         * rootcontext.cs: Lookup types on their namespace;  Lookup types
22000         on namespaces that have been imported using the `using' keyword.
22001
22002         * class.cs (TypeContainer::TypeAttr): Virtualize.
22003         (Class::TypeAttr): Return attributes suitable for this bad boy.
22004         (Struct::TypeAttr): ditto.
22005         Handle nested classes.
22006         (TypeContainer::) Remove all the type visiting code, it is now
22007         replaced with the rootcontext.cs code
22008
22009         * rootcontext.cs (GetClassBases): Added support for structs. 
22010
22011 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
22012
22013         * interface.cs, statement.cs, class.cs, parameter.cs,
22014         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22015         Drop use of TypeRefs, and use strings instead.
22016
22017 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
22018
22019         * rootcontext.cs: 
22020
22021         * class.cs (Struct::Struct): set the SEALED flags after
22022         checking the modifiers.
22023         (TypeContainer::TypeAttr): new property, returns the
22024         TypeAttributes for a class.  
22025
22026         * cs-parser.jay (type_list): Oops, list production was creating a
22027         new list of base types.
22028
22029         * rootcontext.cs (StdLib): New property.
22030         (GetInterfaceTypeByName): returns an interface by type name, and
22031         encapsulates error handling here.
22032         (GetInterfaces): simplified.
22033         (ResolveTree): Encapsulated all the tree resolution here.
22034         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22035         types. 
22036
22037         * driver.cs: Add support for --nostdlib, to avoid loading the
22038         default assemblies.
22039         (Main): Do not put tree resolution here. 
22040
22041         * rootcontext.cs: Beginning of the class resolution.
22042
22043 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
22044
22045         * rootcontext.cs: Provide better error reporting. 
22046
22047         * cs-parser.jay (interface_base): set our $$ to be interfaces.
22048
22049         * rootcontext.cs (CreateInterface): Handle the case where there
22050         are no parent interfaces.
22051
22052         (CloseTypes): Routine to flush types at the end.
22053         (CreateInterface): Track types.
22054         (GetInterfaces): Returns an array of Types from the list of
22055         defined interfaces.
22056
22057         * typemanager.c (AddUserType): Mechanism to track user types (puts
22058         the type on the global type hash, and allows us to close it at the
22059         end). 
22060
22061 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
22062
22063         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22064         RecordInterface instead.
22065
22066         * cs-parser.jay: Updated to reflect changes above.
22067
22068         * decl.cs (Definition): Keep track of the TypeBuilder type that
22069         represents this type here.  Not sure we will use it in the long
22070         run, but wont hurt for now.
22071
22072         * driver.cs: Smaller changes to accomodate the new code.
22073
22074         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22075         when done. 
22076
22077         * rootcontext.cs (CreateInterface):  New method, used to create
22078         the System.TypeBuilder type for interfaces.
22079         (ResolveInterfaces): new entry point to resolve the interface
22080         hierarchy. 
22081         (CodeGen): Property, used to keep track of the code generator.
22082
22083 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
22084
22085         * cs-parser.jay: Add a second production for delegate_declaration
22086         with `VOID'.
22087
22088         (enum_body): Put an opt_comma here instead of putting it on
22089         enum_body or enum_member_declarations so we can handle trailing
22090         commas on enumeration members.  Gets rid of a shift/reduce.
22091
22092         (type_list): Need a COMMA in the middle.
22093
22094         (indexer_declaration): Tell tokenizer to recognize get/set
22095
22096         * Remove old targets.
22097
22098         * Re-add the parser target.
22099
22100 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22101
22102         * cs-parser.jay: Add precendence rules for a number of operators
22103         ot reduce the number of shift/reduce conflicts in the grammar.
22104
22105 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
22106
22107         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22108         and put it here.
22109
22110         Get rid of old crufty code.
22111
22112         * rootcontext.cs: Use this to keep track of the parsed
22113         representation and the defined types available to the program. 
22114
22115         * gen-treedump.cs: adjust for new convention.
22116
22117         * type.cs: Split out the type manager, and the assembly builder
22118         from here. 
22119
22120         * typemanager.cs: the type manager will live here now.
22121
22122         * cil-codegen.cs: And the code generator here. 
22123
22124 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
22125
22126         * makefile: Fixed up for easy making.
22127
22128 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22129
22130         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22131         the 
22132
22133         (unary_expression): Expand pre_increment_expression and
22134         post_decrement_expression to reduce a shift/reduce.
22135
22136 2001-07-11  Simon Cozens
22137
22138         * cs-tokenizer.cs: Hex numbers should begin with a 0.
22139
22140         Improve allow_keyword_as_indent name.
22141
22142 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
22143
22144         * Adjustments for Beta2. 
22145
22146 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
22147
22148         * decl.cs: Added `Define' abstract method.
22149         (InTransit): new property, used to catch recursive definitions. 
22150
22151         * interface.cs: Implement `Define'. 
22152
22153         * modifiers.cs: Map Modifiers.constants to
22154         System.Reflection.TypeAttribute flags.
22155
22156         * class.cs: Keep track of types and user-defined types.
22157         (BuilderInit): New method for creating an assembly
22158         (ResolveType): New function to launch the resolution process, only
22159         used by interfaces for now.
22160
22161         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22162         that are inserted into the name space. 
22163
22164 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
22165
22166         * ARGH.  I have screwed up my tree so many times due to the use of
22167         rsync rather than using CVS.  Going to fix this at once. 
22168
22169         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
22170         load types.
22171
22172 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
22173
22174         * Experiment successful: Use System.Type rather that our own
22175         version of Type.  
22176
22177 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
22178
22179         * cs-parser.jay: Removed nsAliases from here.
22180
22181         Use new namespaces, handle `using XXX;' 
22182
22183         * namespace.cs: Reimplemented namespace handling, use a recursive
22184         definition of the class.  Now we can keep track of using clauses
22185         and catch invalid using clauses.
22186
22187 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
22188
22189         * gen-treedump.cs: Adapted for all the renaming.
22190
22191         * expression.cs (Expression): this class now has a Type property
22192         which returns an expression Type.
22193
22194         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22195         `Type', as this has a different meaning now in the base
22196
22197 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
22198
22199         * interface.cs, class.cs: Removed from all the sources the
22200         references to signature computation, as we can not do method
22201         signature computation during the parsing time, as we are not
22202         trying to solve at that point distinguishing:
22203
22204         class X {
22205                 void a (Blah x) {}
22206                 void a (NS.Blah x) {}
22207         }
22208
22209         Which depending on the context might be valid or not, as we do not
22210         know if Blah is the same thing as NS.Blah at that point.
22211
22212         * Redid everything so the code uses TypeRefs now instead of
22213         Types.  TypeRefs are just temporary type placeholders, that need
22214         to be resolved.  They initially have a pointer to a string and the
22215         current scope in which they are used.  This is used later by the
22216         compiler to resolve the reference to an actual Type. 
22217
22218         * DeclSpace is no longer a CIR.Type, and neither are
22219         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
22220         are all DeclSpaces, but no Types. 
22221
22222         * type.cs (TypeRefManager): This implements the TypeRef manager,
22223         which keeps track of all the types that need to be resolved after
22224         the parsing has finished. 
22225
22226 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
22227
22228         * ARGH.  We are going to have to store `foreach' as a class rather
22229         than resolving it, as we need to verify error 1579 after name
22230         resolution.   *OR* we could keep a flag that says `This request to
22231         IEnumerator comes from a foreach statement' which we can then use
22232         to generate the error.
22233
22234 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
22235
22236         * class.cs (TypeContainer.AddMethod): we now add methods to the
22237         MethodGroup instead of the method hashtable.  
22238
22239         * expression.cs: Add MethodGroup abstraction, which gets us one
22240         step closer to the specification in the way we handle method
22241         declarations.  
22242
22243         * cs-parser.jay (primary_expression): qualified_identifier now
22244         tried to match up an identifier to a local variable reference or
22245         to a parameter reference.
22246
22247         current_local_parameters is now a parser global variable that
22248         points to the current parameters for the block, used during name
22249         lookup.
22250
22251         (property_declaration): Now creates an implicit `value' argument to
22252         the set accessor.
22253
22254 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22255
22256         * parameter.cs: Do not use `param' arguments as part of the
22257         signature, per the spec.
22258
22259 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22260
22261         * decl.cs: Base class for classes, structs and interfaces.  This
22262         is the "Declaration Space" 
22263
22264         * cs-parser.jay: Use CheckDef for checking declaration errors
22265         instead of having one on each function.
22266
22267         * class.cs: Factor out some code for handling error handling in
22268         accordance to the "Declarations" section in the "Basic Concepts"
22269         chapter in the ECMA C# spec.
22270
22271         * interface.cs: Make all interface member classes derive from
22272         InterfaceMemberBase.
22273
22274 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22275
22276         * Many things: all interfaces are parsed and generated in
22277         gen-treedump.  Support for member variables, constructors,
22278         destructors, properties, constants is there.
22279
22280         Beginning of the IL backend, but very little done, just there for
22281         testing purposes. 
22282
22283 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22284
22285         * cs-parser.jay: Fix labeled statement.
22286
22287         * cs-tokenizer.cs (escape): Escape " and ' always.
22288         ref_line, ref_name: keep track of the line/filename as instructed
22289         by #line by the compiler.
22290         Parse #line.
22291
22292 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22293
22294         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22295         to match the values in System.CodeDOM.
22296
22297         Divid renamed to Divide.
22298
22299         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22300         statements. 
22301         (Statements.set): remove.
22302
22303         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22304         statements. 
22305
22306         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22307         falseStatements always have valid values. 
22308
22309         * cs-parser.jay: Use System.CodeDOM now.
22310