2006-01-13 John Luke <john.luke@gmail.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2
3         This fixes the problem where we used ldfld instead of ldflda to
4         load the "THIS" pointer on captured parameters, when THIS is a
5         value type.  See bug #77205.
6         
7         * iterators.cs (CapturedThisReference.Emit): Pass false to
8         EmitThis (we do not need the address).
9
10         * codegen.cs (EmitThis): it needs to know whether we need the
11         address of `this' or not.  This is used by value types.  
12
13         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
14         every other call passes false.
15
16 2006-01-12  Raja R Harinath  <rharinath@novell.com>
17
18         Fix #77221.
19         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
20         GetOverride.
21         * expression.cs (Invocation.OverloadResolve): Update.
22         (Invocation.DoResolve): Avoid double resolution of invocation.
23
24 2006-01-11  Raja R Harinath  <rharinath@novell.com>
25
26         Fix #77180.
27         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
28         unary negation of floating point types as 0-expr; negation cannot
29         overflow in floating point types.
30
31         Fix #77204.
32         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
33         on operands of 'void' type.
34
35         Fix #77200.
36         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
37         and ExclusiveOr for boolean constants too.
38
39 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
40
41         * expression.cs: Fix Console.WriteLine ((this = x).foo);
42
43 2006-01-12  Miguel de Icaza  <miguel@novell.com>
44
45         * cs-tokenizer.cs (Position): New class used to save and restore
46         the position state in the tokenizer.  Before this patch the save
47         and restore was not complete enough so the line and columns would
48         start to drift and the debugger and stack traces will get the
49         wrong data.
50
51 2006-01-10  Martin Baulig  <martin@ximian.com>
52
53         * generic.cs
54         (TypeParameter.InflateConstraints): New public method.
55
56         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
57         constraints; fixes #77042.
58
59 2006-01-10  Martin Baulig  <martin@ximian.com>
60
61         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
62         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
63         #77061. 
64
65 2006-01-09  Raja R Harinath  <rharinath@novell.com>
66
67         Fix #75636.
68         * expression.cs (Invocation.OverloadResolve): Replace reflected
69         override methods with their base virtual methods, rather than
70         skipping over them.
71         * typemanager.cs (TypeManager.GetOverride): New.
72
73 2005-12-21  Miguel de Icaza  <miguel@novell.com>
74
75         * driver.cs: Report the case of no source files and no -out:
76         argument provided.
77
78 2005-12-20  Raja R Harinath  <rharinath@novell.com>
79
80         Fix #77035.
81         * expression.cs (ComposedCast.GetSignatureForError): Define.
82
83 2006-01-05  Jb Evain  <jbevain@gmail.com>
84
85         * class.cs (Property.Define, Indexer.Define): do not tag the
86         properties as SpecialName | RTSpecialName.
87
88 2006-01-04  Miguel de Icaza  <miguel@novell.com>
89
90         * class.cs (MethodCore.IsDuplicateImplementation): This method was
91         doing a low-level comparission of parameter types.  It was lacking
92         a check for __argslist. 
93
94 2005-12-30  Miguel de Icaza  <miguel@novell.com>
95
96         * expression.cs (ParameterReference.DoResolveBase): Allow
97         reference parameters if they are local to this block. 
98
99         This allows the ref and out parameters of a delegate to be used in
100         an anonymous method, for example:
101
102         delegate void set (out int x);
103
104         set s = delegate (out int x){
105                 x = 0;
106         };
107
108         This is used by functionality introduced late in the C# language.
109         
110         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
111         method that take ref and out parameters. 
112
113         Fixes #77119 which was a late change in the spec.
114
115 2005-12-23  Miguel de Icaza  <miguel@novell.com>
116
117         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
118         parent if its the same scope.  Fixes #77060.
119
120 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
121
122         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
123
124 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
125
126         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
127         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
128         that doesn't contain the full public key. This is a update of the
129         friend assemblies in .Net 2.0 release.
130         
131 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
132
133         Fix #76995
134
135         * namespace.cs (NamespaceEntry): Add extern_aliases as a
136         ListDictionary, to contain the ExternAliasEntry entries (in
137         addition to the NamespaceEntry.aliases hashtable). This field is
138         shared between the original entry and its doppelganger (bodyless 
139         copy of it).
140         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
141         extern_aliases field.
142         (NamespaceEntry.Lookup): Move the IsImplicit check after the
143         lookup in extern_aliases.
144
145 2005-12-16  Raja R Harinath  <rharinath@novell.com>
146
147         Fix #77006.
148         * class.cs (TypeContainer.Mark_HasEquals): New.
149         (TypeContainer.Mark_HasGetHashCode): New.
150         (ClassPart): Override them.
151         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
152
153         * generic.cs (GenericMethod.DefineMembers): Update to changes.
154         (TypeParameter.TypeParameter): Change type of 'parent' argument to
155         DeclSpace.
156
157         Fix #77008.
158         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
159         'parent' argument to the base constructor.
160
161         Remove all mention of TypeContainer from decl.cs.
162         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
163         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
164         (DeclSpace.DeclSpace): Likewise.
165         (DeclSpace.DefineMembers): Remove unused argument.
166         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
167         debugging check -- we don't care if the debug code throws an
168         InvalidCastException instead of an InternalErrorException.
169         * class.cs (TypeContainer.DefineMembers): Update to changes.
170         (TypeContainer.DoDefineMembers): Likewise.
171         (TypeContainer.GetMethods): Likewise.
172         (PropertyMember.Define): Likewise.
173         (MemberBase.Parent): New property that forwards to
174         MemberCore.Parent, but ensures that we get a TypeContainer.
175         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
176         (RootContext.PopulateTypes): Likewise.  Remove special case code
177         for !RootContext.StdLib: DefineMembers is idempotent.
178
179 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
180
181         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
182
183 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
184
185         * doc.cs : The search for referenced namespace was insufficient to
186           get global one as it used to do. Fixed bug #76965.
187
188 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
189
190         * doc.cs : check name in cref in the last phase that whether it is
191           namespace or not.
192
193 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
194
195         * cs-tokenizer.cs : reverted the latest change: it somehow broke
196           Mono.C5.
197
198 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
199
200         * doc.cs : so it turned out that we cannot skip override check for 
201           interface members. Fixed bug #76954.
202
203 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
204
205         * cs-tokenizer.cs : fixed bug #75984:
206           - #warning and #error should not be handled when the source line
207             is disabled.
208           - #line is not checked strictly when the source line is disabled.
209           - #define and #undef is on the other hand checked strictly at any
210             state.
211
212 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
213
214         * cs-tokenizer.cs : missing Location (actually, filename) in one of
215           CS1027 report.
216
217 2005-12-15  Raja R Harinath  <rharinath@novell.com>
218
219         * generic.cs (TypeManager.IsGeneric): Remove unused method.
220
221         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
222         nested types.
223
224 2005-12-14  Martin Baulig  <martin@ximian.com>
225
226         * typemanager.cs (TypeManager.GetFullName): Make this public;
227         `Type.Fullname' now never returns null.
228
229         * class.cs (Method.Define): Use TypeManager.GetFullName() for
230         explicit interface implementations; we're now using the same
231         naming convention than csc does.
232
233 2005-12-14  Miguel de Icaza  <miguel@novell.com>
234
235         * convert.cs (ExplicitConversionCore): Check the return value from
236         ExplicitConversionCore which can return null on failure.  Fixes #76914
237
238 2005-12-09  Raja R Harinath  <rharinath@novell.com>
239
240         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
241         instead of IsGenericInstance.
242         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
243         code that's now covered by the more general test.
244         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
245
246         * generic.cs (DropGenericTypeArguments): New.  Captures the common
247         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
248         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
249         * generic.cs, report.cs, typemanager.cs: Likewise.
250
251 2005-12-08  Martin Baulig  <martin@ximian.com>
252
253         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
254
255         * typemanager.cs (TypeManager.CSharpSignature): Include type
256         arguments in the signature of a generic method.
257
258 2005-12-07  Martin Baulig  <martin@ximian.com>
259
260         Add support for custom attributes on type parameters.
261
262         * cs-parser.jay (type_arguments): Added `opt_attributes'.
263
264         * generic.cs (TypeParameterName): New public class; we use this
265         instead of a `string' to store the name of a type parameter, so we
266         can also have `Attributes'.
267         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
268         array instead of a `string[]' array.
269         (TypeParameter.ctor): We now also take an `Attributes' argument.
270         (TypeParameter.EmitAttributes): New public method; emit our
271         `OptAttributes' here.
272         (GenericMethod.EmitAttributes): New public method; emit the custom
273         attributes on all our type parameters.
274
275         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
276         our type parameters.
277         (MethodData.Define): If we're a generic method, call
278         EmitAttributes() on it.
279
280 2005-12-07  Martin Baulig  <martin@ximian.com>
281
282         * generic.cs
283         (ConstraintChecker): New public abstract class; move the
284         constraint checking here from `ConstructedType' and also do
285         constraint checking for generic methods here.
286
287         * expression.cs (Invocation.OverloadResolve): Use
288         ConstraintChecker.CheckConstraints() if we resolved to a generic
289         method.  Fix #76806.
290
291 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
292
293         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
294
295         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
296         event initializers.
297         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
298         (FieldBase.Initializer): Initializer is now optional.
299         (EventField.Define): Only event field can have initializer.
300
301         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
302
303         * const.cs (Const): Reuse initializer.
304
305         * cs-parser.jay: Updated after FieldBase changes.
306         Added current_array_type to simplify array initializers.
307
308         * ecore.cs (NullCast.IsDefaultValue): Implemented.
309
310         * expression.cs, iterators.cs: Updated.
311
312         * namespace.cs (NamespaceEntry): Made UsingFound private.
313
314 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
315
316         * parameterCollection.cs: Obsolete, removed.
317         * parser.cs: Obsolete, removed.
318
319 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
320
321         Fix #76849.
322         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
323
324         * enum.cs (Enum.Define): Set obsolete context here.
325
326 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
327
328         * doc.cs :
329           - FindDocumentedMember() now expects 1) paramList as null
330             when "we don't have to check the number of parameters" and
331             2) Type.EmptyTypes when "there is no arguments".
332           - Introduced FoundMember struct to hold the exact type which was
333             used to find the documented member (the above change broke
334             test-xml-044; it might be better just to use DeclaringType than
335             what MS does, like this change does, but it depends on usage.)
336
337 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
338
339         * doc.cs : documented member might be from DeclaringType for nested
340           types. Fixed bug #76782.
341
342 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
343
344         * anonymous.cs: Have the param code handle leaving copies on the
345         stack etc. Allows anonymous params to take part in the assignment
346         code (++, +=, etc). Fixes bug #76550
347
348         * expression.cs: Handle the prepare_for_load/leave_copy by passing
349         it down to the anon code.
350
351         * iterators.cs: Use dummy var here
352
353         * codegen.cs: Handle new vars
354
355 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
356
357         Fix #76849.
358         * class.cs (MethodData.Define): Set proper Obsolete context.
359
360         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
361         obsolete context.
362         (FieldExpr.DoResolve): Ditto.
363
364 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
365
366         Fix #76849.
367         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
368         parent is not obsolete.
369
370 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
371
372         * doc.cs : (FindDocumentedMember) find parameterless members first
373           and get CS0419 in the early stage. Fixed first case of bug #76727.
374
375 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
376
377         Fix #76859.
378         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
379         no error was reported.
380
381         *expression.cs (Binary.DoResolve): left can be null.
382
383 2005-12-06  Raja R Harinath  <rharinath@novell.com>
384
385         * class.cs (MethodCore.CheckGenericOverride): Delete unused
386         abstract method and all overrides.
387         * support.cs (ParameterData.GenericConstraints): Delete.
388         (ReflectionParameters.type_params): Delete.
389         (ReflectionParameters.ReflectionParameters): Make private.
390         (ReflectionParameters.GetConstaints): New factory method.
391         * generic.cs (TypeParameterDefineType): Use it.
392         (TypeManager.GetTypeParameterConstraints): Likewise.
393
394 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
395
396         Fix #76783.
397         * class.cs (MethodData.Emit): Parameters should be labeled first.
398
399 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
400
401         Fix #76761.
402         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
403
404 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
405
406         * attribute.cs (AreParametersCompliant): Moved to Parameter.
407
408         * class.cs (MethodCore): Parameter clean up.
409         (IMethodData): Added ParameterInfo.
410         (MethodData): Parameter clean up.
411         (Indexer.Define): Parameter clean up.
412
413         * anonymous.cs,
414         * codegen.cs,
415         * cs-parser.jay,
416         * decl.cs,
417         * doc.cs,
418         * ecore.cs,
419         * flowanalysis.cs,
420         * iterators.cs,
421         * pending.cs,
422         * statement.cs,
423         * typemanager.cs: Parameter clean up.
424
425         * delegate.cs (Define): Get rid of duplicated code.
426
427         * expression.cs (ParameterReference): Removed useless parameters
428         and simplified.
429         (Invocation): Ditto.
430
431         * parameter.cs (ParamsParameter): New class, params specialization.
432         (ArglistParameter): Attemp to separate arglist.
433         (Parameter): Refactored to be reusable and faster.
434         (Parameter.Modifier): Made understandable.
435         (Parameters): Changed to be used as a class for `this' assembly
436         parameters. Refactored to use new specialized classes.
437
438         * support.cs (ParameterData): Added Types property.
439         (InternalParameters): Deleted.
440
441 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
442
443         * doc.cs : the previous patch does not actually fix the bug.
444           PropertyInfo override check is now implemented and really fixed it.
445         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
446
447 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
448
449         * doc.cs : apply "override filter" also to properties.
450           Fixed bug #76730.
451
452 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
453
454         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
455           no need to check overrides. For classes, omit those results from 
456           interfaces since they must exist in the class. Fixed bug #76726.
457
458 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
459
460         * typemanager.cs : (GetFullNameSignature) differentiate indexers
461           with different parameters. Fixed the second problem in #76685.
462
463 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
464
465         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
466           get expected 'protected' access in CheckValidFamilyAccess()).
467           Fixed bug #76692.
468
469 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
470
471         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
472           Fixed bug #76705.  CS1569 was incorrectly commented out.
473
474 2005-11-23  Martin Baulig  <martin@ximian.com>
475
476         * generic.cs (Constraints.Define): Removed.
477         (TypeParameter.DefineConstraints): Removed.
478         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
479         on the GenericTypeParameterBuilder here.
480
481 2005-11-23  Martin Baulig  <martin@ximian.com>
482
483         * typemanager.cs (TypeManager.GetProperty): Make this public.
484
485         * generic.cs (Nullable.NullableInfo.ctor): Use
486         TypeManager.GetProperty() rather than using reflection directly.
487
488 2005-11-17  Martin Baulig  <martin@ximian.com>
489
490         * expression.cs (Indexers.GetIndexersForType): Added support for
491         generic parameters; fixes #76587.
492
493 2005-11-17  Martin Baulig  <martin@ximian.com>
494
495         * anonymous.cs
496         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
497         inherit the scope from our parent.  Fixes #76653.
498
499 2005-11-15  Martin Baulig  <martin@ximian.com>
500
501         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
502         instead of `ScopeTypeBuilder' to refer to the "current" type.
503         (AnonymousMethod.CreateScopeType): Correctly create the helper
504         class if we're inside a generic type definition.
505
506 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
507
508         * doc.cs : use Invocation.IsOverride() to do real override check.
509         * expression.cs : made Invocation.IsOverride() internal.
510
511 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
512
513         * doc.cs : use TypeManager.FindMembers() instead of (possible)
514           TypeBuilder.FindMembers() and filter overriden base members out.
515           Fixed bug #76990.
516
517 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
518
519         * doc.cs : ref/out parameters are represented as '@' (instead of
520           '&' in type FullName). Fixed bug #76630 (additionally crefs).
521
522 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
523
524         * doc.cs : when there was no '.' in cref to methods in doc comment,
525           then parameters were missing in the output. Fixed bug #76691.
526
527 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
528
529         * driver.cs : don't output docs when there is an error.
530           Fixed bug #76693.
531
532 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
533
534         * doc.cs :
535           Now it should detect indexers. Fixed primary concern in bug #76685.
536           Fixed CS0419 message to not show the identical member signature in
537           the message.
538
539 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
540
541         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
542           instead of Type.FindMembers() since it does not handle events.
543           Fixed bug #71604.
544
545 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
546
547         * codegen.cs: Fixed typo (speficied -> specified).
548
549 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
550
551         Fix #76369.
552         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
553
554 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
555
556         * attribute.cs: Changed error message.
557
558         * cs-tokenizer.cs: One more check.
559
560 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
561
562         * statement.cs (Block.Resolve): Ignore empty statement.
563
564 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
565
566         * report.cs: Made error/warning methods more strict to avoid
567         their misuse.
568
569         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
570         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
571         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
572         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
573
574 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
575
576         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
577         Use the more explicit AssemblyName.FullName instead of 
578         AssemblyName.Name to report errors.
579         
580 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
581
582         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
583         with mcs.
584
585 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
586
587         * class.cs,
588         * convert.cs,
589         * cs-parser.jay,
590         * decl.cs,
591         * enum.cs,
592         * expression.cs,
593         * generic.cs,
594         * pending.cs,
595         * report.cs: Fixed error reporting and typos.
596
597         * generic.cs (TypeParameter.GetSignatureForError): New method.
598         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
599
600         * typemanager.cs (GetFullName): Refactored.
601
602 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
603
604         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
605         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
606
607         * class.cs (TypeContainer.IsComImport): New property.
608         (Constructor.Define): Create proper ctor for ComImport types.
609
610         * expression.cs (New.CheckComImport): Fixed.
611
612 2005-11-07  Miguel de Icaza  <miguel@novell.com>
613
614         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
615         that a parameter has been captured does not mean that we do not
616         have to do the rest of the processing.  This fixes the second part
617         of #76592.  If there was another anonymous method capturing
618         values in the past, the Scope would never be set for the second
619         method that captured the same parameter.
620
621         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
622         properly manipulate the stack.   Second part of fix for #76592.
623
624         * expression.cs (New): Add support for invoking "new" on
625         interfaces that have been flagged with the ComImport attribute and
626         the CoClass.  Fixes #76637 
627
628         * statement.cs (Try.DoEmit): When a variable is captured, do not
629         try to emit the vi.LocalBuilder variable as it has been captured.
630         Create a temporary variable and store the results on the
631         FieldBuilder.  Fixes #76642
632
633 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
634
635         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
636
637         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
638
639         * expression.cs (Binary.DoResolve): Added && optimalization.
640     
641         * typemanager.cs (AddUserType): Removed useless argument.
642
643 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
644
645         * statement.cs (Block.variables): Uses ListDictionary.
646
647 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
648
649         Fix #75969.
650         * class.cs (PartialContainer.EmitType): Customized to emit
651         security attributes.
652         (ClassPart.ApplyAttributeBuilder): Transform security attribute
653         for partial classes.
654
655 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
656
657         Fix #76599.
658         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
659         access has to be fixed.
660         
661         * typemanager.cs (IsUnmanagedType): Wrong common field type.
662
663 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
664
665         Fix #76590.
666         * ecore.cs (NullCast.Reduce): Implemented.
667
668         * expression.cs (ArrayCreation.CheckIndices): Correcly check
669         constant type.
670         
671         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
672         properly.
673         (Foreach.Resolve): Catch null properly.
674
675 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
676  
677         * cs-tokenizer.cs: Warning text fix.
678
679         * driver.cs: AllWarningNumbers exposed on public interface.
680
681         * report.cs (): Reviewed warning numbers.
682         (IsValidWarning): Use binary search.
683
684 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
685  
686         * driver.cs: Implemeted resource visibility.
687         (Resources): New class for code sharing between /res: and
688         /linkres:
689  
690 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
691
692         decl.cs (CurrentTypeParameters): Fixed to be public.
693
694 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
695
696         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
697
698 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
699
700         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
701
702 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
703
704         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
705
706 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
707
708         Add friend assembly access support.
709         * typemanager.cs: assembly_internals_vis_attrs
710         cache for friend assembly access. 
711         (TypeManager.IsFriendAssembly): New method for
712         checking friend assembly access.
713         (TypeManager.Error_FriendAccessNameNotMatching): New
714         helper method.
715         (TypeManager.CompareKeyTokens): Likewise.
716         (TypeManager.Filter): Handle friend accessible
717         members.
718
719         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
720         friend accessible types.
721
722         * ecore.cs (Expression.IsAccessorAccessible): Handle
723         friend accessible properties.
724
725         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
726         accessible types.
727         
728 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
729
730         Fix #76568.
731         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
732         folding.
733         
734         * convert (Convert.ImplicitReferenceConversion): NullCast holds
735         contants only.
736         
737         * ecore.cs (NullCast): Child is contant only.
738         
739         * literal.cs (NullLiteral.Reduce): null can be converted to any
740         reference type.
741
742 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
743
744         * driver.cs: Use Encoding.Default as default code page instead
745           of ISO-28591.
746
747 2005-10-27  Raja R Harinath  <rharinath@novell.com>
748
749         Fix #76085.
750         * expression.cs (Invocation.Error_InvalidArguments): Handle
751         __arglist parameters.
752         (Invocation.VerifyArgumentsCompat): Likewise.
753         * support.cs (ReflectionParameters.GetSignatureForError): Print
754         __arglist parameters.
755         (InternalParamters.GetSignatureForError): Likewise.
756         * parameter.cs (Parameters.GetSignatureForError): Likewise.
757
758 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
759
760         * attribute.cs (GetPropertyValue): Made public.
761
762         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
763         Resolve.
764         Add new property WrapNonExceptionThrows to handle 2.0 assembly
765         attribute.
766         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
767         is not defined.
768         
769         * driver.cs: Reflect method name change.
770         
771         * statement.cs (Try.Resolve): Warn when try has both general
772         exception handlers.
773         
774         * typemanager.cs: runtime_compatibility_attr_type new predefined
775         type.
776
777 2005-10-26  Raja R Harinath  <harinath@gmail.com>
778
779         Fix #76419.
780         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
781         treat it as an empty parameter list.
782
783 2005-10-26  Raja R Harinath  <rharinath@novell.com>
784
785         Fix #76271.     
786         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
787         ResolveAsTypeStep silent.
788         * statement.cs (Block.AddConstant): Mark block as used.
789         (Block.ResolveMeta): Avoid piling on error messages
790         if a constant initializer resolution fails.
791
792 2005-10-25  Raja R Harinath  <rharinath@novell.com>
793
794         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
795         Remove.
796         (NamespaceEntry.VerifyAllUsing): New.
797         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
798         behaviour.  Delegates actual resolution of alias to ...
799         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
800         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
801         Update.
802         * driver.cs (Driver.MainDriver): Update.
803         
804         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
805         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
806         property.
807         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
808         Remove.
809         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
810         RootNamespace.DefineNamespacesForAll.
811
812 2005-10-24  Raja R Harinath  <harinath@gmail.com>
813
814         * typemanager.cs (assemblies, external_aliases, modules)
815         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
816         (ComputeNamespaces, GetRootNamespace): Remove extra staging
817         overhead.  Move resposibility ...
818         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
819         * driver.cs, attribute.cs, codegen.cs: Update to changes.
820
821 2005-10-23  Raja R Harinath  <harinath@gmail.com>
822
823         * namespace.cs (RootNamespace.all_namespaces): Renamed from
824         cached_namespaces.  Improve usage.
825         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
826         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
827         Move from GlobalRootNamespace and simplify.
828         (RootNamespace.Global): Make instance variable.
829         (RootNamespace.RootNamespace): Add "alias name" parameter.
830         (GlobalRootNamespace): Simplify drastically.
831         (Namespace.Lookup): Don't use GetNamespace.
832         * typemanager.cs (GetRootNamespace): Rename from
833         ComputeNamespaceForAlias.
834         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
835
836 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
837
838         * anonymous.cs (AnonymousContainer): Don't crash when container
839         doesn't exist.
840
841 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
842
843         * expression.cs (Binary.DoResolve): Warn when comparing same
844         values.
845
846 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
847
848         Fix #76486.
849         * expression.cs (Binary.DoResolve): It looks like there are no
850         convetsion rules in enum context.
851
852 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
853
854         Add support for extern alias qualifiers.
855         * typemanager.cs: Move some LookupTypeReflection code
856         to namespace.cs, to have cleaner code. Added some methods
857         to help us keep track of the extern aliased references.
858         * driver.cs: Add suport for extern alias assemblies on command
859         line and check for their warnings/errors. Also keep track of the
860         extern aliased assemblies.
861         * namespace.cs: Move the global functionality of Namespace
862         to GlobalRootNamespace/RootNamespace. Now the global namespace
863         is GlobalRootNamespace.Globa. Also the code moved from 
864         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
865         Finally added LocalAliasEntry (AliasEntry before) and
866         ExternAliasEntry, to handle alias statements.
867         * cs-parser.jay: Add support in the grammar for extern alias
868         statement.
869         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
870         Update callings to Namespace (now in GlobalRootNamespace).
871
872 2005-10-25  Martin Baulig  <martin@ximian.com>
873
874         * convert.cs (ImplicitTypeParameterConversion): Make base
875         interfaces actually work; fixes #76557.
876
877 2005-10-25  Martin Baulig  <martin@ximian.com>
878
879         * generic.cs
880         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
881         all the type parameters; fixes #76551.
882
883 2005-10-25  Martin Baulig  <martin@ximian.com>
884
885         Fix #76472.
886
887         * generic.cs
888         (GenericMethod.ctor): Added `Expression return_type' and
889         `Parameters parameters' arguments.
890         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
891         parameter and return types to check their constraints if they're
892         generic types.
893
894         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
895         boolean field.
896
897         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
898         constraints of a generic type if `ec.ResolvingGenericMethod'.
899
900         * class.cs (MethodCore.DoDefineParameters): Set
901         `ec.ResolvingGenericMethod' if we're a generic method.
902         (MemberBase.MemberType): Likewise.
903
904 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
905
906         * typemanager.cs (TypeManager): Added 
907         TypeManager.internals_visible_attr_type to cache
908         S.R.CompilerServices.InternalsVisibleToAttribute.
909
910         * codegen.cs (AssemblyClass): Added checks for 
911         InternalsVisibleToAttribute in new method 
912         CheckInternalsVisibleAttribute () and also cache the
913         AssemblyName in AssemblyClass.Name.
914         
915 2005-10-24  Martin Baulig  <martin@ximian.com>
916
917         * typemanager.cs
918         (TypeManager.ExpandInterfaces): Added overloaded version which
919         just takes a `Type[]' array.
920
921         * generic.cs
922         (Constraints.Resolve): Don't expand the interfaces here; ie. we
923         just use the interfaces which were explicitly specified and not
924         the interfaces they inherit.  Fixes #76482.
925         (TypeParameter.FindMembers): Expand the interfaces here.
926
927 2005-10-21  Martin Baulig  <martin@ximian.com>
928
929         * generic.cs
930         (Constraints.Resolve): Also resolve the actual types here.
931         (Constraints.ResolveTypes): Just check the constraints here.
932         Fixes #76363; see gtest-218.cs.
933
934 2005-10-21  Martin Baulig  <martin@ximian.com>
935
936         * convert.cs
937         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
938         instead of a `BoxedCast'; fixes gtest-217.cs.
939
940 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
941
942         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
943           1) "new()" is specified as generic parameter constraint and 2) the
944           type is TypeBuilder and 3) the type is abstract even if it has a
945           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
946
947 2005-10-20  Martin Baulig  <martin@ximian.com>
948
949         * generic.cs
950         (GenericConstraints.TypeParameter): New public property.
951         (TypeParameter.ctor): Also take a `DeclSpace' argument.
952         (TypeParameter.DeclSpace): New public property.
953         (TypeParameter.DefineType): Inflate the constraints if our
954         `DeclSpace' is an `Iterator'.   
955
956 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
957
958         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
959           GenericMethod argument to compare methods' generic type arguments.
960           Fixed bug #76382.
961
962 2005-10-19  Martin Baulig  <martin@ximian.com>
963
964         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
965         not ResolveType() when resolving the base type, so we're not
966         checking the constraints here.
967         (TypeContainer.ResolveType): Call ResolveType() on our base_type
968         if we have any.
969
970 2005-10-19  Martin Baulig  <martin@ximian.com>
971
972         * generic.cs (ConstructedType.CheckConstraints): Committing
973         untested fix for #76441.
974
975 2005-10-18  Raja R Harinath  <rharinath@novell.com>
976
977         Fix #76371.
978         * class.cs (TypeContainer.DefineType): Move updating of
979         topological sort earlier in the code.
980         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
981
982 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
983
984         Fix #76273.
985         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
986         
987         * constant.cs (Constant.TryReduce): Moved from Cast class.
988         (Reduce): Made little bit more OO and fixed missing conversions.
989         
990         * ecore.cs (Reduce): Implemented.
991         (Binary.EnumLiftUp): New method to upgrade values to enum values.
992         
993         * literal.cs (Reduce): Implemented.
994         
995         * class.cs: Reverted Miguel's wrong commit.
996
997 2005-10-14  Miguel de Icaza  <miguel@novell.com>
998
999         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1000
1001 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1002
1003         * cs-parser.jay, expression.cs : CS0214 was missing error location
1004           for constants. Fixed bug #76404.
1005
1006 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1007
1008         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1009         InstanceExpression.
1010         (PropertyExpr.EmitCall): Likewise.
1011         * expression.cs (Invocation.EmitArguments): Handle case where
1012         arguments == null.
1013         (Invocation.EmitCall): Avoid allocating temporary variable if
1014         there are no arguments.
1015
1016 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1017
1018         Fix #76370.
1019         * convert.cs (ExplicitConversionCore): Fixed object->enum
1020         conversion.
1021
1022 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1023
1024         Fix #76323.
1025         * convert.cs (ImplicitConversionStandard): Move conversion of
1026         void* to arbitrary pointer types ...
1027         (ExplicitConversionStandard): .. here.
1028         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1029         error to always print typenames.
1030
1031 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1032
1033         * convert.cs (GetConversionOperator): Rename from
1034         GetConversionOperators.  Move operator selection code from ...
1035         (UserDefinedConversion): ... here.
1036
1037 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1038
1039         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1040         conversion.
1041
1042 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1043
1044         * assign.cs (Assign.DoResolve): Error method changed.
1045
1046         * cfold.cs (DoConstantNumericPromotions): Error method changed.
1047         
1048         * const.cs (ResolveValue): Reset in_transit immediately.
1049         
1050         * constant.cs: Error method changed.
1051         
1052         * convert.cs: Removed useless location parameter.
1053         (ExplicitNumericConversion): Don't do double enum check.
1054         (ExplicitConversionCore): Renamed from ExplicitConversion.
1055         (ExplicitUnsafe): Extracted from ExplicitConversion.
1056         (ExplicitConversion): Uses for error reporting.
1057         
1058         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1059         error messages.
1060         (ResolveBoolean): Uses common error method.
1061         (CastToDecimal): Get rid of ec.
1062         (CastFromDecimal): Optimized.
1063         (ConvCast): Get rid of ec.
1064         
1065         * enum.cs (ResolveValue): Reset in_transit immediately.
1066         (Emit): Return after first error.
1067         
1068         * expression.cs: Convert changes.
1069         
1070         * literal.cs: Error method changed.
1071         
1072         * statement.cs: Error method changed.
1073
1074 2005-10-06  Raja R Harinath  <rharinath@novell.com>
1075
1076         Fix gtest-131.cs and gtest-211.cs.
1077         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1078         Only emit code for a label if it is used.  Unreachable code can
1079         violate ECMA evaluation stack invariants.
1080
1081 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1082
1083         * anonymous.cs: Implemented ExprClassName.
1084         
1085         * assign.cs (Assign.DoResolve): Don't chrash when type is not
1086         delegate.
1087         
1088         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1089         check.
1090         
1091         * class.cs (StaticClass.DefineContainerMembers): Report protected
1092         members as error.
1093         
1094         * codegen.cs: if(ed) PRODUCTION.
1095         
1096         * convert.cs (Error_CannotImplicitConversion): Better error
1097         distinction.
1098         
1099         * cs-parser.jay: More error checks.
1100         
1101         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1102         
1103         * driver.cs (CSCParseOption): Enabled wrong option check.
1104         
1105         * ecore.cs (Expression.ExprClassName): Turned to property.
1106         (MemberExpr.CheckIntermediateModification): For checking boxed
1107         value types     modification.
1108         
1109         * statement.cs (Fixed.Resolve): Expression type must be
1110         convertible to fixed type.
1111         (CollectionForeach.GetEnumeratorFilter,TryType):
1112         Small refactoring for easier error checking.
1113
1114 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
1115
1116         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1117         attributes.
1118         
1119         * class.cs (GeneratedBaseInitializer): New class for customization
1120         compiler generated initializers.
1121         (MemberBase.DoDefine): Check Obsolete attribute here.
1122         (FieldMember.DoDefine): Ditto.
1123         
1124         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1125         constants.
1126         
1127         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1128         (MemberCore.GetObsoleteAttribute): Removed argument.
1129         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1130         (MemberCore.CheckObsoleteType): New helper.
1131         
1132         * delegate.cs,
1133         * enum.cs,
1134         * statement.cs: Updates after MemberCore changes.
1135         
1136         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1137         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1138         
1139         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1140         obsolete attribute for compiler construct.
1141         (As.DoResolve): Cache result.
1142         
1143         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1144
1145 2005-10-01  Miguel de Icaza  <miguel@novell.com>
1146
1147         * expression.cs (Probe): instead of having a "Type probe_type"
1148         keep the extra information as a TypeExpr probe_type_expr since the
1149         "As" operator needs to perform some type checks.
1150
1151         * (As.DoResolve): If the type is a type parameter, ensure that it
1152         is constrained by a class.
1153
1154 2005-09-22  Miguel de Icaza  <miguel@novell.com>
1155
1156         * statement.cs (Lock): Use the TemporaryVariable class instead of
1157         manually using local variables as those do not work when variables
1158         are captured.
1159
1160         * ecore.cs: Moved the TemporaryVariable class from being a nested
1161         class inside Foreach to be a public class that can be employed in
1162         other places. 
1163
1164 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
1165
1166         * cs-parser.jay: interface_accessors replaced by
1167         accessor_declarations.
1168
1169         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1170         location.
1171         
1172         * statement.cs (GotoCase.Resolve): Convert null constant to
1173         null case.
1174         (SwitchLabel.ResolveAndReduce): Ditto.
1175         (SwitchLabel.NullStringCase): Custom null stamp.
1176         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1177         
1178         typemanager.cs (CSharpSignature): Don't skip first argument
1179         for full names.
1180
1181 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
1182
1183         * cfold.cs, constant.cs, convert.cs, ecore.cs,
1184         expression.cs, iterators.cs, literal.cs: Store constants and
1185         literals location.
1186         
1187         * class.cs (MemberBase.ShortName): Pass location.
1188         
1189         * cs-parser.jay: Some location fixes.
1190         
1191         * ecore.cs (Expression.Location): Made virtual.
1192
1193 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1194
1195         Fix #72930.
1196         * const.cs (Const.ResolveValue): Check for assigning non-null
1197         value to reference type.
1198
1199 2005-09-26  Raja R Harinath  <rharinath@novell.com>
1200
1201         Fix #76133.
1202         * expression.cs (This.VerifyFixed): In a value type T, the type of
1203         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
1204         value type R, 'this' is treated as a value parameter.
1205
1206 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1207
1208         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1209         if the underlying types are the same, otherwise we need to produce
1210         code that will do the proper cast.
1211
1212         This was exposed by Marek's constant rewrite which produced
1213         invalid code for the call site:
1214
1215         enum X : long { a }
1216         void Method (X v) {}
1217
1218         Method ((X) 5)
1219
1220         This fixes test-49.cs
1221
1222 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1223
1224         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1225           Type/Object should be allowed as well. Fixed bug #75968.
1226
1227 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1228
1229         * expression.cs : (Binary.DoResolve): when one is enum constant and
1230           another is constant 0, then return enum one *as enum type*.
1231           Fixed bug 74846.
1232
1233 2005-10-04  Martin Baulig  <martin@ximian.com>
1234
1235         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1236         `SetMemberIsUsed()' work for generics, too.
1237
1238 2005-10-04  Martin Baulig  <martin@ximian.com>
1239
1240         * expression.cs (DelegateInvocation.EmitStatement): Make this work
1241         for corlib.  Fixes #75691.
1242
1243 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
1244
1245         Fix #76255.
1246         * driver.cs: Fix compilation files with full root path.
1247
1248 2005-09-25  Miguel de Icaza  <miguel@novell.com>
1249
1250         * report.cs (SymbolRelatedToPreviousError): Format the output so
1251         it does not use an open parenthesis that is never closed. 
1252
1253         * driver.cs: Follow coding guidelines
1254
1255 2005-09-18  Miguel de Icaza  <miguel@novell.com>
1256
1257         * driver.cs: Set InEmacs based on the environment variable EMACS. 
1258
1259         * location.cs (InEmacs): in this mode, do not report column
1260         location as it confuses Emacs.
1261
1262 2005-10-03  Raja R Harinath  <rharinath@novell.com>
1263
1264         * support.cs (SeekableStreamReader.Position): Don't error out when
1265         the requested position is just beyond the end of the current
1266         buffered data.
1267
1268 2005-09-28  Raja R Harinath  <rharinath@novell.com>
1269
1270         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
1271         try to keep in sync with the byte count of the underlying Stream.
1272         However, this limits us to a window size of 2048 characters: i.e.,
1273         the maximum lookahead of our lexer/parser can be 2048 characters.
1274
1275 2005-09-22  Martin Baulig  <martin@ximian.com>
1276
1277         * driver.cs: Removed a debugging FIXME.
1278
1279 2005-09-21  Raja R Harinath  <rharinath@novell.com>
1280
1281         * cs-parser.jay (type_arguments): Add CS1644 check.
1282         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1283
1284 2005-09-15  Raja R Harinath  <rharinath@novell.com>
1285
1286         * Makefile (PROGRAM): Make profile specific.
1287         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1288         the current directory.
1289
1290         Fix test-455.cs.
1291         * expression.cs (Invocation.EmitCall): Remove optimization on
1292         this_call since it doesn't handle 'this' being a value type.
1293
1294 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
1295
1296         * driver.cs: Ensure file handles are closed after parsing
1297
1298 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1299
1300         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1301         if the underlying types are the same, otherwise we need to produce
1302         code that will do the proper cast.
1303
1304         This was exposed by Marek's constant rewrite which produced
1305         invalid code for the call site:
1306
1307         enum X : long { a }
1308         void Method (X v) {}
1309
1310         Method ((X) 5)
1311
1312         This fixes test-49.cs
1313
1314 2005-09-05  Martin Baulig  <martin@ximian.com>
1315
1316         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1317         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1318
1319         * cs-parser.jay (delegate_declaration): Small fix for #75852.
1320
1321 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1322
1323         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1324           to be a pointer type due to the spec 25.2, so check if declaring
1325           type is generic type definition. Fixed bug #75772.
1326
1327 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1328
1329         Fixed bug #75957.
1330         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
1331           both types are not defined by methods.
1332         * expression.cs : (Invocation.IsApplicable): it should work when
1333           the argument type is equal to the parameter type, not only when
1334           ImplicitConversionExists() returns true.
1335
1336 2005-09-02  Raja R Harinath  <rharinath@novell.com>
1337
1338         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1339         internal.
1340
1341         Fix #75941.
1342         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1343         flow-branching for LocalVariableReferences in case we were invoked
1344         from a MemberAccess.
1345         * expression.cs (LocalVariableReference.VerifyAssigned): New.
1346         Carved out of ...
1347         (LocalVariableReference.DoResolveBase): ... this.
1348         (MemberAccess.Resolve): Do the check that was disabled during
1349         SimpleNameResolve.
1350
1351 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1352
1353         * class.cs :
1354           (PartialContainer.Create): check abstract/sealed/static strictly
1355           but abstract/sealed can exist only at one side. Fixed bug #75883.
1356
1357 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
1358
1359         Fix #75945.
1360         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1361         specified, don't default to UnmanagedType.I4.
1362
1363 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1364
1365         * expression.cs : conditional operator should check possibly
1366           incorrect assign expression. Fixed bug #75946.
1367
1368 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1369
1370         Fix #75934.
1371         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
1372         (ScopeInfo.EmitScopeType): Use it to construct field names from
1373         names of captured locals.
1374
1375         Fix #75929.
1376         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
1377         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
1378         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
1379         (ExplicitConversion): Remove enum cases already handled by
1380         implicit conversion.  Move implicit conversion check to the beginning.
1381         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
1382         * expression.cs (ArrayCreation.EmitDynamicInitializers):
1383         Don't treat System.Enum as a struct.
1384
1385 2005-08-30  Jb Evain  <jbevain@gmail.com>
1386
1387         * attribute.cs: handles as expression in parameters.
1388
1389 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1390
1391         Fix #75802.
1392         * class.cs (TypeContainer.VerifyClsName): Don't use a
1393         PartialContainer when verifying CLS compliance.
1394         (AbstractPropertyEventMethod): Set Parent here, ...
1395         (PropertyMethod): ... not here.
1396
1397 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
1398
1399         * attribute.cs : escaped attribute name should not be allowed to be
1400           resolved (e.g. @class as classAttribute). Fixed bug #75930.
1401
1402 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1403
1404         Fix #75927.
1405         * convert.cs (ImplicitStandardConversionExists): Allow zero also
1406         when converting a long constant to unsigned long.
1407         * expression.cs (Invocation.OverloadResolve): Add sanity check to
1408         detect where IsApplicable and VerifyArgumentsCompat disagree.
1409
1410 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1411         and Carlos Alberto Cortez  <carlos@unixmexico.org>
1412
1413         Fix #75848.
1414         * class.cs (TypeContainer.CanElideInitializer): New helper.
1415         (TypeContainer.EmitFieldInitializers): Use it to determine if we
1416         can safely emitting the initializer of a field.
1417
1418 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1419
1420         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1421           allowed inside a switch (without loop). Fixed bug #75433.
1422
1423 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
1424
1425         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1426         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1427
1428 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1429
1430         * driver.cs : kinda reverting the default encoding changes (not exact 
1431           revert since I noticed that "codepage:reset" might not work fine).
1432
1433 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1434
1435         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1436           Location. Now getter and setter store location correctly.
1437           (errors/cs0111-12.cs now reports the expected location.)
1438
1439 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1440
1441         * driver.cs : Use default encoding on the environment.
1442           Removed (now that) extra parameter for SeekableStreamReader.
1443         * support.cs : (SeekableStreamReader) third .ctor() argument for
1444           StreamReader is not required (always true). preamble size could
1445           be acquired in simpler and safe way.
1446
1447 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1448
1449         * cs-parser.jay: report CS0642 at warning level 3
1450           and report CS0642 for an if else statement also
1451           fixes bug #74745. Patch by John Luke (and a bit
1452           modified by me).
1453           Removed extra CS0642 warning check for "while",
1454           "for" and "fixed".
1455         * statement.cs: In Block.Resolve(), CS0642 check
1456           is reimplemented to check a sequence of an empty
1457           statement and a block.
1458
1459           Both fix bug #66777.
1460
1461 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
1462
1463         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
1464         detection until I fix it.
1465         
1466         * cs-tokenizer.cs: Changed error message.
1467         
1468         * cs-parser.jay: Fixed 2 error locations.
1469         
1470         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1471         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1472         properties.
1473         
1474         * enum.cs (GetSignatureForError): Fixed.
1475         
1476         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1477         method detection.
1478         
1479         * class.cs,
1480         * typemanager.cs (RegisterProperty): Removed.
1481         
1482         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1483
1484 2005-08-24  Raja R Harinath  <rharinath@novell.com>
1485
1486         Fix #75874.
1487         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1488         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1489
1490 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1491
1492         * expression.cs : tiny fix is required for not warning positive ulong.
1493           See test-441.cs.
1494
1495 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1496
1497         * expression.cs : add CS0652 check for constant and integral
1498           expression. Fixed bug #53974.
1499
1500 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1501
1502         * expression.cs : in DoNumericPromotions(), check if there is implicit
1503           conversion overload for string (to check CS0034). Fixed bug #52492.
1504
1505 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1506
1507         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1508
1509 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1510
1511         * ecore.cs : report location when it is *not* Null.
1512
1513 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1514
1515         * codegen.cs,
1516           ecore.cs,
1517           flowanalysis.cs,
1518           expression.cs:
1519           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1520           correctly. Fixed bug #75721.
1521
1522 2005-08-23  Raja R Harinath  <rharinath@novell.com>
1523
1524         * support.cs (SeekableStreamReader.Position): Avoid an expensive
1525         loop that performs 'min (pos, char_count)'.
1526
1527         Fix #75862.
1528         * expression.cs (Unary.ResolveOperator): Don't discard implicit
1529         converted value in Operator.OnesComplement.
1530
1531 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
1532
1533         * anonymous.cs: If the anon method is pulled into a helper class,
1534         it needs to be `internal' not `private'. Fixes runtime behavior on
1535         msft. bug #75704
1536
1537 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
1538
1539         Fix #75803
1540         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1541         is a partial class.
1542
1543 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
1544
1545         The big constants rewrite
1546         Fix #75746, #75685 and more
1547         As a side effect saved 1MB for MWF ;-)
1548         
1549         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1550         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1551         enum based for corlib compilation.
1552         
1553         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1554         subtractions.
1555         
1556         * class.cs (FixedField.Define): Use ResolveAsConstant.
1557         
1558         * const.cs (IConstant): Interface constants and enums.
1559         (Const.ResolveValue): New method for constant resolvning.
1560         (ExternalConstant): Constants from imported assemblies.
1561         
1562         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1563         conversion; like enums.
1564         (Constant.ToType): Converts this constant to different type.
1565         (Constant.Increment): Adds 1.
1566         
1567         * convert.cs (ImplicitConversionRequired): Simplified.
1568         
1569         * cs-parser.jay: Create EnumMember directly.
1570         
1571         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1572         
1573         * doc.cs (GenerateEnumDocComment): Removed.
1574         
1575         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1576         (ConvertIntLiteral): Removed.
1577         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1578         
1579         * enum.cs (EnumMember): Implement IConstant.
1580         (Enum.IsValidEnumConstant): Removed.
1581         (Enum.GetNextDefaultValue): Removed.
1582         (Enum.FindMembers): Updated.
1583         (Enum.GenerateDocComment): Iterate enum members.
1584         
1585         * expression.cs (Cast.TryReduce): Handle enums correctly.
1586         (New.Constantify): Made public.
1587         (MemberAccess.DoResolve): Removed contant specific if(s).
1588         
1589         * literal.cs (NullLiteral): Implement new abstract methods.
1590         
1591         * statement.cs (GotoCase.Resolve): Use new constant methods.
1592         (SwitchLabel.ResolveAndReduce): Use new constant methods.
1593         
1594         * typemanager.cs (LookupEnum): Removed.
1595         (IsEnumType): Fixed to work with corlib.
1596         (RegisterConstant): Removed.
1597         (LookupConstant): Removed.
1598         (GetConstant): Changed to work with IConstant.
1599
1600 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
1601
1602         * location.cs : Fixed overflown (>255) column number.
1603
1604 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1605
1606         First cut of the qualified-alias-member feature.
1607         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1608         token.
1609         * cs-parser.jay (DOUBLE_COLON): New token.
1610         (namespace_or_type_name): Add rule for recognizing
1611         qualified-alias-members.
1612         (primary_expression): Likewise.
1613         (element_access): Allow QualifiedAliasMember as a possible
1614         type-bearing expression.
1615         (local_variable_type, local_variable_pointer_type): Likewise.
1616         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1617         aliases in the current and enclosing namespace declarations.
1618         (NamespaceEntry.UsingAlias): Add CS0440 warning.
1619         * decl.cs (MemberName.is_double_colon): New.
1620         (MemberName.MemberName): Add new constructor for alias-member.
1621         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1622         * expression.cs (QualifiedAliasMember): New expression type.
1623
1624 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1625
1626         * location.cs : it borked when no argument was specified.
1627
1628 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1629
1630         * location.cs : tiny ToString() format fix.
1631
1632 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1633
1634         * statement.cs : oops, it was missing.
1635
1636 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1637
1638         A set of fixes for precise line/column location.
1639
1640         * location.cs :
1641           "token" field now holds a file/line "delta", a line number offset 
1642           from the segment, and a column number. See also:
1643           http://lists.ximian.com/pipermail/mono-devel-list/2004-
1644           December/009508.html
1645           Removed static IsNull. Use instance IsNull property instead.
1646         * cs-tokenizer.cs :
1647           For some tokens it stores Location. For Identifier it stores
1648           LocatedToken which is a pair of string name and location.
1649           Column numbers are adjusted only at getChar().
1650         * report.cs :
1651           Use Location.ToString() for reporting (it now contains column).
1652         * cs-parser.jay :
1653           Largely modified to use LocatedToken instead of
1654           string (IDENTIFIER), and to acquire Location from some tokens.
1655         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1656           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1657           codegen.cs :
1658           Now MemberName holds Location. DeclSpace.ctor() receives Location
1659           as a parameter. Removed extra parameters to all derived classes.
1660           Replaced Location.IsNull() with instance property.
1661         * assign.cs, expression.cs :
1662           Added .ctor() overload that omits Location.
1663         * attribute.cs :
1664           Added "nameEscaped" flag that indicates the identifier was escaped
1665           in the source file. This fixes bug #57047.
1666
1667 2005-09-02  Martin Baulig  <martin@ximian.com>
1668
1669         * class.cs: Make CS3005 a warning, not an error.
1670
1671 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
1672
1673         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1674         New method, looking for lo-case imported cls type.
1675
1676         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1677         here.
1678
1679         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1680
1681         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1682
1683         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1684         all_imported_types.
1685         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1686
1687         Optimized to save 3.5 MB for SWF compilation.
1688
1689 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1690
1691         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1692         (PartialContainer.Create): Moved logic AddToContainer.
1693         (PartialContainer.MarkForDuplicationCheck): Shares name.
1694         
1695         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1696         place.
1697         
1698         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1699         initialization.
1700         (Namespace.GetSignatureForError): New method.
1701         
1702         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1703         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1704
1705 2005-08-01  Raja R Harinath  <rharinath@novell.com>
1706
1707         Fix #75669.
1708         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1709         member lookup rather than qualifier_type, since qualifier_type can
1710         be null.
1711
1712 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1713
1714         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1715         enum member.
1716
1717 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1718
1719         * statement.cs: Copy the local exception into the exception
1720         captured local.  Fixes 75674
1721
1722 2005-07-31  Raja R Harinath  <harinath@gmail.com>
1723
1724         Fix #75658.
1725         * expression.cs (Invocation.OverloadResolve): Don't report error
1726         CS1501 if error CS1502 has been reported.
1727         (New.DoResolve): Delegate CS1501 reporting to
1728         Invocation.OverloadResolve.
1729
1730         Fix #75656.
1731         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1732         invariant-meaning-in-block property in an enclosing block if
1733         necessary.
1734
1735 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
1736
1737         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1738         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1739         (Switch.CheckSwitch): Just save 50kb for SWF.
1740
1741 2005-07-27  Martin Baulig  <martin@ximian.com>
1742
1743         * anonymous.cs (CaptureContext.AddField): Added
1744         `AnonymousContainer am' argument; compute its toplevel scope if
1745         it's not already computed.  Fixes #75649.
1746
1747 2005-07-26  Raja R Harinath  <rharinath@novell.com>
1748
1749         Fix #75628.
1750         * class.cs (Constructor.Emit): Reset block to null if the block
1751         resolve fails.
1752
1753 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1754
1755         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1756
1757 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1758
1759         * class.cs (MethodData.Define): Check whether accessor implementing
1760         interface is public.
1761
1762         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1763
1764 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
1765
1766         Fix #57245
1767         * namespace.cs (LookupType): Moved same type check to...
1768         
1769         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1770         with the same name.
1771
1772 2005-07-21  Raja R Harinath  <rharinath@novell.com>
1773
1774         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1775         already found a typebuilder.
1776         * class.cs (MethodCore.IsDuplicateImplementation): Compare
1777         MemberNames, not strings.
1778
1779         * const.cs (Error_ExpressionMustBeConst): 
1780         Rename from Error_EpressionMustBeConst.
1781         * const.cs, class.cs, statement.cd: Update.
1782
1783 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
1784
1785         Fix #65573
1786
1787         * const.cs (Const.LookupConstantValue): Report missing contant expression
1788         everytime.
1789         (Error_EpressionMustBeConstant): Only one error method.
1790
1791         * class.cs, statement.c: Updated.
1792
1793 2005-07-20  Raja R Harinath  <rharinath@novell.com>
1794
1795         * statement.cs (Block.Flags): Add back HasVarargs.
1796         (Block.flags): Make protected.
1797         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1798
1799         * typemanager.cs (types, typecontainers, user_types): Remove.
1800         (UserTypes, TypeContainers): Likewise.
1801         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1802         (CleanUp, Reset): Update.
1803         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
1804         (GetNestedType): Use Type.GetNestedType.
1805         (CoreLookupType): Take two arguments, the namespace and the
1806         basename of the type.  Update to use the Namespace.Lookup
1807         mechanism.
1808         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1809         (RealMemberLookup): Use IsNestedChildOf instead of playing with
1810         string concatenation and substring matches.
1811         * class.cs, enum.cs, delegate.cs: Update to changes.
1812
1813 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
1814
1815         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1816         Expression and made virtual.
1817
1818         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1819         (ImplicitStandardConversionExists): Fixed `byte' typo ?
1820
1821         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1822
1823         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1824         error message.
1825
1826         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1827         change.
1828
1829 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
1830
1831         Fix #57707
1832         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1833         AssemblyCultureAttribute is not used on executable.
1834
1835         * rootcontext.cs,
1836         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1837
1838 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1839
1840         Fix #60638.
1841         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1842         New.  Reports CS0252/CS0253.
1843         Mostly taken from preliminary patch by Duncak Mak.
1844         (Binary.DoResolveOperator): Store results of operator lookup.
1845         Use them to detect if we need to warn about unintended reference
1846         comparisons.
1847
1848 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1849
1850         Fix #72969.
1851         * namespace.cs (Namespace.Lookup): Add back location parameter.
1852         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1853         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1854
1855         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1856         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1857         (Namespace.LookupType): ... this.
1858         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1859         of namespaces.
1860         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1861         purported to handle pointers.
1862         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1863         CoreLookupType.
1864
1865 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1866
1867         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1868         type as namespace.
1869
1870 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1871
1872         * namespace.cs (Namespace.Lookup): Drop location parameter.
1873         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1874         (NamespaceEntry.Lookup): ... this.
1875         (NamespaceEntry.Error_AmbiguousTypeReference):
1876         Move here from DeclSpace.
1877         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1878         names ...
1879         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1880         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1881         Move to NamespaceEntry.
1882         * delegate.cs, expression.cs: Update to changes.
1883
1884 2005-08-31  Martin Baulig  <martin@ximian.com>
1885
1886         Committing a patch from Atsushi Enomoto for #75850.
1887
1888         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
1889         Prefer a generic enumerator over a non-generic one.
1890
1891 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
1892
1893         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1894         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1895
1896 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1897
1898         * driver.cs : reverting default encoding change as well as mcs.
1899
1900 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1901
1902         * driver.cs, support.cs : merged r48826.
1903           Marek Safer wrote:
1904           > could you integrate your mcs changes to gmcs otherwise
1905           > gmcs cannot compile some files.
1906
1907 2005-08-20  Martin Baulig  <martin@ximian.com>
1908
1909         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1910         scope if we don't already have it.
1911
1912         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1913         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1914         fixes #75867.
1915
1916 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1917
1918         * statement.cs: Copy the local exception into the exception
1919         captured local.  Fixes 75674
1920
1921 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1922
1923         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1924         type as namespace.
1925
1926 2005-08-12  Martin Baulig  <martin@ximian.com>
1927
1928         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
1929         for nested types here to avoid hitting the cache too early.
1930
1931 2005-08-09  Miguel de Icaza  <miguel@novell.com>
1932
1933         * enum.cs: On the new compiler CLS error 3005 is now a warning not
1934         an error. 
1935
1936 2005-08-03  Martin Baulig  <martin@ximian.com>
1937
1938         Make iterators in generic methods work; see gtest-191.cs.
1939
1940         * generic.cs
1941         (Constraints.Resolve): Protect against being called twice.
1942
1943         * class.cs
1944         (TypeContainer.GetClassBases): Make this `protected virtual'.
1945
1946         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
1947         (Iterator.GetClassBases): Override this and compute the base
1948         classes here.
1949         (Iterator.DefineNestedTypes): If we're a generic method, all our
1950         method type parameters become class type parameters on the proxy
1951         class.
1952
1953         * statement.cs
1954         (ToplevelBlock.Parameters): Make this a property, not a field.
1955         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
1956
1957 2005-08-03  Martin Baulig  <martin@ximian.com>
1958
1959         * typemanager.cs (TypeManager.IsSubclassOf): Use
1960         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
1961         (TypeManager.GetFullName_recursed): Improved.
1962
1963 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1964
1965         Fix #75417
1966         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
1967         Private accessor case, using TypeManager.IsPrivateAccessible instead of
1968         invocation_type == mi.DeclaringType, since the first one also checks
1969         other condition used by generic instances.
1970         
1971 2005-07-27  Martin Baulig  <martin@ximian.com>
1972
1973         * anonymous.cs (CaptureContext.AddField): Added
1974         `AnonymousContainer am' argument; compute its toplevel scope if
1975         it's not already computed.  Fixes #75649.
1976
1977 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1978
1979         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1980         CheckAttributeType and refactored.
1981         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1982         ResolveAsTypeTerminal error handling.
1983         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1984         handling.
1985         (GetSignatureForError): Print errors in same way.
1986
1987         * class.cs,
1988         * codegen.cs: Reflect attribute GetSignatureForError change.
1989
1990         * ecore.cs,
1991         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1992
1993         * namespace.cs (UsingEntry): Refactored to make fields private.
1994
1995         * assign.cs,
1996         statement.cs: Error_UnexpectedKind has extra parameter.
1997
1998 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1999
2000         * ecore.cs (IAlias): Remove.
2001         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2002         that implement the interface.
2003         * namespace.cs (Namespace): Likewise.
2004         (Namespace.declspaces): Renamed from 'defined_names'.
2005         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2006         DeclSpace instead of an IAlias.
2007         * tree.cs (Tree.AddDecl): Update.
2008
2009 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2010
2011         * statement.cs (Block.Flags); Remove HasVarargs.
2012         (Block.HasVarargs): Move to ToplevelBlock.
2013         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2014         (Block.Variables): Make protected.  Initialize variable hashtable
2015         if necessary.
2016         (Block.AddVariable): Update.
2017         (Block.Resolve): Update to changes.
2018         (ToplevelBlock.HasVarargs): New boolean.
2019         (ToplevelBlock.ThisVariable): Move here from Block.
2020         (ToplevelBlock.AddThisVariable): Likewise.
2021         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2022         * expression.cs (This.ResolveBase): Update to changes.
2023         (ArglistAccess.DoResolve): Likewise.
2024
2025 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2026
2027         Fix #75321
2028         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2029
2030         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2031         not used and not used & assigned.
2032         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2033
2034 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2035
2036         Fix #75053
2037         * expression.cs (Is.DoResolve): null is never provided type.
2038
2039 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2040
2041         Fix #52496
2042         * cs-parser.jay: Less strict event error rule to catch more errors.
2043
2044 2005-07-11  Martin Baulig  <martin@ximian.com>
2045
2046         * generic.cs (ConstructedType.CheckConstraints): Improve the check
2047         for the constructor constraint: we do not only have to check
2048         whether the class has a public constructor, but also ensure that
2049         it's parameterless.  Fixes #75492.
2050
2051 2005-07-11  Martin Baulig  <martin@ximian.com>
2052
2053         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2054         between type parameters if they either have the reference type
2055         constraint or the class constraint.
2056
2057 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
2058
2059         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2060
2061 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
2062
2063         Fix #74975
2064         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2065         (ExtractSecurityPermissionSet): Cope with self referencing security
2066         attributes properly.
2067
2068         * driver.cs (SetOutputFile): Made public property OutputFile.
2069
2070 2005-07-07  Raja R Harinath  <rharinath@novell.com>
2071
2072         Fix #75486.
2073         * class.cs (TypeContainer.first_nonstatic_field): Rename from
2074         has_nonstatic_fields.  Make into a FieldBase pointer.
2075         (TypeContainer.AddField): Add CS0282 check.
2076         (TypeContainer.EmitType): Update.
2077
2078 2005-07-06  Miguel de Icaza  <miguel@novell.com>
2079
2080         * cs-tokenizer.cs (consume_identifier): Do not create strings to
2081         compare if they start with __.
2082
2083 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2084
2085         * statement.cs (Switch.SwitchGoverningType): Only look at
2086         UserCasts that don't need implicit standard conversions to one of
2087         the allowed switch types (Fixes test-322.cs).
2088         (LocalInfo.Resolve): Re-enable sanity-test.
2089
2090 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
2091
2092         * cs-tokenizer.cs (consume_identifier): Detect double undescores
2093         
2094         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2095         
2096         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2097
2098 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2099
2100         Fix #75472.
2101         * ecore.cs (SimpleName.GetSignatureForError): Add.
2102         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2103         (MemberAccess.GetSignatureForError): Add.
2104
2105 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
2106  
2107         The big error and warning messages review.
2108         
2109         * anonymous.cs,
2110         * assign.cs,
2111         * attribute.cs,
2112         * class.cs,
2113         * codegen.cs,
2114         * convert.cs,
2115         * cs-parser.jay,
2116         * cs-tokenizer.cs,
2117         * decl.cs,
2118         * delegate.cs,
2119         * doc.cs,
2120         * driver.cs,
2121         * ecore.cs,
2122         * enum.cs,
2123         * expression.cs,
2124         * flowanalysis.cs,
2125         * iterators.cs,
2126         * literal.cs,
2127         * location.cs,
2128         * modifiers.cs,
2129         * namespace.cs,
2130         * parameter.cs,
2131         * pending.cs,
2132         * report.cs,
2133         * rootcontext.cs,
2134         * statement.cs,
2135         * support.cs,
2136         * tree.cs,
2137         * typemanager.cs: Updated.
2138         
2139         * class.cs: (MethodCore.SetYields): Moved here to share.
2140         (PropertyMethod.Define): Moved iterator setup here.
2141         
2142         * iterators.cs: Add orig_method to have full access to parent
2143         container.
2144
2145 2005-07-05  Raja R Harinath  <rharinath@novell.com>
2146
2147         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2148         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2149         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2150         variable of struct type.
2151         * expression.cs (Unary.ResolveOperator): Update to change.
2152         (Indirection.VerifyFixed): Likewise.
2153         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2154         (ParameterReference.VerifyFixed): Value parameters are fixed.
2155         (This.VerifyFixed): Treat 'this' as a value parameter.
2156         * statement.cs (LocalInfo.IsFixed): Remove.
2157
2158 2005-07-01  Martin Baulig  <martin@ximian.com>
2159
2160         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2161         `ec.EmitThis ()' to get the correct scope.
2162
2163 2005-07-01  Martin Baulig  <martin@ximian.com>
2164
2165         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2166         instance is a ParameterReference; fixes #75299.
2167
2168 2005-06-30  Raja R Harinath  <rharinath@novell.com>
2169
2170         Fix #75412.
2171         * expression.cs (Indexers.map): Remove.
2172         (Indexers.Append): Filter out inaccessible setters and getters.
2173         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2174
2175         Fix #75283.
2176         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
2177         Refactored from ...
2178         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2179         (FieldExpr.Emit, PropertyExpr.Emit): Update.
2180         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2181         * expression.cs (Invocation.EmitCall): Add CS0120 check.
2182
2183 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
2184
2185         Fix #75322
2186         * class.cs (FieldBase.GetInitializerExpression): One more field
2187         for backup.
2188
2189 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2190
2191         * pending.cs: Do not define a proxy if the base method is virtual,
2192         it will be picked up by the runtime (bug 75270).
2193
2194 2005-07-08  Martin Baulig  <martin@ximian.com>
2195
2196         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2197         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2198
2199 2005-07-07  Martin Baulig  <martin@ximian.com>
2200
2201         * generic.cs (ConstructedType.CheckConstraint): Use
2202         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2203         called recursively; fixes #75329.
2204
2205 2005-07-06  Martin Baulig  <martin@ximian.com>
2206
2207         * generic.cs (TypeManager.InferTypeArguments): Added support for
2208         anonymous methods; fixes #75461.
2209
2210 2005-07-01  Martin Baulig  <martin@ximian.com>
2211
2212         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2213         `ec.EmitThis ()' to get the correct scope.
2214
2215 2005-07-01  Martin Baulig  <martin@ximian.com>
2216
2217         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2218         instance is `This'; fixes #75299.
2219
2220 2005-06-30  Martin Baulig  <martin@ximian.com>
2221
2222         * class.cs (Indexer): Implement IIteratorContainer; added support
2223         for iterators in indexers.
2224
2225         * codegen.cs
2226         (EmitContext.CurrentIterator): Make this a property, not a field.
2227
2228         * anonymous.cs (AnonymousContainer.Iterator): New public property.
2229
2230 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2231
2232         * pending.cs: Do not define a proxy if the base method is virtual,
2233         it will be picked up by the runtime (bug 75270).
2234
2235 2005-06-28  Martin Baulig  <martin@ximian.com>
2236
2237         * cs-parser.jay (interface_method_declaration): Avoid a
2238         reduce/reduce conflict by moving some of the code into a separate
2239         `interface_method_declaration_body' rule; fixes #75368.
2240
2241 2005-06-28  Martin Baulig  <martin@ximian.com>
2242
2243         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2244         array check after the check for TypeBuilder's.
2245
2246 2005-06-21  Raja R Harinath  <rharinath@novell.com>
2247
2248         * convert.cs (FindMostEncompassedType): Add two trivial special
2249         cases (number_of_types == 0 || number_of_types == 1).
2250         (FindMostEncompasingType): Likewise.
2251
2252 2005-06-17  Raja R Harinath  <rharinath@novell.com>
2253
2254         Some cleanups preparing for the fix of #75283.
2255         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2256         error testing.
2257         (EventExpr.InstanceResolve): Likewise.
2258         (EventExpr.DoResolve): Remove redundant checks.
2259
2260 2005-06-08  Miguel de Icaza  <miguel@novell.com>
2261
2262         * class.cs: Small fix.
2263
2264 2005-06-08  Raja R Harinath  <rharinath@novell.com>
2265
2266         Fix #75160.
2267         * class.cs (GetPartialBases): Fix return value check of
2268         part.GetClassBases.
2269
2270 2005-06-07  Raja R Harinath  <rharinath@novell.com>
2271
2272         Ensure that partial classes are registered in their enclosing
2273         namespace.  Initial part of fix of #75160.
2274         * tree.cs (Tree.RecordDecl): Add new namespace argument.
2275         Register declspace with namespace here, not in
2276         DeclSpace.RecordDecl.
2277         * cs-parser.jay: Pass namespace to RecordDecl.
2278         * class.cs (PartialContainer.Create): Likewise.
2279         (ClassPart.DefineType): New sanity-check.  Throws an exception if
2280         called.
2281         * decl.cs (Declspace.RecordDecl): Remove.
2282         * namespace.cs (NamespaceEntry.DefineName): Remove.
2283
2284 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2285
2286         * rootcontext.cs: Reset TargetExt as well.
2287
2288 2005-06-03  Raja R Harinath  <rharinath@novell.com>
2289
2290         * ecore.cs (Expression.Resolve): Emit CS0654 error when
2291         -langversion:ISO-1.
2292
2293 2005-06-02  Raja R Harinath  <rharinath@novell.com>
2294
2295         Fix #75080, cs0119.cs.
2296         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
2297         of ...
2298         (Expression.Resolve): ... this.  Use it.  Remove bogus code
2299         allowing ExprClass.Type and ExprClass.Namespace for
2300         ResolveFlags.VariableOrValue.
2301         (Expression.Resolve) [1-argument variant]: Change default resolve
2302         flags based on language version.
2303         (Expression.Error_UnexpectedKind): Use a simple string array
2304         rather than an ArrayList.
2305         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2306         not ExprClass.Type.
2307         (TypeOfVoid.DoResolve): Likewise.
2308         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
2309         flags argument -- it always has the same value.
2310
2311 2005-05-31  Raja R Harinath  <rharinath@novell.com>
2312
2313         Fix #75081.
2314         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2315         Use it in the error message.
2316         * assign.cs, expression.cs, statement.cs: Update.
2317
2318 2005-05-30  Raja R Harinath  <rharinath@novell.com>
2319
2320         Fix #75088.
2321         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2322         the "almostMatchedMember" case too.
2323         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2324         that failed the accessibility checks to 'almost_match'.
2325
2326 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
2327
2328         * attribute.cs: Use internal MethodBuilder methods to set
2329         ExactSpelling and SetLastError on PInvoke methods, instead
2330         of passing them via charset.  Fixes #75060.
2331
2332 2005-05-27  Raja R Harinath  <rharinath@novell.com>
2333
2334         * parameter.cs (Parameter): Remove TODO comment.
2335         (Parameter.DefineParameter): Remove Location parameter.
2336         (Parameters.LabelParameters): Likewise.
2337         * class.cs (Constructor.Emit): Update to change.
2338         (MethodData.Emit): Likewise.
2339         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
2340         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2341
2342 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
2343
2344         * parameter.cs,
2345           Removed Parameters.Location and added Parameter.Location instead.
2346           Removed Location parameter from Emit() and GetSignature().
2347         * anonymous.cs,
2348           class.cs,
2349           cs-parser.jay,
2350           delegate.cs,
2351           iterators.cs,
2352           statement.cs :
2353           Modified all related calls.
2354
2355 2005-06-21  Martin Baulig  <martin@ximian.com>
2356
2357         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
2358         left-hand side is not a nullable type; fixes #75328.
2359
2360 2005-06-21  Martin Baulig  <martin@ximian.com>
2361
2362         * typemanager.cs
2363         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
2364         (TypeManager.GetFullNameSignature): Likewise.
2365
2366         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
2367         `source.FullName' and `target.FullName' to check whether there are
2368         two conflicting definitions.
2369
2370 2005-06-21  Martin Baulig  <martin@ximian.com>
2371
2372         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
2373         a BoxedCast - also for reference types - to be compatible with csc.
2374
2375 2005-06-21  Martin Baulig  <martin@ximian.com>
2376
2377         * expression.cs (MemberAccess.DoResolve): Add support for nested
2378         types in a generic instance; fixes #75320.
2379
2380 2005-06-20  Martin Baulig  <martin@ximian.com>
2381
2382         * generic.cs (TypeManager.InferType): Also walk the class
2383         hierarchy for generic instances; fixes #75261.
2384
2385 2005-06-17  Martin Baulig  <martin@ximian.com>
2386
2387         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
2388         to make things work for corlib.
2389
2390 2005-06-15  Martin Baulig  <martin@ximian.com>
2391
2392         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
2393         obsolete `SecurityAction' values.
2394
2395 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2396
2397         * rootcontext.cs: Reset TargetExt as well.
2398         
2399 2005-06-09  Martin Baulig  <martin@ximian.com>
2400
2401         * delegate.cs (Delegate.VerifyMethod): Added
2402         `MethodGroupExpr old_mg' argument; inherit its
2403         `HasTypeParameters'; fix #75085.
2404
2405 2005-06-09  Martin Baulig  <martin@ximian.com>
2406
2407         * expression.cs (Invocation.OverloadResolve): Correctly handle
2408         generic methods for the SetMemberIsUsed(); fix #75064.
2409
2410 2005-06-09  Martin Baulig  <martin@ximian.com>
2411
2412         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
2413         fixes #75062.
2414
2415 2005-06-08  Martin Baulig  <martin@ximian.com>
2416
2417         * cs-parser.jay (nullable_type_or_conditional): If we put the
2418         nullable back and our `type' is a `ComposedCast', remove the
2419         nullable from it.  Fixes #75156.
2420
2421         * expression.cs (ComposedCast.RemoveNullable): New public method.
2422
2423 2005-06-08  Martin Baulig  <martin@ximian.com>
2424
2425         The big Iterators rewrite :-)
2426
2427         * iterators.cs: Rewrite this to use the anonymous methods framework.
2428
2429         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
2430         before the TypeContainers; see 2test-21.cs.
2431
2432         * class.cs
2433         (TypeContainer.DefineType): Don't create a new EmitContext if we
2434         already have one (this only happens if we're an Iterator).
2435         (TypeContainer.Define): Also call Define() on all our iterators.
2436         (Method.CreateEmitContext): Added support for iterators.
2437
2438         * anonymous.cs
2439         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
2440         (AnonymousContainer.CreateMethodHost): Moved here from
2441         AnonymousMethod and made abstract.
2442         (AnonymousContainer.CreateScopeType): New abstract method.
2443         (AnonymousContainer.IsIterator): New public property.
2444         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
2445         get the ScopeTypeBuilder rather than manually defining it here. 
2446         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
2447         iterators here.
2448
2449         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
2450         before RootContext.DefineTypes().
2451
2452         * codegen.cs (EmitContext.RemapToProxy): Removed.
2453         (EmitContext.CurrentAnonymousMethod): Changed type from
2454         AnonymousMethod -> AnonymousContainer.
2455         (EmitContext.ResolveTopBlock): Protect from being called twice.
2456         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
2457         (EmitContext.EmitThis): Removed the iterators hacks; use the
2458         anonymous methods framework for that.
2459
2460         * statement.cs
2461         (ToplevelBlock.Container): Make this a property, not a field.
2462         (ToplevelBlock.ReParent): New public method; move the
2463         ToplevelBlock into a new container.
2464         (Foreach.TemporaryVariable): Simplify.
2465
2466 2005-06-05  Martin Baulig  <martin@ximian.com>
2467
2468         * statement.cs (LocalInfo.CompilerGenerated): New flag.
2469         (Block.AddTemporaryVariable): New public method; creates a new
2470         `LocalInfo' for a temporary variable.
2471         (Block.EmitMeta): Create the LocalBuilders for all the temporary
2472         variables here.
2473         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
2474         non-iterator variables.
2475
2476 2005-06-05  Martin Baulig  <martin@ximian.com>
2477
2478         * statement.cs (Foreach.TemporaryVariable): Create the
2479         LocalBuilder in the Emit phase and not in Resolve since in some
2480         situations, we don't have an ILGenerator during Resolve; see
2481         2test-19.cs for an example.
2482
2483 2005-06-04  Martin Baulig  <martin@ximian.com>
2484
2485         The big Foreach rewrite - Part II.
2486
2487         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2488         with `PropertyInfo ienumerator_getcurrent'.
2489
2490         * codegen.cs (VariableStorage): Removed.
2491
2492         * statement.cs
2493         (Foreach): Derive from Statement, not ExceptionStatement.
2494         (Foreach.CollectionForeach): New nested class.  Moved all the code
2495         dealing with collection foreach here.
2496         (Foreach.ForeachHelperMethods): Removed.
2497         (Foreach.TemporaryVariable): Implement IMemoryLocation.
2498
2499 2005-05-23  Martin Baulig  <martin@ximian.com>
2500
2501         * statement.cs (Try.DoResolve): Don't create a `finally' if we
2502         don't need to.  Fix #75014.
2503
2504 2005-05-26  Raja R Harinath  <rharinath@novell.com>
2505
2506         Improve user-defined conversion handling.
2507         * convert.cs (GetConversionOperators): Rewrite.  Return only the
2508         applicable operators.
2509         (AddConversionOperators): New.  Helper for GetConversionOperators.
2510         (FindMostEncompassedType, FindMostEncompassingType): Verify that
2511         there is only one most encompassed/encompassing type.
2512         (FindMostSpecificSource, FindMostSpecificTarget): Remove
2513         "applicable operator" handling.
2514         (UserConversion): Move cache here from GetConversionOperators.
2515         Directly cache the chosen operator, rather than the whole
2516         MethodGroup.
2517         (ExplicitNumericConversion): Fix buggy implementation of Decimal
2518         case.  Allow conversion of decimal to sbyte and byte too.
2519         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2520         New static methods.  Used to avoid allocating EmptyExpressions in
2521         convert.cs.
2522
2523 2005-05-24  Duncan Mak  <duncan@novell.com>
2524
2525         * ecore.cs (CastFromDecimal): New class for casting a decimal to
2526         another class, used in Convert.ExplicitNumericConversion.
2527         (CastToDecimal): New class, similar to above, but casts to
2528         System.Decimal, used in Convert.ImplicitNumericConversion and also
2529         in explicit convesion from double/float to decimal.
2530
2531         * convert.cs (ImplicitNumericConversion): Handle implicit
2532         conversions to System.Decimal.
2533         (ExplicitNumericConversion): handle explicit conversions to
2534         System.Decimal.
2535
2536         This fixes #68711.
2537         
2538 2005-05-20  Miguel de Icaza  <miguel@novell.com>
2539
2540         * typemanager.cs: Do not throw an exception in the TypeBuilder
2541         case, we take care of it on the TypeCode.
2542
2543 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
2544         
2545         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2546         is back.
2547         
2548         * cs-parser.jay: Catch more lexical errors.
2549         
2550         * report.cs: Add one more Error method.
2551         
2552         * rootcontext.cs,
2553         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2554
2555 2005-05-20  Martin Baulig  <martin@ximian.com>
2556
2557         * class.cs (TypeContainer.CircularDepException): Removed.
2558         (TypeContainer.DefineType): Removed the `InTransit' stuff.
2559         (TypeContainer.CheckRecursiveDefinition): Check for circular class
2560         (CS0146) and interface (CS0529) dependencies here.
2561
2562 2005-05-20  Martin Baulig  <martin@ximian.com>
2563
2564         * expression.cs (New.DoResolve): Move the CS0712 check above the
2565         CS0144 check; otherwise it can never be reached.
2566
2567 2005-05-20  Martin Baulig  <martin@ximian.com>
2568
2569         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
2570
2571 2005-05-20  Martin Baulig  <martin@ximian.com>
2572
2573         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
2574
2575         * typemanager.cs (TypeManager.IsAttributeType): New public method.
2576
2577 2005-05-19  Martin Baulig  <martin@ximian.com>
2578
2579         * delegate.cs
2580         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2581         to disable error reporting.
2582
2583         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2584         here since we don't want to report an error; see the new test-336.cs.
2585
2586 2005-05-19  Raja R Harinath  <rharinath@novell.com>
2587
2588         * statement.cs (ToplevelBlock.GetParameterReference)
2589         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2590         Move here from class Block.
2591         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2592         * expression.cs (ParameterReference.DoResolveBase): Likewise.
2593
2594 2005-05-18  Martin Baulig  <martin@ximian.com>
2595
2596         Fix #74978.
2597
2598         * flowanalysis.cs
2599         (FlowBranching.Reachability): Add non-static public And() and Or()
2600         methods.
2601         (FlowBranchingSwitch): New class; do the `break_origins' thing
2602         like in FlowBranchingLoop.
2603         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2604         reachability, not just locals and parameters.
2605         (FlowBranching.MergeChild): Remove some of the hacks for loop and
2606         switch; MergeBreakOrigins() now takes care of that.
2607
2608 2005-05-18  Martin Baulig  <martin@ximian.com>
2609
2610         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2611         a loop and may leave it, reset the barrier; fixes #74974.
2612
2613 2005-05-16  Raja R Harinath  <rharinath@novell.com>
2614
2615         Fix test-382.cs.  Emit values of decimal constants.
2616         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
2617         Carved out of ...
2618         (TypeContainer.AddField): ... this.
2619         (TypeContainer.EmitFieldInitializers): Allow the list of fields
2620         with initializers to include 'Const's.
2621         (ClassPart.RegisterFieldForInitialization): Forward to
2622         PartialContainer.
2623         * const.cs (Const.Const): Pass initializer to base class.
2624         (Const.Define): In case of decimal constants, register them for
2625         initialization in a static constructor.
2626
2627 2005-05-14  Martin Baulig  <martin@ximian.com>
2628
2629         * statement.cs (Block.Resolve): Correctly handle unreachable code;
2630         do not call ResolveUnreachable() on unreachable statements in
2631         here, see the comment in the source code.
2632
2633 2005-05-13  Raja R Harinath  <rharinath@novell.com>
2634
2635         Fix #74934.
2636         * expression.cs (BinaryResolveOperator): If one of the operands of
2637         an equality comparison is 'null' and the other is a pointer type,
2638         convert the null to a NullPointer.
2639         * convert.cs (ImplicitReferenceConversion): If the expression is a
2640         NullLiteral and the target type is a pointer type, return a
2641         NullPointer instead.
2642         (ImplicitConversionStandard): Likewise.
2643
2644 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
2645         
2646         * cs-parser.jay: Set readonly context based on special constructs.
2647         
2648         * expression.cs (LocalVariableReference.DoResolveBase): Improved
2649         readonly variable error handling.
2650         
2651         * rootcontext.cs (EmitCode): Don't verify members when error
2652         occurred.
2653         
2654         * statement.cs (LocalInfo): Add reaodnly context information.
2655         (SetReadOnlyContext, GetReadOnlyContext): New methods.
2656
2657 2005-05-17  Martin Baulig  <martin@ximian.com>
2658
2659         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
2660         #70970. 
2661
2662 2005-05-13  Martin Baulig  <martin@ximian.com>
2663
2664         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
2665         handle unreachable blocks.
2666
2667 2005-05-13  Martin Baulig  <martin@ximian.com>
2668
2669         * class.cs
2670         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
2671         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
2672         #74905. 
2673
2674 2005-05-13  Martin Baulig  <martin@ximian.com>
2675
2676         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
2677         instance variable, not a local.  Fix #74873.
2678         (Block.ResolveUnreachable): Set it to true here.
2679
2680 2005-05-12  Martin Baulig  <martin@ximian.com>
2681
2682         * cs-parser.jay (property_declaration): Pass the `current_class',
2683         not the `current_container' to Property's .ctor.  Fixes #74912.
2684
2685 2005-05-11  Martin Baulig  <martin@ximian.com>
2686
2687         * typemanager.cs (Closure): Copy this from MCS and merge all the
2688         GMCS-specific changes into it.
2689
2690 2005-05-12  Raja R Harinath  <harinath@gmail.com>
2691
2692         Fix #74920.
2693         * typemanager.cs (unmanaged_enclosing_types): New.
2694         (IsUnmanagedType): Avoid infloops by using
2695         'unmanaged_enclosing_types' to talk with recursive invocations.
2696
2697 2005-05-11  Duncan Mak  <duncan@novell.com>
2698
2699         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
2700         continuing to process for 'arg'.
2701         (handle_preprocessing_directive): Check the argument of the #endif
2702         directive and report error CS1025 if there are any trailing
2703         characters.
2704
2705         According to the C# spec, having even whitespace after the #endif
2706         directive is illegal; however, because we call arg.TrimEnd ()
2707         beforehand, we have the same behavior as csc, allowing whitespace
2708         after the directive.
2709
2710         Fixes #74892.
2711
2712 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
2713
2714         Fix #74863.
2715         
2716         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
2717         (Constructor.GetObsoleteAttribute): Implemented correctly.
2718
2719 2005-05-10  Martin Baulig  <martin@ximian.com>
2720
2721         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
2722         resolve the type; fixes #74864.
2723         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
2724         in DoResolve(); fixes #74862.
2725
2726 2005-05-10  Martin Baulig  <martin@ximian.com>
2727
2728         * support.cs (ReflectionParameters.ParameterModifier): Use
2729         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
2730         and `ParameterAttributes.In'.  Fixes #74884.
2731
2732 2005-05-10  Martin Baulig  <martin@ximian.com>
2733
2734         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
2735         the cache if we're just looking for `MemberTypes.NestedType' in a
2736         generic instance.
2737
2738         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2739         constraints if we're still resolving the type tree.
2740         (Expression.MemberLookup): If we're resolving the type tree, only
2741         look for `MemberTypes.NestedType' since we're only interested in
2742         getting types.
2743
2744         * class.cs (TypeContainer.DefineType): Don't resolve the type
2745         parameters here; do this later in ResolveType() after the type
2746         tree has been resolved.
2747         (TypeContainer.ResolveType): New public method; this is called
2748         after the type tree is resolved and before the types are being
2749         populated.  We resolve the generic constraints here.
2750         (TypeContainer.DoDefineMember): Check the constraints on our base
2751         class and interfaces.
2752
2753         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
2754         set the `ResolvingTypeTree' flag on the EmitContext.
2755
2756         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
2757
2758 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
2759
2760         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
2761         
2762         * expression.cs (Argument.GetParameterModifier): Turned to property.
2763         (Invocation.Error_InvalidArguments): Add more descriptive errors.
2764         
2765         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
2766         its C# equivalent.
2767         
2768 2005-05-09  Raja R Harinath  <rharinath@novell.com>
2769
2770         Fix #74852.
2771         * decl.cs (MemberCache.AddMethods): Register override methods,
2772         rather than non-override methods.
2773         * typemanager.cs (RegisterOverride): New.
2774         (IsOverride): Update.
2775
2776 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
2777
2778         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
2779
2780 2005-05-06  Martin Baulig  <martin@ximian.com>
2781
2782         * attribute.cs
2783         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
2784         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
2785
2786 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
2787
2788         Fix #73105.
2789         
2790         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
2791         recursive declaration.
2792         
2793         * statement.cs (Block.ResolveMeta): Report any error in resolving.
2794         
2795 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
2796
2797         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
2798         
2799         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
2800
2801 2005-05-05  Raja R Harinath  <rharinath@novell.com>
2802
2803         Fix #74797.
2804         * decl.cs (DeclSpace.FamilyAccessible): 
2805         Use TypeManager.IsNestedFamilyAccessible.
2806
2807         Fix reopened #64812.
2808         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
2809         internal'.
2810
2811 2005-05-04  Raja R Harinath  <rharinath@novell.com>
2812             Abin Thomas  <projectmonokochi@rediffmail.com>
2813             Anoob V E  <projectmonokochi@rediffmail.com>
2814             Harilal P R  <projectmonokochi@rediffmail.com>
2815
2816         Fix #64812.
2817         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
2818         allow access to all static members.
2819
2820 2005-05-04  Martin Baulig  <martin@ximian.com>
2821
2822         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
2823
2824 2005-05-04  Martin Baulig  <martin@ximian.com>
2825
2826         Fix #74655.
2827
2828         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
2829         section at the end; make things work if `default' is not the last
2830         section.        
2831
2832 2005-05-04  Martin Baulig  <martin@ximian.com>
2833
2834         Fix #70400.
2835
2836         * statement.cs (Switch): Replaced the `got_default' field with a
2837         `default_section' one.
2838         (Switch.CheckSwitch): Set `default_section' here.
2839         (Switch.Resolve): If we're a constant switch and the constant is
2840         not found, use the default section.
2841
2842 2005-05-03  Martin Baulig  <martin@ximian.com>
2843
2844         * expression.cs (ArrayAccess.EmitGetLength): New public method.
2845
2846         * statement.cs (Foreach.ArrayForeach): New nested class.
2847         (Foreach.TemporaryVariable): New nested class.
2848         (Foreach.EmitArrayForeach): Removed; this is now in the new
2849         ArrayForeach class.
2850
2851 2005-05-03  Raja R Harinath  <rharinath@novell.com>
2852
2853         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
2854         more conservative.
2855         (VerifyPendingMethods): Revert change below.
2856
2857         * typemanager.cs (IsOverride, RegisterNonOverride): New.
2858         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2859         that used to trigger warning -28.  Remove warning -28.
2860         * expression.cs (Invocation.OverloadResolve): Use
2861         TypeManager.IsOverride to distinguish override methods.
2862
2863         Fix #74773.
2864         * pending.cs (VerifyPendingMethods): If a base type implements the
2865         requested interface, don't bother checking individual methods of
2866         the base type.  As a side-effect, this prevents the creation of
2867         unnecessary proxies.
2868
2869 2005-05-02  Martin Baulig  <martin@ximian.com>
2870
2871         Fix #70182.
2872
2873         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2874         Also `And' the locals if the old vector is null.
2875         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2876         null; in this case we basically reset all the variables.        
2877
2878 2005-05-02  Martin Baulig  <martin@ximian.com>
2879
2880         Fix #74529.
2881
2882         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2883         Added `FlowBranching branching' argument; always `and' the
2884         variables instead of `or'ing them unless we're an infinite loop.
2885
2886         * statement.cs (While.Resolve): Create a new sibling unless we're
2887         infinite.       
2888
2889 2005-05-02  Martin Baulig  <martin@ximian.com>
2890
2891         Fix #70140.
2892
2893         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2894         arguments; use it instead of creating a new TopLevelBlock.
2895         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2896         our ConstructorInitializer.
2897
2898         * statement.cs
2899         (TopLevelBlock.TopLevelBranching): New public property.
2900         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2901         and create our `TopLevelBranching'.
2902
2903         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2904         anonymous method host, use `block.TopLevelBranching' rather than
2905         creating a new branching.
2906
2907 2005-04-20  Miguel de Icaza  <miguel@novell.com>
2908
2909         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2910         a ScopeInfo, if any of the current children is a child of the new
2911         entry, move those children there.
2912
2913 2005-04-30  Martin Baulig  <martin@ximian.com>
2914
2915         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2916         at the beginning of a SwitchSection.  Fix #73335.
2917
2918 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
2919
2920         Fix #74378
2921         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2922         
2923         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2924         (FieldExpr.DoResolve): Obsolete members are ignored for field
2925         initializers.
2926         
2927 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
2928
2929         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2930         of arrays detection.
2931
2932         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2933         verification.
2934         (Field.VerifyClsCompliance): Volatile fields are not compliant.
2935
2936         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2937         arrays report.
2938
2939 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
2940
2941         * cs-parser.jay: Use the prefered version of -unsafe in error
2942         message.
2943
2944 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
2945
2946         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2947         circumstances.
2948
2949 2005-04-20  John Luke  <john.luke@gmail.com>
2950
2951         * driver.cs: fix typo in error message, --outout to --output
2952
2953 2005-04-30  Martin Baulig  <martin@ximian.com>
2954
2955         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
2956         handle the .NET 2.x security attributes.
2957
2958 2005-04-30  Martin Baulig  <martin@ximian.com>
2959
2960         * typemanager.cs
2961         (TypeManager.ExpandInterfaces): Don't add things twice.
2962
2963         * class.cs
2964         (TypeContainer.VerifyClsCompliance): Allow generic instances.
2965
2966 2005-04-29  Martin Baulig  <martin@ximian.com>
2967
2968         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
2969
2970         * anonymous.cs: Added support for anonymous generic methods.
2971
2972 2005-04-29  Martin Baulig  <martin@ximian.com>
2973
2974         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
2975         generic instances.
2976
2977 2005-04-29  Martin Baulig  <martin@ximian.com>
2978
2979         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
2980
2981         * expression.cs (New.DoResolve): Fix the CS0304 check.
2982
2983 2005-04-29  Martin Baulig  <martin@ximian.com>
2984
2985         * typemanager.cs (TypeManager.GetFullName): Updated to the new
2986         naming schema.
2987
2988         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
2989         explicit interface implementation, compare the interface types.
2990         (MethodData.Define): Use the new naming scheme from the latest
2991         .NET 2.x beta2.
2992         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
2993
2994         * decl.cs (MemberName.GetMemberName): Removed.
2995         (MemberName.MethodName, FullName): New properties.
2996
2997 2005-04-25  Raja R Harinath  <rharinath@novell.com>
2998
2999         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3000
3001 2005-04-22  Martin Baulig  <martin@ximian.com>
3002
3003         * generic.cs (GenericMethod): Create the EmitContext in the
3004         `Define()'; in `Define(MethodBuilder)', create the type parameters
3005         before calling `Define()'.  Fixes #73933.
3006
3007 2005-04-22  Martin Baulig  <martin@ximian.com>
3008
3009         * generic.cs
3010         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3011         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3012
3013         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3014         ConstructedType, check its constraints.
3015
3016 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3017
3018         * codegen.cs (InRefOutArgumentResolving): New field.
3019         
3020         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3021         fields outside contructor.
3022         
3023         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3024         
3025 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3026
3027         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3028         parameter code was not completed ever, so it was not as up-to-date
3029         as local variables.  Must finish it.
3030
3031         The bug fix was to compare the Toplevel of the block, not the
3032         current block.  Thanks for Ben for pointing this out. 
3033
3034 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3035
3036         * decl.cs (AddMethods): Use the declaring type of the problem
3037         method to determine if we want to squash a warning.
3038
3039 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3040
3041         * attribute.cs: Removed debug output.
3042
3043         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3044         
3045         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3046         Report.Stderr.
3047         
3048 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3049
3050         Fix #74481.
3051         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3052         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3053         all null comparisons against reference types.
3054
3055 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
3056
3057         Fix# 74565
3058         * class.cs (TypeContainer.CircularDepException) New nested
3059         exception class.
3060         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3061         (TypeContainer.DefineType): Removed error, reset InTransit before
3062         exit.
3063         (Class.DefineType): Throw exception when is in Transit.
3064         Catch exception and report error.
3065         (Struct.DefineType): Throw exception when is in Transit.
3066         Catch exception and report error.
3067         (Interface.DefineType): Throw exception when is in Transit.
3068         Catch exception and report error.
3069
3070         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3071         handle nested exception handlers.
3072
3073         * flowanalysis.cs (InTryWithCatch): New method, search for try with
3074         a catch.
3075
3076         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3077         InFinally and InCatch storage.
3078
3079         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3080         (Catch.Resolve): Set and Restore ec.InCatch.
3081         (Try.Resolve): Set and Restore ec.InFinally.
3082         (Try.HasCatch): True when try has catch.
3083
3084 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
3085
3086         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3087           for the same event member, so exclude such cases from warning 419.
3088           Fixed bug #74633.
3089
3090 2005-04-16  Miguel de Icaza  <miguel@novell.com>
3091
3092         * expression.cs (Binary.ResolveOperator): Apply patch from John
3093         Luke to fix bug 59864: operators &, | and ^ on enumerations
3094         require that the same enum type on both sides.
3095
3096         * driver.cs: Add warnings to old flag usage, this is to assist
3097         people who produce Makefiles and hope that the Makefiles will be
3098         used on Windows.
3099
3100         * class.cs (TypeContainer.EmitType): Moved the definition of the
3101         special $PRIVATE$ field from the resolve phase to the Emit phase.
3102         During resolve we do not know if we are a struct with
3103         HasExplicitLayout, we know this only after the attributes for the
3104         type are emitted.
3105
3106         Set the FieldOffset to zero on the dummy field that we create for
3107         the class.   Fixes 74590.
3108
3109 2005-04-16  Raja R Harinath  <rharinath@novell.com>
3110
3111         Fix #73834.
3112         * ecore.cs (PropertyExpr.resolved): New.
3113         (DoResolve): Use it to handle a case of double resolution here.
3114         Handle a case of identical-name-and-type-name.
3115         * expression.cs (ArrayCreation.CheckIndices): Avoid double
3116         resolution by storing the results of expression resolution back
3117         into the "probes" array.
3118
3119 2005-04-15  Raja R Harinath  <rharinath@novell.com>
3120
3121         Fix cs0208-7.cs and cs0208-8.cs.
3122         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3123         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
3124         error reporting to point out the reason a struct is not unmanaged.
3125
3126 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3127
3128         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
3129           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3130
3131 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3132
3133         Fix #74528.
3134         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3135         IdenticalNameAndTypeName here.
3136         (EventExpr.InstanceResolve): Likewise.
3137
3138 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
3139
3140         C# 2.0 DefaultCharSetAttribute implementation
3141         
3142         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3143         which allows us to set GlobalNamespace for every resolve.
3144         (Attribute.ResolveArguments): Cut from Resolve.
3145         (Attribute.GetCharSetValue): Returns CharSet named argument.
3146         (Attribute.DefinePInvokeMethod): Gets default charset from
3147         module settings.
3148         (GlobalAttribute.ResolveAsTypeStep): Override.
3149         (GlobalAttribute.ResolveArguments): Override.
3150         
3151         * class.cs (TypeAttr): Is protected.
3152         
3153         * codegen.cs (ModuleClass.DefaultCharSet): New member.
3154         (ModuleClass.DefaultCharSetType): New memeber.
3155         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3156         
3157         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3158         charset from module.
3159         
3160         * delegate.cs (TypeAttr): Override.
3161         (Delegate.DefineType): Use this TypeAttr.
3162         
3163         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3164         at very early stage (before types are defined) to resolve model
3165         module attributes. It will probably not work with corlib but it
3166         should be ok.
3167         
3168         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3169         charset from module.
3170         
3171         * typemanager.cs (default_charset_type): New type.
3172
3173 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3174
3175         * decl.cs (MemberCache.AddMethods): Don't warn if
3176         System.Object.Finalize has buggy MethodAttributes.
3177
3178         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3179         removed below.
3180
3181 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3182
3183         * doc.cs : detect ambiguous reference to overloaded members.
3184           Fixed bug #71603. MS 1.1 csc does not detect it.
3185
3186 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3187
3188         * doc.cs : delegates must not be referenced with parameters.
3189           Fixed bug #71605.
3190
3191 2005-04-12  Miguel de Icaza  <miguel@novell.com>
3192
3193         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3194
3195 2005-04-10  Miguel de Icaza  <miguel@novell.com>
3196
3197         * driver.cs (MainDriver): Stop processing if the CLS stage found
3198         errors. 
3199
3200         (CompilerCallableEntryPoint.InvokeCompiler): Always
3201         reset after execution;   Take a TextWriter argument for the
3202         output.
3203
3204         * report.cs: Use the error stream instead of hardcoding stderr. 
3205
3206 2005-04-09  Miguel de Icaza  <miguel@novell.com>
3207
3208         * class.cs: Reduce code paths to test, too small of an
3209         optimization to make it worth the extra testing.  Always perform
3210         it. 
3211
3212 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3213
3214         Fix #74510.
3215         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3216         operators that had errors reported on them.
3217
3218 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
3219
3220         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3221         argument types.
3222         (Attribute.Resolve): Add named argument type checking.
3223         
3224         * class.cs (FixedField.Define): Use IsPrimitiveType
3225         
3226         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3227         
3228         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3229         unsafe parameter types.
3230         
3231         * statement.cs (Using.ResolveExpression): Add better error description.
3232         
3233         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3234         
3235 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3236
3237         Fix #74484.
3238         * attribute.cs (Attribute.GetAttributeUsage): Resolve
3239         AttributeUsageAttribute in the emitcontext of the attribute class,
3240         not in the emitcontext of the attributable entity it was attached to.
3241         * cs-parser.jay: Use 'current_class', not 'current_container',
3242         when creating a GlobalAttribute.
3243
3244 2005-04-08  Alp Toker  <alp@atoker.com>
3245
3246         * pending.cs: The fix to #58413 failed to compile methods implementing
3247         interfaces with/without params modifiers and vice versa, even though
3248         params modifiers aren't part of the signature. Make the modifier check
3249         less strict as in csc.
3250
3251 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
3252             Anoob V E  <projectmonokochi@rediffmail.com>
3253             Harilal P R  <projectmonokochi@rediffmail.com>
3254
3255         Fix #58413.
3256         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
3257         modifiers of pending methods.
3258         (PendingImplementation.PendingImplementation): Initialize it.
3259         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3260         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3261         with ParameterData.  Add check for modifiers.
3262         * class.cs (MethodData.Define): Update to changes.
3263
3264 2005-04-07  Raja R Harinath  <rharinath@novell.com>
3265
3266         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3267
3268 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
3269
3270         * class.cs (PropertyMethod.Define): Check private accessor in abstract
3271         property.
3272         
3273         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3274         
3275         * rootcontext.cs,
3276         * typemanager.cs: Registered RequiredAttributeAttribute.
3277         
3278 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
3279
3280         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3281         Warning CS0169 is back at level 3.
3282         (IMethodData.SetMemberIsUsed): New method.
3283         
3284         * decl.cs (IsUsed): New value; moved from FieldBase.Status
3285         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3286         
3287         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3288
3289         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3290         contants.
3291         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3292         is used.
3293         
3294         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3295         is used.
3296         
3297         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3298         to avoid the problems with nested types.
3299
3300 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
3301             Anoob V.E  <projectmonokochi@rediffmail.com>
3302             Harilal P.R  <projectmonokochi@rediffmail.com>
3303             Raja R Harinath  <rharinath@novell.com>
3304
3305         Fix #73820.
3306         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3307         attribute.
3308         * typemanager (GetConstructor): Make public.
3309
3310 2005-04-05  John Luke  <john.luke@gmail.com>
3311             Raja R Harinath  <rharinath@novell.com>
3312
3313         Fix #62232.
3314         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3315         struct too.  Return false quicker in a few cases.
3316         (VerifyUnManaged): Use it.
3317
3318 2005-04-05  Raja R Harinath  <rharinath@novell.com>
3319
3320         Fix #74041.
3321         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3322         not 'unreachable_seen'.
3323
3324 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
3325
3326         * attribute.cs (Attribute.GetValue): Removed unused.
3327         
3328         * codegen.cs (CodeGen.TrimExt): Removed unused.
3329         
3330         * cs-parser.jay (output): Removed unused.
3331         
3332         * cs-tokenizer.cs (hex_digits): Removed unused.
3333         
3334         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3335         
3336         * expression.cs (Indirection.LoadExprValue): Removed unused.
3337         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3338         
3339         * iterators.cs (Iterator.param_types): Removed unused.
3340         
3341         * statement.cs (Goto.block): Removed unused.
3342         (ToplevelBlock.did): Removed unused.
3343         (Switch.ResolveConstantSwitch): Removed unused.
3344
3345 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
3346
3347         * rootcontext.cs: Allow mcs to bootstrap with the compilation
3348         resetting thingy.
3349
3350 2005-04-19  Martin Baulig  <martin@ximian.com>
3351
3352         Merged r42462 from MCS and made it work for GMCS.
3353
3354         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
3355
3356         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
3357
3358 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3359
3360         Fix #74232 and cs0208-3.cs.
3361         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3362         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3363         unmanaged type.  Don't use FieldBuilders when 't' is a
3364         TypeBuilder.  Use ModFlags and MemberType fields.
3365         * class.cs (MemberBase.member_type): Rename from MemberType.
3366         (MemberBase.MemberType): New property.  Determines member_type on
3367         demand.
3368         (MemberBase.DoDefine): Don't initialize MemberType here.
3369         (FieldMember.Define): Likewise.
3370
3371 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
3372
3373         Fix #74241
3374         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3375         Attributes are emitted there.
3376         
3377 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3378
3379         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3380         keyword in 'partial enum' too.
3381         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3382         is not allowed).
3383         Report from Kamil Skalski <nazgul@omega.pl>.
3384
3385         Fix #74309.
3386         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3387         have partial containers too.
3388
3389         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3390         in block' checks to Block.CheckInvariantMeaningInBlock.
3391         * statement.cs (Block.GetKnownVariableInfo): Make private.
3392         (Block.IsVariableUsedInChildBlock): Remove.
3393         (Block.IsVariableUsedInBlock): Likewise.
3394         (Block.CheckInvariantMeaningInBlock): New.  Show location of
3395         conflicting declaration.
3396         (Block.AddVariable): Make error messages less long-winded and more
3397         specific.  Show location of conflicting declaration.
3398         * parameter.cs (Parameters.Location): New readonly property.
3399
3400 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3401
3402         Clean up semantics of invoking ResolveMemberAccess.
3403         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3404         can have an instance, ensure that we pass in a non-TypeExpression
3405         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
3406         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3407         argument.  Update to changes and simplify.
3408         (FieldExpr.Emitinstance): Remove CS0120 check.
3409         (PropertyExpr.EmitInstance): Likewise.
3410         * expression.cs (Argument.Resolve): Likewise.
3411         (Invocation.DoResolve): Update to changes in semantics of
3412         InstanceExpression.
3413
3414 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
3415
3416         Fix #74241
3417         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3418         customization.
3419         
3420         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3421
3422 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3423
3424         Fix difference in behaviour with commandline invocation.
3425         * driver.cs (Driver.Reset): New.
3426         (CompilerCallableEntryPoint): Call it.
3427
3428         * statement.cs (If.Resolve): Avoid spurious "uninitialized
3429         variable" warnings if the boolean expression failed to resolve.
3430
3431 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
3432
3433         * attribute.cs: Fix the union of several permissions when some of them
3434         are unrestricted (so the result isn't an unrestricted permission set).
3435         Fix #74036.
3436
3437 2005-03-30  Raja R Harinath  <rharinath@novell.com>
3438
3439         * ecore.cs (MemberExpr): New class.  Convert from interface
3440         IMemberExpr.
3441         (MemberExpr.ResolveMemberAccess): Refactor and move here from
3442         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
3443         error checks.
3444         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
3445         (MethodGroupExpr.IsExplicitImpl): Remove.
3446         (Expression.GetFieldFromEvent): Remove.
3447         (SimpleName.MemberStaticCheck): Remove.
3448         (SimpleName.DoSimpleNameResolve): Update to changes.
3449         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
3450         (MemberAccess.IdenticalNameAndTypeName): Remove.
3451         (MemberAccess.error176): Move to MemberExpr.
3452         (MemberAccess.DoResolve): Update to changes.
3453         (BaseAccess.DoResolve): Likewise.
3454
3455 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
3456
3457         C# 2.0 Conditional attribute class implementation
3458         
3459         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
3460         Analyzes class whether it has attribute which has ConditionalAttribute
3461         and its condition is not defined.
3462         
3463         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
3464         (Class.IsExcluded): New method. Search for at least one defined
3465         condition in ConditionalAttribute of attribute class.
3466
3467 2005-03-30  Raja R Harinath  <rharinath@novell.com>
3468
3469         * ecore.cs (PropertyExpr): Derive from Expression, not
3470         ExpressionStatement.
3471         (PropertyExpr.EmitStatement): Remove.
3472
3473 2005-03-29  Raja R Harinath  <rharinath@novell.com>
3474
3475         Fix #74060.
3476         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
3477         internal field "value__" of an enum be private.  The examples for
3478         "value__" that I found on MSDN all used FieldAttributes.Private.
3479
3480         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
3481         Don't mention IL method attribute names.
3482
3483         Fix #47991.  Remove a TODO.
3484         * statement.cs (Block.Toplevel): Make into a field.
3485         (Block.Parameters): Move into ToplevelBlock.
3486         (Block.known_variables): Rename from child_variable_names.
3487         (Block.Block): Remove variants that take Parameters.  Initialize
3488         'Toplevel' with the immediately surrounding toplevel block.
3489         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
3490         LocalInfo parameter.
3491         (Block.GetKnownVariableInfo): New.
3492         (Block.IsVariableNameUsedInChildBlock): Update.
3493         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
3494         the block, even though it may not be in scope.
3495         (Block.AddVariable): Remove Parameters parameter.  Use
3496         Toplevel.Parameters instead.
3497         (Block.AddConstant): Remove Parameters parameter.
3498         (Block.GetParameterReference): Update to use Toplevel.Parameters.
3499         (Block.IsParamaterReference): Likewise.
3500         (Block.IsLocalParameter): Likewise.  Simplify a lot.
3501         (ToplevelBlock.Parameters): New.  Moved from Block.
3502         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
3503         initialize Parameters to a non-null value.
3504         * cs-parser.jay: Update to changes.
3505         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3506         simple names that mean different things in the same block.  Use
3507         Block.IsVariableNameUsedInBlock.
3508
3509 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3510
3511         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3512
3513 2005-03-26  Raja R Harinath  <harinath@acm.org>
3514
3515         Fix #73038.
3516         * assign.cs (Assign.DoResolve): When the RHS of an assignment
3517         fails to resolve, ensure that the LHS is still resolved as an
3518         lvalue.
3519
3520 2005-03-25  Raja R Harinath  <harinath@acm.org>
3521
3522         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3523         ec.ContainerType.
3524         (Enum.current_ec): Remove.
3525         (Enum.LookupEnumValue): Remove EmitContext argument.
3526         Just uses the one created during DefineType.
3527         (Enum.FindMembers): Update.
3528         * expression.cs (MemberAccess.DoResolve): Update.
3529
3530 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
3531
3532         * assign.cs (Assign.DoResolve): Check for CS1717 when
3533         source and target are same (uses Equals).
3534
3535         * expression.cs (LocalVariableReference, ParameterReference,
3536         This): Implemented Equals, GetHashCode.
3537
3538         * statement.cs (Block.GetParameterReference): Removed useless
3539         local variable.
3540
3541 2005-03-22  Raja R Harinath  <rharinath@novell.com>
3542
3543         Fix cs0128.cs
3544         * statement.cs (Block.AddVariable): Ensure that we skip implicit
3545         blocks before deciding whether the error is cs0136 or cs0128.
3546
3547         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3548         (using_alias_directive, using_namespace_directive): Pass
3549         MemberName, not an expression to Namespace.UsingAlias and
3550         Namespace.Using.
3551         (MakeName): Use the MemberName of the namespace.
3552         * namespace.cs (Namespace.MemberName): New.
3553         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3554         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3555         Likewise.
3556         * decl.cs (MemberName.Name): Make readonly.
3557         (MemberName.FromDotted): New "constructor".
3558         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3559         (MemberCore.Name): Compute from MemberName on demand.
3560         (MemberCore.SetMemberName): Provide a way to change the
3561         MemberName.
3562         (MemberCore.AddToContainer): Don't take a fullname parameter.
3563         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3564         fully qualified name of the container to the member name.
3565         (TypeContainer.AddToTypeContainer): Use a fully qualified name
3566         only if the type is a member of the root container.
3567         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3568         MemberName.Left rather than searching for an embedded ".".
3569         (PartialContainer.CreatePart): Update to changes in RootContext.
3570         (MemberBase.ShortName): Turn into a property.  Use
3571         MemberCore.SetMemberName.
3572         (MemberBase.ExplicitInterfaceName): Remove.
3573         (MemberBase.UpdateMemberName): Remove.
3574         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3575         (PropertyBase.SetMemberName): New override.
3576         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3577         (Tree.GetDecl): New.
3578         (Tree.AllDecls): Rename from Decls.
3579         * attribute.cs, enum.cs, report.cs: Update to changes.
3580         * driver.cs (MainDriver): Use MemberName.FromDotted on
3581         RootContext.MainClass.
3582
3583 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
3584
3585         * class.cs (FixedField.Define): Check for CS1664 and more sanity
3586         checks.
3587
3588         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3589
3590 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
3591
3592         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3593         property accessor modifiers.
3594
3595         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3596         fixed buffer attribute (CS1716).
3597         (PropertyMethod.HasCustomAccessModifier): When property accessor
3598         has custom modifier.
3599
3600         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3601         modifiers.
3602         (PropertyExpr.DoResolveLValue): Add CS0272.
3603
3604 2005-03-17  Miguel de Icaza  <miguel@novell.com>
3605
3606         * convert.cs: When converting to a pointer, use the proper Conv.U
3607         or Conv.I depending on the source data type.
3608
3609         * cs-tokenizer.cs: Make the size for large decimal constants,
3610         fixes #72957.
3611
3612 2005-03-17  Martin Baulig  <martin@ximian.com>
3613
3614         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3615         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3616
3617 2005-03-17  Martin Baulig  <martin@ximian.com>
3618
3619         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3620         to bool so we can return an error condition.
3621         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3622         returned an error.
3623
3624 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
3625
3626         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
3627         attributes.
3628
3629 2005-03-16  Raja R Harinath  <rharinath@novell.com>
3630
3631         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
3632         Refactor to avoid traversing the list of assemblies, and to avoid
3633         string concatenation.
3634         * typemanager.cs (guid_attr_type): Remove.
3635         (negative_hits, pointers, references): Remove hashes.
3636         (type_hash): New.
3637         (GetConstructedType): New.  Uses type_hash to handle constructed
3638         types (arrays, references, pointers).
3639         (GetReferenceType, GetPointerType): Use it.
3640         (GetNestedType): New.  Uses type_hash to handle nested types of
3641         reflected types.
3642         (LookupType, LookupTypeDirect): Remove.
3643         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
3644         'types' hash and LookupTypeReflection directly.
3645         (params_string, params_object): Use GetConstructedType.
3646         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
3647         top-level types.
3648         (Namespace.Lookup): Use cached_types.
3649         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
3650         provided by old TypeManager.LookupType.
3651         * rootcontext.cs (MakeFQN): Remove.
3652         * decl.cs (DeclSpace.MakeFQN): Likewise.
3653         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
3654         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
3655         TypeManager.GetConstructedType.
3656         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
3657
3658 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
3659
3660         * cs-parser.jay: Fix build.
3661
3662 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
3663
3664         * class.cs (TypeContainer.CircularDepException) New nested
3665         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
3666
3667         * cs-parser.jay: Reports CS1527 for any namespace element.
3668
3669         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
3670         Added CS0407.
3671
3672         * expression.cs (ParameterReference.IsAssigned): Changed error to
3673         CS0269.
3674         (Error_WrongNumArguments): Moved CS0245 detection here.
3675
3676         * statement.cs (Return.Resolve): Add CS1622 report.
3677
3678 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
3679
3680         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
3681
3682 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
3683
3684         * attribute.cs expression.cs: Get rid of some allocations.
3685
3686 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
3687
3688         * doc.cs : just eliminate the latest change.
3689
3690 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3691
3692         * doc.cs : commented out the latest change. It breaks xml-030.cs
3693
3694 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3695
3696         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
3697           fail. So invoke CreateType() in FindDocumentedType().
3698
3699 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3700
3701         * cs-tokenizer.cs : added IsKeyword().
3702         * doc.cs : Detect keyword incorrectly used as identifier.
3703           Allow identifiers prefixed by @.
3704
3705 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
3706
3707         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
3708         It caused exception in namespace resolving (again!).
3709         
3710         * class.cs (Class.ctor): Removed exit.
3711         (PropertyMethod.ctor): ditto.
3712         
3713         * codegen.cs (Codegen.Reset): Reset static data.
3714         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
3715         
3716         * cs-tokenizer.cs (Cleanup): Removed.
3717         
3718         * driver.cs (GetSystemDir): Rewrote to one line command.
3719         It caused problem with unloaded dynamic modules.
3720         (UnixParseOption): Removed Exit.
3721         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
3722         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
3723         Now can be mcs used as library.
3724         
3725         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
3726         empty location.
3727         
3728         * location.cs (Reset): Reset static data.
3729         
3730         * namespace.cs (Reset): Reset static data.
3731         
3732         * report.cs (Report.Reset): Reset static data.
3733         
3734         * rootcontext.cs (RootContext.Reset): Reset static data.
3735         
3736         * tree.cs (RootTypes.ctor): Use Location.Null
3737         
3738         * typemanager.cs (TypeManager.Reset): Reset static data.
3739         (CoreLookupType): Removed Exit.
3740         (TypeHandle.Reset): Reset static data.
3741         
3742 2005-03-10  Raja R Harinath  <rharinath@novell.com>
3743
3744         Fix #73516.
3745         * typemanager.cs (ComputeNamespaces): Import namespaces from
3746         referenced modules too.
3747
3748 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3749
3750         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
3751         than '.'.
3752
3753 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3754
3755         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
3756         enclosing DeclSpace.  This ensures that a name-lookup populates
3757         more caches and there are fewer 'TypeExpression's.  Carve out
3758         nested type lookup into ...
3759         (LookupNestedTypeInHierarchy): ... this.
3760
3761 2005-04-15  Martin Baulig  <martin@ximian.com>
3762
3763         Merged r41590 from MCS and make it work in the generics land.
3764
3765         * generic.cs (TypeParameter.UpdateConstraints): Removed the
3766         `check' argument.
3767
3768         * class.cs (PartialContainer.UpdateConstraints): Removed.
3769         (PartialContainer.CheckConstraints): Removed.
3770         (PartialContainer.SetParameterInfo): Store the constraints here.
3771         (PartialContainer.DefineTypeParameters): New public method;
3772         resolve the type parameter's constraints here.  Note that the
3773         PartialContainer doesn't have an EmitContext anymore, so we must
3774         do this in the ClassPart.
3775
3776 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3777
3778         Clean up a few partial-class semantics.  
3779         Fixes test-357.cs and cs1618-2.cs.
3780         * cs-parser.jay (struct_declaration): Use 'current_class' as
3781         parent of newly-created struct.  Remove call to Register ().
3782         Use 'pop_current_class' to complete handing the current struct.
3783         (interface_declaration): Likewise.
3784         (class_declaration): Likewise.
3785         (enum_declaration): Use 'current_class' as parent of newly created
3786         enum.
3787         (delegate_declaration): Likewise.
3788         (pop_current_class): New function.  This is used to handle closing
3789         up the 'current_class' and 'current_container', and pointing them
3790         to the enclosing class/container.
3791         (CSharpParser): Initialize 'current_class' too.
3792         * decl.cs (MemberCore): Add check for invariant: a partial
3793         container is not a parsed entity, and thus does not enclose any
3794         parsed members.
3795         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
3796         (DeclSpace.BaseTypeExpr): Use it.
3797         (DeclSpace.LookupType): Add check for invariant.
3798         * class.cs (TypeContainer): Add check for invariant: a nested
3799         class should have the same NamespaceEntry as its enclosing class.
3800         (TypeContainer.EmitFieldInitializers): Make virtual.
3801         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
3802         MemberCore.
3803         (TypeContainer.Register): Remove.
3804         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
3805         null.  Use TypeResolveEmitContext for resolving base types and
3806         interfaces.  Move initialization of Parts.TypeBuilder here from
3807         ...
3808         (TypeContainer.DefineNestedTypes): ... here.
3809         (PartialContainer): Take a Namespace not a NamespaceEntry.
3810         (PartialContainer.Create): Don't use Register.  Call the
3811         appropriate Add... function directly.
3812         (ClassPart): Take both the PartialContainer and the enclosing
3813         class as constructor arguments.
3814         (ClassPart.EmitFieldInitializers): Override.
3815         (ClassPart.PartFindNestedTypes): Remove.
3816         (FieldBase.GetInitializerExpression): Resolve the initializer
3817         expression in the emit context of the enclosing class.
3818         * tree.cs (RootTypes): Remove Register ().
3819         
3820 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
3821
3822         * cs-parser.jay: Removed CS0134.
3823         
3824         * driver.cs: Removed CS1901.
3825         
3826         * expression.cs (SizeOf.DoResolve): Don't report CS0233
3827         for predefined types.
3828
3829 2005-03-07  Duncan Mak  <duncan@novell.com>
3830
3831         * codegen.cs (Save):  Catch UnauthorizedAccessException as
3832         well. Fixes bug #73454.
3833
3834 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
3835
3836         * cs-tokenizer.cs (xtoken): Add CS1035.
3837         
3838         * class.cs (MethodData.Define): Add CS0683.
3839         (FieldMember.ctor): Add CS0681.
3840
3841 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3842
3843         * ecore.cs (SimpleName.DoResolve): Rename from
3844         SimpleName.DoResolveAllowStatic.
3845         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
3846         Pass 'intermediate' flag to MemberStaticCheck.
3847         (SimpleName.MemberStaticCheck): Skip "static check" only in case
3848         of "intermediate" lookups via MemberAccess.
3849         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
3850         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
3851
3852 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3853
3854         Fix #73394.
3855         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
3856         slipped in because of variable names that are identical to a
3857         builtin type's BCL equivalent ('string String;', 'int Int32;').
3858         (PropertyExpr.EmitInstance): Likewise.
3859
3860 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
3861
3862         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
3863         
3864         * report.cs (warning_ignore_table): Made public.
3865
3866 2005-03-04  Raja R Harinath  <rharinath@novell.com>
3867
3868         Fix #73282.
3869         * class.cs (MethodData.Emit): Pass 'container' to
3870         container.GetObsoleteAttribute instead of 'container.Parent'.
3871
3872 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
3873
3874         * cs-parser.jay: Add 1534 error test.
3875
3876         * iterators.cs (Yield.CheckContext): Add error 1629.
3877         (Iterator.ctor): Save unsafe modifier.
3878         (MoveNextMethod.DoEmit): Restore unsafe context.
3879
3880         * namespace.cs (UsingAlias): Better error message.
3881
3882 2005-03-03  Dan Winship  <danw@novell.com>
3883
3884         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
3885         the warning message [#73219]
3886
3887 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3888
3889         Fix compile with MCS 1.0.0.0.
3890         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
3891         w_restore to not depend on string constant folding.
3892
3893 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3894
3895         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
3896         CS0246 check to users who passed 'silent = false'.
3897         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
3898         check.
3899         (SimpleName.SimpleNameResolve): Update.
3900         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
3901         (MemberAccess.IdenticalNameAndTypeName): Update.
3902         * doc.cs (FindDocumentedTypeNonArray): Update.
3903
3904 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
3905
3906         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3907         * parameters.cs (ComputeAndDefineParameters): Remove.
3908         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3909         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3910         Use GetParameterInfo.
3911
3912 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
3913
3914         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3915
3916 2005-03-02  Raja R Harinath  <rharinath@novell.com>
3917
3918         Unify DeclSpace.LookupType and DeclSpace.FindType.
3919         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
3920         is in charge of defining nested types on demand.
3921         (DeclSpace.LookupType): Use it when the current_type is a
3922         TypeBuilder.  Use LookupTypeDirect for reflected types.
3923         (DeclSpace.FindType): Remove.
3924         (DeclSpace.LookupInterfaceOrClass): Likewise.
3925         (DeclSpace.DefineTypeAndParents): Likewise.
3926         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3927         DeclSpace.LookupType.
3928         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3929         * typemanager.cs (LookupType): Simplify.
3930         (AddUserType): Remove type from negative_hits.
3931         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3932         * class.cs (TypeContainer.FindMembers): Move handling of nested
3933         types ...
3934         (TypeContainer.FindMembers_NestedTypes): ... here.
3935         (TypeContainer.FindNestedType): Implement override.
3936         (ClassPart.FindNestedType): Delegate to PartialContainer.
3937         (ClassPart.PartFindNestedType): Looks up the nested types of the
3938         part alone.
3939
3940 2005-04-14  Martin Baulig  <martin@ximian.com>
3941
3942         * generic.cs (ConstructedType): Moved all the type lookup and
3943         nested class logic into SimpleName.
3944         (ConstructedType.ResolveConstructedType): Our underlying type is
3945         already fully resolved; all the type lookup stuff is in
3946         SimpleName.
3947
3948         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
3949         constructed types here instead of in ConstructedType.
3950
3951         * decl.cs (MemberName.GetTypeExpression): Always create a
3952         SimpleName, not a ConstructedType.
3953         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
3954
3955 2005-03-02  Martin Baulig  <martin@ximian.com>
3956
3957         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3958         static constructor in static classes.
3959
3960 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
3961
3962         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3963         sizeParamIndex is not specified.
3964
3965 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
3966
3967         Fix #73117
3968         * report.cs (WarningMessage.IsEnabled): Missing null check.
3969
3970 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3971
3972         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3973         in the fields and not in the properties.
3974
3975 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
3976
3977         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
3978         fields as well.
3979
3980 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3981
3982         * attribute.cs: Small refactoring (improved robustness).
3983         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3984         (ValidateGuid): Removed.
3985         (Resolve): Removed referenced to above mentioned.
3986         (GetAttributeUsage): Made private and changed to work without
3987         class assistance.
3988         (GetIndexerAttributeValue): Don't crash.
3989         (GetConditionalAttributeValue): Ditto.
3990         (GetClsCompliantAttributeValue): Ditto.
3991         (ExtractSecurityPermissionSet): All attributes exceptions are
3992         error 648.
3993         (GetPropertyValue): New helper.
3994         (GetMethodImplOptions): New method.
3995         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3996         some missing properties.
3997         
3998         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3999         (Method.ApplyAttributeBuilder): Updated.
4000         
4001         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4002         exception.
4003
4004 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4005
4006         Fix #73052.
4007         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4008         non-simple types (array, pointer, reference).
4009
4010 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4011
4012         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4013
4014         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4015         for operators.
4016         (Method.CheckBase): Catch wrong destructor here.
4017         (MethodData.Define): Add errors 550, 668.
4018
4019         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4020
4021         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4022
4023         * pending.cs (VerifyPendingMethods): Add error 551.
4024
4025         * typemanager.cs (CSharpName): Next error report helper.
4026
4027 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4028
4029         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4030         attributes. Removed useless attribute double check.
4031         It saves almost 2MBs for corlib.
4032
4033 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4034
4035         Fix #72924.
4036         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4037         called twice in case of error.
4038
4039 2005-02-23  Chris Toshok  <toshok@ximian.com>
4040
4041         Fix compiler portions of #72827.
4042         * statement.cs (Block.Emit): call Begin/EndScope on the
4043         EmitContext instead of the ILGenerator.
4044
4045         * codegen.cs (EmitContext.BeginScope): new method, call
4046         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4047         we have one.)
4048         (EmitContext.BeginScope): same, but EndScope and CloseScope
4049
4050         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4051         offset and call the superclass's OpenScope(int) with it.
4052         (SymbolWriter.CloseScope): get the current il
4053         offset and call superclass's CloseScope(int) with it.
4054
4055 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
4056
4057         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4058         CS1677 for out and ref as well.
4059
4060         * class.cs (Method.Define): Add error CS1599 detection.
4061         
4062         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4063         
4064         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4065         
4066         * delegate.cs (Delegate.Define): Add error CS1599 detection.
4067         
4068         * support.cs.cs (ModifierDesc): New helper method.
4069
4070 2005-02-23  Raja R Harinath  <rharinath@novell.com>
4071             Abin Thomas  <projectmonokochi@rediffmail.com>
4072             Anoob V E  <projectmonokochi@rediffmail.com>
4073             Harilal P R  <projectmonokochi@rediffmail.com>
4074
4075         Fix #57851, #72718.
4076         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4077         MemberLookup (used for error reporting) actually returns a result.
4078         Fix error report number (122, not 112).
4079
4080 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
4081             Anoob V E  <projectmonokochi@rediffmail.com>
4082             Harilal P R  <projectmonokochi@rediffmail.com>
4083
4084         Fix #71134.
4085         * pending.cs (PendingImplementation.GetAbstractMethods):
4086         Find NonPublic members too.
4087
4088 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
4089
4090         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4091         Fixed error 217.
4092         
4093         * class.cs (MethodCore.CheckMethodAgainstBase):
4094         Add error 239 report.
4095
4096 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4097
4098         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4099         
4100         * class.cs (Operator.Define): Add error 217 report.
4101         
4102 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4103
4104         Fix #68955.
4105         * expression.cs (Invocation.IsApplicable): Make public.
4106         (Invocation.IsParamsMethodApplicable): Likewise.
4107         * delegate.cs (Delegate.VerifyApplicability): Don't use
4108         Invocation.VerifyArgumentCompat for parameter applicability
4109         testing.  Use Invocation.IsApplicable and
4110         Invocation.IsParamsMethodApplicable.
4111
4112 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4113
4114         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4115         
4116         * class.cs (Operator.Define): Add error 217 report.
4117         
4118 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4119
4120         * namespace.cs (UsingEntry.Resolve): Undo change below.
4121
4122 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4123
4124         Fix #72756.
4125         * ecore.cs (Expression.MemberLookupFailed): Add argument to
4126         disable the error message when the extended MemberLookup also
4127         fails.
4128         (Expression.MemberLookupFinal): Update.
4129         (SimpleName.DoSimpleNameResolve): Update.
4130         * expression.cs (MemberAccess.ResolveNamespaceOrType):
4131         Don't use MemberLookupFinal.
4132         (New.DoResolve): Update.
4133         (BaseAccess.CommonResolve): Update.
4134
4135 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4136
4137         Fix #72732.
4138         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4139         occured previously, don't resolve again.
4140
4141 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4142
4143         Fix #69949
4144         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4145         argument. Call ResolveAttributeUsage for unresolved.
4146         when types doesn't match ctor arguments.
4147         
4148         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4149         for nested attribute classes.
4150         (Class.attribute_usage): Removed.
4151         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4152         for attribute class.
4153         
4154         * ecore.cs (IsAttribute): Removed.
4155         
4156         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4157         
4158         * rootcontext.cs (RegisterAttribute): Removed, attributes are
4159         now normal types.
4160         (attribute_types): Removed.
4161         (EmitCode): Global attributes are emited as the latest.
4162
4163 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
4164
4165         * class.cs (EmitFieldInitializers): Don't emit field initializer
4166         for default values when optimilization is on.
4167         
4168         * constant.cs (Constant.IsDefaultValue): New property.
4169         
4170         * driver.cs: Add /optimize handling.
4171         
4172         * constant.cs,
4173         * ecore.cs,
4174         * literal.cs: Implement new IsDefaultValue property.
4175         
4176         * rootcontext.cs (Optimize): New field, holds /optimize option.
4177
4178 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4179
4180         Fix crasher in re-opened #72347.
4181         * namespace.cs (Namespace.Lookup): Return null if
4182         DeclSpace.DefineType returns null.
4183
4184         Fix #72678.
4185         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4186
4187 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4188
4189         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
4190         now returns null if it cannot resolve to an lvalue.
4191         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4192         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4193         returned null.  Remove check for SimpleName.
4194         (EventExpr.DoResolveLValue): New.
4195         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4196         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
4197         error from ...
4198         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
4199         avoid CS0131 error.
4200         (Unary.ResolveOperator): Move CS0211 check ...
4201         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
4202         CS0131 error.
4203         (Unary.DoResolveLValue): Simplify.
4204         (AddressOf.DoResolveLValue): New.
4205         (ArrayAccess.DoResolveLValue): New.
4206
4207 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
4208
4209         * attribute.cs (Attribute.Resolve): Add arguments casting for
4210         when types doesn't match ctor arguments.
4211
4212 2005-02-16  Raja R Harinath  <rharinath@novell.com>
4213
4214         Fix parts of #63202.
4215         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4216         lookup of operator in base type.  Ensure that all checks happen
4217         when the operator resolves to an "op_..." method.
4218
4219 2005-02-15  Raja R Harinath  <rharinath@novell.com>
4220
4221         Fix #71992.
4222         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4223         'ignore_cs0104' parameter.  Pass it to ...
4224         (NamespaceEntry.Lookup): ... this.
4225         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4226         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4227         (TypeLookupExpression.DoResolveAsTypeStep): Update.
4228         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4229         Update.  Request that cs0104 errors be ignored.
4230         (ComposedCast.ResolveAsTypeStep): Update.
4231
4232 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4233
4234         Fix #59209.
4235         * expression.cs (Invocation.BetterFunction): Remove support for
4236         comparing virtual functions and their overrides.
4237         (Invocation.IsOverride): New.
4238         (Invocation.OverloadResolve): Don't consider 'override' functions
4239         during candidate selection.  Store them in a lookaside list.
4240         If the selected method is a 'virtual' function, use the list to
4241         find any overrides that are closer to the LHS type.
4242
4243 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
4244
4245         * expression.cs (New.DoResolve): Add complex core type reduction.
4246         (New.Constantify): Converts complex core type syntax like 'new int ()'
4247         to simple constant.
4248         
4249 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4250
4251         * decl.cs (EntryType.EntryType): New constructor to create an
4252         updated copy of a cache entry.
4253         (MemberCache.AddMethods): Use it.
4254         (MemberCache.ClearDeclaredOnly): Remove.
4255         (MemberCache.MemberCache): Update.
4256
4257 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4258
4259         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4260         variable.  This one is represents the actual low-level declaration
4261         of the method, as opposed to the semantic level `IsStatic'.   
4262
4263         An anonymous method which is hosted into a static method might be
4264         actually an instance method.  IsStatic would reflect the
4265         container, while MethodIsStatic represents the actual code
4266         generated.
4267
4268         * expression.cs (ParameterReference): Use the new MethodIsStatic
4269         instead of IsStatic.
4270
4271         * anonymous.cs (AnonymousMethod.Compatible): Pass the
4272         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4273         set on the current EmitContext. 
4274
4275         * expression.cs (Cast): Overload DoResolveLValue so we can pass
4276         resolve our casted expression as an LValue.  This triggers the
4277         proper LValue processing that is later required by Assign.
4278
4279         This fixes 72347.
4280
4281         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4282
4283 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
4284
4285         C# 2.0 Fixed buffer implementation
4286
4287         * anonymous.cs: Update after RegisterHelperClass renaming.
4288
4289         * attribute.cs (AttributeTester.fixed_buffer_cache):
4290         Cache of external fixed buffers.
4291         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4292         implementation if field is fixed buffer else null.
4293
4294         * class.cs
4295         (TypeContainer.AddField): Accept FieldMember instead of Field.
4296         (FieldBase.IsFieldClsCompliant): Extracted code from
4297         VerifyClsCompliance descendant customization.
4298         (FixedField): New class handles fixed buffer fields.
4299         (FixedFieldExternal): Keeps information about imported fixed
4300         buffer.
4301         (IFixedField): Make access to internal or external fixed buffer
4302         same.
4303
4304         * cs-parser.jay: Add fixed buffer parsing.
4305
4306         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4307         buffer.
4308
4309         * expression.cs (Indirection): Extended implementation to accept
4310         fixed buffer field.
4311         (PointerArithmetic.Emit): Get element from fixed buffer as well.
4312         (ElementAccess.MakePointerAccess): Get type as parameter.
4313         (DoResolve): Add fixed buffer field expression conversion.
4314         (DoResolveLValue): Ditto.
4315         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4316         (ArrayPtr): Derives from FixedBufferPtr.
4317         (ArrayPtr.Emit): Add extra emit for array elements.
4318
4319         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4320
4321         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4322         for compiler generated types.
4323         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4324
4325         * statement.cs (Fixed): Refactored to be easier add fixed buffer
4326         and consume less memory.
4327         (Fixed.Resolve): Add fixed buffer case.
4328
4329         * typemanager.cs (compiler_generated_attr_ctor,
4330         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4331         (HasElementType): Add our own implementation to work on every
4332         runtime.
4333
4334 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4335
4336         * anonymous.cs (CaptureContext): Track whether `this' has been
4337         referenced.   
4338
4339         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
4340         only captured `this' if it was implicitly done (instance
4341         methods/variables were used). 
4342
4343         * codegen.cs (EmitContext.CaptureThis): New method to flag that
4344         `this' must be captured.
4345
4346 2005-01-30  Miguel de Icaza  <miguel@novell.com>
4347  
4348         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4349         is null it means that there has been no need to capture anything,
4350         so we just create a sibling.
4351
4352         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4353
4354         Just a partial fix.  The other half is fairly elusive.
4355         
4356 2005-02-10  Raja R Harinath  <rharinath@novell.com>
4357
4358         Fix #52586, cs0121-4.cs.
4359         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
4360         and return a hashtable.
4361         (MemberCache.ClearDeclaredOnly): New.
4362         (MemberCache.MemberCache): Update to change.  Make a deep copy of
4363         the method_hash of a base type too.
4364         (MemberCache.AddMethods): Adapt to having a deep copy of the base
4365         type methods.  Overwrite entries with the same MethodHandle so
4366         that the ReflectedType is correct.  The process leaves in base
4367         virtual functions and their overrides as distinct entries.
4368         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
4369         matters since it was boxed in a ArrayList before.
4370         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4371         modifier.
4372         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
4373         case of a virtual function and its override (choose the overload
4374         as better).
4375         (Invocation.OverloadResolve): Avoid 'override' members during
4376         'applicable_type' calculation.
4377
4378 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4379
4380         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4381         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4382         GetTypeHandle.  It is possible for a reflected type to derive from
4383         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4384         System.Array during mscorlib compilation).
4385         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4386         contain a method_hash, don't create one either.  Don't create a
4387         deep copy of the base cache's method_hash.
4388         (MemberCache.SetupCache): Rename back from DeepCopy.
4389         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4390         already initialized.  If we see an override function, add its
4391         underlying base virtual function to the member_hash too.
4392
4393 2005-02-09  Raja R Harinath  <rharinath@novell.com>
4394
4395         Combine two near-redundant caches.
4396         * typemanager.cs (method_params): Rename from method_internal_params.
4397         (TypeManager.GetParameterData): New.  Replace
4398         Invocation.GetParameterData.
4399         (TypeManager.LookupParametersByBuilder): Remove.
4400         * expression.cs (Invocation.method_parameter_cache): Remove.
4401         (Invocation.GetParameterData): Remove.
4402         Update to changes.
4403         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4404         Update to changes.
4405
4406 2005-02-08  Raja R Harinath  <rharinath@novell.com>
4407
4408         Fix #72015.
4409         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4410         TypeManager.multicast_delegate_type is null, resolve it by looking
4411         up "System.MulticastDelegate".
4412         * rootcontext.cs (RootContext.ResolveCore): Simplify.
4413
4414 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
4415             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
4416             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
4417
4418         Fix cs0164.cs.
4419         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4420         (LabeledStatement.AddReference): New.  Set 'referenced'.
4421         (Goto.Resolve): Use it.
4422
4423 2005-02-05  John Luke  <john.luke@gmail.com>
4424
4425         * driver.cs: remove duplicate -doc line in Usage ()
4426
4427 2005-02-04  Raja R Harinath  <rharinath@novell.com>
4428
4429         * location.cs (Location.AddFile): Fix CS2002 error report.
4430
4431 2005-02-02  Martin Baulig  <martin@ximian.com>
4432
4433         * delegate.cs (Delegate.DefineType): Report an internal error if
4434         TypeManager.multicast_delegate_type is null.  See bug #72015 for
4435         details.        
4436
4437 2005-02-02  Raja R Harinath  <rharinath@novell.com>
4438
4439         Fix a crasher in a variant of #31984.
4440         * const.cs (Constant.CheckBase): New override that defers the
4441         new-or-override check in case the base type hasn't been populated
4442         yet.
4443         (Constant.Define): Ensure the new-or-override check is performed.
4444
4445 2005-02-01  Duncan Mak  <duncan@ximian.com>
4446
4447         * const.cs (LookupConstantValue): Check that `ce' is not null
4448         before calling GetValue ().
4449
4450 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4451
4452         Fix test-334.cs (#69519).
4453         * cs-parser.jay (using_alias_directive): Pass in an expression to
4454         NamespaceEntry.UsingAlias.
4455         (using_namespace_directive): Pass in an expression to
4456         NamespaceEntry.Using.
4457         (namespace_name): Don't flatten to a string.
4458         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4459         (NamespaceEntry.AliasEntry.Resolve): Lookup using
4460         ResolveAsTypeStep.
4461         (NamespaceEntry.UsingEntry): Likewise.
4462         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4463         changes.
4464         (NamespaceEntry.LookupForUsing): Remove.
4465         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4466         names.
4467         (NamespaceEntry.Lookup): Remove support for dotted names.
4468
4469 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4470
4471         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4472         split into two.
4473         (NamespaceEntry.ImplicitParent): Compute on demand.
4474         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4475         parallels the current.
4476         (NamespaceEntry.LookupForUsing): Use it.
4477         (NamespaceEntry.Lookup): If the current namespace-entry is
4478         implicit, don't search aliases and using tables.
4479
4480 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4481
4482         Fix #31984.
4483         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
4484         BaseCache here.
4485         (TypeContainer.BaseCache): Compute on demand.
4486         (TypeContainer.FindMembers): Define constants and types if they're
4487         not already created.
4488         (FieldMember.Define): Move resetting of ec.InUnsafe before error
4489         check.
4490         * const.cs (Constant.Define): Make idempotent.
4491
4492 2005-01-29  Miguel de Icaza  <miguel@novell.com>
4493
4494         * pending.cs: Produce better code (no nops produced by using Ldarg
4495         + value).
4496         
4497         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4498         i - 1' it should be arg + 1.
4499
4500         Fixes bug #71819.
4501
4502 2005-01-28  Raja R Harinath  <rharinath@novell.com>
4503
4504         * attribute.cs (Attribute.CheckAttributeType): Make private
4505         non-virtual.
4506         (Attribute.ResolveType): Make virtual.
4507         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4508         handling of RootContext.Tree.Types.
4509
4510 2005-01-27  Raja R Harinath  <rharinath@novell.com>
4511
4512         Update attribute-handling to use the SimpleName/MemberAccess
4513         mechanisms.
4514         * cs-parser.jay (attribute): Pass in an expression to the
4515         constructors of Attribute and GlobalAttribute.
4516         * attribute.cs (Attribute): Take an expression for the name.
4517         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
4518         passed in attribute name expression.
4519         (Attribute.CheckAttributeType): Use it.
4520         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4521         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4522         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
4523         argument to prevent error messages if the lookup fails.
4524
4525 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
4526
4527         * expression.cs (Indirection): Implemented IVariable interface
4528         to support indirection in AddressOf operator.
4529         (PointerArithmetic.Emit): Add optimalization for case where
4530         result can be precomputed.
4531
4532 2005-01-26  Martin Baulig  <martin@ximian.com>
4533
4534         * class.cs (TypeContainer.AttributeTargets): Return the correct
4535         AttributeTargets depending on our `Kind' instead of throwing an
4536         exception; fixes #71632.
4537
4538 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
4539
4540         Fix #71257
4541         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4542         constant members.
4543
4544 2005-03-17  Martin Baulig  <martin@ximian.com>
4545
4546         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4547         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4548
4549 2005-03-17  Martin Baulig  <martin@ximian.com>
4550
4551         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4552         to bool so we can return an error condition.
4553         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4554         returned an error.
4555
4556 2005-03-17  Martin Baulig  <martin@ximian.com>
4557
4558         * generic.cs (TypeMananager.IsIEnumerable): New public method.
4559
4560         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
4561         converting from an array-type of T to `IEnumerable<T>'.
4562
4563 2005-03-16  Martin Baulig  <martin@ximian.com>
4564
4565         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
4566         (Nullable.LiftedUnaryMutator): New public class.
4567
4568         * expression.cs (UnaryMutator.DoResolve): Added support for
4569         Nullable Types.
4570
4571 2005-03-14  Martin Baulig  <martin@ximian.com>
4572
4573         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
4574
4575 2005-03-14  Martin Baulig  <martin@ximian.com>
4576
4577         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
4578         the comparision operators `<', `>', `<=' and `>='.
4579
4580 2005-03-13  Martin Baulig  <martin@ximian.com>
4581
4582         * generic.cs
4583         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
4584         avoid confusion with the `NullLiteral'.
4585         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
4586
4587 2005-03-13  Martin Baulig  <martin@ximian.com>
4588
4589         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
4590         comparing arbitrary types with the null literal.
4591
4592 2005-03-13  Martin Baulig  <martin@ximian.com>
4593
4594         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
4595         boolean operators '&&', '||', '&' and '|'.
4596         (Nullable.OperatorTrueOrFalse): New public class.
4597
4598         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
4599         instead of a `StaticCallExpr'; added support for nullables.
4600
4601 2005-03-10  Martin Baulig  <martin@ximian.com>
4602
4603         * expression.cs
4604         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
4605         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
4606
4607 2005-03-07  Martin Baulig  <martin@ximian.com>
4608
4609         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
4610         it work if `expr' is not an IMemoryLocation.
4611         (Nullable.Lifted): Implement IMemoryLocation.
4612         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
4613         target type.
4614
4615 2005-03-05  Martin Baulig  <martin@ximian.com>
4616
4617         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
4618         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
4619         (Nullable): Added support for lifted unary and binary operators.
4620
4621         * expression.cs (Unary.DoResolve): Added support for nullable types.
4622         (Binary.DoResolve): Likewise.
4623         (Conditional.DoResolve): Likewise.
4624
4625 2005-03-02  Martin Baulig  <martin@ximian.com>
4626
4627         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
4628
4629         * class.cs (ClassPart.SetParameterInfo): Override this.
4630         (PartialContainer.SetParameterInfo): Override this.
4631         (TypeContainer.CheckConstraints): New protected method.
4632         (PartialContainer.CheckConstraints): Override this and check
4633         whether the same contraints were specified in all parts of a
4634         partial generic type definition.
4635         (PartialContainer.UpdateConstraints): New public method.
4636
4637         * generic.cs (TypeParameter.UpdateConstraints): New public method.
4638
4639 2005-03-02  Martin Baulig  <martin@ximian.com>
4640
4641         Committing a patch from Carlos Alberto Cortez to fix #72887.
4642
4643         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
4644         casts from `T []' to `int []'.
4645
4646 2005-03-02  Martin Baulig  <martin@ximian.com>
4647
4648         * generic.cs (TypeManager.IsEqual): Make this symmetric.
4649
4650         * expression.cs (Binary.ResolveOperator): When resolving a
4651         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
4652         `=='.  Fixes #71866.  See gen-127.cs.
4653
4654 2005-03-02  Martin Baulig  <martin@ximian.com>
4655
4656         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4657         static constructor in static classes.
4658
4659 2005-03-02  Martin Baulig  <martin@ximian.com>
4660
4661         * generic.cs
4662         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
4663         (Nullable.LiftedConversion): Added support for user-defined
4664         conversions.
4665
4666         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
4667
4668         * cs-parser.jay: Use ComposedCast everywhere instead of
4669         NullableType, so we don't need to check for NullableType
4670         everywhere.
4671         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
4672         case where we'll be resolved into a `parenthesized_expression_0'
4673         afterwards.
4674
4675         * convert.cs
4676         (Convert.UserDefinedConversion): Added nullable conversions.
4677
4678 2005-02-28  Martin Baulig  <martin@ximian.com>
4679
4680         * generic.cs (TypeManager.IsNullableType): New static method.
4681         (Nullable): New abstract class.
4682         (Nullable.NullLiteral): New public class.
4683         (Nullable.LiftedConversion): New public class.
4684
4685         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
4686         `builtin_types opt_nullable'.
4687
4688         * convert.cs
4689         (Convert.ImplicitConversionStandard): Added nullable conversions.
4690         (Convert.ExplicitConversionStandard): Likewise.
4691         (Convert.ExplicitConversion): Likewise.
4692
4693 2005-02-26  Martin Baulig  <martin@ximian.com>
4694
4695         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
4696         begin with a "?", for instance "?[]".  Don't do a type lookup if
4697         `dim' is empty.
4698
4699 2005-02-25  Martin Baulig  <martin@ximian.com>
4700
4701         The first part of Nullable Types :-)
4702
4703         * generic.cs (NullableType): New public class.
4704         (NullCoalescingOperator): New public class.
4705         (TypeArguments.Resolve): Add a CS0306 check.
4706
4707         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
4708         (opt_nullable): New rule.
4709         (type): Added `opt_nullable' to `namespace_or_type_name',
4710         `builtin_types' and `pointer_type'.
4711         (array_type): Added `opt_nullable'.
4712         (opt_rank_specifier_or_nullable): New rule; this is the
4713         combination of `opt_rank_specifier' and `opt_nullable'.
4714         (opt_error): New rule; catch errors here.
4715         (nullable_type_or_conditional): New rule; we use this to check for
4716         nullable and still detect the conditional operator.
4717         (local_variable_type): Use `opt_rank_specifier_or_nullable'
4718         instead `opt_rank_specifier'.
4719
4720         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
4721         for nullables.
4722
4723 2005-02-24  Martin Baulig  <martin@ximian.com>
4724
4725         * README, README.Changes: Removed; they're old and obsolete.
4726
4727 2005-02-22  Martin Baulig  <martin@ximian.com>
4728
4729         * generic.cs (TypeParameter.Resolve): If resolving the constraints
4730         returned an error, set `constraints' to null to avoid a crash
4731         later on.
4732         (TypeParameter.ResolveType): Likewise.
4733
4734 2005-02-22  Martin Baulig  <martin@ximian.com>
4735
4736         * generic.cs
4737         (Constraints.ResolveTypes): Protect against being called twice.
4738         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
4739         (TypeParameter.ResolveType): New public method; calls
4740         constraints.ResolveTypes().
4741         (TypeParameter.DefineType): Moved constraints.ResolveType() out
4742         into the new ResolveType().
4743         (GenericMethod.Define): Call ResolveType() on all our
4744         TypeParameter's.        
4745
4746 2005-02-21  Martin Baulig  <martin@ximian.com>
4747
4748         * generic.cs
4749         (TypeManager.generic_nullable_type): New static public field.
4750         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
4751
4752         * rootcontext.cs
4753         (RootContext.ResolveCore): Resolve "System.Nullable`1".
4754
4755 2005-02-15  Martin Baulig  <martin@ximian.com>
4756
4757         * generic.cs (ConstructedType.Constraints): Correctly check
4758         constraints if the argument type is a type parameter; fixes
4759         #72326. 
4760
4761 2005-02-02  Martin Baulig  <martin@ximian.com>
4762
4763         * delegate.cs (Delegate.DefineType): Report an internal error if
4764         TypeManager.multicast_delegate_type is null.  See bug #72015 for
4765         details.        
4766
4767 2005-01-29  Miguel de Icaza  <miguel@novell.com>
4768
4769         * pending.cs: Produce better code (no nops produced by using Ldarg
4770         + value).
4771         
4772         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4773         i - 1' it should be arg + 1.
4774
4775         Fixes bug #71819.
4776         
4777 2005-01-26  Martin Baulig  <martin@ximian.com>
4778
4779         * cs-parser.jay (indexer_declarator): Don't report an error if we
4780         have type parameters since we can be an explicit interface
4781         implementation; fixes #71449.
4782
4783 2005-01-26  Martin Baulig  <martin@ximian.com>
4784
4785         * class.cs (TypeContainer.AttributeTargets): Return the correct
4786         AttributeTargets depending on our `Kind' instead of throwing an
4787         exception; fixes #71632.
4788
4789 2005-01-26  Martin Baulig  <martin@ximian.com>
4790
4791         * delegate.cs (Delegate.DefineType): Correctly define our type
4792         parameters.  Fixes #71483.
4793
4794 2005-01-25  Raja R Harinath  <rharinath@novell.com>
4795
4796         Fix #71602.
4797         * expression.cs (MemberAccess.DoResolve): Don't complain with
4798         cs0572 when the LHS of a member access has identical name and type
4799         name.
4800
4801 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
4802
4803         Fix #71651, #71675
4804         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
4805         CreatePermission.
4806         Create custom PermissionSet only for PermissionSetAttribute.
4807
4808 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
4809
4810         Fix #71649
4811         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
4812         delegates in static class.
4813
4814 2005-01-24  Martin Baulig  <martin@ximian.com>
4815
4816         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4817         merging an implicit block, just use its reachability.
4818
4819         * statement.cs (Block.Resolve): Make the unreachable code check
4820         work wrt. implicit blocks; see test-337 from #63842.
4821
4822 2005-01-21  Alp Toker  <alp@atoker.com>
4823  
4824         * cs-parser.jay: destructor_declaration's container is PartialContainer
4825         not Class when partial types are used, so use Kind prop instead of
4826         'is'.
4827         
4828 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
4829
4830         * cs-parser.jay: Improve error reporting when an interface
4831         declares new types.
4832
4833 2005-01-20  Dick Porter  <dick@ximian.com>
4834
4835         * support.cs: SeekableStreamReader fix from Sandor Dobos
4836         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
4837         chars are read.  Fixes bug 70369.
4838
4839 2005-01-20  Raja R Harinath  <rharinath@novell.com>
4840
4841         * cs-parser.jay (catch_clause): Simplify current_block handling
4842         somewhat.
4843
4844 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
4845
4846         * convert.cs (ImplicitStandardConversionExists): Synchronize the
4847         code with ImplicitStandardConversion to handle the implicit
4848         conversion of method groups into valid delegate invocations. 
4849
4850         The problem is that in parameter handling we were using this code
4851         path.  Fixes bug #64698
4852
4853 2005-01-19  Raja R Harinath  <rharinath@novell.com>
4854
4855         * cs-parser.jay: Fix several infelicities.
4856         - Avoid assigning to the parser value stack.  Code like 
4857           '$3 = null' is unclean.  Synthesize a value for the code block
4858           instead. 
4859         - Avoid using oob_stack for storing location information.  Use ...
4860         (_mark_): ... this.  New (empty) rule.  Saves the current location
4861         in $$.
4862         (foreach_statement): Avoid using oob_stack for current_block
4863         handling.  Use technique used in for_statement and
4864         using_statement.  Synthesize a value for the code block to store
4865         additional intermediate information.
4866
4867 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
4868
4869         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
4870         of a different type is only allowed to private fields of a
4871         containing type, not on fields of a base class.
4872
4873         See test-174.cs and error cs0122-9.cs
4874
4875 2005-01-13  Raja R Harinath  <rharinath@novell.com>
4876
4877         Fix test-335.cs (bug #58126).
4878         * cs-parser.jay (argument): Split out non-expression parts of the
4879         rule into 'non_simple_argument'.
4880         (invocation_expression): Support parenthesized invocations with
4881         multiple arguments, and with single non-simple arguments.
4882
4883 2005-01-13  Raja R Harinath  <rharinath@novell.com>
4884
4885         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
4886         places.
4887
4888 2005-01-12  Raja R Harinath  <rharinath@novell.com>
4889
4890         Fix cs0038-1.cs, cs1640-6.cs.
4891         * ecore.cs (Expression.Resolve): Remove special-case for
4892         SimpleName in error-handling.
4893         (Expression.almostMatchedMembers): Relax access permission to
4894         protected.
4895         (Expression.MemberLookupFailed): Handle duplicates in
4896         almostMatchedMembers list.
4897         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
4898         * expression.cs (New.DoResolve): Report CS1540 for more cases.
4899         * typemanager.cs (GetFullNameSignature): Use the MethodBase
4900         overload if the passed in MemberInfo is a MethodBase.
4901
4902 2005-01-25  Martin Baulig  <martin@ximian.com>
4903
4904         * doc.cs
4905         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
4906
4907 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
4908
4909         Fix #70749
4910         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
4911         for non-CAS & merge permission sets properly.
4912
4913 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4914
4915         Improve standard-compliance of simple name and member access 
4916         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
4917         * ecore.cs (FullNamedExpression): New abstract base class 
4918         for Namespaces and TypeExpressions.
4919         (ResolveFlags.SimpleName): Remove.
4920         (SimpleName): Remove support for dotted names.
4921         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
4922         DeclSpace.FindType and DeclSpace.LookupType.
4923         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
4924         (Expression.ExprClassName): Make member function.
4925         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
4926         a namespace.  Remove creation of dotted "SimpleName"s.
4927         (MemberAccess.DoResolve): Likewise.
4928         * decl.cs (DeclSpace.Cache): Make private.
4929         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
4930         (DeclSpace.FindType): Update.
4931         (DeclSpace.LookupType): Move here from RootContext.  Return a 
4932         FullNamedExpression.
4933         * namespace.cs (Namespace): Derive from FullNamedExpression
4934         so that it can be part of expression resolution.
4935         (Namespace.Lookup): Return an FullNamedExpression.
4936         (NamespaceEntry.LookupAlias): Lookup aliases only in current
4937         namespace.
4938         * rootcontext.cs (NamespaceLookup): Remove.
4939         (LookupType): Move to DeclSpace.
4940         * attribute.cs (CheckAttributeType): Update.
4941         * doc.cs (FindDocumentedType): Remove allowAlias argument.
4942         (FindDocumentedTypeNonArray): Likewise.
4943
4944 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4945
4946         Fix cs0509.cs, cs1632.cs.
4947         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
4948         is the same as IsInterface.
4949         (TypeContainer.GetClassBases): Likewise.
4950         * statement.cs (LabeledStatement.ig): New field.
4951         (LabeledStatement.LabelTarget): Save ILGenerator which created the
4952         label.
4953         (LabeledStatement.DoEmit): Check that the label was created with
4954         the same ILGenerator.
4955
4956 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4957
4958         Fix #71058
4959         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
4960         accessors to its properties.
4961
4962         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
4963         from accessors to property.
4964         
4965 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4966
4967         Fix #70722
4968         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
4969         only for overrides.
4970         
4971 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
4972
4973         * attribute.cs: Check for null and empty strings.  
4974
4975         I have lost another battle to Paolo.
4976
4977 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
4978
4979         Fix #70942
4980         * class.cs (PropertyMethod): Set Parent field in ctors.
4981         (SetMethod.InternalParameters): Add unsafe switch hack.
4982         Override MarkForDuplicationCheck where it is appropriate.
4983
4984         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
4985         It says whether container allows members with the same name.
4986         Base default is no.
4987         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
4988         Removed is_method parameter.
4989
4990 2005-01-06  Duncan Mak  <duncan@ximian.com>
4991
4992         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
4993         because the previous change led to incorrect reporting of CS1032
4994         ("Cannot define/undefine preprocessor symbols after first token in
4995         file"). Instead of using `tokens_seen' as the only flag that
4996         triggers CS1040, introduce `comments_seen'. This new flag is used
4997         to signify having seen comments on the current line, so it is
4998         unset after a newline.
4999
5000 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5001
5002         * doc.cs : When searching for a type, find nested type too.
5003           This fixes bug #71040.
5004
5005 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5006
5007         * doc.cs :
5008           - Warn missing member comment on those classes which also does not
5009             have doc comments. Fixed bug #71041.
5010           - Don't warn missing doc comment on default constructor.
5011             Fixed bug #71042.
5012
5013 2005-01-06  Duncan Mak  <duncan@ximian.com>
5014
5015         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5016         comments, set `tokens_seen' to true. This allows us to detect
5017         misplaced preprocessor directives (i.e. not at the beginning of
5018         the a line, nor after whitespaces). In that case, report error
5019         CS1040. This fixes bug #56460.
5020
5021         * cs-parser.jay (interface_member_declaration): Add checks for
5022         IsExplicitImpl, and report CS0541 error if an interface member is
5023         defined as an explicit interface declaration.
5024
5025 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5026
5027         Fix #70817
5028         * class.cs (PropertyMethod): Set Parent field in ctors.
5029         (SetMethod.InternalParameters): Add unsafe switch hack.
5030         
5031         * decl.cs (MemberCore.Parent): Cannot be readonly.
5032
5033 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5034
5035         * decl.cs (DeclSpace.ResolveType): Remove.
5036         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5037         Merge in code from ...
5038         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5039         * class.cs, enum.cs: Update to changes.
5040
5041 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5042
5043         * anonymous.cs: Ensure that we init the scope of our parent if it
5044         has not been initialized yet.
5045
5046 2004-12-30  Duncan Mak  <duncan@ximian.com>
5047
5048         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5049         if field.FieldBuilder is null. Fixes #70758.
5050
5051         * convert.cs: Fixed some typos and updated some of the comments.
5052         (ImplicitStandardConversionExists):
5053         (TryImplicitIntConversion): If `target_type' is an interface and
5054         the type of `ic' implements this interface, return true or a new
5055         BoxedCast instead of null. This fixes #70468.
5056
5057 2004-12-29  Duncan Mak  <duncan@ximian.com>
5058
5059         * expression.cs (Argument.Emit): Check that Expr is
5060         IMemoryLocation before casting to it, and report CS1510 otherwise.
5061
5062         This fixes #70402.
5063
5064 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5065
5066         * statement.cs (Block.ThisVariable): remove the recursion here, to
5067         make the --profile more sane.
5068
5069 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5070
5071         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5072         assembly, by JB Evain.
5073
5074 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5075
5076         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5077           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5078         "parent" refers to enclosing type/class.  "base" refers to superclass.
5079
5080 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5081
5082         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5083         Ensure that we only have GlobalAttributes.
5084         * attribute.cs (Attribute.Emit): Make non-virtual.
5085         (GlobalAttribute.Emit): Remove.
5086         (Attribute.Resolve): Make virtual.
5087         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5088         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5089         the argument. Don't create one.
5090         (Attribute.GetObsoleteAttribute): Likewise.
5091         (Attribute.GetClsCompliantAttributeValue): Likewise.
5092         * class.cs, decl.cs: Update to changes.
5093
5094 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5095
5096         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5097         
5098         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5099         
5100         * statement.cs (Foreach.Resolve): Add error 186 report.
5101
5102 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5103
5104         * expression.cs (Conditional.DoResolve): Add warning 429.
5105         
5106         * statement.cs (If.Resolve): Add warning 665.
5107
5108 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5109
5110         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5111         except when in the parser, and in GlobalAttribute.
5112         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5113         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5114         RootContext.Tree.Types.NamespaceEntry once work is done.
5115         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5116         and resets RootContext.Tree.Types.NamespaceEntry.
5117
5118 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5119
5120         * cs-parser.jay: Don't create a block for every variable.
5121
5122 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5123
5124         * location.cs: Provide extra information.
5125
5126         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5127         variables from the captured environment, it is the ldarg_0.
5128
5129 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5130
5131         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5132         find a conclusion.
5133         
5134         * class.cs: Changed warning level for 169 to avoid developer
5135         displeasure from warning flooding. It will be changed back when they
5136         fix most of current BCL warnings.
5137         
5138         * RootContext.cs: Pushed default WarningLevel to 3.
5139         
5140         * statement.cs: Removed unused variable.
5141
5142 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5143
5144         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5145         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5146         Add error 502 report.
5147         (StaticClass.DefineType): Add error 441 report.
5148         (Class.AllowedModifiersProp): New virtual property as temporary
5149         extension to AllowedModifiers.
5150         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5151         to share implementation with StaticClass and don't call virtual
5152         methods from ctor.
5153         
5154         * driver.cs (MainDriver): Add error 1558 test.
5155
5156         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5157         report. Moved error 36 test here.
5158
5159         * statement.cs (Throw.Resolve): Add error 724 report.
5160
5161         * typemanager.cs: Add out_attribute_type core type.
5162         
5163 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5164
5165         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5166         3018 report.
5167         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5168
5169         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5170         3017 report.
5171         
5172         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5173
5174         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5175         Add error 3023 report.
5176         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5177
5178         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5179         implementation.
5180
5181 2004-12-12  John Luke  <john.luke@gmail.com>
5182
5183         * driver.cs (AddArgs): take -- into account when
5184         adding arguments, fixes bug 65710 
5185
5186 2004-12-12  Martin Baulig  <martin@ximian.com>
5187
5188         * expression.cs (Unary.TryReduceNegative): Added support for
5189         SByteConstant and ByteConstant.
5190         (Unary.Reduce): Check error values from TryReduceNegative().
5191
5192 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5193
5194         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5195         and report exception as error 182.
5196
5197 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5198
5199         * driver.cs (Main): Fix message when there are warnings.
5200
5201 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5202
5203         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5204
5205 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5206
5207         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5208         Reduced number of warnings.
5209         
5210         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5211
5212 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5213
5214         * driver.cs: Removed message.
5215
5216         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5217
5218 2004-12-08    <vargaz@freemail.hu>
5219
5220         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5221
5222 2004-12-08  Martin Baulig  <martin@ximian.com>
5223
5224         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5225         instead of a CS3002 for properties and indexer.
5226
5227 2004-12-08  Martin Baulig  <martin@ximian.com>
5228
5229         * decl.cs (MemberName.ToString): Make this work again.
5230
5231 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5232
5233         * attribute.cs (Resolve): Add error 591 detection.
5234
5235         * class.cs (FieldMember.Define): Add error 1547 detection.
5236         (Indexer.Define): Add error 620 detection.
5237         (Operator.Define): Add error 590 detection.
5238
5239         * ecore.cs: Missing argument for error 79.
5240
5241         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5242         detection.
5243
5244 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5245
5246         Fix #70106
5247         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5248         only.
5249
5250 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5251
5252         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5253           Some operator comments were suppressed.
5254         * doc.cs : Implicit/explicit operator name in doc comments are like
5255           "op_Explicit(type)~returnType", so added suffix handling.
5256
5257 2005-01-21  Alp Toker  <alp@atoker.com>
5258
5259         * cs-parser.jay: destructor_declaration's container is PartialContainer
5260         not Class when partial types are used, so use Kind prop instead of 'is'.
5261
5262 2004-12-12  Martin Baulig  <martin@ximian.com>
5263
5264         * expression.cs (Unary.TryReduceNegative): Added support for
5265         SByteConstant and ByteConstant.
5266         (Unary.Reduce): Check error values from TryReduceNegative().
5267
5268 2004-12-11  Martin Baulig  <martin@ximian.com>
5269
5270         * support.cs (ReflectionParameters.ParameterName): If we have a
5271         `gpd', call `ParameterName' on it.
5272
5273         * parameter.cs (Parameter.GetParameterAttributes): New static method.
5274
5275         * pending.cs (PendingImplementation.DefineProxy): Call
5276         DefineParameter() for all of the MethodBuilder's arguments.
5277
5278 2004-12-09  Martin Baulig  <martin@ximian.com>
5279
5280         * doc.cs (DocUtil): Make this a static class.
5281
5282 2004-12-09  Martin Baulig  <martin@ximian.com>
5283
5284         * expression.cs (Invocation.InferType): Moved the type inference
5285         implementation into TypeManager.
5286
5287         * generics.cs (TypeManager): Moved the type inference
5288         implementation here.
5289
5290 2004-12-09  Martin Baulig  <martin@ximian.com>
5291
5292         * typemanager.cs (TypeManager): Make this a partial class.
5293
5294         * generics.cs
5295         (TypeManager): Move the generics part of `TypeManager' here.
5296
5297 2004-12-08  Martin Baulig  <martin@ximian.com>
5298
5299         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5300         instead of a CS3002 for properties and indexer.  Added CS3024
5301         check for generic interfaces.
5302
5303         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5304         instances are not CLS-compliant.
5305
5306 2004-12-08  Martin Baulig  <martin@ximian.com>
5307
5308         * cs-parser.jay
5309         (void_pointer_expression): New rule for `void*', `void**' etc.
5310         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
5311
5312 2004-12-08  Martin Baulig  <martin@ximian.com>
5313
5314         * expression.cs (Invocation.InferType): Removed the hack for
5315         MethodCore.MayUnify().  
5316
5317         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5318         this actually work.
5319
5320         * class.cs (MethodCore.MayUnify): Use
5321         TypeManager.MayBecomeEqualGenericTypes().       
5322
5323 2004-12-08  Martin Baulig  <martin@ximian.com>
5324
5325         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
5326         parameter, box it.  Fixes #69233.
5327
5328 2004-12-08  Martin Baulig  <martin@ximian.com>
5329
5330         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
5331         have the ctor constraint.  Fixes #68326.
5332
5333 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5334
5335         * cs-parser.jay : interface comment was not consumed because of
5336           extra opt_semicolon before doc handling.
5337
5338 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5339
5340         Fix test-327.cs, test-328.cs, and put in early infrastructure
5341         for eventually fixing #52697.
5342         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5343         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5344         from other methods.
5345         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5346         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5347         (VerifyUsing, error246): Update.
5348         * rootcontext.cs (RootContext.NamespaceLookup): Just use
5349         'NamespaceEntry.LookupNamespaceOrType'.
5350
5351 2004-12-07  Martin Baulig  <martin@ximian.com>
5352
5353         * driver.cs: Call it "BETA SOFTWARE" :-)
5354
5355 2004-12-06  Raja R Harinath  <rharinath@novell.com>
5356
5357         Fix crash on cs0657-17.cs.
5358         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5359         Use RootContext.Tree.Types, not 'new RootTypes ()'.
5360         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5361         the case where the NamespaceEntry gets overwritten.
5362
5363 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
5364
5365         Fixed #69195, #56821
5366         * ecore.cs (ResolveBoolean): Tiny refactoring.
5367
5368         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5369         of right expression resolving when left is false constant and
5370         operator is LogicalAnd OR true constant and operator is LogicalOr.
5371
5372         * statement.cs (ResolveUnreachable): Always reports warning.
5373
5374 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
5375
5376         * class.cs: Distinguish between 1721 and 1722 (just a little help
5377         for the programmer).
5378
5379 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
5380
5381         * delegate.cs: Only allow this on new versions of the language. 
5382
5383 2004-12-02  Duncan Mak  <duncan@ximian.com>
5384
5385         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5386         Expression class.
5387         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5388         here as a static method. Take an additional bool out parameter
5389         `must_do_cs1540_check' for signaling to InstanceResolve.
5390         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5391         member field from PropertyExpr class and made it an argument of
5392         the method instead.
5393         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5394         check for MarshalByRefObject, and report CS0122 instead of CS1540.
5395         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5396         and `remove_accessor' as well as InstanceResolve: report CS0122
5397         where applicable.
5398
5399         Fixes #70129.
5400
5401 2004-12-07  Martin Baulig  <martin@ximian.com>
5402
5403         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
5404         and CS0692 where appropriate.
5405
5406 2004-12-06  Martin Baulig  <martin@ximian.com>
5407
5408         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
5409         IsDuplicateImplementation() and improved it.
5410
5411         * expression.cs (Invocation.InferTypeArguments): Added
5412         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
5413         and removed the "ref" modifier from `infered_types'.
5414
5415         * decl.cs (MemberName.ToString): Removed the exception.
5416
5417 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
5418
5419         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5420           comments are allowed.
5421
5422 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5423
5424         * delegate.cs: Add checks for subtypes in paramaters and return values
5425         in VerifyMethod () to add support for Covariance/Contravariance
5426         in delegates.
5427         
5428 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
5429
5430         * report.cs: Remove extra closing parenthesis.
5431
5432         * convert.cs (Error_CannotImplicitConversion): If the name of the
5433         types are the same, provide some extra information.
5434
5435 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
5436
5437         Fix bug #70102
5438         * attribute.cs (Resolve): Improved implementation of params
5439         attribute arguments.
5440
5441         * support.cs (ParameterData): Add HasParams to be faster.
5442
5443 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
5444
5445         all things are for /doc support:
5446
5447         * doc.cs: new file that supports XML documentation generation.
5448         * mcs.exe.sources: added doc.cs.
5449         * driver.cs:
5450           Handle /doc command line option.
5451           Report error 2006 instead of 5 for missing file name for /doc.
5452           Generate XML documentation when required, after type resolution.
5453         * cs-tokenizer.cs:
5454           Added support for picking up documentation (/// and /** ... */),
5455           including a new XmlCommentState enumeration.
5456         * cs-parser.jay:
5457           Added lines to fill Documentation element for field, constant,
5458           property, indexer, method, constructor, destructor, operator, event
5459           and class, struct, interface, delegate, enum.
5460           Added lines to warn incorrect comment.
5461         * rootcontext.cs :
5462           Added Documentation field (passed only when /doc was specified).
5463         * decl.cs:
5464           Added DocComment, DocCommentHeader, GenerateDocComment() and
5465           OnGenerateDocComment() and some supporting private members for
5466           /doc feature to MemberCore.
5467         * class.cs:
5468           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5469         * delegate.cs:
5470           Added overriden DocCommentHeader.
5471         * enum.cs:
5472           Added overriden DocCommentHeader and GenerateDocComment().
5473
5474 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
5475
5476         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5477         unwrapping the enumeration values, chain to
5478         DoConstantNumericPromotions again, so we can promote things to the
5479         fundamental types (takes care of enums that are bytes, sbytes).
5480
5481         Fixes bug #62054.
5482
5483 2004-12-01  Raja R Harinath  <rharinath@novell.com>
5484
5485         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5486         Fix long-standing bug in type-lookup.  Use FindType instead of
5487         LookupType when ec.ResolvingTypeTree.
5488         (Attribute.ResolveType, Attribute.Resolve)
5489         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5490         Update to changes.
5491         (Attributes.Search): Remove internal version.  Update.
5492         (Attributes.SearchMulti): Update.
5493         (Attributes.GetClsCompliantAttribute): Remove.
5494         (Attributes.GetIndexerNameAttribute): Remove.
5495         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5496         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5497         * class.cs (Indexer.Define): Likewise.
5498
5499 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
5500
5501         Fix bug #68790
5502         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5503         MarshallByReference members access.
5504
5505         * expression.cs: Use CheckMarshallByRefAccess;
5506         Better error CS0197 message.
5507
5508         * report.cs: Print whole related error message.
5509
5510 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5511
5512         * class (GetClassBases): Better error 60 report.
5513         (EventProperty): Disabled warning 67 detection.
5514
5515 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5516
5517         Fix bug #60324
5518         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5519
5520         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5521         precise values.
5522
5523 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5524
5525         Fix bug #49488
5526         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5527
5528         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5529
5530 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
5531
5532         * attribute.cs (Attribute.Resolve): Refine error reporting and
5533         report a cs0117 if the identifier does not exist, to distinguish
5534         from 0617 which is a miss-use of the actual identifier.
5535
5536         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5537         between cs0070 and cs0079.
5538
5539         * class.cs (MemberBase.DoDefine): When reporting a wrong
5540         accessibility level, we use MethodCore to compare instead of
5541         Method (this was a regression in some refactoring effort).
5542
5543         So now we correctly report cs0056 again.
5544
5545         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5546         testing the target_type (which was known to be object_type) and
5547         not the source type (which is anonymous_method).
5548
5549         Fixed reporting of error cs1660.
5550
5551         * expression.cs (UserCast.Source): Expose the underlying cast.
5552
5553         * statement.cs (Switch.SwitchGoverningType): Sort the list of
5554         allowed types to find a match to int32 first (most common).
5555
5556         In addition, it ignores any ImplicitUserConversions that did an
5557         internal implicit conversion (as the switch statement allows only
5558         one integral conversion to exist).
5559
5560         * class.cs (PartialContainer.Create): rename `name' to
5561         `member_name' for clarity.  Then replace the string calls with a
5562         call to MemberName.GetPartialName, as now using
5563         MemberName.ToString is an error (this is due to the side effects
5564         it had, that were fixed in the past).
5565
5566         This will restore the error reporting on a number of partial class
5567         errors that were missusing this (and getting an exception as a
5568         results, which is now just a plain textual warning, because
5569         yyparse debug output would crash otherwise).
5570
5571 2004-11-26  Raja R Harinath  <rharinath@novell.com>
5572
5573         * Makefile (PROGRAM_INSTALL_DIR): Remove.
5574
5575 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5576
5577         * rootcontext.cs (LookupType): Make sure to cache lookups that
5578         don't give us a negative result. This saves about 5% of corlib
5579         compilation time.
5580
5581 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5582
5583         * report.cs (AbstractMessage.Print): messages are sent to stderr
5584
5585         * class.cs (TypeContainer.GetClassBases): It is an error to have a
5586         non-interface in the list of interfaces (at this point, either
5587         parent was properly set, or a base class is being listed in the
5588         interfaces section).
5589
5590         This flags error 1722, and resolves the crash from bug 69259.
5591
5592 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5593
5594         * statement.cs (Using.EmitExpressionFinally): make this work right
5595         for valuetypes. Fixes 69926.
5596
5597 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5598
5599         * const.cs (Const.ChangeType): Cope with the "0 literal can be
5600         converted to an enum" here, before we try to change the underlying
5601         type.  This code exists, but it is a different code path than the
5602         one used while encoding constants.
5603
5604         (ImplicitReferenceConversionExists): In addition, resynchronized
5605         the code here, so it matches the same code in
5606         ImplicitReferenceConversionExists for the `from any class-type S
5607         to any interface-type T'.       
5608
5609 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
5610
5611         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5612
5613 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
5614
5615         * cs-parser.jay: Use verbosity accordingly. 
5616
5617 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5618
5619         * expression.cs (Unary.ResolveOperator): Do not report warning;
5620         AddressOf reads from variable.
5621         
5622         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5623
5624 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5625
5626         Fix bug #69462
5627
5628         * attribute.cs (Attributable): Removed CheckTargets.
5629         (Attributes.Emit): Explicit attribute targets are tested here.
5630
5631         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
5632         not enabled for interfaces.
5633
5634         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
5635         (GetAssemblyName): Ouch next bug there.
5636
5637 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5638
5639         * expression.cs: Error 275 added.
5640         
5641 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
5642
5643         Fix bug #69177 (Implemented decimal constant support)
5644
5645         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
5646         (BinaryFold): Add DecimalConstant.
5647
5648         * const.cs (Define): Decimal constant 
5649         (is not constant.
5650         (ChangeType): Add decimal type handling.
5651         (LookupConstantValue): Don't set value for decimal type but
5652         emit DecimalConstantAttribute. Needed for constant optimization.
5653
5654         * constant.cs (ToDecimal): New method.
5655         (ConvertToDecimal): New method.
5656         (IntConstant): Implemented ConvertToDecimal.
5657         (DecimalConstant.Emit): Emit optimized version for decimals in
5658         int range.
5659
5660         * expression.cs (ResolveOperator): Changed order of constant
5661         reduction to work correctly with native types which have
5662         overloaded operators.
5663         (ResolveMemberAccess): Extract constant value from attribute
5664         for decimal type.
5665
5666         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
5667
5668         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
5669         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
5670         (ChangeType): Decimal is special.
5671         (TypeToCoreType): Add decimal type.
5672
5673 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
5674
5675         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
5676         decimal types.
5677
5678 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
5679
5680         * class.cs (EventField.ApplyAttributeBuilder): Fix error
5681         test cs1667-5.cs.
5682
5683 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
5684
5685         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
5686
5687         * pending.cs (PendingImplementation): Grab only interfaces.
5688
5689 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
5690
5691         * statement.cs (ForeachHelperMethods): Add location member and
5692         error 202 detection.
5693
5694 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
5695
5696         * expression.cs (DoResolveBase): Fixed wrong warning for out
5697         variables.
5698
5699 2004-12-04  Martin Baulig  <martin@ximian.com>
5700
5701         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
5702         to check whether the conversion is ok.
5703
5704         * typemanager.cs (TypeManager.GetTypeArguments): Just return
5705         `Type.EmptyTypes' if we're not a generic TypeContainer.
5706
5707 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5708
5709         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
5710         old bug: when converting from the null literal to a pointer,
5711         return an EmptyCast, not the NullLiteral.
5712
5713         This fixes #69921, the recent null_type changes probably made this
5714         bug more prominent.
5715
5716 2004-12-03  Martin Baulig  <martin@ximian.com>
5717
5718         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5719         method as our child, call AnonymousMethod.Compatible() on it.
5720
5721 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
5722
5723         * class.cs (FieldBase): Use an unused bit field from the field to
5724         encode the `has_offset' property from the FieldMember.  This saves
5725         a couple of Ks on bootstrap compilation.
5726
5727         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5728         method as our child, return the AnonymousMethod resolved
5729         expression.
5730
5731         * expression.cs (New.DoResolve): Allow return values from
5732         NewDelegate to also include AnonymousMethods.
5733
5734         Fixes #70150.
5735
5736 2004-11-29  Raja R Harinath  <rharinath@novell.com>
5737
5738         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
5739         cs1648 report.
5740         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
5741         System.Runtime.InteropServices._Exception, since it's a base
5742         interface of the core type System.Exception in the net_2_0 profile.
5743
5744 2004-11-27  Martin Baulig  <martin@ximian.com>
5745
5746         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
5747
5748 2004-11-26  Raja R Harinath  <rharinath@novell.com>
5749
5750         * Makefile: Convert to use executable.make.
5751         * gmcs.exe.sources: New.
5752
5753 2004-11-25  Martin Baulig  <martin@ximian.com>
5754
5755         * expression.cs (Invocation.InferType): Added support for byref types.
5756
5757 2004-11-25  Martin Baulig  <martin@ximian.com>
5758
5759         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
5760         in TypeManager.TypeToCoreType().
5761
5762 2004-11-25  Martin Baulig  <martin@ximian.com>
5763
5764         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
5765         "Dispose" method from the `current_type'.
5766         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
5767         DoDefineMembers() instead of using the MethodBuilder; this is
5768         required for generic iterators.
5769
5770         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
5771
5772 2004-11-24  Martin Baulig  <martin@ximian.com>
5773
5774         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
5775
5776 2004-11-20  Martin Baulig  <martin@ximian.com>
5777
5778         * expression.cs (Invocation.InferType): Correctly infer generic
5779         instances; see gen-103.cs.
5780         (Invocation.InferTypeArguments): If a generic method doesn't have
5781         any unbound type parameters, we don't need to infer anything.
5782
5783 2004-11-19  Raja R Harinath  <rharinath@novell.com>
5784
5785         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
5786
5787 2004-11-17  Raja R Harinath  <rharinath@novell.com>
5788
5789         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
5790         (TypeHandle.GetMemberCache): New.
5791         (TypeHandle.TypeHandle): Update.
5792         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
5793         (TypeManager.LookupParentInterfacesCache):
5794         Rename from LookupInterfaceCache.  Optimize slightly.
5795         (TypeManager.MemberLookup_FindMembers): Update.
5796         * decl.cs (MemberCache.MemberCache): Set Container to null in the
5797         multi-type variant.
5798         (AddCacheContents): Rename from AddHashtable.
5799         * class.cs (TypeContainer.parent_container): Remove.
5800         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
5801         (TypeContainer.DoDefineMembers): Don't initialize it.
5802         Update to name changes.
5803         
5804 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
5805
5806         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
5807         that factors the code to check access modifiers on override.  
5808
5809         (PropertyBase): Use the code here.
5810
5811         Patch from Lluis S'anchez, fixes bug #69361.
5812
5813 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
5814
5815         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
5816         routine that is used to report the use of a captured variable
5817         whose address has been taken.
5818
5819         There are two checks: one when variables are being captured and
5820         the other check is when the address of a variable is taken. 
5821         
5822         (because an anonymous methods might be resolved before *or* after
5823         the address has been taken) and 
5824
5825         * expression.cs (Conditional.DoResolve): Remove the special
5826         casing that Martin added to trueExpr and falseExpr being both
5827         NullLiteral.  We get the right behavior now just by introducing
5828         the null_type into the compiler. 
5829
5830         * convert.cs (ExplicitConversion): Change the code to use
5831         null_type instead of testing `expr is NullLiteral'.
5832         (ImplicitConversionStandard): use null_type too.
5833         (ImplicitReferenceConversionExists): use null_type too.
5834         (ImplicitReferenceConversion): use null_type too.
5835
5836         * literal.cs: The type of `NullLiteral' is now null_type instead
5837         of object_type. 
5838         (Resolve): Set the type here.
5839
5840         * typemanager.cs: Introduce null_type.
5841
5842 2004-11-18  Martin Baulig  <martin@ximian.com>
5843
5844         * rootcontext.cs
5845         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
5846
5847 2004-11-18  Martin Baulig  <martin@ximian.com>
5848
5849         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
5850
5851 2004-11-18  Martin Baulig  <martin@ximian.com>
5852
5853         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
5854         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
5855         call ResolveConstructedType() on it to resolve it without checking
5856         constraints.
5857         (Constraints.ResolveTypes): Check them here.
5858         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
5859         but don't check constraints.
5860         (ConstructedType.ResolveAsTypeTerminal): Override this and also
5861         check constraints here.
5862         (ConstructedType.ResolveConstructedType): New public method.  This
5863         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
5864         resolve ourselves without checking constraints.
5865
5866         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
5867
5868 2004-11-18  Martin Baulig  <martin@ximian.com>
5869
5870         * decl.cs
5871         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
5872
5873         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
5874
5875 2004-11-18  Martin Baulig  <martin@ximian.com>
5876
5877         * ecore.cs (TypeExpr.ResolveType): Removed.
5878         (Expression.ResolveAsTypeTerminal): We always return a fully
5879         resolved `TypeExpr', so we can just access its `Type'.
5880
5881         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
5882
5883 2004-11-17  Martin Baulig  <martin@ximian.com>
5884
5885         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
5886         sure we don't return any unresolved TypeExpr's.
5887         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
5888         a `TypeExpr'.
5889         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
5890
5891         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
5892         unresolved `ConstructedType's.
5893
5894 2004-11-17  Martin Baulig  <martin@ximian.com>
5895
5896         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
5897
5898 2004-11-17  Martin Baulig  <martin@ximian.com>
5899
5900         * ecore.cs
5901         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
5902
5903         * decl.cs (DeclSpace.ResolveType): Removed.
5904         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
5905
5906 2004-11-17  Martin Baulig  <martin@ximian.com>
5907
5908         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
5909         direction, like FindMembers() does.  Fixes #69546, testcase is in
5910         test-315.cs.    
5911
5912 2004-11-16  Martin Baulig  <martin@ximian.com>
5913
5914         This is based on a patch from Marek Safar, see bug #69082.
5915         Fixes bugs #63705 and #67130.
5916
5917         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
5918         method; create a MemberCache for an interface type and cache the
5919         result.
5920
5921         * decl.cs (IMemberContainer.ParentContainer): Removed.
5922         (IMemberContainer.ParentCache): New property.
5923         (MemberCache.SetupCacheForInterface): Removed.
5924         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
5925         to create a cache for an interface's "parent".
5926
5927         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
5928         interfaces too.
5929
5930 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
5931
5932         * statement.cs: Avoid adding bools to a hashtable.
5933
5934 2004-11-15  Martin Baulig  <martin@ximian.com>
5935
5936         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
5937
5938 2004-11-11  Martin Baulig  <martin@ximian.com>
5939
5940         * typemanager.cs (TypeManager.GetMethodName): New method.
5941
5942         * class.cs (MethodData.Define): Include the generic arity in the
5943         name of an explicit interface; also add it to the method name.
5944
5945         * pending.cs (PendingImplementation.InterfaceMethod): The method
5946         name now includes the generic arity.
5947
5948 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
5949
5950         * expression.cs (Invocation.OverloadResolve): Flag error if we are
5951         calling an unsafe method from a safe location.
5952
5953 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
5954
5955         Fix #69167
5956         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
5957
5958 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
5959
5960         * namespace.cs (VerifyUsing): use GetPartialName instead of
5961         ToString. 
5962
5963 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
5964
5965         * statement.cs (Return.Resolve): Fix regression in typo: if
5966         `in_exc', we have to request a NeedReturnLabel, this was a typo
5967         introduced in the anonymous method check-in.  Fixes #69131.
5968
5969         * Indexers were using the ShortName when defining themselves,
5970         causing a regression in the compiler bootstrap when applying the
5971         patch from 2004-11-02 (first part), now they use their full name
5972         and the bug is gone.
5973
5974 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
5975
5976         * driver.cs: Strip the path from the names of embedded resources. Fixes
5977         #68519.
5978
5979 2004-11-04  Raja R Harinath  <rharinath@novell.com>
5980
5981         Fix error message regression: cs0104-2.cs.
5982         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
5983         (AliasEntry.Resolve): Update.
5984         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
5985         'silent' flag.
5986         (RootContext.LookupType): Update.
5987
5988 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
5989
5990         * cs-parser.jay: Add support for handling accessor modifiers
5991         * class: Add support port accessor modifiers and error checking,
5992         define PropertyMethod.Define as virtual (not abstract anymore)
5993         * ecore.cs: Add checking for proeprties access with access modifiers
5994         * iterators.cs: Modify Accessor constructor call based in the modified
5995         constructor
5996 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
5997
5998         * expression.cs (StringConcat): Handle being called twice,
5999         as when we have a concat in a field init with more than two
6000         ctors in the class
6001
6002 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6003
6004         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6005         special case explicit implementations, we should always produce
6006         the .property or .event declaration.
6007         
6008         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6009         since it will not return correct data if people use this
6010         unresolved in the presence of using statements (see test-313).
6011
6012         * class.cs (MethodData.Define): If we are an explicit interface
6013         implementation, set the method name to the full name of the
6014         interface plus the name of the method.  
6015
6016         Notice that using the method.MethodName.GetFullName() does not
6017         work, as it will only contain the name as declared on the source
6018         file (it can be a shorthand in the presence of using statements)
6019         and not the fully qualifed type name, for example:
6020
6021         using System;
6022
6023         class D : ICloneable {
6024                 object ICloneable.Clone ()  {
6025                 }
6026         }
6027
6028         Would produce a method called `ICloneable.Clone' instead of
6029         `System.ICloneable.Clone'.
6030
6031         * namespace.cs (Alias.Resolve): Use GetPartialName.
6032         
6033 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6034
6035         * cs-parser.jay: Add error 1055 report.
6036
6037 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6038
6039         * assign.cs (Assign.DoResolve): Only do the transform of
6040         assignment into a New if the types are compatible, if not, fall
6041         through and let the implicit code deal with the errors and with
6042         the necessary conversions. 
6043
6044 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6045
6046         * cs-parser.jay: Add error 1031 report.
6047
6048         * cs-tokenizer.cs: Add location for error 1038.
6049
6050 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6051
6052         * cs-parser.jay: Add error 1016 report.
6053
6054 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6055
6056         * cs-parser.jay: Add errors 1575,1611 report.
6057
6058 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6059
6060         * cs-parser.jay: Add error 1001 report.
6061
6062 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6063
6064         Fix #68850
6065         * attribute.cs (GetMarshal): Add method argument for
6066         caller identification.
6067
6068         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6069         agument for GetMarshal and RuntimeMissingSupport.
6070
6071 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6072
6073         * attribute.cs (ExtractSecurityPermissionSet): Removed
6074         TypeManager.code_access_permission_type.
6075
6076         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6077
6078 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6079
6080         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6081         for obsolete use of a variable here.   Fixes regression on errors
6082         cs0619-25 and cs0619-26.
6083
6084 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6085
6086         Fix #62358, implemented security attribute encoding.
6087
6088         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6089         Tests permitted SecurityAction for assembly or other types.
6090         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6091         data from SecurityPermissionAttribute to PermisionSet class.
6092
6093         * class.cs (ApplyAttributeBuilder): Added special handling
6094         for System.Security.Permissions.SecurityAttribute based types.
6095
6096         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6097         special handling for System.Security.Permissions.SecurityAttribute
6098         based types.
6099
6100         * enum.cs (ApplyAttributeBuilder): Added special handling
6101         for System.Security.Permissions.SecurityAttribute based types.
6102
6103         * parameter.cs (ApplyAttributeBuilder): Added special handling
6104         for System.Security.Permissions.SecurityAttribute based types.
6105
6106         * rootcontext.cs: Next 2 core types.
6107
6108         * typemanager.cs (TypeManager.security_permission_attr_type):
6109         Built in type for the SecurityPermission Attribute.
6110         (code_access_permission_type): Build in type.
6111
6112 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6113
6114         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6115         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6116         all of this information into
6117         EmitContext.EmitCapturedVariableInstance.
6118         
6119         * codegen.cs (EmitCapturedVariableInstance): move here the
6120         funcionality of emitting an ldarg.0 in the presence of a
6121         remapping.   This centralizes the instance emit code.
6122
6123         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6124         then emit a load of this: it means that we have reached the
6125         topmost ScopeInfo: the one that contains the pointer to the
6126         instance of the class hosting the anonymous method.
6127
6128         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6129         captures to the topmost CaptureContext.
6130
6131 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6132
6133         * expression.cs (LocalVariableReference): Move the knowledge about
6134         the iterators into codegen's EmitCapturedVariableInstance.
6135
6136 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6137
6138         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6139         all code paths return a value from an anonymous method (it is the
6140         same as the 161 error, but for anonymous methods).
6141
6142 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6143
6144         The introduction of anonymous methods in the compiler changed
6145         various ways of doing things in the compiler.  The most
6146         significant one is the hard split between the resolution phase
6147         and the emission phases of the compiler.
6148
6149         For instance, routines that referenced local variables no
6150         longer can safely create temporary variables during the
6151         resolution phase: they must do so from the emission phase,
6152         since the variable might have been "captured", hence access to
6153         it can not be done with the local-variable operations from the runtime.
6154         
6155         * statement.cs 
6156
6157         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6158         is a toplevel block.
6159
6160         (ToplevelBlock): A new kind of Block, these are the blocks that
6161         are created by the parser for all toplevel method bodies.  These
6162         include methods, accessors and anonymous methods.
6163
6164         These contain some extra information not found in regular blocks:
6165         A pointer to an optional CaptureContext (for tracking captured
6166         local variables and parameters).  A pointer to the parent
6167         ToplevelBlock.
6168         
6169         (Return.Resolve): Catch missmatches when returning a value from an
6170         anonymous method (error 1662).
6171         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6172         phase.
6173
6174         (Break.Resolve): ditto.
6175
6176         (SwitchLabel): instead of defining the labels during the
6177         resolution phase, we now turned the public ILLabel and ILLabelCode
6178         labels into methods called GetILLabelCode() and GetILLabel() that
6179         only define the label during the Emit phase.
6180
6181         (GotoCase): Track the SwitchLabel instead of the computed label
6182         (its contained therein).  Emit the code by using
6183         SwitchLabel.GetILLabelCode ().
6184
6185         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6186         whether the Local has been captured or not.
6187
6188         (LocalInfo.IsCaptured): New property, used to tell whether the
6189         local has been captured.
6190         
6191         * anonymous.cs: Vastly updated to contain the anonymous method
6192         support.
6193
6194         The main classes here are: CaptureContext which tracks any
6195         captured information for a toplevel block and ScopeInfo used to
6196         track the activation frames for various local variables.   
6197
6198         Each toplevel block has an optional capture context associated
6199         with it.  When a method contains an anonymous method both the
6200         toplevel method and the anonymous method will create a capture
6201         context.   When variables or parameters are captured, they are
6202         recorded on the CaptureContext that owns them, for example:
6203
6204         void Demo () {
6205              int a;
6206              MyDelegate d = delegate {
6207                  a = 1;
6208              }
6209         }
6210
6211         Here `a' will be recorded as captured on the toplevel
6212         CapturedContext, the inner captured context will not have anything
6213         (it will only have data if local variables or parameters from it
6214         are captured in a nested anonymous method.
6215
6216         The ScopeInfo is used to track the activation frames for local
6217         variables, for example:
6218
6219         for (int i = 0; i < 10; i++)
6220                 for (int j = 0; j < 10; j++){
6221                    MyDelegate d = delegate {
6222                         call (i, j);
6223                    }
6224                 }
6225
6226         At runtime this captures a single captured variable `i', but it
6227         captures 10 different versions of the variable `j'.  The variable
6228         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6229         recorded on a child.  
6230
6231         The toplevel ScopeInfo will also track information like the `this'
6232         pointer if instance variables were referenced (this is necessary
6233         as the anonymous method lives inside a nested class in the host
6234         type of the method). 
6235
6236         (AnonymousMethod): Expanded to track the Toplevel, implement
6237         `AnonymousMethod.Compatible' to tell whether an anonymous method
6238         can be converted to a target delegate type. 
6239
6240         The routine now also produces the anonymous method content
6241
6242         (AnonymousDelegate): A helper class that derives from
6243         DelegateCreation, this is used to generate the code necessary to
6244         produce the delegate for the anonymous method that was created. 
6245
6246         * assign.cs: API adjustments for new changes in
6247         Convert.ImplicitStandardConversionExists.
6248
6249         * class.cs: Adjustments to cope with the fact that now toplevel
6250         blocks are of type `ToplevelBlock'. 
6251
6252         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6253         insteda of standard blocks.
6254
6255         Flag errors if params arguments are passed to anonymous methods.
6256
6257         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6258         `CurrentAnonymousMethod' which points to the current Anonymous
6259         Method.  The variable points to the AnonymousMethod class that
6260         holds the code being compiled.  It is set in the new EmitContext
6261         created for the anonymous method.
6262
6263         (EmitContext.Phase): Introduce a variable and an enumeration to
6264         assist in enforcing some rules about when and where we are allowed
6265         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6266         only one that enfonces this right now).
6267
6268         (EmitContext.HaveCaptureInfo): new helper method that returns
6269         whether we have a CapturedContext initialized.
6270
6271         (EmitContext.CaptureVariable): New method used to register that a
6272         LocalInfo must be flagged for capturing. 
6273
6274         (EmitContext.CapturedParameter): New method used to register that a
6275         parameters must be flagged for capturing. 
6276         
6277         (EmitContext.CapturedField): New method used to register that a
6278         field must be flagged for capturing. 
6279
6280         (EmitContext.HaveCapturedVariables,
6281         EmitContext.HaveCapturedFields): Return whether there are captured
6282         variables or fields. 
6283
6284         (EmitContext.EmitMethodHostInstance): This is used to emit the
6285         instance for the anonymous method.  The instance might be null
6286         (static methods), this (for anonymous methods that capture nothing
6287         and happen to live side-by-side with the current method body) or a
6288         more complicated expression if the method has a CaptureContext.
6289
6290         (EmitContext.EmitTopBlock): Routine that drives the emission of
6291         code: it will first resolve the top block, then emit any metadata
6292         and then emit the code.  The split is done so that we can extract
6293         any anonymous methods and flag any captured variables/parameters.
6294         
6295         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6296         during this phase, the ILGenerator should not be used as labels
6297         and local variables declared here might not be accessible to any
6298         code that is part of an anonymous method.  
6299
6300         Exceptions to this include the temporary variables that are
6301         created by some statements internally for holding temporary
6302         variables. 
6303         
6304         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6305         metadata for a cb
6306
6307         (EmitContext.TemporaryReturn): This method is typically called
6308         from the Emit phase, and its the only place where we allow the
6309         ReturnLabel to be defined other than the EmitMeta.  The reason is
6310         that otherwise we would have to duplicate a lot of logic in the
6311         Resolve phases of various methods that today is on the Emit
6312         phase. 
6313
6314         (EmitContext.NeedReturnLabel): This no longer creates the label,
6315         as the ILGenerator is not valid during the resolve phase.
6316
6317         (EmitContext.EmitThis): Extended the knowledge in this class to
6318         work in anonymous methods in addition to iterators. 
6319
6320         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6321         code is necessary on the stack to access the instance to a local
6322         variable (the variable will be accessed as a field).
6323
6324         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6325         EmitContext.EmitAddressOfParameter): Routines to support
6326         parameters (not completed at this point). 
6327         
6328         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6329         will also remove the parameters.
6330
6331         * convert.cs (Convert): Define a `ConstantEC' which points to a
6332         null.  This is just to prefity some code that uses
6333         ImplicitStandardConversion code and do not have an EmitContext
6334         handy.
6335
6336         The idea is to flag explicitly that at that point in time, it is
6337         known that the conversion will not trigger the delegate checking
6338         code in implicit conversions (which requires a valid
6339         EmitContext). 
6340
6341         Everywhere: pass new EmitContext parameter since
6342         ImplicitStandardConversionExists now requires it to check for
6343         anonymous method conversions. 
6344
6345         (Convert.ImplicitStandardConversionExists): If the type of an
6346         expression is the anonymous_method_type, and the type is a
6347         delegate, we invoke the AnonymousMethod.Compatible method to check
6348         whether an implicit conversion is possible. 
6349
6350         (Convert.ImplicitConversionStandard): Only do implicit method
6351         group conversions if the language level is not ISO_1.
6352
6353         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6354         MethodInfo for the Invoke method.  used by Delegate and
6355         AnonymousDelegate.
6356
6357         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6358         method conversions if the target type is a delegate.
6359
6360         Removed extra debugging nops.
6361
6362         (LocalVariableReference): Turn the `local_info' into a public
6363         field. 
6364
6365         Add `prepared' field, the same hack used for FieldExprs to cope
6366         with composed assignments, as Local variables do not necessarily
6367         operate purely on the stack as they used to: they can be captured
6368         fields. 
6369
6370         Add `temp' for a temporary result, like fields.
6371
6372         Refactor DoResolve and DoResolveLValue into DoResolveBase.
6373
6374         It now copes with Local variables that are captured and emits the
6375         proper instance variable to load it from a field in the captured
6376         case. 
6377
6378         (ParameterReference.DoResolveBase): During the resolve phase,
6379         capture parameters if we are in an anonymous method.
6380
6381         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6382         anonymous method, use the EmitContext helper routines to emit the
6383         parameter reference.
6384
6385         * iterators.cs: Set RemapToProxy to true/false during the
6386         EmitDispose class.
6387
6388         * parameters.cs (GetParameterByName): New helper method. 
6389
6390         * typemanager.cs (anonymous_method_type) a new type that
6391         represents an anonyous method.  This is always an internal type,
6392         used as a fencepost to test against the anonymous-methodness of an
6393         expression. 
6394         
6395 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
6396
6397         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6398         561 report.
6399         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6400
6401 2004-11-10  Martin Baulig  <martin@ximian.com>
6402
6403         * expression.cs (Invocation.BetterFunction): If two methods have
6404         equal parameter types, but only one of them is generic, the
6405         non-generic one wins.
6406         (New.DoResolve): Don't set `is_struct' to false if we're a generic
6407         instance; just use `Type.IsValueType' to determine whether
6408         something is a struct or not.
6409         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
6410         so we can be called multiple times.
6411
6412 2004-11-10  Martin Baulig  <martin@ximian.com>
6413
6414         * generic.cs (TypeParameter.DefineConstraints): New public method.
6415         (TypeParameter.CheckAccessLevel): Override this and return true.
6416         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
6417         override ResolveType() anymore.
6418         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
6419
6420 2004-11-10  Martin Baulig  <martin@ximian.com>
6421
6422         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
6423         call DeclSpace.ResolveNestedType() on it.
6424
6425 2004-11-10  Martin Baulig  <martin@ximian.com>
6426
6427         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
6428         non-null, call ParameterModifier() on it.
6429
6430 2004-11-10  Martin Baulig  <martin@ximian.com>
6431
6432         * iterators.cs
6433         (Iterators): Added `current_type' and `this_type' fields.
6434         (Iterators.DefineIterator): Create a new EmitContext and store it
6435         in `ec'; compute `this_type'.
6436
6437 2004-11-10  Martin Baulig  <martin@ximian.com>
6438
6439         * typemanager.cs
6440         (TypeManager.IsPrivateAccessible): New public method.
6441         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
6442
6443 2004-11-10  Martin Baulig  <martin@ximian.com>
6444
6445         * class.cs (TypeContainer.DefineType): Call
6446         TypeBuilder.DefineGenericParameters() before resolving the type
6447         parameters.
6448         (MethodData.parent_method): New protected field.
6449         (MethodData..ctor): Added `MethodInfo parent_method' argument.
6450         (MethodData.Define): Compute `parent_method'.
6451
6452         * decl.cs
6453         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6454         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6455         (DeclSpace.ec): New protected field; store the EmitContext here.
6456         (DeclSpace.EmitContext): New public property.
6457         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
6458         (DeclSpace.ResolveNestedType): New public method.
6459         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
6460         (DeclSpace.NestedAccessible): Added `Type tb' argument.
6461         (DeclSpace.FamilyAccessible): Likewise.
6462         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
6463         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6464         EmitContext.
6465
6466         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
6467         field.
6468
6469         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6470         (Enum.Emit): Don't create a new EmitContext.
6471
6472 2004-10-18  Martin Baulig  <martin@ximian.com>
6473
6474         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6475         `Type' directly, but call ResolveType() on it.
6476         (Catch.Resolve): Likewise.
6477         (Foreach.Resolve): Likewise.
6478
6479 2004-10-18  Martin Baulig  <martin@ximian.com>
6480
6481         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6482         `Type' directly, but call ResolveType() on it.
6483         (Probe.DoResolve): Likewise.
6484         (ArrayCreation.LookupType): Likewise.
6485         (TypeOf.DoResolve): Likewise.
6486         (SizeOf.DoResolve): Likewise.
6487
6488 2004-10-18  Raja R Harinath  <rharinath@novell.com>
6489
6490         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6491         the ResolveType.
6492
6493 2004-10-17  John Luke  <john.luke@gmail.com>
6494
6495         * class.cs (Operator.GetSignatureForError): use CSharpName
6496
6497         * parameter.cs (Parameter.GetSignatureForError): Returns
6498         correct name even if was not defined.
6499
6500 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6501
6502         Fix #65816.
6503         * class.cs (TypeContainer.EmitContext): New property.
6504         (DefineNestedTypes): Create an emitcontext for each part.
6505         (MethodCore.DoDefineParameters): Use container's emitcontext.
6506         Pass type array to InternalParameters.
6507         (MemberBase.DoDefine): Use container's emitcontext.
6508         (FieldMember.Define): Likewise.
6509         (Event.Define): Likewise.
6510         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6511         Pass type array to InternalParameters.
6512         (SetIndexerMethod.GetParameterInfo): Likewise.
6513         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6514         * delegate.cs (Define): Pass emitcontext to
6515         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6516         array to InternalParameters.
6517         * expression.cs (ParameterReference.DoResolveBase): Pass
6518         emitcontext to GetParameterInfo.
6519         (ComposedCast.DoResolveAsTypeStep): Remove check on
6520         ec.ResolvingTypeTree.
6521         * parameter.cs (Parameter.Resolve): Change argument to
6522         EmitContext.  Use ResolveAsTypeTerminal.
6523         (Parameter.GetSignature): Change argument to EmitContext.
6524         (Parameters.ComputeSignature): Likewise.
6525         (Parameters.ComputeParameterTypes): Likewise.
6526         (Parameters.GetParameterInfo): Likewise.
6527         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6528         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6529         * support.cs (InternalParameters..ctor): Remove variant that takes
6530         a DeclSpace.
6531         * typemanager.cs (system_intptr_expr): New.
6532         (InitExpressionTypes): Initialize it.
6533
6534 2004-10-12  Chris Toshok  <toshok@ximian.com>
6535
6536         * cs-parser.jay: fix location for try_statement and catch_clause.
6537
6538 2004-10-18  Martin Baulig  <martin@ximian.com>
6539
6540         * class.cs (FieldMember.Define): Don't access the TypeExpr's
6541         `Type' directly, but call ResolveType() on it.
6542         (MemberBase.DoDefine): Likewise.
6543
6544         * expression.cs (New.DoResolve): Don't access the TypeExpr's
6545         `Type' directly, but call ResolveType() on it.
6546         (ComposedCast.DoResolveAsTypeStep): Likewise.
6547
6548         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6549         `Type' directly, but call ResolveType() on it.
6550
6551 2004-10-17  John Luke  <john.luke@gmail.com>
6552
6553         * class.cs (Operator.GetSignatureForError): use CSharpName
6554
6555         * parameter.cs (Parameter.GetSignatureForError): Returns
6556         correct name even if was not defined.
6557
6558 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6559
6560         Fix #65816.
6561         * class.cs (TypeContainer.EmitContext): New property.
6562         (DefineNestedTypes): Create an emitcontext for each part.
6563         (MethodCore.DoDefineParameters): Use container's emitcontext.
6564         Pass type array to InternalParameters.
6565         (MemberBase.DoDefine): Use container's emitcontext.
6566         (FieldMember.Define): Likewise.
6567         (Event.Define): Likewise.
6568         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6569         Pass type array to InternalParameters.
6570         (SetIndexerMethod.GetParameterInfo): Likewise.
6571         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6572         * delegate.cs (Define): Pass emitcontext to
6573         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6574         array to InternalParameters.
6575         * expression.cs (ParameterReference.DoResolveBase): Pass
6576         emitcontext to GetParameterInfo.
6577         (ComposedCast.DoResolveAsTypeStep): Remove check on
6578         ec.ResolvingTypeTree.
6579         * parameter.cs (Parameter.Resolve): Change argument to
6580         EmitContext.  Use ResolveAsTypeTerminal.
6581         (Parameter.GetSignature): Change argument to EmitContext.
6582         (Parameters.ComputeSignature): Likewise.
6583         (Parameters.ComputeParameterTypes): Likewise.
6584         (Parameters.GetParameterInfo): Likewise.
6585         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6586         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6587         * support.cs (InternalParameters..ctor): Remove variant that takes
6588         a DeclSpace.
6589         * typemanager.cs (system_intptr_expr): New.
6590         (InitExpressionTypes): Initialize it.
6591
6592 2004-10-12  Chris Toshok  <toshok@ximian.com>
6593
6594         * cs-parser.jay: fix location for try_statement and catch_clause.
6595
6596 2004-10-07  Raja R Harinath  <rharinath@novell.com>
6597
6598         More DeclSpace.ResolveType avoidance.
6599         * decl.cs (MemberCore.InUnsafe): New property.
6600         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
6601         with newly created EmitContext.
6602         (FieldMember.Define): Likewise.
6603         * delegate.cs (Delegate.Define): Likewise.
6604         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6605         only if normal name-lookup fails.
6606         (TypeExpr.DoResolve): Enable error-checking.
6607         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6608         (SizeOf.DoResolve): Likewise.
6609         (ComposedCast.DoResolveAsTypeStep): Likewise.
6610         (StackAlloc.DoResolve): Likewise.
6611         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6612         (Block.Unsafe): New property.
6613         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6614         (Unsafe): Set 'unsafe' flag of contained block.
6615         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6616         (Fixed.Resolve): Likewise.
6617         (Catch.Resolve): Likewise.
6618         (Using.ResolveLocalVariableDecls): Likewise.
6619         (Foreach.Resolve): Likewise.
6620
6621 2004-10-05  John Luke <john.luke@gmail.com>
6622
6623         * cs-parser.jay: add location to error CS0175
6624
6625 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
6626
6627         * ecore.cs (Expression.Constantity): Add support for turning null
6628         into a constant.
6629
6630         * const.cs (Const.Define): Allow constants to be reference types
6631         as long as the value is Null.
6632
6633 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
6634
6635         * namespace.cs (NamespaceEntry.Using): No matter which warning
6636         level is set, check if this namespace name has already been added.
6637
6638 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
6639
6640         * expression.cs: reftype [!=]= null should always use br[true,false].
6641         # 67410
6642
6643 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
6644
6645         Fix #67108
6646         * attribute.cs: Enum conversion moved to 
6647         GetAttributeArgumentExpression to be applied to the all
6648         expressions.
6649
6650 2004-10-01  Raja R Harinath  <rharinath@novell.com>
6651
6652         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
6653         * class.c (TypeContainer.DefineType): Flag error if
6654         base types aren't accessible due to access permissions.
6655         * decl.cs (DeclSpace.ResolveType): Move logic to
6656         Expression.ResolveAsTypeTerminal.
6657         (DeclSpace.ResolveTypeExpr): Thin layer over
6658         Expression.ResolveAsTypeTerminal.
6659         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
6660         Refactor code into NestedAccess.  Use it.
6661         (DeclSpace.NestedAccess): New.
6662         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
6663         argument to silence errors.  Check access permissions.
6664         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
6665         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
6666         (Cast.DoResolve): Likewise.
6667         (New.DoResolve): Likewise.
6668         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
6669         (TypeOf.DoResolve): Likewise.
6670
6671         * expression.cs (Invocation.BetterConversion): Return the Type of
6672         the better conversion.  Implement section 14.4.2.3 more faithfully.
6673         (Invocation.BetterFunction): Make boolean.  Make correspondence to
6674         section 14.4.2.2 explicit.
6675         (Invocation.OverloadResolve): Update.
6676         (Invocation): Remove is_base field.
6677         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
6678         (Invocation.Emit): Likewise.
6679
6680 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
6681
6682         * cs-parser.jay: Reverted 642 warning fix.
6683
6684 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6685
6686         Fix bug #66615
6687         * decl.cs (FindMemberWithSameName): Indexer can have more than
6688         1 argument.
6689
6690 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6691
6692         * expression.cs (LocalVariableReference.DoResolveLValue):
6693         Do not report warning 219 for out values.
6694         (EmptyExpression.Null): New member to avoid extra allocations.
6695
6696 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6697
6698         * cs-parser.jay: Fix wrong warning 642 report.
6699
6700         * cs-tokenizer.cs (CheckNextToken): New helper;
6701         Inspect next character if is same as expected.
6702
6703 2004-09-23  Martin Baulig  <martin@ximian.com>
6704
6705         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6706         (Convert.ImplicitReferenceConversionExists): Likewise.
6707
6708 2004-11-09  Raja R Harinath  <rharinath@novell.com>
6709
6710         * Makefile (DISTFILES): Comment out a few missing files.
6711
6712 2004-10-29  Raja R Harinath  <rharinath@novell.com>
6713
6714         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
6715         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
6716         (gmcs.exe): Invoke bootstrap-libs.
6717         (clean-local): Clean the net_2_0_bootstrap profile too.
6718         (PROGRAM_INSTALL_DIR): New.
6719         (install-local): Use it.
6720
6721 2004-10-13  Martin Baulig  <martin@ximian.com>
6722
6723         * generic.cs (TypeManager.InflatedConstraints): New nested class.
6724         (TypeParameter.DefineType): If we're a method type parameter and
6725         that method is overriding something, "inflate" its constraints.
6726
6727 2004-10-12  Martin Baulig  <martin@ximian.com>
6728
6729         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
6730         and have type arguments, create and resolve a ConstructedType.
6731
6732 2004-10-12  Martin Baulig  <martin@ximian.com>
6733
6734         * decl.cs (MemberCache.FindMemberToOverride): Use
6735         TypeManager.IsEqual() to compare the parameters and Type.Equals()
6736         to compare the invocationType.
6737
6738         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
6739         When comparing two type parameters, only do the signature-only
6740         comparision for method type parameters.
6741
6742 2004-10-11  Martin Baulig  <martin@ximian.com>
6743
6744         * report.cs: Don't make --fatal abort on warnings, we have
6745         -warnaserror for that.
6746
6747 2004-10-11  Martin Baulig  <martin@ximian.com>
6748
6749         * typemanager.cs
6750         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
6751         (TypeManager.IsEqual): Call ourself recursively instead of using
6752         Type.IsEqual(). 
6753
6754 2004-10-11  Martin Baulig  <martin@ximian.com>
6755
6756         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
6757         on our own type parameters, not on the ones we inherit from a containing
6758         class.
6759
6760         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
6761         the comparision.
6762
6763         * generic.cs (TypeParameter.Define): We may only be called once.
6764
6765         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
6766         instead of TypeManager.IsEqual().
6767
6768 2004-09-28  Martin Baulig  <martin@ximian.com>
6769
6770         * generic.cs
6771         (GenericConstraints.EffectiveBaseClass): New public property.
6772         (TypeParameter.GenericConstraints): New public property.
6773         (ConstructedType.CheckConstraints): Improved.
6774
6775         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
6776         (Convert.TypeParameterConversion): New private method; use this in
6777         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
6778         for all conversions related to type parameters.
6779
6780 2004-09-24  Martin Baulig  <martin@ximian.com>
6781
6782         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
6783         type parameter conversions for type parameters which are known to
6784         be reference types.
6785
6786 2004-09-24  Martin Baulig  <martin@ximian.com>
6787
6788         * generic.cs (GenericConstraints): Added `IsReferenceType' and
6789         `IsValueType' properties.
6790
6791         * support.cs (ReflectionConstraints): Use
6792         Type.GetGenericParameterConstraints() instead of the old hack.
6793
6794 2004-09-24  Martin Baulig  <martin@ximian.com>
6795
6796         * generic.cs (GenericConstraints): Moved here and made it an
6797         abstract class.
6798
6799         * support.cs (GenericConstraints): Moved to generic.cs.
6800
6801 2004-09-24  Martin Baulig  <martin@ximian.com>
6802
6803         * support.cs
6804         (ReflectionConstraints): Un-nested this class and made it public.
6805
6806         * typemanager.cs
6807         (TypeManager.GetTypeParameterConstraints): New public method.
6808         (TypeManager.HasConstructorConstraint): Use the attributes.
6809
6810 2004-09-24  Martin Baulig  <martin@ximian.com>
6811
6812         * support.cs (GenericConstraints): Replaced `HasConstructor',
6813         `IsReferenceType' and `IsValueType' with `Attributes'.
6814         (ReflectionParameters.ReflectionConstraints): Removed the Create()
6815         method and made the .ctor public.
6816
6817         * generic.cs (Constraints.Attributes): New public property.
6818         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
6819         `IsReferenceType' -> `HasReferenceTypeConstraint' and
6820         `IsValueType' -> `HasValueTypeConstraint'.
6821
6822 2004-09-23  Martin Baulig  <martin@ximian.com>
6823
6824         * generic.cs (Constraints): Reflect latest runtime changes.
6825
6826 2004-09-23  Martin Baulig  <martin@ximian.com>
6827
6828         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6829         (Convert.ImplicitReferenceConversionExists): Likewise.
6830
6831 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6832
6833         * class.cs (Operator.Define): Add error 448 and 559 report.
6834         
6835 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6836
6837         * class.cs (MemberBase.IsTypePermitted): New protected
6838         method for checking error CS0610.
6839
6840 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6841
6842         * class.cs (TypeContainer.HasExplicitLayout): New property
6843         Returns whether container has StructLayout attribute set Explicit.
6844         (FieldMember): New abstract class for consts and fields.
6845         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
6846         (Field): Reuse FieldMember.
6847
6848         * const.cs (Const): Reuse FieldMember.
6849
6850         * rootcontext.cs: EmitConstants call moved to class.
6851
6852 2004-09-22  Martin Baulig  <martin@ximian.com>
6853
6854         Marek and me just fixed one of our oldest bugs: #28562 :-)
6855
6856         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
6857
6858         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
6859         we're an EnumConstant, just return that.
6860         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
6861         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
6862         to get the value which'll actually be written into the attribute.
6863         However, we have to use GetValue() to access the attribute's value
6864         in the compiler.        
6865
6866 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6867
6868         * constant.cs (Constant.IsNegative): New abstract property
6869         IsNegative.
6870
6871         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
6872         (StackAlloc.DoResolve): Reused IsNegative.
6873
6874 2004-09-22  Martin Baulig  <martin@ximian.com>
6875
6876         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
6877         public method; like LookupTypeContainer, but also works for
6878         generic instances.
6879
6880         * report.cs (Report.SymbolRelatedToPreviousError): Use
6881         TypeManager.LookupGenericTypeContainer().       
6882
6883 2004-09-22  Martin Baulig  <martin@ximian.com>
6884
6885         Thanks to Peter Sestoft for this bug report.
6886
6887         * expression.cs (Conditional): If both the `trueExpr' and the
6888         `falseExpr' is a NullLiteral, return a NullLiteral.
6889
6890 2004-09-22  Martin Baulig  <martin@ximian.com>
6891
6892         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
6893         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
6894         for the "get_Current" call.
6895
6896 2004-09-21  Martin Baulig  <martin@ximian.com>
6897
6898         * convert.cs (Convert.ImplicitReferenceConversion): When
6899         converting to an interface type, first check whether we're
6900         converting from a reference type.
6901
6902 2004-09-14  Martin Baulig  <martin@ximian.com>
6903
6904         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6905
6906 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6907
6908         Fixed bug #61902
6909         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6910         called and is obsolete then this member suppress message
6911         when call is inside next [Obsolete] method or type.
6912
6913         * expression.cs: Use TestObsoleteMethodUsage member.
6914
6915 2004-09-14  Martin Baulig  <martin@ximian.com>
6916
6917         * genericparser.cs: Removed.
6918
6919 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
6920
6921         * class.cs (MethodCore.CheckBase): Fix bug #65757.
6922
6923 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
6924
6925         * attribute.cs (Attribute.Resolve): Add error 653 report.
6926
6927         * class.cs (Class.ApplyAttributeBuilder): Add error 641
6928         report.
6929         (Method.ApplyAttributeBuilder): Add error 685 report.
6930         (Operator.Define): Add error 564 report.
6931
6932         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6933
6934         * expression.cs (Invocation.DoResolve): Add error
6935         245 and 250 report.
6936
6937         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6938         error 674 report.
6939
6940 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6941
6942         * class.cs (ConstructorInitializer.Resolve):
6943         Wrong error number (515->516).
6944
6945 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6946
6947         * class.cs (Indexer.Define): Add error 631 report.
6948
6949 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6950
6951         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
6952
6953 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6954
6955         * expression.cs (Probe.DoResolve): Add error CS0241 report.
6956
6957 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
6958
6959         * cs-parser.jay: Added error CS0241 report.
6960
6961 2004-09-10  Raja R Harinath  <rharinath@novell.com>
6962
6963         * cs-parser.jay (fixed_statement): Introduce a scope for the
6964         declaration in the 'fixed' statement.
6965
6966 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6967
6968         * cs-parser.jay: Added CS0230 error report.
6969
6970 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6971
6972         * cs-parser.jay: Added errors CS0231 and CS0257 report.
6973
6974 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6975
6976         * expression.cs (Argument.Resolve): Added error CS0192 and
6977         CS0199 report.
6978
6979 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6980
6981         C# 2.0 #pragma warning feature
6982
6983         * cs-tokenizer.cs (PreProcessPragma): New method; 
6984         Handles #pragma directive.
6985
6986         * report.cs (WarningRegions): New class; Support
6987         class for #pragma warning directive. It tests whether
6988         warning is enabled for a given line.
6989
6990 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
6991
6992         * const.cs: Add more descriptive error report, tahnks to
6993         Sebastien. 
6994
6995 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
6996
6997         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6998
6999 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7000
7001         * expression.cs: Apply patch from Ben: Remove dead code from
7002         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7003         as that code just threw an exception anwyays.
7004
7005         * const.cs: Remove the call to the turnintoconstant, for details
7006         see bug: #63144
7007         
7008         * literal.cs: The type of the null-literal is the null type;  So
7009         we use a placeholder type (literal.cs:System.Null, defined here)
7010         for it.
7011
7012         * expression.cs (Conditional.DoResolve): Remove some old code that
7013         is no longer needed, conversions have been fixed.
7014
7015         (ArrayCreationExpression.DoResolve): Return false if we fail to
7016         resolve the inner expression.
7017
7018 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7019
7020         Fix test-290.cs.
7021         * cs-parser.jay (delegate_declaration): Record a delegate
7022         declaration as a type declaration.
7023         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7024
7025 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7026
7027         * parameter.cs: Do not crash if the type can not be resolved. 
7028
7029         * expression.cs: Report errors with unsafe pointers, fixes #64896
7030
7031 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7032
7033         * expression.cs: Pointer arith always needs to do a conv.i
7034         if the operand is a long. fix 65320
7035
7036 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7037
7038         Fixed cs0619-37.cs, cs0619-38.cs
7039
7040         * enum.cs (GetObsoleteAttribute): Removed.
7041
7042         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7043         on Enum member is double staged. The first is tested member
7044         and then enum.
7045
7046 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7047
7048         Fixed #56986, #63631, #65231
7049
7050         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7051         adds member to name container.
7052         (TypeContainer.AddToTypeContainer): New method, adds type to
7053         name container.
7054         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7055         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7056         AddOperator): Simplified by reusing AddToMemberContainer.
7057         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7058         instead of field.
7059         (Method.CheckForDuplications): Fixed implementation to test all
7060         possibilities.
7061         (MemberBase): Detection whether member is explicit interface
7062         implementation is now in constructor.
7063         (MemberBase.UpdateMemberName): Handles IndexerName.
7064         (Accessor): Changed to keep also location information.
7065         (AbstractPropertyEventMethod): Is derived from MemberCore.
7066         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7067         will be emited or not.
7068         (PropertyBase.AreAccessorsDuplicateImplementation):
7069         Tests whether accessors are not in collision with some method.
7070         (Operator): Is derived from MethodCore to simplify common
7071         operations.
7072
7073         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7074         must be performed.
7075         (DeclSpace.AddToContainer): Adds the member to defined_names
7076         table. It tests for duplications and enclosing name conflicts.
7077
7078         * enum.cs (EnumMember): Clean up to reuse the base structures
7079
7080 2004-09-03  Martin Baulig  <martin@ximian.com>
7081
7082         Merged latest changes into gmcs.  Please keep this comment in
7083         here, it makes it easier for me to see what changed in MCS since
7084         the last time I merged.
7085
7086 2004-09-03  Martin Baulig  <martin@ximian.com>
7087
7088         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7089         into TypeContainer, to make partial classes work again.
7090
7091 2004-09-03  Martin Baulig  <martin@ximian.com>
7092
7093         * rootcontext.cs (RootContext.V2): Removed.
7094
7095 2004-03-23  Martin Baulig  <martin@ximian.com>
7096
7097         * expression.cs (Invocation.OverloadResolve): Added `bool
7098         may_fail' argument and use it instead of the Location.IsNull() hack.
7099
7100 2004-09-09  Martin Baulig  <martin@ximian.com>
7101
7102         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7103
7104 2004-09-09  Martin Baulig  <martin@ximian.com>
7105
7106         * generic.cs (TypeParameter.DefineType): Added support for
7107         explicit interface methods.
7108
7109 2004-09-09  Martin Baulig  <martin@ximian.com>
7110
7111         * README.Changes: New document.  Started to list important changes
7112         between MCS and GMCS here.
7113
7114 2004-09-08  Martin Baulig  <martin@ximian.com>
7115
7116         * class.cs
7117         (TypeContainer.CheckRecursiveDefinition): New protected method.
7118         (TypeContainer.DefineType): Move the CS0146 check into
7119         CheckRecursiveDefinition().     
7120
7121 2004-09-06  Martin Baulig  <martin@ximian.com>
7122
7123         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7124         types for the constructor constraint.
7125
7126 2004-09-03  Martin Baulig  <martin@ximian.com>
7127
7128         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7129         into TypeContainer, to make partial classes work again.
7130
7131 2004-09-03  Martin Baulig  <martin@ximian.com>
7132
7133         * rootcontext.cs (RootContext.V2): Removed.
7134
7135 2004-03-23  Martin Baulig  <martin@ximian.com>
7136
7137         * expression.cs (Invocation.OverloadResolve): Added `bool
7138         may_fail' argument and use it instead of the Location.IsNull() hack.
7139
7140 2004-09-03  Martin Baulig  <martin@ximian.com>
7141
7142         Merged latest changes into gmcs.  Please keep this comment in
7143         here, it makes it easier for me to see what changed in MCS since
7144         the last time I merged.
7145
7146 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7147
7148         Fix #61128.
7149         * expression.cs (BetterConversion): Don't allow either conversion 
7150         to be null.  Remove redundant implicit conversion test when 'q ==
7151         null' -- when this function is invoked, we already know that the
7152         implicit conversion exists.
7153         (BetterFunction): Assume that 'best' is non-null.  Remove
7154         redundant reimplementation of IsApplicable when 'best' is null.
7155         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7156         number of arguments.
7157         (IsAncestralType): Extract from OverloadResolve.
7158         (OverloadResolve): Make robust to the MethodGroupExpr being
7159         unsorted.  Implement all the logic of Section 14.5.5.1, and
7160         support overloading of methods from multiple applicable types.
7161         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7162
7163         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7164         (RealError, Warning): Append type of report to related symbol.
7165
7166 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7167
7168         * enum.cs: Fixed CLS-Compliance checks for enum members.
7169         Error tests cs3008-8.cs, cs3014-8.cs
7170
7171 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7172
7173         Fixed bug #62342, #63102
7174         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7175         like ImplementMethod.
7176
7177 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7178
7179         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7180         Fixed bug #65170.
7181
7182 2004-09-02  Martin Baulig  <martin@ximian.com>
7183
7184         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7185         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7186         on the MethodBase.
7187
7188 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7189
7190         C# 2.0 Static classes implemented
7191
7192         * class.cs (TypeContainer): instance_constructors,
7193         initialized_fields, initialized_static_fields,
7194         default_constructor, base_inteface_types are protected to be
7195         accessible from StaticClass.
7196         (TypeContainer.DefineDefaultConstructor): New virtual method
7197         for custom default constructor generating
7198         (StaticClass): New class to handle "Static classes" feature.
7199
7200         * cs-parser.jay: Handle static keyword on class like instance
7201         of StaticClass.
7202
7203         * driver.cs: Added "/langversion" command line switch with two
7204         options (iso-1, default).
7205
7206 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7207
7208         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7209
7210 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7211
7212         * delegate.cs: Style.
7213
7214 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7215
7216         * delegate.cs: Add seperate instance expr field for miguel.
7217
7218 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7219
7220         * PointerArithmetic (Resolve): make sure we are not doing
7221         pointer arith on void*. Also, make sure we are resolved
7222         by not setting eclass until resolve.
7223
7224         All callers: Make sure that PointerArithmetic gets resolved.
7225
7226 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7227
7228         * ArrayCreation (LookupType): If the type does not resolve 
7229         to an array, give an error.
7230
7231 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7232
7233         * statement.cs (Try.Resolve): Fixed bug #64222
7234
7235 2004-08-27  Martin Baulig  <martin@ximian.com>
7236
7237         * class.cs
7238         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7239         crash here.     
7240
7241 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7242
7243         * ecore.cs (Constantify): Get underlying type via
7244         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7245         Windows in special cases.
7246
7247 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7248
7249         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7250         for obtaining also private methods.
7251         (GetRemoveMethod): Used GetRemoveMethod (true)
7252         for obtaining also private methods.
7253
7254 2004-09-02  Martin Baulig  <martin@ximian.com>
7255
7256         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7257         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7258         on the MethodBase.
7259
7260 2004-08-27  Martin Baulig  <martin@ximian.com>
7261
7262         * class.cs
7263         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7264         crash here.     
7265
7266 2004-08-25  Martin Baulig  <martin@ximian.com>
7267
7268         * support.cs (ReflectionParameters..ctor): If this is a generic
7269         method, retrieve and store its type parameters.
7270         (InternalParameters..ctor): Added `TypeParameter[]' argument.
7271         (ReflectionParameters.GenericConstraints): The argument specifies
7272         the type parameter, not the method parameter.
7273         (InternalParameters.GenericConstraints): Likewise.
7274
7275         * generic.cs (TypeParameter.DefineType): Correctly handle
7276         constraints wrt. generic methods in interfaces and their
7277         implementations.        
7278
7279 2004-08-24  Martin Baulig  <martin@ximian.com>
7280
7281         * generic.cs (TypeParameter.IsSubclassOf): New public method.
7282         (Constraints.IsSubclassOf): New internal method.
7283
7284         * typemanager.cs (TypeManager.FindMembers): Added special support
7285         for GenericTypeParameterBuilder's.      
7286         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7287         type parameters.
7288
7289 2004-08-24  Martin Baulig  <martin@ximian.com>
7290
7291         * typemanager.cs
7292         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7293         this for accessibility checks.
7294         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7295         IsNestedFamilyAccessible.
7296         (TypeManager.IsSubclassOf): New method, do what the name actually
7297         says.   
7298
7299 2004-08-24  Martin Baulig  <martin@ximian.com>
7300
7301         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7302         as a SimpleName, include the generic arity.
7303
7304 2004-08-24  Martin Baulig  <martin@ximian.com>
7305
7306         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7307         MethodAttributes.HideBySig for operators.
7308
7309 2004-08-23  Martin Baulig  <martin@ximian.com>
7310
7311         Back to the old error reporting system :-)
7312
7313         * report.cs (Message): Removed.
7314         (Report.MessageData, ErrorData, WarningData): Removed.
7315         (Report.Error, Warning): Back to the old system.
7316
7317 2004-08-23  Martin Baulig  <martin@ximian.com>
7318
7319         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7320
7321         * class.cs (TypeContainer.ParentContainer): New public virtual
7322         method; replaces the explicit interface implementation.
7323         (ClassPart.ParentContainer): Override.
7324
7325 2004-08-23  Martin Baulig  <martin@ximian.com>
7326
7327         * statement.cs (Switch): Added support for constant switches; see
7328         #59428 or test-285.cs.
7329
7330 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7331
7332         Fixed bug #62740.
7333         * statement.cs (GetEnumeratorFilter): Removed useless
7334         logic because C# specs is strict. GetEnumerator must be
7335         public.
7336
7337 2004-08-22  Martin Baulig  <martin@ximian.com>
7338
7339         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7340         a switch and may break, reset the barrier.  Fixes #59867.
7341
7342 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7343
7344         CLS-Compliance speed up (~5% for corlib)
7345
7346         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7347         New method. Tests container for CLS-Compliant names
7348
7349         * class.cs (TypeContainer.VerifyClsName): New method.
7350         Checks whether container name is CLS Compliant.
7351         (Constructor): Implements IMethodData.
7352
7353         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7354         low-case table for CLS Compliance test.
7355         (MemberCache.VerifyClsParameterConflict): New method.
7356         Checks method parameters for CS3006 error.
7357
7358         * enum.cs (EnumMember): Is derived from MemberCore.
7359         (Enum.VerifyClsName): Optimized for better performance.
7360
7361 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7362
7363         * report.cs: Renamed Error_T to Error and changed all
7364         references.
7365
7366 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7367
7368         * class.cs (TypeContainer.IndexerArrayList): New inner class
7369         container for indexers.
7370         (TypeContainer.DefaultIndexerName): New constant for default
7371         indexer name. Replaced all "Item" with this constant.
7372         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7373
7374         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7375         DefaultMemberAttribute constructor.
7376
7377 2004-08-05  Martin Baulig  <martin@ximian.com>
7378
7379         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7380         Fix bug #59429.
7381
7382 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7383
7384         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7385         multi platforms problem.
7386
7387         * compiler.csproj: Included shared files.
7388
7389 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7390
7391         Fix bug 60333, 55971 in the more general way
7392         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7393         Added arg_type argument for constant conversion.
7394         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7395
7396 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7397
7398         Fix bug #59760
7399         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7400         OperatorArrayList, MethodCoreArrayList for typecontainer
7401         containers. Changed class member types to these new types.
7402         (MethodArrayList.DefineMembers): Added test for CS0659.
7403
7404 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7405
7406         * cfold.cs: Synchronize the folding with the code in expression.cs
7407         Binary.DoNumericPromotions for uint operands.
7408
7409         * attribute.cs: Revert patch from Raja, it introduced a regression
7410         while building Blam-1.2.1 (hard to isolate a test case).
7411
7412 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7413
7414         Fix for #55382
7415         * class.cs:
7416         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7417         name collision.
7418         (MethodCore.parent_method): New member. The method we're overriding
7419         if this is an override method.
7420         (MethodCore.CheckBase): Moved from Method class and made common.
7421         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7422         private.
7423         (MethodCore.CheckForDuplications): New abstract method. For custom
7424         member duplication search in a container
7425         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7426         method and its return type.
7427         (Event.conflict_symbol): New member. Symbol with same name in the
7428         parent class.
7429
7430         * decl.cs:
7431         (MemberCache.FindMemberWithSameName): New method. The method
7432         is looking for conflict with inherited symbols.
7433
7434 2004-08-04  Martin Baulig  <martin@ximian.com>
7435
7436         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7437
7438         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7439
7440 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7441
7442         * report.cs (Message): New enum for better error, warning reference in
7443         the code.
7444         (MessageData): New inner abstract class. It generally handles printing of
7445         error and warning messages.
7446         Removed unused Error, Warning, Message methods.
7447
7448 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7449
7450         Fix for cs0592-8.cs test
7451         * attribute.cs
7452         (Attributable.ValidAttributeTargets): Made public.
7453         (Attribute.ExplicitTarget): New member for explicit target value.
7454         (Attribute.CheckTargets): Now we translate explicit attribute
7455         target to Target here.
7456
7457 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7458
7459         * ecore.cs (MethodGroupExpr): new IsBase property.
7460
7461         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7462
7463         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7464         rather than an instance expr.
7465
7466         (DelegateCreation.Emit): Use the method group rather than
7467         the instance expression. Also, if you have base.Foo as the
7468         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7469
7470         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7471
7472         (NewDelegate.DoResolve): Only check for the existance of Invoke
7473         if the method is going to be needed. Use MethodGroupExpr.
7474
7475         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
7476
7477         * expression.cs: For pointer arith., make sure to use
7478         the size of the type, not the size of the pointer to
7479         the type.
7480
7481 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7482
7483         Fix for #60722
7484         * class.cs (Class): Added error CS0502 test.
7485
7486 2004-08-03  John Luke  <jluke@cfl.rr.com>
7487             Raja R Harinath  <rharinath@novell.com>
7488
7489         Fix for #60997.
7490         * attribute.cs (Attribute.complained_before): New flag.
7491         (Attribute.ResolveType, Attribute.Resolve),
7492         (Attribute.DefinePInvokeMethod): Set it.
7493         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7494         
7495 2004-08-03  Martin Baulig  <martin@ximian.com>
7496
7497         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7498         use a user-defined operator; we still need to do numeric
7499         promotions in case one argument is a builtin type and the other
7500         one has an implicit conversion to that type.  Fixes #62322.
7501
7502 2004-08-18  Martin Baulig  <martin@ximian.com>
7503
7504         * class.cs (Method.Define): Use the correct method name when
7505         creating the MethodBuilder for a generic method.
7506
7507 2004-08-17  Martin Baulig  <martin@ximian.com>
7508
7509         * generic.cs (Constraints): Support type parameter constraints.
7510
7511 2004-08-16  Martin Baulig  <martin@ximian.com>
7512
7513         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
7514         (Token.GENERIC_DIMENSION): New token; this is returned if we
7515         encounter an unbound generic type in a typeof() expression.
7516
7517         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
7518         this token is only generated while parsing a typeof() expression.
7519         (typeof_expression): Removed the old unbound_type hack.
7520
7521         * generic.cs (TypeArguments.IsUnbound): New public property.
7522
7523         * decl.cs (MemberName): Added support for unbound types.
7524
7525 2004-08-14  Martin Baulig  <martin@ximian.com>
7526
7527         * typemanager.cs
7528         (TypeManager.IsEqualGenericInstance): New static method.
7529         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
7530         just used to check accessibility, so follow the rules of 26.1.6.        
7531
7532         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
7533         ConstructedType instead of a TypeExpression if we have type arguments.
7534
7535         * cs-parser.jay (typeof_expression): Support unbound generic types.
7536
7537         * ecore.cs (UnboundTypeExpression): New public class.
7538
7539 2004-08-12  Martin Baulig  <martin@ximian.com>
7540
7541         * typemanager.cs (TypeManager.IsNestedChildOf): Use
7542         TypeManager.IsEqual() rather than `=='.
7543
7544         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
7545         generic instances as well.
7546
7547 2004-08-12  Martin Baulig  <martin@ximian.com>
7548
7549         * expression.cs (Invocation.InferType): We can only infer method
7550         type parameters.  Fixes #62647.
7551
7552 2004-08-11  Martin Baulig  <martin@ximian.com>
7553
7554         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
7555         before resolving the base classes.
7556
7557 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7558
7559         * Makefile: install .mdb file too.
7560
7561 2004-08-05  Martin Baulig  <martin@ximian.com>
7562
7563         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
7564         initializer, the current type is just the TypeBuilder, not the
7565         instantiated generic type.
7566         (FieldExpr.IsFieldInitializer): New public property.
7567
7568 2004-08-04  Martin Baulig  <martin@ximian.com>
7569
7570         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7571
7572         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7573
7574 2004-08-03  Martin Baulig  <martin@ximian.com>
7575
7576         * class.cs (MethodData.Define): If we're an explicit
7577         implementation, remove the generic arity from the type name.
7578
7579 2004-08-03  Martin Baulig  <martin@ximian.com>
7580
7581         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7582         use a user-defined operator; we still need to do numeric
7583         promotions in case one argument is a builtin type and the other
7584         one has an implicit conversion to that type.  Fixes #62322.
7585
7586 2004-08-02  Martin Baulig  <martin@ximian.com>
7587
7588         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
7589         `TypeExpr[]' array.
7590         (TypeContainer.GetClassBases): Return the unexpanded list of
7591         interfaces; we expand them later.
7592         (TypeContainer.DefineType): After creating the TypeBuilder, call
7593         TypeManager.ExpandInterfaces() to get an expanded and resolved
7594         list of interfaces.
7595
7596         * ecore.cs (TypeExpr.GetInterfaces): Removed
7597
7598         * generics.cs (Constraints.InterfaceConstraints): Remove.
7599         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
7600         register the interface constraints.
7601
7602         * typemanager.cs
7603         (TypeManager.AddUserType): Removed the `ifaces' argument.
7604         (TypeManager.AddTypeParameter): Likewise.
7605         (TypeManager.AddUserInterface): Removed, was unused.
7606         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
7607         `TypeExpr[]' array for the interfaces.
7608         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
7609         has been defined, returns a list of the resolved interfaces types.
7610         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
7611         (TypeManager.GetExplicitInterfaces): Likewise.  
7612
7613 2004-08-02  Martin Baulig  <martin@ximian.com>
7614
7615         * expression.cs (Invocation.EmitCall): If we're invoking a method
7616         on a type parameter, use the new `Constrained' prefix opcode.
7617
7618 2004-08-02  Martin Baulig  <martin@ximian.com>
7619
7620         * statement.cs (LocalInfo.Flags): Added `IsThis'.
7621         (LocalInfo.IsThis): New public property.
7622         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7623
7624 2004-08-01  Martin Baulig  <martin@ximian.com>
7625
7626         * class.cs (TypeContainer.GetClassBases): Don't set the default
7627         here since we may get called from GetPartialBases().
7628         (TypeContainer.DefineType): If GetClassBases() didn't return a
7629         parent, use the default one.
7630
7631 2004-07-30  Martin Baulig  <martin@ximian.com>
7632
7633         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7634
7635         * class.cs (SourceMethod): New public class, derive from the
7636         symbol writer's ISourceMethod.
7637         (Method): Use the new symbol writer API.
7638
7639         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7640         as argument and use the new symbol writer.
7641
7642         * location.cs
7643         (SourceFile): Implement the symbol writer's ISourceFile.
7644         (Location.SymbolDocument): Removed.
7645         (Location.SourceFile): New public property.
7646
7647         * symbolwriter.cs: Use the new symbol writer API.
7648
7649 2004-07-30  Raja R Harinath  <rharinath@novell.com>
7650
7651         * Makefile (install-local): Remove.  Functionality moved to
7652         executable.make.
7653
7654 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
7655
7656         * Makefile: Install mcs.exe.config file together with mcs.exe.
7657         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7658         correct runtime version.
7659         
7660 2004-07-25  Martin Baulig  <martin@ximian.com>
7661
7662         * class.cs
7663         (TypeContainer.RegisterOrder): Removed, this was unused.
7664         (TypeContainer, interface_order): Removed.
7665         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7666         TypeContainer as argument since we can also be called with a
7667         `PartialContainer' for a partial class/struct/interface.
7668         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7669         of checking whether we're an `Interface' - we could be a
7670         `PartialContainer'.
7671         (PartialContainer.Register): Override; call
7672         AddClass()/AddStruct()/AddInterface() on our parent.
7673
7674         * cs-parser.jay (interface_member_declaration): Add things to the
7675         `current_container', not the `current_class'.
7676
7677         * rootcontext.cs (RegisterOrder): The overloaded version which
7678         takes an `Interface' was unused, removed.
7679
7680         * typemanager.cs (TypeManager.LookupInterface): Return a
7681         `TypeContainer', not an `Interface'.
7682         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7683         contain a `PartialContainer' for an interface, so check it's
7684         `Kind' to figure out what it is.
7685
7686 2004-07-25  Martin Baulig  <martin@ximian.com>
7687
7688         * class.cs (Class.DefaultTypeAttributes): New public constant.
7689         (Struct.DefaultTypeAttributes): Likewise.
7690         (Interface.DefaultTypeAttributes): Likewise.
7691         (PartialContainer.TypeAttr): Override this and add the
7692         DefaultTypeAttributes.
7693
7694 2004-07-25  Martin Baulig  <martin@ximian.com>
7695
7696         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7697         we can just use the `Parent' field instead.
7698
7699 2004-07-25  Martin Baulig  <martin@ximian.com>
7700
7701         * class.cs (TypeContainer.Emit): Renamed to EmitType().
7702
7703 2004-07-25  Martin Baulig  <martin@ximian.com>
7704
7705         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7706         our parts before defining any methods.
7707         (TypeContainer.VerifyImplements): Make this virtual.
7708         (ClassPart.VerifyImplements): Override and call VerifyImplements()
7709         on our PartialContainer.
7710
7711 2004-07-25  Martin Baulig  <martin@ximian.com>
7712
7713         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7714
7715         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7716         argument, we can just use the `Parent' field instead.
7717
7718         * class.cs
7719         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
7720         (MemberBase.DoDefine): Likewise.
7721
7722 2004-07-24  Martin Baulig  <martin@ximian.com>
7723
7724         * decl.cs (MemberCore.Parent): New public field.
7725         (DeclSpace.Parent): Moved to MemberCore.
7726
7727         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7728         (MemberBase.ctor): Added TypeContainer argument, pass it to our
7729         parent's .ctor.
7730         (FieldBase, Field, Operator): Likewise.
7731         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7732         (EventField, Event): Likewise.
7733
7734 2004-07-23  Martin Baulig  <martin@ximian.com>
7735
7736         * class.cs (PartialContainer): New public class.
7737         (ClassPart): New public class.
7738         (TypeContainer): Added support for partial classes.
7739         (TypeContainer.GetClassBases): Splitted some of the functionality
7740         out into GetNormalBases() and GetPartialBases().
7741
7742         * cs-tokenizer.cs (Token.PARTIAL): New token.
7743         (Tokenizer.consume_identifier): Added some hacks to recognize
7744         `partial', but only if it's immediately followed by `class',
7745         `struct' or `interface'.
7746
7747         * cs-parser.jay: Added support for partial clases.
7748
7749 2004-07-23  Martin Baulig  <martin@ximian.com>
7750
7751         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
7752         a `DeclSpace' and also made it readonly.
7753         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
7754         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
7755         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
7756
7757         * cs-parser.jay: Pass the `current_class', not the
7758         `current_container' (at the moment, this is still the same thing)
7759         to a new Method, Property, Event, Indexer or Constructor.
7760
7761 2004-07-23  Martin Baulig  <martin@ximian.com>
7762
7763         * cs-parser.jay (CSharpParser): Added a new `current_class' field
7764         and removed the `current_interface' one.
7765         (struct_declaration, class_declaration, interface_declaration):
7766         Set `current_class' to the newly created class/struct/interface;
7767         set their `Bases' and call Register() before parsing their body.
7768
7769 2004-07-23  Martin Baulig  <martin@ximian.com>
7770
7771         * class.cs (Kind): New public enum.
7772         (TypeContainer): Made this class abstract.
7773         (TypeContainer.Kind): New public readonly field.
7774         (TypeContainer.CheckDef): New public method; moved here from
7775         cs-parser.jay.
7776         (TypeContainer.Register): New public abstract method.
7777         (TypeContainer.GetPendingImplementations): New public abstract
7778         method.
7779         (TypeContainer.GetClassBases): Removed the `is_class' and
7780         `is_iface' parameters.
7781         (TypeContainer.DefineNestedTypes): Formerly known as
7782         DoDefineType().
7783         (ClassOrStruct): Made this class abstract.
7784
7785         * tree.cs (RootTypes): New public type. 
7786
7787 2004-07-20  Martin Baulig  <martin@ximian.com>
7788
7789         * tree.cs (Tree.RecordNamespace): Removed.
7790         (Tree.Namespaces): Removed.
7791
7792         * rootcontext.cs (RootContext.IsNamespace): Removed.
7793
7794         * cs-parser.jay (namespace_declaration): Just create a new
7795         NamespaceEntry here.
7796
7797 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
7798
7799         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
7800         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
7801         entry to make sure it runs in the correct runtime version.
7802         
7803 2004-07-18  Martin Baulig  <martin@ximian.com>
7804
7805         * generic.cs (ConstructedType.CheckConstraints): Improved
7806         constraints checking.
7807
7808 2004-07-18  Martin Baulig  <martin@ximian.com>
7809
7810         * expression.cs (Invocation.BetterMethod): Call
7811         TypeManager.TypeToCoreType() on all types and removed my previous
7812         hack; we're already doig the right thing here.
7813
7814 2004-07-17  Martin Baulig  <martin@ximian.com>
7815
7816         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
7817
7818 2004-07-16  Martin Baulig  <martin@ximian.com>
7819
7820         * iterators.cs: Added generics support.
7821
7822 2004-07-16  Martin Baulig  <martin@ximian.com>
7823
7824         * iterators.cs: Rewrote this.  We're now using one single Proxy
7825         class for both the IEnumerable and the IEnumerator interface and
7826         `Iterator' derives from Class so we can use the high-level API.
7827
7828         * class.cs (TypeContainer.AddIterator): New method.
7829         (TypeContainer.DoDefineType): New protected virtual method, which
7830         is called from DefineType().
7831         (TypeContainer.DoDefineMembers): Call DefineType() and
7832         DefineMembers() on all our iterators.
7833         (TypeContainer.Emit): Call Emit() on all our iterators.
7834         (TypeContainer.CloseType): Call CloseType() on all our iterators.
7835
7836         * codegen.cs (EmitContext.CurrentIterator): New public field.
7837
7838 2004-07-15  Martin Baulig  <martin@ximian.com>
7839
7840         * typemanager.cs
7841         (TypeManager.not_supported_exception_type): New type.   
7842
7843 2004-07-14  Martin Baulig  <martin@ximian.com>
7844
7845         * typemanager.cs
7846         (TypeManager.generic_ienumerable_type): New type.
7847         (TypeManager.generic_ienumerator_type): New type.
7848
7849         * rootcontext.cs
7850         (RootContext.interfaces_first_stage): Added
7851         "System.Collections.Generic.IEnumerator`1" and
7852         "System.Collections.Generic.IEnumerable`1".     
7853
7854 2004-07-14  Martin Baulig  <martin@ximian.com>
7855
7856         * iterators.cs: Use real error numbers.
7857
7858 2004-07-14  Martin Baulig  <martin@ximian.com>
7859
7860         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
7861         requires this to be a System.Collection.IEnumerable and not a
7862         class implementing that interface.
7863         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
7864
7865 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
7866
7867         * class.cs: Fixed previous fix, it broke some error tests.
7868
7869 2004-07-12  Martin Baulig  <martin@ximian.com>
7870
7871         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
7872         Fixes #61293.
7873
7874 2004-07-14  Martin Baulig  <martin@ximian.com>
7875
7876         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
7877         an exclamation mark (!) for the generic arity to reflect the
7878         latest spec changes; ie. use "System.Collections.Generic.IList`1".
7879
7880 2004-07-13  Martin Baulig  <martin@ximian.com>
7881
7882         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
7883         specifiers being part of a type argument.
7884
7885 2004-07-13  Martin Baulig  <martin@ximian.com>
7886
7887         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
7888         name for generic types.
7889
7890 2004-07-13  Martin Baulig  <martin@ximian.com>
7891
7892         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
7893         bit to fix #60119.
7894
7895 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
7896
7897         * assign.cs (LocalTemporary): Add new argument: is_address,If
7898         `is_address' is true, then the value that we store is the address
7899         to the real value, and not the value itself.
7900         
7901         * ecore.cs (PropertyExpr): use the new local temporary
7902         stuff to allow us to handle X.Y += z (where X is a struct)
7903
7904 2004-07-08  Martin Baulig  <martin@ximian.com>
7905
7906         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7907         not always return, just like we're doing in Using.Resolve().
7908
7909 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
7910
7911         * cs-parser.jay (fixed_statement): flag this as Pinned.
7912
7913 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
7914
7915         * typemanager.cs (TypeManager): Removed MakePinned method, this
7916         mechanism is replaced with the .NET 2.x compatible mechanism of
7917         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7918
7919         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
7920         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7921         `IsFixed' property which has a different meaning.
7922
7923 2004-07-02  Raja R Harinath  <rharinath@novell.com>
7924
7925         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7926         visible from inside a nested class, not just the names of the
7927         immediately enclosing class.
7928         Fix for bug #60730.
7929
7930 2004-06-24  Raja R Harinath  <rharinath@novell.com>
7931
7932         * expression.cs (BetterConversion): Remove buggy special-case
7933         handling of "implicit constant expression conversions".  At this
7934         point, we already know that the conversion is possible -- we're
7935         only checking to see which is better.
7936
7937 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7938
7939         * cs-parser.jay: Added error CS0210 test.
7940
7941 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7942
7943         * cs-parser.jay: Added error CS0134 test.
7944
7945 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7946
7947         Fix bug #52507
7948         * cs-parser.jay: Added error CS0145 test.
7949
7950 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7951
7952         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7953
7954 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
7955         
7956         * expression.cs (StackAlloc.Resolve): The argument may not
7957         be a constant; deal with this case.
7958         
7959 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
7960
7961         * attribute.cs (IndexerName_GetIndexerName): Renamed to
7962         GetIndexerAttributeValue.
7963         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7964
7965         * class.cs (Indexer.Define): Added error tests for CS0415,
7966         CS0609.
7967
7968 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
7969
7970         * attribute.cs (Attribute.Resolve): Keep field code in sync with
7971         property code.
7972
7973 2004-06-23  Martin Baulig  <martin@ximian.com>
7974
7975         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7976         neither return nor throw, reset the barrier as well.  Fixes #60457.
7977
7978 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
7979
7980         * class.cs : EventAttributes is now set to None by default.
7981           This fixes bug #60459.
7982
7983 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7984
7985         Fix bug #60219
7986         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7987         Don't throw exception but return null (it's sufficient now).
7988
7989 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7990
7991         * typemanager.cs (GetArgumentTypes): Faster implementation.
7992
7993 2004-06-18  Martin Baulig  <martin@ximian.com>
7994
7995         * attribute.cs (Attribute.Resolve): Check whether we're an
7996         EmptyCast which a Constant child.  Fixes #60333.
7997
7998 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
7999
8000         * statement.cs (EmitCollectionForeach): Account for the fact that
8001         not all valuetypes are in areas which we can take the address of.
8002         For these variables, we store to a temporary variable. Also, make
8003         sure that we dont emit a `callvirt' on a valuetype method.
8004
8005 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8006
8007         * expression.cs (StackAlloc.DoReSolve): Added test for
8008         negative parameter (CS0247).
8009
8010 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8011
8012         Fix bug #59792
8013         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8014
8015 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8016
8017         Fix bug #59781
8018         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8019         ulong.
8020
8021 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8022
8023         Fix bug #58254 & cs1555.cs, cs1556.cs
8024         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8025
8026 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8027
8028         * cs-parser.jay: Added error CS1669 test for indexers.
8029
8030 2004-06-18  Martin Baulig  <martin@ximian.com>
8031
8032         * generics.cs (GenericMethod.ctor): Don't take an Attributes
8033         argument.  Fixes #60441.
8034
8035 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
8036         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8037         The name needs to have the actual name of the method in order
8038         for other tests (such as the one in OverloadResolve for Invoke
8039         on a delegate) to work. As well, it does not really help
8040         error reporting because the method group had multiple methods.
8041         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8042         Make profiling work.
8043         
8044 2004-06-13  Martin Baulig  <martin@ximian.com>
8045
8046         * cs-parser.jay: Don't allow generic attributes.
8047
8048 2004-06-13  Martin Baulig  <martin@ximian.com>
8049
8050         * class.cs (MemberBase.DoDefineBase): New protected method.
8051         (MemberBase.DoDefine): Compute the `flags' in the new
8052         DoDefineBase() which must be called first.
8053         (Method.Define): Call DoDefineBase() first so we have the flags
8054         when defining the generic method.
8055
8056         * cs-parser.jay (interface_method_declaration): Support generic methods.
8057
8058 2004-06-13  Martin Baulig  <martin@ximian.com>
8059
8060         * decl.cs (TypeName): Removed.
8061         (MemberName): Removed TypeName and MemberNow; now we just have
8062         MemberName.
8063
8064         * cs-parser.jay: Don't distinguish between type arguments and type
8065         parameters in the grammar and simplified the rules a bit.  The
8066         reduce/reduce conflicts are now gone (except the one we inherited
8067         from mcs).
8068
8069 2004-06-11  Martin Baulig  <martin@ximian.com>
8070
8071         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8072         call this twice: for params and varargs methods.
8073
8074 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8075
8076         * class.cs:
8077         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8078
8079 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8080
8081         * attribute.cs (Attribute.GetValidTargets): Made public.
8082
8083         * class.cs: 
8084         (AbstractPropertyEventMethod): New class for better code sharing.
8085         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8086         CS1667 report.
8087         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8088
8089 2004-06-09  Martin Baulig  <martin@ximian.com>
8090
8091         * cs-parser.jay: Removed a reduce/reduce conflict.
8092
8093 2004-06-03  Martin Baulig  <martin@ximian.com>
8094
8095         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8096         GetSimpleName() and return a SimpleName.
8097
8098         * ecore.cs (SimpleName.Arguments): New public field.
8099         (SimpleName): Added overloaded ctor which takes an additional
8100         TypeArguments argument.
8101         (SimpleName.SimpleNameResolve): Added support for generic methods.
8102         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
8103         formerly in MemberAccess.DoResolve(), but we also need it in
8104         SimpleNameResolve().
8105
8106         * expression.cs (MemberAccess.DoResolve): Use the new
8107         MethodGroupExpr.ResolveGeneric().       
8108
8109 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8110
8111         * decl.cs: If possible, use lookuptypedirect here. We can only do
8112         this if there is no `.' after the namespace. Avoids using
8113         LookupType, which does lots of slow processing.
8114         (FindNestedType) New method, does what it says :-).
8115         * namespace.cs: use LookupTypeDirect.
8116         * rootcontext.cs: use membercache, if possible.
8117         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8118
8119 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8120
8121         * expression.cs:
8122         According to the spec, 
8123
8124         In a member access of the form E.I, if E is a single identifier,
8125         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8126         field, property, localvariable, or parameter with the same type as
8127         the meaning of E as a type-name (§3.8), then both possible
8128         meanings of E are permitted.
8129
8130         We did not check that E as a simple-name had the same type as E as
8131         a type name.
8132
8133         This trivial check gives us 5-7% on bootstrap time.
8134
8135 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8136
8137         * expression.cs (Invocation.OverloadResolve): Avoid the
8138         use of hashtables and boxing here by allocating on demand.
8139
8140 2004-05-30  Martin Baulig  <martin@ximian.com>
8141
8142         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8143         we're doing a silent lookup.  Don't try to lookup nested types in
8144         TypeManager.object_type (thanks to Ben Maurer).
8145
8146 2004-05-30  Martin Baulig  <martin@ximian.com>
8147
8148         Committing a patch from Ben Maurer.
8149
8150         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8151
8152 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8153
8154         * convert.cs: add a trivial cache for overload operator resolution.
8155
8156 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
8157
8158         * attribute.cs
8159         (AttributeTester.GetObsoleteAttribute): Returns instance of
8160         ObsoleteAttribute when type is obsolete.
8161
8162         * class.cs
8163         (TypeContainer.VerifyObsoleteAttribute): Override.
8164         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8165         (MethodCode.VerifyObsoleteAttribute): Override.
8166         (MemberBase.VerifyObsoleteAttribute): Override.
8167
8168         * decl.cs
8169         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8170         and report proper error.
8171
8172         *delegate.cs
8173         (Delegate.VerifyObsoleteAttribute): Override.
8174
8175         * ecore.cs
8176         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8177         and report proper error.
8178         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8179
8180         * enum.cs
8181         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8182         and enum member.
8183
8184         * expression.cs
8185         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8186         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8187         Added test for ObsoleteAttribute.
8188
8189         * statement.cs
8190         (Catch): Derived from Statement.
8191
8192 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8193
8194         * decl.cs: If possible, use lookuptypedirect here. We can only do
8195         this if there is no `.' after the namespace. Avoids using
8196         LookupType, which does lots of slow processing.
8197         (FindNestedType) New method, does what it says :-).
8198         * namespace.cs: use LookupTypeDirect.
8199         * rootcontext.cs: use membercache, if possible.
8200         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8201
8202 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8203
8204         * expression.cs:
8205         According to the spec, 
8206
8207         In a member access of the form E.I, if E is a single identifier,
8208         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8209         field, property, localvariable, or parameter with the same type as
8210         the meaning of E as a type-name (§3.8), then both possible
8211         meanings of E are permitted.
8212
8213         We did not check that E as a simple-name had the same type as E as
8214         a type name.
8215
8216         This trivial check gives us 5-7% on bootstrap time.
8217
8218 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8219
8220         Fixed bug #59071 & cs0160.cs
8221         * statement.cs (Try.Resolve): Check here whether order of catch
8222         clauses matches their dependencies.
8223
8224 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8225
8226         Fixed bug #58624
8227         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8228         unsafe type.
8229
8230 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8231
8232         * expression.cs (Invocation.OverloadResolve): Avoid the
8233         use of hashtables and boxing here by allocating on demand.
8234
8235 2004-05-30  Martin Baulig  <martin@ximian.com>
8236
8237         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8238         we're doing a silent lookup.  Don't try to lookup nested types in
8239         TypeManager.object_type (thanks to Ben Maurer).
8240
8241 2004-05-30  Martin Baulig  <martin@ximian.com>
8242
8243         Committing a patch from Ben Maurer.
8244
8245         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
8246
8247 2004-05-29  Martin Baulig  <martin@ximian.com>
8248
8249         * class.cs (IMethodData.ShouldIgnore): New method.
8250
8251         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8252         `Location' argument, we don't need it anywhere.  Use
8253         `IMethodData.ShouldIgnore ()' instead of
8254         `MethodData.GetMethodFlags ()'.
8255         (TypeManager.AddMethod): Removed.
8256         (TypeManager.AddMethod2): Renamed to AddMethod.
8257
8258 2004-05-29  Martin Baulig  <martin@ximian.com>
8259
8260         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8261
8262         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8263         converting from a class type S to an interface type and we already
8264         have an object on the stack, don't box it again.  Fixes #52578.
8265
8266 2004-05-29  Martin Baulig  <martin@ximian.com>
8267
8268         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8269         Added support for `params' parameters.  Fixes #59267.
8270
8271 2004-05-29  Martin Baulig  <martin@ximian.com>
8272
8273         * literal.cs (NullPointer): Provide a private .ctor which sets
8274         `type' to TypeManager.object_type.  Fixes #59048.
8275
8276 2004-05-29  Martin Baulig  <martin@ximian.com>
8277
8278         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8279         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8280
8281         * ecore.cs (EventExpr.instance_expr): Make the field private.
8282
8283 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8284
8285         Fixed bug #50080 & cs0214-2.cs
8286         * expression.cs (Cast.DoResolve): Check unsafe context here.
8287         
8288         * statement.cs (Resolve.DoResolve): Likewise.
8289
8290 2004-05-26  Martin Baulig  <martin@ximian.com>
8291
8292         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8293
8294         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8295         (RootContext.LookupType): Pass down the `silent' flag.
8296
8297 2004-05-25  Martin Baulig  <martin@ximian.com>
8298
8299         * expression.cs
8300         (MethodGroupExpr.IdenticalTypeName): New public property.
8301         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8302         expression actually refers to a type.
8303
8304 2004-05-25  Martin Baulig  <martin@ximian.com>
8305
8306         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8307         for #56176 and made it actually work.
8308
8309 2004-05-25  Martin Baulig  <martin@ximian.com>
8310
8311         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8312         (FieldExpr, PropertyExpr): Override and implement
8313         CacheTemporaries.  Fixes #52279.
8314
8315 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8316
8317         * location.cs: In the new compiler listing a file twice is a
8318         warning, not an error.
8319
8320 2004-05-24  Martin Baulig  <martin@ximian.com>
8321
8322         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8323         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8324
8325 2004-05-24  Martin Baulig  <martin@ximian.com>
8326
8327         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8328         walking the `using' list.  Fixes #53921.
8329
8330 2004-05-24  Martin Baulig  <martin@ximian.com>
8331
8332         * const.cs (Const.LookupConstantValue): Added support for
8333         EmptyCast's; fixes #55251.
8334
8335 2004-05-24  Martin Baulig  <martin@ximian.com>
8336
8337         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8338         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8339         which does the CS0135 check.  The reason is that we first need to
8340         check whether the variable actually exists.
8341
8342 2004-05-24  Martin Baulig  <martin@ximian.com>
8343
8344         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8345         than RootContext.LookupType() to find the explicit interface
8346         type.  Fixes #58584.
8347
8348 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8349
8350         * Makefile: Simplify.  Use executable.make.
8351         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8352
8353 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8354
8355         * decl.cs:
8356         * enum.cs:
8357         Use the invariant culture when doing String.Compare for CLS case
8358         sensitivity.
8359         
8360 2004-05-23  Martin Baulig  <martin@ximian.com>
8361
8362         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8363         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8364
8365         * namespace.cs (NamespaceEntry.Lookup): Likewise.
8366
8367 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8368
8369         * class.cs (MemberBase.Define): Reuse MemberType member for 
8370         resolved type. Other methods can use it too.
8371
8372 2004-05-23  Martin Baulig  <martin@ximian.com>
8373
8374         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8375         the variable also exists in the current block (otherwise, we need
8376         to report a CS0103).  Fixes #58670.
8377
8378 2004-05-23  Martin Baulig  <martin@ximian.com>
8379
8380         * flowanalysis.cs (Reachability.Reachable): Compute this
8381         on-the-fly rather than storing it as a field.
8382
8383 2004-05-23  Martin Baulig  <martin@ximian.com>
8384
8385         * flowanalysis.cs (Reachability.And): Manually compute the
8386         resulting `barrier' from the reachability.      
8387        
8388 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8389
8390         Fix bug #57835
8391         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8392         instance of ObsoleteAttribute when symbol is obsolete.
8393
8394         * class.cs
8395         (IMethodData): Extended interface for ObsoleteAttribute support.
8396
8397 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8398
8399         * attribute.cs: Fix bug #55970
8400
8401 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8402
8403         Fix bug #52705
8404         * attribute.cs
8405         (GetObsoleteAttribute): New method. Creates the instance of
8406         ObsoleteAttribute.
8407         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8408         ObsoleteAttribute when member is obsolete.
8409         (AttributeTester.Report_ObsoleteMessage): Common method for
8410         Obsolete error/warning reporting.
8411
8412         * class.cs
8413         (TypeContainer.base_classs_type): New member for storing parent type.
8414
8415         * decl.cs
8416         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8417         for this MemberCore.
8418
8419 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8420
8421         * attribute.cs, const.cs: Fix bug #58590
8422
8423 2004-05-21  Martin Baulig  <martin@ximian.com>
8424
8425         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8426         out parameters if the end of the method is unreachable.  Fixes
8427         #58098. 
8428
8429 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8430
8431         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8432         Hari was right, why extra method.
8433
8434 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8435
8436         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8437
8438 2004-05-20  Martin Baulig  <martin@ximian.com>
8439
8440         * delegate.cs: Convert this file to Unix mode - like the original
8441         version in mcs is.
8442
8443 2004-05-20  Martin Baulig  <martin@ximian.com>
8444
8445         * attribute.cs: Convert this file to Unix mode - like the original
8446         version in mcs is.
8447
8448 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8449
8450        Fix bug #58688 (MCS does not report error when the same attribute
8451        is assigned twice)
8452
8453        * attribute.cs (Attribute.Emit): Distinction between null and default.
8454
8455 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8456
8457        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8458        of a top-level attribute without an attribute target.
8459        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8460        Make non-static.
8461        (Attribute.Conditional_GetConditionName), 
8462        (Attribute.Obsolete_GetObsoleteMessage): Update.
8463        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8464        part of ScanForIndexerName.
8465        (Attribute.CanIgnoreInvalidAttribute): New function.
8466        (Attribute.ScanForIndexerName): Move to ...
8467        (Attributes.ScanForIndexerName): ... here.
8468        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8469        (Attributes.Search): New internal variant that can choose not to
8470        complain if types aren't resolved.  The original signature now
8471        complains.
8472        (Attributes.GetClsCompliantAttribute): Use internal variant, with
8473        complaints suppressed.
8474        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8475        only if it not useful.
8476        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8477        top-level for attributes that are shared between the assembly
8478        and a top-level class.
8479        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8480        * class.cs: Update to reflect changes.
8481        (DefineIndexers): Fuse loops.
8482        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
8483        a couple more variants of attribute names.
8484
8485 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
8486
8487         Fix bug #52585 (Implemented explicit attribute declaration)
8488
8489         * attribute.cs:
8490         (Attributable.ValidAttributeTargets): New abstract method. It gets
8491         list of valid attribute targets for explicit target declaration.
8492         (Attribute.Target): It holds target itself.
8493         (AttributeSection): Removed.
8494         (Attribute.CheckTargets): New method. It checks whether attribute
8495         target is valid for the current element.
8496
8497         * class.cs:
8498         (EventProperty): New class. For events that are declared like
8499         property (with add and remove accessors).
8500         (EventField): New class. For events that are declared like field.
8501         class.cs
8502
8503         * cs-parser.jay: Implemented explicit attribute target declaration.
8504
8505         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
8506         Override ValidAttributeTargets.
8507
8508         * parameter.cs:
8509         (ReturnParameter): Class for applying custom attributes on 
8510         the return type.
8511         (ParameterAtribute): New class. Class for applying custom
8512         attributes on the parameter type.
8513
8514 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
8515
8516         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8517         definitions. 
8518
8519         (Method): Allow UNSAFE here.
8520
8521         * modifiers.cs: Support unsafe reporting.
8522
8523 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
8524
8525         * decl.cs: Fix bug #58478.
8526
8527 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8528
8529         * statement.cs: When checking for unreachable code on an EmptyStatement,
8530         set the location. Fixes bug #58488.
8531
8532 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
8533
8534         * driver.cs: Add -pkg handling.
8535
8536         From Gonzalo: UseShelLExecute=false
8537
8538 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
8539
8540         * attribute.cs:
8541         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8542         for attribute.
8543         (Attribute.IsClsCompliaceRequired): Moved to base for better
8544         accesibility.
8545         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8546         when attribute is AttributeUsageAttribute.
8547         (Attribute.GetValidTargets): Simplified.
8548         (Attribute.GetAttributeUsage): New method returns AttributeUsage
8549         attribute for this type.
8550         (Attribute.ApplyAttributes): Method renamed to Emit and make
8551         non-static.
8552         (GlobalAttributeSection): New class for special handling of global
8553         attributes (assembly, module).
8554         (AttributeSection.Emit): New method.
8555
8556         * class.cs: Implemented Attributable abstract methods.
8557         (MethodCore.LabelParameters): Moved to Parameter class.
8558         (Accessor): Is back simple class.
8559         (PropertyMethod): Implemented Attributable abstract class.
8560         (DelegateMethod): Implemented Attributable abstract class.
8561         (Event): New constructor for disctintion between normal Event
8562         and Event with accessors.
8563
8564         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8565
8566         * codegen.cs, const.cs, decl.cs, delegate.cs:
8567         (CommonAssemblyModulClass): Implemented Attributable abstract class
8568         and simplified.
8569
8570         * enum.cs: Implement IAttributeSupport interface.
8571         (EnumMember): New class for emum members. Implemented Attributable
8572         abstract class
8573
8574         * parameter.cs:
8575         (ParameterBase): Is abstract.
8576         (ReturnParameter): New class for easier [return:] attribute handling.
8577
8578         * typemanager.cs: Removed builder_to_attr.
8579
8580 2004-05-11  Raja R Harinath  <rharinath@novell.com>
8581
8582         Fix bug #57151.
8583         * attribute.cs (Attribute.GetPositionalValue): New function.
8584         * class.cs (TypeContainer.VerifyMembers): New function.
8585         (TypeContainer.Emit): Use it.
8586         (ClassOrStruct): New base class for Class and Struct.
8587         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
8588         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8589         class.
8590         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8591         then each non-static field should have a FieldOffset attribute.
8592         Otherwise, none of the fields should have a FieldOffset attribute.
8593         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
8594         and FieldOffset attributes.
8595         * typemanager.cs (TypeManager.struct_layout_attribute_type)
8596         (TypeManager.field_offset_attribute_type): New core types.
8597         (TypeManager.InitCoreTypes): Initialize them.
8598
8599 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
8600
8601         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8602         Return correct type.
8603         From bug #58270.
8604
8605 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
8606
8607         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8608         be implicitly converted to ulong.
8609         
8610         * expression.cs: The logic for allowing operator &, | and ^ worked
8611         was wrong, it worked before because we did not report an error in
8612         an else branch.  Fixes 57895.
8613
8614         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8615         allow volatile fields to be reference types.
8616
8617 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
8618
8619         * driver.cs: Add support for /debug-
8620
8621 2004-05-07  Raja R Harinath  <rharinath@novell.com>
8622
8623         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
8624         Add a 'complain' parameter to silence errors.
8625         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
8626         silently overlooked type-resolutions.
8627         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8628         to reflect changes.
8629         (Attributes.Search): New function.
8630         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8631         (Attributes.GetAttributeFullName): Remove hack.
8632         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
8633         Update to reflect changes.
8634         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8635         Use Attributes.Search instead of nested loops.
8636
8637 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
8638
8639         * decl.cs:
8640         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
8641         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
8642         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
8643
8644         * report.cs: (Report.Warning): Renamed to Warning_T because of
8645         parameter collision.
8646
8647 2004-05-05  Raja R Harinath  <rharinath@novell.com>
8648
8649         * expression.cs (MemberAccess.ResolveMemberAccess):
8650         Exit with non-zero status after Report.Error.
8651         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
8652         Likewise.
8653         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
8654
8655 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
8656
8657         * support.cs: Don't hang when the file is empty.
8658
8659 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
8660
8661         * support.cs: In SeekableStreamReader, compute the preamble size of the
8662           underlying stream. Position changes should take into account that initial
8663           count of bytes.
8664
8665 2004-05-03  Todd Berman  <tberman@sevenl.net>
8666
8667         * driver.cs: remove unused GetSysVersion function.
8668
8669 2004-05-03  Todd Berman  <tberman@sevenl.net>
8670
8671         * driver.cs: Remove the hack from saturday, as well as the hack
8672         from jackson (LoadAssemblyFromGac), also adds the CWD to the
8673         link_paths to get that bit proper.
8674
8675 2004-05-01  Todd Berman  <tberman@sevenl.net>
8676
8677         * driver.cs: Try a LoadFrom before a Load, this checks the current
8678         path. This is currently a bug in mono that is be fixed, however, this
8679         provides a workaround for now. This will be removed when the bug
8680         is fixed.
8681
8682 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
8683
8684         * CryptoConvert.cs: Updated to latest version. Fix issue with 
8685         incomplete key pairs (#57941).
8686
8687 2004-05-01  Todd Berman  <tberman@sevenl.net>
8688
8689         * driver.cs: Remove '.' from path_chars, now System.* loads properly
8690         from the GAC
8691
8692 2004-04-30  Jackson Harper  <jackson@ximian.com>
8693
8694         * codegen.cs: Open keys readonly.
8695         
8696 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8697
8698         * typemanager.cs: don't report cyclic struct layout when a struct
8699         contains 2 or more fields of the same type. Failed for Pango.AttrShape
8700         which has 2 Pango.Rectangle fields.
8701
8702 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8703
8704         * expression.cs: Handle IntPtr comparisons with IL code
8705         rather than a method call.
8706
8707 2004-04-29  Martin Baulig  <martin@ximian.com>
8708
8709         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
8710         the list of PropertyInfo's in class hierarchy and find the
8711         accessor.  Fixes #56013.
8712
8713 2004-04-29  Martin Baulig  <martin@ximian.com>
8714
8715         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
8716
8717 2004-04-29  Martin Baulig  <martin@ximian.com>
8718
8719         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8720
8721         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
8722
8723 2004-04-29  Martin Baulig  <martin@ximian.com>
8724
8725         * class.cs (ConstructorInitializer.Resolve): Check whether the
8726         parent .ctor is accessible.  Fixes #52146.
8727
8728 2004-04-29  Martin Baulig  <martin@ximian.com>
8729
8730         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8731
8732         * statement.cs (Using.EmitLocalVariableDecls): Use
8733         TypeManager.idisposable_type, not typeof (IDisposable).
8734         (Foreach.EmitCollectionForeach): Added support for valuetypes.
8735
8736 2004-04-29  Martin Baulig  <martin@ximian.com>
8737
8738         * class.cs (Event.Define): Don't emit the field and don't set
8739         RTSpecialName and SpecialName for events on interfaces.  Fixes
8740         #57703. 
8741
8742 2004-04-29  Raja R Harinath  <rharinath@novell.com>
8743
8744         Refactor Attribute.ApplyAttributes.
8745         * attribute.cs (Attributable): New base class for objects that can
8746         have Attributes applied on them.
8747         (Attribute): Make AttributeUsage fields public.
8748         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
8749         (Attribute.IsInternalCall): New property.
8750         (Attribute.UsageAttr): Convert to a public read-only property.
8751         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
8752         (Attribute.ResolveType, Attribute.Resolve)
8753         (Attribute.ScanForIndexerName): Update to reflect changes.
8754         (Attribute.CheckAttributeTarget): Re-format.
8755         (Attribute.ApplyAttributes): Refactor, to various
8756         Attributable.ApplyAttributeBuilder methods.
8757         * decl.cs (MemberCore): Make Attributable.
8758         * class.cs (Accessor): Make Attributable.
8759         (MethodData.ApplyAttributes): Use proper attribute types, not
8760         attribute names.
8761         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
8762         (TypeContainer.ApplyAttributeBuilder)
8763         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
8764         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
8765         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
8766         (Operator.ApplyAttributeBuilder): New factored-out methods.
8767         * const.cs (Const.ApplyAttributeBuilder): Likewise.
8768         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
8769         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
8770         * parameter.cs (ParameterBase): New Attributable base class
8771         that can also represent Return types.
8772         (Parameter): Update to the changes.
8773
8774 2004-04-29  Jackson Harper  <jackson@ximian.com>
8775
8776         * driver.cs: Prefer the corlib system version when looking for
8777         assemblies in the GAC. This is still a hack, but its a better hack
8778         now.
8779         
8780 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
8781
8782         * decl.cs, enum.cs: Improved error 3005 reporting.
8783   
8784         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
8785         (related_symbols): New private member for list of symbols
8786         related to reported error/warning.
8787         
8788         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
8789
8790 2004-04-29  Martin Baulig  <martin@ximian.com>
8791
8792         * ecore.cs (Expression.Constantify): If we're an enum and
8793         TypeManager.TypeToCoreType() doesn't give us another type, use
8794         t.UnderlyingSystemType.  Fixes #56178.  
8795
8796 2004-04-29  Martin Baulig  <martin@ximian.com>
8797
8798         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
8799         interfaces and for each interface, only add members directly
8800         declared in that interface.  Fixes #53255.
8801
8802 2004-04-28  Martin Baulig  <martin@ximian.com>
8803
8804         * expression.cs (ConditionalLogicalOperator): Use a temporary
8805         variable for `left' to avoid that we evaluate it more than once;
8806         bug #52588.
8807
8808 2004-04-28  Martin Baulig  <martin@ximian.com>
8809
8810         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
8811         `void[]' (CS1547).
8812
8813 2004-04-28  Martin Baulig  <martin@ximian.com>
8814
8815         * statement.cs (LocalInfo.Resolve): Check whether the type is not
8816         void (CS1547).
8817
8818         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
8819         whether the type is not void (CS1547).
8820
8821 2004-04-28  Martin Baulig  <martin@ximian.com>
8822
8823         * expression.cs (Unary.DoResolveLValue): Override this and report
8824         CS0131 for anything but Operator.Indirection.
8825
8826 2004-04-28  Martin Baulig  <martin@ximian.com>
8827
8828         Committing a patch from Ben Maurer; see bug #50820.
8829
8830         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8831         check for classes.
8832
8833         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8834         classes.        
8835
8836 2004-04-28  Martin Baulig  <martin@ximian.com>
8837
8838         Committing a patch from Ben Maurer; see bug #50820.
8839
8840         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8841         check for classes.
8842
8843         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8844         classes.        
8845
8846 2004-04-28  Martin Baulig  <martin@ximian.com>
8847
8848         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
8849         (Block.AddLabel): Call DoLookupLabel() to only search in the
8850         current block.
8851
8852 2004-04-28  Martin Baulig  <martin@ximian.com>
8853
8854         * cfold.cs (ConstantFold.BinaryFold): Added special support for
8855         comparing StringConstants and NullLiterals in Equality and Inequality.
8856
8857 2004-04-28  Jackson Harper  <jackson@ximian.com>
8858
8859         * driver.cs: Attempt to load referenced assemblies from the
8860         GAC. This is the quick and dirty version of this method that
8861         doesnt take into account versions and just takes the first
8862         canidate found. Will be good enough for now as we will not have more
8863         then one version installed into the GAC until I update this method.
8864
8865 2004-04-28  Martin Baulig  <martin@ximian.com>
8866
8867         * typemanager.cs (TypeManager.CheckStructCycles): New public
8868         static method to check for cycles in the struct layout.
8869
8870         * rootcontext.cs (RootContext.PopulateTypes): Call
8871         TypeManager.CheckStructCycles() for each TypeContainer.
8872         [Note: We only need to visit each type once.]
8873
8874 2004-04-28  Martin Baulig  <martin@ximian.com>
8875
8876         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
8877
8878         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
8879         success and added `out object value'.  Use a `bool resolved' field
8880         to check whether we've already been called rather than
8881         `ConstantValue != null' since this breaks for NullLiterals.
8882
8883 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8884
8885         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
8886         setting of this flag, since the 'set' method may be non-public.
8887
8888 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8889
8890         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
8891         check on current_vector.Block.
8892
8893 2004-04-27  Martin Baulig  <martin@ximian.com>
8894
8895         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
8896         a field initializer.  Fixes #56459.
8897
8898 2004-04-27  Martin Baulig  <martin@ximian.com>
8899
8900         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
8901         we're not attempting to use an indexer.  Fixes #52154.
8902
8903 2004-04-27  Martin Baulig  <martin@ximian.com>
8904
8905         * statement.cs (Return): Don't create a return label if we don't
8906         need it; reverts my change from January 20th.  Thanks to Ben
8907         Maurer for this.
8908
8909 2004-04-27  Martin Baulig  <martin@ximian.com>
8910
8911         According to the spec, `goto' can only leave a nested scope, but
8912         never enter it.
8913
8914         * statement.cs (Block.LookupLabel): Only lookup in the current
8915         block, don't recurse into parent or child blocks.
8916         (Block.AddLabel): Check in parent and child blocks, report
8917         CS0140/CS0158 if we find a duplicate.
8918         (Block): Removed this indexer for label lookups.
8919         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8920         this already does the error reporting for us.
8921
8922         * flowanalysis.cs
8923         (FlowBranching.UsageVector.Block): New public variable; may be null.
8924         (FlowBranching.CreateSibling): Added `Block' argument.
8925         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
8926         label for the target of a `goto' and check whether we're not
8927         leaving a `finally'.
8928
8929 2004-04-27  Martin Baulig  <martin@ximian.com>
8930
8931         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8932         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8933         just for returns).
8934
8935 2004-04-27  Martin Baulig  <martin@ximian.com>
8936
8937         * statement.cs (Block.AddLabel): Also check for implicit blocks
8938         and added a CS0158 check.
8939
8940 2004-04-27  Martin Baulig  <martin@ximian.com>
8941
8942         * flowanalysis.cs (FlowBranchingLoop): New class.
8943         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8944         UsageVector's instead of an ArrayList.
8945         (FlowBranching.Label): Likewise.
8946         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8947         (FlowBranching.AddBreakVector): New method.
8948
8949 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
8950
8951         * attribute.cs: Small regression fix: only convert the type if we
8952         the type is different, fixes System.Drawing build.
8953
8954 2004-04-27  Martin Baulig  <martin@ximian.com>
8955
8956         * attribute.cs (Attribute.Resolve): If we have a constant value
8957         for a named field or property, implicity convert it to the correct
8958         type.
8959
8960 2004-04-27  Raja R Harinath  <rharinath@novell.com>
8961
8962         * statement.cs (Block.Block): Implicit blocks share
8963         'child_variable_names' fields with parent blocks.
8964         (Block.AddChildVariableNames): Remove.
8965         (Block.AddVariable): Mark variable as "used by a child block" in
8966         every surrounding block.
8967         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8968         been used in a child block, complain about violation of "Invariant
8969         meaning in blocks" rule.
8970         * cs-parser.jay (declare_local_variables): Don't use
8971         AddChildVariableNames.
8972         (foreach_statement): Don't create an implicit block: 'foreach'
8973         introduces a scope.
8974
8975 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
8976
8977         * convert.cs (ImplicitNumericConversion): 0 is also positive when
8978         converting from 0L to ulong.  Fixes 57522.
8979
8980 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8981
8982         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8983         derived class hides via 'new' keyword field from base class (test-242.cs).
8984         TODO: Handle this in the more general way.
8985         
8986         * class.cs (CheckBase): Ditto.
8987
8988 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8989
8990         * decl.cs (caching_flags): New member for storing cached values
8991         as bit flags.
8992         (MemberCore.Flags): New enum where bit flags for caching_flags
8993         are defined.
8994         (MemberCore.cls_compliance): Moved to caching_flags.
8995         (DeclSpace.Created): Moved to caching_flags.
8996
8997         * class.cs: Use caching_flags instead of DeclSpace.Created
8998         
8999 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9000
9001         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9002         if we are only a derived class, not a nested class.
9003
9004         * typemanager.cs: Same as above, but do this at the MemberLookup
9005         level (used by field and methods, properties are handled in
9006         PropertyExpr).   Allow for the qualified access if we are a nested
9007         method. 
9008
9009 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9010
9011         * class.cs: Refactoring.
9012         (IMethodData): New inteface; Holds links to parent members
9013         to avoid member duplication (reduced memory allocation).
9014         (Method): Implemented IMethodData interface.
9015         (PropertyBase): New inner classes for get/set methods.
9016         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9017         (Event): New inner classes for add/remove methods.
9018         (Event.DelegateMethod): Implemented IMethodData interface.
9019
9020         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9021         EmitContext (related to class.cs refactoring).
9022
9023 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9024
9025         * delegate.cs (Delegate.VerifyApplicability): If the number of
9026         arguments are the same as the number of parameters, first try to
9027         verify applicability ignoring  any 'params' modifier on the last
9028         parameter.
9029         Fixes #56442.
9030
9031 2004-04-08  Martin Baulig  <martin@ximian.com>
9032
9033         Merged latest changes into gmcs.  Please keep this comment in
9034         here, it makes it easier for me to see what changed in MCS since
9035         the last time I merged.
9036
9037 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9038
9039         * class.cs (TypeContainer.AddIndexer): Use
9040         'ExplicitInterfaceName' to determine if interface name was
9041         explicitly specified.  'InterfaceType' is not initialized at this time.
9042         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9043         Indexers array is already in the required order.  Initialize
9044         'IndexerName' only if there are normal indexers.
9045         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9046         (TypeContainer.Emit): Emit DefaultMember attribute only if
9047         IndexerName is initialized.
9048         Fixes #56300.
9049
9050 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9051
9052         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9053         Fixes #57007
9054
9055 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9056
9057         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9058         attributes.
9059         Fix for #56456.
9060
9061         * attribute.cs (Attribute.Resolve): Check for duplicate named
9062         attributes.
9063         Fix for #56463.
9064
9065 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9066
9067         * iterators.cs (MarkYield): track whether we are in an exception,
9068         and generate code accordingly.  Use a temporary value to store the
9069         result for our state.
9070
9071         I had ignored a bit the interaction of try/catch with iterators
9072         since their behavior was not entirely obvious, but now it is
9073         possible to verify that our behavior is the same as MS .NET 2.0
9074
9075         Fixes 54814
9076
9077 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9078
9079         * iterators.cs: Avoid creating temporaries if there is no work to
9080         do. 
9081
9082         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9083         Enumerations, use TypeManager.EnumToUnderlying and call
9084         recursively. 
9085
9086         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9087         bug #57013
9088
9089         (This.Emit): Use EmitContext.EmitThis to emit our
9090         instance variable.
9091
9092         (This.EmitAssign): Ditto.
9093
9094         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9095         codepaths, we will move all the functionality into
9096         Mono.CSharp.This 
9097
9098         (FieldExpr.EmitAssign): Ditto.
9099
9100         This fixes several hidden bugs that I uncovered while doing a code
9101         review of this today.
9102
9103         * codegen.cs (EmitThis): reworked so the semantics are more clear
9104         and also support value types "this" instances.
9105
9106         * iterators.cs: Changed so that for iterators in value types, we
9107         do not pass the value type as a parameter.  
9108
9109         Initialization of the enumerator helpers is now done in the caller
9110         instead of passing the parameters to the constructors and having
9111         the constructor set the fields.
9112
9113         The fields have now `assembly' visibility instead of private.
9114
9115 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9116
9117         * expression.cs (Argument.Resolve): Check if fields passed as ref
9118         or out are contained in a MarshalByRefObject.
9119
9120         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9121         another compiler type.
9122
9123 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9124
9125         * class.cs (Indexer.Define): use the new name checking method.
9126         Also, return false on an error.
9127         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9128         (is_identifier_[start/part]_character): make static.
9129
9130 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9131
9132         * expression.cs (Binary.ResolveOperator): Do no append strings
9133         twice: since we can be invoked more than once (array evaluation)
9134         on the same concatenation, take care of this here.  Based on a fix
9135         from Ben (bug #56454)
9136
9137 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9138
9139         * codegen.cs: Fix another case where CS1548 must be reported (when 
9140         delay-sign isn't specified and no private is available #56564). Fix
9141         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9142         error when MCS is used on the MS runtime and we need to delay-sign 
9143         (which seems unsupported by AssemblyBuilder - see #56621).
9144
9145 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9146
9147         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9148         (TypeManager.ComputeNamespaces): Faster implementation for
9149         Microsoft runtime.
9150
9151         * compiler.csproj: Updated AssemblyName to mcs.
9152
9153 2004-05-11  Jackson Harper  <jackson@ximian.com>
9154
9155         * Makefile: Preserve MONO_PATH
9156         
9157 2004-05-11  Jackson Harper  <jackson@ximian.com>
9158
9159         * Makefile: Use mono and mcs to build gmcs
9160         
9161 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
9162
9163         * codegen.cs: Add patch from Robert Shade
9164         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9165         sync with mcs.
9166
9167 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
9168
9169         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9170         incomplete key pairs (#57941).
9171
9172 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9173
9174         * codegen.cs: Fix another case where CS1548 must be reported (when 
9175         delay-sign isn't specified and no private is available #56564). Fix
9176         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9177         error when MCS is used on the MS runtime and we need to delay-sign 
9178         (which seems unsupported by AssemblyBuilder - see #56621).
9179
9180 2004-04-29  Jackson Harper  <jackson@ximian.com>
9181
9182         * Makefile: Set MONO_PATH to use the bootstrap corlib
9183         * driver.cs: Check the GAC for referenced assemblies.
9184                 
9185 2004-04-29  Martin Baulig  <martin@ximian.com>
9186
9187         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9188
9189 2004-04-07  Martin Baulig  <martin@ximian.com>
9190
9191         * expression.cs (Binary.ResolveOperator): Added special case for
9192         Equality/Inequality between a type parameter and a null literal.
9193
9194 2004-04-07  Martin Baulig  <martin@ximian.com>
9195
9196         * convert.cs: Check null literal -> type parameter conversions.
9197
9198 2004-04-07  Martin Baulig  <martin@ximian.com>
9199
9200         * generic.cs (ConstructedType.CheckConstraints): Enforce the
9201         `class' and `struct' constraints.
9202
9203 2004-04-07  Martin Baulig  <martin@ximian.com>
9204
9205         * generic.cs (SpecialConstraint): New public enum.
9206         (Constraints.Resolve): Added support for the `class' and `struct'
9207         constraints.
9208
9209         * cs-parser.jay (type_parameter_constraint): Added support for the
9210         `class' and `struct' constraints.
9211
9212 2004-04-07  Martin Baulig  <martin@ximian.com>
9213
9214         * support.cs (GenericConstraints): Replaced `Types' by
9215         `ClassConstraint' and `InterfaceConstraints'; added
9216         `HasClassConstraint'.   
9217
9218 2004-04-07  Martin Baulig  <martin@ximian.com>
9219
9220         * generic.cs
9221         (Constraints.InterfaceConstraints): New public property.
9222         (Constraints.Types): Make this property public
9223         (TypeParameter): Implement IMemberContainer.
9224         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9225         instead of a TypeBuilder/MethodBuilder; pass the interface
9226         constraints to TypeManager.AddTypeParameter().
9227         (TypeParameter.DefineType): Just take an EmitContext and no
9228         TypeBuilder/MethodBuilder.  Use the new public API.
9229
9230         * typemanager.cs (TypeManager.AddTypeParameter): Added
9231         `TypeExpr[]' argument; add the interfaces to the
9232         `builder_to_ifaces' hash.
9233         (TypeManager.LookupMemberContainer): For
9234         GenericTypeParameterBuilders, get the TypeParameter from the
9235         `builder_to_type_param'.
9236         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9237         the TypeParameter and call FindMembers on it.
9238
9239 2004-04-07  Martin Baulig  <martin@ximian.com>
9240
9241         * class.cs
9242         (MethodCore.GenericMethod): Moved this field here from Method.
9243         (MethodCore.IsDuplicateImplementation): Take the number of type
9244         parameters into account if we're a generic method.
9245
9246         * expression.cs (Invocation.InferTypeArguments): Don't return true
9247         if `arguments' is null; we still need to check whether we actually
9248         don't need to infer anything in this case.
9249         (MemberAccess): Merged the functionality from GenericMemberAccess
9250         into this class.
9251
9252         * generic.cs (GenericMemberAccess): Removed.
9253
9254 2004-04-05  Martin Baulig  <martin@ximian.com>
9255
9256         * decl.cs (MemberCore): For generic classes, interfaces and
9257         structs, `Name' now includes the number of type parameters
9258         ("Stack!1.Node!1").
9259         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9260         encode the number of type arguments in the type name.
9261
9262         * expression.cs (Expression.MemberLookup): Removed the
9263         `num_type_args' argument; we now encode the number of type
9264         arguments in the type name.
9265
9266         * ecore.cs (SimpleName): Encode the number of type arguments in
9267         the type name itself.
9268
9269         * generic.cs (ConstructedType): Likewise.
9270
9271         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9272         `MemberName'; we now include the number of type parameters in the
9273         type name.
9274
9275         * typemanager.cs (TypeManager.CheckGeneric): Removed.
9276         (TypeManager.MemberLookup): Removed the
9277         `num_type_args' argument; we now encode the number of type
9278         arguments in the type name.     
9279
9280 2004-04-03  Martin Baulig  <martin@ximian.com>
9281
9282         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9283         (MemberCore.MemberName): Moved here from MemberBase.
9284         (DeclSpace.SetParameterInfo): Just take the constraints as an
9285         ArrayList; we already have the type parameters in our
9286         `MemberName'; also do the CS0080 reporting here.
9287
9288         * cs-parser.jay (struct_declaration): Use `member_name' instead of
9289         `IDENTIFIER opt_type_parameter_list'; when constructing our
9290         `MemberName', it'll already include our type parameters.
9291         (class_declaration, interface_declaration): Likewise.
9292         (delegate_declaration): Likewise.
9293         (MakeName): Take a MemberName and return a MemberName.
9294         The following two changes are required to avoid shift/reduce conflicts:
9295         (member_name): Don't include a TypeName anymore; ie. this is now
9296         just 'IDENTIFIER opt_type_parameter_list'.
9297         (property_declaration, event_declaration): Use a
9298         `namespace_or_type_name' instead of a `member_name'.            
9299
9300 2004-04-03  Martin Baulig  <martin@ximian.com>
9301
9302         * decl.cs (MemberName): Renamed to `TypeName' and created a new
9303         `MemberName' class.
9304         (TypeName): Formerly known as MemberName.
9305
9306         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9307         instead of a `MemberName'.
9308
9309         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9310         (member_name): New rule; create a MemberName.
9311
9312 2004-04-02  Martin Baulig  <martin@ximian.com>
9313
9314         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9315         (CS0305 and CS0308).
9316
9317 2004-04-02  Martin Baulig  <martin@ximian.com>
9318
9319         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9320         support for nested types.
9321
9322 2004-04-02  Martin Baulig  <martin@ximian.com>
9323
9324         * ecore.cs (IAlias): New public interface.
9325         (TypeExpr, TypeExpression): Implement IAlias.
9326         (TypeAliasExpression): New public class.
9327
9328         * namespace.cs (Namespace): Implement IAlias.
9329         (Namespace.Lookup): Return an IAlias instead on an object.
9330         (Namespace.DefineName): Take an IAlias instead of an object.
9331         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
9332         an object.
9333         (NamespaceEntry.UsingAlias): Take a Membername instead of an
9334         Expression.
9335         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
9336         object.
9337         (NamespaceEntry.Lookup): Likewise.
9338
9339         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
9340         instead of a Type.      
9341
9342         * decl.cs (DeclSpace): Implement IAlias.
9343         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
9344
9345         * generic.cs (ConstructedType): Improved error checking.
9346
9347 2004-04-02  Martin Baulig  <martin@ximian.com>
9348
9349         * convert.cs: Added type parameter conversions.
9350
9351         * ecore.cs
9352         (UnboxCast.Emit): Emit an `unbox.any' for type params.
9353         (ClassCast.Emit): If the source type is a type parameter, box it.
9354         If the target type is a type parameter, emit an `unbox.any'
9355         instead of a `classcast'.1      
9356
9357 2004-04-01  Martin Baulig  <martin@ximian.com>
9358
9359         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
9360
9361 2004-04-01  Martin Baulig  <martin@ximian.com>
9362
9363         * generic.cs (ConstructedType.CheckConstraints): Use
9364         Convert.ImplicitStandardConversionExists(); user-defined implicit
9365         conversions are not allowed according to the spec.
9366
9367 2004-03-30  Martin Baulig  <martin@ximian.com>
9368
9369         * expression.cs (New): Added support for type parameters.
9370
9371         * typemanager.cs
9372         (TypeManager.activator_type): New public static field.
9373         (TypeManager.activator_create_instance): Likewise.
9374
9375 2004-03-30  Martin Baulig  <martin@ximian.com>
9376
9377         * typemanager.cs (TypeManager.HasConstructorConstraint): New
9378         public method.
9379
9380 2004-03-30  Martin Baulig  <martin@ximian.com>
9381
9382         * generic.cs (ConstructedType.CheckConstraints): Actually follow
9383         the spec here: the argument type must be convertible to the
9384         constraints.
9385
9386 2004-03-30  Martin Baulig  <martin@ximian.com>
9387
9388         * generic.cs
9389         (TypeParameter.Define, TypeParameter.DefineMethod): Call
9390         TypeManager.AddTypeParameter().
9391         (ConstructedType.CheckConstraints): Re-enable this and actually
9392         check whether we have a constructor constraint.
9393
9394         * typemanager.cs
9395         (TypeManager.builder_to_type_param): New static field.
9396         (TypeManager.AddTypeParameter): New static method.
9397         (TypeManager.LookupTypeParameter): New public method.
9398
9399 2004-03-30  Martin Baulig  <martin@ximian.com>
9400
9401         * generic.cs (TypeParameter.DefineType): Return a boolean and use
9402         the new API to actually define the constructor constraint.
9403
9404         * typemanager.cs
9405         (TypeManager.new_constraint_attr_type): New static field.
9406         (TypeManager.InitCoreTypes): Initialize it.
9407
9408 2004-03-30  Martin Baulig  <martin@ximian.com>
9409
9410         * generic.cs (Constraints): Completed error checking, use correct
9411         error numbers.
9412
9413 2004-03-29  Martin Baulig  <martin@ximian.com>
9414
9415         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
9416
9417         * expression.cs (Invocation.InferTypeArguments): Added overloaded
9418         public version which takes a `ParameterData pd' instead of an
9419         `ArrayList args'.
9420
9421 2004-03-29  Martin Baulig  <martin@ximian.com>
9422
9423         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
9424         not a MethodInfo.       
9425
9426 2004-03-29  Martin Baulig  <martin@ximian.com>
9427
9428         * expression.cs (Argument.ResolveMethodGroup): If we're a
9429         ConstructedType, call GetMemberAccess() on it.  
9430
9431 2004-03-29  Martin Baulig  <martin@ximian.com>
9432
9433         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
9434         (MethodCore.CheckGenericOverride): When overriding a generic
9435         method, check whether the constraints match.
9436
9437         * support.cs (GenericConstraints): New public interface.
9438         (ParameterData.GenericConstraints): New public method.
9439
9440         * parameter.cs (Parameter.Resolve): Check whether we're a generic
9441         method parameter and compute our constraints if appropriate.
9442         (Parameter.GenericConstraints): New public property.
9443
9444         * generic.cs (Constraints): Implement GenericConstraints.
9445
9446 2004-03-29  Martin Baulig  <martin@ximian.com>
9447
9448         * decl.cs (MemberCache.FindMemberToOverride): Use
9449         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
9450
9451 2004-03-29  Martin Baulig  <martin@ximian.com>
9452
9453         * generic.cs (GenericMethod.Define): Resolve our type parameters.
9454
9455 2004-03-29  Martin Baulig  <martin@ximian.com>
9456
9457         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
9458         not allowed on non-generic declarations").
9459
9460 2004-03-29  Martin Baulig  <martin@ximian.com>
9461
9462         * expression.cs (Invocation.InferTypeArguments): Added overloaded
9463         public version of this method.
9464
9465         * class.cs (MethodCore.IsDuplicateImplementation): Use
9466         Invocation.InferTypeArguments() to check this.
9467
9468 2004-03-29  Martin Baulig  <martin@ximian.com>
9469
9470         * convert.cs: Use TypeManager.IsDelegateType() instead of
9471         comparing types correctly.
9472
9473 2004-03-29  Martin Baulig  <martin@ximian.com>
9474
9475         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
9476         types directly to make it work for generic instances.
9477
9478         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
9479
9480 2004-03-29  Martin Baulig  <martin@ximian.com>
9481
9482         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
9483         support for arrays.     
9484
9485 2004-03-24  Martin Baulig  <martin@ximian.com>
9486
9487         * decl.cs (DeclSpace.FindType): Also use
9488         TypeManager.CheckGeneric() for types from the using clauses.
9489
9490 2004-03-23  Martin Baulig  <martin@ximian.com>
9491
9492         * expression.cs (Invocation.OverloadResolve): Added `bool
9493         may_fail' argument and use it instead of the Location.IsNull() hack.
9494
9495 2004-03-23  Martin Baulig  <martin@ximian.com>
9496
9497         * expression.cs (Invocation.InferType): Use correct type inference
9498         rules here.     
9499
9500 2004-03-23  Martin Baulig  <martin@ximian.com>
9501
9502         * ecore.cs (MethodGroupExpr.Name): Use
9503         TypeManager.CSharpSignature() instead of just the name.
9504
9505         * expression.cs (Invocation.OverloadResolve): Provide better error
9506         reporting.
9507         (Invocation.DoResolve): OverloadResolve() never returns null
9508         without reporting an error, so removed the error -6 reporting here.
9509
9510 2004-03-23  Martin Baulig  <martin@ximian.com>
9511
9512         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
9513         generic methods.
9514
9515         * cs-parser.jay (delegate_declaration): Support generic delegates.
9516
9517         * delegate.cs: Support generic delegates.
9518
9519 2004-03-22  Martin Baulig  <martin@ximian.com>
9520
9521         * expression.cs (Invocation.InferParamsTypeArguments): New static
9522         method; does type inference for params arguments.
9523
9524 2004-03-21  Martin Baulig  <martin@ximian.com>
9525
9526         * typemanager.cs (TypeManager.IsGenericMethod): New public static
9527         method; checks whether a method is a generic method.    
9528
9529         * expression.cs (Invocation.InferTypeArguments): New static method;
9530         infer type arguments for generic method invocation.
9531
9532         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
9533         property; we set this to true if we're resolving a generic method
9534         invocation and the user specified type arguments, ie. we're not
9535         doing type inference.
9536
9537 2004-03-20  Martin Baulig  <martin@ximian.com>
9538
9539         * class.cs (MethodData.DeclaringType): New public property.
9540         (MethodData.Define): Set DeclaringType here.
9541         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
9542         instead of OperatorMethodBuilder.DeclaringType.
9543
9544 2004-03-20  Martin Baulig  <martin@ximian.com>
9545
9546         * cs-tokenizer.cs (xtoken): Return a special
9547         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
9548
9549         * cs-parser.jay (default_value_expression): Switch to the new
9550         syntax (14.5.13).
9551
9552 2004-03-19  Martin Baulig  <martin@ximian.com>
9553
9554         * decl.cs (MemberName): New class.  We use this to "construct"
9555         namespace_or_type_name's.
9556
9557         * generics.cs (TypeArguments.GetDeclarations): New public method;
9558         returns the type arguments as a string[] and reports a CS0081 if
9559         one of them is not an identifier.
9560
9561         * class.cs (MemberBase): The .ctor now takes the name as a
9562         MemberName instead of a string.
9563         (MemberBase.ExplicitInterfaceName): Changed type from string to
9564         Expression.
9565         (MemberBase.DoDefine): If we're an explicit implementation, the
9566         InterfaceType may be a generic instance.
9567
9568         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
9569         (namespace_name): Call MemberName.GetName () to transform the
9570         MemberName into a string and ensure we don't have any type
9571         arguments.
9572         (type_name): Call MemberName.GetTypeExpression() to transfrom the
9573         MemberName into an expression.
9574         (method_header): Use namespace_or_type_name instead of member_name.     
9575
9576 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9577
9578         * rootcontext.cs: Add new types to the boot resolution.
9579
9580         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9581         MulticastDelegate is not allowed.
9582
9583         * typemanager.cs: Add new types to lookup: System.TypedReference
9584         and ArgIterator.
9585
9586         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9587         check for TypedReference or ArgIterator, they are not allowed. 
9588
9589         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9590         makes us properly catch 1510 in some conditions (see bug 56016 for
9591         details). 
9592
9593 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9594
9595         * CryptoConvert.cs: update from corlib version
9596         with endian fixes.
9597
9598 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9599
9600         * class.cs (Indexer.Define): Check indexername declaration
9601
9602 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9603
9604         * attribute.cs (IsClsCompliant): Fixed problem with handling
9605         all three states (compliant, not-compliant, undetected).
9606
9607 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9608
9609         * attribute.cs (Attribute): Location is now public.
9610         (Resolve): Store resolved arguments (pos_values) in attribute class.
9611         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9612         (GetClsCompliantAttributeValue): New method that gets
9613         CLSCompliantAttribute value.
9614         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9615         if exists else null.
9616         (AttributeTester): New class for CLS-Compliant verification routines.
9617
9618         * class.cs (Emit): Add CLS-Compliant verification.
9619         (Method.GetSignatureForError): Implemented.
9620         (Constructor.GetSignatureForError): Implemented
9621         (Constructor.HasCompliantArgs): Returns if constructor has
9622         CLS-Compliant arguments.
9623         (Constructor.Emit): Override.
9624         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9625         is needed to test only parameters.
9626         (FieldBase.GetSignatureForError): Implemented.
9627         (TypeContainer): New member for storing base interfaces.
9628         (TypeContainer.FindMembers): Search in base interfaces too.
9629
9630         * codegen.cs (GetClsComplianceAttribute): New method that gets
9631         assembly or module CLSCompliantAttribute value.
9632         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9633         for assembly.
9634         (ModuleClass.Emit): Add error 3012 test.
9635
9636         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9637
9638         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9639         state for all decl types.
9640         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9641         if CLS-Compliant tests are required.
9642         (IsClsCompliaceRequired): New method. Analyze whether code
9643         must be CLS-Compliant.
9644         (IsExposedFromAssembly): New method. Returns true when MemberCore
9645         is exposed from assembly.
9646         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9647         value or gets cached value.
9648         (HasClsCompliantAttribute): New method. Returns true if MemberCore
9649         is explicitly marked with CLSCompliantAttribute.
9650         (IsIdentifierClsCompliant): New abstract method. This method is
9651         used to testing error 3005.
9652         (IsIdentifierAndParamClsCompliant): New method. Common helper method
9653         for identifier and parameters CLS-Compliant testing.
9654         (VerifyClsCompliance): New method. The main virtual method for
9655         CLS-Compliant verifications.
9656         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9657         null. I don't know why is null (too many public members !).
9658         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9659         and get value of first CLSCompliantAttribute that found.
9660
9661         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9662         (VerifyClsCompliance): Override and add extra tests.
9663
9664         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9665         clscheck- disable CLS-Compliant verification event if assembly is has
9666         CLSCompliantAttribute(true).
9667
9668         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9669         ApllyAttribute is now called in emit section as in the other cases.
9670         Possible future Emit integration.
9671         (IsIdentifierClsCompliant): New override.
9672         (VerifyClsCompliance): New override.
9673         (GetEnumeratorName): Returns full enum name.
9674
9675         * parameter.cs (GetSignatureForError): Implemented.
9676
9677         * report.cs (WarningData): New struct for Warning message information.
9678         (LocationOfPreviousError): New method.
9679         (Warning): New method. Reports warning based on the warning table.
9680         (Error_T): New method. Reports error based on the error table.
9681
9682         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9683         verifications are done here.
9684
9685         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9686
9687         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9688         CLSCompliantAttribute.
9689         (all_imported_types): New member holds all imported types from other
9690         assemblies.
9691         (LoadAllImportedTypes): New method fills static table with exported types
9692         from all referenced assemblies.
9693         (Modules): New property returns all assembly modules.
9694
9695 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
9696
9697         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9698         throwing a parser error.
9699
9700         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9701         which removes the hardcoded get_/set_ prefixes for properties, as
9702         IL allows for the properties to be named something else.  
9703
9704         Bug #56013
9705
9706         * expression.cs: Do not override operand before we know if it is
9707         non-null.  Fix 56207
9708
9709 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9710
9711         * typemanager.cs: support for pinned variables.
9712
9713 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9714
9715         * decl.cs, typemanager.cs: Avoid using an arraylist
9716         as a buffer if there is only one result set.
9717
9718 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9719
9720         * expression.cs: Make sure you cant call a static method
9721         with an instance expression, bug #56174.
9722
9723 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
9724
9725         * class.cs (IsDuplicateImplementation): Improve error reporting to
9726         flag 663 (method only differs in parameter modifier).
9727
9728         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9729         in preprocessor directives.
9730
9731         * location.cs (LookupFile): Allow for the empty path.
9732
9733         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
9734         better approach for some of that patch, but its failing with the
9735         CharSet enumeration.  For now try/catch will do.
9736
9737         * typemanager.cs: Do not crash if a struct does not have fields.
9738         Fixes 56150.
9739
9740 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9741
9742         * expression.cs: cs0213, cant fix a fixed expression.
9743         fixes 50231.
9744
9745 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9746
9747         * cs-parser.jay: detect invalid embeded statements gracefully.
9748         bug #51113.
9749
9750 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9751
9752         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9753         As a regex:
9754         s/
9755         the invocation type may not be a subclass of the tye of the item/
9756         The type of the item must be a subclass of the invocation item.
9757         /g
9758
9759         Fixes bug #50820.
9760
9761 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
9762
9763         * attribute.cs: Added methods to get a string and a bool from an
9764         attribute. Required to information from AssemblyKeyFileAttribute,
9765         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9766         * codegen.cs: Modified AssemblyName creation to include support for
9767         strongnames. Catch additional exceptions to report them as CS1548.
9768         * compiler.csproj: Updated include CryptoConvert.cs.
9769         * compiler.csproj.user: Removed file - user specific configuration.
9770         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
9771         Mono.Security assembly. The original class is maintained and tested in
9772         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9773         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9774         like CSC 8.0 (C# v2) supports.
9775         * Makefile: Added CryptoConvert.cs to mcs sources.
9776         * rootcontext.cs: Added new options for strongnames.
9777
9778 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
9779
9780         * driver.cs: For --expect-error, report error code `2'
9781         if the program compiled with no errors, error code `1' if
9782         it compiled with an error other than the one expected.
9783
9784 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
9785
9786         * compiler.csproj: Updated for Visual Studio .NET 2003.
9787         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9788         * compiler.sln: Updated for Visual Studio .NET 2003.
9789
9790 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
9791
9792         * expression.cs: Fix bug #47234. We basically need to apply the
9793         rule that we prefer the conversion of null to a reference type
9794         when faced with a conversion to 'object' (csc behaviour).
9795
9796 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9797
9798         * statement.cs: Shorter form for foreach, eliminates
9799         a local variable. r=Martin.
9800
9801 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9802
9803         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9804         checks if we can use brtrue/brfalse to test for 0.
9805         * expression.cs: use the above in the test for using brtrue/brfalse.
9806         cleanup code a bit.
9807
9808 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9809
9810         * expression.cs: Rewrite string concat stuff. Benefits:
9811
9812         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9813         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9814         rather than a concat chain.
9815
9816         * typemanager.cs: Add lookups for more concat overloads.
9817
9818 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9819
9820         * expression.cs: Emit shorter il code for array init.
9821
9822         newarr
9823         dup
9824         // set 1
9825
9826         // set 2
9827
9828         newarr
9829         stloc.x
9830
9831         ldloc.x
9832         // set 1
9833
9834         ldloc.x
9835         // set 2
9836
9837 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
9838
9839         * statement.cs: Before, two switch blocks would be merged if the
9840         total size of the blocks (end_item - begin_item + 1) was less than
9841         two times the combined sizes of the blocks.
9842
9843         Now, it will only merge if after the merge at least half of the
9844         slots are filled.
9845
9846         fixes 55885.
9847
9848 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
9849
9850         * class.cs : csc build fix for GetMethods(). See bug #52503.
9851
9852 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
9853
9854         * expression.cs: Make sure fp comparisons work with NaN.
9855         This fixes bug #54303. Mig approved this patch a long
9856         time ago, but we were not able to test b/c the runtime
9857         had a related bug.
9858
9859 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
9860
9861         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
9862
9863 2004-03-19  Martin Baulig  <martin@ximian.com>
9864
9865         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
9866         two overloads may unify for some type parameter substitutions and
9867         report a CS0408 if appropriate.
9868
9869 2004-03-19  Martin Baulig  <martin@ximian.com>
9870
9871         * class.cs (MemberCore.IsDuplicateImplementation): Report the
9872         error here and not in our caller.
9873
9874 2004-03-19  Martin Baulig  <martin@ximian.com>
9875
9876         * interface.cs: Completely killed this file.
9877         (Interface): We're now a TypeContainer and live in class.cs.
9878
9879         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9880         argument; we're now also called for interfaces.
9881         (TypeContainer.DefineMembers): Allow this method being called
9882         multiple times.
9883         (TypeContainer.GetMethods): New public method; formerly known as
9884         Interface.GetMethod().  This is used by PendingImplementation.
9885         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9886         it's now private and non-static.
9887         (Interface): Moved this here; it's now implemented similar to
9888         Class and Struct.
9889         (Method, Property, Event, Indexer): Added `bool is_interface'
9890         argument to their .ctor's.
9891         (MemberBase.IsInterface): New public field.
9892
9893         * cs-parser.jay: Create normal Method, Property, Event, Indexer
9894         instances instead of InterfaceMethod, InterfaceProperty, etc.
9895         (opt_interface_base): Removed; we now use `opt_class_base' instead.
9896         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9897
9898 2004-03-19  Martin Baulig  <martin@ximian.com>
9899
9900         * class.cs (MethodCore.IsDuplicateImplementation): New private
9901         method which does the CS0111 checking.
9902         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9903         Use IsDuplicateImplementation().
9904
9905 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9906
9907         * decl.cs (FindMemberToOverride): New method to find the correct
9908         method or property to override in the base class.
9909         * class.cs
9910             - Make Method/Property use the above method to find the
9911               version in the base class.
9912             - Remove the InheritableMemberSignatureCompare as it is now
9913               dead code.
9914
9915         This patch makes large code bases much faster to compile, as it is
9916         O(n) rather than O(n^2) to do this validation.
9917
9918         Also, it fixes bug 52458 which is that nested classes are not
9919         taken into account when finding the base class member.
9920
9921         Reviewed/Approved by Martin.
9922
9923 2004-03-17  Martin Baulig  <martin@ximian.com>
9924
9925         * expression.cs (MemberAccess.DoResolve): Take the parent's number
9926         of type arguments into account; use the `real_num_type_args'
9927         approach like in DoResolveAsTypeStep().
9928
9929         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
9930         nested types.
9931
9932 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
9933
9934         * interface.cs: In all interface classes removed redundant
9935         member initialization.
9936
9937 2004-03-16  Martin Baulig  <martin@ximian.com>
9938
9939         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9940
9941 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9942
9943         * decl.cs (DefineTypeAndParents): New helper method to define a
9944         type's containers before the type itself is defined;  This is a
9945         bug exposed by the recent changes to Windows.Forms when an
9946         implemented interface was defined inside a class that had not been
9947         built yet.   
9948
9949         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9950
9951         (Check): Loop correctly to report errors modifiers
9952         (UNSAFE was not in the loop, since it was the same as TOP).
9953
9954         * interface.cs: Every interface member now takes a ModFlags,
9955         instead of a "is_new" bool, which we set on the base MemberCore. 
9956
9957         Every place where we called "UnsafeOk" in the interface, now we
9958         call the proper member (InterfaceMethod.UnsafeOK) instead to get
9959         the unsafe settings from the member declaration instead of the
9960         container interface. 
9961
9962         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
9963
9964         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9965         `set_indexer_name' to the pending bits (one per type).
9966
9967         We fixed a bug today that was picking the wrong method to
9968         override, since for properties the existing InterfaceMethod code
9969         basically ignored the method name.  Now we make sure that the
9970         method name is one of the valid indexer names.
9971
9972 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
9973  
9974         * support.cs (SeekableStreamReader): Keep track of stream byte
9975         positions and don't mix them with character offsets to the buffer.
9976
9977         Patch from Gustavo Giráldez
9978
9979 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
9980
9981         * interface.cs (InterfaceSetGetBase): Removed double member
9982         initialization, base class does it as well.
9983
9984 2004-03-13  Martin Baulig  <martin@ximian.com>
9985
9986         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9987         when compiling corlib.
9988
9989 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
9990
9991         * convert.cs (ExplicitConversion): We were reporting an error on
9992         certain conversions (object_type source to a value type, when the
9993         expression was `null') before we had a chance to pass it through
9994         the user defined conversions.
9995
9996         * driver.cs: Replace / and \ in resource specifications to dots.
9997         Fixes 50752
9998
9999         * class.cs: Add check for duplicate operators.  Fixes 52477
10000
10001 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10002
10003         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10004         that are in the middle of the statements, not only at the end.
10005         Fixes #54987
10006
10007         * class.cs (TypeContainer.AddField): No longer set the
10008         `HaveStaticConstructor' flag, now we call it
10009         `UserDefineStaticConstructor' to diferentiate the slightly
10010         semantic difference.
10011
10012         The situation is that we were not adding BeforeFieldInit (from
10013         Modifiers.TypeAttr) to classes that could have it.
10014         BeforeFieldInit should be set to classes that have no static
10015         constructor. 
10016
10017         See:
10018
10019         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10020
10021         And most importantly Zoltan's comment:
10022
10023         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10024
10025         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10026          before its static fields are used', i.e. initialization does not need
10027          to be triggered by the first access to the type. Setting this flag
10028          helps the JIT to compile better code, since it can run the static
10029          constructor at JIT time, and does not need to generate code to call it
10030          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10031          this flag for lots of classes like String. 
10032          
10033          csc sets this flag if the type does not have an explicit static 
10034          constructor. The reasoning seems to be that if there are only static
10035          initalizers for a type, and no static constructor, then the programmer
10036          does not care when this initialization happens, so beforefieldinit
10037          can be used.
10038          
10039          This bug prevents the AOT compiler from being usable, since it 
10040          generates so many calls to mono_runtime_class_init that the AOT code
10041          is much slower than the JITted code. The JITted code is faster, 
10042          because it does not generate these calls if the vtable is type is
10043          already initialized, which is true in the majority of cases. But the
10044          AOT compiler can't do this."
10045
10046 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10047
10048         * class.cs (MethodData.Emit): Refactor the code so symbolic
10049         information is generated for destructors;  For some reasons we
10050         were taking a code path that did not generate symbolic information
10051         before. 
10052
10053 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10054
10055         * class.cs: Create a Constructor.CheckBase method that
10056         takes care of all validation type code. The method
10057         contains some code that was moved from Define.
10058
10059         It also includes new code that checks for duplicate ctors.
10060         This fixes bug #55148.
10061
10062 2004-03-09  Joshua Tauberer <tauberer@for.net>
10063
10064         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10065         a { ... }-style array creation invokes EmitStaticInitializers
10066         which is not good for reference-type arrays.  String, decimal
10067         and now null constants (NullCast) are not counted toward
10068         static initializers.
10069
10070 2004-03-05  Martin Baulig  <martin@ximian.com>
10071
10072         * location.cs (SourceFile.HasLineDirective): New public field;
10073         specifies whether the file contains or is referenced by a "#line"
10074         directive.
10075         (Location.DefineSymbolDocuments): Ignore source files which
10076         either contain or are referenced by a "#line" directive.        
10077
10078 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10079
10080         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10081         direct access to our parent, so check the method inline there.
10082
10083 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10084
10085         * expression.cs (Invocation.EmitCall): Miguel's last commit
10086         caused a regression. If you had:
10087
10088             T t = null;
10089             t.Foo ();
10090
10091         In Foo the implict this would be null.
10092
10093 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10094
10095         * expression.cs (Invocation.EmitCall): If the method is not
10096         virtual, do not emit a CallVirt to it, use Call.
10097
10098         * typemanager.cs (GetFullNameSignature): Improve the method to
10099         cope with ".ctor" and replace it with the type name.
10100
10101         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10102         as an argument the ConstructorBuilder where it is being defined,
10103         to catch the recursive constructor invocations.
10104
10105 2004-03-16  Martin Baulig  <martin@ximian.com>
10106
10107         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10108         ConstructedType, call ResolveType() on it to get the type rather
10109         than just using `expr.Type'.
10110
10111 2004-03-16  Martin Baulig  <martin@ximian.com>
10112
10113         * generics.cs (ConstructedType.GetMemberAccess): Take the
10114         EmitContext instead on the TypeExpr and use
10115         ec.TypeContainer.CurrentType/ec.ContainerType.
10116
10117 2004-03-16  Martin Baulig  <martin@ximian.com>
10118
10119         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10120         parameters before aliases.
10121
10122 2004-03-16  Martin Baulig  <martin@ximian.com>
10123
10124         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10125         New oublic function; checks whether two generic instances may become
10126         equal under some instantiations (26.3.1).
10127
10128         * class.cs (TypeContainer.Define): Call
10129         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10130         error.
10131
10132 2004-03-16  Martin Baulig  <martin@ximian.com>
10133
10134         * class.cs (TypeContainer.GetClassBases): Moved
10135         Error_TypeParameterAsBase() here and also check whether the base
10136         class is not an attribute.
10137
10138 2004-03-16  Martin Baulig  <martin@ximian.com>
10139
10140         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10141
10142 2004-03-16  Martin Baulig  <martin@ximian.com>
10143
10144         * class.cs (Error_TypeParameterAsBase): Use correct error number
10145         here (CS0689).  
10146
10147 2004-03-16  Martin Baulig  <martin@ximian.com>
10148
10149         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10150         for generics.
10151
10152         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10153         error reporting.
10154
10155 2004-03-15  Martin Baulig  <martin@ximian.com>
10156
10157         * typemanager.cs (TypeManager.GetFullName): New public method.
10158         (TypeManager.MemberLookup): Added `int_num_type_arguments'
10159         argument; only return members with the correct number of type
10160         arguments.
10161         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10162         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10163         whether the number of type arguments matches.
10164
10165         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10166         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10167
10168         * expression.cs (MemberAccess): Added public `NumTypeArguments'
10169         field; it's set by the protected .ctor when we're actually a
10170         GenericMemberAccess.
10171         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10172         arguments and pass it to MemberLookupFinal ().
10173
10174         * ecore.cs (Expression.MemberLookup): Added `int
10175         num_type_arguments' argument; only return members with the correct
10176         number of type arguments.
10177         (Expression.MemberLookupFailed): Check whether the MemberLookup
10178         failed because we did not have the correct number of type
10179         arguments; report CS0305 in this case.
10180
10181         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10182         `e.ResolveAsTypeTerminal()' already did so.
10183
10184 2004-03-15  Martin Baulig  <martin@ximian.com>
10185
10186         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10187         we're a ConstructedType; in this case, the caller must report an
10188         error (for instance CS0131).
10189
10190         * generic.cs (TypeArguments): Added Location argument to the .ctor.
10191         (TypeArguments.Resolve): Actually report errors here.
10192
10193 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10194
10195         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10196         `set_indexer_name' to the pending bits (one per type).
10197
10198         We fixed a bug today that was picking the wrong method to
10199         override, since for properties the existing InterfaceMethod code
10200         basically ignored the method name.  Now we make sure that the
10201         method name is one of the valid indexer names.
10202
10203 2004-03-15  Martin Baulig  <martin@ximian.com>
10204
10205         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10206         for generic instances.
10207
10208 2004-03-13  Martin Baulig  <martin@ximian.com>
10209
10210         * class.cs (TypeContainer.DefineType): Call
10211         TypeManager.AddUserType() immediately after creating the
10212         TypeBuilder; pass all type parameters when creating the
10213         CurrentType.
10214
10215         * decl.cs (DeclSpace.FindNestedType): New public method.
10216         (DeclSpace.FindType): Added `int num_type_args' argument; only
10217         return types with the correct number of type parameters.
10218         (DeclSpace.CountTypeParams): New public property.
10219
10220         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10221         the number of type parameters; defaults to zero.
10222
10223         * generic.cs (TypeArguments.Count): New public property.
10224         (ConstructedType.DoResolveAsTypeStep): First call
10225         ds.FindNestedType() to find out whether we're nested in the
10226         current generic type; in this case, we inherit all type parameters
10227         from the current class.
10228
10229         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10230         num_type_args' argument.
10231         (RootContext.LookupType): Added overloaded version which takes the
10232         number of type arguments; only return types with the correct
10233         number of type arguments.
10234
10235         * typemanager.cs (TypeManager.CheckGeneric): New public function;
10236         checks whether `Type t' has `int num_type_args'.
10237
10238 2004-03-13  Martin Baulig  <martin@ximian.com>
10239
10240         * generic.cs (GenericMethod.DefineType): New method; calls
10241         DefineType() on all the type parameters.
10242
10243         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10244         (MethodData.Define): If we're a generic method, call
10245         GenericMethod.DefineType() to define the type parameters.       
10246
10247 2004-03-10  Martin Baulig  <martin@ximian.com>
10248
10249         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10250         instead of IsAssignableFrom.    
10251
10252 2004-03-10  Martin Baulig  <martin@ximian.com>
10253
10254         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10255
10256         * support.cs (ParameterData.HasArrayParameter): New property.
10257         (ReflectionParameters.ctor): Take a MethodBase instead of a
10258         ParameterInfo[].  If we have any type parameters, get the generic
10259         method definition and ask it whether we have variable arguments.
10260
10261 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10262
10263         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10264         routines to check if a type is an enumerable/enumerator allow
10265         classes that implement the IEnumerable or IEnumerator interfaces.
10266
10267         * class.cs (Property, Operator): Implement IIteratorContainer, and
10268         implement SetYields.
10269
10270         (Property.Define): Do the block swapping for get_methods in the
10271         context of iterators.   We need to check if Properties also
10272         include indexers or not.
10273
10274         (Operator): Assign the Block before invoking the
10275         OperatorMethod.Define, so we can trigger the Iterator code
10276         replacement. 
10277
10278         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10279         Property and Operator classes are not created when we parse the
10280         declarator but until we have the block completed, so we use a
10281         singleton SimpleIteratorContainer.Simple to flag whether the
10282         SetYields has been invoked.
10283
10284         We propagate this setting then to the Property or the Operator to
10285         allow the `yield' to function.
10286
10287 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10288
10289         * codegen.cs: Implemented attribute support for modules.
10290         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10291         Assembly/Module functionality.
10292
10293         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10294         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10295         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10296
10297 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10298
10299         * interface.cs (FindMembers): The operation is performed on all base
10300         interfaces and not only on the first. It is required for future CLS Compliance patch.
10301
10302 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10303
10304         * statement.cs, codegen.cs:
10305         This patch deals with patterns such as:
10306
10307         public class List : IEnumerable {
10308
10309                 public MyEnumerator GetEnumerator () {
10310                         return new MyEnumerator(this);
10311                 }
10312
10313                 IEnumerator IEnumerable.GetEnumerator () {
10314                         ...
10315                 }
10316                 
10317                 public struct MyEnumerator : IEnumerator {
10318                         ...
10319                 }
10320         }
10321
10322         Before, there were a few things we did wrong:
10323         1) we would emit callvirt on a struct, which is illegal
10324         2) we emited ldarg when we needed to emit ldarga
10325         3) we would mistakenly call the interface methods on an enumerator
10326         type that derived from IEnumerator and was in another assembly. For example:
10327
10328         public class MyEnumerator : IEnumerator
10329
10330         Would have the interface methods called, even if there were public impls of the
10331         method. In a struct, this lead to invalid IL code.
10332
10333 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10334
10335         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10336           renamed to Emit.
10337
10338         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10339
10340 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10341
10342         * cs-parser.jay: Fix small regression: we were not testing V2
10343         compiler features correctly.
10344
10345         * interface.cs: If the emit context is null, then create one
10346
10347 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10348
10349         * decl.cs (GetSignatureForError): New virtual method to get full name
10350           for error messages.
10351
10352         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10353           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10354
10355         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10356           Duplicated members and code in these classes has been removed.
10357           Better encapsulation in these classes.
10358
10359 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10360
10361         * assign.cs (Assign.DoResolve): When dealing with compound
10362         assignments, there is a new rule in ECMA C# 2.4 (might have been
10363         there before, but it is documented here) that states that in:
10364
10365         a op= b;
10366
10367         If b is of type int, and the `op' is a shift-operator, then the
10368         above is evaluated as:
10369
10370         a = (int) a op b 
10371
10372         * expression.cs (Binary.ResolveOperator): Instead of testing for
10373         int/uint/long/ulong, try to implicitly convert to any of those
10374         types and use that in pointer arithmetic.
10375
10376         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10377         method to print information for from the type, not from the
10378         null-method we were given.
10379
10380 2004-02-01  Duncan Mak  <duncan@ximian.com>
10381
10382         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10383         parsing for cmd, fixes bug #53694.
10384
10385 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10386
10387         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10388         in the member name duplication tests. Property and operator name duplication
10389         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10390
10391 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10392
10393         * interface.cs (PopulateMethod): Fixed crash when interface method
10394         returns not existing type (error test cs0246-3.cs).
10395
10396 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10397
10398         * cs-parser.jay (interface_accessors): Re-write actions to also
10399         store attributes attached to get and set methods. Fix spelling
10400         while at it.
10401
10402         (inteface_property_declaration): Modify accordingly.
10403
10404         (InterfaceAccessorInfo): New helper class to store information to pass
10405         around between rules that use interface_accessors.
10406
10407         * interface.cs (Emit): Apply attributes on the get and set
10408         accessors of properties and indexers too.
10409
10410         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10411         right MethodBuilder when applying attributes to the get and set accessors.
10412
10413 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10414
10415         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10416
10417 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10418
10419         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10420
10421 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10422
10423         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10424         changes that treat `yield' specially when present before `break'
10425         or `return' tokens.
10426
10427         * cs-tokenizer.cs: yield is no longer a keyword.
10428
10429 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10430
10431         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10432         setting for default constructors.
10433         For default constructors are almost every time set wrong Modifier. The
10434         generated IL code has been alright. But inside mcs this values was
10435         wrong and this was reason why several of my CLS Compliance tests
10436         failed.
10437
10438 2004-02-27  Martin Baulig  <martin@ximian.com>
10439
10440         * generics.cs (ConstructedType.ResolveType): Make the nested type
10441         stuff actually work.
10442
10443 2004-02-25  Martin Baulig  <martin@ximian.com>
10444
10445         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
10446         property; returns the type parameters just from the current type,
10447         ie. with the ones from outer classes.
10448         (DeclSpace.LookupGeneric): First search in the current class, then
10449         in outer classes.
10450         (DeclSpace.initialize_type_params): When hiding a type parameter
10451         from an outer class, put it into the `type_param_list' anyways.
10452
10453         * expression.cs (MemberAccess.expr): Made this field protected.
10454
10455         * class.cs (TypeContainer.Define): The `CurrentType' just contains
10456         the type parameters from the current class.
10457
10458         * generic.cs (ConstructedType.ResolveType): Support nested generic
10459         types by taking the type parameters which we inherit from outer
10460         classes into account.
10461         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
10462         support for nested generic types.
10463
10464 2004-02-23  Martin Baulig  <martin@ximian.com>
10465
10466         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
10467         field and check whether we're nested inside a generic type.
10468         (DeclSpace.ResolveType): If we're resolving to a generic type
10469         definition, create a ConstructedType and return its resolved type.
10470         (DeclSpace.initialize_type_params): New private method;
10471         initializes the `type_param_list' field from the type parameters
10472         from this and all enclosing classes.
10473         (DeclSpace.TypeParameters): Call initialize_type_params() unless
10474         we're already initialized.
10475
10476 2004-02-23  Martin Baulig  <martin@ximian.com>
10477
10478         * class.cs (Method.Define): Create the generic method before
10479         calling DoDefine().
10480         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
10481         the TypeContainer one); we use this for generic methods.
10482
10483         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
10484         parent's TypeBuilder.
10485
10486 2004-02-18  Martin Baulig  <martin@ximian.com>
10487
10488         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
10489         to check for equality.
10490
10491 2004-02-05  Martin Baulig  <martin@ximian.com>
10492
10493         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
10494         `ec.TypeContainer.CurrentType', use it instead of
10495         `ec.ContainerType' to check whether we're in the type's ctor.
10496
10497 2004-01-29  Martin Baulig  <martin@ximian.com>
10498
10499         * expression.cs (Invocation.DoResolve): If we're a
10500         `ConstructedType', then we're actually a generic method, so
10501         rewrite the expr as a GenericMemberAccess.
10502
10503         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
10504         here; manually parse it into a string.
10505
10506 2004-01-28  Martin Baulig  <martin@ximian.com>
10507
10508         * typemanager.cs (TypeManager.IsEqual): New static method.
10509         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
10510         check for equality instead of using `=='.
10511
10512 2004-01-26  Martin Baulig  <martin@ximian.com>
10513
10514         * decl.cs (DeclSpace.CurrentType): New public field.
10515
10516         * expression.cs (This.ResolveBase): If we have an
10517         `ec.TypeContainer.CurrentType', use it instead of
10518         `ec.ContainerType'.
10519
10520         * class.cs (TypeContainer.DefineType): If we're a generic type,
10521         create the `CurrentType' (unresolved).
10522         (TypeContainer.GenericType): New private field.
10523         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
10524         it and store it in `GenericType' before creating the MemberCache.
10525         (TypeContainer.GetMembers): If we have a `GenericType', call
10526         TypeManager.FindMembers() on it.
10527
10528         * interface.cs (Interface.GenericType): New private field.
10529         (Interface.DefineType): If we're a generic type, create the
10530         `CurrentType' (unresolved).
10531         (Interface.DefineMembers): If we have a `CurrentType', resolve it
10532         and store it in `GenericType' before creating the MemberCache.
10533         (Interface.GetMembers): If we have a `GenericType', call
10534         TypeManager.FindMembers() on it.
10535
10536 2004-01-22  Martin Baulig  <martin@ximian.com>
10537
10538         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10539         not a QualifiedIdentifier.  This is what `type_name_expression'
10540         was previously doing.
10541         (type_name_expression): Removed; the code is now in
10542         `namespace_or_type_name'.
10543         (qualified_identifier): Removed, use `namespace_or_type_name'
10544         instead.
10545         (QualifiedIdentifier): Removed this class.      
10546
10547 2004-01-22  Martin Baulig  <martin@ximian.com>
10548
10549         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10550         not a string as alias name.
10551
10552 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10553
10554         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10555         #52730 bug, and instead compute correctly the need to use a
10556         temporary variable when requesting an address based on the
10557         static/instace modified of the field and the constructor.
10558  
10559 2004-01-21  Martin Baulig  <martin@ximian.com>
10560
10561         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10562         class and namespace before looking up aliases.  Fixes #52517.
10563
10564 2004-01-21  Martin Baulig  <martin@ximian.com>
10565
10566         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10567         assinged in a 'try'; fixes exception4.cs.
10568
10569 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10570         * class.cs : Implemented parameter-less constructor for TypeContainer
10571
10572         * decl.cs: Attributes are now stored here. New property OptAttributes
10573
10574         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10575
10576         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10577
10578 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10579
10580         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10581           (CSharpSignature): New method for indexer and property signature.
10582
10583 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10584
10585         * pending.cs (IsVirtualFilter): Faster implementation.
10586
10587 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10588
10589         * typemanager.cs: Avoid inclusion of same assembly more than once.
10590
10591 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10592
10593         * cs-parser.jay: Fixed problem where the last assembly attribute
10594           has been applied also to following declaration (class, struct, etc.)
10595           
10596 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10597
10598         * class.cs: Added error CS0538, CS0539 reporting.
10599         Fixed crash on Microsoft runtime when field type is void.
10600
10601         * cs-parser.jay: Added error CS0537 reporting.
10602
10603         * pending.cs: Added error CS0535 reporting.
10604         Improved error report for errors CS0536, CS0534.
10605
10606 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10607
10608         Merge a few bits from the Anonymous Method MCS tree.
10609
10610         * statement.cs (ToplevelBlock): New class for toplevel methods,
10611         will hold anonymous methods, lifted variables.
10612
10613         * cs-parser.jay: Create toplevel blocks for delegates and for
10614         regular blocks of code. 
10615
10616 2004-01-20  Martin Baulig  <martin@ximian.com>
10617
10618         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10619         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10620         and `NeedExplicitReturn'; added `IsLastStatement'.
10621         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10622         have a `ReturnLabel' or we're not unreachable.
10623
10624         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10625         child's reachability; don't just override ours with it.  Fixes
10626         #58058 (lluis's example).
10627         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10628         InFinally(), InLoop(), InSwitch() and
10629         BreakCrossesTryCatchBoundary() methods.
10630
10631         * statement.cs (Return): Do all error checking in Resolve().
10632         Unless we are the last statement in a top-level block, always
10633         create a return label and jump to it.
10634         (Break, Continue): Do all error checking in Resolve(); also make
10635         sure we aren't leaving a `finally'.
10636         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10637         statement in a top-level block.
10638         (Block.Flags): Added `IsDestructor'.
10639         (Block.IsDestructor): New public property.
10640
10641 2004-01-20  Martin Baulig  <martin@ximian.com>
10642
10643         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10644
10645 2004-01-20  Martin Baulig  <martin@ximian.com>
10646
10647         * statement.cs (Statement.ResolveUnreachable): New public method.
10648         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10649         (Block.Resolve): Resolve unreachable statements.
10650
10651 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10652
10653         * expression.cs: We need to fix the case where we do
10654         not have a temp variable here.
10655
10656         * assign.cs: Only expression compound assignments need
10657         temporary variables.
10658
10659 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10660
10661         * flowanalysis.cs: Reduce memory allocation in a few ways:
10662           - A block with no variables should not allocate a bit
10663             vector for itself.
10664           - A method with no out parameters does not need any tracking
10665             for assignment of the parameters, so we need not allocate
10666             any data for it.
10667           - The arrays:
10668                 public readonly Type[] VariableTypes;
10669                 public readonly string[] VariableNames;
10670             Are redundant. The data is already stored in the variable
10671             map, so we need not allocate another array for it.
10672           - We need to add alot of checks for if (params | locals) == null
10673             due to the first two changes.
10674
10675 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10676
10677         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10678         implement IMemoryLocation, we store a copy on a local variable and
10679         take the address of it.  Patch from Benjamin Jemlich
10680
10681         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10682         to use a special "type_name_expression" rule which reduces the
10683         number of "QualifiedIdentifier" classes created, and instead
10684         directly creates MemberAccess expressions.
10685
10686 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
10687
10688         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10689         that fixes #52853.  Null literal assignment to ValueType
10690
10691         * class.cs (MethodData.Emit): Instead of checking the name of the
10692         method to determine if its a destructor, create a new derived
10693         class from Method called Destructor, and test for that.  
10694
10695         * cs-parser.jay: Create a Destructor object instead of a Method.  
10696
10697         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10698
10699         Fixes: 52933
10700
10701 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
10702
10703         * expression.cs (Binary.ResolveOperator): Perform an implicit
10704         conversion from MethodGroups to their delegate types on the
10705         Addition operation.
10706
10707         * delegate.cs: Introduce a new class DelegateCreation that is the
10708         base class for `NewDelegate' and `ImplicitDelegateCreation',
10709         factor some code in here.
10710
10711         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10712         conversion from MethodGroups to compatible delegate types. 
10713
10714         * ecore.cs (Expression.Resolve): Do not flag error 654
10715         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10716         we allow conversions from MethodGroups to delegate types now.
10717
10718         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10719         assignments in v2 either.
10720
10721 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
10722
10723         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10724         static read-only fields in ctors.
10725
10726         Applied patch from Benjamin Jemlich 
10727
10728         * expression.cs (UnaryMutator): Avoid leaking local variables. 
10729
10730 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
10731
10732         * cs-tokenizer.cs (IsCastToken): Allow the various native types
10733         here to return true, as they can be used like this:
10734
10735                 (XXX) int.MEMBER ()
10736
10737         Fixed 49836 and all the other dups
10738
10739 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
10740
10741         * driver.cs: Implement /win32res and /win32icon.
10742
10743 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
10744
10745         * cs-parser.jay: Add a rule to improve error handling for the
10746         common mistake of placing modifiers after the type.
10747
10748 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
10749
10750         * cs-parser.jay (interface_event_declaration): Catch
10751         initialization of events on interfaces, and report cs0068
10752
10753         * cs-parser.jay (interface_event_declaration): Catch
10754         initialization of events. 
10755
10756         * ecore.cs: Better report missing constructors.
10757
10758         * expression.cs (Binary.ResolveOperator): My previous bug fix had
10759         the error reporting done in the wrong place.  Fix.
10760
10761         * expression.cs (Binary.ResolveOperator): Catch the 
10762         operator + (E x, E y) error earlier, and later allow for implicit
10763         conversions in operator +/- (E e, U x) from U to the underlying
10764         type of E.
10765
10766         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10767         52596, if the container class is abstract, the default constructor
10768         is protected otherwise its public (before, we were always public).
10769
10770         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10771         fixed statement.
10772
10773         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10774         Jemlich that fixes bug #52597, MCS was generating invalid code for
10775         idisposable structs.   Thanks to Ben for following up with this
10776         bug as well.
10777
10778 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
10779
10780         * driver.cs: Allow assemblies without code to be generated, fixes
10781         52230.
10782
10783 2004-01-07  Nick Drochak <ndrochak@gol.com>
10784
10785         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10786
10787 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
10788
10789         * cs-parser.jay: Add rules to improve error reporting if fields or
10790         methods are declared at the namespace level (error 116)
10791
10792         * Add rules to catch event add/remove
10793
10794 2004-01-04  David Sheldon <dave-mono@earth.li>
10795
10796   * expression.cs: Added matching ")" to error message for 
10797   CS0077
10798
10799 2004-01-03 Todd Berman <tberman@gentoo.org>
10800
10801         * ecore.cs, attribute.cs:
10802         Applying fix from #52429.
10803
10804 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10805
10806         * ecore.cs, expression.cs, statement.cs:
10807         Total rewrite of how we handle branching. We
10808         now handle complex boolean expressions with fewer
10809         jumps. As well if (x == 0) no longer emits a ceq.
10810
10811         if (x is Foo) is much faster now, because we generate
10812         better code.
10813
10814         Overall, we get a pretty big improvement on our benchmark
10815         tests. The code we generate is smaller and more readable.
10816
10817         I did a full two-stage bootstrap. The patch was reviewed
10818         by Martin and Miguel.
10819
10820 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10821
10822         * cs-parser.jay: Make primary_expression not take a QI.
10823         we dont need this because the member_access rule covers
10824         us here. So we replace the rule with just IDENTIFIER.
10825
10826         This has two good effects. First, we remove a s/r conflict.
10827         Second, we allocate many fewer QualifiedIdentifier objects.
10828
10829 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10830
10831         * attribute.cs: Handle MarshalAs attributes as pseudo, and
10832         set the correct information via SRE. This prevents
10833         hanging on the MS runtime. Fixes #29374.
10834
10835 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10836
10837         * convert.cs: correctly handle conversions to value types
10838         from Enum and ValueType as unboxing conversions.
10839
10840         Fixes bug #52569. Patch by Benjamin Jemlich.
10841
10842 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10843
10844         * expression.cs (BetterConversion): Prefer int -> uint
10845         over int -> ulong (csc's behaviour). This fixed bug #52046.
10846
10847 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10848
10849         * decl.cs (MemberCache.FindMembers): now returns a
10850         MemberInfo [].
10851
10852         * typemanager.cs: In general, go with with ^^.
10853         (CopyNewMethods): take an IList.
10854         (RealMemberLookup): Only allocate an arraylist
10855         if we copy from two sets of methods.
10856
10857         This change basically does two things:
10858         1) Fewer array lists allocated due to CopyNewMethods.
10859         2) the explicit cast in MemberList costed ALOT.
10860
10861 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10862
10863         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10864         a hashtable to avoid needless string allocations when an identifier is
10865         used more than once (the common case).
10866
10867 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10868
10869         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10870         is broken, it will not return anything. So, we
10871         have to use the information we have in mcs to
10872         do the task.
10873
10874         * typemanager.cs: Add a cache for GetInterfaces,
10875         since this will now be used more often (due to ^^)
10876
10877         (GetExplicitInterfaces) New method that gets the
10878         declared, not effective, interfaces on a type
10879         builder (eg, if you have interface IFoo, interface
10880         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10881         { IBar }.
10882
10883         This patch makes MCS able to bootstrap itself on
10884         Windows again.
10885
10886 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10887
10888         * expression.cs: Remove the Nop's that Miguel put
10889         in by mistake.
10890
10891 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10892
10893         * report.cs, codegen.cs: Give the real stack trace to
10894         the error when an exception is thrown.
10895
10896 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10897
10898         * decl.cs: only allocate hashtables for ifaces if 
10899         it is an iface!
10900
10901 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10902
10903         * expression.cs: fix the error from cs0121-2.cs
10904         (a parent interface has two child interfaces that
10905         have a function with the same name and 0 params
10906         and the function is called through the parent).
10907
10908 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10909
10910         * class.cs, rootcontext.cs, typmanager.cs: do not
10911         leak pointers.
10912
10913 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10914
10915         * codegen.cs: remove stack for the ec flow branching.
10916         It is already a linked list, so no need.
10917
10918 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10919
10920         * Makefile: Allow custom profiler here.
10921
10922 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10923
10924         * typemanager.cs (LookupType):
10925           - Use a static char [], because split takes
10926             a param array for args, so it was allocating
10927             every time.
10928           - Do not store true in a hashtable, it boxes.
10929
10930 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10931
10932         * flowanalysis.cs: bytify common enums.
10933
10934 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10935
10936         * modifiers.cs: Add a new set of flags for the
10937         flags allowed on explicit interface impls.
10938         * cs-parser.jay: catch the use of modifiers in
10939         interfaces correctly.
10940         * class.cs: catch private void IFoo.Blah ().
10941
10942         All related to bug #50572.
10943
10944 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10945
10946         * decl.cs: Rewrite the consistant accessability checking.
10947         Accessability is not linear, it must be implemented in
10948         a tableish way. Fixes #49704.
10949
10950 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10951
10952         * expression.cs: Handle negation in a checked context.
10953         We must use subtraction from zero. Fixes #38674.
10954
10955 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10956
10957         * class.cs: Ignore static void main in DLLs.
10958         * rootcontext.cs: Handle the target type here,
10959         since we are have to access it from class.cs
10960         * driver.cs: account for the above.
10961
10962 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10963
10964         * report.cs: Give line numbers and files if available.
10965
10966 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10967
10968         * driver.cs: Implement /addmodule.
10969
10970         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10971         ModuleBuilders.
10972
10973 2003-12-20  Martin Baulig  <martin@ximian.com>
10974
10975         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10976         (FieldBase.IsAssigned): Removed this field.
10977         (FieldBase.SetAssigned): New public method.
10978         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10979
10980 2003-12-20  Martin Baulig  <martin@ximian.com>
10981
10982         * expression.cs (LocalVariableReference.DoResolve): Don't set
10983         `vi.Used' if we're called from DoResolveLValue().
10984
10985         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10986         returns the usage vector it just merged into the current one -
10987         pass this one to UsageWarning().
10988         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10989         of the `EmitContext', don't call this recursively on our children.
10990
10991 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
10992
10993         * driver.cs: Implement /target:module.
10994
10995 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10996
10997         * support.cs (CharArrayHashtable): New helper class.
10998
10999         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11000         char arrays, not strings, so we can avoid creating a string in
11001         consume_identifier if the identifier is a keyword.
11002
11003 2003-12-16  Martin Baulig  <martin@ximian.com>
11004
11005         * statement.cs (LocalInfo.Assigned): Removed this property.
11006         (LocalInfo.Flags): Removed `Assigned'.
11007         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11008         and uses flow analysis.
11009         (Block.UsageWarning): Made this method private.
11010         (Block.Resolve): Call UsageWarning() if appropriate.
11011
11012         * expression.cs (LocalVariableReference.DoResolve): Always set
11013         LocalInfo.Used here.
11014
11015 2003-12-13  Martin Baulig  <martin@ximian.com>
11016
11017         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11018         any value here; we're now using flow analysis to figure out
11019         whether a statement/block returns a value.
11020
11021 2003-12-13  Martin Baulig  <martin@ximian.com>
11022
11023         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11024         working again.
11025         (FlowBranching.MergeFinally): Don't call
11026         `branching.CheckOutParameters()' here, this is called in
11027         MergeTopBlock().
11028         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11029         when adding the `finally' vector.       
11030
11031 2003-12-13  Martin Baulig  <martin@ximian.com>
11032
11033         * flowanalysis.cs
11034         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11035         actually work and also fix #48962.
11036
11037 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11038
11039         * decl.cs: Do not check System.Object for nested types,
11040         since we know it does not have any. Big bang for buck:
11041
11042         BEFORE:
11043            Run 1:   8.35 seconds
11044            Run 2:   8.32 seconds
11045            corlib:  17.99 seconds
11046         AFTER:
11047            Run 1:   8.17 seconds
11048            Run 2:   8.17 seconds
11049            corlib:  17.39 seconds
11050
11051 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11052
11053         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11054         time we are returning 0 members, so we save alot here.
11055
11056 2003-12-11  Martin Baulig  <martin@ximian.com>
11057
11058         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11059         `MergeChild()', also just take the `FlowBranching' as argument;
11060         call Merge() on it and return the result.
11061         (FlowBranching.Merge): We don't need to do anything if we just
11062         have one sibling.
11063
11064 2003-12-11  Martin Baulig  <martin@ximian.com>
11065
11066         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11067         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11068         Maurer for this idea.
11069
11070 2003-12-11  Martin Baulig  <martin@ximian.com>
11071
11072         * flowanalysis.cs (MergeResult): This class is now gone; we now
11073         use the `UsageVector' for this.  The reason for this is that if a
11074         branching just has one sibling, we don't need to "merge" them at
11075         all - that's the next step to do.
11076         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11077         `MergeResult'.
11078
11079 2003-12-11  Martin Baulig  <martin@ximian.com>
11080
11081         Reworked flow analyis and made it more precise and bug-free.  The
11082         most important change is that we're now using a special `Reachability'
11083         class instead of having "magic" meanings of `FlowReturns'.  I'll
11084         do some more cleanups and optimizations and also add some more
11085         documentation this week.
11086
11087         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11088         largely reworked this class.
11089         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11090         the new `Reachability' class instead of having "magic" values here.
11091         (FlowBranching): We're now using an instance of `Reachability'
11092         instead of having separate `Returns', `Breaks' etc. fields.
11093
11094         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11095         based on flow analysis; ignore the return value of block.Emit ().
11096
11097 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11098
11099         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11100         if they are private.
11101
11102 2003-12-09  Martin Baulig  <martin@ximian.com>
11103
11104         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11105         call them directly on the UsageVector.
11106
11107 2003-12-09  Martin Baulig  <martin@ximian.com>
11108
11109         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11110         Changed return type from `FlowReturns' to `Reachability'.
11111
11112 2003-12-09  Martin Baulig  <martin@ximian.com>
11113
11114         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11115         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11116         `Reachable' fields with a single `Reachability' one.
11117
11118 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11119
11120         * class.cs (FindMembers): Remove foreach's.
11121
11122         Bootstrap times:
11123
11124         BEFORE
11125                 Run 1:   8.74 seconds
11126                 Run 2:   8.71 seconds
11127
11128         AFTER
11129                 Run 1:   8.64 seconds
11130                 Run 2:   8.58 seconds
11131
11132
11133 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11134
11135         * cs-parser.jay:
11136         * gen-treedump.cs:
11137         * statement.cs:
11138         This patch does a few things:
11139                 1. EmptyStatement is now a singleton, so it is never reallocated.
11140                 2. All blah is EmptyStatement constructs have been changed to
11141                    blah == EmptyStatement.Value, which is much faster and valid
11142                    now that EmptyStatement is a singleton.
11143                 3. When resolving a block, rather than allocating a new array for
11144                    the non-empty statements, empty statements are replaced with
11145                    EmptyStatement.Value
11146                 4. Some recursive functions have been made non-recursive.
11147         Mainly the performance impact is from (3), however (1) and (2) are needed for
11148         this to work. (4) does not make a big difference in normal situations, however
11149         it makes the profile look saner.
11150
11151         Bootstrap times:
11152
11153         BEFORE
11154         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11155         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11156         Total memory allocated: 56397 KB
11157
11158         AFTER
11159         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11160         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11161         Total memory allocated: 55666 KB
11162
11163 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11164
11165         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11166         than the hashtable in a hashtable version
11167
11168         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11169         we always end up concating a string. This results in a huge perf
11170         loss, because many strings have to be tracked by the GC. In this
11171         patch, we first use a hashtable that works with two keys, so that
11172         the strings do not need to be concat'ed.
11173
11174         Bootstrap times:
11175         BEFORE
11176                 Run 1:   8.74 seconds
11177                 Run 2:   8.71 seconds
11178
11179         AFTER
11180                 Run 1:   8.65 seconds
11181                 Run 2:   8.56 seconds
11182
11183 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11184
11185         * Makefile: Add a new target `do-time' that does a quick and simple
11186         profile, leaving easy to parse output.
11187
11188 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11189
11190         * codegen.cs (Init): Create the dynamic assembly with 
11191         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11192
11193 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11194
11195         * support.cs: Make the PtrHashtable use only one
11196         instance of its comparer.
11197
11198 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11199
11200         * typemanager.cs: Fix lookup of GetNamespaces.
11201
11202 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11203
11204         * expression.cs: Removed redundant line.
11205
11206         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11207         ArrayLists, use for loops with bounds.  
11208
11209         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11210         arraylist.
11211
11212         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11213         arraylists, use for loop with bounds.
11214
11215         The above three changes give us a 0.071 second performance
11216         improvement out of 3.294 seconds down to 3.223.  On my machine
11217         the above changes reduced the memory usage by 1,387 KB during
11218         compiler bootstrap.
11219
11220         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11221         QualifiedIdentifiers.  Before we created a new string through
11222         concatenation, and mostly later on, the result would be
11223         manipulated by DecomposeQI through string manipulation.
11224
11225         This reduced the compiler memory usage for bootstrapping from
11226         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11227         compile times in 0.05 seconds.
11228
11229 2003-11-28  Dick Porter  <dick@ximian.com>
11230
11231         * support.cs: Do string compares with the Invariant culture.
11232
11233         * rootcontext.cs: 
11234         * gen-treedump.cs: 
11235         * expression.cs: 
11236         * driver.cs: 
11237         * decl.cs: 
11238         * codegen.cs: 
11239         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11240         the comparison is done with the Invariant culture.
11241
11242 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11243
11244         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11245         GetEnumerator method.
11246
11247         (ProbeCollectionType): Iterate starting at the most specific type
11248         upwards looking for a GetEnumerator
11249
11250         * expression.cs: Shift count can be up to 31 for int/uint and 63
11251         for long/ulong.
11252
11253 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11254
11255         * statement.cs (Block.LookupLabel): Also look for the label on the
11256         children blocks.  Use a hash table to keep track of visited
11257         nodes. 
11258
11259         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11260         we actually did transform the other operand, otherwise fall back
11261         to the common codepath that casts to long.
11262
11263         * cs-tokenizer.cs: Use the same code pattern as the int case.
11264         Maybe I should do the parsing myself, and avoid depending on the
11265         Parse routines to get this done.
11266
11267 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11268
11269         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11270         which fixes bug 51347.  This time test it.
11271
11272         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11273         attributes for example can not tell the difference between these.
11274         The difference was only a syntax feature of the language. 
11275
11276         * attribute.cs: Apply attributes to delegates.
11277
11278         * delegate.cs: Call the apply attributes method.
11279
11280 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11281
11282         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11283         comparing 0 vs Byte.MinValue, not the value
11284
11285         (ImplicitConversionRequired): When reporting a conversion error,
11286         use error 31 to print out the constant error instead of the
11287         simpler 29.
11288
11289         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11290         which fixes bug 51347.
11291
11292 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11293
11294         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11295         which fixes the -warnaserror command line option.
11296
11297 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11298
11299         * cfold.cs (DoNumericPromotions): During constant folding of
11300         additions on UIntConstant, special case intconstants with
11301         IntConstants like we do on the expression binary operator. 
11302
11303 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11304
11305         * convert.cs (ImplicitReferenceConversion): We were missing a case
11306         (System.Enum are not value types or class types, so we need to
11307         classify them separatedly).
11308
11309         * driver.cs: We do not support error 2007.
11310
11311 2003-11-12 Jackson Harper <jackson@ximian.com>
11312
11313         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11314         system directory. Also use the full file name so users can
11315         libraries names mscorlib-o-tron.dll in a non system dir.
11316         
11317 2004-01-04  David Sheldon <dave-mono@earth.li>
11318
11319         * expression.cs: Added matching ")" to error message for CS0077.
11320
11321 2003-12-19  Martin Baulig  <martin@ximian.com>
11322
11323         * typemanager.cs (TypeManager.IsEqualGenericType): New public
11324         static method; see documentation in the method.
11325         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
11326
11327         * convert.cs (Convert.ImplicitReferenceConversion,
11328         Convert.ImplicitReferenceConversionExists): Add support for
11329         generic type declarations; see gen-36.cs.
11330
11331 2003-12-19  Martin Baulig  <martin@ximian.com>
11332
11333         * pending.cs (Pending.InterfaceMethod): Use
11334         `Type.IsAssignableFrom()' instead of `=='.
11335
11336 2003-12-18  Martin Baulig  <martin@ximian.com>
11337
11338         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
11339         byref types first.
11340
11341         * convert.cs (Convert.ImplicitStandardConversionExists): Use
11342         `expr_type.Equals (target_type)' instead of `=='.
11343
11344 2003-12-08  Martin Baulig  <martin@ximian.com>
11345
11346         * generics.cs (Constraints.Types): Removed.
11347         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
11348         to Type's.
11349         (Constraints.ResolveTypes): New public method; resolves the
11350         TypeExpr's to Type's.
11351         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
11352         longer takes the constraints.
11353         (TypeParameter.DefineMethod): Likewise.
11354         (TypeParameter.DefineType): New public method.  Calls
11355         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
11356         the constraints.
11357
11358 2003-12-08  Martin Baulig  <martin@ximian.com>
11359
11360         * convert.cs (Convert.ImplicitConversionStandard): Use
11361         `expr_type.Equals (target_type)' instead of `=='.
11362
11363 2003-12-08  Martin Baulig  <martin@ximian.com>
11364
11365         * typemanager.cs (TypeManager.GetReferenceType): Call
11366         `Type.MakeByRefType ()'.
11367
11368 2003-12-08  Martin Baulig  <martin@ximian.com>
11369
11370         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
11371         just has some special meaning in some situations.  For instance,
11372         it is allowed to use `where' as the name of a variable etc.
11373
11374 2003-12-04  Martin Baulig  <martin@ximian.com>
11375
11376         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11377         `Type.MakeArrayType()' for array types.
11378
11379 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
11380
11381         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
11382         debugging message.
11383
11384         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
11385         corlib to compile.
11386
11387 2003-11-16  Martin Baulig  <martin@ximian.com>
11388
11389         * codegen.cs (EmitContext.IsGeneric): Removed.
11390
11391         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
11392         ResolveGeneric() on the DeclSpace.
11393
11394 2003-11-16  Martin Baulig  <martin@ximian.com>
11395
11396         * generic.cs (TypeArguments.Resolve):
11397         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
11398         `ResolveType()' on it to get the Type.
11399
11400 2003-11-15  Martin Baulig  <martin@ximian.com>
11401
11402         * generic.cs (ConstructedType.GetInterfaces): Override this.
11403
11404 2003-11-14  Martin Baulig  <martin@ximian.com>
11405
11406         * interface.cs (Interface.DefineType): Define all type parameters
11407         before adding the interfaces we inherit.
11408
11409 2003-11-11  Martin Baulig  <martin@ximian.com>
11410
11411         * generic.cs (ConstructedType.ResolveType): Always call
11412         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
11413
11414 2003-11-10  Martin Baulig  <martin@ximian.com>
11415
11416         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11417         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11418         calling `ResolveType()' on them, directly assign their `Type'.
11419
11420 2003-11-08  Martin Baulig  <martin@ximian.com>
11421
11422         * generic.cs (ConstructedType): Override `IsClass' etc.
11423
11424 2003-11-08  Martin Baulig  <martin@ximian.com>
11425
11426         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11427         return value and the `out parent' parameter.
11428         (TypeContainer.DefineType): Moved the CS0644 check into
11429         GetClassBases().  Don't pass the interface types to the
11430         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11431         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11432
11433         * ecore.cs (TypeExpr.IsAttribute): New property.
11434         (TypeExpr.GetInterfaces): New method.
11435
11436         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11437         TypeExpr instead of a Type.
11438         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11439         (Interface.DefineType): Don't pass the interface types to the
11440         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11441         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11442
11443         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11444         instead of a `Type[]'.
11445         (TypeManager.RegisterBuilder): Likewise.
11446         (TypeManager.AddUserInterface): Likewise.
11447         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11448         `Type[]' and also return a `TypeExpr[]'.
11449         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11450
11451 2003-11-08  Martin Baulig  <martin@ximian.com>
11452
11453         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11454         Expression.     
11455
11456 2003-11-08  Martin Baulig  <martin@ximian.com>
11457
11458         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11459         TypeManager.ResolveExpressionTypes().
11460
11461         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11462         instead of an Expression.
11463         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11464         (TypeExpression): New public class; formerly known as `TypeExpr'.
11465
11466         * expression.cs (ComposedCast): Derive from TypeExpr.
11467
11468         * typemanager.cs (TypeManager.system_*_expr): These are now
11469         TypExpr's instead of Expression's.
11470         (TypeManager.ResolveExpressionTypes): New public static function;
11471         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11472         of them.        
11473
11474 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11475
11476         * expression.cs (New.DoResolve): Do not dereference value that
11477         might be a null return.
11478
11479         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11480         sure that the constant value has the right type.  Fixes an
11481         unreported bug, similar to 50425.
11482
11483         * const.cs (Const.LookupConstantValue): Call
11484         ImplicitStandardConversionExists before doing a conversion to
11485         avoid havng the TypeManager.ChangeType do conversions.
11486
11487         Reduced the number of casts used
11488
11489         (Const.ChangeType): New routine to enable reuse of the constant
11490         type changing code from statement.
11491
11492         * typemanager.cs (ChangeType): Move common initialization to
11493         static global variables.
11494
11495         Fixes #50425.
11496
11497         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11498         every value type to go through, even if it was void.  Fix that. 
11499
11500         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11501         character of the define, and the is_identifier_part_character for
11502         the rest of the string.
11503
11504 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11505
11506         * expression.cs (UnaryMutator.EmitCode): When I updated
11507         LocalVariableReference.DoResolve, I overdid it, and dropped an
11508         optimization done on local variable references.
11509
11510 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11511
11512         * ecore.cs: Convert the return from Ldlen into an int.
11513
11514 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11515
11516         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11517         the accessibility, this is a special case for toplevel non-public
11518         classes (internal for instance).
11519
11520 2003-10-20  Nick Drochak <ndrochak@gol.com>
11521
11522         * ecore.cs: Fix typo and build.  Needed another right paren.
11523
11524 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11525
11526         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11527         `internal' case regular and protected, but not allowing protected
11528         to be evaluated later.  Bug 49840
11529
11530 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11531
11532         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11533         to kb.Nlast, and not the kb.nFirst to isolate the switch
11534         statement.
11535
11536         Extract the underlying type, so enumerations of long/ulong are
11537         treated like long/ulong.
11538
11539 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11540
11541         * expression.cs (New): Overload the meaning of RequestedType to
11542         track the possible creation of the NewDelegate type, since
11543         DoResolve is invoked more than once for new constructors on field
11544         initialization.
11545
11546         See bugs: #48800 and #37014
11547
11548         * cs-parser.jay (declare_local_constants): Take an arraylist
11549         instead of a single constant.
11550
11551         (local_constant_declaration): It should take a
11552         constant_declarators, not a constant_declarator.  Fixes 49487
11553
11554         * convert.cs: Fix error report.
11555
11556 2003-10-13 Jackson Harper <jackson@ximian.com>
11557
11558         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11559         bug #49611
11560         
11561 2003-11-03  Martin Baulig  <martin@ximian.com>
11562
11563         * expression.cs (ArrayAccess.GetStoreOpcode): Added
11564         `out bool has_type_arg'; if set, we need to pass the type to
11565         ig.Emit().
11566         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
11567         Stelem_Any/Ldelem_Any for generic parameters.   
11568
11569 2003-11-02  Martin Baulig  <martin@ximian.com>
11570
11571         * expression.cs (Invocation.EmitCall): Use
11572         `TypeManager.IsValueType()' to check whether it's a value type.
11573         Don't set `struct_call' when calling a method on a type parameter.
11574
11575 2003-11-02  Martin Baulig  <martin@ximian.com>
11576
11577         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
11578         and removed the TypeBuilder argument.
11579
11580         * typemanager.cs (TypeManager.IsValueType): Return
11581         `t.IsGenericParameter || t.IsValueType'.
11582
11583 2003-10-25  Martin Baulig  <martin@ximian.com>
11584
11585         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
11586         call ConstructedType.Resolve() on it.
11587
11588         * generic.cs (ConstructedType.Resolve): Set `type' on success.
11589
11590 2003-10-25  Martin Baulig  <martin@ximian.com>
11591
11592         * class.cs (TypeContainer.GetClassBases): Changed
11593         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
11594         CS8214 reporting here.
11595         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
11596         instead of a `Type' for our parent.  In case of a recursive
11597         declaration (see tests/gen-23.cs for an example), our parent is a
11598         ConstructedType and it doesn't have its type set.  So, first
11599         create our own TypeBuilder, then call constructed.Resolve() to get
11600         the parent's type and finally TypeBuilder.SetParent() it.
11601
11602         * ecore.cs (TypeExpr.Name): New public virtual property.
11603
11604         * generic.cs
11605         (ConstructedType): We're now a TypeExpr and not just an Expression.
11606         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
11607         arguments here; this is done later.
11608         (ConstructedType.Resolve): New public method to resolve the type
11609         arguments and bind them.
11610
11611 2003-10-21  Martin Baulig  <martin@ximian.com>
11612
11613         * convert.cs: Use `TypeManager.IsValueType' instead of
11614         'type.IsValueType' everywhere.
11615
11616         * typemanager.cs (TypeManager.IsValueType): Return true for type
11617         parameters.  The reason for this is that we need to box a type
11618         parameter when converting it to a reference type.
11619
11620         * cs-parser.jay: Added support for default value expressions.
11621
11622         * generics.cs (DefaultValueExpression): New public class.       
11623
11624 2003-10-17  Martin Baulig  <martin@ximian.com>
11625
11626         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
11627         TypeContainer so we can also use this for Interfaces.
11628         (TypeParameter.Resolve): Likewise.
11629
11630         * interface.cs (Interface.DefineType): Added support for generic
11631         interfaces.
11632
11633         * cs-parser.jay: Added support for generic structs and interfaces.
11634
11635 2003-10-17  Martin Baulig  <martin@ximian.com>
11636
11637         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
11638         call generic methods :-)
11639
11640 2003-10-16  Martin Baulig  <martin@ximian.com>
11641
11642         * cs-parser.jay (namespace_or_type_name): Only create a
11643         GenericMemberAccess if we actually have type arguments.
11644
11645 2003-10-13  Martin Baulig  <martin@ximian.com>
11646
11647         * class.cs (Method.Define): If we're a generic method, call
11648         TypeBuilder.DefineGenericMethod () before resolving
11649         the parameters.
11650         (MethodData): Added .ctor which takes an additional MethodBuilder
11651         argument; this is used for generic methods.
11652         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
11653         we already have a MethodBuilder.
11654
11655 2003-10-10  Martin Baulig  <martin@ximian.com>
11656
11657         * class.cs (Method): Added .ctor which takes a `GenericMethod'
11658         instead of a `DeclSpace'.  This is used for generic methods.
11659
11660         * cs-parser.jay (method_header): Added support for generic
11661         methods; create a `GenericMethod' instance and pass it to the
11662         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
11663         parameters and locals.
11664
11665         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
11666         since we already have the location.  Check whether we're a generic
11667         type declaration or a generic method and create the correct type
11668         parameter.
11669
11670         * generic.cs (TypeParameter.DefineMethod): New public method.
11671         (GenericMethod): New public class; derives from DeclSpace and is
11672         used for generic methods.       
11673
11674 2003-10-09  Martin Baulig  <martin@ximian.com>
11675
11676         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11677         to the .ctor.
11678         (MethodCore.DoDefineParameters): Removed the TypeContainer
11679         argument; use the DeclSpace which was passed to the .ctor instead.
11680         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11681         TypeContainer; we only need a DeclSpace here.
11682
11683 2003-10-09  Martin Baulig  <martin@ximian.com>
11684
11685         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11686         to the .ctor.
11687         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11688         EmitContext's .ctor.    
11689
11690 2003-10-09  Martin Baulig  <martin@ximian.com>
11691
11692         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11693         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11694         AsAccessible(), moved them as well.
11695
11696         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11697
11698 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11699
11700         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11701         generation for >=, as spotted by Paolo, bug 48679.  
11702         Patch from David Waite.
11703
11704         * cs-tokenizer.cs: Add handling for #pragma.
11705
11706         * cs-parser.jay: Allow for both yield and yield return in the
11707         syntax.  The anti-cobolization of C# fight will go on!
11708
11709         * class.cs (TypeBuilder.DefineType): Catch error condition here
11710         (Parent.DefineType erroring out and returning null).
11711
11712         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11713         coping with enumerations variables, we were mistakenly processing
11714         them as a regular value type instead of built-in types.  Fixes the
11715         bug #48063
11716
11717         * typemanager.cs (IsBuiltinOrEnum): New method.
11718
11719 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
11720
11721         * cs-parser.jay: Upgrade: yield now needs the return clause.
11722
11723 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11724
11725         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11726
11727 2003-09-29  Martin Baulig  <martin@ximian.com>
11728
11729         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
11730         inflated generic methods.
11731
11732         * generics.cs (ConstructedType): Distinguish between open and
11733         closed constructed types; correctly resolve the arguments.
11734
11735 2003-09-22  Martin Baulig  <martin@ximian.com>
11736
11737         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
11738         all type arguments meet their constraints.
11739
11740 2003-09-19  Martin Baulig  <martin@ximian.com>
11741
11742         * decl.cs (MemberCache.SetupCacheForInterface): Take a
11743         `MemberCache parent' argument.  Normally, an interface doesn't
11744         have a parent type except System.Object, but we use this in gmcs
11745         for generic type parameters.
11746
11747 2003-09-18  Martin Baulig  <martin@ximian.com>
11748
11749         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11750         on `type.IsInterface'; don't check whether the type has a parent
11751         to determine whether it's an interface.
11752
11753 2003-09-17  Martin Baulig  <martin@ximian.com>
11754
11755         * generic.cs (ConstructedType.ToString): Always use `name' as the
11756         type name.
11757
11758 2003-09-15  Martin Baulig  <martin@ximian.com>
11759
11760         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
11761
11762         * generic.cs (Constraints.Resolve): New public method; this is
11763         called to resolve the constraint types and to check whether all
11764         the constraints are correct.
11765         (Constraints.Types): New public property.
11766         (TypeParameter.Resolve): New public method; resolves all the
11767         type's constraints.
11768
11769         * class.cs (TypeContainer.DefineType): Call
11770         TypeParameter.Resolve() before actually defining the type.
11771
11772 2003-09-15  Martin Baulig  <martin@ximian.com>
11773
11774         * class.cs (TypeContainer.DefineType): Added an error flag to
11775         avoid reporting duplicate CS0146's ("class definition is
11776         circular.").
11777
11778         * driver.cs (Driver.MainDriver): Abort if
11779         RootContext.ResolveTree() reported any errors.
11780
11781 2003-09-07  Martin Baulig  <martin@ximian.com>
11782
11783         * report.cs (Error, Warning): Added overloaded versions which take
11784         a `params object[] args' and call String.Format().
11785
11786 2003-09-07  Martin Baulig  <martin@ximian.com>
11787
11788         * decl.cs (DeclSpace..ctor): Don't call
11789         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11790         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11791         (DeclSpace.RecordDecl): New method.
11792
11793         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11794
11795 2003-09-02  Ravi Pratap  <ravi@ximian.com>
11796
11797         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11798         value attributes to be applied to ParameterBuilders.
11799
11800         * class.cs (MethodCore.LabelParameters): Make static and more
11801         generic so that it can be used from other places - like interface
11802         methods, for instance.
11803
11804         * interface.cs (Interface.Emit): Call LabelParameters before
11805         emitting attributes on the InterfaceMethod.
11806
11807 2003-09-07  Martin Baulig  <martin@ximian.com>
11808
11809         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
11810         if the number of type parameters doesn't match.
11811
11812 2003-09-04  Martin Baulig  <martin@ximian.com>
11813
11814         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
11815         for arrays of generic type params (ie. `!0[]').
11816
11817 2003-09-04  Martin Baulig  <martin@ximian.com>
11818
11819         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
11820         for the moment.
11821
11822 2003-09-04  Martin Baulig  <martin@ximian.com>
11823
11824         * decl.cs (DeclSpace.LookupGeneric): New method.
11825         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
11826         moment.
11827
11828         * generic.cs (TypeParameterExpr): Take a TypeParameter as
11829         argument, not just a string.
11830         (TypeParameter.Define): New public method; this is called to
11831         actually define the generic parameter; after this, you can use the
11832         new `Type' property to get the type.
11833
11834 2003-09-04  Martin Baulig  <martin@ximian.com>
11835
11836         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
11837         is now an ArrayList; initialize the result of the `TypeParameters'
11838         property here.
11839         (DeclSpace.GetGenericData): Removed.
11840         (DeclSpace.LookupGeneric): Temporarily removed; we need to
11841         implement this in a different way.
11842         (DeclSpace.GetTypeParameters): Removed; there's now a
11843         `TypeParameters' property.
11844         (DeclSpace.TypeParameters): New public property.
11845
11846         * generic.cs (Constraints): Make this class public.
11847         (TypeParameter): New public class.
11848
11849 2003-09-04  Martin Baulig  <martin@ximian.com>
11850
11851         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
11852         generic parameters.
11853
11854         * class.cs (TypeContainer.DefineType): Call
11855         TypeBuilder.DefineGenericParameter () on all generic parameters if
11856         this is a generic type.
11857
11858 2003-08-28  Martin Baulig  <martin@ximian.com>
11859
11860         * sample-stack.il: Compile this with ilasm: "ilasm /dll
11861         sample-stack.il".
11862
11863         * sample-hello.cs: Compile this with gmcs: "gmcs
11864         /r:sample-stack.dll sample-hello.cs".
11865
11866 2003-08-28  Martin Baulig  <martin@ximian.com>
11867
11868         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
11869         the parameters to the generic type.
11870
11871 2003-08-28  Martin Baulig  <martin@ximian.com>
11872
11873         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
11874
11875 2003-08-28  Martin Baulig  <martin@ximian.com>
11876
11877         * cs-parser.jay (opt_type_argument_list): Use
11878         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
11879         (primary_expression): Replace `qualified_identifier' with `type_name'.
11880         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
11881
11882         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
11883         parser to check whether it is syntactically a type parameter list;
11884         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
11885         this case.
11886
11887 2003-08-26  Martin Baulig  <martin@ximian.com>
11888
11889         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11890         resolving aliases; fixes #47927.
11891
11892 2003-08-26  Martin Baulig  <martin@ximian.com>
11893
11894         * statement.cs (Using.DoResolve): This is internally emitting a
11895         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11896         do not always return.  Fixes #47681.
11897
11898 2003-08-26  Martin Baulig  <martin@ximian.com>
11899
11900         * decl.cs (MemberCore): Moved WarningNotHiding(),
11901         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11902         into MemberBase.
11903         (AdditionResult): Make this nested in DeclSpace.
11904         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11905         argument; call NamespaceEntry.Define() unless we're nested in a
11906         class or struct.
11907
11908         * namespace.cs (Namespace.DefineName): New public function.  This
11909         is called from DeclSpace's .ctor to add 
11910         (Namespace.Lookup): Include DeclSpaces in the lookup.
11911
11912         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11913
11914         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11915
11916 2003-08-25  Martin Baulig  <martin@ximian.com>
11917
11918         * convert.cs (Convert.ExplicitReferenceConversion): When
11919         converting from an interface type to a class, unbox if the target
11920         type is a struct type.  Fixes #47822.
11921
11922 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11923
11924         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11925         #47854.
11926
11927 2003-08-22  Martin Baulig  <martin@ximian.com>
11928
11929         * class.cs (TypeManager.DefineType): When defining a nested type,
11930         call DefineType() on our parent; fixes #47801.
11931
11932 2003-08-22  Martin Baulig  <martin@ximian.com>
11933
11934         * class.cs (MethodData.Define): While checking if a method is an
11935         interface implementation, improve the test a bit more to fix #47654.
11936
11937 2003-08-22  Martin Baulig  <martin@ximian.com>
11938
11939         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11940         correctly; fixes #47722.
11941
11942 2003-08-22  Martin Baulig  <martin@ximian.com>
11943
11944         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11945         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11946
11947         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11948
11949 2003-08-22  Martin Baulig  <martin@ximian.com>
11950
11951         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11952         can only be assigned in static constructors.  Fixes #47161.
11953
11954 2003-08-22  Martin Baulig  <martin@ximian.com>
11955
11956         Rewrote and improved the flow analysis code.
11957
11958         * flowbranching.cs (FlowBranching): Make this class abstract.
11959         (FlowBranching.CreateBranching): New static function to create a
11960         new flow branching.
11961         (FlowBranchingBlock, FlowBranchingException): New classes.
11962         (FlowBranching.UsageVector.Type): New public readonly field.
11963         (FlowBranching.UsageVector.Breaks): Removed the setter.
11964         (FlowBranching.UsageVector.Returns): Removed the setter.
11965         (FlowBranching.UsageVector): Added Break(), Return(),
11966         NeverReachable() and Throw() methods to modify the reachability.
11967         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11968         done by FlowBranching.Merge().
11969         (FlowBranching.UsageVector.MergeChild): New method; merges the
11970         merge result into the current vector.
11971         (FlowBranching.Merge): New abstract method to merge a branching.
11972
11973 2003-08-12  Martin Baulig  <martin@ximian.com>
11974
11975         * expression.cs (Indirection.CacheTemporaries): Create the
11976         LocalTemporary with the pointer type, not its element type.
11977
11978 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11979
11980         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11981         token was a keyword or not.
11982
11983         Add `error' options where an IDENTIFIER was expected;  Provide
11984         CheckToken and CheckIdentifierToken convenience error reporting
11985         functions. 
11986
11987         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11988
11989         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11990         NameSpaceEntry NameSpaceEntry.
11991
11992         (LookupInterfaceOrClass): Avoid creating a full qualified name
11993         from namespace and name: avoid doing lookups when we know the
11994         namespace is non-existant.   Use new Tree.LookupByNamespace which
11995         looks up DeclSpaces based on their namespace, name pair.
11996
11997         * driver.cs: Provide a new `parser verbose' to display the
11998         exception thrown during parsing.  This is turned off by default
11999         now, so the output of a failure from mcs is more graceful.
12000
12001         * namespace.cs: Track all the namespaces defined in a hashtable
12002         for quick lookup.
12003
12004         (IsNamespace): New method
12005
12006 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12007
12008         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12009         we know that we need to concatenate (full typename can never be
12010         null). 
12011
12012         * class.cs: ditto.
12013
12014         * statement.cs: Use a bitfield;  Do not initialize to null things
12015         which are done by the constructor by default.
12016
12017         * cs-parser.jay: bug fix, parameter was 4, not 3.
12018
12019         * expression.cs: Just use the property;
12020
12021         * statement.cs: No need for GetVariableInfo method.
12022
12023 2003-08-08  Martin Baulig  <martin@ximian.com>
12024
12025         * flowanalysis.cs (FlowReturns): This is now nested in the
12026         `FlowBranching' class.
12027         (MyBitVector): Moved this here from statement.cs.
12028         (FlowBranching.SiblingType): New enum type.
12029         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12030
12031 2003-08-07  Martin Baulig  <martin@ximian.com>
12032
12033         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12034         `FlowBranching' class and called `BranchingType'.
12035
12036 2003-08-07  Martin Baulig  <martin@ximian.com>
12037
12038         * flowanalysis.cs: Moved all the control flow analysis code into
12039         its own file.
12040
12041 2003-08-07  Martin Baulig  <martin@ximian.com>
12042
12043         * assign.cs (Assign.DoResolve): `target' must either be an
12044         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12045         #37319.
12046
12047 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12048
12049         * expression.cs (BinaryMethod): This kind of expression is created by the
12050         Binary class if it determines that the operator has to be handled
12051         by a method.
12052
12053         (BinaryDelegate): This kind of expression is created if we are
12054         dealing with a + or - operator on delegates.
12055
12056         (Binary): remove method, argumetns, and DelegateOperator: when
12057         dealing with methods, 
12058
12059         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12060
12061         * statement.cs (Block): use bitfields for the three extra booleans
12062         we had in use.   Remove unused topblock parameter.
12063
12064         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12065
12066         * assign.cs: Drop extra unneeded tests.
12067
12068 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12069
12070         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12071
12072         * statement.cs (Foreach): Use VariableStorage instead of
12073         LocalBuilders.   
12074
12075         * codegen.cs (VariableStorage): New class used by clients that
12076         require a variable stored: locals or fields for variables that
12077         need to live across yield.
12078
12079         Maybe provide a convenience api for EmitThis+EmitLoad?
12080
12081         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12082         these bad boys.
12083
12084 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12085
12086         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12087         RemapParameterLValue): New methods that are used to turn a
12088         precomputed FieldInfo into an expression like this:
12089
12090                 instance.FieldInfo
12091
12092         The idea is to use this instead of making LocalVariableReference
12093         have more than one meaning.
12094
12095         * cs-parser.jay: Add error production to BASE.
12096
12097         * ecore.cs: Deal with TypeManager.GetField returning null, which
12098         is now a valid return value.
12099
12100         (FieldExprNoAddress): New expression for Fields whose address can
12101         not be taken.
12102
12103         * expression.cs (LocalVariableReference): During the resolve
12104         phases, create new expressions if we are in a remapping context.
12105         Remove code that dealt with remapping here.
12106
12107         (ParameterReference): same.
12108
12109         (ProxyInstance): New expression, like the `This' expression, but
12110         it is born fully resolved.  We know what we are doing, so remove
12111         the errors that are targeted to user-provided uses of `this'.
12112
12113         * statement.cs (Foreach): our variable is now stored as an
12114         Expression;  During resolution, follow the protocol, dont just
12115         assume it will return this.
12116
12117 2003-08-06  Martin Baulig  <martin@ximian.com>
12118
12119         * support.cs (SeekableStreamReader.cs): New public class.
12120
12121         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12122         SeekableStreamReader instead of the normal StreamReader.
12123
12124 2003-08-04  Martin Baulig  <martin@ximian.com>
12125
12126         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12127         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12128         deambiguate casts and delegate invocations.
12129         (parenthesized_expression): Use the new tokens to ensure this is
12130         not a cast of method invocation.
12131
12132         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12133         when reading a `)' and Deambiguate_CloseParens () was previously
12134         called.
12135
12136         * expression.cs (ParenthesizedExpression): New class.  This is
12137         just used for the CS0075 test.
12138         (Binary.DoResolve): Check for CS0075.   
12139
12140 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12141
12142         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12143         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12144         reference comparison.
12145
12146         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12147         examine the ReturnType for equality - this is necessary in the
12148         cases of implicit and explicit operators whose signature also
12149         includes the return type.
12150
12151 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12152
12153         * namespace.cs: Cache the result of the namespace computation,
12154         instead of computing it every time.
12155
12156 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12157
12158         * decl.cs: Use a global arraylist that we reuse over invocations
12159         to avoid excesive memory consumption.  Reduces memory usage on an
12160         mcs compile by one meg (45 average).
12161
12162         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12163         private, work around that.
12164
12165 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12166
12167         * literal.cs (IntLiteral): Define Zero and One static literals. 
12168
12169         * cs-parser.jay (integer_literal): use static literals to reduce
12170         memory usage for the most used literals (0, 1 and -1).  211kb
12171         reduced in memory usage.
12172
12173         Replace all calls to `new ArrayList' with `new
12174         ArrayList(4)' which is a good average number for most allocations,
12175         and also requires only 16 bytes of memory for its buffer by
12176         default. 
12177
12178         This reduced MCS memory usage in seven megabytes for the RSS after
12179         bootstrapping.
12180
12181 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12182
12183         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12184         handle params methods the correct way by forming only one
12185         applicable set with params and normal methods in them. Earlier we
12186         were looking at params methods only if we found no normal methods
12187         which was not the correct thing to do.
12188
12189         (Invocation.BetterFunction): Take separate arguments indicating
12190         when candidate and the best method are params methods in their
12191         expanded form.
12192
12193         This fixes bugs #43367 and #46199.
12194
12195         * attribute.cs: Documentation updates.
12196
12197         (CheckAttribute): Rename to CheckAttributeTarget.
12198         (GetValidPlaces): Rename to GetValidTargets.
12199
12200         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12201         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12202
12203         Fixes bug #44468.
12204
12205 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
12206
12207         * codegen.cs: Compute IsGeneric correctly.
12208
12209         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12210         resolution. 
12211
12212         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12213         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
12214         regressions, and I was chasing more bugs than I required.
12215
12216         * interface.cs: Use expressions for base type names (like classes
12217         and structs have been doing for a while now), and resolve that.
12218         This patch should probably go into head as well.
12219
12220         This makes it one less user of FindType.
12221
12222 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12223
12224         This compiler can not self host currently.  Need to fix that.
12225         
12226         * Makefile: compile to `gmcs.exe'
12227
12228         * driver.cs: Turn on v2 by default on gmcs.
12229
12230         * generic.cs (ConstructedType): Does no longer take a container
12231         type argument;  That will be taken care of later.
12232
12233         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12234         Use SimpleName to resolve for now, so we can continue the work on
12235         the parser, until we get Type.GetType that understands generics.
12236
12237         (ConstructedType.ToString): Implement
12238
12239         (TypeArguments.Resolve): Resolve the child expressions as types. 
12240         
12241         * cs-parser.jay: Rename interface_constraints to
12242         type_parameter_constraints
12243
12244         (namespace_or_type_name): Only use constructed types for the basic
12245         construction, we will deal with identifier<...> later.
12246
12247         (type/type_name): No longer call DecomposeQI, as
12248         namespace_or_type_name is always decoded now.
12249         
12250 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12251
12252         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12253         closely: we eliminate methods in base types when we have an
12254         applicable method in a top-level type.
12255
12256         Please see section 14.5.5.1 for an exact description of what goes
12257         on. 
12258
12259         This fixes bug #45127 and a host of other related to corlib compilation.
12260
12261         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12262         array is the method corresponding to the top-level type (this is
12263         because of the changes made to icall.c) so we change this
12264         accordingly.
12265
12266         (MethodGroupExpr.Name): This too.
12267
12268         * typemanager.cs (GetElementType): New method which does the right
12269         thing when compiling corlib. 
12270
12271         * everywhere: Make use of the above in the relevant places.
12272
12273 2003-07-22  Martin Baulig  <martin@ximian.com>
12274
12275         * cs-parser.jay (invocation_expression): Moved
12276         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12277         `cast_expression', but create a InvocationOrCast which later
12278         resolves to either an Invocation or a Cast.
12279
12280         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12281         method; call this before EmitStatement() to make sure that this
12282         expression can be used as a statement.
12283
12284         * expression.cs (InvocationOrCast): New class; resolves to either
12285         an Invocation or a Cast.
12286
12287         * statement.cs (StatementExpression): Call ResolveStatement() on
12288         the ExpressionStatement before emitting it.
12289
12290 2003-07-21  Martin Baulig  <martin@ximian.com>
12291
12292         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12293         `ref' and `out' attributes match; fixes #46220.
12294         (MemberAccess.ResolveMemberAccess): You can't reference a type
12295         through an expression; fixes #33180.
12296         (Indexers.GetIndexersForType): Don't return the indexers from
12297         interfaces the class implements; fixes #46502.
12298
12299 2003-07-21  Martin Baulig  <martin@ximian.com>
12300
12301         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12302         CS0661 checks; fixes bug #30442.
12303
12304 2003-07-21  Martin Baulig  <martin@ximian.com>
12305
12306         * decl.cs (AdditionResult): Added `Error'.
12307
12308         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12309
12310         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12311         cs0031.cs actually work.
12312
12313  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12314  
12315         * cs-parser.jay (namespace_name): do not use
12316         namespace_or_type_name, use qualified_identifier, because
12317         namespace_or_type_name will soon return a composed expression
12318         instead of a string.
12319  
12320         (namespace_or_type_name): Instead of returning a string, now this
12321         production returns an expression.
12322  
12323         * codegen.cs (EmitContext): Setup IsGeneric property based on
12324         whether our DeclSpace is generic, our the method is generic.
12325  
12326         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
12327         the method is generic.
12328  
12329         * cs-parser.jay (type_arguments, opt_type_argument_list,
12330         type_parameters, type_parameter_list, opt_type_parameter_list,
12331         type_parameter,, opt_type_parameter_constraints_clauses,
12332         type_parameter_constraints_clauses,
12333         type_parameter_constraint_clause, type_parameter_constraint,
12334         interface_constraints): Add new production
12335  
12336         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
12337         DeclSpace is generic or not.
12338  
12339         (DeclSpace.SetParameterInfo): New routine, used to set the
12340         parameter info for a type.
12341  
12342         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
12343         returns a GenericTypeExpr
12344  
12345         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
12346         generic, lookup the generic argument.
12347  
12348         * attribute.cs: Do not allow TypeParameterExpressions in
12349         Attributes.
12350  
12351         * class.cs: Do not allow the Main method to be defined in a
12352         Generic container.
12353  
12354         * expression.cs (SizeOf): Do not allow generic types to be used as
12355         arguments to sizeof.
12356  
12357         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
12358         it: whether a type is generic or not.  Only works for types we are
12359         currently building for now.
12360         
12361 2003-07-20  Martin Baulig  <martin@ximian.com>
12362
12363         * namespace.cs: Fixed that bug which caused a crash when compiling
12364         the debugger's GUI.
12365
12366 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12367
12368         * typemanager.cs (LookupTypeReflection): Never expose types which
12369         are NotPublic, NestedPrivate, NestedAssembly, or
12370         NestedFamANDAssem.  We used to return these, and later do a check
12371         that would report a meaningful error, but the problem is that we
12372         would not get the real match, if there was a name override.
12373
12374 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12375
12376         * namespace.cs (Namespace, Name): Do not compute the namespace
12377         name dynamically, compute it in the constructor.  This reduced
12378         memory usage by 1697 KB.
12379
12380         * driver.cs: Use --pause to pause at the end.
12381
12382 2003-07-17  Peter Williams  <peter@newton.cx>
12383
12384         * Makefile: Change the name of the test target so that it doesn't
12385         conflict with the recursive test target.
12386
12387 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12388
12389         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12390         AddressOf): Do not use EmitThis, that was wrong, use the actual
12391         this pointer.
12392
12393 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12394
12395         * class.cs (MethodData.Define): While checking if a method is an
12396         interface implementation, improve the test: If we are not public
12397         (use new test here: use the computed MethodAttributes directly,
12398         instead of the parsed modifier flags) check if the `implementing'
12399         method comes from an interface or not.
12400
12401         * pending.cs (VerifyPendingMethods): Slightly better error
12402         message.
12403
12404         * makefile: add test target that does the mcs bootstrap.
12405
12406 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12407
12408         * interface.cs (Define): Do nothing here since there are no
12409         members to populate etc. Move the attribute emission out of here
12410         since this was just totally the wrong place to put it. Attribute
12411         application happens during the 'Emit' phase, not in the 'Define'
12412         phase.
12413
12414         (Emit): Add this method and move the attribute emission here
12415
12416         * rootcontext.cs (EmitCode): Call the Emit method on interface
12417         types too.
12418
12419 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12420
12421         * expression.cs (OverloadResolve): Report error only if Location
12422         is not 'Null' which means that there was a probe going on.
12423
12424 2003-07-14  Martin Baulig  <martin@ximian.com>
12425
12426         * expression.cs (ConditionalLogicalOperator): New public class to
12427         implement user defined conditional logical operators.
12428         This is section 14.11.2 in the spec and bug #40505.
12429
12430 2003-07-14  Martin Baulig  <martin@ximian.com>
12431
12432         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12433
12434 2003-07-14  Martin Baulig  <martin@ximian.com>
12435
12436         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12437
12438         * ecore.cs (IVariable.VerifyFixed): New interface method.
12439
12440         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12441         operator, check whether the variable is actually fixed.  Fixes bug
12442         #36055.  Set a variable definitely assigned when taking its
12443         address as required by the spec.
12444
12445         * statement.cs (LocalInfo.IsFixed): New field.
12446         (LocalInfo.MakePinned): Set `IsFixed' to true.
12447
12448 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12449
12450         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12451         for .ctors, ensure that we only ask for members declared in the
12452         attribute type (BindingFlags.DeclaredOnly).
12453
12454         Fixes bug #43632.
12455
12456         * expression.cs (Error_WrongNumArguments): Report error 1501
12457         correctly the way CSC does.
12458
12459 2003-07-13  Martin Baulig  <martin@ximian.com>
12460
12461         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12462         lookup on the fully qualified name, to make things like "X.X" work
12463         where "X.X" is a fully qualified type name, but we also have a
12464         namespace "X" in the using list.  Fixes #41975.
12465
12466 2003-07-13  Martin Baulig  <martin@ximian.com>
12467
12468         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12469         function. If we're a CompoundAssign, we need to create an embedded
12470         CompoundAssign, not an embedded Assign.
12471         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12472         Fixes #45854.
12473
12474 2003-07-13  Martin Baulig  <martin@ximian.com>
12475
12476         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12477         work to fix bug #46088.
12478
12479 2003-07-13  Ravi Pratap <ravi@ximian.com>
12480
12481         * class.cs (Operator.Emit): Do not emit attributes here - it is
12482         taken care of by the Method class that we delegate too. This takes
12483         care of bug #45876.
12484
12485 2003-07-10  Martin Baulig  <martin@ximian.com>
12486
12487         * expression.cs (TypeOfVoid): New class.
12488         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12489
12490 2003-07-10  Martin Baulig  <martin@ximian.com>
12491
12492         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12493         bug #35957.
12494
12495 2003-07-10  Martin Baulig  <martin@ximian.com>
12496
12497         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12498         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12499
12500         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12501
12502         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12503
12504 2003-07-10  Martin Baulig  <martin@ximian.com>
12505
12506         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12507         of decimal.  Fixes #42850.
12508
12509         NOTE: I also fixed the created byte blob, but this doesn't work on
12510         the MS runtime and csc never produces any byte blobs for decimal
12511         arrays.
12512
12513 2003-07-10  Martin Baulig  <martin@ximian.com>
12514
12515         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12516         structs; fixes #32068.
12517         (Block.AddChildVariableNames): Fixed #44302.
12518
12519 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12520
12521         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12522
12523 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12524
12525         * attribute.cs: And this test is onger needed.
12526
12527 2003-07-08  Martin Baulig  <martin@ximian.com>
12528
12529         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12530         inaccessible types.  Fixes #36313.
12531
12532         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12533
12534         * namespace.cs (NamespaceEntry): Create implicit entries for all
12535         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12536         implicit entries for N1.N2 and N1.
12537
12538 2003-07-08  Martin Baulig  <martin@ximian.com>
12539
12540         Rewrote the handling of namespaces to fix a lot of the issues
12541         wrt. `using' aliases etc.
12542
12543         * namespace.cs (Namespace): Splitted this class into a
12544         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12545
12546         * typemanager.cs (TypeManager.IsNamespace): Removed.
12547         (TypeManager.ComputeNamespaces): Only compute namespaces from
12548         loaded assemblies here, not the namespaces from the assembly we're
12549         currently compiling.
12550
12551 2003-07-08  Martin Baulig  <martin@ximian.com>
12552
12553         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12554
12555 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12556
12557         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12558         already fixed it.  
12559
12560         I thought about the memory savings here, but LookupTypeReflection
12561         is used under already very constrained scenarios.  Compiling
12562         corlib or mcs only exposes one hit, so it would not really reduce
12563         any memory consumption.
12564
12565 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12566
12567         * typemanager.cs: fixes bug #45889 by only adding public types from
12568         other assemblies to the list of known types.
12569
12570 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12571
12572         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12573         on the type we resolved.
12574
12575 2003-07-05  Martin Baulig  <martin@ximian.com>
12576
12577         * pending.cs (PendingImplementation.ParentImplements): Don't
12578         create the proxy if the parent is abstract.
12579
12580         * class.cs (TypeContainer.DefineIndexers): Process explicit
12581         interface implementations first.  Fixes #37714.
12582
12583 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12584
12585         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12586         defined recursively;  but since we modify the input parameters
12587         (left is set to `this' temporarily), we reset this value if the
12588         left_is_explicit is false, which gives the original semantics to
12589         the code.  
12590
12591         * literal.cs (NullPointer): new class used to represent a null
12592         literal in a pointer context.
12593
12594         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12595         type is a pointer, use a NullPointer object instead of a
12596         NullLiteral.   Closes 43687
12597
12598         (ExplicitConversion): Convert pointer values using
12599         the conv opcode to the proper type.
12600
12601         * ecore.cs (New): change ValueTypeVariable property into a method,
12602         that returns whether the valuetype is suitable for being used.
12603
12604         * expression.cs (Binary.DoNumericPromotions): Only return if we
12605         the int constant was a valid uint, and we can return both left and
12606         right as uints.  If not, we continue processing, to trigger the
12607         type conversion.  This fixes 39018.
12608
12609         * statement.cs (Block.EmitMeta): During constant resolution, set
12610         the CurrentBlock property on the emitcontext, so that we resolve
12611         constants propertly.
12612
12613 2003-07-02  Martin Baulig  <martin@ximian.com>
12614
12615         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12616         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12617
12618         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12619         than emitting it here.
12620
12621         * statement.cs: Fixed some more flow analysis bugs.
12622
12623 2003-07-02  Martin Baulig  <martin@ximian.com>
12624
12625         * class.cs (MethodData.Define): When implementing interface
12626         methods, set Final unless we're Virtual.
12627
12628         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12629         check work for interface methods.
12630
12631 2003-07-01  Martin Baulig  <martin@ximian.com>
12632
12633         * ecore.cs (EmitContext.This): Replaced this property with a
12634         GetThis() method which takes a Location argument.  This ensures
12635         that we get the correct error location for a CS0188.
12636
12637 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12638
12639         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12640         ImplicitStandardConversion.
12641
12642         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12643
12644 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
12645
12646         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12647         optimization.
12648
12649 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
12650
12651         * class.cs (Constructor.Define): Turn off initlocals for unsafe
12652         constructors.
12653
12654         (MethodData.Define): Turn off initlocals for unsafe methods.
12655
12656 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
12657
12658         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12659         complete;  Fixes #37521.
12660
12661         * delegate.cs: Use Modifiers.TypeAttr to compute the
12662         TypeAttributes, instead of rolling our own.  This makes the flags
12663         correct for the delegates.
12664
12665 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12666
12667         * class.cs (Constructor.Define): Set the private flag for static
12668         constructors as well.
12669
12670         * cs-parser.jay (statement_expression): Set the return value to
12671         null, to avoid a crash when we catch an error.
12672
12673 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12674
12675         * cs-parser.jay: Applied patch from Jackson that adds support for
12676         extern and unsafe modifiers to destructor declarations.
12677
12678         * expression.cs: Report error 21 if the user is trying to index a
12679         System.Array.
12680
12681         * driver.cs: Add an error message, suggested by the bug report.
12682
12683         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12684         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12685
12686 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12687
12688         * namespace.cs: Add some information to reduce FAQs.
12689
12690 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12691
12692         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12693         underlying enumeration types.  Fixes #43915.
12694
12695         * expression.cs: Treat ushort/short as legal values to be used in
12696         bitwise operations.
12697
12698 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12699
12700         * delegate.cs: transfer custom attributes for paramenters from
12701         the delegate declaration to Invoke and BeginInvoke.
12702
12703 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12704
12705         * attribute.cs: handle custom marshalers and emit marshal info
12706         for fields, too.
12707
12708 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12709
12710         * makefile.gnu: Added anonymous.cs to the compiler sources.
12711
12712 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12713
12714         * iterators.cs: Change the name of the proxy class to include two
12715         underscores.
12716
12717         * cs-parser.jay: Update grammar to include anonymous methods.
12718
12719         * anonymous.cs: new file.
12720
12721 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12722
12723         * class.cs (Field.Define): Add missing test for pointers and
12724         safety. 
12725
12726 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12727
12728         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12729         we use the stobj opcode.
12730
12731         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12732         since it wasn't the correct fix. 
12733
12734         It still is puzzling that we are required to use stobj for IntPtr
12735         which seems to be a ValueType.
12736
12737 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12738
12739         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12740         during regular simple name resolution.   Now, the trick is that
12741         instead of returning for processing the simplename, we do a
12742         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12743         contextual lookup type).   If a match is found, return that, if
12744         not, return for further composition.
12745
12746         This fixes long-standing 30485.
12747
12748         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12749         using the address to initialize an object, do an Stobj instead of
12750         using the regular Stelem.
12751
12752         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12753         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12754         Because if we are a BaseIndexerAccess that value will be true.
12755         Fixes 43643.
12756
12757         * statement.cs (GotoCase.Resolve): Return after reporting an
12758         error, do not attempt to continue. 
12759
12760         * expression.cs (PointerArithmetic.Emit): If our operand is a
12761         long, convert our constants to match the operand before
12762         multiplying.  Convert to I type before adding.   Fixes 43670.
12763
12764 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12765
12766         * enum.cs (ImplicitConversionExists) : Rename to
12767         ImplicitEnumConversionExists to remove ambiguity. 
12768
12769         * ecore.cs (NullCast): New type of cast expression class which
12770         basically is very similar to EmptyCast with the difference being
12771         it still is a constant since it is used only to cast a null to
12772         something else
12773         (eg. (string) null)
12774
12775         * convert.cs (ImplicitReferenceConversion): When casting a null
12776         literal, we return a NullCast.
12777
12778         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12779         should be around anymore.
12780
12781         The renaming (reported was slightly wrong). Corrections:
12782
12783         ConvertImplicitStandard -> ImplicitConversionStandard
12784         ConvertExplicitStandard -> ExplicitConversionStandard
12785
12786         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12787         before passing them in !
12788
12789         * convert.cs (ImplicitConversionStandard): When comparing for
12790         equal expr and target types, ensure that expr is not a
12791         NullLiteral.
12792
12793         In general, we must not be checking (expr_type ==
12794         target_type) in the top level conversion methods
12795         (ImplicitConversion, ExplicitConversion etc). This checking is
12796         done in the methods that they delegate to.
12797
12798 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12799
12800         * convert.cs: Move Error_CannotConvertType,
12801         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12802         ImplicitNumericConversion, ImplicitConversionExists,
12803         ImplicitUserConversionExists, StandardConversionExists,
12804         FindMostEncompassedType, FindMostSpecificSource,
12805         FindMostSpecificTarget, ImplicitUserConversion,
12806         ExplicitUserConversion, GetConversionOperators,
12807         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12808         TryImplicitIntConversion, Error_CannotConvertImplicit,
12809         ConvertImplicitRequired, ConvertNumericExplicit,
12810         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12811         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12812         its own file.
12813
12814         Perform the following renames:
12815
12816         StandardConversionExists -> ImplicitStandardConversionExists
12817         ConvertImplicit -> ImplicitConversion
12818         ConvertImplicitStandard -> ImplicitStandardConversion
12819         TryImplicitIntConversion -> ImplicitIntConversion
12820         ConvertImplicitRequired -> ImplicitConversionRequired
12821         ConvertNumericExplicit -> ExplicitNumericConversion
12822         ConvertReferenceExplicit -> ExplicitReferenceConversion
12823         ConvertExplicit -> ExplicitConversion
12824         ConvertExplicitStandard -> ExplicitStandardConversion
12825
12826 2003-05-19  Martin Baulig  <martin@ximian.com>
12827
12828         * statement.cs (TypeInfo.StructInfo): Made this type protected.
12829         (TypeInfo): Added support for structs having structs as fields.
12830
12831         * ecore.cs (FieldExpr): Implement IVariable.
12832         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12833         VariableInfo for the field.
12834
12835 2003-05-18  Martin Baulig  <martin@ximian.com>
12836
12837         * expression.cs (This.DoResolve): Report a CS0027 if we're
12838         emitting a field initializer.
12839
12840 2003-05-18  Martin Baulig  <martin@ximian.com>
12841
12842         * expression.cs (This.ResolveBase): New public function.
12843         (This.DoResolve): Check for CS0188.
12844
12845         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12846         This.Resolve().
12847
12848         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12849         `instance_expression' to null if we don't have any non-static
12850         methods.
12851
12852 2003-05-18  Martin Baulig  <martin@ximian.com>
12853
12854         Reworked the way how local variables and parameters are handled by
12855         the flow analysis code.
12856
12857         * statement.cs (TypeInfo, VariableMap): New public classes.
12858         (VariableInfo): New public class.  This is now responsible for
12859         checking whether a variable has been assigned.  It is used for
12860         parameters and local variables.
12861         (Block.EmitMeta): Take the InternalParameters as argument; compute
12862         the layout of the flow vectors here.
12863         (Block.LocalMap, Block.ParameterMap): New public properties.
12864         (FlowBranching): The .ctor doesn't get the InternalParameters
12865         anymore since Block.EmitMeta() now computes the layout of the flow
12866         vector.
12867         (MyStructInfo): This class is now known as `StructInfo' and nested
12868         in `TypeInfo'; we don't access this directly anymore.
12869
12870         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12871         property and removed IsAssigned(), IsFieldAssigned(),
12872         SetAssigned() and SetFieldAssigned(); we now call them on the
12873         VariableInfo so we don't need to duplicate this code everywhere.
12874
12875         * expression.cs (ParameterReference): Added `Block block' argument
12876         to the .ctor.
12877         (LocalVariableReference, ParameterReference, This): The new
12878         VariableInfo class is now responsible for all the definite
12879         assignment stuff.
12880
12881         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12882         IsParameterAssigned, SetParameterAssigned): Removed.
12883
12884 2003-05-18  Martin Baulig  <martin@ximian.com>
12885
12886         * typemanager.cs (InitCoreTypes): Try calling
12887         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12888         the 3-args-version.  Corlib now also needs our `void_type'.
12889         (GetMethod): Added overloaded version which takes an optional
12890         `bool report_errors' to allow lookups of optional methods.
12891
12892 2003-05-12  Martin Baulig  <martin@ximian.com>
12893
12894         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12895         only used for locals and not for parameters.
12896
12897 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12898
12899         * support.cs (InternalParameters.ParameterType): Return the
12900         ExternalType of the parameter.
12901
12902         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12903         they were unused.
12904
12905 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12906
12907         * class.cs (MethodData.Define): Do not set the `newslot' on
12908         interface members, if they are also flagged as "override".
12909
12910         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12911         better code for ++i and i++.  This only works for static fields
12912         and local variables.
12913
12914         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12915         want to pull the DeclSpace out of the builder_to_declspace instead
12916         of the TypeBuilder (like in TypeContainer.FindMembers).
12917
12918         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12919         instead of LookupTypeContainer.  Fixes the crash on .NET for
12920         looking up interface members.
12921
12922         * const.cs: Create our own emit context during the Definition
12923         stage, so that constants are evaluated in the proper context, when
12924         a recursive definition happens.
12925
12926 2003-05-11  Martin Baulig  <martin@ximian.com>
12927
12928         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12929         new block for a switch section.
12930         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12931         the adding/lookup in the switch block.  Fixes #39828.
12932
12933 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12934
12935         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12936         functionality: I needed to convert the data after I had performed
12937         the add/sub operation into the operands type size.
12938
12939         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12940         pass the type for the box operation, otherwise the resulting
12941         object would have been of type object.
12942
12943         (BoxedCast): Add constructor to specify the type to box as.
12944
12945 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12946
12947         * iterators.cs: I was reusing the `count' variable inadvertently,
12948         take steps to not allow this to happen.
12949
12950 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12951
12952         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12953         by creating an array at the point where the params starts and
12954         putting all those arguments there, then adjusting the size of the
12955         array.
12956
12957 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12958
12959         * expression.cs (New.AddressOf): Implement interface
12960         IMemoryLocation.  This is used when the `new' operator is used in
12961         the context of an invocation to a method on a value type.
12962
12963         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12964         example. 
12965
12966         * namespace.cs: Also check the using aliases here.
12967
12968         * driver.cs: Move the test for using validity after the types have
12969         been entered, so we do a single pass that also includes the using
12970         aliases. 
12971
12972         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12973         in the regular case.   CreateSiblingForFinally is doing extra
12974         error checking.
12975
12976         * attribute.cs (GetAttributeArgumentExpression): Store the result
12977         on an out value, and use the return value to indicate failure
12978         instead of using null (which is a valid return for Constant.GetValue).
12979
12980         * statement.cs: Perform the analysis flow for the increment
12981         portion after the statement, because this will be the real flow of
12982         execution.  Fixes #42385
12983
12984         * codegen.cs (EmitContext.EmitArgument,
12985         EmitContext.EmitStoreArgument): New helper functions when the
12986         RemapToProxy flag is set.
12987
12988         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12989         function.
12990
12991         Add support for remapping parameters. 
12992
12993         * iterators.cs: Propagate parameter values;  Store parameter
12994         values in the proxy classes.
12995
12996 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12997
12998         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12999         need a proxy reference;  I do not know what I was thinking
13000
13001         * cs-parser.jay (constructor_initializer): catch another error,
13002         and display nice message.
13003
13004         (field_declaration): catch void field declaration
13005         to flag a better error. 
13006
13007         * class.cs (MemberBase.CheckBase): Report an error instead of a
13008         warning if a new protected member is declared in a struct. 
13009         (Field.Define): catch the error of readonly/volatile.
13010
13011         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13012
13013         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13014         volatile variable is taken
13015
13016 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13017
13018         * statement.cs (Fixed.Resolve): Report an error if we are not in
13019         an unsafe context.
13020
13021 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13022
13023         * typemanager.cs: reuse the code that handles type clashes for
13024         delegates and enumerations.
13025
13026         * class.cs (Report28): Always report.
13027
13028         * expression.cs (EncodeAsAttribute): Allow nulls here.
13029
13030 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13031
13032         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13033         the functionality for testing whether an expression is valid for
13034         an attribute here.  Also handle the case of arrays of elements
13035         being stored. 
13036
13037         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13038         encoding a linear array into an array of objects that are suitable
13039         to be passed to an CustomAttributeBuilder.
13040
13041         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13042
13043         * ecore.cs: (FieldExpr): Handle field remapping here.
13044
13045         * iteratators.cs: Pass the instance variable (if the method is an
13046         instance method) to the constructors, so we can access the field
13047         variables on the class.
13048
13049         TODO: Test this with structs.  I think the THIS variable on
13050         structs might have to be a pointer, and not a refenrece
13051
13052 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13053
13054         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13055         local variables to fields in a proxy class.
13056
13057         * iterators.cs (PopulateProxy): Rename our internal fields to
13058         <XXX>.  
13059         Create a <THIS> field if we are an instance method, so we can
13060         reference our parent container variables.
13061         (MapVariable): Called back from the EmitContext code to enter a
13062         new variable to field mapping into the proxy class (we just create
13063         a FieldBuilder).
13064
13065         * expression.cs
13066         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13067         for using the remapped locals to fields.
13068
13069         I placed the code here, because that gives the same semantics to
13070         local variables, and only changes the Emit code.
13071
13072         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13073         statements inside iterators.
13074         (VariableInfo): Add a FieldBuilder for the cases when we are
13075         remapping local variables to fields in a proxy class
13076
13077         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13078         current_block != null.
13079
13080         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13081         not cope with strings, as it has been moved to the
13082         TableSwitchEmit.  Fixed bug in switch generation.
13083
13084         * expression.cs (New.DoResolve): Provide more context for the user
13085         when reporting an error.
13086
13087         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13088         pointers. 
13089
13090         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13091         check the permissions for it.  Note than in a type-resolution
13092         context the check was already present in DeclSpace.ResolveType,
13093         but was missing from the MemberAccess.
13094
13095         (ArrayCreation.CheckIndices): warn if the user has
13096         more nested levels of expressions, but there are no more
13097         dimensions specified.  Avoids crash on bug 41906.
13098
13099 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13100
13101         * statement.cs (Block): replace Implicit bool, for a generic
13102         flags.   
13103         New flag: `Unchecked'.  This is used during the EmitMeta phase
13104         (which is out-of-line with the regular Resolve/Emit process for a
13105         statement, as this is done ahead of time, but still gets a chance
13106         to call constant resolve).
13107
13108         (Block.Flags): new enum for adding a new flag.
13109
13110         (Block.EmitMeta): track the state of unchecked.
13111
13112         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13113         to enable constant resolution to work there as well.
13114
13115 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13116
13117         * typemanager.cs (ienumerable_type): Also look up
13118         System.Collections.IEnumerable. 
13119
13120 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13121
13122         TODO: Test more than one conditional per method.
13123
13124         * class.cs (Indexer.Define): Report the location where the user is
13125         referencing the unsupported feature.
13126
13127         (MethodData): Overload the use of `conditionals' to
13128         minimize the creation of needless ArrayLists.   This saves roughly
13129         212kb on my machine.
13130
13131         (Method): Implement the new IIteratorContainer interface.
13132         (Method.SetYields): Implement the method by setting the ModFlags
13133         to contain METHOD_YIELDS.
13134
13135         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13136         which just got set to null.
13137
13138         * iterators.cs: New file.
13139
13140         (Yield, YieldBreak): New statements.
13141
13142         * statement.cs (Return.Resolve): Flag an error if we are used in
13143         an iterator method.
13144
13145         * codegen.cs (InIterator): New flag set if the code is being
13146         compiled in an iterator method.
13147
13148         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13149         internal modifier, and we just use it to avoid adding extra
13150         fields, as this is seldom used.  
13151
13152         * cs-parser.jay: Add yield_statement (yield and yield break).
13153
13154         * driver.cs: New flag -v2 to turn on version 2 features. 
13155
13156         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13157         hashtable when v2 is enabled.
13158
13159 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13160
13161         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13162         there is already a namespace defined with this name.
13163
13164         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13165         people upgraded their corlibs.
13166
13167         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13168         always use fully qualified types, no need to use the compiler
13169         front end.
13170
13171         (TypeManager.IsNamespace): Use binarysearch.
13172
13173         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13174         AddDelegate): I did not quite use the new IsValid API properly: I
13175         have to pass the short-name and the fullname.  I was passing only
13176         the basename instead of the fullname sometimes. 
13177
13178         (TypeContainer.DefineType): call NamespaceClash.
13179
13180         * interface.cs (Interface.DefineType): use NamespaceClash before
13181         defining the type.
13182
13183         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13184         defining the type.
13185
13186         * enum.cs: (Enum.DefineType): use NamespaceClash before
13187         defining the type.
13188
13189         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13190         speed increase.  First, use the negative_hits cache when we get a
13191         negative.  Second, add the type with its full original name
13192         instead of the new . and + encoded name (reflection uses + to
13193         separate type from a nested type).  Use LookupTypeReflection
13194         directly which bypasses the type->name hashtable (that we already
13195         know does not contain the type.
13196
13197         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13198         location/container type. 
13199
13200         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13201
13202 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13203
13204         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13205
13206         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13207         method is being referenced in the method group from a static
13208         context, and report error 120 if so.
13209
13210         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13211         Error118. 
13212
13213         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13214         is created, we create the A namespace).
13215
13216         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13217         Fixes #41591
13218
13219 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13220
13221         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13222         invocation to ModuleBuilder.GetType with the same values will
13223         return a new type instance, so we need to cache its return
13224         values. 
13225
13226         * expression.cs (Binary.ResolveOperator): Only allow the compare
13227         operators on enums if they are of the same type.
13228
13229         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13230         types of ValueType on their own case.  Before we were giving them
13231         the same treatment as objects.
13232
13233         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13234         fullname.  Short name is used to compare against container name.
13235         Fullname is used to check against defined namespace names.
13236
13237         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13238         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13239
13240         (Method.CheckBase): Call parent.
13241         (MemberBase.CheckBase): Check for protected members on sealed
13242         classes.
13243         (PropertyBase.CheckBase): Call parent.
13244         (Field.Define): Call parent.
13245
13246         * report.cs: Negative error codes are now mapped to 8000 - code,
13247         so that the display is render more nicely.
13248
13249         * typemanager.cs: Do not use try/catch, instead report a regular
13250         error. 
13251
13252         (GetPointerType, GetReferenceType): These methods provide
13253         mechanisms to obtain the T* and T& from a T.  We had the code
13254         previously scattered around the code base, and it also used
13255         TypeManager.LookupType that would go through plenty of caches.
13256         This one goes directly to the type source.
13257
13258         In some places we did the Type.GetType followed by
13259         ModuleBuilder.GetType, but not in others, so this unifies the
13260         processing as well.
13261
13262         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13263         statements now that we have namespace information.
13264
13265         * typemanager.cs (IsNamespace): New method, returns whether the
13266         string presented is a namespace or not.
13267
13268         (ComputeNamespaces): New public entry point, computes the list of
13269         available namespaces, using the GetNamespaces API call in Mono, or
13270         the slower version in MS.NET.   
13271
13272         Now before we start the semantic analysis phase, we have a
13273         complete list of namespaces including everything that the user has
13274         provided.
13275
13276         Deleted old code to cache namespaces in .nsc files.
13277
13278 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13279
13280         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13281         class/struct location definition Location for the implicit
13282         constructor location.
13283
13284         (Operator.Define): Use the location of the operator for the
13285         implicit Method definition.
13286
13287         (Constructor.Emit): use the constructor location for the implicit
13288         base initializer constructor.
13289
13290         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13291         and the Expression class now contains two new methods:
13292
13293         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13294         isolate type lookup from the rest of the resolution process.
13295
13296         Since we use Expressions to hold type definitions due to the way
13297         we parse the input we have historically overloaded Resolve to
13298         perform the Type lookups if a special flag is passed.  Now this is
13299         eliminated and two methods take their place. 
13300
13301         The differences in the two methods between xStep and xTerminal is
13302         that xStep is involved in our current lookup system that uses
13303         SimpleNames to compose a name, while xTerminal is used just to
13304         catch the case where the simplename lookup failed.
13305
13306 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13307
13308         * expression.cs (ResolveMemberAccess): Remove redundant code.
13309         TypeExpr expressions are always born fully resolved.
13310
13311         * interface.cs (PopulateMethod): Do not lookup the types twice.
13312         We were doing it once during SemanticAnalysis and once during
13313         PopulateMethod.
13314
13315         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13316         in local variable type definitions, were being returned as a
13317         SimpleName (we decomposed everything into a string), that is
13318         because primary_expression was being used instead of a type in the
13319         grammar (reduce/reduce conflicts).
13320
13321         The part that was wrong is that we converted the expression into a
13322         string (an oversimplification in one hand, compounded with primary
13323         expressions doing string concatenation).
13324
13325         So things like:
13326
13327         A.B.C [] x;
13328
13329         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13330         using clauses from working on this particular context.  And a type
13331         was being matched directly against "A.B.C[]".
13332
13333         We now use the correct approach, and allow for ComposedCast to be
13334         part of the unary expression.  So the "A.B.C []" become a composed
13335         cast of "A.B.C" (as a nested group of MemberAccess with a
13336         SimpleName at the end) plus the rank composition "[]". 
13337
13338         Also fixes 35567
13339
13340 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13341
13342         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13343         for the access level checking.
13344
13345         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13346         `TypeContainer container', because I kept getting confused when I
13347         was debugging this code.
13348
13349         * expression.cs (Indexers): Instead of tracking getters/setters,
13350         we now track them in parallel.  We create one arraylist less, but
13351         most importantly it is possible now for the LValue code to find a
13352         matching get for a set.
13353
13354         (IndexerAccess.DoResolveLValue): Update the code.
13355         GetIndexersForType has been modified already to extract all the
13356         indexers from a type.  The code assumed it did not.
13357
13358         Also make the code set the correct return type for the indexer.
13359         This was fixed a long time ago for properties, but was missing for
13360         indexers.  It used to be void_type.
13361
13362         (Binary.Emit): Test first for doubles instead of
13363         floats, as they are more common.
13364
13365         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13366         when dealing with floats and the <=, >= operators.  This fixes bug
13367         #39314 
13368
13369         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13370         to load the array value by emitting a load on the foreach variable
13371         type.  This was incorrect.  
13372
13373         We now emit the code to load an element using the the array
13374         variable type, and then we emit the conversion operator.
13375
13376         Fixed #40176
13377
13378 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13379
13380         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13381
13382 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13383
13384         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13385         test for protection before we test for signatures. 
13386
13387         (MethodSignature.ToString): implement.
13388
13389         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13390         to the case where we reduced into a LongConstant.
13391
13392         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13393         depend on whether the information is acurrate, because the
13394         Microsoft runtime will always claim that the array type is public,
13395         regardless of the real state.
13396
13397         If the type is a pointer, another problem happens: the type is
13398         reported as non-public in Microsoft.  
13399
13400         In both cases we have to call CheckAccessLevel recursively with
13401         the underlying type as the argument to be tested.
13402
13403 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13404
13405         * assign.cs (Assign.Emit): If we are dealing with a compound
13406         assignment expression, we should use the code path that stores the
13407         intermediate result in a temporary value.  This fixes #40903.
13408
13409         *expression.cs (Indirection.ToString): Provide ToString method for
13410         debugging. 
13411
13412 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13413
13414         * class.cs: Null out fields holding references to Block objects so
13415         they can be garbage collected.
13416
13417         * expression.cs (OverloadResolve): Remove unused local.
13418
13419 2003-04-07  Martin Baulig  <martin@ximian.com>
13420
13421         * codegen.cs (EmitContext.CurrentFile): New public field.
13422         (EmitContext.Mark): Use the CurrentFile to check whether the
13423         location is in the correct file.
13424         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13425
13426 2003-04-07  Martin Baulig  <martin@ximian.com>
13427
13428         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13429
13430         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13431         location.  [FIXME: The location argument which gets passed to this
13432         method is sometimes wrong!]
13433
13434 2003-04-07  Nick Drochak <ndrochak@gol.com>
13435
13436         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13437
13438 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13439
13440         * expression.cs (Indirection.EmitAssign): We were using the
13441         temporary, but returning immediately instead of continuing the
13442         EmitAssing flow.
13443
13444 2003-04-06  Martin Baulig  <martin@ximian.com>
13445
13446         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13447         if it's a nested child, but also deriving from the outer class.
13448         See test 190.cs.
13449
13450         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13451         nested child, but also deriving from the outer class.  See
13452         test-190.cs.
13453         (FilterWithClosure): We may access private members of the outer
13454         class if we're a nested child and deriving from the outer class.
13455         (RealMemberLookup): Only set `closure_private_ok' if the
13456         `original_bf' contained BindingFlags.NonPublic.
13457
13458 2003-04-05  Martin Baulig  <martin@ximian.com>
13459
13460         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
13461         probe if its a type parameter, and if so, flag an error.
13462
13463         * decl.cs: Move here the SetParameterInfo code from class.cs.
13464         Handle IsGeneric here.
13465
13466         Handle a variety of errors in the parameter info definition.
13467
13468         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
13469         type parameters here.
13470
13471         * cs-parser.jay (class_declaration): report errors for parameters
13472         here as well.
13473
13474 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
13475
13476         * generic.cs: New file, contains support code for generics.
13477
13478         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
13479         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
13480
13481         Update parser for the above removals.
13482
13483         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
13484         now taken care of in the parser.
13485
13486 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13487
13488         * class.cs (Event.Define): Do not allow abstract events to have
13489         initializers. 
13490
13491 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13492
13493         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13494         block in event declarations.
13495
13496         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13497         value type, get its address.
13498
13499         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13500         leaving a class on the stack instead of a boolean value (int
13501         0/1).  Change the code so we compare against null, and then the
13502         result against zero.
13503
13504         * class.cs (TypeContainer.GetClassBases): We were checking for the
13505         parent class being sealed too late.
13506
13507         * expression.cs (Binary.Emit): For <= and >= when dealing with
13508         floating point values, use cgt.un and clt.un instead of cgt and
13509         clt alone.
13510
13511 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13512
13513         * statement.cs: Apply the same optimization as MS: skip the 
13514         GetEnumerator returning an IEnumerator, and use the one returning a 
13515         CharEnumerator instead. This allows us to avoid the try-finally block 
13516         and the boxing.
13517
13518 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13519
13520         * cs-parser.jay: Attributes cannot be applied to
13521                          namespaces. Fixes #40473
13522
13523 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13524
13525         * class.cs:
13526         (Add*): check if the name is valid using the full name for constants,
13527         fields, properties and events.
13528
13529 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13530
13531         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13532         char constants to be part of the enumeration.
13533
13534         * expression.cs (Conditional.DoResolve): Add support for operator
13535         true. Implements the missing functionality from 14.12
13536
13537         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13538         operator true/false as required by the spec.
13539
13540         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13541         implicit conversion to boolean.
13542
13543         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13544         also one where the type implements `operator true'. 
13545
13546         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13547         get an expression that will invoke operator true based on an
13548         expression.  
13549
13550         (GetConversionOperators): Removed the hack that called op_True
13551         here.  
13552
13553         (Expression.ResolveBoolean): Move this from Statement.
13554
13555 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13556
13557         * ecore.cs (FieldExpr): do not allow initialization of initonly
13558         fields on derived classes
13559
13560 2003-03-13  Martin Baulig  <martin@ximian.com>
13561
13562         * statement.cs (Block.Emit): Call ig.BeginScope() and
13563         ig.EndScope() when compiling with debugging info; call
13564         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13565
13566 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13567
13568         * expression.cs (Indexers): Do not construct immediately, allow
13569         for new members to be appended as we go.  Fixes 38143
13570
13571 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13572
13573         * expression.cs: save/restore context when resolving an unchecked
13574         expression.
13575
13576 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13577
13578         * cfold.cs: Catch division by zero in modulus operator during
13579         constant folding.
13580
13581 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13582
13583         * interface.cs (Interface.DefineMembers): Avoid defining members
13584         twice. 
13585
13586 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13587
13588         * driver.cs: handle the +/- options for -noconfig
13589
13590         * statement.cs (Unckeched.Resolve): Also track the state of
13591         unchecked in the Resolve phase.
13592
13593 2003-02-27  Martin Baulig  <martin@ximian.com>
13594
13595         * ecore.cs (Expression.MemberLookup): Don't create a
13596         MethodGroupExpr for something which is not a method.  Fixes #38291.
13597
13598 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13599
13600         * class.cs (MemberBase.CheckParameters): Also check that the type
13601         is unmanaged if it is a pointer.
13602
13603         * expression.cs (SizeOf.Resolve): Add location information.
13604
13605         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13606         a managed type is declared.
13607
13608         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13609         parameter modifiers as well.  Fixes bug 38606
13610
13611         * class.cs: Very sad.  Am backing out the speed up changes
13612         introduced by the ArrayList -> Array in the TypeContainer, as they
13613         were not actually that much faster, and introduced a bug (no error
13614         reports on duplicated methods).
13615
13616         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13617         source first, this will guarantee that we have a valid expression
13618         before calling in lower levels functions that will require a
13619         resolved object.  Then use this original_source in the
13620         target.ResolveLValue instead of the original source that was
13621         passed to us.
13622
13623         Another change.  Use target.Resolve instead of LValueResolve.
13624         Although we are resolving for LValues, we will let the Assign code
13625         take care of that (it will be called again from Resolve).  This
13626         basically allows code like this:
13627
13628         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13629         class Y { void A (X x) { x [0] += o; }
13630
13631         The problem was that the indexer was trying to resolve for
13632         set_Item (idx, object o) and never finding one.  The real set_Item
13633         was set_Item (idx, X).  By delaying the process we get the right
13634         semantics. 
13635
13636         Fixes bug 36505
13637
13638 2003-02-23  Martin Baulig  <martin@ximian.com>
13639
13640         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13641         while calling DoEmit ().
13642
13643         * codegen.cs (EmitContext.Mark): Don't mark locations in other
13644         source files; if you use the #line directive inside a method, the
13645         compiler stops emitting line numbers for the debugger until it
13646         reaches the end of the method or another #line directive which
13647         restores the original file.
13648
13649 2003-02-23  Martin Baulig  <martin@ximian.com>
13650
13651         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13652
13653 2003-02-23  Martin Baulig  <martin@ximian.com>
13654
13655         * statement.cs (Block.AddChildVariableNames): We need to call this
13656         recursively, not just for our immediate children.
13657
13658 2003-02-23  Martin Baulig  <martin@ximian.com>
13659
13660         * class.cs (Event.Define): Always make the field private, like csc does.
13661
13662         * typemanager.cs (TypeManager.RealMemberLookup): Make events
13663         actually work, fixes bug #37521.
13664
13665 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
13666
13667         * delegate.cs: When creating the various temporary "Parameters"
13668         classes, make sure that we call the ComputeAndDefineParameterTypes
13669         on those new parameters (just like we do with the formal ones), to
13670         allow them to be resolved in the context of the DeclSpace.
13671
13672         This fixes the bug that Dick observed in Bugzilla #38530.
13673
13674 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
13675
13676         * expression.cs (ResolveMemberAccess): When resolving a constant,
13677         do not attempt to pull a constant if the value was not able to
13678         generate a valid constant.
13679
13680         * const.cs (LookupConstantValue): Do not report more errors than required.
13681
13682 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13683
13684         * expression.cs: fixes bug #38328.
13685
13686 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13687
13688         * class.cs: Changed all the various members that can be part of a
13689         class from being an ArrayList to be an Array of the right type.
13690         During the DefineType type_list, interface_list, delegate_list and
13691         enum_list are turned into types, interfaces, delegates and enums
13692         arrays.  
13693
13694         And during the member population, indexer_list, event_list,
13695         constant_list, field_list, instance_constructor_list, method_list,
13696         operator_list and property_list are turned into their real arrays.
13697
13698         Although we could probably perform this operation earlier, for
13699         good error reporting we need to keep the lists and remove the
13700         lists for longer than required.
13701
13702         This optimization was triggered by Paolo profiling the compiler
13703         speed on the output of `gen-sample-program.pl' perl script. 
13704
13705         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13706         not crash in methods like MemberLookupFailed that use this field.  
13707
13708         This problem arises when the compiler fails to resolve a type
13709         during interface type definition for example.
13710
13711 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13712
13713         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13714         inherit from System.Object, so we have to stop at null, not only
13715         when reaching System.Object.
13716
13717 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13718
13719         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13720         DeclaredOnly because the parent indexer might have had a different
13721         name, but did not loop until the top of the hierarchy was reached.
13722
13723         The problem this one fixes is 35492: when a class implemented an
13724         indexer from an interface, we were getting the interface method
13725         (which was abstract) and we were flagging an error (can not invoke
13726         abstract method).
13727
13728         This also keeps bug 33089 functioning, and test-148 functioning.
13729
13730         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13731         out if a method is special is to see if it is declared in a
13732         property or event, or whether it is one of the predefined operator
13733         names.   This should fix correctly #36804.
13734
13735 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13736
13737         The goal here is to remove the dependency on EmptyCast.Peel ().
13738         Killing it completely.
13739
13740         The problem is that currently in a number of places where
13741         constants are expected, we have to "probe" for an EmptyCast, and
13742         Peel, which is not the correct thing to do, as this will be
13743         repetitive and will likely lead to errors. 
13744
13745         The idea is to remove any EmptyCasts that are used in casts that
13746         can be reduced to constants, so we only have to cope with
13747         constants. 
13748
13749         This bug hunt was triggered by Bug 37363 and the desire to remove
13750         the duplicate pattern where we were "peeling" emptycasts to check
13751         whether they were constants.  Now constants will always be
13752         constants.
13753
13754         * ecore.cs: Use an enumconstant here instead of wrapping with
13755         EmptyCast.  
13756
13757         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13758         throwing me off.  By handling this we can get rid of a few hacks.
13759
13760         * statement.cs (Switch): Removed Peel() code.
13761
13762 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13763
13764         * class.cs: Location information for error 508
13765
13766         * expression.cs (New.DoResolve): Add a guard against double
13767         resolution of an expression.  
13768
13769         The New DoResolve might be called twice when initializing field
13770         expressions (see EmitFieldInitializers, the call to
13771         GetInitializerExpression will perform a resolve on the expression,
13772         and later the assign will trigger another resolution
13773
13774         This leads to bugs (#37014)
13775
13776         * delegate.cs: The signature for EndInvoke should contain any ref
13777         or out parameters as well.  We were not doing this in the past. 
13778
13779         * class.cs (Field.Define): Do not overwrite the type definition
13780         inside the `volatile' group.  Turns out that volatile enumerations
13781         were changing the type here to perform a validity test, which
13782         broke conversions. 
13783
13784 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13785
13786         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13787         and structs, we do not want to load the instance variable
13788
13789         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13790         enum_type has to be handled like an object reference (implicit
13791         conversions exists from this to object), but the regular IsClass
13792         and IsValueType tests will never return true for this one.
13793
13794         Also we use TypeManager.IsValueType instead of type.IsValueType,
13795         just for consistency with the rest of the code (this is only
13796         needed if we ever use the construct exposed by test-180.cs inside
13797         corlib, which we dont today).
13798
13799 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13800
13801         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13802         just InternalCall.
13803
13804 2003-02-09  Martin Baulig  <martin@ximian.com>
13805
13806         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13807         (Namespace.DefineNamespaces): New static public method; this is
13808         called when we're compiling with debugging to add all namespaces
13809         to the symbol file.
13810
13811         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13812         pass it to the Namespace's .ctor.
13813
13814         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13815         and MethodBase arguments; pass the namespace ID to the symwriter;
13816         pass the MethodBase instead of the token to the symwriter.
13817         (SymbolWriter.DefineNamespace): New method to add a namespace to
13818         the symbol file.
13819
13820 2003-02-09  Martin Baulig  <martin@ximian.com>
13821
13822         * symbolwriter.cs: New file.  This is a wrapper around
13823         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13824         methods here in near future.
13825
13826 2003-02-09  Martin Baulig  <martin@ximian.com>
13827
13828         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13829         ILGenerator.MarkSequencePoint() which are actually used by the
13830         symbol writer.
13831
13832 2003-02-09  Martin Baulig  <martin@ximian.com>
13833
13834         * location.cs (SourceFile): New public sealed class.  This
13835         contains the name and an index which is used in the location's token.
13836         (Location): Reserve an appropriate number of bits in the token for
13837         the source file instead of walking over that list, this gives us a
13838         really huge performance improvement when compiling with debugging.
13839
13840         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13841         `SourceFile' argument instead of a string.
13842         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13843         but don't parse/tokenize here, we need to generate the list of all
13844         source files before we do that.
13845         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13846         the files.
13847
13848         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13849         instead of a string.
13850
13851         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13852         of a string.
13853
13854 2003-02-09  Martin Baulig  <martin@ximian.com>
13855
13856         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13857         filename on `#line default'.
13858
13859 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13860
13861         * statement.cs: don't clear the pinned var when the fixed statement
13862         returns from the method (fixes bug#37752).
13863
13864 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13865
13866         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13867         to IsValueType.
13868
13869 2003-02-07  Martin Baulig  <martin@ximian.com>
13870
13871         * driver.cs: Removed the `--debug-args' command line argument.
13872
13873         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13874         automatically by the AsssemblyBuilder.
13875         (CodeGen.InitializeSymbolWriter): We don't need to call any
13876         initialization function on the symbol writer anymore.  This method
13877         doesn't take any arguments.
13878
13879 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13880
13881         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13882         from referenced assemblies as well.
13883
13884 2003-02-02  Martin Baulig  <martin@ximian.com>
13885
13886         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13887
13888 2003-02-02  Martin Baulig  <martin@ximian.com>
13889
13890         * class.cs (Constructor.Emit): Open the symbol writer before
13891         emitting the constructor initializer.
13892         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13893         single-stepping through constructor initializers.
13894
13895 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13896
13897         * class.cs: Handle error 549: do not allow virtual methods in
13898         sealed classes. 
13899
13900 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13901
13902         * decl.cs: Check access levels when resolving types
13903
13904 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13905
13906         * statement.cs: Add parameters and locals set in catch blocks that might 
13907         return to set vector
13908
13909 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13910
13911         * class.cs (Operator): Set the SpecialName flags for operators.
13912
13913         * expression.cs (Invocation.DoResolve): Only block calls to
13914         accessors and operators on SpecialName methods.
13915
13916         (Cast.TryReduce): Handle conversions from char constants.
13917
13918
13919 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13920
13921         * statement.cs: small memory and time optimization in FlowBranching.
13922
13923 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13924
13925         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13926         problem that the last fix but in the other sid (Set).
13927
13928         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13929         access when there is no indexer in the hierarchy.
13930
13931 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13932
13933         * class.cs: Combine some if statements.
13934
13935 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13936
13937         * driver.cs: fixed bug #37187.
13938
13939 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13940
13941         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13942         any indexer, it's needed to build a list with all the indexers in the
13943         hierarchy (AllGetters), else we have problems. Fixes #35653.
13944
13945 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13946
13947         * class.cs (MethodData.Define): It is wrong for an interface
13948         implementation to be static in both cases: explicit and implicit.
13949         We were only handling this in one case.
13950
13951         Improve the if situation there to not have negations.
13952
13953         * class.cs (Field.Define): Turns out that we do not need to check
13954         the unsafe bit on field definition, only on usage.  Remove the test.
13955
13956 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13957
13958         * driver.cs: use assembly.Location instead of Codebase (the latest
13959         patch made mcs fail when using MS assemblies).
13960
13961 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13962
13963         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13964         get the path to *corlib.dll.
13965
13966 2003-01-21  Nick Drochak <ndrochak@gol.com>
13967
13968         * cs-tokenizer.cs:
13969         * pending.cs:
13970         * typemanager.cs: Remove compiler warnings
13971
13972 2003-01-20  Duncan Mak  <duncan@ximian.com>
13973
13974         * AssemblyInfo.cs: Bump the version number to 0.19.
13975
13976 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13977
13978         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13979
13980 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13981
13982         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13983
13984 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13985
13986         * cs-parser.jay: Small fix: we were not comparing the constructor
13987         name correctly.   Thanks to Zoltan for the initial pointer.
13988
13989 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13990
13991         * cs-tokenizer.cs: Set file name when specified with #line
13992
13993 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13994
13995         * cs-parser.jay: Only perform the constructor checks here if we
13996         are named like the class;  This will help provider a better
13997         error.  The constructor path is taken when a type definition is
13998         not found, but most likely the user forgot to add the type, so
13999         report that rather than the constructor error.
14000
14001 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14002
14003         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14004         allocations.
14005
14006 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14007
14008         * cs-parser.jay: Add cleanup call.
14009
14010 2003-01-13  Duncan Mak  <duncan@ximian.com>
14011
14012         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14013         consistent with other methods.
14014
14015 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14016
14017         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14018
14019 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14020
14021         * attribute.cs: only set GuidAttr to true when we have a
14022         GuidAttribute.
14023
14024 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14025
14026         * ecore.cs:
14027         * expression.cs:
14028         * typemanager.cs: fixes to allow mcs compile corlib with the new
14029         Type.IsSubclassOf fix.
14030
14031 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14032
14033         * expression.cs (LocalVariableReference.DoResolve): Classify a
14034         constant as a value, not as a variable.   Also, set the type for
14035         the variable.
14036
14037         * cs-parser.jay (fixed_statement): take a type instead of a
14038         pointer_type, so we can produce a better error message later.
14039
14040         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14041         as an error.  
14042
14043         (For.DoEmit): Make inifinite loops have a
14044         non-conditional branch back.
14045
14046         (Fixed.DoEmit): First populate the pinned variables, then emit the
14047         statement, then clear the variables.  Before I was emitting the
14048         code once for each fixed piece.
14049
14050
14051 2003-01-08  Martin Baulig  <martin@ximian.com>
14052
14053         * statement.cs (FlowBranching.MergeChild): A break in a
14054         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14055
14056 2003-01-08  Martin Baulig  <martin@ximian.com>
14057
14058         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14059         lives in the same number space than `param_map'.  Fixes #36154.
14060
14061 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14062
14063         * cs-parser.jay (constructor_declaration): Set the
14064         Constructor.ModFlags before probing for it.  This makes the
14065         compiler report 514, 515 and 132 (the code was there, but got
14066         broken). 
14067
14068         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14069         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14070         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14071
14072 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14073
14074         * enum.cs: create the enum static fields using the enum type.
14075
14076 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14077
14078         * class.cs: don't try to create the ParamBuilder for the return
14079         type if it's not needed (and handle it breaking for the ms runtime
14080         anyway).
14081
14082 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14083
14084         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14085
14086 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14087
14088         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14089         the command.   This showed up while compiling the JANET source
14090         code, which used \r as its only newline separator.
14091
14092 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14093
14094         * class.cs (Method.Define): If we are an operator (because it
14095         reuses our code), then set the SpecialName and HideBySig.  #36128
14096
14097 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14098
14099         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14100         exception, report error 120 `object reference required'.
14101
14102         * driver.cs: Add --pause option, used during to measure the size
14103         of the process as it goes with --timestamp.
14104
14105         * expression.cs (Invocation.DoResolve): Do not allow methods with
14106         SpecialName to be invoked.
14107
14108 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14109
14110         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14111         number before adding it.
14112
14113 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14114
14115         * ecore.cs (StandardImplicitConversion): When in an unsafe
14116         context, we allow conversion between void * to any other pointer
14117         type. This fixes bug #35973.
14118
14119 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14120
14121         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14122         is not thrown when extensionless outputs are used 
14123
14124 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14125
14126         * rootcontext.cs: fixed compilation of corlib.
14127
14128 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14129
14130         * attribute.cs (Attributes.Contains): Add new method.
14131
14132         * class.cs (MethodCore.LabelParameters): if the parameter is an
14133         `out' parameter, check that no attribute `[In]' has been passed.
14134
14135         * enum.cs: Handle the `value__' name in an enumeration.
14136
14137 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14138
14139         * decl.cs: Added special case to allow overrides on "protected
14140         internal" methods
14141
14142 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14143
14144         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14145         since it makes much more sense.
14146
14147         (Attributes.ctor): Don't require a Location parameter.
14148
14149         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14150
14151         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14152         since we already have that information per attribute.
14153
14154         * everywhere : make appropriate changes.
14155
14156         * class.cs (LabelParameters): Write the code which actually
14157         applies attributes to the return type. We can't do this on the MS
14158         .NET runtime so we flag a warning in the case an exception is
14159         thrown.
14160
14161 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14162
14163         * const.cs: Handle implicit null conversions here too.
14164
14165 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14166
14167         * class.cs (MethodCore.LabelParameters): Remove the extra
14168         Type [] parameter since it is completely unnecessary. Instead
14169         pass in the method's attributes so that we can extract
14170         the "return" attribute.
14171
14172 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14173
14174         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14175         of ignoring it and letting the compile continue.
14176
14177         * typemanager.cs (ChangeType): use an extra argument to return an
14178         error condition instead of throwing an exception.
14179
14180 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14181
14182         * expression.cs (Unary.TryReduce): mimic the code for the regular
14183         code path.  Perform an implicit cast in the cases where we can
14184         implicitly convert to one of the integral types, and then reduce
14185         based on that constant.   This fixes bug #35483.
14186
14187 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14188
14189         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14190
14191 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14192
14193         * namespace.cs: fixed bug #35489.
14194
14195 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14196
14197         * class.cs: Remove some dead code.
14198
14199         * cs-parser.jay: Estimate the number of methods needed
14200         (RootContext.MethodCount);
14201
14202         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14203         numbers instead of StringBuilders.
14204
14205         * support.cs (PtrHashtable): Add constructor with initial size;
14206         We can now reduce reallocations of the method table.
14207
14208 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14209
14210         * attribute.cs (ApplyAttributes): Keep track of the emitted
14211         attributes on a per-target basis. This fixes bug #35413.
14212
14213 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14214
14215         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14216         default to the Windows 1252 encoding.
14217
14218         (UnixParseOption): Support version, thanks to Alp for the missing
14219         pointer. 
14220
14221         * AssemblyInfo.cs: Add nice assembly information.
14222
14223         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14224         (bug 35169).
14225
14226         * cs-parser.jay: Allow a trailing comma before the close bracked
14227         in the attribute_section production.
14228
14229         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14230         address of the instance was being taken, I will take this out,
14231         because we take the address of the object immediately here.
14232
14233 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14234
14235         * typemanager.cs (AreMultipleAllowed): Take care of the most
14236         obvious case where attribute type is not in the current assembly -
14237         stupid me ;-)
14238
14239 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14240
14241         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14242         definitions, instead of doing that afterwards.  
14243
14244         Also we use a nice little hack, depending on the constructor, we
14245         know if we are a "composed" name or a simple name.  Hence, we
14246         avoid the IndexOf test, and we avoid 
14247
14248         * codegen.cs: Add code to assist in a bug reporter to track down
14249         the source of a compiler crash. 
14250
14251 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14252
14253         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14254         types have been emitted for a given element and flag an error
14255         if something which does not have AllowMultiple set is used more
14256         than once.
14257
14258         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14259         attribute types and their corresponding AllowMultiple properties
14260
14261         (AreMultipleAllowed): Check the property for a given type.
14262
14263         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14264         property in the case we have a TypeContainer.
14265
14266         (Attributes.AddAttribute): Detect duplicates and just skip on
14267         adding them. This trivial fix catches a pretty gross error in our
14268         attribute emission - global attributes were being emitted twice!
14269
14270         Bugzilla bug #33187 is now fixed.
14271
14272 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14273
14274         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14275         instead of pp_and).
14276
14277         * expression.cs (Binary.ResolveOperator): I can only use the
14278         Concat (string, string, string) and Concat (string, string,
14279         string, string) if the child is actually a concatenation of
14280         strings. 
14281
14282 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14283
14284         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14285         context where we need a 2-character lookahead.
14286
14287         * pending.cs (PendingImplementation): Rework so we can keep track
14288         of interface types all the time, and flag those which were
14289         implemented by parents as optional.
14290
14291 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14292
14293         * expression.cs (Binary.ResolveOperator): Use
14294         String.Concat(string,string,string) or
14295         String.Concat(string,string,string,string) when possible. 
14296
14297         * typemanager: More helper methods.
14298
14299
14300 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14301
14302         * pending.cs: remove the bogus return from GetMissingInterfaces()
14303         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14304
14305 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14306
14307         * namespace.cs: avoid duplicated 'using xxx' being added to
14308         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14309         when we get more than one 'using' statement for the same namespace.
14310         Report a CS0105 warning for it.
14311
14312 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14313
14314         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14315         of calling getChar/putback, uses internal knowledge of it.    
14316
14317         (xtoken): Reorder tokenizer so most common patterns are checked
14318         first.  This reduces the compilation time in another 5% (from 8.11s
14319         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14320
14321         The parsing time is 22% of the compilation in mcs, and from that
14322         64% is spent on the tokenization process.  
14323
14324         I tried using a binary search for keywords, but this is slower
14325         than the hashtable.  Another option would be to do a couple of
14326         things:
14327
14328                 * Not use a StringBuilder, instead use an array of chars,
14329                   with a set value.  Notice that this way we could catch
14330                   the 645 error without having to do it *afterwards*.
14331
14332                 * We could write a hand-parser to avoid the hashtable
14333                   compares altogether.
14334
14335         The identifier consumption process takes 37% of the tokenization
14336         time.  Another 15% is spent on is_number.  56% of the time spent
14337         on is_number is spent on Int64.Parse:
14338
14339                 * We could probably choose based on the string length to
14340                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14341                   computations. 
14342
14343         Another 3% is spend on wrapping `xtoken' in the `token' function.
14344
14345         Handle 0xa0 as whitespace (#34752)
14346
14347 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14348
14349         * typemanager.cs (IsCLRType): New routine to tell whether a type
14350         is one of the builtin types.  
14351
14352         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14353         typecode in more places instead of doing pointer comparissions.
14354         We could leverage some knowledge about the way the typecodes are
14355         laid out.
14356
14357         New code to cache namespaces in assemblies, it is currently not
14358         invoked, to be used soon.
14359
14360         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14361
14362         * expression.cs (Binary.ResolveOperator): specially handle
14363         strings, and do not perform user-defined operator overloading for
14364         built-in types.
14365
14366 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14367
14368         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14369         internalcall as it is a pretty simple operation;  Avoid whenever
14370         possible to call Char.IsLetter.
14371
14372         (consume_identifier): Cut by half the number of
14373         hashtable calls by merging the is_keyword and GetKeyword behavior.
14374
14375         Do not short-circuit, because if we do, we
14376         report errors (ie, #if false && true would produce an invalid
14377         directive error);
14378
14379
14380 2002-11-24  Martin Baulig  <martin@ximian.com>
14381
14382         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14383         check constant ranges and report a CS0221.  Fixes #33186.
14384
14385 2002-11-24  Martin Baulig  <martin@ximian.com>
14386
14387         * cs-parser.jay: Make this work for uninitialized variable
14388         declarations in the `for' initializer.  Fixes #32416.
14389
14390 2002-11-24  Martin Baulig  <martin@ximian.com>
14391
14392         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14393         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14394
14395 2002-11-24  Martin Baulig  <martin@ximian.com>
14396
14397         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14398         argument; if true, we also check for user-defined conversions.
14399         This is only needed if both arguments are of a user-defined type.
14400         Fixes #30443, added test-175.cs.
14401         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14402
14403         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14404
14405 2002-11-24  Martin Baulig  <martin@ximian.com>
14406
14407         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14408         function to get the store opcode.
14409         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14410         only emit the Ldelema if the store opcode is Stobj.  You must run
14411         both test-34 and test-167 to test this.  Fixes #34529.
14412
14413 2002-11-23  Martin Baulig  <martin@ximian.com>
14414
14415         * ecore.cs (Expression.MemberLookup): Added additional
14416         `qualifier_type' argument which is used when we're being called
14417         from MemberAccess.DoResolve() and null if we're called from a
14418         SimpleName lookup.
14419         (Expression.MemberLookupFailed): New method to report errors; this
14420         does the CS1540 check and reports the correct error message.
14421
14422         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14423         argument for the CS1540 check and redone the way how we're dealing
14424         with private members.  See the comment in the source code for details.
14425         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14426         `closure_start_type' to `closure_qualifier_type' and check whether
14427         it's not null.  It was not this filter being broken, it was just
14428         being called with the wrong arguments.
14429
14430         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14431         and pass it the correct `qualifier_type'; this also does the error
14432         handling for us.
14433
14434 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14435
14436         * expression.cs (Invocation.EmitParams): If the we are dealing
14437         with a non-built-in value type, load its address as well.
14438
14439         (ArrayCreation): Use a a pretty constant instead
14440         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14441         static initializers.  
14442
14443         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14444         because they are not really value types, just glorified integers. 
14445
14446         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14447
14448         * ecore.cs: Remove redundant code for enumerations, make them use
14449         the same code path as everything else, fixes the casting issue
14450         with enumerations in Windows.Forms.
14451
14452         * attribute.cs: Do only cast to string if it is a string, the
14453         validation happens later.
14454
14455         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14456         people upgrade their corlibs.
14457
14458         * ecore.cs: Oops, enumerations were not following the entire code path
14459
14460 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14461
14462         * typemanager.cs (FilterWithClosure): Commented out the test for
14463         1540 in typemanager.cs, as it has problems when accessing
14464         protected methods from a parent class (see test-174.cs). 
14465
14466         * attribute.cs (Attribute.ValidateGuid): new method.
14467         (Attribute.Resolve): Use above.
14468
14469 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14470
14471         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14472
14473         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14474         handling for enumerations, as we only needed the TypeContainer
14475         functionality to begin with (this is required for the fix below to
14476         work for enums that reference constants in a container class for
14477         example). 
14478
14479         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14480
14481         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14482         a valid TypeBuilder to perform lookups on.o
14483
14484         * class.cs (InheritableMemberSignatureCompare): Use true in the
14485         call to GetGetMethod and GetSetMethod, because we are comparing
14486         the signature, and we need to get the methods *even* if they are
14487         private. 
14488
14489         (PropertyBase.CheckBase): ditto.
14490
14491         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14492         GotoCase.Resolve): Use Peel on EmpytCasts.
14493
14494         * ecore.cs (EmptyCast): drop child, add Peel method.
14495
14496 2002-11-17  Martin Baulig  <martin@ximian.com>
14497
14498         * ecore.cs (EmptyCast.Child): New public property.
14499
14500         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14501         label resolved to an EmptyCast.  Fixes #34162.
14502         (GotoCase.Resolve): Likewise.
14503         (Block.EmitMeta): Likewise.
14504
14505 2002-11-17  Martin Baulig  <martin@ximian.com>
14506
14507         * expression.cs (Invocation.BetterConversion): Prefer int over
14508         uint; short over ushort; long over ulong for integer literals.
14509         Use ImplicitConversionExists instead of StandardConversionExists
14510         since we also need to check for user-defined implicit conversions.
14511         Fixes #34165.  Added test-173.cs.
14512
14513 2002-11-16  Martin Baulig  <martin@ximian.com>
14514
14515         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14516         with the `true' and `false' literals.  Fixes #33151.
14517
14518 2002-11-16  Martin Baulig  <martin@ximian.com>
14519
14520         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14521         October 22nd; don't do the cs1540 check for static members.
14522
14523         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14524         now using our own filter here and doing the cs1540 check again.
14525
14526 2002-11-16  Martin Baulig  <martin@ximian.com>
14527
14528         * support.cs (InternalParameters): Don't crash if we don't have
14529         any fixed parameters.  Fixes #33532.
14530
14531 2002-11-16  Martin Baulig  <martin@ximian.com>
14532
14533         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14534         when looking up static methods to make this work on Windows.
14535         Fixes #33773.
14536
14537 2002-11-16  Martin Baulig  <martin@ximian.com>
14538
14539         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14540         a setter rather than using PropertyInfo.CanWrite.
14541
14542 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14543
14544         * class.cs: Allow acces to block member by subclasses. Fixes build
14545         breaker.
14546
14547 2002-11-14  Martin Baulig  <martin@ximian.com>
14548
14549         * class.cs (Constructor.Emit): Added the extern/block check.
14550         Fixes bug #33678.
14551
14552 2002-11-14  Martin Baulig  <martin@ximian.com>
14553
14554         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14555         iteration while looking for indexers, this is needed because the
14556         indexer may have a different name in our base classes.  Fixed the
14557         error reporting (no indexers at all, not get accessor, no
14558         overloaded match).  Fixes bug #33089.
14559         (IndexerAccess.DoResolveLValue): Likewise.
14560
14561 2002-11-14  Martin Baulig  <martin@ximian.com>
14562
14563         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14564         indexers.  Fixes the first part of bug #33089.
14565         (MethodSignature.InheritableMemberSignatureCompare): Added support
14566         for properties.
14567
14568 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14569
14570         * attribute.cs (Attribute.Resolve): Catch the
14571         NullReferenceException and report it since it isn't supposed to
14572         happen. 
14573
14574 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14575
14576         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14577         LogicalOr and LogicalAnd that can benefit from recursively
14578         handling EmitBranchable.  The code now should be nice for Paolo.
14579
14580 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14581
14582         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14583         the Type lookups, as we perform quite a number of lookups on
14584         non-Types.  This can be removed once we can deterministically tell
14585         whether we have a type or a namespace in advance.
14586
14587         But this might require special hacks from our corlib.
14588
14589         * TODO: updated.
14590
14591         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14592         and double which avoids a conversion from an integer to a double.
14593
14594         * expression.cs: tiny optimization, avoid calling IsConstant,
14595         because it effectively performs the lookup twice.
14596
14597 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14598
14599         But a bogus return here to keep the semantics of the old code
14600         until the Mono runtime is fixed.
14601
14602         * pending.cs (GetMissingInterfaces): New method used to remove all
14603         the interfaces that are already implemented by our parent
14604         classes from the list of pending methods. 
14605
14606         * interface.cs: Add checks for calls after ResolveTypeExpr.
14607
14608 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14609
14610         * class.cs (Class.Emit): Report warning 67: event not used if the
14611         warning level is beyond 3.
14612
14613         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14614         being a NullLiteral.
14615
14616         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14617         specifiers. 
14618
14619         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14620         path that might fail if a type can not be resolved.
14621
14622         * expression.cs (Binary.Emit): Emit unsigned versions of the
14623         operators. 
14624
14625         * driver.cs: use error 5.
14626
14627 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14628
14629         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14630
14631 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14632
14633         * cs-parser.jay (switch_section): A beautiful patch from Martin
14634         Baulig that fixed 33094.
14635
14636 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14637
14638         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14639         Check whether the base is abstract and report an error if so.
14640
14641         * expression.cs (IndexerAccess.DoResolveLValue,
14642         IndexerAccess.DoResolve): ditto. 
14643
14644         (Invocation.DoResolve): ditto.
14645
14646         (Invocation.FullMethodDesc): Improve the report string.
14647
14648         * statement.cs (Block): Eliminate IsVariableDefined as it is
14649         basically just a wrapper for GetVariableInfo.
14650
14651         * ecore.cs (SimpleName): Use new 
14652
14653         * support.cs (ReflectionParamter.ParameterType): We unwrap the
14654         type, as we return the actual parameter ref/unref state on a
14655         different call.
14656
14657 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
14658
14659         * support.cs: Return proper flags REF/OUT fixing the previous
14660         commit.  
14661
14662         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
14663         not used to mean `ref' but `ref or out' in ParameterReference
14664
14665         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14666         full type signature instead of calling TypeManger.CSharpName
14667         ourselves. 
14668
14669         * support.cs (InternalParameters.ParameterDesc): Do not compare
14670         directly to the modflags, because REF/OUT will actually be bitsets
14671         if set. 
14672
14673         * delegate.cs (VerifyMethod): Check also the modifiers.
14674
14675         * cs-tokenizer.cs: Fix bug where floating point values with an
14676         exponent where a sign was missing was ignored.
14677
14678         * driver.cs: Allow multiple assemblies to be specified in a single
14679         /r: argument
14680
14681 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
14682
14683         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
14684         because identifiers after a parenthesis would end up in this kind
14685         of production, and we needed to desamiguate it for having casts
14686         like:
14687
14688                 (UserDefinedType *) xxx
14689
14690 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14691
14692         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14693         we should set on the Bindingflags.NonPublic, but not turn on
14694         private_ok.  private_ok controls whether a Private member is
14695         returned (this is chekced on the filter routine), while the
14696         BindingFlags.NonPublic just controls whether private/protected
14697         will be allowed.   This fixes the problem part of the problem of
14698         private properties being allowed to be used in derived classes.
14699
14700         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14701         so we can call the children DoResolveLValue method (this will
14702         properly signal errors on lvalue assignments to base properties)
14703
14704         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14705         getter are null, and we have a property info, we know that this
14706         happened because the lookup failed, so we report an error 122 for
14707         protection level violation.
14708
14709         We also silently return if setter and getter are null in the
14710         resolve functions, this condition only happens if we have flagged
14711         the error before.  This is the other half of the problem. 
14712
14713         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14714         not have accessibility information, that is why we were returning
14715         true in the filter function in typemanager.cs.
14716
14717         To properly report 122 (property is inaccessible because of its
14718         protection level) correctly, we report this error in ResolveAccess
14719         by failing if both the setter and the getter are lacking (ie, the
14720         lookup failed). 
14721
14722         DoResolve and DoLResolve have been modified to check for both
14723         setter/getter being null and returning silently, the reason being
14724         that I did not want to put the knowledge about this error in upper
14725         layers, like:
14726
14727         int old = Report.Errors;
14728         x = new PropertyExpr (...);
14729         if (old != Report.Errors)
14730                 return null;
14731         else
14732                 return x;
14733
14734         So the property expr is returned, but it is invalid, so the error
14735         will be flagged during the resolve process. 
14736
14737         * class.cs: Remove InheritablePropertySignatureCompare from the
14738         class, as we no longer depend on the property signature to compute
14739         whether it is possible to implement a method or not.
14740
14741         The reason is that calling PropertyInfo.GetGetMethod will return
14742         null (in .NET, in Mono it works, and we should change this), in
14743         cases where the Get Method does not exist in that particular
14744         class.
14745
14746         So this code:
14747
14748         class X { public virtual int A { get { return 1; } } }
14749         class Y : X { }
14750         class Z : Y { public override int A { get { return 2; } } }
14751
14752         Would fail in Z because the parent (Y) would not have the property
14753         defined.  So we avoid this completely now (because the alternative
14754         fix was ugly and slow), and we now depend exclusively on the
14755         method names.
14756
14757         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14758         reference method, instead of using the property.
14759
14760         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14761         routines are gone now.
14762
14763         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14764         names, they were incorrectly named.
14765
14766         * cs-tokenizer.cs: Return are more gentle token on failure. 
14767
14768         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14769         had an out-of-sync index variable, which caused it to remove from
14770         the list of pending methods the wrong method sometimes.
14771
14772 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14773
14774         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14775         CanWrite, because those refer to this particular instance of the
14776         property, and do not take into account the fact that we can
14777         override single members of a property.
14778
14779         Constructor requires an EmitContext.  The resolution process does
14780         not happen here, but we need to compute the accessors before,
14781         because the resolution does not always happen for properties.
14782
14783         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14784         subclass, before we did not update this flag, but we did update
14785         bindingflags. 
14786
14787         (GetAccessors): Drop this routine, as it did not work in the
14788         presence of partially overwritten set/get methods. 
14789
14790         Notice that this broke the cs1540 detection, but that will require
14791         more thinking. 
14792
14793 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14794
14795         * class.cs:
14796         * codegen.cs:
14797         * driver.cs: issue a warning instead of an error if we don't support
14798         debugging for the platform. Also ignore a couple of errors that may
14799         arise when trying to write the symbols. Undo my previous patch.
14800
14801 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14802
14803         * driver.cs: ignore /debug switch except for Unix platforms.
14804
14805 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14806
14807         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14808
14809 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14810
14811         * driver.cs: Do not make mcs-debug conditional, so we do not break
14812         builds that use it.
14813
14814         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14815         review this patch.  But basically after all the children variables
14816         have been merged, the value of "Breaks" was not being set to
14817         new_breaks for Switch blocks.  I think that it should be set after
14818         it has executed.  Currently I set this to the value of new_breaks,
14819         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14820         conservative, but I do not understand this code very well.
14821
14822         I did not break anything in the build, so that is good ;-)
14823
14824         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14825
14826 2002-10-20  Mark Crichton  <crichton@gimp.org>
14827
14828         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14829
14830 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14831
14832         * cfold.cs: Fixed compile blocker.
14833
14834 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14835
14836         * driver.cs: I was chekcing the key, not the file.
14837
14838 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14839
14840         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14841         message that we were generating - we just need to silently return
14842         a null.
14843
14844 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14845
14846         * class.cs (Event.Define): Change my previous commit, as this
14847         breaks the debugger.  This is a temporary hack, as it seems like
14848         the compiler is generating events incorrectly to begin with.
14849
14850         * expression.cs (Binary.ResolveOperator): Added support for 
14851         "U operator - (E x, E y)"
14852
14853         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14854         y)".
14855
14856         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14857         init-only variables, but this path did not take into account that
14858         there might be also instance readonly variables.  Correct this
14859         problem. 
14860
14861         This fixes bug 32253
14862
14863         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14864         delegates as well.
14865
14866         * driver.cs: Change the extension for modules to `netmodule'
14867
14868         * cs-parser.jay: Improved slightly the location tracking for
14869         the debugger symbols.
14870
14871         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14872         modifiers that were specified instead of the hardcoded value
14873         (FamAndAssem).  This was basically ignoring the static modifier,
14874         and others.  Fixes 32429.
14875
14876         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14877         fixed a bug in the process (32476)
14878
14879         * expression.cs (ArrayAccess.EmitAssign): Patch from
14880         hwang_rob@yahoo.ca that fixes bug 31834.3
14881
14882 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14883
14884         * driver.cs: Make the module extension .netmodule.
14885
14886 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14887
14888         * driver.cs: Report an error if the resource file is not found
14889         instead of crashing.
14890
14891         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14892         false, like Emit does.
14893
14894 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14895
14896         * typemanager.cs: Remove unused private member.  Also reported mcs
14897         bug to report this as a warning like csc.
14898
14899 2002-10-15  Martin Baulig  <martin@gnome.org>
14900
14901         * statement.cs (Statement.Emit): Made this a virtual method; emits
14902         the line number info and calls DoEmit().
14903         (Statement.DoEmit): New protected abstract method, formerly knows
14904         as Statement.Emit().
14905
14906         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14907
14908 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14909
14910         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14911         have fixed a remaining problem: not every AddXXXX was adding a
14912         fully qualified name.  
14913
14914         Now everyone registers a fully qualified name in the DeclSpace as
14915         being defined instead of the partial name.  
14916
14917         Downsides: we are slower than we need to be due to the excess
14918         copies and the names being registered this way.  
14919
14920         The reason for this is that we currently depend (on the corlib
14921         bootstrap for instance) that types are fully qualified, because
14922         we dump all the types in the namespace, and we should really have
14923         types inserted into the proper namespace, so we can only store the
14924         basenames in the defined_names array.
14925
14926 2002-10-10  Martin Baulig  <martin@gnome.org>
14927
14928         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14929         from bug #31834, see the bug report for a testcase which is
14930         miscompiled.
14931
14932 2002-10-10  Martin Baulig  <martin@gnome.org>
14933
14934         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14935         flow analysis code for this.
14936
14937         * statement.cs (Do, While, For): Tell the flow analysis code about
14938         infinite loops.
14939         (FlowBranching.UsageVector): Added support for infinite loops.
14940         (Block.Resolve): Moved the dead code elimination here and use flow
14941         analysis to do it.
14942
14943 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14944
14945         * class.cs (Field.Define): Catch cycles on struct type
14946         definitions. 
14947
14948         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14949         fields if the fields are static.  We only need to check instance
14950         fields. 
14951
14952         * expression.cs (As.DoResolve): Test for reference type.
14953
14954         * statement.cs (Using.ResolveExpression): Use
14955         ConvertImplicitRequired, not ConvertImplicit which reports an
14956         error on failture
14957         (Using.ResolveLocalVariableDecls): ditto.
14958
14959         * expression.cs (Binary.ResolveOperator): Report errors in a few
14960         places where we had to.
14961
14962         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14963
14964 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14965
14966         * expression.cs: Use StoreFromPtr instead of extracting the type
14967         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14968
14969         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14970         an enumeration value to a System.Enum, but System.Enum is not a
14971         value type, but an class type, so we need to box.
14972
14973         (Expression.ConvertExplicit): One codepath could return
14974         errors but not flag them.  Fix this.  Fixes #31853
14975
14976         * parameter.cs (Resolve): Do not allow void as a parameter type.
14977
14978 2002-10-06  Martin Baulig  <martin@gnome.org>
14979
14980         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14981         if it's a class type and not a struct.  Fixes #31815.
14982
14983 2002-10-06  Martin Baulig  <martin@gnome.org>
14984
14985         * statement.cs: Reworked the flow analysis code a bit to make it
14986         usable for dead code elimination.
14987
14988 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14989
14990         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14991
14992 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14993
14994         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14995         to fix the test 165, will investigate deeper.
14996
14997 2002-10-04  Martin Baulig  <martin@gnome.org>
14998
14999         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15000         finally blocks actually work.
15001         (Try.Resolve): We don't need to create a sibling for `finally' if
15002         there is no finally block.
15003
15004 2002-10-04  Martin Baulig  <martin@gnome.org>
15005
15006         * class.cs (Constructor.Define): The default accessibility for a
15007         non-default constructor is private, not public.
15008
15009 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15010
15011         * class.cs (Constructor): Make AllowedModifiers public, add
15012         EXTERN.
15013
15014         * cs-parser.jay: Perform the modifiers test here, as the
15015         constructor for the Constructor class usually receives a zero
15016         because of the way we create it (first we create, later we
15017         customize, and we were never checking the modifiers).
15018
15019         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15020         is a version of LookupTypeReflection that includes the type-name
15021         cache.  This can be used as a fast path for functions that know
15022         the fully qualified name and are only calling into *.GetType() to
15023         obtain a composed type.
15024
15025         This is also used by TypeManager.LookupType during its type
15026         composition.
15027
15028         (LookupType): We now also track the real type name, as sometimes
15029         we can get a quey for the real type name from things like
15030         ComposedCast.  This fixes bug 31422.
15031
15032         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15033         complete type fullname, it does not have to go through the type
15034         resolution system to obtain the composed version of the type (for
15035         obtaining arrays or pointers).
15036
15037         (Conditional.Emit): Use the EmitBoolExpression to
15038         generate nicer code, as requested by Paolo.
15039
15040         (ArrayCreation.CheckIndices): Use the patch from
15041         hwang_rob@yahoo.ca to validate the array initializers. 
15042
15043 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15044
15045         * class.cs (ConstructorInitializer.Emit): simplify code by using
15046         Invocation.EmitCall, and at the same time, fix the bugs in calling
15047         parent constructors that took variable arguments. 
15048
15049         * ecore.cs (Expression.ConvertNumericExplicit,
15050         Expression.ImplicitNumericConversion): Remove the code that
15051         manually wrapped decimal (InternalTypeConstructor call is now gone
15052         as well).
15053
15054         * expression.cs (Cast.TryReduce): Also handle decimal types when
15055         trying to perform a constant fold on the type.
15056
15057         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15058
15059         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15060         that only turned off an error report, and did nothing else. 
15061
15062 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15063
15064         * driver.cs: Handle and ignore /fullpaths
15065
15066 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15067
15068         * expression.cs (Binary.ResolveOperator): Catch the case where
15069         DoNumericPromotions returns true, 
15070
15071         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15072
15073 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15074
15075         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15076         report error 70.
15077
15078 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15079
15080         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15081         conversion exists, but it is also required that the conversion be
15082         performed.  This manifested in "(Type64Enum) 2".  
15083
15084         * class.cs (TypeManager.AddMethod): The fix is not to change
15085         AddEnum, because that one was using a fully qualified name (every
15086         DeclSpace derivative does), but to change the AddMethod routine
15087         that was using an un-namespaced name.  This now correctly reports
15088         the duplicated name.
15089
15090         Revert patch until I can properly fix it.  The issue
15091         is that we have a shared Type space across all namespaces
15092         currently, which is wrong.
15093
15094         Options include making the Namespace a DeclSpace, and merge
15095         current_namespace/current_container in the parser.
15096
15097 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15098
15099         * cs-parser.jay: Improve error reporting when we get a different
15100         kind of expression in local_variable_type and
15101         local_variable_pointer_type. 
15102
15103         Propagate this to avoid missleading errors being reported.
15104
15105         * ecore.cs (ImplicitReferenceConversion): treat
15106         TypeManager.value_type as a target just like object_type.   As
15107         code like this:
15108
15109         ValueType v = 1;
15110
15111         Is valid, and needs to result in the int 1 being boxed before it
15112         is assigned to the value type v.
15113
15114         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15115         to validate the enumeration name.
15116
15117         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15118         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15119         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15120
15121         * ecore.cs (TryImplicitIntConversion): When doing an
15122         implicit-enumeration-conversion, check if the type is 64-bits and
15123         perform a conversion before passing to EnumConstant.
15124
15125 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15126
15127         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15128         report ambiguous type references.  Unlike the MS version, we
15129         report what the ambiguity is.   Innovation at work ;-)
15130
15131         (DeclSpace.FindType): Require a location argument to
15132         display when we display an ambiguous error.
15133
15134         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15135
15136         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15137
15138         * expression.cs (EmitDynamicInitializers): Apply patch from
15139         hwang_rob@yahoo.ca that fixes the order in which we emit our
15140         initializers. 
15141
15142 2002-09-21  Martin Baulig  <martin@gnome.org>
15143
15144         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15145         delegate takes no arguments.
15146
15147 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15148
15149         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15150         from integers.
15151
15152         * expression.cs: Extract the underlying type.
15153
15154         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15155
15156         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15157
15158 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15159
15160         * class.cs (TypeContainer.DefineType): We can not use the nice
15161         PackingSize with the size set to 1 DefineType method, because it
15162         will not allow us to define the interfaces that the struct
15163         implements.
15164
15165         This completes the fixing of bug 27287
15166
15167         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15168         means also structs.  This fixes part of the problem. 
15169         (Expresion.ImplicitReferenceConversionExists): ditto.
15170
15171         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15172         error if there were no errors reported during the type lookup
15173         process, to avoid duplicates or redundant errors.  Without this
15174         you would get an ambiguous errors plus a type not found.  We have
15175         beaten the user enough with the first error.  
15176
15177         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15178         reference. 
15179
15180         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15181         during the resolution process, stop the lookup, this avoids
15182         repeated error reports (same error twice).
15183
15184         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15185
15186         * typemanager.cs (LookupType): Redo the type lookup code to match
15187         the needs of System.Reflection.  
15188
15189         The issue is that System.Reflection requires references to nested
15190         types to begin with a "+" sign instead of a dot.  So toplevel
15191         types look like: "NameSpace.TopLevelClass", and nested ones look
15192         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15193         levels. 
15194
15195 2002-09-19  Martin Baulig  <martin@gnome.org>
15196
15197         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15198         says that a method always returns or always throws an exception,
15199         don't report the CS0161.
15200
15201         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15202         set `Returns = new_returns'.
15203
15204 2002-09-19  Martin Baulig  <martin@gnome.org>
15205
15206         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15207         to an enum constant, check for a CS0176.
15208
15209 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15210
15211         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15212         for operators that must be in pairs and report errors.
15213
15214         * ecore.cs (SimpleName.DoResolveType): During the initial type
15215         resolution process, when we define types recursively, we must
15216         check first for types in our current scope before we perform
15217         lookups in the enclosing scopes.
15218
15219         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15220
15221         (Invocation.VerifyArgumentsCompat): Call
15222         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15223         I thought we were supposed to always call this, but there are a
15224         few places in the code where we dont do it.
15225
15226 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15227
15228         * driver.cs: Add support in -linkres and -resource to specify the
15229         name of the identifier.
15230
15231 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15232
15233         * ecore.cs (StandardConversionExists): Sync with the conversion
15234         code: allow anything-* to void* conversions.
15235
15236         (FindMostSpecificSource): Use an Expression argument
15237         instead of a Type, because we might be handed over a Literal which
15238         gets a few more implicit conversions that plain types do not.  So
15239         this information was being lost.
15240
15241         Also, we drop the temporary type-holder expression when not
15242         required.
15243
15244 2002-09-17  Martin Baulig  <martin@gnome.org>
15245
15246         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15247         this is an explicit interface implementation.
15248
15249 2002-09-17  Martin Baulig  <martin@gnome.org>
15250
15251         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15252         different `IndexerName' attributes.
15253
15254         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15255         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15256         virtual CommonResolve().
15257
15258 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15259
15260         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15261         and convert that to the UnderlyingType.
15262
15263         * statement.cs (Foreach.Resolve): Indexers are just like variables
15264         or PropertyAccesses.
15265
15266         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15267         inside quoted strings, we were not doing this before.
15268
15269 2002-09-16  Martin Baulig  <martin@gnome.org>
15270
15271         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15272         resolve it.  This is needed for the definite assignment check of the
15273         instance expression, fixes bug #29846.
15274         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15275
15276 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15277
15278         * parameter.cs: Fix compile error.  Cannot reference static member
15279         from an instance object.  Is this an mcs bug?
15280
15281 2002-09-14  Martin Baulig  <martin@gnome.org>
15282
15283         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15284         multiple times.  Fixes bug #30295, added test-166.cs.
15285
15286 2002-09-14  Martin Baulig  <martin@gnome.org>
15287
15288         * statement.cs (Block.Emit): Don't emit unreachable code.
15289         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15290         `break' statements.
15291         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15292
15293 2002-09-14  Martin Baulig  <martin@gnome.org>
15294
15295         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15296         is set.
15297
15298 2002-09-14  Martin Baulig  <martin@gnome.org>
15299
15300         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15301         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15302         be false on the ms runtime.
15303
15304 2002-09-13  Martin Baulig  <martin@gnome.org>
15305
15306         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15307         the CS0038 error message.
15308
15309 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15310
15311         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15312         constant inside, return it.
15313
15314 2002-09-12  Martin Baulig  <martin@gnome.org>
15315
15316         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15317         implicit conversion can be done between enum types.
15318
15319         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15320         check whether an implicit conversion to the current enum's UnderlyingType
15321         exists and report an error if not.
15322
15323         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15324         without debugging support.
15325
15326         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15327         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15328
15329 2002-09-12  Martin Baulig  <martin@gnome.org>
15330
15331         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15332
15333         * ecore.cs (IMemberExpr.DeclaringType): New property.
15334         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15335         nonstatic member of an outer type (CS0038).
15336
15337 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15338
15339         * driver.cs: Activate the using-error detector at warning level
15340         4 (at least for MS-compatible APIs).
15341
15342         * namespace.cs (VerifyUsing): Small buglett fix.
15343
15344         * pending.cs (PendingImplementation): pass the container pointer. 
15345
15346         * interface.cs (GetMethods): Allow for recursive definition.  Long
15347         term, I would like to move every type to support recursive
15348         definitions, not the current ordering mechanism that we have right
15349         now.
15350
15351         The situation is this: Attributes are handled before interfaces,
15352         so we can apply attributes to interfaces.  But some attributes
15353         implement interfaces, we will now handle the simple cases
15354         (recursive definitions will just get an error).  
15355
15356         * parameter.cs: Only invalidate types at the end if we fail to
15357         lookup all types.  
15358
15359 2002-09-09  Martin Baulig  <martin@gnome.org>
15360
15361         * ecore.cs (PropertyExpr.Emit): Also check for
15362         TypeManager.system_int_array_get_length so this'll also work when
15363         compiling corlib.  Fixes #30003.
15364
15365 2002-09-09  Martin Baulig  <martin@gnome.org>
15366
15367         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15368         and throw an exception if we can't get the type's size.  Fixed #30040,
15369         added test-165.cs.
15370
15371 2002-09-09  Martin Baulig  <martin@gnome.org>
15372
15373         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15374
15375         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15376         context.  Fixes bug #30027.
15377
15378         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15379         virtual functions.  Fixes bug #30043, added test-164.cs.
15380
15381 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15382
15383         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15384
15385 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15386
15387         * driver.cs: Use an object to get the windows codepage since it's not a
15388         static property.
15389
15390 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15391
15392         * statement.cs (For.Emit): for infinite loops (test == null)
15393         return whether there is a break inside, not always "true".
15394
15395         * namespace.cs (UsingEntry): New struct to hold the name of the
15396         using definition, the location where it is defined, and whether it
15397         has been used in a successful type lookup.
15398
15399         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15400         strings.
15401
15402         * decl.cs: ditto.
15403
15404 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15405
15406         * attribute.cs : Fix incorrect code which relied on catching
15407         a NullReferenceException to detect a null being passed in
15408         where an object was expected.
15409
15410 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15411
15412         * statement.cs (Try): flag the catch variable as assigned
15413
15414         * expression.cs (Cast): Simplified by using ResolveType instead of
15415         manually resolving.
15416
15417         * statement.cs (Catch): Fix bug by using ResolveType.
15418
15419 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15420
15421         * expression.cs (BetterConversion): Special case for when we have
15422         a NullLiteral as the argument and we have to choose between string
15423         and object types - we choose string the way csc does.
15424
15425         * attribute.cs (Attribute.Resolve): Catch the
15426         NullReferenceException and report error #182 since the Mono
15427         runtime no more has the bug and having this exception raised means
15428         we tried to select a constructor which takes an object and is
15429         passed a null.
15430
15431 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15432
15433         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15434         message (1502, 1503) when we can't locate a method after overload
15435         resolution. This is much more informative and closes the bug
15436         Miguel reported.
15437
15438         * interface.cs (PopulateMethod): Return if there are no argument
15439         types. Fixes a NullReferenceException bug.
15440
15441         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15442         expressions too. Previously we were checking only in one place for
15443         positional arguments leaving out named arguments.
15444
15445         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15446         type to the enum type is not allowed. Remove code corresponding to
15447         that.
15448
15449         (ConvertNumericExplicit): Allow explicit conversions from
15450         the underlying type to enum type. This precisely follows the spec
15451         and closes a bug filed by Gonzalo.
15452
15453 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15454
15455         * compiler.csproj:
15456         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15457
15458 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15459
15460         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15461         it was important that we stored the right value after the
15462         reduction in `converted'.
15463
15464 2002-09-04  Martin Baulig  <martin@gnome.org>
15465
15466         * location.cs (Location.SymbolDocument): Use full pathnames for the
15467         source files.
15468
15469 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15470
15471         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15472         of the expression resolve mechanism, because that will catch the
15473         SimpleName error failures.
15474
15475         (Conditional): If we can not resolve the
15476         expression, return, do not crash.
15477
15478 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15479
15480         * cs-tokenizer.cs:
15481         (location): display token name instead of its number.
15482
15483 2002-08-28  Martin Baulig  <martin@gnome.org>
15484
15485         * expression.cs (Binary.ResolveOperator): Don't silently return
15486         but return an error if an operator cannot be applied between two
15487         enum types.
15488
15489 2002-08-28  Martin Baulig  <martin@gnome.org>
15490
15491         * class.cs (Constructor.Define): Set the permission attributes
15492         correctly instead of making all constructors public.
15493
15494 2002-08-28  Martin Baulig  <martin@gnome.org>
15495
15496         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15497         for private members before reporting a CS0103; if we find anything,
15498         it's a CS0122.
15499
15500 2002-08-28  Martin Baulig  <martin@gnome.org>
15501
15502         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15503         to check whether `closure_start_type == closure_invocation_type',
15504         we also need to check whether `m.DeclaringType == closure_invocation_type'
15505         before bypassing the permission checks.  We might be accessing
15506         protected/private members from the base class.
15507         (TypeManager.RealMemberLookup): Only set private_ok if private
15508         members were requested via BindingFlags.NonPublic.
15509
15510         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15511
15512         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15513         MethodGroupExpr.IsExplicitImpl if appropriate.
15514         (Invocation.DoResolve): Don't report the CS0120 for explicit
15515         interface implementations.
15516
15517 2002-08-27  Martin Baulig  <martin@gnome.org>
15518
15519         * expression.cs (Invocation.DoResolve): If this is a static
15520         method and we don't have an InstanceExpression, we must report
15521         a CS0120.
15522
15523 2002-08-25  Martin Baulig  <martin@gnome.org>
15524
15525         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15526         `==' between a valuetype and an object.
15527
15528 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15529
15530         * ecore.cs (TypeExpr): Provide a ToString method.
15531
15532 2002-08-24  Martin Baulig  <martin@gnome.org>
15533
15534         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15535         now called proggie.dbg and it's a binary file.
15536
15537 2002-08-23  Martin Baulig  <martin@gnome.org>
15538
15539         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15540
15541 2002-08-23  Martin Baulig  <martin@gnome.org>
15542
15543         * struct.cs (MyStructInfo.ctor): Make this work with empty
15544         structs; it's not allowed to use foreach() on null.
15545
15546 2002-08-23  Martin Baulig  <martin@gnome.org>
15547
15548         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15549         writer the full pathname of the generated assembly.
15550
15551 2002-08-23  Martin Baulig  <martin@gnome.org>
15552
15553         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15554         A `finally' block never returns or breaks; improved handling of
15555         unreachable code.
15556
15557 2002-08-23  Martin Baulig  <martin@gnome.org>
15558
15559         * statement.cs (Throw.Resolve): Allow `throw null'.
15560
15561 2002-08-23  Martin Baulig  <martin@gnome.org>
15562
15563         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15564         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15565         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15566         MemberLookup would return a wrong event if this is an explicit
15567         interface implementation and the class has an event with the same
15568         name.
15569
15570 2002-08-23  Martin Baulig  <martin@gnome.org>
15571
15572         * statement.cs (Block.AddChildVariableNames): New public method.
15573         (Block.AddChildVariableName): Likewise.
15574         (Block.IsVariableNameUsedInChildBlock): Likewise.
15575         (Block.AddVariable): Check whether a variable name has already
15576         been used in a child block.
15577
15578         * cs-parser.jay (declare_local_variables): Mark all variable names
15579         from the current block as being used in a child block in the
15580         implicit block.
15581
15582 2002-08-23  Martin Baulig  <martin@gnome.org>
15583
15584         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15585         find the symbol writer.
15586
15587         * driver.cs: csc also allows the arguments to /define being
15588         separated by commas, not only by semicolons.
15589
15590 2002-08-23  Martin Baulig  <martin@gnome.org>
15591
15592         * interface.cs (Interface.GetMembers): Added static check for events.
15593
15594 2002-08-15  Martin Baulig  <martin@gnome.org>
15595
15596         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15597         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15598
15599         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15600         why the MethodData.EmitDestructor() change was necessary.
15601
15602 2002-08-20  Martin Baulig  <martin@gnome.org>
15603
15604         * class.cs (TypeContainer.FindMembers): Added static check for events.
15605
15606         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15607
15608         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15609         use Type.GetEvents(), not Type.FindMembers().
15610
15611 2002-08-20  Martin Baulig  <martin@gnome.org>
15612
15613         * decl.cs (MemberCache): Added a special method cache which will
15614         be used for method-only searched.  This ensures that a method
15615         search will return a MethodInfo with the correct ReflectedType for
15616         inherited methods.      
15617
15618 2002-08-20  Martin Baulig  <martin@gnome.org>
15619
15620         * decl.cs (DeclSpace.FindMembers): Made this public.
15621
15622 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15623
15624         * delegate.cs: fixed build on windows.
15625         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15626
15627 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15628
15629         * ecore.cs (StandardConversionExists): Return a false
15630         if we are trying to convert the void type to anything else
15631         since that is not allowed.
15632
15633         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15634         we flag error 70 in the event an event is trying to be accessed
15635         directly from outside the declaring type.
15636
15637 2002-08-20  Martin Baulig  <martin@gnome.org>
15638
15639         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15640         MemberCache from typemanager.cs to decl.cs.
15641
15642 2002-08-19  Martin Baulig  <martin@gnome.org>
15643
15644         * class.cs (TypeContainer): Implement IMemberContainer.
15645         (TypeContainer.DefineMembers): Create the MemberCache.
15646         (TypeContainer.FindMembers): Do better BindingFlags checking; only
15647         return public members if BindingFlags.Public was given, check
15648         whether members are static.
15649
15650 2002-08-16  Martin Baulig  <martin@gnome.org>
15651
15652         * decl.cs (DeclSpace.Define): Splitted this in Define and
15653         DefineMembers.  DefineMembers is called first and initializes the
15654         MemberCache.
15655
15656         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
15657         DefineMembers() on all our DeclSpaces.
15658
15659         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15660         but call DefineMembers() on all nested interfaces.  We call their
15661         Define() in our new Define() function.
15662
15663         * interface.cs (Interface): Implement IMemberContainer.
15664         (Interface.Define): Moved all code except the attribute stuf to
15665         DefineMembers().
15666         (Interface.DefineMembers): Initialize the member cache.
15667
15668         * typemanager.cs (IMemberFinder): Removed this interface, we don't
15669         need this anymore since we can use MemberCache.FindMembers directly.
15670
15671 2002-08-19  Martin Baulig  <martin@gnome.org>
15672
15673         * typemanager.cs (MemberCache): When creating the cache for an
15674         interface type, add all inherited members.
15675         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15676         to `out bool used_cache' and documented it.
15677         (TypeManager.MemberLookup): If we already used the cache in the first
15678         iteration, we don't need to do the interfaces check.
15679
15680 2002-08-19  Martin Baulig  <martin@gnome.org>
15681
15682         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
15683         here from IMemberFinder and don't implement this interface anymore.
15684         (DeclSpace.MemberCache): Moved here from IMemberFinder.
15685
15686         * typemanager.cs (IMemberFinder): This interface is now only used by
15687         classes which actually support the member cache.
15688         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15689         since we only put DeclSpaces into this Hashtable.
15690         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15691         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15692
15693 2002-08-16  Martin Baulig  <martin@gnome.org>
15694
15695         * typemanager.cs (ICachingMemberFinder): Removed.
15696         (IMemberFinder.MemberCache): New property.
15697         (TypeManager.FindMembers): Merged this with RealFindMembers().
15698         This function will never be called from TypeManager.MemberLookup()
15699         so we can't use the cache here, just the IMemberFinder.
15700         (TypeManager.MemberLookup_FindMembers): Check whether the
15701         IMemberFinder has a MemberCache and call the cache's FindMembers
15702         function.
15703         (MemberCache): Rewrote larger parts of this yet another time and
15704         cleaned it up a bit.
15705
15706 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15707
15708         * driver.cs (LoadArgs): Support quoting.
15709
15710         (Usage): Show the CSC-like command line arguments.
15711
15712         Improved a few error messages.
15713
15714 2002-08-15  Martin Baulig  <martin@gnome.org>
15715
15716         * typemanager.cs (IMemberContainer.Type): New property.
15717         (IMemberContainer.IsInterface): New property.
15718
15719         The following changes are conditional to BROKEN_RUNTIME, which is
15720         defined at the top of the file.
15721
15722         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15723         class'es members, but add all members from TypeHandle.ObjectType
15724         if we're an interface.
15725         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15726         is the current type.
15727         (MemberCache.CacheEntry.Container): Removed this field.
15728         (TypeHandle.GetMembers): Include inherited members.
15729
15730 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15731
15732         * typemanager.cs: fixed compilation and added a comment on a field that
15733         is never used.
15734
15735 2002-08-15  Martin Baulig  <martin@gnome.org>
15736
15737         * class.cs (ConstructorInitializer.Resolve): In the
15738         Expression.MemberLookup call, use the queried_type as
15739         invocation_type.
15740
15741         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15742         declared' attribute, it's always true.
15743         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15744         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15745         temporary wrapper for FindMembers which tells MemberLookup whether
15746         members from the base classes are included in the return value.
15747         This will go away soon.
15748         (TypeManager.MemberLookup): Use this temporary hack here; once the
15749         new MemberCache is completed, we don't need to do the DeclaredOnly
15750         looping here anymore since the MemberCache will take care of this.
15751         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15752         (MemberCache): When creating the MemberCache for a class, get
15753         members from the current class and all its base classes.
15754         (MemberCache.CacheEntry.Container): New field.  This is a
15755         temporary hack until the Mono runtime is fixed to distinguish
15756         between ReflectedType and DeclaringType.  It allows us to use MCS
15757         with both the MS runtime and the unfixed Mono runtime without
15758         problems and without accecting performance.
15759         (MemberCache.SearchMembers): The DeclaredOnly looping from
15760         TypeManager.MemberLookup is now done here.      
15761
15762 2002-08-14  Martin Baulig  <martin@gnome.org>
15763
15764         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15765         Type.GetFields on dynamic types but get the fields from the
15766         corresponding TypeContainer.
15767         (MyStructInfo.GetStructInfo): Added check for enum types.
15768
15769         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15770         (MemberList.SyncRoot): Implemented.
15771         (TypeManager.FilterWithClosure): No need to check permissions if
15772         closure_start_type == closure_invocation_type, don't crash if
15773         closure_invocation_type is null.
15774
15775 2002-08-13  Martin Baulig  <martin@gnome.org>
15776
15777         Rewrote TypeContainer.FindMembers to use a member cache.  This
15778         gives us a speed increase of about 35% for the self-hosting MCS
15779         build and of about 15-20% for the class libs (both on GNU/Linux).
15780
15781         * report.cs (Timer): New class to get enhanced profiling.  This
15782         whole class is "TIMER" conditional since it remarkably slows down
15783         compilation speed.
15784
15785         * class.cs (MemberList): New class.  This is an IList wrapper
15786         which we're now using instead of passing MemberInfo[]'s around to
15787         avoid copying this array unnecessarily.
15788         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15789         (ICachingMemberFinder, IMemberContainer): New interface.
15790         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15791         has already been checked, otherwise use it for the name comparision.
15792         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15793         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15794         if possible.  Returns a MemberList, not a MemberInfo [].
15795         (TypeHandle): New class, implements IMemberContainer.  We create
15796         one instance of this class per type, it contains a MemberCache
15797         which is used to do the member lookups.
15798         (MemberCache): New class.  Each instance of this class contains
15799         all members of a type and a name-based hash table.
15800         (MemberCache.FindMembers): This is our new member lookup
15801         function.  First, it looks up all members of the requested name in
15802         the hash table.  Then, it walks this list and sorts out all
15803         applicable members and returns them.
15804
15805 2002-08-13  Martin Baulig  <martin@gnome.org>
15806
15807         In addition to a nice code cleanup, this gives us a performance
15808         increase of about 1.4% on GNU/Linux - not much, but it's already
15809         half a second for the self-hosting MCS compilation.
15810
15811         * typemanager.cs (IMemberFinder): New interface.  It is used by
15812         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15813         Enum, Delegate or Interface.
15814         (TypeManager.finder_to_member_finder): New PtrHashtable.
15815         (TypeManager.finder_to_container): Removed.
15816         (TypeManager.finder_to_delegate): Removed.
15817         (TypeManager.finder_to_interface): Removed.
15818         (TypeManager.finder_to_enum): Removed.
15819
15820         * interface.cs (Interface): Implement IMemberFinder.
15821
15822         * delegate.cs (Delegate): Implement IMemberFinder.
15823
15824         * enum.cs (Enum): Implement IMemberFinder.
15825
15826         * class.cs (TypeContainer): Implement IMemberFinder.
15827
15828 2002-08-12  Martin Baulig  <martin@gnome.org>
15829
15830         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15831
15832 2002-08-12  Martin Baulig  <martin@gnome.org>
15833
15834         * ecore.cs (ITypeExpression): New interface for expressions which
15835         resolve to a type.
15836         (TypeExpression): Renamed to TypeLookupExpression.
15837         (Expression.DoResolve): If we're doing a types-only lookup, the
15838         expression must implement the ITypeExpression interface and we
15839         call DoResolveType() on it.
15840         (SimpleName): Implement the new ITypeExpression interface.
15841         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15842         hack, the situation that we're only looking up types can't happen
15843         anymore when this method is called.  Moved the type lookup code to
15844         DoResolveType() and call it.
15845         (SimpleName.DoResolveType): This ITypeExpression interface method
15846         is now doing the types-only lookup.
15847         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15848         (ResolveFlags): Added MaskExprClass.
15849
15850         * expression.cs (MemberAccess): Implement the ITypeExpression
15851         interface.
15852         (MemberAccess.DoResolve): Added support for a types-only lookup
15853         when we're called via ITypeExpression.DoResolveType().
15854         (ComposedCast): Implement the ITypeExpression interface.
15855
15856         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15857         Expression.Resolve() with ResolveFlags.Type instead.
15858
15859 2002-08-12  Martin Baulig  <martin@gnome.org>
15860
15861         * interface.cs (Interface.Define): Apply attributes.
15862
15863         * attribute.cs (Attribute.ApplyAttributes): Added support for
15864         interface attributes.
15865
15866 2002-08-11  Martin Baulig  <martin@gnome.org>
15867
15868         * statement.cs (Block.Emit): Only check the "this" variable if we
15869         do not always throw an exception.
15870
15871         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15872         whether the property has a set accessor.
15873
15874 2002-08-11  Martin Baulig  <martin@gnome.org>
15875
15876         Added control flow analysis support for structs.
15877
15878         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15879         with control flow analysis turned off.
15880         (IVariable): New interface.
15881         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15882         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15883         (FieldExpr.DoResolve): Resolve the instance expression with flow
15884         analysis turned off and do the definite assignment check after the
15885         resolving when we know what the expression will resolve to.
15886
15887         * expression.cs (LocalVariableReference, ParameterReference):
15888         Implement the new IVariable interface, only call the flow analysis
15889         code if ec.DoFlowAnalysis is true.
15890         (This): Added constructor which takes a Block argument.  Implement
15891         the new IVariable interface.
15892         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15893         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15894         This does the definite assignment checks for struct members.
15895
15896         * class.cs (Constructor.Emit): If this is a non-static `struct'
15897         constructor which doesn't have any initializer, call
15898         Block.AddThisVariable() to tell the flow analysis code that all
15899         struct elements must be initialized before control returns from
15900         the constructor.
15901
15902         * statement.cs (MyStructInfo): New public class.
15903         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15904         argument to this indexer.  If non-zero, check an individual struct
15905         member, not the whole struct.
15906         (FlowBranching.CheckOutParameters): Check struct members.
15907         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15908         overloaded versions of these methods which take an additional
15909         `int field_idx' argument to check struct members.
15910         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15911         overloaded versions of these methods which take an additional
15912         `string field_name' argument to check struct member.s
15913         (VariableInfo): Implement the IVariable interface.
15914         (VariableInfo.StructInfo): New public property.  Returns the
15915         MyStructInfo instance of the variable if it's a struct or null.
15916         (Block.AddThisVariable): New public method.  This is called from
15917         Constructor.Emit() for non-static `struct' constructor which do
15918         not have any initializer.  It creates a special variable for the
15919         "this" instance variable which will be checked by the flow
15920         analysis code to ensure that all of the struct's fields are
15921         initialized before control returns from the constructor.
15922         (UsageVector): Added support for struct members.  If a
15923         variable/parameter is a struct with N members, we reserve a slot
15924         in the usage vector for each member.  A struct is considered fully
15925         initialized if either the struct itself (slot 0) or all its
15926         members are initialized.
15927
15928 2002-08-08  Martin Baulig  <martin@gnome.org>
15929
15930         * driver.cs (Driver.MainDriver): Only report an error CS5001
15931         if there were no compilation errors.
15932
15933         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15934         `UnsafeContext' property to determine whether the parent is in
15935         unsafe context rather than checking the parent's ModFlags:
15936         classes nested in an unsafe class are unsafe as well.
15937
15938 2002-08-08  Martin Baulig  <martin@gnome.org>
15939
15940         * statement.cs (UsageVector.MergeChildren): Distinguish between
15941         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15942         we return.  Added test17() and test18() to test-154.cs.
15943
15944 2002-08-08  Martin Baulig  <martin@gnome.org>
15945
15946         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15947         Family access, make sure the invoking type isn't a subclass of the
15948         queried type (that'd be a CS1540).
15949
15950         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15951         this method which takes an additional `Type invocation_type'.
15952
15953         * expression.cs (BaseAccess.DoResolve): Use the base type as
15954         invocation and query type.
15955         (MemberAccess.DoResolve): If the lookup failed and we're about to
15956         report a CS0122, try a lookup with the ec.ContainerType - if this
15957         succeeds, we must report a CS1540.
15958
15959 2002-08-08  Martin Baulig  <martin@gnome.org>
15960
15961         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15962         (MethodGroupExpr): Implement the IMemberExpr interface.
15963
15964         * expression (MemberAccess.ResolveMemberAccess): No need to have
15965         any special code for MethodGroupExprs anymore, they're now
15966         IMemberExprs.   
15967
15968 2002-08-08  Martin Baulig  <martin@gnome.org>
15969
15970         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15971         Family, FamANDAssem and FamORAssem permissions.
15972         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15973
15974 2002-08-08  Martin Baulig  <martin@gnome.org>
15975
15976         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15977         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15978         or loop block.
15979
15980 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15981
15982         * driver.cs: implemented /resource option to embed managed resources.
15983
15984 2002-08-07  Martin Baulig  <martin@gnome.org>
15985
15986         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15987         (FieldBase.HasFieldInitializer): New public property.
15988         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15989         returns the field initializer and makes sure it is only resolved once.
15990         (TypeContainer.EmitFieldInitializers): Call
15991         FieldBase.GetInitializerExpression to get the initializer, this ensures
15992         that it isn't resolved multiple times.
15993
15994         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15995         the resolving process (SimpleName/MemberLookup) that we're currently
15996         emitting a field initializer (which must not access any instance members,
15997         this is an error CS0236).
15998
15999         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16000         argument, if the `IsFieldInitializer' flag is set, we must report and
16001         error CS0236 and not an error CS0120.   
16002
16003 2002-08-07  Martin Baulig  <martin@gnome.org>
16004
16005         * ecore.cs (IMemberExpr): New public interface.
16006         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16007         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16008         if the expression is an IMemberExpr.
16009
16010         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16011         to be null, implicitly default to `this' if we're non-static in
16012         this case.  Simplified the code a lot by using the new IMemberExpr
16013         interface.  Also fixed bug #28176 here.
16014
16015 2002-08-06  Martin Baulig  <martin@gnome.org>
16016
16017         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16018         ParameterReferences during semantic analysis so that we can do a
16019         type-only search when resolving Cast, TypeOf and SizeOf.
16020         (block): Pass the `current_local_parameters' to the Block's
16021         constructor.
16022
16023         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16024         argument to the constructor.
16025         (ConstructorInitializer.Resolve): Create a temporary implicit
16026         block with the parameters.
16027
16028         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16029         references here if we aren't doing a type-only search.
16030
16031         * statement.cs (Block): Added constructor which takes a
16032         `Parameters parameters' argument.
16033         (Block.Parameters): New public property.
16034
16035         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16036         to `Parameters' and made it public readonly.
16037
16038 2002-08-06  Martin Baulig  <martin@gnome.org>
16039
16040         * ecore.cs (Expression.Warning): Made this public as well.
16041
16042         * report.cs (Report.Debug): Print the contents of collections.
16043
16044 2002-08-06  Martin Baulig  <martin@gnome.org>
16045
16046         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16047         used to tell Resolve() which kinds of expressions it may return.
16048         (Expression.Resolve): Added overloaded version of this method which
16049         takes a `ResolveFlags flags' argument.  This can be used to tell
16050         Resolve() which kinds of expressions it may return.  Reports a
16051         CS0118 on error.
16052         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16053         ResolveFlags.SimpleName.
16054         (Expression.Error118): Added overloaded version of this method which
16055         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16056         which kinds of expressions are allowed.
16057
16058         * expression.cs (Argument.ResolveMethodGroup): New public method.
16059         Resolves an argument, but allows a MethodGroup to be returned.
16060         This is used when invoking a delegate.
16061
16062         * TODO: Updated a bit.
16063
16064 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16065
16066         Fixed compilation with csc.
16067
16068         * ecore.cs: Expression.Error made public. Is this correct? Should
16069         Warning be made public too?
16070
16071         * expression.cs: use ea.Location instead of ea.loc.
16072         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16073
16074 2002-08-06  Martin Baulig  <martin@gnome.org>
16075
16076         * ecore.cs (Expression.loc): Moved the location here instead of
16077         duplicating it in all derived classes.
16078         (Expression.Location): New public property.
16079         (Expression.Error, Expression.Warning): Made them non-static and
16080         removed the location argument.
16081         (Expression.Warning): Added overloaded version which takes an
16082         `int level' argument.
16083         (Expression.Error118): Make this non-static and removed the
16084         expression and location arguments.
16085         (TypeExpr): Added location argument to the constructor.
16086
16087         * expression.cs (StaticCallExpr): Added location argument to
16088         the constructor.
16089         (Indirection, PointerArithmetic): Likewise.
16090         (CheckedExpr, UnCheckedExpr): Likewise.
16091         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16092         (StringPtr): Likewise.
16093
16094
16095 2002-08-05  Martin Baulig  <martin@gnome.org>
16096
16097         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16098
16099         * assign.cs (Assign.DoResolve): Check whether the source
16100         expression is a value or variable.
16101
16102         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16103         while resolving the corresponding blocks.
16104
16105         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16106         an error, don't silently return null.
16107
16108         * statement.cs (Block.AddVariable): Do the error reporting here
16109         and distinguish between CS0128 and CS0136.
16110         (Block.DoResolve): Report all unused labels (warning CS0164).
16111         (LabeledStatement): Pass the location to the constructor.
16112         (LabeledStatement.HasBeenReferenced): New property.
16113         (LabeledStatement.Resolve): Set it to true here.
16114
16115         * statement.cs (Return.Emit): Return success even after reporting
16116         a type mismatch error (CS0126 or CS0127), this is what csc does and
16117         it avoids confusing the users with any consecutive errors.
16118
16119 2002-08-05  Martin Baulig  <martin@gnome.org>
16120
16121         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16122
16123         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16124
16125         * expression.cs (MemberAccess.DoResolve): Silently return if an
16126         error has already been reported.
16127
16128         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16129         error has already been reported.
16130
16131 2002-08-05  Martin Baulig  <martin@gnome.org>
16132
16133         * statement.cs (UsageVector): Only initialize the `parameters'
16134         vector if we actually have any "out" parameters.
16135
16136 2002-08-05  Martin Baulig  <martin@gnome.org>
16137
16138         * expression.cs (Binary.ResolveOperator): When combining delegates,
16139         they must have the same type.
16140
16141 2002-08-05  Martin Baulig  <martin@gnome.org>
16142
16143         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16144         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16145         work with the ms runtime and we also don't need it: if we're a
16146         PropertyBuilder and not in the `indexer_arguments' hash, then we
16147         are a property and not an indexer.
16148
16149         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16150         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16151         since the latter one doesn't work with the ms runtime.
16152
16153 2002-08-03  Martin Baulig  <martin@gnome.org>
16154
16155         Fixed bugs #27998 and #22735.
16156
16157         * class.cs (Method.IsOperator): New public field.
16158         (Method.CheckBase): Report CS0111 if there's already a method
16159         with the same parameters in the current class.  Report CS0508 when
16160         attempting to change the return type of an inherited method.
16161         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16162         and it's not marked abstract or extern.
16163         (PropertyBase): New abstract base class for Property and Indexer.
16164         (PropertyBase.CheckBase): Moved here from Property and made it work
16165         for indexers.
16166         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16167         the same so we can reuse it there.
16168         (Property, Indexer): Derive from PropertyBase.
16169         (MethodSignature.inheritable_property_signature_filter): New delegate
16170         to find properties and indexers.
16171
16172         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16173         argument and improved error reporting.
16174
16175         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16176         EmptyReadOnlyParameters and made it a property.
16177
16178         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16179         version of this method which takes a `PropertyInfo indexer'.
16180         (TypeManager.RegisterIndexer): New method.
16181
16182         * class.cs: Added myself as author of this file :-)
16183
16184 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16185
16186         * class.cs: fixed compilation on windoze.
16187
16188 2002-08-03  Martin Baulig  <martin@gnome.org>
16189
16190         * interface.cs (Interface.GetInterfaceBases): Check whether all
16191         base interfaces are at least as accessible than the current one.
16192
16193         * class.cs (TypeContainer.GetClassBases): Check whether base types
16194         are at least as accessible than the current type.
16195         (TypeContainer.AsAccessible): Implemented and made non-static.
16196         (MemberBase.CheckParameters): Report errors if the accessibility
16197         checks fail.
16198
16199         * delegate.cs (Delegate.Delegate): The default visibility is
16200         internal for top-level types and private for nested types.
16201         (Delegate.Define): Report errors if the accessibility checks fail.
16202
16203         * enum.cs (Enum.Enum): The default visibility is internal for
16204         top-level types and private for nested types.
16205         (Enum.DefineType): Compute the correct visibility.
16206
16207         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16208         function which takes a `bool is_toplevel' instead of a TypeContainer.
16209
16210         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16211         builtin type.
16212
16213 2002-08-02  Martin Baulig  <martin@gnome.org>
16214
16215         * expression.cs (LocalVariableReferenc): Added constructor which
16216         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16217         (LocalVariableReference.IsReadOnly): New property.
16218         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16219         variable is readonly, use our own readonly flag to do this; you can
16220         use the new constructor to get a writable reference to a read-only
16221         variable.
16222
16223         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16224         reference to the local variable.
16225
16226 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16227
16228         * rootcontext.cs (ResolveCore): Also include System.Exception
16229
16230         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16231         we reach an EmptyStatement.
16232
16233         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16234         is also fine.
16235
16236         * expression.cs (Binary.ResolveOperator): Check error result in
16237         two places.
16238
16239         use brtrue/brfalse directly and avoid compares to null.
16240
16241 2002-08-02  Martin Baulig  <martin@gnome.org>
16242
16243         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16244         Fixes bug #28407, added test-155.cs.
16245
16246 2002-08-01  Martin Baulig  <martin@gnome.org>
16247
16248         * class.cs (Event.EmitDefaultMethod): Make this work with static
16249         events.  Fixes #28311, added verify-3.cs.
16250
16251 2002-08-01  Martin Baulig  <martin@gnome.org>
16252
16253         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16254         `is_disposable' fields.
16255         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16256         `hm.is_disposable' if we're using the collection pattern.
16257         (Foreach.EmitCollectionForeach): Use the correct type for the
16258         enumerator's local variable, only emit the try/finally block if
16259         necessary (fixes #27713).
16260
16261 2002-08-01  Martin Baulig  <martin@gnome.org>
16262
16263         * ecore.cs (Expression.report118): Renamed to Error118 and made
16264         it public static.
16265
16266         * statement.cs (Throw.Resolve): Check whether the expression is of
16267         the correct type (CS0118) and whether the type derives from
16268         System.Exception (CS0155).
16269         (Catch.Resolve): New method.  Do the type lookup here and check
16270         whether it derives from System.Exception (CS0155).
16271         (Catch.CatchType, Catch.IsGeneral): New public properties.
16272
16273         * typemanager.cs (TypeManager.exception_type): Added.
16274
16275 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16276
16277         * driver.cs: Updated About function.
16278
16279 2002-07-31  Martin Baulig  <martin@gnome.org>
16280
16281         Implemented Control Flow Analysis.
16282
16283         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16284         (EmitContext.CurrentBranching): Added.
16285         (EmitContext.StartFlowBranching): Added.
16286         (EmitContext.EndFlowBranching): Added.
16287         (EmitContext.KillFlowBranching): Added.
16288         (EmitContext.IsVariableAssigned): Added.
16289         (EmitContext.SetVariableAssigned): Added.
16290         (EmitContext.IsParameterAssigned): Added.
16291         (EmitContext.SetParameterAssigned): Added.
16292         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16293         Added control flow analysis stuff here.
16294
16295         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16296         resolve the expression as lvalue.
16297         (LocalVariableReference.DoResolve): Check whether the variable has
16298         already been assigned.
16299         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16300         the parameter as assigned here.
16301         (ParameterReference.DoResolve): Check whether the parameter has already
16302         been assigned.
16303         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16304         expression as lvalue.
16305
16306         * statement.cs (FlowBranching): New class for the flow analysis code.
16307         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16308         (LabeledStatement.IsDefined): New public property.
16309         (LabeledStatement.AddUsageVector): New public method to tell flow
16310         analyis that the label may be reached via a forward jump.
16311         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16312         flow analysis.
16313         (VariableInfo.Number): New public field.  This is used by flow analysis
16314         to number all locals of a block.
16315         (Block.CountVariables): New public property.  This is the number of
16316         local variables in this block (including the locals from all parent
16317         blocks).
16318         (Block.EmitMeta): Number all the variables.
16319
16320         * statement.cs: Added flow analysis support to all classes.
16321
16322 2002-07-31  Martin Baulig  <martin@gnome.org>
16323
16324         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16325         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16326         then use this argument.
16327
16328         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16329
16330         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16331         use this to specify /define options.
16332
16333 2002-07-29  Martin Baulig  <martin@gnome.org>
16334
16335         * statement.cs (Fixed): Moved all code that does variable lookups
16336         and resolvings from Emit to Resolve.
16337
16338         * statement.cs (For): Moved all code that does variable lookups
16339         and resolvings from Emit to Resolve.
16340
16341         * statement.cs (Using): Moved all code that does variable lookups
16342         and resolvings from Emit to Resolve.
16343
16344 2002-07-29  Martin Baulig  <martin@gnome.org>
16345
16346         * attribute.cs (Attribute.Resolve): Explicitly catch a
16347         System.NullReferenceException when creating the
16348         CustromAttributeBuilder and report a different warning message.
16349
16350 2002-07-29  Martin Baulig  <martin@gnome.org>
16351
16352         * support.cs (ParameterData.ParameterName): Added method to
16353         get the name of a parameter.
16354
16355         * typemanager.cs (TypeManager.IsValueType): New public method.
16356
16357 2002-07-29  Martin Baulig  <martin@gnome.org>
16358
16359         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16360         is a flag which specifies that it's either ref or out.
16361         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16362         the out parameter to `out Parameter.Modifier mod', also set the
16363         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16364
16365         * support.cs (InternalParameters.ParameterModifier): Distinguish
16366         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16367         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16368
16369         * expression.cs (Argument.GetParameterModifier): Distinguish
16370         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16371         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16372
16373 2002-07-29  Martin Baulig  <martin@gnome.org>
16374
16375         * expression.cs (ParameterReference.ParameterReference): Added
16376         `Location loc' argument to the constructor.
16377
16378         * cs-parser.jay: Pass location to ParameterReference.
16379
16380 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16381
16382         * statement.cs (Try): Initialize the location.
16383
16384         * cs-parser.jay: pass location to Try.
16385
16386         * expression.cs (Unary.Reduce): Change the prototype to return
16387         whether a constant fold could be performed or not.  The result is
16388         returned in an out parameters.  In the case of Indirection and
16389         AddressOf, we want to perform the full tests.
16390
16391 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16392
16393         * statement.cs (Statement.Emit): Flag dead code.
16394
16395 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16396
16397         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16398
16399 2002-07-27  Martin Baulig  <martin@gnome.org>
16400
16401         * class.cs (MethodData.Define): Put back call to
16402         TypeManager.AddMethod(), accidentally commented this out.
16403
16404         * report.cs (Debug): New public method to print debugging information,
16405         this is `[Conditional ("DEBUG")]'.
16406
16407 2002-07-26  Martin Baulig  <martin@gnome.org>
16408
16409         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16410         (switch_statement): Push the current_block to the switch_stack and
16411         pop it again when we're done with the switch.
16412         (switch_section): The new block is a child of the current_block.
16413         Fixes bug #24007, added test-152.cs.
16414
16415 2002-07-27  Martin Baulig  <martin@gnome.org>
16416
16417         * expression.cs (Invocation.EmitArguments): When calling a varargs
16418         function with only its fixed arguments, we need to pass an empty
16419         array.
16420
16421 2002-07-27  Martin Baulig  <martin@gnome.org>
16422
16423         Mono 0.13 has been released.
16424
16425 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16426
16427         * driver.cs: Rename --resource to --linkres, because that is what
16428         we do currently, we dont support --resource yet.
16429
16430         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16431
16432 2002-07-25  Martin Baulig  <martin@gnome.org>
16433
16434         * class.cs (MethodData): New public class.  This is a `method builder'
16435         class for a method or one accessor of a Property/Indexer/Event.
16436         (MethodData.GetMethodFlags): Moved here from MemberBase.
16437         (MethodData.ApplyAttributes): Likewise.
16438         (MethodData.ApplyObsoleteAttribute): Likewise.
16439         (MethodData.ApplyConditionalAttribute): Likewise.
16440         (MethodData.ApplyDllImportAttribute): Likewise.
16441         (MethodData.CheckAbstractAndExternal): Likewise.
16442         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16443         (MethodData.Emit): Formerly known as Method.Emit().
16444         (MemberBase): Moved everything which was specific to a single
16445         accessor/method to MethodData.
16446         (Method): Create a new MethodData and call Define() and Emit() on it.
16447         (Property, Indexer, Event): Create a new MethodData objects for each
16448         accessor and call Define() and Emit() on them.
16449
16450 2002-07-25  Martin Baulig  <martin@gnome.org>
16451
16452         Made MethodCore derive from MemberBase to reuse the code from there.
16453         MemberBase now also checks for attributes.
16454
16455         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16456         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16457         as virtual.
16458         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16459         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16460         (MemberBase.ApplyAttributes): New virtual method; applies the
16461         attributes to a method or accessor.
16462         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16463         (MemberBase.ApplyConditionalAttribute): Likewise.
16464         (MemberBase.ApplyDllImportAttribute): Likewise.
16465         (MemberBase.CheckAbstractAndExternal): Likewise.
16466         (MethodCore.ParameterTypes): This is now a property instead of a
16467         method, it's initialized from DoDefineParameters().
16468         (MethodCore.ParameterInfo): Removed the set accessor.
16469         (MethodCore.DoDefineParameters): New protected virtual method to
16470         initialize ParameterTypes and ParameterInfo.
16471         (Method.GetReturnType): We can now simply return the MemberType.
16472         (Method.GetMethodFlags): Override the MemberBase version and add
16473         the conditional flags.
16474         (Method.CheckBase): Moved some code from Define() here, call
16475         DoDefineParameters() here.
16476         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16477         here to avoid some larger code duplication.
16478         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16479         ensure that abstract and external accessors don't declare a body.
16480
16481         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16482         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16483         lookup in the attribute's parent classes, so we need to abort as soon
16484         as we found the first match.
16485         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16486         the attribute has no arguments.
16487
16488         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16489         of a Method.
16490
16491 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16492
16493         * cs-parser.jay: reverted previous patch.
16494
16495 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16496
16497         * cs-parser.jay: fixed bug #22119.
16498
16499 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16500
16501         * attribute.cs: fixed compilation. The error was:
16502         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16503         be assigned to before control leaves the current method."
16504         [FIXME:  Filed as bug #28186: MCS must report this error.]
16505
16506 2002-07-25  Martin Baulig  <martin@gnome.org>
16507
16508         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16509         method to pull the condition name ouf of a Conditional attribute.
16510         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16511         the obsolete message and error flag out of an Obsolete attribute.
16512
16513         * class.cs (Method.GetMethodFlags): New public method to get the
16514         TypeManager.MethodFlags for this method.
16515         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16516         private methods.
16517         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16518         if we're overriding a virtual function, set the new private variable
16519         `parent_method'; call the new TypeManager.AddMethod().
16520
16521         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16522         the MethodBuilder and the Method in a PtrHashtable.
16523         (TypeManager.builder_to_method): Added for this purpose.
16524         (TypeManager.MethodFlags): Added IsObsoleteError.
16525         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16526         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16527         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16528         the message from the attribute.
16529
16530 2002-07-24  Martin Baulig  <martin@gnome.org>
16531
16532         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16533         preprocessor directives, ensure that the argument to #define/#undef is
16534         exactly one identifier and that it's actually an identifier.
16535
16536         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16537         did not work ....
16538
16539 2002-07-24  Martin Baulig  <martin@gnome.org>
16540
16541         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16542         initialize it to TypeManager.object_type in the constructor.
16543         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16544         of the `hm.get_current' method if we're using the collection pattern.
16545         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16546         for the explicit conversion to make it work when we're using the collection
16547         pattern and the `Current' property has a different return type than `object'.
16548         Fixes #27713.
16549
16550 2002-07-24  Martin Baulig  <martin@gnome.org>
16551
16552         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16553         does not match, but don't report any errors.  This method is called in
16554         order for all methods in a MethodGroupExpr until a matching method is
16555         found, so we don't want to bail out if the first method doesn't match.
16556         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16557         matches, report the 123.  Fixes #28070.
16558
16559 2002-07-24  Martin Baulig  <martin@gnome.org>
16560
16561         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16562         TypeManager.TypeToCoreType() to the top of the method so the
16563         following equality checks will work.  Fixes #28107.
16564
16565 2002-07-24  Martin Baulig  <martin@gnome.org>
16566
16567         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16568         operand is of type uint, and the other operand is of type sbyte,
16569         short or int, the operands are converted to type long." -
16570         Actually do what this comment already told us.  Fixes bug #28106,
16571         added test-150.cs.
16572
16573 2002-07-24  Martin Baulig  <martin@gnome.org>
16574
16575         * class.cs (MethodBase): New abstract class.  This is now a base
16576         class for Property, Indexer and Event to avoid some code duplication
16577         in their Define() and DefineMethods() methods.
16578         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16579         generic methods for Define() and DefineMethods().
16580         (FieldBase): Derive from MemberBase, not MemberCore.
16581         (Property): Derive from MemberBase, not MemberCore.
16582         (Property.DefineMethod): Moved all the code from this method to the
16583         new MethodBase.DefineAccessor(), just call it with appropriate
16584         argumetnts.
16585         (Property.Define): Call the new Property.DoDefine(), this does some
16586         sanity checks and we don't need to duplicate the code everywhere.
16587         (Event): Derive from MemberBase, not MemberCore.
16588         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16589         accessors, this will also make them work with interface events.
16590         (Indexer): Derive from MemberBase, not MemberCore.
16591         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16592         (Indexer.Define): Use the new MethodBase functions.
16593
16594         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16595         argument to the constructor.
16596         (Interface.FindMembers): Added support for interface events.
16597         (Interface.PopluateEvent): Implemented.
16598
16599         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16600
16601 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16602
16603         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16604         but this is required to check for a method name being the same as
16605         the containing class.  
16606
16607         Handle this now.
16608
16609 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16610
16611         * interface.cs: initialize variable.
16612
16613 2002-07-23  Martin Baulig  <martin@gnome.org>
16614
16615         Implemented the IndexerName attribute in interfaces.
16616
16617         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16618         name if this is an explicit interface implementation.
16619         (Indexer.InterfaceIndexerName): New public variable.  If we're
16620         implementing an interface indexer, this is the IndexerName in that
16621         interface.  Otherwise, it's the IndexerName.
16622         (Indexer.DefineMethod): If we're implementing interface indexer,
16623         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16624         and Pending.ImplementIndexer methods.
16625         (Indexer.Define): Also define the PropertyBuilder if we're
16626         implementing an interface indexer and this is neither an explicit
16627         interface implementation nor do the IndexerName match the one in
16628         the interface.
16629
16630         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16631         If a method is defined here, then we always need to create a proxy
16632         for it.  This is used when implementing interface indexers.
16633         (Pending.IsInterfaceIndexer): New public method.
16634         (Pending.ImplementIndexer): New public method.
16635         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16636         This is used when implementing interface indexers to define a proxy
16637         if necessary.
16638         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16639         define a proxy if necessary.
16640
16641         * interface.cs (Interface.IndexerName): New public variable.
16642         (Interface.PopulateIndexer): Set the IndexerName.
16643         (Interface.DefineIndexers): New private method.  Populate all the
16644         indexers and make sure their IndexerNames match.
16645
16646         * typemanager.cs (IndexerPropertyName): Added support for interface
16647         indexers.
16648
16649 2002-07-22  Martin Baulig  <martin@gnome.org>
16650
16651         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16652         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16653         ret if HasReturnLabel.
16654         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16655         variables.
16656
16657         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16658         and set the ec.LoopBeginTryCatchLevel.
16659         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16660         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16661         the current ec.TryCatchLevel, the branch goes out of an exception
16662         block.  In this case, we need to use Leave and not Br.
16663
16664 2002-07-22  Martin Baulig  <martin@gnome.org>
16665
16666         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16667         block unless the block does not always return or it is contained in
16668         another try { ... } catch { ... } block.  Fixes bug #26506.
16669         Added verify-1.cs to the test suite.
16670
16671 2002-07-22  Martin Baulig  <martin@gnome.org>
16672
16673         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16674         then we do not always return.  Fixes bug #24985.
16675
16676 2002-07-22  Martin Baulig  <martin@gnome.org>
16677
16678         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16679         lookup on a per-class level; ie. walk up the class hierarchy until we
16680         found at least one applicable method, then choose the best among them.
16681         Fixes bug #24463 and test-29.cs.
16682
16683 2002-07-22  Martin Baulig  <martin@gnome.org>
16684
16685         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16686         return types of the methods.  The return type is not part of the
16687         signature and we must not check it to make the `new' modifier work.
16688         Fixes bug #27999, also added test-147.cs.
16689         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16690
16691         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16692         on the method's return type.
16693
16694 2002-07-21  Martin Baulig  <martin@gnome.org>
16695
16696         * assign.cs: Make this work if the rightmost source is a constant and
16697         we need to do an implicit type conversion.  Also adding a few more tests
16698         to test-38.cs which should have caught this.
16699
16700         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16701         target in the makefile for this.  The makefile.gnu is primarily intended
16702         for end-users who don't want to debug the compiler.
16703
16704 2002-07-21  Martin Baulig  <martin@gnome.org>
16705
16706         * assign.cs: Improved the Assign class so it can now handle embedded
16707         assignments (X = Y = Z = something).  As a side-effect this'll now also
16708         consume less local variables.  test-38.cs now passes with MCS, added
16709         a few new test cases to that test.
16710
16711 2002-07-20  Martin Baulig  <martin@gnome.org>
16712
16713         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16714         instructions.  Fixes bug #27977, also added test-146.cs.
16715
16716 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16717
16718         * cs-tokenizer.cs: fixed getHex ().
16719
16720 2002-07-19  Martin Baulig  <martin@gnome.org>
16721
16722         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16723         not Type.GetType() to lookup the array type.  This is needed when
16724         we're constructing an array of a user-defined type.
16725         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16726         single-dimensional arrays, but also for single-dimensial arrays of
16727         type decimal.
16728
16729 2002-07-19  Martin Baulig  <martin@gnome.org>
16730
16731         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16732         this function is called, it's not allowed to share LocalBuilders
16733         among ILGenerators.
16734
16735 2002-07-19  Martin Baulig  <martin@gnome.org>
16736
16737         * expression.cs (Argument.Resolve): Report an error 118 when trying
16738         to pass a type as argument.
16739
16740 2002-07-18  Martin Baulig  <martin@gnome.org>
16741
16742         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16743         Conv_R_Un for the signed `long' type.
16744
16745 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16746
16747         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16748         `expr' for the temporary result, as that will fail if we do
16749         multiple resolves on the same expression.
16750
16751 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16752
16753         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16754         ec.TypeContainer for looking up aliases. 
16755
16756         * class.cs (TypeContainer): Remove LookupAlias from here.
16757
16758         * decl.cs (DeclSpace); Move here.
16759
16760 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16761
16762         * class.cs (FindMembers): Only call filter if the constructor
16763         bulider is not null.
16764
16765         Also handle delegates in `NestedTypes' now.  Now we will perform
16766         type lookups using the standard resolution process.  This also
16767         fixes a bug.
16768
16769         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16770         This uses Expressions (the limited kind that can be parsed by the
16771         tree) instead of strings.
16772
16773         * expression.cs (ComposedCast.ToString): Implement, used to flag
16774         errors since now we have to render expressions.
16775
16776         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16777         FormArrayType. 
16778
16779         * ecore.cs (SimpleName.ToString): ditto.
16780
16781         * cs-parser.jay: Instead of using strings to assemble types, use
16782         Expressions to assemble the type (using SimpleName, ComposedCast,
16783         MemberAccess).  This should fix the type lookups in declarations,
16784         because we were using a different code path for this.
16785
16786         * statement.cs (Block.Resolve): Continue processing statements
16787         even when there is an error.
16788
16789 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16790
16791         * class.cs (Event.Define): Also remove the `remove' method from
16792         the list of pending items.
16793
16794         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16795         generate more compact code. 
16796
16797 2002-07-17  Martin Baulig  <martin@gnome.org>
16798
16799         * const.cs (Const.LookupConstantValue): Add support for constant
16800         `unchecked' and `checked' expressions.
16801         Also adding test case test-140.cs for this.
16802
16803 2002-07-17  Martin Baulig  <martin@gnome.org>
16804
16805         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16806         check whether mi.ReturnType implements the IEnumerator interface; the
16807         `==' and the IsAssignableFrom() will fail in this situation.
16808
16809 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16810
16811         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16812         here too.
16813
16814 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16815
16816         * expression.cs: fixed bug #27811.
16817
16818 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16819
16820         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16821         Molaro: when we are a ref, the value already contains a pointer
16822         value, do not take the address of it.
16823
16824 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16825         * removed mb-parser.jay and mb-tokenizer.cs
16826
16827 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16828
16829         * expression.cs: check against the building corlib void type.
16830
16831 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16832
16833         * ecore.cs: fix for valuetype static readonly fields: when 
16834         initializing them, we need their address, not the address of a copy.
16835
16836 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16837
16838         * typemanager.cs: register also enum_type in corlib.
16839
16840 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16841
16842         * class.cs: allow calling this (but not base) initializers in structs.
16843
16844 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16845
16846         * ecore.cs: make sure we compare against the building base types
16847         in GetTypeSize ().
16848
16849 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16850
16851         * typemanager.cs: fix TypeToCoreType() to handle void and object
16852         (corlib gets no more typerefs after this change).
16853
16854 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16855
16856         * expression.cs (ArrayCreation.EmitArrayArguments): use
16857         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16858
16859         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16860         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16861         array indexes, the runtime actually forbids them.
16862
16863         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16864         for array arguments here.
16865
16866         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16867         instead of the default for ValueTypes.
16868
16869         (New.DoEmit): Use IsValueType instead of
16870         IsSubclassOf (value_type)
16871         (New.DoResolve): ditto.
16872         (Invocation.EmitCall): ditto.
16873
16874         * assign.cs (Assign): ditto.
16875
16876         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16877         Statements *are* currently doing part of their resolution during
16878         Emit.  
16879
16880         Expressions do always resolve during resolve, but statements are
16881         only required to propagate resolution to their children.
16882
16883 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16884
16885         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16886
16887         (LoadAssembly): Do not add the dll if it is already specified
16888
16889         (MainDriver): Add the System directory to the link path at the end,
16890         after all the other -L arguments. 
16891
16892         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16893         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16894         ldelem.u1) and using the opposite for sbytes.
16895
16896         This fixes Digger, and we can finally run it.
16897
16898         * driver.cs (UnixParseOption): Move the option parsing here.  
16899         (CSCParseOption): Implement CSC-like parsing of options.
16900
16901         We now support both modes of operation, the old Unix way, and the
16902         new CSC-like way.  This should help those who wanted to make cross
16903         platform makefiles.
16904
16905         The only thing broken is that /r:, /reference: and /lib: are not
16906         implemented, because I want to make those have the same semantics
16907         as the CSC compiler has, and kill once and for all the confussion
16908         around this.   Will be doing this tomorrow.
16909
16910         * statement.cs (Unsafe.Resolve): The state is checked during
16911         resolve, not emit, so we have to set the flags for IsUnsfe here.
16912
16913 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16914
16915         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16916         not catch the Error_ObjectRefRequired in SimpleName (as it is
16917         possible to have a class/instance variable name that later gets
16918         deambiguated), we have to check this here.      
16919
16920 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16921
16922         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16923         make static and put into Expression.
16924
16925         (Event.Define): Register the private field of the event with the 
16926         TypeManager so that GetFieldFromEvent can get at it.
16927
16928         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16929         keep track of the private field associated with an event which
16930         has no accessors.
16931
16932         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16933         private field.
16934
16935         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16936
16937 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16938
16939         * expression.cs (Binary.EmitBranchable): this routine emits the
16940         Binary expression in a branchable context.  This basically means:
16941         we need to branch somewhere, not just get the value on the stack.
16942
16943         This works together with Statement.EmitBoolExpression.
16944
16945         * statement.cs (Statement.EmitBoolExpression): Use
16946         EmitBranchable. 
16947
16948 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16949
16950         * statement.cs (For): Reduce the number of jumps in loops.
16951
16952         (For): Implement loop inversion for the For statement.
16953
16954         (Break): We can be breaking out of a Try/Catch controlled section
16955         (foreach might have an implicit try/catch clause), so we need to
16956         use Leave instead of Br.
16957
16958         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16959         now).  If the instace expression supports IMemoryLocation, we use
16960         the AddressOf method from the IMemoryLocation to extract the
16961         address instead of emitting the instance.
16962
16963         This showed up with `This', as we were emitting the instance
16964         always (Emit) instead of the Address of This.  Particularly
16965         interesting when This is a value type, as we dont want the Emit
16966         effect (which was to load the object).
16967
16968 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16969
16970         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16971
16972         * statement.cs (Checked): Set the CheckedState during the resolve
16973         process too, as the ConvCast operations track the checked state on
16974         the resolve process, and not emit.
16975
16976         * cs-parser.jay (namespace_member_declaration): Flag that we have
16977         found a declaration when we do.  This is used to flag error 1529
16978
16979         * driver.cs: Report ok when we display the help only.
16980
16981 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16982
16983         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16984
16985 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16986
16987         * cs-tokenizer.cs (define): We also have to track locally the
16988         defines.  AllDefines is just used for the Conditional Attribute,
16989         but we also need the local defines for the current source code. 
16990
16991 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16992
16993         * statement.cs (While, For, Do): These loops can exit through a
16994         Break statement, use this information to tell whether the
16995         statement is the last piece of code.
16996
16997         (Break): Flag that we break.
16998
16999         * codegen.cs (EmitContexts): New `Breaks' state variable.
17000
17001 2002-07-03  Martin Baulig  <martin@gnome.org>
17002
17003         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17004         modifiers in method declarations in structs.  Otherwise, you won't
17005         be able to override things like Object.Equals().
17006
17007 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17008
17009         * class.cs (Method, Property, Indexer): Do not allow the public
17010         modifier to be used in explicit interface implementations.
17011
17012         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17013         override modifiers in method declarations in structs
17014
17015 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17016
17017         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17018         integer or real overflow, report an error
17019
17020 2002-07-02  Martin Baulig  <martin@gnome.org>
17021
17022         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17023         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17024         to tell the runtime about our newly created System.Object and
17025         System.ValueType types.
17026
17027 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17028
17029         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17030         struct instead of Ldarg/Starg.
17031
17032 2002-07-02  Martin Baulig  <martin@gnome.org>
17033
17034         * expression.cs (Indirection.Indirection): Call
17035         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17036
17037 2002-07-02  Martin Baulig  <martin@gnome.org>
17038
17039         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17040         ValueType, call TypeManager.TypeToCoreType() on it.
17041         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17042         the OpCodes.Newarr argument.
17043
17044 2002-07-02  Martin Baulig  <martin@gnome.org>
17045
17046         * expression.cs (Invocation.EmitCall): When compiling corlib,
17047         replace all calls to the system's System.Array type to calls to
17048         the newly created one.
17049
17050         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17051         System.Array methods.
17052         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17053         from the system's System.Array type which must be replaced.
17054
17055 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17056
17057         * typemanager.cs: load unverifiable_code_ctor so we can build
17058         corlib using the correct type. Avoid using GetTypeCode() with
17059         TypeBuilders.
17060         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17061         TypeManager.object_type to allow building corlib.
17062
17063 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17064
17065         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17066
17067 2002-07-01  Martin Baulig  <martin@gnome.org>
17068
17069         * class.cs: Make the last change actually work, we need to check
17070         whether `ifaces != null' to avoid a crash.
17071
17072 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17073
17074         * class.cs: when we build structs without fields that implement
17075         interfaces, we need to add the interfaces separately, since there is
17076         no API to both set the size and add the interfaces at type creation
17077         time.
17078
17079 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17080
17081         * expression.cs: the dimension arguments to the array constructors
17082         need to be converted if they are a long.
17083
17084 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17085
17086         * class.cs: don't emit ldarg.0 if there is no parent constructor
17087         (fixes showstopper for corlib).
17088
17089 2002-06-29  Martin Baulig  <martin@gnome.org>
17090
17091         MCS now compiles corlib on GNU/Linux :-)
17092
17093         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17094         ie. check for MethodImplOptions.InternalCall.
17095
17096         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17097         and TypeManager.attribute_type are null, so we must explicitly check
17098         whether parent is not null to find out whether it's an attribute type.
17099         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17100         and SetBuilder, not only if the property is neither abstract nor external.
17101         This is necessary to set the MethodImplOptions on the accessor methods.
17102         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17103         SetBuilder, see Property.Emit().
17104
17105         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17106         populate "System.Object", "System.ValueType" and "System.Attribute" since
17107         they've already been populated from BootCorlib_PopulateCoreTypes().
17108
17109 2002-06-29  Martin Baulig  <martin@gnome.org>
17110
17111         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17112         is the NullLiteral, we also need to make sure that target_type is not
17113         an enum type.   
17114
17115 2002-06-29  Martin Baulig  <martin@gnome.org>
17116
17117         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17118         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17119         before calling BootstrapCorlib_ResolveDelegate ().
17120
17121 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17122
17123         * statement.cs: fixed build-breaker. All tests passed ok.
17124
17125 2002-06-27  Martin Baulig  <martin@gnome.org>
17126
17127         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17128         for System.Decimal when compiling corlib.
17129
17130 2002-06-27  Martin Baulig  <martin@gnome.org>
17131
17132         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17133         switch blocks which contain nothing but a default clause.
17134
17135 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17136
17137        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17138
17139 2002-06-27  Martin Baulig  <martin@gnome.org>
17140
17141         * ecore.cs (PropertyExpr.PropertyExpr): Call
17142         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17143
17144         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17145         is already a TypeBuilder.
17146
17147 2002-06-27  Martin Baulig  <martin@gnome.org>
17148
17149         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17150         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17151         the "from an array-type to System.Array" case.  This makes it work
17152         when compiling corlib.
17153
17154 2002-06-27  Martin Baulig  <martin@gnome.org>
17155
17156         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17157         non-static PropertyExpr, set its InstanceExpression.  This makes
17158         the `ICollection.Count' property work in System/Array.cs.
17159
17160 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17161
17162         * driver.cs: Made error handling more consistent.  Errors now
17163         tracked by Report class, so many methods which used to return int
17164         now return void.  Main() now prints success/failure and 
17165         errors/warnings message.
17166
17167         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17168         the magic number return values (123 and 124).  Now, if the
17169         expected error occurs, the compiler exits with success (exit value
17170         0).  If the compilation completes without seeing that particular
17171         error, the compiler exits with failure (exit value 1).  The
17172         makefile in mcs/errors has been changed to handle the new behaviour.
17173
17174         * report.cs: Made 'expected error' number a property and renamed
17175         it from 'Probe' to 'ExpectedError'.
17176
17177         * genericparser.cs: Removed error handling support, since it is
17178         now all done by Report class.
17179
17180         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17181         class, so parse() no longer returns an int.
17182
17183         * namespace.cs: Use Report.Error instead of GenericParser.error
17184
17185 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17186
17187         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17188         TypeContainer.AddOperator): At the front of the list put the
17189         explicit implementations, so they get resolved/defined first. 
17190
17191 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17192
17193         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17194         interface type is implemented by this TypeContainer.  Used during
17195         explicit interface implementation.
17196
17197         (Property.Define, Indexer.Define, Method.Define): Validate that
17198         the given interface in the explicit implementation is one of the
17199         base classes for the containing type.
17200
17201         Also if we are explicitly implementing an interface, but there is
17202         no match in the pending implementation table, report an error.
17203
17204         (Property.Define): Only define the property if we are
17205         not explicitly implementing a property from an interface.  Use the
17206         correct name also for those properties (the same CSC uses,
17207         although that is really not needed).
17208
17209         (Property.Emit): Do not emit attributes for explicitly implemented
17210         properties, as there is no TypeBuilder.
17211
17212         (Indexer.Emit): ditto.
17213
17214         Hiding then means that we do not really *implement* a pending
17215         implementation, which makes code fail.
17216
17217 2002-06-22  Martin Baulig  <martin@gnome.org>
17218
17219         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17220         the return value of Object.GetType().  [FIXME: we need to do this whenever
17221         we get a type back from the reflection library].
17222
17223 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17224
17225         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17226
17227 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17228
17229         * attribute.cs: Return null if we can not look up the type.
17230
17231         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17232         the interface types found.
17233
17234         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17235         interface types found.
17236
17237         * typemanager.cs (GetInterfaces): Make this routine returns alll
17238         the interfaces and work around the lame differences between
17239         System.Type and System.Reflection.Emit.TypeBuilder in the results
17240         result for GetInterfaces.
17241
17242         (ExpandInterfaces): Given an array of interface types, expand and
17243         eliminate repeated ocurrences of an interface.  This expands in
17244         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17245         be IA, IB, IC.
17246
17247 2002-06-21  Martin Baulig  <martin@gnome.org>
17248
17249         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17250         on System.Enum.
17251
17252 2002-06-21  Martin Baulig  <martin@gnome.org>
17253
17254         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17255         and called with one of the core types, return the corresponding typebuilder for
17256         that type.
17257
17258         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17259         element type.
17260
17261 2002-06-21  Martin Baulig  <martin@gnome.org>
17262
17263         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17264         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17265         (Expression.ConvertReferenceExplicit): Likewise.
17266
17267         * expression.cs (ElementAccess.DoResolve): Likewise.
17268         (ElementAccess.DoResolveLValue): Likewise.
17269
17270 2002-06-10  Martin Baulig  <martin@gnome.org>
17271
17272         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17273         add the "value" parameter to the parameter list.
17274
17275         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17276         to our caller.
17277
17278 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17279
17280         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17281         the argument to an int, uint, long or ulong, per the spec.  Also
17282         catch negative constants in array creation.
17283
17284 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17285
17286         * class.cs: do not allow the same interface to appear twice in
17287         the definition list.
17288
17289 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17290
17291         * ecore.cs: don't use ldlen with System.Array.
17292
17293 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17294
17295         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17296
17297 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17298
17299         * modifiers.cs: produce correct field attributes for protected
17300         internal. Easy fix so miguel can work on ther harder stuff:-)
17301
17302 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17303
17304         * pending.cs: New file.  Move the code from class.cs here.
17305         Support clearning the pending flag for all methods (when not doing
17306         explicit interface implementation).
17307
17308 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17309
17310         * rootcontext.cs: added a couple more types needed to bootstrap.
17311
17312 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17313
17314         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17315         constructor in the type, instead of any constructor in the type
17316         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17317         a bug in the Mono runtime when applying the params attribute). 
17318
17319 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17320         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17321
17322 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17323
17324         * expression.cs (Unary.ResolveOperator): Use TypeManager
17325         to resolve the type.
17326
17327 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17328
17329         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17330         attached.
17331
17332         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17333         with each member too.
17334
17335         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17336         field builders too - this takes care of the enum member case.
17337
17338 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17339
17340         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17341         address-of operator on both value types and pointers.
17342
17343 2002-06-10  Martin Baulig  <martin@gnome.org>
17344
17345         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17346         PropertyBuilder to the `property_builders' list.
17347
17348         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17349         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17350         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17351         find any indexers which are inherited from an interface.
17352
17353 2002-06-09  Martin Baulig  <martin@gnome.org>
17354
17355         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17356         the same type as the constant if necessary.  There's also a test-130.cs
17357         for this.
17358
17359         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17360
17361         * typemanager.cs (TypeManager.ChangeType): Previously known as
17362         Enum.ChangeEnumType().
17363
17364 2002-06-09  Martin Baulig  <martin@gnome.org>
17365
17366         * expression.cs (Cast.TryReduce): Added support for consts.
17367
17368 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17369
17370         * class.cs (Accessor): Hold attributes information so we can pass
17371         it along.
17372
17373         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17374         Modify to pass in attributes attached to the methods.
17375
17376         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17377
17378         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17379         to handle the Accessor kind :-)
17380
17381         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17382
17383 2002-06-08  Martin Baulig  <martin@gnome.org>
17384
17385         * expression.cs (Unary.TryReduceNegative): Added support for
17386         ULongConstants.
17387
17388 2002-06-08  Martin Baulig  <martin@gnome.org>
17389
17390         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17391         name can't be found in the `defined_names' - the caller will do a
17392         MemberLookup in this case and thus find methods in System.Enum
17393         such as Enum.IsDefined().
17394
17395 2002-06-08  Martin Baulig  <martin@gnome.org>
17396
17397         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17398         Convert.ChangeType() which works with TypeBuilder created types.
17399         (Enum.LookupEnumValue, Enum.Define): Use it here.
17400
17401         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17402         `TypeBuilder.BaseType != null' check.
17403         (TypeContainer.FindMembers): Only lookup parent members if we
17404         actually have a parent.
17405         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17406         (ConstructorInitializer.Resolve): Likewise.
17407
17408         * interface.cs (Interface.FindMembers): Added
17409         `TypeBuilder.BaseType != null' check.
17410
17411         * rootcontext.cs (RootContext.ResolveCore): Added
17412         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17413         classes_second_stage.
17414
17415         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17416         debug_type and trace_type when compiling with --nostdlib.       
17417
17418 2002-06-07  Martin Baulig  <martin@gnome.org>
17419
17420         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17421         (AddField): Set it to true when adding a non-static field.
17422         (DefineType): Use `have_nonstatic_fields' to find out whether we
17423         have non-static fields, not `Fields != null'.
17424
17425 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17426
17427         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17428         dereferencing a null on the static-field code path)
17429
17430 2002-05-30  Martin Baulig  <martin@gnome.org>
17431
17432         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17433         to take command line arguments.  Use reflection to call the new
17434         custom `Initialize' function on the symbol writer and pass it the
17435         command line arguments.
17436
17437         * driver.cs (--debug-args): New command line argument to pass command
17438         line arguments to the symbol writer.
17439
17440 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17441
17442         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17443         the target type for indexers and properties.  Thanks to Joe for
17444         catching this.
17445
17446 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17447
17448         * typemanager.cs (MethodFlags): returns the method flags
17449         (Obsolete/ShouldIgnore) that control warning emission and whether
17450         the invocation should be made, or ignored. 
17451
17452         * expression.cs (Invocation.Emit): Remove previous hack, we should
17453         not do this on matching a base type, we should do this based on an attribute
17454
17455         Only emit calls to System.Diagnostics.Debug and
17456         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17457         on the command line.
17458
17459         * rootcontext.cs: Global settings for tracing and debugging.
17460
17461         * cs-tokenizer.cs (define): New utility function to track
17462         defines.   Set the global settings for TRACE and DEBUG if found.
17463
17464 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17465
17466         * interface.cs (Populate*): Pass in the TypeContainer as well as
17467         the DeclSpace as parameters so that we can create EmitContexts and
17468         then use that to apply attributes etc.
17469
17470         (PopulateMethod, PopulateEvent, PopulateProperty)
17471         (PopulateIndexer): Apply attributes everywhere.
17472
17473         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17474         etc.
17475
17476         (ApplyAttributes): Update accordingly.
17477
17478         We now apply interface attributes for all members too.
17479
17480 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17481
17482         * class.cs (Indexer.Define); Correctly check if we are explicit
17483         implementation (instead of checking the Name for a ".", we
17484         directly look up if the InterfaceType was specified).
17485
17486         Delay the creation of the PropertyBuilder.
17487
17488         Only create the PropertyBuilder if we are not an explicit
17489         interface implementation.   This means that explicit interface
17490         implementation members do not participate in regular function
17491         lookups, and hence fixes another major ambiguity problem in
17492         overload resolution (that was the visible effect).
17493
17494         (DefineMethod): Return whether we are doing an interface
17495         implementation. 
17496
17497         * typemanager.cs: Temporary hack until we get attributes in
17498         interfaces (Ravi is working on that) and we get IndexerName
17499         support in interfaces.
17500
17501         * interface.cs: Register the indexers as properties.
17502
17503         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17504         warning, I have verified that this is a bug in the .NET runtime
17505         (JavaScript suffers of the same problem).
17506
17507         * typemanager.cs (MemberLookup): When looking up members for
17508         interfaces, the parent of an interface is the implicit
17509         System.Object (so we succeed in searches of Object methods in an
17510         interface method invocation.  Example:  IEnumerable x;  x.ToString
17511         ()) 
17512
17513 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17514
17515         * class.cs (Event): Events should also register if they do
17516         implement the methods that an interface requires.
17517
17518         * typemanager.cs (MemberLookup); use the new GetInterfaces
17519         method. 
17520
17521         (GetInterfaces): The code used to lookup interfaces for a type is
17522         used in more than one place, factor it here. 
17523
17524         * driver.cs: Track the errors at the bottom of the file, we kept
17525         on going.
17526
17527         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17528         instance if the method we are calling is static!
17529
17530 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17531
17532         * attribute.cs (ApplyAttributes): Make this function filter out
17533         the IndexerName attribute (as that attribute in reality is never
17534         applied) and return the string constant for the IndexerName
17535         attribute. 
17536
17537         * class.cs (TypeContainer.Emit): Validate that all the indexers
17538         have the same IndexerName attribute, and if so, set the
17539         DefaultName attribute on the class. 
17540
17541         * typemanager.cs: The return value might contain other stuff (not
17542         only methods).  For instance, consider a method with an "Item"
17543         property and an Item method.
17544
17545         * class.cs: If there is a problem with the parameter types,
17546         return. 
17547
17548 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17549
17550         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17551         looks at user defined conversion after making a call to 
17552         StandardConversionExists - we need this for overload resolution.
17553
17554         * expression.cs : Update accordingly the various method calls.
17555
17556         This fixes 2 bugs filed against implicit user defined conversions 
17557
17558 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17559
17560         * statement.cs: Track the result of the assignment.
17561
17562 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17563
17564         * expression.cs (MemberAccess): Improved error reporting for
17565         inaccessible members.
17566
17567 2002-05-22  Martin Baulig  <martin@gnome.org>
17568
17569         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17570         itself with debugging support.
17571
17572 2002-05-22  Martin Baulig  <martin@gnome.org>
17573
17574         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17575         Removed, this isn't needed anymore.
17576
17577 2002-05-20  Martin Baulig  <martin@gnome.org>
17578
17579         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17580         be underlying type for an enum.
17581
17582 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17583
17584         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17585         that splits out the loading of just the core types.
17586
17587         * rootcontext.cs (ResolveCore): Split the struct resolution in
17588         two, so we can load the enumeration underlying types before any
17589         enums are used.
17590
17591         * expression.cs (Is): Bandaid until we fix properly Switch (see
17592         bug #24985 for details).
17593
17594         * typemanager.cs (ImplementsInterface): The hashtable will contain
17595         a null if there are no interfaces implemented.
17596
17597 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17598
17599         * cs-parser.jay (indexer_declarator): It is fine to have array
17600         parameters
17601
17602 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17603
17604         * typemanager.cs: (RegisterBuilder): New function used to register
17605         TypeBuilders that implement interfaces.  Since
17606         TypeBuilder.GetInterfaces (as usual) does not work with lame
17607         Reflection.Emit. 
17608         (AddUserType): register interfaces.
17609
17610         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17611         dealing with TypeBuilder.  Also, arrays are showing up as
17612         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17613         methods can not be invoked on them!
17614
17615         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17616         (ImplicitReferenceConversionExists): Split out from
17617         StandardConversionExists. 
17618
17619         * expression.cs (As): We were only implementing one of the three
17620         cases for the as operator.  We now implement them all.
17621         (Is): Implement the various other cases for Is as well.
17622
17623         * typemanager.cs (CACHE): New define used to control if we want or
17624         not the FindMembers cache.  Seems to have a negative impact on
17625         performance currently
17626
17627         (MemberLookup): Nested types have full acess to
17628         enclosing type members
17629
17630         Remove code that coped with instance/static returns for events, we
17631         now catch this in RealFindMembers.
17632
17633         (RealFindMembers): only perform static lookup if the instance
17634         lookup did not return a type or an event.  
17635
17636 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17637
17638         * assign.cs (CompoundAssign): We pass more semantic information
17639         now to Compound Assignments than we did before: now we have all
17640         the information at hand, and now we resolve the target *before* we
17641         do the expression expansion, which allows the "CacheValue" method
17642         to have the effect we intended (before, a [x] += 1 would generate
17643         two differen ArrayAccess expressions from the ElementAccess,
17644         during the resolution process).
17645
17646         (CompoundAssign.DoResolve): Resolve target and original_source here.
17647
17648 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
17649
17650         * expression.cs (ArrayAccess): dropped debugging information. 
17651
17652         * typemanager.cs: Small bug fix: I was always returning i_members,
17653         instead of one of i_members or s_members (depending on which had
17654         the content).
17655
17656         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
17657         method is invoked before any code generation takes place, and it
17658         is a mechanism to inform that the expression will be invoked more
17659         than once, and that the method should use temporary values to
17660         avoid having side effects
17661
17662         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17663
17664         * ecore.cs (Expression.CacheTemporaries): Provide empty default
17665         implementation.
17666
17667         * expression.cs (Indirection, ArrayAccess): Add support for
17668         CacheTemporaries in these two bad boys. 
17669
17670         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17671         ldobj or ldind_ref.  
17672         (StoreFromPtr): Handle stobj as well.
17673
17674         * expression.cs (UnaryMutator): Share more code.
17675
17676         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17677         down: I was not tracking the Filter function as well, which
17678         was affecting the results of the cache.
17679
17680 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
17681
17682         * attribute.cs: Remove the hack to handle the CharSet property on
17683         StructLayouts. 
17684
17685 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17686
17687         * attribute.cs (DoResolve): More uglyness, we now only try to
17688         resolve the attribute partially, to extract the CharSet
17689         information (only if we are a StructLayout attribute).  Otherwise 
17690
17691         (GetExtraTypeInfo): Add some code to conditionally kill in the
17692         future this.   I am more and more convinced that the .NET
17693         framework has special code to handle the attribute setting on
17694         certain elements.
17695
17696         * expression.cs (IsParamsMethodApplicable): Revert my previous
17697         foreach change here, it was wrong.
17698
17699 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17700
17701         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17702         (pp_expr): do not abort on unknown input, just return.
17703         (eval): abort if there are pending chars.
17704
17705         * attribute.cs (Attribute.Resolve): Positional parameters are
17706         optional.  Deal with that case.
17707
17708         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17709         the Ansi/Unicode/Auto information for the type.
17710
17711         (TypeContainer.DefineType): instantiate the EmitContext here, as
17712         we will be using it during the type definition (to resolve
17713         attributes) and during the emit phase.
17714
17715         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17716         to pull type information out of the attributes
17717
17718         (Attribute.Resolve): track the constructor builder, and allow for
17719         multiple invocations (structs and classes will use this).
17720
17721         * ecore.cs (MemberLookupFinal): new version with all the
17722         parameters customizable.
17723
17724         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17725         constructors.  Return if the result value is null (as the error
17726         would have been flagged already by MemberLookupFinal)
17727
17728         Do not allow instances of abstract classes or interfaces to be
17729         created.
17730
17731         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17732         We have to compare the assembly property here when dealing with
17733         FamANDAssem and Assembly access modifiers, because we might be
17734         creating an assembly from *modules* (that means that we are not
17735         getting TypeBuilders for types defined in other modules that are
17736         part of this assembly).
17737
17738         (Method.Emit): If the method is marked abstract and has a body,
17739         emit an error. 
17740
17741         (TypeContainer.DefineMembers): If both the defined member and the
17742         parent name match are methods, then do not emit any warnings: let
17743         the Method.Define routine take care of flagging warnings.  But if
17744         there is a mismatch (method overrides something else, or method is
17745         overriwritten by something, then emit warning).
17746
17747         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17748         set to null, this means `do not check for the return type on the
17749         signature'. 
17750
17751         (Method.Define): set the return type for the method signature to
17752         null, so that we get methods with the same name and parameters and
17753         different return types.  This is used to flag warning 114 (you are
17754         hiding a method, and you probably want to use the new/override
17755         keywords instead).
17756
17757         * typemanager.cs (MemberLookup): Implemented proper access
17758         control, closing a long standing set of bug reports.  The problem
17759         was that the Framework only has two bits: Public and NonPublic,
17760         and NonPublic includes private and protected methods, but we need
17761         to enforce the FamANDAssem, FamOrAssem and Family. 
17762
17763 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17764
17765         * statement.cs (GotoCase): Return true: Ammounts to giving up
17766         knowledge on whether we return or not, and letting the other case
17767         be responsible for it.
17768
17769 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17770
17771         * driver.cs: Do not load directories for each file processed, only
17772         do it if there is a pattern.
17773
17774         * ecore.cs: Report readonly assigns here as well, as we might have
17775         been resolved only by MemberAccess.
17776
17777         (SimpleName.SimpleNameResolve): Also be useful for LValue
17778         resolution.   We need this to propagate assign to local readonly variables
17779
17780         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17781         do not want to reuse potential criteria memory.
17782
17783         * class.cs (MyEventBuilder): Set reflected_type;
17784
17785         * ecore.cs (Constantify): Added support for constifying bools.
17786
17787         (RootContext.LookupType): Added a cache for values looked up in
17788         the declaration space.
17789
17790         * typemanager.cs (FindMembers): Now is a front-end to
17791         RealFindMembers, and provides a two-level hashtable-based cache to
17792         the request.  
17793
17794         15% performance improvement: from 22.5 to 19.2 seconds.
17795
17796         * expression.cs (IsParamsMethodApplicable): use foreach.
17797         (Invocation.DoResolve): ditto.
17798         (New.DoResolve): ditto.
17799         (ArrayCreation.DoResolve): ditto.
17800
17801         * ecore.cs (FindMostEncompassingType): use foreach.
17802
17803         * delegate.cs (NewDelegate.DoResolve): Use foreach
17804
17805         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17806         (RemoveMethods): use foreach.
17807
17808         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17809         nested foreach statements instead of for, and also break out of
17810         the inner loop once a match is found.
17811
17812         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17813
17814 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17815
17816         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17817         we actually unwrap the expression to allow for extra information
17818         to be extracted. 
17819
17820         * expression.cs: Use Shr_Un on unsigned operations. 
17821
17822 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17823
17824         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17825         applicable operators was not being considered correctly. This closes
17826         the bug Miguel reported.
17827
17828 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17829
17830         * attribute.cs: check that the type derives from System.Attribute
17831         and report the correct error in that case (moved the duplicate code to
17832         its own method, too).
17833
17834 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17835
17836         * attribute.cs: lookup attribute type name as the spec says: first the
17837         bare attribute name and then name + "Attribute" (nant compiles with
17838         mcs after this fix).
17839
17840 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17841
17842         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17843         Because of the way we parse things, we should try to see if a
17844         UIntConstant can fit in an integer.
17845
17846 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17847
17848         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17849         when we are in an explicit context.
17850
17851         (ConvertReferenceExplicit): When converting from Iface type S to Class
17852         T make sure the rules are implemented as an OR.
17853
17854         * parameter.cs (ParameterType): Make it a property for now although the
17855         purpose really isn't anything immediate.
17856
17857         * expression.cs (Is*Applicable): Do better checking on the parameter type
17858         of a ref/out parameter. The ones from the system assemblies are already 
17859         marked with the correct type so we don't need to do any correction.
17860
17861         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17862         the object type is standard too so include that.
17863
17864 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17865
17866         * ecore.cs (StandardConversionExists): Augment with missing code:
17867         deal with IntConstant, LongConstants and Enumerations.
17868
17869         * assign.cs: Report the error, instead of failing silently
17870
17871         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17872         typecontainer that they are declared, because the
17873         typecontainer/namespace will have the list of using clauses that
17874         need to be applied.
17875
17876         Assembly Attributes were escaping the normal registration
17877         mechanism. 
17878
17879         (EmitCode): Apply attributes within an EmitContext that represents
17880         the container they were declared on.
17881
17882         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17883
17884 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17885
17886         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17887         Revamp completely - make much cleaner as we now operate only
17888         on a set of Types.
17889
17890         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17891         to implement the logic detailed in the spec more correctly.
17892
17893         (UserDefinedConversion): Update accordingly.
17894
17895 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17896
17897         * statement.cs: Return flow analysis information up.
17898
17899         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17900         and the default.
17901
17902         (token): Do not consume an extra character before calling
17903         decimal_digits.
17904
17905 2002-05-06  Piers Haken <piersh@friskit.com>
17906
17907         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17908
17909 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17910
17911         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17912         EmitContext during the instance constructor initializer
17913         resolution, to stop access to instance variables.
17914
17915         This is mandated by the spec, last paragraph of the `constructor
17916         initializers' section. 
17917
17918 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17919
17920         * cs-parser.jay, class.cs (Accessor): new class used to represent
17921         an accessor (get or set).  In the past we used `null' to represent
17922         a missing accessor.  But this is ambiguous because there was no
17923         way to tell in abstract indexers/properties if one of them was
17924         specified.
17925
17926         Now there is a way of addressing that.
17927
17928         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17929         instead of FindMembers.
17930
17931         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17932         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17933
17934         * attribute.cs: Treat indexers and properties as the same in terms
17935         of applying attributes
17936
17937         * ecore.cs (FindMostEncompassedType): Use statically initialized
17938         EmptyExpressions()s like we do elsewhere to avoid creating useless
17939         objects (and we take this out of the tight loop).
17940
17941         (GetConversionOperators): Move the code to extract the actual
17942         operators to a separate routine to clean things up.
17943
17944 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17945
17946         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17947         events are always registered FieldBuilders.
17948
17949         * class.cs (FieldBase): New class shared by Fields 
17950
17951         * delegate.cs: If we are a toplevel delegate, use our full name.
17952         If we are a nested delegate, then only use our tail name.
17953
17954 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17955
17956         * expression.cs (IsApplicable): Ensure that we add the "&" to
17957         ref/out types before comparing it with the type of the argument.
17958
17959         (IsParamsMethodApplicable): Ditto.
17960
17961         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17962         silly me ;-)
17963
17964         * delegate.cs : Handle the case when we have more than one applicable
17965         method. Flag an error only when we finish checking all.
17966
17967 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17968
17969         * expression.cs: Add support for boolean static initializers.
17970
17971 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17972
17973         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17974
17975         * parameter.cs (ComputeParameterTypes,
17976         ComputeAndDefineParameterTypes): Better error handling: now we
17977         clear the `types' cache if we fail during any of the type lookups.
17978         We also return the status code correctly to our caller
17979
17980         * delegate.cs: If we fail to define a delegate, abort the extra
17981         steps. 
17982
17983         * expression.cs (Binary.ResolveOperator): for
17984         operator==(object,object) and operator !=(object, object) we also
17985         have to verify that there is an implicit conversion from one to
17986         the other.
17987
17988         (ArrayAccess.DoResolve): Array Access can operate on
17989         non-variables. 
17990
17991 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17992
17993         * assign.cs (CompoundAssign): A new class used as a "flag" that
17994         the assignment actually is happening as part of a compound
17995         assignment operator.
17996
17997         During compound assignment, a few new rules exist to enable things
17998         like:
17999
18000         byte b |= 1 + 2
18001
18002         From the spec:
18003
18004         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18005         to the type of x) if y is implicitly convertible to the type of x,
18006         and the operator is a builtin operator and the return type of the
18007         operator is explicitly convertible to the type of x. 
18008
18009         * rootcontext.cs: Reset warning level to 2.  4 catches various
18010         "interesting" features in mcs, we must clean this up at some
18011         point, but currently am trying to kill other bugs ;-)
18012
18013         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18014         in container classes as well.  
18015
18016         * expression.cs (Binary.ResolveOperator): Handle string case
18017         before anything else (as operator overloading does emit an error
18018         before doing anything else).
18019
18020         This code could go away when we move to a table driven model, but
18021         i could not come up with a good plan last night.
18022
18023 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18024
18025         * typemanager.cs (CSharpName): reimplementation using regex.
18026         * class.cs: added null check for fields in Emit
18027         * rootcontext.cs: set warninglevel to 4
18028
18029 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18030
18031         * typemanager.cs (CSharpName): reimplemented with Lupus
18032         suggestion.
18033
18034 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18035
18036         * statement.cs (If): correclty implement Resolve, because we were
18037         not catching sem errors in there.  The same process is needed
18038         everywhere else. 
18039         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18040
18041
18042         (Statement.Warning_DeadCodeFound): Factorize code.
18043         (While): Report dead code here too.
18044
18045         (Statement): Added Resolve virtual method to allow
18046         for resolution split from the emit code.
18047
18048 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18049
18050         * statement.cs (EmitBoolExpression): No longer try to resolve the
18051         expression here.    
18052         (MakeBoolean): New utility function that resolve, implicitly
18053         converts to boolean and tags the expression. 
18054
18055
18056         (If, Do): Implement dead code elimination.
18057         (While): Implement loop inversion
18058
18059         (Do, While, For, If): Resolve the expression prior to calling our
18060         code generation.
18061
18062 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18063
18064         * class.cs:
18065           - added method Report28 (warning: program has more than one entry point)
18066           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18067           - modified method Method.Define, the part at the end of the method
18068
18069         * rootcontext.cs: added static public Location EntryPointLocation;
18070           
18071         * ../errors/cs0028.cs : Add test case for the above warning.              
18072
18073         * typemanager.cs:
18074           - modified method CSharpName to allow arrays of primitive type to
18075             be printed nicely (e.g. instead of System.Int32[][] it now prints
18076             int[][])
18077           - added method CSharpSignature: returns the signature of a method
18078             in string format to be used in reporting errors, warnings, etc.
18079
18080         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18081         with String.Empty.
18082
18083 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18084
18085         * delegate.cs (Define): Fix extremely silly bug where I was
18086         setting the type of the 'object' parameter of the BeginInvoke
18087         method to System.IAsyncResult instead of System.Object ;-)
18088
18089 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18090
18091         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18092         here. 
18093
18094         (Constructor.Emit): return if we fail to initialize the
18095         constructor.  Another door closed!  
18096
18097         * expression.cs (New.DoResolve): Improve error message (from -6 to
18098         1501).  Use DeclaredOnly lookup to find the exact constructor.
18099
18100         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18101         loop.  This is useful.
18102
18103         * cs-parser.jay: Adjust the default parameters so that destructors
18104         have the proper signature.
18105
18106 2002-04-26  Martin Baulig  <martin@gnome.org>
18107
18108         * driver.cs (LoadAssembly): If `assembly' contains any characters
18109         which are only valid in path names and not in assembly names
18110         (currently slash, backslash and point), use Assembly.LoadFrom ()
18111         instead of Assembly.Load () on the `assembly' (before iteration
18112         over the link_paths).
18113
18114 2002-04-26  Martin Baulig  <martin@gnome.org>
18115
18116         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18117
18118 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18119
18120         * class.cs (Property): use the new typemanager.MemberLookup
18121
18122         (TypeContainer.MemberLookup): Implement using the
18123         TypeManager.MemberLookup now. 
18124
18125         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18126         and return MemberInfos, so that these can be used without an
18127         EmitContext (what we had before).
18128
18129 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18130
18131         * expression.cs: Fix the case where the argument to params if the
18132         type of the params.  I omitted handling this before.   Fixed
18133
18134 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18135
18136         * driver.cs: Call BootCorlib_PopulateCoreType
18137
18138         * class.cs (Property.CheckBase): Check for properties only, not
18139         for all members. 
18140
18141         * interface.cs: Temporary hack: try/catch around the
18142         CustomAttributeBuilder, because I am getting an exception that I
18143         do not understand.
18144
18145         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18146         types whose definitions are required to be there (attributes are
18147         defined before standard types).
18148
18149         Compute definitions as we boot the various types, as they are used
18150         immediately (value_type class will need object_type, but if we do
18151         not initialize object_type, we will pass a null, which will let
18152         the runtime pick the System.Object from the existing corlib, which
18153         is not what we want).
18154
18155 2002-04-22  Patrik Torstensson <totte@labs2.com>
18156
18157         * cs-tokenizer.cs: fixed a number of trim() issues.
18158
18159 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18160
18161         * expression.cs (Argument.Type): Ensure that we return the correct
18162         type when we have out or ref parameters [in which case we 
18163         append a "&"].
18164
18165 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18166
18167         * class.cs (Property, Indexer): Allow extern modifier in there. 
18168
18169         * typemanager.cs (InitBaseTypes): Initializes object_type and
18170         value_type, since those will be used early on during the bootstrap
18171         process to compile corlib.
18172
18173         (InitCoreTypes): Move code from here to InitBaseTypes.
18174
18175 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18176
18177         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18178         single-dimension arrays as using the ldlen opcode.  
18179
18180         Daniel Lewis discovered this optimization.  
18181
18182         * typemanager.cs: Add signature for System.Array::get_Length
18183
18184 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18185
18186         * statement.cs: report the error when the foreach does not apply to an
18187         array nor a collection.
18188
18189 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18190
18191         * expression.cs: Add implicit conversions to the operator ~.
18192
18193         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18194
18195         * typemanager.cs: Locate the decimal constructor.
18196
18197 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18198
18199         * attribute.cs: use the new property of TypeOf.
18200         * expression.cs: added 'get' property around typearg.
18201
18202         These changes fix a build breaker reported by NickD. Is this the
18203         correct way to fix?  If not, please, revert my changes and make it
18204         work :-).
18205
18206 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18207
18208         * attribute.cs: Add support for typeof in attribute invocations.
18209         I am not sure that this is right though.
18210
18211 2002-04-14  Duncan Mak  <duncan@ximian.com>
18212
18213         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18214         Binary.Operator.Division case.
18215
18216 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18217
18218         * class.cs (DefineType): Ensure that we do a proper check on
18219         attribute types and also register it with the TypeManager.
18220
18221         (TypeContainer.Targets): The default for attribute types is
18222         AttributeTargets.All.
18223
18224         * attribute.cs (ApplyAttributes): Registering the attribute type
18225         is done elsewhere, not when we discover we have a Usage attribute.
18226
18227 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18228
18229         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18230         and get rid of is_delegate parameter.
18231
18232         * everywhere : update.
18233
18234 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18235
18236         * cs-parser.jay (compilation_unit): Revamp completely to use
18237         some new ideas that I got from Rhys' grammar to solve the problems
18238         with assembly level attributes.
18239
18240         (outer_declaration): New grammar production.
18241
18242         (attribute_sections): Add.
18243
18244         (opt_attributes): Base on attribute_sections
18245
18246         (namespace_declaration): Allow opt_attributes to tackle the case
18247         when we have assembly level attributes - we are clever in this
18248         regard now ;-)
18249
18250         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18251         attributes in the non-global context.
18252
18253         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18254         instead of SetGlobalAttributes.
18255
18256         * class.cs, rootcontext.cs : Ensure we define and generate 
18257         attribute types before anything else.
18258
18259         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18260         and flag the new error -20 for the case when the attribute type
18261         does not have valid targets specified. csc does not catch this.
18262
18263         * ../errors/errors.txt : update for error # -20
18264
18265 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18266
18267         * support.cs (InternalParameters.ParameterModifier): Do some null
18268         checking and return sane values.
18269
18270         * class.cs (Method.Define): If we are a PInvoke method, ensure
18271         that we are static and extern. Report error # 601
18272
18273         * ../errors/cs0601.cs : Add test case for the above error.
18274
18275 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18276
18277         * rootcontext.cs (attribute_types): We need to keep type of
18278         all attribute types separately and emit code for them first.
18279
18280         (RegisterAttribute) : Implement.
18281
18282         * class.cs (DefineType): Check if the current Type is a custom
18283         attribute type and register it accordingly.
18284
18285         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18286         adding the first attribute twice and rename to
18287
18288         (SetGlobalAttributes): this.
18289
18290         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18291         lookups.
18292
18293         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18294         if we are processing global arguments. Hmm, I am unsure of this.
18295
18296 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18297
18298         * expression.cs: added static array of strings to avoid calling
18299         Enum.ToString () for Operator in Binary. Significant recover of
18300         performance.
18301
18302 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18303
18304         * class.cs (FindMembers): Allow the Builders of the various
18305         members to be null.  If they are skip them.  This only happens
18306         during the PInvoke declaration.
18307
18308 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18309
18310         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18311         failure, so we do not keep going afterwards.
18312
18313         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18314         wanted to pass `false' as the `is_delegate' argument.  If this is
18315         the case, why not use delegate_type == null to mean `is_delegate =
18316         false' and anything else as is_delegate = true.
18317
18318 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18319
18320         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18321         code for the section, not the beginning of the tests.
18322
18323 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18324
18325         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18326
18327         * expression.cs (Binary): same.  Warn about errors where we have
18328         Enum/Enum in operator + as well.
18329
18330 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18331
18332         * statement.cs:
18333                 - added support for switch(bool)
18334                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18335                 - add TableSwitchEmit() to handle table-based switch statements
18336
18337 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18338
18339         * expression.cs (Invocation.OverloadResolve): Factor out code which
18340         does parameter compatibility checking with arguments so that we can 
18341         re-use the code even from Delegate.VerifyApplicability
18342
18343         (VerifyArgumentsCompat): Move above code here.
18344
18345         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18346         and instead make a call to the above method.
18347
18348 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18349
18350         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18351         We use it to keep track of classes which are attribute types.
18352
18353 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18354
18355         * delegate.cs (Delegate.Define): Correctly define the types in the
18356         presence of fixed and array parameters.
18357
18358         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18359         doing FindMembers.
18360
18361         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18362         include NonPublic after the first iteration.
18363
18364         * class.cs (Indexer.CheckBase): Only check if both parents are
18365         non-null. 
18366
18367         * cs-parser.jay (accessor_body): If empty, set to null.
18368
18369         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18370         same code path here to resolve constants names that we did have in
18371         MemberAccess.DoResolve.  There is too much code duplicated here.
18372
18373 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18374
18375         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18376
18377         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18378         to MakeUnionSet.
18379
18380         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18381         tokens, numbers and strings.
18382
18383         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18384         parenthesis.
18385
18386         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18387         asyncronous parameters and the regular parameters.  
18388
18389         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18390         specify the target directory.
18391
18392         * expression.cs: (This.DoResolve): Simplify
18393         (As.Emit): Optimize, do not generate IsInst if the expression is
18394         always of the given type.
18395
18396         (Is.DoResolve): Bug fix, we were reporting both always/never for
18397         the is expression.
18398
18399         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18400         creating too many unnecessary arrays.
18401
18402 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18403
18404         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18405         fields instead of rolling our own initializer.   Takes care of all
18406         implicit conversions, and drops unnecessary static checks/argument.
18407
18408 2002-03-31  Dick Porter  <dick@ximian.com>
18409
18410         * driver.cs: use the GetDirectories() return values properly, and
18411         use "/" as path separator.
18412
18413 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18414
18415         * expression.cs (Unary): Optimize - - expr into expr.
18416         (Binary): Optimize a + (-b) into a -b.
18417
18418         * codegen.cs (CodeGen): Made all methods static.
18419
18420 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18421
18422         * rootcontext.cs: 
18423
18424         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18425         TypeBuilder property.
18426
18427         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18428         instead. 
18429
18430         * tree.cs: Removed the various RecordXXXX, and replaced with a
18431         single RecordDecl.  Removed all the accessor methods, and just
18432         left a single access point Type 
18433
18434         * enum.cs: Rename DefineEnum to DefineType.
18435
18436         * decl.cs: New abstract method `DefineType' used to unify the
18437         Defines for Enumerations, Interfaces, TypeContainers and
18438         Delegates.
18439
18440         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18441         LookupBaseClasses method that used to live in class.cs and
18442         interface.cs here, and renamed to FindType.
18443
18444         * delegate.cs: Implement DefineType.  Take advantage of the
18445         refactored pattern for locating the parent builder without taking
18446         the parent_builder argument (which we know does not work if we are
18447         nested, and triggering a toplevel definition).
18448
18449 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18450
18451         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18452         accessibility of a member has changed during override and report
18453         an error if so.
18454
18455         * class.cs (Method.Define, Property.Define): Only complain on
18456         overrides if the method is private, any other accessibility is
18457         fine (and since we just checked the permission is the same, we are
18458         good to go).
18459
18460         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18461         and elif are processed always.  The other pre-processing
18462         directives are only processed if we are "taking" the path
18463
18464 2002-03-29  Martin Baulig  <martin@gnome.org>
18465
18466         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18467         current location is not Null.
18468
18469         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18470         a separate method so we can profile it.
18471
18472         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18473         `span.Seconds' are just seconds, but no minutes or hours.
18474         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18475
18476 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18477
18478         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18479         Remove the gratuitous set of Final:
18480
18481                                 // If an interface implementation, then we can set Final.
18482                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18483                                     implementing.DeclaringType.IsInterface)
18484                                         flags |= MethodAttributes.Final;
18485
18486         I do not know what I was smoking when I used that.
18487
18488
18489         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18490         step into fixing the name resolution issues for delegates and
18491         unifying the toplevel name resolution.
18492
18493 2002-03-28  Martin Baulig  <martin@gnome.org>
18494
18495         * class.cs (Method.Emit): If we have a symbol writer, call its
18496         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18497         tell it about the current method.
18498
18499         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18500         writer that we're going to emit the first byte of IL code for a new
18501         statement (a new source line).
18502         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18503         EmitContext.Mark() before emitting any code.
18504
18505         * location.cs (SymbolDocument): Return null when we're Null.
18506
18507         * statement.cs (Statement): Moved the `Location loc' variable here.
18508         (Statement.EmitBoolExpression): If we have a symbol writer, call
18509         ec.Mark() before emitting any code to tell it that we're at the
18510         beginning of a new statement.
18511         (StatementExpression): Added `Location' argument to the constructor.
18512         (Block): Added public readonly variable `StartLocation' and public
18513         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18514         (Block): Added constructor which takes a start and end location.
18515         (Block.SetEndLocation): New method. This sets the end location.
18516         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18517         local variables we create.
18518         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18519         each statement and do also mark the begin and end of the block.
18520
18521         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18522         tell it the current lexer.Location, use Location.Null for the end of the
18523         block.
18524         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18525         current block, set its end location using SetEndLocation().
18526         (statement_expression): StatementExpression constructor now takes the
18527         lexer.Location as additional argument.
18528         (for_statement, declare_local_variables): Likewise.
18529         (declare_local_variables): When creating a new implicit block, use the
18530         new Block constructor and pass it the lexer.Location.
18531
18532 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18533
18534         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18535         members also on the parent interfaces recursively.
18536
18537 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18538
18539         * report.cs: Use new formats, since Gonzalo finished the missing
18540         bits. 
18541
18542         * expression.cs (Binary.ResolveOperator): added missing operator|
18543         operator& and operator^ for bool/bool.
18544
18545         * cs-parser.jay: CheckDef now takes a Location argument that is
18546         used to report errors more precisly (instead of reporting the end
18547         of a definition, we try to track something which is a lot closer
18548         to the source of the problem).
18549
18550         * cs-tokenizer.cs: Track global token use, so we can properly flag
18551         the use of #define/#undef after the first token has been seen.
18552
18553         Also, rename the reportXXXX to Error_DescriptiveName
18554
18555         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18556         TypeContainer, so that Enum and Interface can use this too.
18557
18558         * class.cs (TypeContainer.LookupInterfaceOrClass,
18559         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18560         `builder' argument.  Typically this was used to pass the parent
18561         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18562         the definition).  
18563
18564         The problem is that a nested class could trigger the definition of
18565         a toplevel class, and the builder would be obviously wrong in that
18566         case. 
18567
18568         So we drop this argument, and we compute dynamically the
18569         TypeBuilder/ModuleBuilder (the correct information was available
18570         to us anyways from DeclSpace.Parent)
18571
18572         * interface.cs (Interface.DefineInterface): Drop builder
18573         parameter cleanup like class.cs
18574
18575         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18576         like class.cs
18577
18578         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18579         values. 
18580
18581         (Try.Emit): Propagate the returns value from the statement.
18582
18583         (Return.Emit): Even if we are leavning 
18584
18585         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18586
18587         * modifiers.cs: Fix the computation of MethodAttributes flags.
18588
18589 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18590
18591         * driver.cs: allow compilation of files that start with '/'.
18592         Add a default case when checking the argument of --target.
18593
18594 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18595
18596         * interface.cs: Implement the same search algorithm for types in
18597         the interface code.
18598
18599         * delegate.cs: Do not allow multiple definition.
18600
18601         * Recovered ChangeLog that got accidentally amputated
18602
18603         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18604
18605         * rootcontext.cs: Load manually enum to allow core classes to
18606         contain enumerations.
18607
18608         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18609         Update to new static methods in TypeManager.
18610
18611         * typemanager.cs (GetMethod, GetConstructor): Use our
18612         implementation of FindMembers to find the members, since during
18613         corlib compilation, the types are TypeBuilders and GetMethod and
18614         GetConstructor do not work.
18615
18616         Make all methods in TypeManager static.
18617
18618         (InitCodeHelpers): Split the functionality from
18619         the InitCodeTypes function.
18620
18621         * driver.cs: Call InitCodeHelpers after we have populated the
18622         types. 
18623
18624         * cs-parser.jay (delegate_declaration): we did not used to compute
18625         the delegate name correctly for void delegates.
18626
18627 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18628
18629         * rootcontext.cs (RootContext): Init the interface_resolve_order
18630         and type_container_resolve_order always.
18631
18632         (ResolveCore, BootstrapCorlib_ResolveClass,
18633         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18634         compiler when compiling with --nostdlib
18635
18636         * class.cs (TypeContainer.DefineType): Check that our parent is
18637         not null.  This test is most important when we are bootstraping
18638         the core types.
18639
18640         * codegen.cs: Split out the symbol writing code.
18641
18642 2002-03-25  Martin Baulig  <martin@gnome.org>
18643
18644         * driver.cs (-g): Made -g an alias for --debug.
18645
18646 2002-03-24  Martin Baulig  <martin@gnome.org>
18647
18648         * codegen.cs (SymbolWriter): New public variable. Returns the
18649         current symbol writer.
18650         (CodeGen): Added `bool want_debugging_support' argument to the
18651          constructor. If true, tell the ModuleBuild that we want debugging
18652         support and ask it for the ISymbolWriter.
18653         (Save): If we have a symbol writer, call it's Close() method after
18654         saving the assembly.
18655
18656         * driver.c (--debug): New command line argument to create a
18657         debugger information file.
18658
18659         * location.cs (SymbolDocument): New public property. Returns an
18660         ISymbolDocumentWriter object for the current source file or null
18661         if we don't have a symbol writer.
18662
18663 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
18664
18665         * driver.cs (LoadAssembly): Correctly return when all the paths
18666         have been tried and not before.
18667
18668         * statement.cs (Switch.Emit): return the actual coverage for this
18669         statement (returns/not-returns)
18670
18671         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18672         switch of the statement if we are the last switch section.  That
18673         kills two problems: try/catch problems (we used to emit an empty
18674         nop at the end) and switch statements where all branches would
18675         return. 
18676
18677 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
18678
18679         * driver.cs: Add default assemblies (the equivalent to the
18680         Microsoft CSC.RSP file)
18681
18682         * cs-tokenizer.cs: When updating `cols and setting it to zero,
18683         also update tokens_seen and set it to false.
18684
18685         * driver.cs: Implement --recurse for Mike.
18686
18687         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18688         correctly splitting out the paths.
18689
18690 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18691
18692         * interface.cs (Interface.PopulateProperty): Instead of using
18693         `parent' as the declaration space for the set parameters, use
18694         `this' 
18695
18696         * support.cs (InternalParameters): InternalParameters constructor
18697         takes a DeclSpace instead of a TypeContainer.
18698
18699         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18700         types are being initialized, load the address of it before calling
18701         the function.  
18702
18703         (New): Provide a mechanism to disable the generation of local
18704         value type temporaries when the caller will be providing us with
18705         an address to store it.
18706
18707         (ArrayCreation.EmitDynamicInitializers): Use it.
18708
18709 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18710
18711         * expression.cs (Invocation.EmitArguments): Only probe for array
18712         property if there is more than one argument.  Sorry about that.
18713
18714         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18715         empty param arrays.
18716
18717         * class.cs (Method.LabelParameters): Fix incorrect code path that
18718         prevented the `ParamArrayAttribute' from being applied to the
18719         params attribute.
18720
18721 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18722
18723         * support.cs (ReflectionParameters): Correctly compute whether the
18724         last argument is a params array.  Fixes the problem with
18725         string.Split ('a')
18726
18727         * typemanager.cs: Make the assemblies array always be non-null
18728         (empty, but non-null)
18729
18730         * tree.cs (RecordDecl): New function that abstracts the recording
18731         of names.  This reports error 101, and provides a pointer to the
18732         previous declaration.  Fixes a crash in the compiler.
18733
18734         * cs-parser.jay (constructor_declaration): Update to new grammar,
18735         and provide a constructor_body that can be empty.
18736
18737 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18738
18739         * driver.cs: Add support for --resources.
18740
18741         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18742         Make all types for the various array helper methods be integer.
18743
18744         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18745         CheckState to ConvCast.
18746
18747         (ConvCast): Now it takes a `checked' state argument, to avoid
18748         depending on the emit context for the conversion, and just using
18749         the resolve time setting.
18750
18751         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18752         instead of Invocation.EmitArguments.  We do not emit the original
18753         arguments, instead we emit those which have been converted to
18754         unsigned int expressions.
18755
18756         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18757
18758         * codegen.cs: ditto.
18759
18760         * expression.cs (LocalVariableReference): Drop the use of the
18761         Store function that depended on the variable index.
18762
18763         * statement.cs (VariableInfo): Drop the `Idx' property from this
18764         class, as this is not taking into account the indexes for
18765         temporaries tat we generate during the execution, getting the
18766         indexes wrong.
18767
18768         * class.cs: First emit class initializers, then call the parent
18769         constructor. 
18770
18771         * expression.cs (Binary): Fix opcode emision.
18772         (UnaryMutator.EmitCode): Support checked code generation
18773
18774         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18775         matches for events for both the Static and Instance scans,
18776         pointing to the same element.   Fix that.
18777
18778 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18779
18780         * rootcontext.cs (ResolveTree): Always set the
18781         interface_resolve_order, because nested interfaces will be calling
18782         into us.
18783
18784         * class.cs (GetInterfaceOrClass): Track the same resolution
18785         process used by TypeManager.LookupType.  This fixes the nested
18786         type lookups in class declarations (separate path from
18787         LookupType). 
18788
18789         (TypeContainer.DefineType): Also define nested interfaces.
18790         (TypeContainer.RegisterOrder): New public function used to
18791         register the order in which child interfaces need to be closed.
18792
18793         Nested interfaces need to be closed after their parents have been
18794         created. 
18795
18796         * interface.cs (InterfaceAttr): Put all the logic for computing
18797         the interface attribute here. 
18798
18799         (DefineInterface): Register our interface order with the
18800         RootContext or with the TypeContainer depending on the case.
18801
18802 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18803
18804         * cs-parser.jay: rework foreach statement to work with the new
18805         changes to the policy on SimpleNames.
18806
18807         * report.cs: support Stacktrace on warnings as well.
18808
18809         * makefile: drop --unsafe and /unsafe from the compile.
18810
18811 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18812
18813         * ecore.cs (StandardConversionExists): Modify to take an Expression
18814         as the first parameter. Ensure we do null -> reference type conversion
18815         checking.
18816
18817         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18818         temporary Expression objects.
18819
18820 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18821
18822         * interface.cs: workaround bug in method overloading resolution
18823         (there is already a bugzilla bug for it).
18824
18825 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18826
18827         We could also solve this problem by having a separate path for
18828         performing type lookups, instead of DoResolve, we could have a
18829         ResolveType entry point, and only participating pieces of the
18830         production (simplename, deref, array) would implement this. 
18831
18832         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18833         signal SimpleName to only resolve type names and not attempt to
18834         resolve anything else.
18835
18836         * expression.cs (Cast): Set the flag.
18837
18838         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18839
18840         * class.cs: Only report 108 if there is no `new' modifier.
18841
18842         * cs-parser.jay: rework foreach statement to work with the new
18843         changes to the policy on SimpleNames.
18844         
18845         * report.cs: support Stacktrace on warnings as well.
18846
18847         * makefile: drop --unsafe and /unsafe from the compile.
18848
18849 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18850
18851         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18852         lookups here, instead of doing that at parse time.  This means
18853         that our grammar will not introduce `LocalVariableReferences' as
18854         expressions at this point.  That solves the problem of code like
18855         this:
18856
18857         class X {
18858            static void Main ()
18859            { int X = 1;
18860             { X x = null }}}
18861
18862         This is only half the fix.  The full fix requires parameters to
18863         also be handled in this way.
18864
18865         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18866         makes the use more obvious of the DeclSpace.  The
18867         ec.TypeContainer.TypeBuilder is now only used to pull the
18868         TypeBuilder for it.
18869
18870         My theory is that I can get rid of the TypeBuilder completely from
18871         the EmitContext, and have typecasts where it is used (from
18872         DeclSpace to where it matters).  
18873
18874         The only pending problem is that the code that implements Aliases
18875         is on TypeContainer, and probably should go in DeclSpace.
18876
18877         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18878         lookups here, instead of doing that at parse time.  This means
18879         that our grammar will not introduce `LocalVariableReferences' as
18880         expressions at this point.  That solves the problem of code like
18881         this:
18882
18883         class X {
18884            static void Main ()
18885            { int X = 1;
18886             { X x = null }}}
18887
18888         This is only half the fix.  The full fix requires parameters to
18889         also be handled in this way.
18890
18891         * class.cs (Property.DefineMethod): When implementing an interface
18892         method, set newslot, when implementing an abstract method, do not
18893         set the flag (before we tried never setting it, or always setting
18894         it, which is the difference).
18895         (Indexer.DefineMethod): same.
18896         (Method.DefineMethod): same.
18897
18898         * ecore.cs: Only set the status used flag if we get back a Field.
18899
18900         * attribute.cs: Temporary hack, so Paolo can keep working.
18901
18902 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18903
18904         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18905         the unmanaged type in the case we have a MarshalAs attribute.
18906
18907         (Resolve): Handle the case when we are parsing the special MarshalAs
18908         attribute [we need to store the unmanaged type to use later]
18909
18910         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18911         MarshalAs Attribute.
18912
18913         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18914         on parameters and accordingly set the marshalling info.
18915
18916 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18917
18918         * class.cs: Optimizing slightly by removing redundant code after
18919         we switched to the `NoTypes' return value.
18920         (Property.DefineMethod): use NoTypes here too.
18921
18922         This fixes the bug I introduced in my last batch of changes.
18923
18924 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18925
18926         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18927
18928         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18929         Enums since those are types too. 
18930
18931         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18932
18933         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18934         thanks to a call during the lookup process.
18935
18936 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18937
18938         * statement.cs (Foreach): Lots of work to accomodate a particular
18939         kind of foreach statement that I had not kept in mind.  It is
18940         possible to have foreachs on classes that provide a GetEnumerator
18941         method that return objects that implement the "pattern" for using
18942         a foreach, there is no need to support GetEnumerator
18943         specifically. 
18944
18945         This is needed to compile nant.
18946
18947         * decl.cs: Only report 114 if the member is not `Finalize' and if
18948         the warning level is at least 2.
18949
18950         * class.cs: Moved the compare function from Method to
18951         MethodSignature. 
18952
18953         (MethodSignature.InheritableMemberSignatureCompare): Add new
18954         filter function that is used to extract inheritable methods from a
18955         class. 
18956
18957         (Method.Define): Use the new `inheritable_method_signature_filter'
18958         delegate
18959
18960         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18961         command. 
18962
18963 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18964
18965         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18966
18967         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18968
18969         * expression.cs: Pass location information to
18970         ConvertImplicitStandard. 
18971
18972         * class.cs: Added debugging code to track return values from
18973         interfaces. 
18974
18975 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18976
18977         * expression.cs (Is.DoResolve): If either side of the `is' is an
18978         interface, do not flag the warning.
18979
18980         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18981         for interfaces
18982
18983         * report.cs: Allow for --fatal to be used with --probe.
18984
18985         * typemanager.cs (NoTypes): Move the definition for the empty Type
18986         array here. 
18987
18988         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18989         properties. 
18990         (TypeContainer.DefineProxy): New function used to proxy to parent
18991         implementations when implementing interfaces.
18992         (TypeContainer.ParentImplements): used to lookup if our parent
18993         implements a public function that is required by an interface.
18994         (TypeContainer.VerifyPendingMethods): Hook this up.
18995
18996         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18997         `modules' and `assemblies' arraylists into arrays.  We only grow
18998         these are the very early start up of the program, so this improves
18999         the speedof LookupType (nicely measured).
19000
19001         * expression.cs (MakeByteBlob): Replaced unsafe code with
19002         BitConverter, as suggested by Paolo.
19003
19004         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19005         folding of string concatenation, but if either side is a string,
19006         and the other is not, then return null, and let the runtime use
19007         the concatenation on the string plus the object (using
19008         `Object.ToString'). 
19009
19010 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19011
19012         Constant Folding has been implemented now.
19013
19014         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19015         the error instead on types that are not supported in one's
19016         complement. 
19017
19018         * constant.cs (Constant and all children): New set of functions to
19019         perform implict and explicit conversions.
19020
19021         * ecore.cs (EnumConstant): Implement the new functions to perform
19022         conversion by proxying to the child expression.
19023
19024         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19025         own separate setting that can not be turned off from the command
19026         line using --unchecked or --checked and is only controlled using
19027         the checked/unchecked statements and expressions.  This setting is
19028         used by the constant folder to flag errors.
19029
19030         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19031         ConstantCheckState as well.   
19032
19033         During Resolve, they also have to flag the state, because the
19034         constant folder runs completely in the Resolve phase.
19035
19036         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19037         well.
19038
19039 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19040
19041         * cfold.cs: New file, this file contains the constant folder.
19042
19043         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19044         argument to track whether we are using the resulting address to
19045         load or store a value and provide better error messages. 
19046
19047         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19048         new AddressOf arguments.
19049
19050         * statement.cs (Foreach.EmitCollectionForeach): Update
19051
19052         * expression.cs (Argument.Emit): Call AddressOf with proper
19053         arguments to track usage.
19054
19055         (New.DoEmit): Call AddressOf with new arguments.
19056
19057         (Unary.Emit): Adjust AddressOf call.
19058
19059 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19060
19061         * cs-parser.jay (member_access): Change the case for pre-defined types
19062         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19063         this suggestion.
19064
19065         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19066         a method body.
19067
19068         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19069         essentially like methods and apply attributes like MethodImplOptions to them too.
19070
19071         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19072         not being null.
19073
19074         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19075         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19076         is the DeclSpace.
19077
19078         * Update code everywhere accordingly.
19079
19080         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19081
19082         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19083
19084 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19085
19086         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19087         try performing lookups against those instead of jumping straight into using
19088         the 'using' clauses.
19089
19090         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19091
19092         (LookupType): Perform lookups in implicit parents too.
19093
19094         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19095         sequence as RootContext.LookupType. 
19096
19097         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19098         the various cases of namespace lookups into this method.
19099
19100 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19101
19102         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19103         in positional arguments)
19104
19105         * class.cs (Operator): Update the AllowedModifiers to contain
19106         extern. 
19107
19108         * cs-parser.jay: Update operator declaration to allow for the
19109         operator body to be empty.
19110
19111         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19112         values. 
19113
19114 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19115
19116         * class.cs (Method.Emit): Label parameters.
19117
19118         * driver.cs: Return 1 or 0 as the program exit code.
19119
19120 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19121
19122         * expression.cs: Special case the `null' object when trying to
19123         auto-compute the type, as anything can be explicitly converted to
19124         that. 
19125
19126         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19127         spotting this Paolo.
19128
19129         (Expression.ImplicitNumericConversion): Perform comparissions of
19130         the type using the underlying type in the case of an enumeration
19131         rather than using the enumeration type for the compare.
19132
19133         Cope with the underlying == type case, which is not possible to
19134         catch before. 
19135
19136         (Expression.ConvertNumericExplicit): Perform comparissions of
19137         the type using the underlying type in the case of an enumeration
19138         rather than using the enumeration type for the compare.
19139
19140         * driver.cs: If the user does not supply an extension, assume .exe
19141
19142         * cs-parser.jay (if_statement): Rewrote so that we can track the
19143         location for the if statement.
19144
19145         * expression.cs (Binary.ConstantFold): Only concat strings when
19146         the operation is "+", not everything ;-)
19147
19148         * statement.cs (Statement.EmitBoolExpression): Take a location
19149         argument. 
19150         (If, While, Do): Track location.
19151
19152         * expression.cs (Binary.ResolveOperator): In the object + string
19153         case, I was missing a call to ConvertImplicit
19154
19155 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19156
19157         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19158         Location arguments. Ensure we use RootContext.LookupType to do our work
19159         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19160
19161         * interface.cs (PopulateMethod): Handle the type of the parameter being
19162         null gracefully.
19163
19164         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19165         have a params method with no fixed arguments and a call is made with no
19166         arguments.
19167
19168 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19169
19170         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19171         the verbatim-string-literal
19172
19173         * support.cs (InternalParameters.ParameterModifier): handle null
19174         fixed parameters.
19175         (InternalParameters.ParameterType): ditto.
19176
19177         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19178         duplicating the name of the variable parameter.
19179         (GetParameterByName): Fix bug where we were not looking up array
19180         paramters if they were the only present (thanks Paolo!).
19181         (GetParameterInfo): We only have an empty set of types if both
19182         fixed and array are set to null.
19183         (GetParameterInfo-idx): Handle FixedParameter == null
19184
19185         * cs-parser.jay: Handle the case where there is no catch
19186         statements (missing null test).
19187
19188 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19189
19190         * driver.cs (MainDriver): Be conservative on our command line
19191         handling.
19192
19193         Catch DirectoryNotFoundException when calling GetFiles.
19194
19195         (SplitPathAndPattern): Used to split the input specification into
19196         a path and a pattern that we can feed to Directory.GetFiles.
19197
19198 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19199
19200         * statement.cs (Fixed): Implement the last case of the Fixed
19201         statement (string handling).
19202
19203         * expression.cs (StringPtr): New class used to return a char * to
19204         a string;  Used by the Fixed statement.
19205
19206         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19207
19208         * expression.cs (Binary.ResolveOperator): Remove redundant
19209         MemberLookup pn parent type.
19210         Optimize union call, we do not need a union if the types are the same.
19211         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19212         type.
19213
19214         Specialize the use of MemberLookup everywhere, instead of using
19215         the default settings. 
19216
19217         (StackAlloc): Implement stackalloc keyword.
19218
19219         * cs-parser.jay: Add rule to parse stackalloc.
19220
19221         * driver.cs: Handle /h, /help, /?
19222
19223         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19224         before we supported unsafe code.
19225
19226         * makefile: add --unsafe to the self compilation of mcs.
19227
19228 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19229
19230         * expression.cs (PointerArithmetic): New class that is used to
19231         perform pointer arithmetic.
19232         (Binary.Resolve): Handle pointer arithmetic
19233         Handle pointer comparission.
19234         (ArrayPtr): Utility expression class that is used to take the
19235         address of an array.
19236
19237         (ElementAccess): Implement array access for pointers
19238
19239         * statement.cs (Fixed): Implement fixed statement for arrays, we
19240         are missing one more case before we are done.
19241
19242         * expression.cs (Indirection): Implement EmitAssign and set the
19243         ExprClass to Variable.  This allows pointer dereferences to be
19244         treated as variables, and to have values assigned to them.
19245
19246         * ecore.cs (Expression.StoreFromPtr): New utility function to
19247         store values dereferencing.
19248
19249 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19250
19251         * expression.cs (Binary.ResolveOperator): Ensure that we are
19252         not trying to operate on a void type - this fixes the reported
19253         bug.
19254
19255         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19256         the parent implementation is sealed.
19257
19258         * ../errors/cs0239.cs : Add.
19259
19260         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19261
19262         * typemanager.cs (unverifiable_code_type): Corresponds to 
19263         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19264         which have unsafe code in them.
19265
19266         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19267         unsafe context.
19268
19269 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19270
19271         * cs-tokenizer.cs: Add support for @"litreal strings"
19272
19273         Make tokenizer accept pre-processor directives
19274         on any column (remove the old C-like limitation). 
19275
19276         * rootcontext.cs (EmitCode): Emit any global attributes.
19277         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19278
19279         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19280
19281         * cs-parser.jay: Add support for global attributes.  
19282
19283 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19284
19285         * expression.cs (Indirection): New helper class.  Unary will
19286         create Indirection classes to be able to implement the
19287         IMemoryLocation interface on it.
19288
19289 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19290
19291         * cs-parser.jay (fixed_statement): reference the right statement.
19292
19293         * statement.cs (Fixed.Emit): Finish implementing the fixed
19294         statement for the &x case.
19295
19296 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19297
19298         * class.cs (Property.Define, Method.Define): Remove newslot when
19299         `implementing'.  
19300
19301         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19302         wrong.  NewSlot should only be used if the `new' keyword is present.
19303
19304         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19305         locating our system dir.  Sorry about this.
19306
19307 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19308
19309         * driver.cs (GetSystemDir): Compute correctly the location of our
19310         system assemblies.  I was using the compiler directory instead of
19311         the library directory.
19312
19313 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19314
19315         * expression.cs (BetterFunction): Put back in what Miguel commented out
19316         since it is the correct fix. The problem is elsewhere ;-)
19317
19318         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19319         parameters of the parms method are themselves compatible or not !
19320
19321         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19322         to check that a class implements an interface before saying that an implicit
19323         conversion was allowed. Use ImplementsInterface to do the checking.
19324
19325 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19326
19327         * class.cs (Method.Define): Track whether we are an explicit
19328         implementation or not.  And only call DefineMethodOverride if we
19329         are an explicit implementation.
19330
19331         (Property.DefineMethod): Ditto.
19332
19333 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19334
19335         * expression.cs (BetterFunction): Catch hideous bug which was
19336          preventing us from detecting ambiguous calls due to implicit casts i.e
19337         cs0121.
19338
19339 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19340
19341         * support.cs (Pair): Remove un-needed method.  I figured why I was
19342         getting the error in cs-parser.jay, the variable in a foreach loop
19343         is readonly, and the compiler does not really treat this as a variable.
19344
19345         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19346         instead of EQUALS in grammar.  
19347
19348         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19349
19350         * expression.cs (Unary.DoResolve): Check whether the argument is
19351         managed or not.
19352
19353 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19354
19355         * support.cs: Api for Pair to set a value.  Despite the fact that
19356         the variables are public the MS C# compiler refuses to compile
19357         code that accesses the field if the variable is part of a foreach
19358         statement. 
19359
19360         * statement.cs (Fixed): Begin implementation of the fixed
19361         statement.
19362
19363         (Block.AddVariable): Return the VariableInfo on success and null
19364         on failure instead of true/false. 
19365
19366         * cs-parser.jay (foreach): Catch errors on variables already
19367         defined (we were ignoring this value before) and properly unwind
19368         the block hierarchy
19369
19370         (fixed_statement): grammar for the fixed statement.
19371
19372 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19373
19374         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19375         pointer types to be incretemented.
19376
19377         (SizeOf): Implement.
19378
19379         * cs-parser.jay (pointer_member_access): Implement
19380         expr->IDENTIFIER production.
19381
19382         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19383         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19384         on safe contexts.
19385
19386         (Unary): Implement indirection.
19387
19388         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19389         use in non-unsafe context).
19390
19391         (SimpleName.DoResolve): Check for pointers in field access on safe
19392         contexts. 
19393
19394         (Expression.LoadFromPtr): Factor the load-indirect code in this
19395         function.  This was duplicated in UnboxCast and ParameterReference
19396
19397 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19398
19399         * expression.cs (ComposedCast): report an error if a pointer cast
19400         is used in a safe region.
19401
19402         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19403         pointer type casts in unsafe context.
19404
19405         * codegen.cs (EmitContext): Set up IsUnsafe.
19406
19407         * cs-parser.jay (non_expression_type): Add productions for pointer
19408         casts. 
19409
19410         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19411         code.  We should not use force into static mode if the method is
19412         not virtual.  Fixes bug in MIS
19413
19414         * statement.cs (Do.Emit, While.Emit, For.Emit,
19415         Statement.EmitBoolExpression): Add support to Do and While to
19416         propagate infinite loop as `I do return' semantics.
19417
19418         Improve the For case to also test for boolean constants.
19419
19420         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19421         to the list of attributes we can add.
19422
19423         Remove `EmitContext' argument.
19424
19425         * class.cs (Method.Define): Apply parameter attributes.
19426         (Constructor.Define): Apply parameter attributes.
19427         (MethodCore.LabelParameters): Move here the core of labeling
19428         parameters. 
19429
19430         * support.cs (ReflectionParameters.ParameterModifier,
19431         InternalParameters.ParameterModifier): Use IsByRef on the type and
19432         only return the OUT bit for these parameters instead of in/out/ref
19433         flags.
19434
19435         This is because I miss-understood things.  The ParameterInfo.IsIn
19436         and IsOut represent whether the parameter has the [In] and [Out]
19437         attributes set.  
19438
19439 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19440
19441         * ecore.cs (FieldExpr.Emit): Release temporaries.
19442
19443         * assign.cs (LocalTemporary.Release): new function.
19444
19445         * codegen.cs (EmitContext.GetTemporaryStorage,
19446         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19447         temporary storage.  Now we can "put back" localbuilders when we
19448         are done with them
19449
19450 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19451
19452         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19453         need to make a copy of the variable to generate verifiable code.
19454
19455 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19456
19457         * driver.cs: Compute dynamically the system directory.
19458
19459         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19460         Slower, but more generally useful.  Used by the abstract
19461         registering implementation. 
19462
19463         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19464         the rules for the special rule on Type/instances.  First check if
19465         we have the same name, and if so, try that special static path
19466         rather than the instance path.
19467
19468 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19469
19470         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19471         for, while and if.
19472
19473         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19474         Enum, ValueType, Delegate or Array for non-corlib compiles.
19475
19476         * cs-tokenizer.cs: Catch long identifiers (645)
19477
19478         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19479         piece of code.
19480
19481         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19482         fix, we were returning too early, so we were not registering
19483         pending methods from abstract classes.
19484
19485         Do not register pending methods if the class is abstract.
19486
19487         * expression.cs (Conditional.DoResolve): Report circular implicit
19488         conversions when we neecd to compute it for conditional
19489         expressions. 
19490
19491         (Is.DoResolve): If the expression is always of the provided type,
19492         flag warning 183.  If the expression can not ever be of the
19493         provided type flag warning 184.
19494
19495         * class.cs: Catch 169 as well.
19496
19497         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19498         read. 
19499
19500 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19501
19502         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19503
19504 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19505
19506         * interface.cs: (PopulateMethod): Check for pointers being defined
19507         only if the unsafe context is active.
19508         (PopulateProperty): ditto.
19509         (PopulateIndexer): ditto.
19510
19511         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19512         specified.  If pointers are present, make sure that they are
19513         present in an unsafe context.
19514         (Constructor, Constructor.Define): ditto.
19515         (Field, Field.Define): ditto.
19516         (Property, Property.Define): ditto.
19517         (Event, Event.Define): ditto.
19518
19519         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19520         hashtable if there are classes or structs defined.
19521
19522         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19523         code, as the constant resolution moved.
19524
19525         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19526         the metadata, so we can flag error 133. 
19527
19528         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19529         pointer is being declared in an unsafe context.
19530
19531 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19532
19533         * modifiers.cs (Modifiers.Check): Require a Location argument.
19534         Report error 227 for Unsafe use.
19535
19536         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19537
19538         * statement.cs (For.Emit): If the test is null, then report that
19539         we do `return', as we wont reach anything afterwards.
19540
19541         (Switch.SwitchGoverningType): Track the expression that matched
19542         the conversion.
19543
19544         * driver.cs: Allow negative numbers as an error code to flag.
19545
19546         * cs-parser.jay: Handle 1551.
19547
19548         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19549
19550 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19551
19552         * cs-parser.jay: Report 1518 (type declaration can only contain
19553         class, struct, interface, enum or delegate)
19554
19555         (switch_label): Report 1523 (keywords `case' or `default' must
19556         preced code)
19557
19558         (opt_switch_sections): Report 1522 (empty switch)
19559
19560         * driver.cs: Report 1515 (response file specified multiple times)
19561         Report 1516 (Source file specified multiple times).
19562
19563         * expression.cs (Argument.Resolve): Signal 1510
19564
19565         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19566         access not allowed in static code)
19567
19568 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19569
19570         * typemanager.cs (IsPointerType): Utility method which we are going
19571         to need a lot.
19572
19573         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19574         the object type, so we take care of that.
19575
19576         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19577
19578         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19579         added to non-params parameters :-)
19580
19581         * typemanager.cs (CSharpName): Include 'void' type too. 
19582
19583         (void_ptr_type): Include in the set of core types.
19584
19585         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19586         duplicating code.
19587
19588         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19589         an unsafe context.
19590
19591         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19592         completely forgotten about it.
19593
19594 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19595
19596         * cs-parser.jay (pointer_type): Add. This begins our implementation
19597         of parsing rules for unsafe code.
19598
19599         (unsafe_statement): Implement.
19600
19601         (embedded_statement): Modify to include the above.
19602
19603         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19604
19605         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19606         if the current context is an unsafe one.
19607
19608         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19609         are handled differently, we need separate rules for them.
19610
19611         (local_variable_declaration): Update to use local_variable_pointer_type
19612         to allow variable declarations of unmanaged pointer types.
19613
19614         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19615         in unsafe contexts.
19616
19617         * ../errors/cs0214.cs : Add.
19618
19619 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19620
19621         * makefile: remove 'response' file when cleaning.
19622
19623 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19624
19625         * cs-parser.jay: Report 1524.
19626
19627 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19628
19629         * typemanager.cs (RegisterMethod): drop checking if we have
19630         registered this from here
19631
19632 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19633
19634         * class.cs (Method.EmitDestructor): Implement calling our base
19635         destructor. 
19636
19637         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19638         value of InFinally.
19639
19640         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19641         this routine and will wrap the call in a try/catch block.  Deal
19642         with the case.
19643
19644 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
19645
19646         * ecore.cs (Expression.MemberLookup): instead of taking a
19647         parameter `same_type' that was used to tell whether we could
19648         access private members we compute our containing type from the
19649         EmitContext.
19650
19651         (FieldExpr): Added partial support for volatile fields.  This does
19652         not work for volatile fields exposed from assemblies, as I can not
19653         figure out how to extract the modreq from it.
19654
19655         Updated all the source files to use this.
19656
19657         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19658         because it is referenced by MemberLookup very often. 
19659
19660 2002-01-09  Ravi Pratap  <ravi@ximian.com>
19661
19662         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19663         TypeBuilder.GetCustomAttributes to retrieve what we need.
19664
19665         Get rid of redundant default_member_attr_type as this is the same as
19666         default_member_type which already exists.
19667
19668         * interface.cs, attribute.cs : Update accordingly.
19669
19670 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
19671
19672         * typemanager.cs: Enable IndexerPropertyName again.  It does not
19673         work for TYpeBuilders though.  Ravi, can you please fix this?
19674
19675         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19676
19677         * expression.cs (Argument.Emit): Handle the case of ref objects
19678         being passed to ref functions;  
19679
19680         (ParameterReference.EmitLoad): Loads the content of the pointer
19681         without dereferencing.
19682
19683 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19684
19685         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19686
19687 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19688
19689         * class.cs (Indexer.DefineMethod): Incorporate the interface
19690         type in the name of the method if we are doing explicit interface
19691         implementation.
19692
19693         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19694
19695         (BetterConversion): Fix extremely trivial bug where we were referring to
19696         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19697         again !
19698
19699         * ../errors/bug16.cs : Add although we have fixed it.
19700
19701 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19702
19703         * expression.cs (BaseIndexer): Begin implementation.
19704
19705         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19706
19707         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19708         production directly to remove a shift/reduce, and implement
19709         explicit interface implementation.
19710
19711         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19712         after a floating point suffix.
19713
19714         * expression.cs (DoNumericPromotions): Improved the conversion for
19715         uint/uint.  If we have a constant, we avoid doing a typecast to a
19716         larger type.
19717
19718         * class.cs (Indexer): Implement explicit interface implementation
19719         for indexers.
19720
19721 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19722
19723         * class.cs: make the default instance constructor public and hidebysig.
19724
19725 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19726
19727         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19728         so we can call it from elsewhere.
19729
19730         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19731         we emit it internally if the class has a defined indexer; otherwise the user
19732         emits it by decorating the class definition with the DefaultMemberAttribute.
19733
19734         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19735         attribute is not used on a type which defines an indexer.
19736
19737         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19738         character when we skip whitespace.
19739
19740         * ../errors/cs0646.cs : Add.
19741
19742 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19743
19744         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19745         again. 
19746
19747         * makefile: Add practical target `mcs3.exe' which builds the third
19748         generation compiler. 
19749
19750         * expression.cs (New): Fix structures constructor calling.
19751
19752         * class.cs (Property, Method, Indexer): Emit Final flag on the
19753         method if we are an interface implementation and we are not
19754         abstract. 
19755
19756         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19757         whether this property is referencing a `base' method.
19758
19759         * expression.cs (Invocation.EmitCall): take an extra argument:
19760         is_base, this is used to determine whether the `call' or
19761         `callvirt' opcode should be used.
19762
19763
19764         * delegate.cs: update EmitCall.
19765
19766         * class.cs (Method.Define): Set NewSlot for the cases where we are
19767         not implementing an interface method.
19768
19769         (Property.Define): ditto.
19770
19771 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19772
19773         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19774         'r'.  Allows mcs to parse itself fully.
19775
19776 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19777
19778         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19779         of the number of initializers that require the InitializeArray method.
19780
19781         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19782         update the above field where necessary.
19783
19784         (MakeByteBlob): Update accordingly.
19785
19786         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19787         greater than 2.
19788
19789         (EmitDynamicInitializers): Update in accordance with the new optimization.
19790
19791         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19792         same OpCode applies.
19793
19794         * cs-parser.jay : Fix some glaring errors I introduced.
19795
19796 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19797
19798         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19799         so that we can check for name clashes there too.
19800
19801         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19802         for interface indexers.
19803
19804         * interfaces.cs (Define): Emit the default member attribute.
19805
19806         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19807         variable was being referred to while setting the value ;-)
19808
19809 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19810
19811         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19812         byte-by-byte information when we know the data is zero.
19813
19814         Make the block always a multiple of 4, because
19815         DefineInitializedData has a bug.
19816
19817         * assign.cs: Fix, we should assign from the temporary, not from
19818         the source. 
19819
19820         * expression.cs (MakeByteBlob): Fix my incorrect code.
19821
19822 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19823
19824         * typemanager.cs (EnumToUnderlying): This function is used to get
19825         the underlying type from an enumeration, because it does not
19826         always work. 
19827
19828         * constant.cs: Use the I4_S form for values between -128 and 127.
19829
19830         * statement.cs (Block.LookupLabel): Looks up a label.
19831         (Block): Drop support for labeled blocks.
19832
19833         (LabeledStatement): New kind of statement that represents a label
19834         only.
19835
19836         (Goto): Finally implement this bad boy.
19837
19838         * cs-parser.jay: Update to reflect new mechanism to implement
19839         labels.
19840
19841 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19842
19843         * codegen.cs (EmitContext.This): a codegen property that keeps the
19844         a single instance of this instead of creating many different this
19845         instances. 
19846
19847         * delegate.cs (Delegate.DoResolve): Update to use the property;
19848
19849         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19850
19851         * expression.cs (BaseAccess.DoResolve): Ditto.
19852
19853 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19854
19855         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19856         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19857
19858         (InitCoreTypes): Update accordingly.
19859
19860         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19861         so we can quickly store the state.
19862
19863         (ApplyAttributes): Set the correct implementation flags
19864         for InternalCall methods.
19865
19866 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19867
19868         * expression.cs (EmitCall): if a method is not virtual, then do
19869         not use callvirt on it.
19870
19871         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19872         user defined stuff) requires the use of stobj, which takes an
19873         address on the stack instead of an array and an index.  So emit
19874         the Ldelema operation for it.
19875
19876         (EmitStoreOpcode): Use stobj for valuetypes.
19877
19878         (UnaryMutator.EmitCode): Use the right 1 value depending on
19879         whether we are dealing with int64/uint64, float or doubles.
19880
19881         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19882         constructors that I implemented last night.
19883
19884         (Constructor.IsDefault): Fix to work properly for static
19885         constructors.
19886
19887         * cs-parser.jay (CheckDef): report method signature errors.
19888         Update error number 103 to be 132.
19889
19890         * decl.cs: New AdditionResult enumeration value: MethodExists.
19891         Although we do this check for methods later on in the semantic
19892         analysis, catching repeated default constructors is so easy that
19893         we catch these here. 
19894
19895         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19896         promotions code.
19897
19898         (ParameterReference.EmitAssign, Emit): handle
19899         bools as bytes.
19900
19901         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19902         (ArrayAccess.EmitStoreOpcode): ditto.
19903
19904         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19905
19906         * expression.cs (MakeByteBlob): Complete all the missing types
19907         (uint, short, ushort, byte, sbyte)
19908
19909         * class.cs: Only init instance field initializers on instance
19910         constructors. 
19911
19912         Rename `constructors' to instance_constructors. 
19913
19914         (TypeContainer.AddConstructor): Only add constructors to the list
19915         if it is not static.
19916
19917         Make sure that we handle default_static_constructor independently
19918         everywhere where we handle instance_constructors
19919
19920 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19921
19922         * class.cs: Do not lookup or create a base initializer for a
19923         static constructor.
19924
19925         (ConstructorInitializer.Resolve): use the proper type to lookup
19926         for constructors.
19927
19928         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19929
19930         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19931         in DeclSpace. 
19932
19933         * decl.cs: CloseType is now an virtual method, the default
19934         implementation just closes this type.
19935
19936 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19937
19938         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19939         to PreserveSig by default. Also emit HideBySig on such methods.
19940
19941         Basically, set the defaults to standard values.
19942
19943         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19944         argument, if candidate is better, it can't be worse than the best !
19945
19946         (Invocation): Re-write bits to differentiate between methods being
19947         applicable in their expanded form and their normal form - for params
19948         methods of course.
19949
19950         Get rid of use_standard everywhere as only standard conversions are allowed
19951         in overload resolution. 
19952
19953         More spec conformance.
19954
19955 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19956
19957         * driver.cs: Add --timestamp, to see where the compiler spends
19958         most of its time.
19959
19960         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19961         `this' in static code.
19962
19963         (SimpleName.DoResolve): Implement in terms of a helper function
19964         that allows static-references to be passed upstream to
19965         MemberAccess.
19966
19967         (Expression.ResolveWithSimpleName): Resolve specially simple
19968         names when called by MemberAccess to implement the special
19969         semantics. 
19970
19971         (Expression.ImplicitReferenceConversion): Handle conversions from
19972         Null to reference types before others, as Null's type is
19973         System.Object. 
19974
19975         * expression.cs (Invocation.EmitCall): Handle the special case of
19976         calling methods declared on a reference type from a ValueType
19977         (Base classes System.Object and System.Enum)
19978
19979         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19980         the left hand side is a TypeExpr, not on every enumeration. 
19981
19982         (Binary.Resolve): If types are reference types, then do a cast to
19983         object on operators != and == of both arguments.
19984
19985         * typemanager.cs (FindMembers): Extract instance and static
19986         members if requested.
19987
19988         * interface.cs (PopulateProperty): Use void_type instead of null
19989         as the return type for the setter method.
19990
19991         (PopulateIndexer): ditto.
19992
19993 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19994
19995         * support.cs (ReflectionParameters): Fix minor bug where we
19996         were examining the wrong parameter for the ParamArray attribute.
19997
19998         Cope with requests for the type of the parameter at position
19999         greater than the params parameter's. We now return the element
20000         type of the params array as that makes more sense.
20001
20002         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20003         accordingly as we no longer have to extract the element type
20004         ourselves.
20005
20006         (Invocation.OverloadResolve): Update.
20007
20008 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20009
20010         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20011         against IEnumerator, test whether the return value is a descendant
20012         of the IEnumerator interface.
20013
20014         * class.cs (Indexer.Define): Use an auxiliary method to implement
20015         the other bits of the method definition.  Begin support for
20016         explicit interface implementation.
20017
20018         (Property.DefineMethod): Use TypeManager.void_type instead of null
20019         for an empty return value.
20020
20021 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20022
20023         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20024         dealing with a FieldExpr which is composed of a FieldBuilder, in
20025         the code path we did extract the constant, but we should have
20026         obtained the underlying value to be able to cast it (otherwise we
20027         end up in an infinite loop, this is what Ravi was running into).
20028
20029         (ArrayCreation.UpdateIndices): Arrays might be empty.
20030
20031         (MemberAccess.ResolveMemberAccess): Add support for section
20032         14.5.4.1 that deals with the special case of E.I when E is a type
20033         and something else, that I can be a reference to a static member.
20034
20035         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20036         handle a particular array type to create byte blobs, it is just
20037         something we dont generate byteblobs for.
20038
20039         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20040         arguments. 
20041
20042         * location.cs (Push): remove the key from the hashtable that we
20043         are about to add.   This happens for empty files.
20044
20045         * driver.cs: Dispose files after we have parsed them.
20046
20047         (tokenize): new function that only runs the tokenizer on its
20048         input, for speed testing.
20049
20050 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20051
20052         * class.cs (Event.Define): Define the private field only if there
20053         are no accessors defined.
20054
20055         * expression.cs (ResolveMemberAccess): If there is no associated
20056         field with the event, that means we have an event defined with its
20057         own accessors and we should flag error cs0070 since transforming
20058         ourselves into a field is not valid in that case.
20059
20060         * ecore.cs (SimpleName.DoResolve): Same as above.
20061
20062         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20063         and charset to sane values.
20064
20065 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20066
20067         * assign.cs (DoResolve): Perform check on events only if they 
20068         are being accessed outside the declaring type.
20069
20070         * cs-parser.jay (event_declarations): Update rules to correctly
20071         set the type of the implicit parameter etc.
20072
20073         (add_accessor, remove_accessor): Set current local parameters.
20074
20075         * expression.cs (Binary): For delegate addition and subtraction,
20076         cast the return value from the method into the appropriate delegate
20077         type.
20078
20079 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20080
20081         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20082         of these as the workaround is unnecessary.
20083
20084         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20085         delegate data - none of that is needed at all.
20086
20087         Re-write bits to extract the instance expression and the delegate method
20088         correctly.
20089
20090         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20091         on delegates too.
20092
20093         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20094         of attaching attributes instead of duplicating code everywhere.
20095
20096         * everywhere : Update code to do attribute emission using the above method.
20097
20098 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20099
20100         * expression.cs (IsParamsMethodApplicable): if there are not
20101         parameters, return immediately.
20102
20103         * ecore.cs: The 0 literal can be implicity converted to an enum
20104         type. 
20105
20106         (SimpleName.DoResolve): First lookup the type, then lookup the
20107         members. 
20108
20109         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20110         want to get its address.  If the InstanceExpression is not
20111         addressable, store the result in a temporary variable, then get
20112         the address of it.
20113
20114         * codegen.cs: Only display 219 errors on warning level or above. 
20115
20116         * expression.cs (ArrayAccess): Make it implement the
20117         IMemoryLocation interface.
20118
20119         (Binary.DoResolve): handle the operator == (object a, object b)
20120         and operator != (object a, object b) without incurring into a
20121         BoxedCast (because 5 != o should never be performed).
20122
20123         Handle binary enumerator operators.
20124
20125         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20126         value type, otherwise use Ldelem_ref.
20127
20128         Use precomputed names;
20129
20130         (AddressOf): Implement address of
20131
20132         * cs-parser.jay (labeled_statement): Fix recursive block
20133         addition by reworking the production.
20134
20135         * expression.cs (New.DoEmit): New has a special case:
20136                 
20137                  If we are dealing with a ValueType, we have a few
20138                  situations to deal with:
20139                 
20140                     * The target of New is a ValueType variable, that is
20141                       easy, we just pass this as the variable reference
20142                 
20143                     * The target of New is being passed as an argument,
20144                       to a boxing operation or a function that takes a
20145                       ValueType.
20146                 
20147                       In this case, we need to create a temporary variable
20148                       that is the argument of New.
20149
20150
20151 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20152
20153         * rootcontext.cs (LookupType): Check that current_type is not null before
20154         going about looking at nested types.
20155
20156         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20157         not implement the IAssignMethod interface any more.
20158
20159         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20160         where we tranform them into FieldExprs if they are being resolved from within
20161         the declaring type.
20162
20163         * ecore.cs (SimpleName.DoResolve): Do the same here.
20164
20165         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20166
20167         * ../errors/bug10.cs : Add.
20168
20169         * ../errors/cs0070.cs : Add.
20170
20171         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20172
20173         * assign.cs : Get rid of EventIsLocal everywhere.
20174
20175 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20176
20177         * ecore.cs (ConvertIntLiteral): finished the implementation.
20178
20179         * statement.cs (SwitchLabel): Convert the value we are using as a
20180         key before looking up the table.
20181
20182 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20183
20184         * codegen.cs (EmitTopBlock): Require a Location argument now.
20185
20186         * cs-parser.jay (constructor_declarator): We need to setup
20187         current_local_parameters before we parse the
20188         opt_constructor_initializer, to allow the variables to be bound
20189         to the constructor arguments.
20190
20191         * rootcontext.cs (LookupType): First lookup nested classes in our
20192         class and our parents before we go looking outside our class.
20193
20194         * expression.cs (ConstantFold): Extract/debox the values at the
20195         beginnning. 
20196
20197         * rootcontext.cs (EmitCode): Resolve the constants first before we
20198         resolve the types.  This is not really needed, but it helps debugging.
20199
20200         * statement.cs: report location.
20201
20202         * cs-parser.jay: pass location to throw statement.
20203
20204         * driver.cs: Small bug fix.
20205
20206         * report.cs: Updated format to be 4-zero filled digits.
20207
20208 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20209
20210         * expression.cs (CheckIndices): Fix minor bug where the wrong
20211         variable was being referred to ;-)
20212
20213         (DoEmit): Do not call EmitStaticInitializers when the 
20214         underlying type is System.Object.
20215
20216 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20217
20218         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20219         and do the usual workaround for SRE.
20220
20221         * class.cs (MyEventBuilder.EventType): New member to get at the type
20222         of the event, quickly.
20223
20224         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20225
20226         * assign.cs (Assign.DoResolve): Handle the case when the target
20227         is an EventExpr and perform the necessary checks.
20228
20229         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20230         interface.
20231
20232         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20233
20234         (EventExpr): Set the type in the constructor itself since we 
20235         are meant to be born fully resolved.
20236
20237         (EventExpr.Define): Revert code I wrote earlier.
20238                 
20239         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20240         instance expression is null. The instance expression is a This in that case
20241         or a null, depending on whether it is a static method or not.
20242
20243         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20244         refers to more than one method.
20245
20246         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20247         and accordingly flag errors.
20248
20249 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20250
20251         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20252
20253 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20254
20255         * location.cs (ToString): Provide useful rutine.
20256
20257 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20258
20259         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20260         objects, return the actual integral boxed.
20261
20262         * statement.cs (SwitchLabel): define an ILLabel for each
20263         SwitchLabel. 
20264
20265         (Switch.CheckSwitch): If the value is a Literal, extract
20266         the underlying literal.
20267
20268         Also in the unused hashtable we had, add the SwitchLabel so we can
20269         quickly look this value up.
20270
20271         * constant.cs: Implement a bunch of new constants.  Rewrite
20272         Literal based on this.  Made changes everywhere to adapt to this.
20273
20274         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20275         dereferencing array only once, and also copes with enumrations.
20276
20277         bytes are two bytes wide, not one.
20278
20279         (Cast): Perform constant conversions.
20280
20281         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20282         wrappers to the literals here.
20283
20284         * expression.cs (DoNumericPromotions): long literals can converted
20285         to ulong implicity (this is taken care of elsewhere, but I was
20286         missing this spot).
20287
20288         * ecore.cs (Expression.Literalize): Make the return type Literal,
20289         to improve type checking.
20290
20291         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20292
20293 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20294
20295         * literal.cs: Revert code from ravi that checked the bounds.  The
20296         bounds are sane by the definition of the type itself. 
20297
20298         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20299         need to actually look up in our parent hierarchy for interfaces
20300         implemented. 
20301
20302         * const.cs: Use the underlying type for enumerations
20303
20304         * delegate.cs: Compute the basename for the delegate creation,
20305         that should fix the delegate test case, and restore the correct
20306         Type Lookup semantics in rootcontext
20307
20308         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20309         referencing a nested type with the Reflection API is using the "+"
20310         sign. 
20311
20312         * cs-parser.jay: Do not require EOF token at the end.
20313
20314 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20315
20316         * rootcontext.cs (LookupType): Concatenate type names with
20317         a '.' instead of a '+' The test suite passes again.
20318
20319         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20320         field of the enumeration.
20321
20322         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20323         the case when the member is an EventExpr.
20324
20325         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20326         static has an associated instance expression.
20327
20328         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20329
20330         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20331
20332         * class.cs (Event.Define): Register event and perform appropriate checks
20333         for error #111.
20334
20335         We define the Add and Remove methods even if the use provides none because
20336         in that case, we provide default implementations ourselves.
20337
20338         Define a private field of the type of the event. This is done by the CSC compiler
20339         and we should be doing it too ;-)
20340
20341         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20342         More methods we use in code we generate.
20343
20344         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20345         is important.
20346
20347         (InitCoreTypes): Update accordingly for the above.
20348
20349         * class.cs (Event.Emit): Generate code for default accessors that we provide
20350
20351         (EmitDefaultMethod): Do the job in the above.
20352
20353         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20354         appropriate place.
20355
20356 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20357
20358         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20359         builders even if we were missing one.
20360
20361         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20362         pass the Basename as our class name instead of the Name.  The
20363         basename will be correctly composed for us.
20364
20365         * parameter.cs (Paramters): Now takes a Location argument.
20366
20367         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20368         make all the code call directly LookupType in RootContext and take
20369         this chance to pass the Location information everywhere.
20370
20371         * Everywhere: pass Location information.
20372
20373 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20374
20375         * class.cs (Constructor.Define): Updated way of detecting the
20376         length of the parameters.
20377
20378         (TypeContainer.DefineType): Use basename as the type name for
20379         nested types.
20380
20381         (TypeContainer.Define): Do not recursively define types here, as
20382         definition is taken care in order by the RootContext.
20383
20384         * tree.cs: Keep track of namespaces in a per-file basis.
20385
20386         * parameter.cs (Parameter.ComputeSignature): Update to use
20387         DeclSpace. 
20388
20389         (Parameters.GetSignature): ditto.
20390
20391         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20392         instead of a TypeContainer.
20393
20394         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20395         resolve names.  Because we need to be resolve in our context, not
20396         our parents.
20397
20398         * driver.cs: Implement response files.
20399
20400         * class.cs (TypeContainer.DefineType): If we are defined, do not
20401         redefine ourselves.
20402
20403         (Event.Emit): Emit the code for add/remove handlers.
20404         (Event.Define): Save the MethodBuilders for add/remove.
20405
20406         * typemanager.cs: Use pair here too.
20407
20408         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20409         DictionaryEntry requires the first argument to be non-null.  
20410
20411         (enum_declaration): Compute full name for registering the
20412         enumeration.
20413
20414         (delegate_declaration): Instead of using
20415         formal_parameter_list, use opt_formal_parameter_list as the list
20416         can be empty.
20417
20418         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20419         (EventParsing): New property that controls whether `add' and
20420         `remove' are returned as tokens or identifiers (for events);
20421
20422 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20423
20424         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20425         use MyEventBuilder only and let it wrap the real builder for us.
20426
20427         (MyEventBuilder): Revamp constructor etc.
20428
20429         Implement all operations that we perform on EventBuilder in precisely the same
20430         way here too.
20431
20432         (FindMembers): Update to use the EventBuilder member.
20433
20434         (Event.Emit): Update accordingly.
20435
20436 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20437
20438         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20439         by calling the appropriate methods.
20440
20441         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20442         useful.
20443
20444         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20445
20446 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20447
20448         * delegate.cs (Delegate.Populate): Check that the return type
20449         and various parameters types are indeed accessible.
20450
20451         * class.cs (Constructor.Define): Same here.
20452
20453         (Field.Define): Ditto.
20454
20455         (Event.Define): Ditto.
20456
20457         (Operator.Define): Check that the underlying Method defined itself
20458         correctly - so it's MethodBuilder should not be null.
20459
20460         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20461         expression happens to be null.
20462
20463         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20464         members but as of now we don't seem to be able to do anything really useful with it.
20465
20466         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20467         not the EventBuilder.
20468
20469 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20470
20471         * cs-tokenizer.cs: Add support for defines.
20472         Add support for #if, #elif, #else, #endif
20473
20474         (eval_var): evaluates a variable.
20475         (eval): stubbed for evaluating functions.
20476
20477         * cs-parser.jay: Pass the defines information
20478
20479         * driver.cs: Add --define command line option.
20480
20481         * decl.cs: Move MemberCore here.
20482
20483         Make it the base class for DeclSpace.  This allows us to catch and
20484         report 108 and 109 for everything now.
20485
20486         * class.cs (TypeContainer.Define): Extract all the members
20487         before populating and emit the warning 108 (new keyword required
20488         to override) instead of having each member implement this.
20489
20490         (MemberCore.Define): New abstract method, we will be using this in
20491         the warning reporting engine in Populate.
20492
20493         (Operator.Define): Adjust to new MemberCore protocol. 
20494
20495         * const.cs (Const): This does not derive from Expression, it is a
20496         temporary object we use to create fields, it is a MemberCore. 
20497
20498         * class.cs (Method.Define): Allow the entry point to be in a
20499         specific class.
20500
20501         * driver.cs: Rewrite the argument handler to clean it up a bit.
20502
20503         * rootcontext.cs: Made it just an auxiliary namespace feature by
20504         making everything static.
20505
20506         * driver.cs: Adapt code to use RootContext type name instead of
20507         instance variable.
20508
20509         * delegate.cs: Remove RootContext argument.
20510
20511         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20512         argument. 
20513
20514         * class.cs (Event.Define): The lookup can fail.
20515
20516         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20517
20518         * expression.cs: Resolve the this instance before invoking the code.
20519
20520 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20521
20522         * cs-parser.jay: Add a production in element_access that allows
20523         the thing to become a "type" reference.  This way we can parse
20524         things like "(string [])" as a type.
20525
20526         Note that this still does not handle the more complex rules of
20527         casts. 
20528
20529
20530         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20531
20532         * ecore.cs: (CopyNewMethods): new utility function used to
20533         assemble the list of methods from running FindMembers.
20534
20535         (MemberLookup): Rework FindMembers so that 
20536
20537 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20538
20539         * class.cs (TypeContainer): Remove Delegates who fail to be
20540         defined.
20541
20542         * delegate.cs (Populate): Verify that we dont get null return
20543         values.   TODO: Check for AsAccessible.
20544
20545         * cs-parser.jay: Use basename to emit error 574 (destructor should
20546         have the same name as container class), not the full name.
20547
20548         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20549         possible representation.  
20550
20551         Also implements integer type suffixes U and L.
20552
20553 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20554
20555         * expression.cs (ArrayCreation.DoResolve): We need to do the
20556         argument resolution *always*.
20557
20558         * decl.cs: Make this hold the namespace.  Hold the root context as
20559         well.
20560         (LookupType): Move here.
20561
20562         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20563
20564         * location.cs (Row, Name): Fixed the code, it was always returning
20565         references to the first file.
20566
20567         * interface.cs: Register properties defined through interfaces.
20568
20569         * driver.cs: Add support for globbing on the command line
20570
20571         * class.cs (Field): Make it derive from MemberCore as well.
20572         (Event): ditto.
20573
20574 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20575
20576         * class.cs (Event::Define): Check that the type of the event is a delegate
20577         type else flag error #66.
20578
20579         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20580         same.
20581
20582         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20583         values of EntryPoint, CharSet etc etc.
20584
20585         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20586
20587         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20588         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20589         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20590         which needs this to do its work.
20591
20592         * ../errors/cs0066.cs : Add.
20593
20594 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20595
20596         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20597         helper functions.
20598
20599         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20600         clears out the parameters field.
20601         (MemberSignatureCompare): Cleanup
20602
20603         (MemberCore): New base class used to share code between MethodCore
20604         and Property.
20605
20606         (RegisterRequiredImplementations) BindingFlags.Public requires
20607         either BindingFlags.Instace or Static.  Use instance here.
20608
20609         (Property): Refactored code to cope better with the full spec.
20610
20611         * parameter.cs (GetParameterInfo): Return an empty array instead
20612         of null on error.
20613
20614         * class.cs (Property): Abstract or extern properties have no bodies.
20615
20616         * parameter.cs (GetParameterInfo): return a zero-sized array.
20617
20618         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20619         method modifier validation to the typecontainer so we can reuse
20620         this on properties.
20621
20622         (MethodCore.ParameterTypes): return an empty sized array of types.
20623
20624         (Property.Define): Test property modifier validity.
20625
20626         Add tests for sealed/override too.
20627
20628         (Method.Emit): abstract or extern methods have no bodies.
20629
20630 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20631
20632         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20633         thing.
20634
20635         (Method::Define, ::Emit): Modify accordingly.
20636
20637         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20638
20639         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20640
20641         * makefile: Pass in /unsafe.
20642
20643 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
20644
20645         * class.cs (MakeKey): Kill routine.
20646
20647         * class.cs (TypeContainer.Define): Correctly define explicit
20648         method implementations (they require the full interface name plus
20649         the method name).
20650
20651         * typemanager.cs: Deply the PtrHashtable here and stop using the
20652         lame keys.  Things work so much better.
20653
20654         This of course broke everyone who depended on `RegisterMethod' to
20655         do the `test for existance' test.  This has to be done elsewhere.
20656
20657         * support.cs (PtrHashtable): A hashtable that avoid comparing with
20658         the object stupid Equals method (because, that like fails all over
20659         the place).  We still do not use it.
20660
20661         * class.cs (TypeContainer.SetRequiredInterface,
20662         TypeContainer.RequireMethods): Killed these two routines and moved
20663         all the functionality to RegisterRequiredImplementations.
20664
20665         (TypeContainer.RegisterRequiredImplementations): This routine now
20666         registers all the implementations required in an array for the
20667         interfaces and abstract methods.  We use an array of structures
20668         which can be computed ahead of time to reduce memory usage and we
20669         also assume that lookups are cheap as most classes will not
20670         implement too many interfaces.
20671
20672         We also avoid creating too many MethodSignatures.
20673
20674         (TypeContainer.IsInterfaceMethod): Update and optionally does not
20675         clear the "pending" bit if we find that there are problems with
20676         the declaration.
20677
20678         (TypeContainer.VerifyPendingMethods): Update to report errors of
20679         methods that look like implementations but are not.
20680
20681         (TypeContainer.Define): Add support for explicit interface method
20682         implementation. 
20683
20684 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
20685
20686         * typemanager.cs: Keep track of the parameters here instead of
20687         being a feature of the TypeContainer.
20688
20689         * class.cs: Drop the registration of parameters here, as
20690         InterfaceMethods are also interface declarations.
20691
20692         * delegate.cs: Register methods with the TypeManager not only with
20693         the TypeContainer.  This code was buggy.
20694
20695         * interface.cs: Full registation here.
20696
20697 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20698
20699         * expression.cs: Remove reducer for binary expressions, it can not
20700         be done this way.
20701
20702         * const.cs: Put here the code that used to go into constant.cs
20703
20704         * constant.cs: Put here the code for constants, this is a new base
20705         class for Literals.
20706
20707         * literal.cs: Make Literal derive from Constant.
20708
20709 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20710
20711         * statement.cs (Return.Emit): Report error 157 if the user
20712         attempts to return from a finally block.
20713
20714         (Return.Emit): Instead of emitting a return, jump to the end of
20715         the function.
20716
20717         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20718         LocalBuilder to store the result of the function.  ReturnLabel is
20719         the target where we jump.
20720
20721
20722 2001-12-09  Radek Doulik  <rodo@ximian.com>
20723
20724         * cs-parser.jay: remember alias in current namespace
20725
20726         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20727         namespaces
20728
20729         * class.cs (LookupAlias): lookup alias in my_namespace
20730
20731         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20732         aliases hashtable
20733         (LookupAlias): lookup alias in this and if needed in parent
20734         namespaces
20735
20736 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20737
20738         * support.cs: 
20739
20740         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20741         making things static.  I need this to avoid passing the
20742         TypeContainer when calling ParameterType.
20743
20744         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20745         that did string manipulation to compute the type and then call
20746         GetType.  Use Parameter.ParameterType instead.
20747
20748         * cs-tokenizer.cs: Consume the suffix for floating values.
20749
20750         * expression.cs (ParameterReference): figure out whether this is a
20751         reference parameter or not.  Kill an extra variable by computing
20752         the arg_idx during emission.
20753
20754         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20755         function that returns whether a parameter is an out/ref value or not.
20756
20757         (Parameter.ParameterType): The type of the parameter (base,
20758         without ref/out applied).
20759
20760         (Parameter.Resolve): Perform resolution here.
20761         (Parameter.ExternalType): The full type (with ref/out applied).
20762
20763         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20764         support for expressions on the using statement.
20765
20766 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20767
20768         * statement.cs (Using.EmitLocalVariableDecls): Split the
20769         localvariable handling of the using statement.
20770
20771         (Block.EmitMeta): Keep track of variable count across blocks.  We
20772         were reusing slots on separate branches of blocks.
20773
20774         (Try.Emit): Emit the general code block, we were not emitting it. 
20775
20776         Check the type of the declaration to be an IDisposable or
20777         something that can be implicity converted to it. 
20778
20779         Emit conversions if required.
20780
20781         * ecore.cs (EmptyExpression): New utility class.
20782         (Expression.ImplicitConversionExists): New utility function.
20783
20784 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20785
20786         * statement.cs (Using): Implement.
20787
20788         * expression.cs (LocalVariableReference): Support read only variables.
20789
20790         * statement.cs: Remove the explicit emit for the Leave opcode.
20791         (VariableInfo): Add a readonly field.
20792
20793 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20794
20795         * ecore.cs (ConvCast): new class used to encapsulate the various
20796         explicit integer conversions that works in both checked and
20797         unchecked contexts.
20798
20799         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20800         properly generate the overflow opcodes.
20801
20802 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20803
20804         * statement.cs: The correct type for the EmptyExpression is the
20805         element_type, not the variable type.  Ravi pointed this out.
20806
20807 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20808
20809         * class.cs (Method::Define): Handle PInvoke methods specially
20810         by using DefinePInvokeMethod instead of the usual one.
20811
20812         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20813         above to do the task of extracting information and defining the method.
20814
20815 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20816
20817         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20818         of the condition for string type.
20819
20820         (Emit): Move that here. 
20821
20822         (ArrayCreation::CheckIndices): Keep string literals in their expression
20823         form.
20824
20825         (EmitDynamicInitializers): Handle strings appropriately.
20826
20827 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20828
20829         * codegen.cs (EmitContext): Replace multiple variables with a
20830         single pointer to the current Switch statement.
20831
20832         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20833         EmitContext.
20834
20835 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20836
20837         * statement.cs 
20838
20839         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20840         default'.
20841
20842         (Foreach.Emit): Foreach on arrays was not setting
20843         up the loop variables (for break/continue).
20844
20845         (GotoCase): Semi-implented.
20846
20847 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20848
20849         * attribute.cs (CheckAttribute): Handle system attributes by using
20850         Attribute.GetAttributes to examine information we need.
20851
20852         (GetValidPlaces): Same here.
20853
20854         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20855
20856         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20857
20858         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20859
20860         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20861
20862         (Method::Emit): Handle the case when we are a PInvoke method.
20863
20864 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20865
20866         * expression.cs: Use ResolveWithSimpleName on compound names.
20867
20868 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20869
20870         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20871         before trying to reduce it.
20872
20873         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20874
20875         * constant.cs (LookupConstantValue): Implement.
20876
20877         (EmitConstant): Use the above in emitting the constant.
20878
20879         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20880         that are user-defined by doing a LookupConstantValue on them.
20881
20882         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20883         too, like above.
20884
20885 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20886
20887         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20888
20889         (BaseAccess.DoResolve): Implement.
20890
20891         (MemberAccess.DoResolve): Split this routine into a
20892         ResolveMemberAccess routine that can be used independently
20893
20894 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20895
20896         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20897         As that share bits of the implementation.  Is returns a boolean,
20898         while As returns the Type that is being probed.
20899
20900 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20901
20902         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20903         instead of a Literal - much easier.
20904
20905         (EnumInTransit): Remove - utterly useless :-)
20906
20907         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20908
20909         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20910
20911         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20912         chain when we have no associated expression.
20913
20914 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20915
20916         * constant.cs (Define): Use Location while reporting the errror.
20917
20918         Also emit a warning when 'new' is used and there is no inherited
20919         member to hide.
20920
20921         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20922         populated.
20923
20924         (LookupEnumValue): Implement to lookup an enum member's value and define it
20925         if necessary.
20926
20927         (Populate): Re-write accordingly to use the above routine.
20928
20929 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20930
20931         * expression.cs (This): Fix prototype for DoResolveLValue to
20932         override the base class DoResolveLValue.
20933
20934         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20935         declarations) 
20936
20937         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20938         (we need to load the address of the field here).  This fixes
20939         test-22. 
20940
20941         (FieldExpr.DoResolveLValue): Call the DoResolve
20942         function to initialize the Instance expression.
20943
20944         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20945         correctly the GetEnumerator operation on a value type.
20946
20947         * cs-parser.jay: Add more simple parsing error catches.
20948
20949         * statement.cs (Switch): Add support for string switches.
20950         Handle null specially.
20951
20952         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20953
20954 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20955
20956         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20957
20958         (declare_local_constant): New helper function.
20959
20960         * statement.cs (AddConstant): Keep a separate record of constants
20961
20962         (IsConstant): Implement to determine if a variable is a constant.
20963
20964         (GetConstantExpression): Implement.
20965
20966         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20967
20968         * statement.cs (IsVariableDefined): Re-write.
20969
20970 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20971
20972         * class.cs (TypeContainer::FindMembers): Look for constants
20973         in the case when we are looking for MemberTypes.Field
20974
20975         * expression.cs (MemberAccess::DoResolve): Check that in the
20976         case we are a FieldExpr and a Literal, we are not being accessed
20977         by an instance reference.
20978
20979         * cs-parser.jay (local_constant_declaration): Implement.
20980
20981         (declaration_statement): Implement for constant declarations.
20982
20983 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20984
20985         * statement.cs (Switch): Catch double defaults.
20986
20987         (Switch): More work on the switch() statement
20988         implementation.  It works for integral values now, need to finish
20989         string support.
20990
20991
20992 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20993
20994         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20995         integer literals into other integer literals.  To be used by
20996         switch. 
20997
20998 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20999
21000         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21001         some memory.
21002
21003         (EmitDynamicInitializers): Cope with the above since we extract data
21004         directly from ArrayData now.
21005
21006         (ExpectInitializers): Keep track of whether initializers are mandatory
21007         or not.
21008
21009         (Bounds): Make it a hashtable to prevent the same dimension being 
21010         recorded for every element in that dimension.
21011
21012         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21013         from being found.
21014
21015         Also fix bug which was causing the indices to be emitted in the reverse
21016         order.
21017
21018 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21019
21020         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21021         unfinished.  They do not work, because the underlying code is
21022         sloppy.
21023
21024 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21025
21026         * cs-parser.jay: Remove bogus fixme.
21027
21028         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21029         on Switch statement.
21030
21031 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21032
21033         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21034         the same. 
21035
21036         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21037         parameter. Apparently, any expression is allowed. 
21038
21039         (ValidateInitializers): Update accordingly.
21040
21041         (CheckIndices): Fix some tricky bugs thanks to recursion.
21042
21043         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21044         I was being completely brain-dead.
21045
21046         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21047         and re-write acordingly.
21048
21049         (DelegateInvocation): Re-write accordingly.
21050
21051         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21052
21053         (MakeByteBlob): Handle types more correctly.
21054
21055         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21056         initialization from expressions but it is incomplete because I am a complete
21057         Dodo :-|
21058
21059 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21060
21061         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21062         on If.  Basically, we have to return `true' (ie, we do return to
21063         our caller) only if both branches of the if return.
21064
21065         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21066         short-circuit operators, handle them as short circuit operators. 
21067
21068         (Cast.DoResolve): Resolve type.
21069         (Cast.Cast): Take an expression as the target type.
21070
21071         * cs-parser.jay (cast_expression): Remove old hack that only
21072         allowed a limited set of types to be handled.  Now we take a
21073         unary_expression and we resolve to a type during semantic
21074         analysis.
21075
21076         Use the grammar productions from Rhys to handle casts (this is
21077         not complete like Rhys syntax yet, we fail to handle that corner
21078         case that C# has regarding (-x), but we will get there.
21079
21080 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21081
21082         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21083         field which is an array type.
21084
21085         * cs-parser.jay (declare_local_variables): Support array initialization too.
21086
21087         * typemanager.cs (MakeKey): Implement.
21088
21089         (everywhere): Use the above appropriately.
21090
21091         * cs-parser.jay (for_statement): Update for array initialization while
21092         declaring variables.
21093
21094         * ecore.cs : The error message was correct, it's the variable's names that
21095         were misleading ;-) Make the code more readable.
21096
21097         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21098         the correct type etc.
21099
21100         (ConvertExplicit): Handle Enum types by examining the underlying type.
21101
21102 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21103
21104         * parameter.cs (GetCallingConvention): Always return
21105         CallingConventions.Standard for now.
21106
21107 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21108
21109         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21110         and `r' after calling DoNumericPromotions.
21111
21112         * ecore.cs: Fix error message (the types were in the wrong order).
21113
21114         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21115         BindingFlags.Instance as well 
21116
21117         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21118         implicit int literal conversion in an empty cast so that we
21119         propagate the right type upstream.
21120
21121         (UnboxCast): new class used to unbox value types.
21122         (Expression.ConvertExplicit): Add explicit type conversions done
21123         by unboxing.
21124
21125         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21126         the target type before applying the implicit LongLiterals to ULong
21127         literal cast.
21128
21129 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21130
21131         * cs-parser.jay (for_statement): Reworked the way For works: now
21132         we declare manually any variables that are introduced in
21133         for_initializer to solve the problem of having out-of-band code
21134         emition (that is what got for broken).
21135
21136         (declaration_statement): Perform the actual variable declaration
21137         that used to be done in local_variable_declaration here.
21138
21139         (local_variable_declaration): Do not declare anything, just pass
21140         the information on a DictionaryEntry
21141
21142 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21143
21144         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21145         re-write of the logic to now make it recursive.
21146
21147         (UpdateIndices): Re-write accordingly.
21148
21149         Store element data in a separate ArrayData list in the above methods.
21150
21151         (MakeByteBlob): Implement to dump the array data into a byte array.
21152
21153 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21154
21155         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21156         into CheckIndices.
21157
21158         * constant.cs (Define): Implement.
21159
21160         (EmitConstant): Re-write fully.
21161
21162         Pass in location info.
21163
21164         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21165         respectively.
21166
21167         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21168         DictionaryEntry since we need location info too.
21169
21170         (constant_declaration): Update accordingly.
21171
21172         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21173         code into another method : UpdateIndices.
21174
21175 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21176
21177         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21178         some type checking etc.
21179
21180 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21181
21182         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21183         bits to provide dimension info if the user skips doing that.
21184
21185         Update second constructor to store the rank correctly.
21186
21187 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21188
21189         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21190         and try to implement.
21191
21192         * ../errors/cs0150.cs : Add.
21193
21194         * ../errors/cs0178.cs : Add.
21195
21196 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21197
21198         * statement.cs: Implement foreach on multi-dimensional arrays. 
21199
21200         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21201         name of the params argument.
21202
21203         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21204         initializing the array.
21205
21206         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21207         we can use this elsewhere.
21208
21209         * statement.cs: Finish implementation of foreach for single
21210         dimension arrays.
21211
21212         * cs-parser.jay: Use an out-of-band stack to pass information
21213         around, I wonder why I need this.
21214
21215         foreach_block: Make the new foreach_block the current_block.
21216
21217         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21218         function used to return a static Parameters structure.  Used for
21219         empty parameters, as those are created very frequently.
21220
21221         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21222
21223 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21224
21225         * interface.cs : Default modifier is private, not public. The
21226         make verify test passes again.
21227
21228 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21229
21230         * support.cs (ReflectionParameters): Fix logic to determine
21231         whether the last parameter is a params one. Test 9 passes again.
21232
21233         * delegate.cs (Populate): Register the builders we define with
21234         RegisterParameterForBuilder. Test 19 passes again.
21235
21236         * cs-parser.jay (property_declaration): Reference $6 instead
21237         of $$ to get at the location.
21238
21239         (indexer_declaration): Similar stuff.
21240
21241         (attribute): Ditto.
21242
21243         * class.cs (Property): Register parameters for the Get and Set methods
21244         if they exist. Test 23 passes again.
21245
21246         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21247         call to EmitArguments as we are sure there aren't any params arguments. 
21248         Test 32 passes again.
21249
21250         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21251         IndexOutOfRangeException. 
21252
21253         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21254         Test 33 now passes again.
21255
21256 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21257
21258         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21259         broke a bunch of things.  Will have to come up with a better way
21260         of tracking locations.
21261
21262         * statement.cs: Implemented foreach for single dimension arrays.
21263
21264 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21265
21266         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21267         an error.  This removes the lookup from the critical path.
21268
21269         * cs-parser.jay: Removed use of temporary_loc, which is completely
21270         broken. 
21271
21272 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21273
21274         * support.cs (ReflectionParameters.ParameterModifier): Report
21275         whether the argument is a PARAMS argument or not.
21276
21277         * class.cs: Set the attribute `ParamArrayAttribute' on the
21278         parameter argument.
21279
21280         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21281         and cons_param_array_attribute (ConstructorInfo for
21282         ParamArrayAttribute)., 
21283
21284         * codegen.cs: Emit the return using the `Return' statement, that
21285         way we can report the error correctly for missing return values. 
21286
21287         * class.cs (Method.Emit): Clean up.
21288
21289         * expression.cs (Argument.Resolve): Take another argument: the
21290         location where this argument is used.  Notice that this is not
21291         part of the "Argument" class as to reduce the size of the
21292         structure (we know the approximate location anyways).
21293
21294         Test if the argument is a variable-reference, if not, then
21295         complain with a 206.
21296
21297         (Argument.Emit): Emit addresses of variables.
21298
21299         (Argument.FullDesc): Simplify.
21300
21301         (Invocation.DoResolve): Update for Argument.Resolve.
21302
21303         (ElementAccess.DoResolve): ditto.
21304
21305         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21306         method should be virtual, as this method is always virtual.
21307
21308         (NewDelegate.DoResolve): Update for Argument.Resolve.
21309
21310         * class.cs (ConstructorInitializer.DoResolve): ditto.
21311
21312         * attribute.cs (Attribute.Resolve): ditto.
21313
21314 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21315
21316         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21317
21318         * expression.cs (ParameterReference): Drop IStackStorage and implement
21319         IAssignMethod instead. 
21320
21321         (LocalVariableReference): ditto.
21322
21323         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21324         IAssignMethod instead. 
21325
21326 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21327
21328         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21329         enumerations that are used in heavily used structures derive from
21330         byte in a laughable and pathetic attempt to reduce memory usage.
21331         This is the kind of pre-optimzations that you should not do at
21332         home without adult supervision.
21333
21334         * expression.cs (UnaryMutator): New class, used to handle ++ and
21335         -- separatedly from the other unary operators.  Cleans up the
21336         code, and kills the ExpressionStatement dependency in Unary.
21337
21338         (Unary): Removed `method' and `Arguments' from this class, making
21339         it smaller, and moving it all to SimpleCall, so I can reuse this
21340         code in other locations and avoid creating a lot of transient data
21341         strucutres when not required.
21342
21343         * cs-parser.jay: Adjust for new changes.
21344
21345 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21346
21347         * enum.cs (Enum.Populate): If there is a failure during
21348         definition, return
21349
21350         * cs-parser.jay (opt_enum_base): we used to catch type errors
21351         here, but this is really incorrect.  The type error should be
21352         catched during semantic analysis.
21353
21354 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21355
21356         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21357         current_local_parameters as expected since I, in my stupidity, had forgotten
21358         to do this :-)
21359
21360         * attribute.cs (GetValidPlaces): Fix stupid bug.
21361
21362         * class.cs (Method::Emit): Perform check on applicability of attributes.
21363
21364         (Constructor::Emit): Ditto.
21365
21366         (Field::Emit): Ditto.
21367
21368         (Field.Location): Store location information.
21369
21370         (Property, Event, Indexer, Operator): Ditto.
21371
21372         * cs-parser.jay (field_declaration): Pass in location for each field.
21373
21374         * ../errors/cs0592.cs : Add.
21375
21376 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21377
21378         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21379
21380         (InitCoreTypes): Update accordingly.
21381
21382         (RegisterAttrType, LookupAttr): Implement.
21383
21384         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21385         info about the same.
21386
21387         (Resolve): Update to populate the above as necessary.
21388
21389         (Error592): Helper.
21390
21391         (GetValidPlaces): Helper to the above.
21392
21393         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21394
21395         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21396
21397 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21398
21399         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21400
21401         * ../errors/cs0617.cs : Add.
21402
21403 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21404
21405         * enum.cs (Emit): Rename to Populate to be more consistent with what
21406         we expect it to do and when exactly it is called.
21407
21408         * class.cs, rootcontext.cs : Update accordingly.
21409
21410         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21411         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21412
21413         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21414
21415         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21416         of a fieldinfo using the above, when dealing with a FieldBuilder.
21417
21418 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21419
21420         * ../errors/cs0031.cs : Add.
21421
21422         * ../errors/cs1008.cs : Add.
21423
21424         * ../errrors/cs0543.cs : Add.
21425
21426         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21427         enum type.
21428
21429         (FindMembers): Implement.
21430
21431         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21432         enums and delegates too.
21433
21434         (enum_types): Rename to builder_to_enum.
21435
21436         (delegate_types): Rename to builder_to_delegate.
21437
21438         * delegate.cs (FindMembers): Implement.
21439
21440 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21441
21442         * typemanager.cs (IsEnumType): Implement.
21443
21444         * enum.cs (Emit): Re-write parts to account for the underlying type
21445         better and perform checking etc.
21446
21447         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21448         of the underlying type.
21449
21450         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21451         value
21452
21453         * enum.cs (error31): Helper to report error #31.
21454
21455         * cs-parser.jay (enum_declaration): Store location of each member too.
21456
21457         * enum.cs (member_to_location): New hashtable. 
21458
21459         (AddEnumMember): Update location hashtable.
21460
21461         (Emit): Use the location of each member while reporting errors.
21462
21463 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21464
21465         * cs-parser.jay: A for_initializer if is a
21466         local_variable_declaration really ammount to have an implicit
21467         block with the variable declaration and no initializer for for.
21468
21469         * statement.cs (For.Emit): Cope with null initializers.
21470
21471         This fixes the infinite loop on for initializers.
21472
21473 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21474
21475         * enum.cs: More cleanup.
21476
21477         * ecore.cs: Remove dead code.
21478
21479         * class.cs (Property.Emit): More simplification.
21480         (Event.Emit): ditto.
21481
21482         Reworked to have less levels of indentation.
21483
21484 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21485
21486         * class.cs (Property): Emit attributes.
21487
21488         (Field): Ditto.
21489
21490         (Event): Ditto.
21491
21492         (Indexer): Ditto.
21493
21494         (Operator): Ditto.
21495
21496         * enum.cs (Emit): Ditto.
21497
21498         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21499         Enums too.
21500
21501         * class.cs (Field, Event, etc.): Move attribute generation into the
21502         Emit method everywhere.
21503
21504         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21505         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21506         as we had no way of defining nested enums !
21507
21508         * rootcontext.cs : Adjust code accordingly.
21509
21510         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21511
21512 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21513
21514         * expression.cs (EvalConstantExpression): Move into ecore.cs
21515
21516         * enum.cs (Enum): Rename some members and make them public and readonly
21517         according to our convention.
21518
21519         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21520         nothing else.
21521
21522         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21523
21524         (Enum::Emit): Write a simple version for now which doesn't try to compute
21525         expressions. I shall modify this to be more robust in just a while.
21526
21527         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21528
21529         (TypeContainer::CloseType): Create the Enum types too.
21530
21531         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21532
21533         * expression.cs (EvalConstantExpression): Get rid of completely.
21534
21535         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21536         user-defined values and other cases.
21537
21538         (IsValidEnumLiteral): Helper function.
21539
21540         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21541         out there in the case we had a literal FieldExpr.
21542
21543         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21544
21545         (Literalize): Revamp a bit to take two arguments.
21546
21547         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21548
21549 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21550
21551         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21552
21553         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21554
21555         (Resolve): Use the above to ensure we have proper initializers.
21556
21557 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21558
21559         * expression.cs (Expression::EvalConstantExpression): New method to 
21560         evaluate constant expressions.
21561
21562         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21563
21564 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21565
21566         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21567         in an array.
21568
21569         (Binary.ResolveOperator): Handle operator != (object a, object b)
21570         and operator == (object a, object b);
21571
21572         (Binary.DoNumericPromotions): Indicate whether the numeric
21573         promotion was possible.
21574
21575         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21576         Implement.  
21577
21578         Made the ArrayAccess implement interface IAssignMethod instead of
21579         IStackStore as the order in which arguments are passed reflects
21580         this.
21581
21582         * assign.cs: Instead of using expr.ExprClass to select the way of
21583         assinging, probe for the IStackStore/IAssignMethod interfaces.
21584
21585         * typemanager.cs: Load InitializeArray definition.
21586
21587         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21588         static data that can be used to initialize arrays. 
21589
21590 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21591
21592         * expression.cs: Handle operator== and operator!= for booleans.
21593
21594         (Conditioal.Reduce): Implement reducer for the ?: operator.
21595
21596         (Conditional.Resolve): Implement dead code elimination.
21597
21598         (Binary.Resolve): Catch string literals and return a new
21599         concatenated string.
21600
21601         (Unary.Reduce): Implement reduction of unary expressions.
21602
21603         * ecore.cs: Split out the expression core handling here.
21604
21605         (Expression.Reduce): New method used to perform constant folding
21606         and CSE.  This is needed to support constant-expressions. 
21607
21608         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21609         targets, and optimize for !x.
21610
21611 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21612
21613         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21614         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21615         set custom atttributes.
21616
21617         * literal.cs (Literal::GetValue): New abstract method to return the actual
21618         value of the literal, cast as an object.
21619
21620         (*Literal): Implement GetValue method.
21621
21622         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21623         expressions to the arraylist but objects of type Argument.
21624
21625         * class.cs (TypeContainer::Emit): Emit our attributes too.
21626
21627         (Method::Emit, Constructor::Emit): Ditto.
21628
21629         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21630         to be ignoring earlier.
21631
21632 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21633
21634         * attribute.cs (AttributeSection::Define): Implement to do the business
21635         of constructing a CustomAttributeBuilder.
21636
21637         (Attribute): New trivial class. Increases readability of code.  
21638
21639         * cs-parser.jay : Update accordingly.
21640
21641         (positional_argument_list, named_argument_list, named_argument): New rules
21642
21643         (attribute_arguments): Use the above so that we are more correct.
21644
21645 2001-11-02  Ravi Pratap  <ravi@ximian.com>
21646
21647         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21648         to perform all checks for a method with a params parameter.
21649
21650         (Invocation::OverloadResolve): Update to use the above method and therefore
21651         cope correctly with params method invocations.
21652
21653         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
21654         params too.
21655
21656         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21657         constructors in our parent too because we can't afford to miss out on 
21658         protected ones ;-)
21659
21660         * attribute.cs (AttributeSection): New name for the class Attribute
21661
21662         Other trivial changes to improve readability.
21663
21664         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21665         use the new class names.
21666
21667 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21668
21669         * class.cs (Method::Define): Complete definition for params types too
21670
21671         (Indexer::Define): Ditto.
21672
21673         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21674         Cope everywhere with a request for info about the array parameter.
21675
21676 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21677
21678         * tree.cs (RecordNamespace): Fix up to check for the correct key.
21679
21680         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
21681         local_variable_type to extract the string corresponding to the type.
21682
21683         (local_variable_type): Fixup the action to use the new helper method.
21684
21685         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21686         go.
21687
21688         * expression.cs : Clean out code which uses the above.
21689
21690 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21691
21692         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21693         and bale out if necessary by returning a false.
21694
21695         (RegisterProperty): Ditto.
21696
21697         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21698         and print out appropriate error messages.
21699
21700         * interface.cs (everywhere): Ditto.
21701
21702         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21703         location to constructor.
21704
21705         * class.cs (Property, Event, Indexer): Update accordingly.
21706
21707         * ../errors/cs111.cs : Added.
21708
21709         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21710         of a method, as laid down by the spec.
21711
21712         (Invocation::OverloadResolve): Use the above method.
21713
21714 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21715
21716         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21717         now take a TypeContainer and a Parameters object.
21718
21719         (ParameterData): Modify return type of ParameterModifier method to be 
21720         Parameter.Modifier and not a string.
21721
21722         (ReflectionParameters, InternalParameters): Update accordingly.
21723
21724         * expression.cs (Argument::GetParameterModifier): Same here.
21725
21726         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21727         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21728         symbol in it at all so maybe this is only for now.
21729
21730 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21731
21732         * support.cs (InternalParameters): Constructor now takes an extra argument 
21733         which is the actual Parameters class.
21734
21735         (ParameterDesc): Update to provide info on ref/out modifiers.
21736
21737         * class.cs (everywhere): Update call to InternalParameters to pass in
21738         the second argument too.
21739
21740         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21741         to return the modifier info [ref/out etc]
21742
21743         (InternalParameters, ReflectionParameters): Implement the above.
21744
21745         * expression.cs (Argument::ParameterModifier): Similar function to return
21746         info about the argument's modifiers.
21747
21748         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21749         too.
21750
21751         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21752         a new SetFormalParameters object which we pass to InternalParameters.
21753
21754 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21755
21756         * expression.cs (NewArray): Merge into the ArrayCreation class.
21757
21758 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21759
21760         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21761         NewUserdefinedArray into one as there wasn't much of a use in having
21762         two separate ones.
21763
21764         * expression.cs (Argument): Change field's name to ArgType from Type.
21765
21766         (Type): New readonly property which returns the proper type, taking into 
21767         account ref/out modifiers.
21768
21769         (everywhere): Adjust code accordingly for the above.
21770
21771         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21772         whether we are emitting for a ref or out parameter.
21773
21774         * expression.cs (Argument::Emit): Use the above field to set the state.
21775
21776         (LocalVariableReference::Emit): Update to honour the flag and emit the
21777         right stuff.
21778
21779         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21780
21781         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21782
21783         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21784
21785         (ReflectionParameters, InternalParameters): Implement the above method.
21786
21787         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21788         reporting errors.
21789
21790         (Invocation::FullMethodDesc): Ditto. 
21791
21792 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21793
21794         * cs-parser.jay: Add extra production for the second form of array
21795         creation. 
21796
21797         * expression.cs (ArrayCreation): Update to reflect the above
21798         change. 
21799
21800         * Small changes to prepare for Array initialization.
21801
21802 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21803
21804         * typemanager.cs (ImplementsInterface): interface might be null;
21805         Deal with this problem;
21806
21807         Also, we do store negative hits on the cache (null values), so use
21808         this instead of calling t.GetInterfaces on the type everytime.
21809
21810 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21811
21812         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21813
21814         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21815         split functionality out into different classes.
21816
21817         (New::FormArrayType): Move into NewBuiltinArray.
21818
21819         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21820         quite useless.
21821
21822         (NewBuiltinArray): New class to handle creation of built-in arrays.
21823
21824         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21825         account creation of one-dimensional arrays.
21826
21827         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21828
21829         (NewUserdefinedArray::DoResolve): Implement.
21830
21831         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21832
21833         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21834         we maintain inside the TypeManager. This is necessary to perform lookups on the
21835         module builder.
21836
21837         (LookupType): Update to perform GetType on the module builders too.     
21838
21839         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21840
21841         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21842
21843 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21844
21845         * expression.cs (New::DoResolve): Implement guts of array creation.
21846
21847         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21848
21849 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21850
21851         * expression.cs: Fix bug I introduced lsat night that broke
21852         Delegates. 
21853
21854         (Expression.Resolve): Report a 246 error (can not resolve name)
21855         if we find a SimpleName in the stream.
21856
21857         (Expression.ResolveLValue): Ditto.
21858
21859         (Expression.ResolveWithSimpleName): This function is a variant of
21860         ResolveName, this one allows SimpleNames to be returned without a
21861         warning.  The only consumer of SimpleNames is MemberAccess
21862
21863 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21864
21865         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21866         might arrive here.  I have my doubts that this is correct.
21867
21868         * statement.cs (Lock): Implement lock statement.
21869
21870         * cs-parser.jay: Small fixes to support `lock' and `using'
21871
21872         * cs-tokenizer.cs: Remove extra space
21873
21874         * driver.cs: New flag --checked, allows to turn on integer math
21875         checking. 
21876
21877         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21878         Threading.Monitor.Exit 
21879
21880 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21881
21882         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21883         Expression Class to be IndexerAccess.
21884
21885         Notice that Indexer::DoResolve sets the eclass to Value.
21886
21887 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21888
21889         * class.cs (TypeContainer::Emit): Emit code for indexers.
21890
21891         * assign.cs (IAssignMethod): New interface implemented by Indexers
21892         and Properties for handling assignment.
21893
21894         (Assign::Emit): Simplify and reuse code. 
21895
21896         * expression.cs (IndexerAccess, PropertyExpr): Implement
21897         IAssignMethod, clean up old code. 
21898
21899 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21900
21901         * typemanager.cs (ImplementsInterface): New method to determine if a type
21902         implements a given interface. Provides a nice cache too.
21903
21904         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21905         method.
21906
21907         (ConvertReferenceExplicit): Ditto.
21908
21909         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21910         various methods, with correct names etc.
21911
21912         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21913         Operator.UnaryNegation.
21914
21915         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21916         we have a unary plus or minus operator.
21917
21918         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21919         UnaryMinus.
21920
21921         * everywhere : update accordingly.
21922
21923         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21924         respectively.
21925
21926         * class.cs (Method::Define): For the case where we are implementing a method
21927         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21928         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21929
21930 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21931
21932         * interface.cs (FindMembers): Implement to work around S.R.E
21933         lameness.
21934
21935         * typemanager.cs (IsInterfaceType): Implement.
21936
21937         (FindMembers): Update to handle interface types too.
21938
21939         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21940         use IsAssignableFrom as that is not correct - it doesn't work.
21941
21942         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21943         and accordingly override EmitStatement.
21944
21945         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21946         using the correct logic :-)
21947
21948 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21949
21950         * ../errors/cs-11.cs : Add to demonstrate error -11 
21951
21952 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21953
21954         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21955         then pass this as a hint to ResolveLValue.
21956
21957         * expression.cs (FieldExpr): Add Location information
21958
21959         (FieldExpr::LValueResolve): Report assignment to readonly
21960         variable. 
21961
21962         (Expression::ExprClassFromMemberInfo): Pass location information.
21963
21964         (Expression::ResolveLValue): Add new method that resolves an
21965         LValue. 
21966
21967         (Expression::DoResolveLValue): Default invocation calls
21968         DoResolve. 
21969
21970         (Indexers): New class used to keep track of indexers in a given
21971         Type. 
21972
21973         (IStackStore): Renamed from LValue, as it did not really describe
21974         what this did.  Also ResolveLValue is gone from this interface and
21975         now is part of Expression.
21976
21977         (ElementAccess): Depending on the element access type
21978
21979         * typemanager.cs: Add `indexer_name_type' as a Core type
21980         (System.Runtime.CompilerServices.IndexerNameAttribute)
21981
21982         * statement.cs (Goto): Take a location.
21983
21984 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21985
21986         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21987         if two delegates are compatible.
21988
21989         (NewDelegate::DoResolve): Update to take care of the case when
21990         we instantiate a delegate from another delegate.
21991
21992         * typemanager.cs (FindMembers): Don't even try to look up members
21993         of Delegate types for now.
21994
21995 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21996
21997         * delegate.cs (NewDelegate): New class to take care of delegate
21998         instantiation.
21999
22000         * expression.cs (New): Split the delegate related code out into 
22001         the NewDelegate class.
22002
22003         * delegate.cs (DelegateInvocation): New class to handle delegate 
22004         invocation.
22005
22006         * expression.cs (Invocation): Split out delegate related code into
22007         the DelegateInvocation class.
22008
22009 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22010
22011         * expression.cs (New::DoResolve): Implement delegate creation fully
22012         and according to the spec.
22013
22014         (New::DoEmit): Update to handle delegates differently.
22015
22016         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22017         because of which we were printing out arguments in reverse order !
22018
22019         * delegate.cs (VerifyMethod): Implement to check if the given method
22020         matches the delegate.
22021
22022         (FullDelegateDesc): Implement.
22023
22024         (VerifyApplicability): Implement.
22025
22026         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22027         delegate invocations too.
22028
22029         (Invocation::Emit): Ditto.
22030
22031         * ../errors/cs1593.cs : Added.
22032
22033         * ../errors/cs1594.cs : Added.
22034
22035         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22036
22037 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22038
22039         * typemanager.cs (intptr_type): Core type for System.IntPtr
22040
22041         (InitCoreTypes): Update for the same.
22042
22043         (iasyncresult_type, asynccallback_type): Ditto.
22044
22045         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22046         correct.
22047
22048         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22049         too.
22050
22051         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22052         the builders for the 4 members of a delegate type :-)
22053
22054         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22055         type.
22056
22057         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22058
22059         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22060
22061 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22062
22063         * statement.cs (Break::Emit): Implement.   
22064         (Continue::Emit): Implement.
22065
22066         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22067         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22068         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22069         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22070         end loop
22071
22072         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22073         properties that track the label for the current loop (begin of the
22074         loop and end of the loop).
22075
22076 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22077
22078         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22079         use of emitting anything at all.
22080
22081         * class.cs, rootcontext.cs : Get rid of calls to the same.
22082
22083         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22084
22085         (Populate): Define the constructor correctly and set the implementation
22086         attributes.
22087
22088         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22089         have been defined.
22090
22091         (AddDelegateType): Implement.
22092
22093         (IsDelegateType): Implement helper method.
22094
22095         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22096
22097         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22098         and accordingly handle it.
22099
22100         * delegate.cs (Populate): Take TypeContainer argument.
22101         Implement bits to define the Invoke method. However, I still haven't figured out
22102         how to take care of the native int bit :-(
22103
22104         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22105         Qualify the name of the delegate, not its return type !
22106
22107         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22108         conversion.
22109
22110         (StandardConversionExists): Checking for array types turns out to be recursive.
22111
22112         (ConvertReferenceExplicit): Implement array conversion.
22113
22114         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22115
22116 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22117
22118         * cs-parser.jay (delegate_declaration): Store the fully qualified
22119         name as it is a type declaration.
22120
22121         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22122         readonly.
22123
22124         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22125         as TypeContainer::DefineType.
22126
22127         (Populate): Method in which all the definition of the various methods (Invoke)
22128         etc is done.
22129
22130         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22131         see.
22132
22133         (CloseDelegate): Finally creates the delegate.
22134
22135         * class.cs (TypeContainer::DefineType): Update to define delegates.
22136         (Populate, Emit and CloseType): Do the same thing here too.
22137
22138         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22139         delegates in all these operations.
22140
22141 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22142
22143         * expression.cs: LocalTemporary: a new expression used to
22144         reference a temporary that has been created.
22145
22146         * assign.cs: Handle PropertyAccess back here, so that we can
22147         provide the proper semantic access to properties.
22148
22149         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22150         a few more explicit conversions. 
22151
22152         * modifiers.cs: `NEW' modifier maps to HideBySig.
22153
22154         * expression.cs (PropertyExpr): Make this into an
22155         ExpressionStatement, and support the EmitStatement code path. 
22156
22157         Perform get/set error checking, clean up the interface.
22158
22159         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22160         them into toplevel access objects.
22161
22162 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22163
22164         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22165         SRE.
22166
22167         * typemanager.cs: Keep track here of our PropertyBuilders again to
22168         work around lameness in SRE.
22169
22170 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22171
22172         * expression.cs (LValue::LValueResolve): New method in the
22173         interface, used to perform a second resolution pass for LValues. 
22174
22175         (This::DoResolve): Catch the use of this in static methods.
22176
22177         (This::LValueResolve): Implement.
22178
22179         (This::Store): Remove warning, assigning to `this' in structures
22180         is 
22181
22182         (Invocation::Emit): Deal with invocation of
22183         methods on value types.  We need to pass the address to structure
22184         methods rather than the object itself.  (The equivalent code to
22185         emit "this" for structures leaves the entire structure on the
22186         stack instead of a pointer to it). 
22187
22188         (ParameterReference::DoResolve): Compute the real index for the
22189         argument based on whether the method takes or not a `this' pointer
22190         (ie, the method is static).
22191
22192         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22193         value types returned from functions when we need to invoke a
22194         method on the sturcture.
22195
22196
22197 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22198
22199         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22200         defining the type in the Modulebuilder or Typebuilder. This is to take
22201         care of nested types which need to be defined on the TypeBuilder using
22202         DefineNestedMethod.
22203
22204         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22205         methods in RootContext, only ported to be part of TypeContainer.
22206
22207         (TypeContainer::GetInterfaceOrClass): Ditto.
22208
22209         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22210
22211         * interface.cs (Interface::DefineInterface): New method. Does exactly
22212         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22213         too.
22214
22215         (Interface::GetInterfaces): Move from RootContext here and port.
22216
22217         (Interface::GetInterfaceByName): Same here.
22218
22219         * rootcontext.cs (ResolveTree): Re-write.
22220
22221         (PopulateTypes): Re-write.
22222
22223         * class.cs (TypeContainer::Populate): Populate nested types too.
22224         (TypeContainer::Emit): Emit nested members too.
22225
22226         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22227         instead just use the name argument passed in as it is already fully
22228         qualified.
22229
22230         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22231         to TypeContainer mapping to see if a type is user-defined.
22232
22233         * class.cs (TypeContainer::CloseType): Implement. 
22234
22235         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22236         the default constructor.
22237
22238         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22239         twice.
22240
22241         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22242
22243         * interface.cs (CloseType): Create the type here.
22244
22245         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22246         the hierarchy.
22247
22248         Remove all the methods which are now in TypeContainer.
22249
22250 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22251
22252         * delegate.cs (Define): Re-write bits to define the delegate
22253         correctly.
22254
22255 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22256
22257         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22258
22259         * expression.cs (ImplicitReferenceConversion): handle null as well
22260         as a source to convert to any reference type.
22261
22262         * statement.cs (Return): Perform any implicit conversions to
22263         expected return type.  
22264
22265         Validate use of return statement.  
22266
22267         * codegen.cs (EmitContext): Pass the expected return type here.
22268
22269         * class.cs (Method, Constructor, Property): Pass expected return
22270         type to EmitContext.
22271
22272 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22273
22274         * expression.cs: Make DoResolve take an EmitContext instead of a
22275         TypeContainer.
22276
22277         Replaced `l' and `location' for `loc', for consistency.
22278
22279         (Error, Warning): Remove unneeded Tc argument.
22280
22281         * assign.cs, literal.cs, constant.cs: Update to new calling
22282         convention. 
22283
22284         * codegen.cs: EmitContext now contains a flag indicating whether
22285         code is being generated in a static method or not.
22286
22287         * cs-parser.jay: DecomposeQI, new function that replaces the old
22288         QualifiedIdentifier.  Now we always decompose the assembled
22289         strings from qualified_identifier productions into a group of
22290         memberaccesses.
22291
22292 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22293
22294         * rootcontext.cs: Deal with field-less struct types correctly now
22295         by passing the size option to Define Type.
22296
22297         * class.cs: Removed hack that created one static field. 
22298
22299 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22300
22301         * statement.cs: Moved most of the code generation here. 
22302
22303 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22304
22305         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22306         seem very right.
22307
22308         (ElementAccess): Remove useless bits for now - keep checks as the spec
22309         says.
22310
22311 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22312
22313         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22314         and start performing checks according to the spec.
22315
22316 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22317
22318         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22319         rank_specifiers instead.
22320
22321         (rank_specifiers): Change the order in which the rank specifiers are stored
22322
22323         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22324
22325         * expression.cs (ElementAccess): Implement the LValue interface too.
22326
22327 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22328
22329         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22330         except that user defined conversions are not included.
22331
22332         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22333         perform the conversion of the return type, if necessary.
22334
22335         (New::DoResolve): Check whether we are creating an array or an object
22336         and accordingly do the needful.
22337
22338         (New::Emit): Same here.
22339
22340         (New::DoResolve): Implement guts of array creation.
22341
22342         (New::FormLookupType): Helper function.
22343
22344 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22345
22346         * codegen.cs: Removed most of the code generation here, and move the
22347         corresponding code generation bits to the statement classes. 
22348
22349         Added support for try/catch/finalize and throw.
22350
22351         * cs-parser.jay: Added support for try/catch/finalize.
22352
22353         * class.cs: Catch static methods having the flags override,
22354         virtual or abstract.
22355
22356         * expression.cs (UserCast): This user cast was not really doing
22357         what it was supposed to do.  Which is to be born in fully resolved
22358         state.  Parts of the resolution were being performed at Emit time! 
22359
22360         Fixed this code.
22361
22362 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22363
22364         * expression.cs: Implicity convert the result from UserCast.
22365
22366 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22367
22368         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22369         prevented it from working correctly. 
22370
22371         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22372         merely ConvertImplicit.
22373
22374 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22375
22376         * typemanager.cs: Make the LookupTypeContainer function static,
22377         and not per-instance.  
22378
22379         * class.cs: Make static FindMembers (the one that takes a Type
22380         argument). 
22381
22382         * codegen.cs: Add EmitForeach here.
22383
22384         * cs-parser.jay: Make foreach a toplevel object instead of the
22385         inline expansion, as we need to perform semantic analysis on it. 
22386
22387 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22388
22389         * expression.cs (Expression::ImplicitUserConversion): Rename to
22390         UserDefinedConversion.
22391
22392         (Expression::UserDefinedConversion): Take an extra argument specifying 
22393         whether we look for explicit user conversions too.
22394
22395         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22396
22397         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22398
22399         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22400         with the appropriate arguments.
22401
22402         * cs-parser.jay (cast_expression): Record location too.
22403
22404         * expression.cs (Cast): Record location info.
22405
22406         (Expression::ConvertExplicit): Take location argument.
22407
22408         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22409         to determine if we are doing explicit conversions.
22410
22411         (UserCast::Emit): Update accordingly.
22412
22413         (Expression::ConvertExplicit): Report an error if everything fails.
22414
22415         * ../errors/cs0030.cs : Add.
22416
22417 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22418
22419         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22420         virtual and newslot bits. 
22421
22422         * class.cs (TypeContainer::RegisterRequiredImplementations):
22423         Record methods we need.
22424
22425         (TypeContainer::MakeKey): Helper function to make keys for
22426         MethodBases, since the Methodbase key is useless.
22427
22428         (TypeContainer::Populate): Call RegisterRequiredImplementations
22429         before defining the methods.   
22430
22431         Create a mapping for method_builders_to_methods ahead of time
22432         instead of inside a tight loop.
22433
22434         (::RequireMethods):  Accept an object as the data to set into the
22435         hashtable so we can report interface vs abstract method mismatch.
22436
22437 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22438
22439         * report.cs: Make all of it static.
22440
22441         * rootcontext.cs: Drop object_type and value_type computations, as
22442         we have those in the TypeManager anyways.
22443
22444         Drop report instance variable too, now it is a global.
22445
22446         * driver.cs: Use try/catch on command line handling.
22447
22448         Add --probe option to debug the error reporting system with a test
22449         suite. 
22450
22451         * report.cs: Add support for exiting program when a probe
22452         condition is reached.
22453
22454 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22455
22456         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22457         we do a forcible conversion regardless of type, to check if 
22458         ForceConversion returns a null.
22459
22460         (Binary::error19): Use location to report error.
22461
22462         (Unary::error23): Use location here too.
22463
22464         * ../errors/cs0019.cs : Check in.
22465
22466         * ../errors/cs0023.cs : Check in.
22467
22468         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22469         case of a non-null MethodInfo object with a length of 0 !
22470
22471         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22472         an applicable member - according to the spec :-)
22473         Also fix logic to find members in base types.
22474
22475         (Unary::ResolveOperator): Same here.
22476
22477         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22478         as I was getting thoroughly confused between this and error19 :-)
22479
22480         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22481         (::FindMostEncompassedType): Implement.
22482         (::FindMostEncompassingType): Implement.
22483         (::StandardConversionExists): Implement.
22484
22485         (UserImplicitCast): Re-vamp. We now need info about most specific
22486         source and target types so that we can do the necessary conversions.
22487
22488         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22489         mathematical union with no duplicates.
22490
22491 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22492
22493         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22494         in order from base classes to child classes, so that we can in
22495         child classes look up in our parent for method names and
22496         attributes (required for handling abstract, virtual, new, override
22497         constructs: we need to instrospect our base class, and if we dont
22498         populate the classes in order, the introspection might be
22499         incorrect.  For example, a method could query its parent before
22500         the parent has any methods and would determine that the parent has
22501         no abstract methods (while it could have had them)).
22502
22503         (RootContext::CreateType): Record the order in which we define the
22504         classes.
22505
22506 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22507
22508         * class.cs (TypeContainer::Populate): Also method definitions can
22509         fail now, keep track of this.
22510
22511         (TypeContainer::FindMembers): Implement support for
22512         DeclaredOnly/noDeclaredOnly flag.
22513
22514         (Constructor::Emit) Return the ConstructorBuilder.
22515
22516         (Method::Emit) Return the MethodBuilder. 
22517         Check for abstract or virtual methods to be public.
22518
22519         * rootcontext.cs (RootContext::CreateType): Register all the
22520         abstract methods required for the class to be complete and the
22521         interface methods that must be implemented. 
22522
22523         * cs-parser.jay: Report error 501 (method requires body if it is
22524         not marked abstract or extern).
22525
22526         * expression.cs (TypeOf::Emit): Implement.
22527
22528         * typemanager.cs: runtime_handle_type, new global type.
22529
22530         * class.cs (Property::Emit): Generate code for properties.
22531
22532 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22533
22534         * expression.cs (Unary::ResolveOperator): Find operators on base type
22535         too - we now conform exactly to the spec.
22536
22537         (Binary::ResolveOperator): Same here.
22538
22539         * class.cs (Operator::Define): Fix minor quirk in the tests.
22540
22541         * ../errors/cs0215.cs : Added.
22542
22543         * ../errors/cs0556.cs : Added.
22544
22545         * ../errors/cs0555.cs : Added.
22546
22547 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22548
22549         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22550         single integer which is really efficient
22551
22552 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22553
22554         *  expression.cs (Expression::ImplicitUserConversion): Use location
22555         even in the case when we are examining True operators.
22556  
22557         * class.cs (Operator::Define): Perform extensive checks to conform
22558         with the rules for operator overloading in the spec.
22559
22560         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22561         some of the other conversions mentioned in the spec.
22562
22563         * typemanager.cs (array_type): New static member for the System.Array built-in
22564         type.
22565
22566         (cloneable_interface): For System.ICloneable interface.
22567
22568         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22569         we start resolving the tree and populating types.
22570
22571         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22572  
22573 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22574
22575         * expression.cs (Expression::ExprClassFromMemberInfo,
22576         Expression::Literalize): Create literal expressions from
22577         FieldInfos which are literals.
22578
22579         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22580         type casts, because they were wrong.  The test suite in tests
22581         caught these ones.
22582
22583         (ImplicitNumericConversion): ushort to ulong requires a widening
22584         cast. 
22585
22586         Int32 constant to long requires widening cast as well.
22587
22588         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22589         for integers because the type on the stack is not i4.
22590
22591 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22592
22593         * expression.cs (report118): require location argument. 
22594
22595         * parameter.cs: Do not dereference potential null value.
22596
22597         * class.cs: Catch methods that lack the `new' keyword when
22598         overriding a name.  Report warnings when `new' is used without
22599         anything being there to override.
22600
22601         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22602
22603         * class.cs: Only add constructor to hashtable if it is non-null
22604         (as now constructors can fail on define).
22605
22606         (TypeManager, Class, Struct): Take location arguments.
22607
22608         Catch field instance initialization in structs as errors.
22609
22610         accepting_filter: a new filter for FindMembers that is static so
22611         that we dont create an instance per invocation.
22612
22613         (Constructor::Define): Catch errors where a struct constructor is
22614         parameterless 
22615
22616         * cs-parser.jay: Pass location information for various new
22617         constructs. 
22618
22619         * delegate.cs (Delegate): take a location argument.
22620
22621         * driver.cs: Do not call EmitCode if there were problesm in the
22622         Definition of the types, as many Builders wont be there. 
22623
22624         * decl.cs (Decl::Decl): Require a location argument.
22625
22626         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22627         into integers, and find the most appropiate integer for it.
22628
22629         * literal.cs: Implement ULongLiteral.
22630
22631         * rootcontext.cs: Provide better information about the location of
22632         failure when CreateType fails.
22633
22634 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22635
22636         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22637         as well.
22638
22639         * expression.cs (Binary::CheckShiftArguments): Add missing type
22640         computation.
22641         (Binary::ResolveOperator): Add type to the logical and and logical
22642         or, Bitwise And/Or and Exclusive Or code paths, it was missing
22643         before.
22644
22645         (Binary::DoNumericPromotions): In the case where either argument
22646         is ulong (and most signed types combined with ulong cause an
22647         error) perform implicit integer constant conversions as well.
22648
22649 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22650
22651         * expression.cs (UserImplicitCast): Method should always be
22652         non-null. 
22653         (Invocation::BetterConversion): Simplified test for IntLiteral.
22654
22655         (Expression::ImplicitNumericConversion): Split this routine out.
22656         Put the code that performs implicit constant integer conversions
22657         here. 
22658
22659         (Expression::Resolve): Become a wrapper around DoResolve so we can
22660         check eclass and type being set after resolve.
22661
22662         (Invocation::Badness): Remove this dead function
22663
22664         (Binary::ResolveOperator): Do not compute the expensive argumnets
22665         unless we have a union for it.
22666
22667         (Probe::Emit): Is needs to do an isinst and then
22668         compare against null.
22669
22670         (::CanConvert): Added Location argument.  If the Location argument
22671         is null (Location.Null), then we do not report errors.  This is
22672         used by the `probe' mechanism of the Explicit conversion.  We do
22673         not want to generate an error for something that the user
22674         explicitly requested to be casted.  But the pipeline for an
22675         explicit cast first tests for potential implicit casts.
22676
22677         So for now, if the Location is null, it means `Probe only' to
22678         avoid adding another argument.   Might have to revise this
22679         strategy later.
22680
22681         (ClassCast): New class used to type cast objects into arbitrary
22682         classes (used in Explicit Reference Conversions).
22683
22684         Implement `as' as well.
22685
22686         Reverted all the patches from Ravi below: they were broken:
22687
22688                 * The use of `level' as a mechanism to stop recursive
22689                   invocations is wrong.  That was there just to catch the
22690                   bug with a strack trace but not as a way of addressing
22691                   the problem.
22692
22693                   To fix the problem we have to *understand* what is going
22694                   on and the interactions and come up with a plan, not
22695                   just get things going.
22696
22697                 * The use of the type conversion cache that I proposed
22698                   last night had an open topic: How does this work across
22699                   protection domains.  A user defined conversion might not
22700                   be public in the location where we are applying the
22701                   conversion, a different conversion might be selected
22702                   (ie, private A->B (better) but public B->A (worse),
22703                   inside A, A->B applies, but outside it, B->A will
22704                   apply).
22705
22706                 * On top of that (ie, even if the above is solved),
22707                   conversions in a cache need to be abstract.  Ie, `To
22708                   convert from an Int to a Short use an OpcodeCast', not
22709                   `To convert from an Int to a Short use the OpcodeCast on
22710                   the variable 5' (which is what this patch was doing).
22711
22712 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22713
22714         * expression.cs (Invocation::ConversionExists): Re-write to use
22715         the conversion cache
22716
22717         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22718         cache all conversions done, not just user-defined ones.
22719
22720         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22721         to determine if a conversion exists instead of acutually trying to 
22722         perform the conversion. It's faster too.
22723
22724         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22725         and only then attempt the implicit conversion.
22726
22727 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22728
22729         * expression.cs (ConvertImplicit): Use a cache for conversions
22730         already found. Check level of recursion and bail out if necessary.
22731
22732 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22733
22734         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22735         Export standard methods that we expect for string operations.
22736
22737         * statement.cs (Block::UsageWarning): Track usage of variables and
22738         report the errors for not used variables.
22739
22740         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22741         operator. 
22742
22743 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22744
22745         * codegen.cs: remove unnneded code 
22746
22747         * expression.cs: Removed BuiltinTypeAccess class
22748
22749         Fix the order in which implicit conversions are
22750         done.  
22751
22752         The previous fixed dropped support for boxed conversions (adding a
22753         test to the test suite now)
22754
22755         (UserImplicitCast::CanConvert): Remove test for source being null,
22756         that code is broken.  We should not feed a null to begin with, if
22757         we do, then we should track the bug where the problem originates
22758         and not try to cover it up here.
22759
22760         Return a resolved expression of type UserImplicitCast on success
22761         rather than true/false.  Ravi: this is what I was talking about,
22762         the pattern is to use a static method as a "constructor" for
22763         objects. 
22764
22765         Also, do not create arguments until the very last minute,
22766         otherwise we always create the arguments even for lookups that
22767         will never be performed. 
22768
22769         (UserImplicitCast::Resolve): Eliminate, objects of type
22770         UserImplicitCast are born in a fully resolved state. 
22771
22772         * typemanager.cs (InitCoreTypes): Init also value_type
22773         (System.ValueType). 
22774
22775         * expression.cs (Cast::Resolve): First resolve the child expression.
22776
22777         (LValue): Add new method AddressOf to be used by
22778         the `&' operator.  
22779
22780         Change the argument of Store to take an EmitContext instead of an
22781         ILGenerator, because things like FieldExpr need to be able to call
22782         their children expression to generate the instance code. 
22783
22784         (Expression::Error, Expression::Warning): Sugar functions for
22785         reporting errors.
22786
22787         (Expression::MemberLookup): Accept a TypeContainer instead of a
22788         Report as the first argument.
22789
22790         (Expression::ResolvePrimary): Killed.  I still want to improve
22791         this as currently the code is just not right.
22792
22793         (Expression::ResolveMemberAccess): Simplify, but it is still
22794         wrong. 
22795
22796         (Unary::Resolve): Catch errors in AddressOf operators.
22797
22798         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22799         index to a byte for the short-version, or the compiler will choose
22800         the wrong Emit call, which generates the wrong data.
22801
22802         (ParameterReference::Emit, ::Store): same.
22803
22804         (FieldExpr::AddressOf): Implement.
22805
22806         * typemanager.cs: TypeManager: made public variable instead of
22807         property.
22808
22809         * driver.cs: document --fatal.
22810
22811         * report.cs (ErrorMessage, WarningMessage): new names for the old
22812         Error and Warning classes.
22813
22814         * cs-parser.jay (member_access): Turn built-in access to types
22815         into a normal simplename
22816
22817 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22818
22819         * expression.cs (Invocation::BetterConversion): Fix to cope
22820         with q being null, since this was introducing a bug.
22821
22822         * expression.cs (ConvertImplicit): Do built-in conversions first.
22823
22824 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22825
22826         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22827
22828 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22829
22830         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22831         I had introduced long ago (what's new ?).
22832
22833         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22834         the work of all the checking. 
22835         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22836         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22837
22838         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22839         that is the right way. 
22840
22841         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22842         overloading resolution. Use everywhere instead of cutting and pasting code.
22843
22844         (Binary::ResolveOperator): Use MakeUnionSet.
22845
22846         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22847         we have to convert to bool types. Not complete yet.
22848
22849 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22850
22851         * typemanager.cs (TypeManager::CSharpName): support ushort.
22852
22853         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22854         to provide an expression that performsn an implicit constant int
22855         conversion (section 6.1.6).
22856         (Expression::ConvertImplicitRequired): Reworked to include
22857         implicit constant expression conversions.
22858
22859         (Expression::ConvertNumericExplicit): Finished.
22860
22861         (Invocation::Emit): If InstanceExpression is null, then it means
22862         that we perform a call on this.
22863
22864 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22865
22866         * expression.cs (Unary::Emit): Remove some dead code.
22867         (Probe): Implement Resolve and Emit for `is'.
22868         (Expression::ConvertImplicitRequired): Attempt to do constant
22869         expression conversions here.  Maybe should be moved to
22870         ConvertImplicit, but I am not sure.
22871         (Expression::ImplicitLongConstantConversionPossible,
22872         Expression::ImplicitIntConstantConversionPossible): New functions
22873         that tell whether is it possible to apply an implicit constant
22874         expression conversion.
22875
22876         (ConvertNumericExplicit): Started work on explicit numeric
22877         conversions.
22878
22879         * cs-parser.jay: Update operator constants.
22880
22881         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22882         (Parameters::GetSignature): Hook up VerifyArgs here.
22883         (Parameters::VerifyArgs): Verifies that no two arguments have the
22884         same name. 
22885
22886         * class.cs (Operator): Update the operator names to reflect the
22887         ones that the spec expects (as we are just stringizing the
22888         operator names).
22889
22890         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22891         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22892         previous usage did only work for our methods.
22893         (Expression::ConvertImplicit): Handle decimal implicit numeric
22894         conversions as well.
22895         (Expression::InternalTypeConstructor): Used to invoke constructors
22896         on internal types for default promotions.
22897
22898         (Unary::Emit): Implement special handling for the pre/post
22899         increment/decrement for overloaded operators, as they need to have
22900         the same semantics as the other operators.
22901
22902         (Binary::ResolveOperator): ditto.
22903         (Invocation::ConversionExists): ditto.
22904         (UserImplicitCast::Resolve): ditto.
22905
22906 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22907
22908         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22909         operator, return after emitting body. Regression tests pass again !
22910
22911         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22912         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22913         (Invocation::OverloadResolve): Ditto.
22914         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22915
22916         * everywhere : update calls to the above methods accordingly.
22917
22918 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22919
22920         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22921
22922         * expression.cs (ExpressionStatement): New base class used for
22923         expressions that can appear in statements, so that we can provide
22924         an alternate path to generate expression that do not leave a value
22925         on the stack.
22926
22927         (Expression::Emit, and all the derivatives): We no longer return
22928         whether a value is left on the stack or not.  Every expression
22929         after being emitted leaves a single value on the stack.
22930
22931         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22932         facilties of ExpressionStatement if possible.
22933
22934         * cs-parser.jay: Update statement_expression.
22935
22936 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22937
22938         * driver.cs: Change the wording of message
22939
22940 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22941
22942         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22943         the type of the expression to the return type of the method if
22944         we have an overloaded operator match ! The regression tests pass again !
22945         (Unary::ResolveOperator): Ditto.
22946
22947         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22948         to find "op_Implicit", not "implicit" ;-)
22949         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22950         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22951
22952         * everywhere : Correct calls to the above accordingly.
22953
22954         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22955         (ConvertImplicit): Do user-defined conversion if it exists.
22956
22957 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22958
22959         * assign.cs: track location.
22960         (Resolve): Use implicit conversions on assignment.
22961
22962         * literal.cs: Oops.  Not good, Emit of short access values should
22963         pass (Bytes) or the wrong argument will be selected.
22964
22965         * expression.cs (Unary::Emit): Emit code for -expr.
22966
22967         (Unary::ResolveOperator): Handle `Substract' for non-constants
22968         (substract from zero from the non-constants).
22969         Deal with Doubles as well. 
22970
22971         (Expression::ConvertImplicitRequired): New routine that reports an
22972         error if no implicit conversion exists. 
22973
22974         (Invocation::OverloadResolve): Store the converted implicit
22975         expressions if we make them
22976
22977 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22978
22979         * class.cs (ConstructorInitializer): Take a Location argument.
22980         (ConstructorBaseInitializer): Same here.
22981         (ConstructorThisInitializer): Same here.
22982
22983         * cs-parser.jay : Update all calls accordingly.
22984
22985         * expression.cs (Unary, Binary, New): Take location argument.
22986         Update accordingly everywhere.
22987
22988         * cs-parser.jay : Update all calls to the above to take a location
22989         argument.
22990
22991         * class.cs : Ditto.
22992
22993 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22994
22995         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22996         (Invocation::BetterConversion): Same here
22997         (Invocation::ConversionExists): Ditto.
22998
22999         (Invocation::ConversionExists): Implement.
23000
23001 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23002
23003         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23004         Also take an additional TypeContainer argument.
23005
23006         * All over : Pass in TypeContainer as argument to OverloadResolve.
23007
23008         * typemanager.cs (CSharpName): Update to check for the string type and return
23009         that too.
23010
23011         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23012         a given method.
23013
23014 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23015
23016         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23017         (Invocation::BetterFunction): Implement.
23018         (Invocation::BetterConversion): Implement.
23019         (Invocation::ConversionExists): Skeleton, no implementation yet.
23020
23021         Okay, things work fine !
23022
23023 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23024
23025         * typemanager.cs: declare and load enum_type, delegate_type and
23026         void_type. 
23027
23028         * expression.cs (Expression::Emit): Now emit returns a value that
23029         tells whether a value is left on the stack or not.  This strategy
23030         might be reveted tomorrow with a mechanism that would address
23031         multiple assignments.
23032         (Expression::report118): Utility routine to report mismatches on
23033         the ExprClass.
23034
23035         (Unary::Report23): Report impossible type/operator combination
23036         utility function.
23037
23038         (Unary::IsIncrementableNumber): Whether the type can be
23039         incremented or decremented with add.
23040         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23041         complemented. 
23042         (Unary::ResolveOperator): Implement ++, !, ~,
23043
23044         (Invocation::Emit): Deal with new Emit convetion.
23045
23046         * All Expression derivatives: Updated their Emit method to return
23047         whether they leave values on the stack or not.
23048
23049         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23050         stack for expressions that are statements. 
23051
23052 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23053
23054         * expression.cs (LValue): New interface.  Must be implemented by
23055         LValue objects.
23056         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23057         LValue interface.
23058
23059         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23060         interface for generating code, simplifies the code.
23061
23062 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23063
23064         * expression.cs (everywhere): Comment out return statements in ::Resolve
23065         methods to avoid the warnings.
23066
23067 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23068
23069         * driver.cs (parse): Report error 2001 if we can not open the
23070         source file.
23071
23072         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23073         not resolve it.
23074
23075         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23076         object. 
23077
23078         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23079         otherwise nested blocks end up with the same index.
23080
23081         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23082
23083         * expression.cs:  Instead of having FIXMEs in the Resolve
23084         functions, throw exceptions so it is obvious that we are facing a
23085         bug. 
23086
23087         * cs-parser.jay (invocation_expression): Pass Location information.
23088
23089         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23090         Use a basename for those routines because .NET does not like paths
23091         on them. 
23092
23093         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23094         already defined.
23095
23096 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23097
23098         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23099         are loading the correct data types (throws an exception if not).
23100         (TypeManager::InitCoreTypes): Use CoreLookupType
23101
23102         * expression.cs (Unary::ResolveOperator): return the child
23103         expression for expressions which are just +expr.
23104         (Unary::ResolveOperator): Return negative literals for -LITERAL
23105         expressions (otherwise they are Unary {Literal}).
23106         (Invocation::Badness): Take into account `Implicit constant
23107         expression conversions'.
23108
23109         * literal.cs (LongLiteral): Implement long literal class.
23110         (IntLiteral): export the `Value' of the intliteral. 
23111
23112 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23113
23114         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23115
23116         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23117         instead of 'Operator'
23118
23119         * expression.cs (Binary::ResolveOperator): Update accordingly.
23120         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23121         and 'Minus'
23122
23123         * cs-parser.jay (unary_expression): Update to use the new names.
23124
23125         * gen-treedump.cs (GetUnary): Same here.
23126
23127         * expression.cs (Unary::Resolve): Implement.
23128         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23129         operators are found instead of making noise ;-)
23130         (Unary::ResolveOperator): New method to do precisely the same thing which
23131         Binary::ResolveOperator does for Binary expressions.
23132         (Unary.method, .Arguments): Add.
23133         (Unary::OperName): Implement.   
23134         (Unary::ForceConversion): Copy and Paste !
23135
23136         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23137         a unary operator.
23138
23139         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23140         for the inbuilt operators. Only overloading works for now ;-)
23141
23142 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23143
23144         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23145         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23146
23147         * expression.cs (This::Emit): Implement. 
23148         (This::Resolve): Implement.
23149         (TypeOf:Resolve): Implement.
23150         (Expression::ResolveSimpleName): Add an implicit this to instance
23151         field references. 
23152         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23153         Bind instance variable to Field expressions.
23154         (FieldExpr::Instance): New field used to track the expression that
23155         represents the object instance.
23156         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23157         binding 
23158         (FieldExpr::Emit): Implement.
23159
23160         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23161         the last instruction contains a return opcode to avoid generating
23162         the last `ret' instruction (this generates correct code, and it is
23163         nice to pass the peverify output).
23164
23165         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23166         initializer for static and instance variables.
23167         (Constructor::Emit): Allow initializer to be null in the case of
23168         static constructors.  Only emit initializer for instance
23169         constructors. 
23170
23171         (TypeContainer::FindMembers): Return a null array if there are no
23172         matches.
23173
23174         Also fix the code for the MemberTypes.Method branch, as it was not
23175         scanning that for operators (or tried to access null variables before).
23176
23177         * assign.cs (Assign::Emit): Handle instance and static fields. 
23178
23179         * TODO: Updated.
23180
23181         * driver.cs: Stop compilation if there are parse errors.
23182
23183         * cs-parser.jay (constructor_declaration): Provide default base
23184         initializer for non-static constructors.
23185         (constructor_declarator): Do not provide a default base
23186         initializers if none was specified.
23187         Catch the fact that constructors should not have parameters.
23188
23189         * class.cs: Do not emit parent class initializers for static
23190         constructors, that should be flagged as an error.
23191
23192 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23193
23194         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23195         Move back code into TypeContainer::Populate.
23196
23197 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23198
23199         * class.cs (TypeContainer::AddConstructor): Fix the check to
23200         compare against Name, not Basename. 
23201         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23202
23203         * cs-parser.jay : Update accordingly.
23204
23205         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23206         for methods, don't forget to look into the operators too.
23207         (RegisterMethodBuilder): Helper method to take care of this for
23208         methods, constructors and operators.
23209         (Operator::Define): Completely revamp.
23210         (Operator.OperatorMethod, MethodName): New fields.
23211         (TypeContainer::Populate): Move the registering of builders into
23212         RegisterMethodBuilder.
23213         (Operator::Emit): Re-write.
23214
23215         * expression.cs (Binary::Emit): Comment out code path to emit method
23216         invocation stuff for the case when we have a user defined operator. I am
23217         just not able to get it right !
23218
23219 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23220
23221         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23222         argument. 
23223
23224         (Expression::MemberLookup): Provide a version that allows to
23225         specify the MemberTypes and BindingFlags. 
23226
23227         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23228         so it was not fetching variable information from outer blocks.
23229
23230         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23231         Beforefieldinit as it was buggy.
23232
23233         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23234         that Ravi put here.  
23235
23236         * class.cs (Constructor::Emit): Only emit if block is not null.
23237         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23238         deal with this by semantically definining it as if the user had
23239         done it.
23240
23241         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23242         constructors as we now "emit" them at a higher level.
23243
23244         (TypeContainer::DefineDefaultConstructor): Used to define the
23245         default constructors if none was provided.
23246
23247         (ConstructorInitializer): Add methods Resolve and Emit. 
23248
23249         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23250
23251 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23252
23253         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23254         the default constructor builder with our hashtable for methodbuilders
23255         to methodcores.
23256
23257         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23258         and argument_count is 0 in which case we have a match.
23259         (Binary::ResolveOperator): More null checking and miscellaneous coding
23260         style cleanup.
23261
23262 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23263
23264         * rootcontext.cs (IsNameSpace): Compare against null.
23265
23266         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23267
23268         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23269         and Unary::Operator.
23270
23271         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23272         accordingly.
23273
23274         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23275         we have overloaded operators.
23276         (Binary::ResolveOperator): Implement the part which does the operator overload
23277         resolution.
23278
23279         * class.cs (Operator::Emit): Implement.
23280         (TypeContainer::Emit): Emit the operators we have too.
23281
23282         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23283         the case when we have a user-defined operator.
23284
23285 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23286
23287         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23288
23289 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23290
23291         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23292         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23293         (Constructor::Emit): Implement.
23294         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23295         if we have no work to do. 
23296         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23297         Emit method.
23298
23299         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23300         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23301
23302         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23303         of parent.parent.
23304
23305 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23306
23307         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23308         in the source.
23309         (Tree::RecordNamespace): Method to do what the name says ;-)
23310         (Tree::Namespaces): Property to get at the namespaces hashtable.
23311
23312         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23313         keep track.
23314
23315         * rootcontext.cs (IsNamespace): Fixed it :-)
23316
23317 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23318
23319         * class.cs (TypeContainer::FindMembers): Add support for
23320         constructors. 
23321         (MethodCore): New class that encapsulates both the shared aspects
23322         of a Constructor and a Method.  
23323         (Method, Constructor): Factored pieces into MethodCore.
23324
23325         * driver.cs: Added --fatal which makes errors throw exceptions.
23326         Load System assembly as well as part of the standard library.
23327
23328         * report.cs: Allow throwing exceptions on errors for debugging.
23329
23330         * modifiers.cs: Do not use `parent', instead use the real type
23331         container to evaluate permission settings.
23332
23333         * class.cs: Put Ravi's patch back in.  He is right, and we will
23334         have to cope with the
23335
23336 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23337
23338         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23339         FamORAssem, not FamANDAssem.
23340
23341 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23342
23343         * driver.cs: Added --parse option that only parses its input files
23344         and terminates.
23345
23346         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23347         incorrect.  IsTopLevel is not used to tell whether an object is
23348         root_types or not (that can be achieved by testing this ==
23349         root_types).  But to see if this is a top-level *class* (not
23350         necessarly our "toplevel" container). 
23351
23352 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23353
23354         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23355         parent instead of a direct call to GetType.
23356
23357 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23358
23359         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23360         Modifiers.TypeAttr. This should just be a call to that method.
23361
23362         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23363         object so that we can determine if we are top-level or not.
23364
23365         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23366         TypeContainer too.
23367
23368         * enum.cs (Enum::Define): Ditto.
23369
23370         * modifiers.cs (FieldAttr): Re-write.
23371
23372         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23373         (TypeContainer::HaveStaticConstructor): New property to provide access
23374         to precisely that info.
23375
23376         * modifiers.cs (MethodAttr): Re-write.
23377         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23378
23379         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23380         of top-level types as claimed.
23381
23382 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23383
23384         * expression.cs (MemberLookup): Fruitless attempt to lookup
23385         constructors.  Maybe I need to emit default constructors?  That
23386         might be it (currently .NET emits this for me automatically).
23387         (Invocation::OverloadResolve): Cope with Arguments == null.
23388         (Invocation::EmitArguments): new function, shared by the new
23389         constructor and us.
23390         (Invocation::Emit): Handle static and instance methods.  Emit
23391         proper call instruction for virtual or non-virtual invocations.
23392         (New::Emit): Implement.
23393         (New::Resolve): Implement.
23394         (MemberAccess:Resolve): Implement.
23395         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23396         to track instances.
23397         (FieldExpr::Resolve): Set type.
23398
23399         * support.cs: Handle empty arguments.
23400                 
23401         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23402         SimpleLookup): Auxiliary routines to help parse a qualifier
23403         identifier.  
23404
23405         Update qualifier_identifier rule.
23406
23407         * codegen.cs: Removed debugging messages.
23408
23409         * class.cs: Make this a global thing, this acts just as a "key" to
23410         objects that we might have around.
23411
23412         (Populate): Only initialize method_builders_to_methods once.
23413
23414         * expression.cs (PropertyExpr): Initialize type from the
23415         PropertyType. 
23416
23417         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23418         Resolve pattern.  Attempt to implicitly convert value to boolean.
23419         Emit code.
23420
23421         * expression.cs: Set the type for the int32/int32 argument case.
23422         (Binary::ResolveOperator): Set the return type to boolean for
23423         comparission operators
23424
23425         * typemanager.cs: Remove debugging print code.
23426
23427         (Invocation::Resolve): resolve type.
23428
23429         * class.cs: Allocate a MemberInfo of the correct size, as the code
23430         elsewhere depends on the test to reflect the correct contents.
23431
23432         (Method::) Keep track of parameters, due to System.Reflection holes
23433
23434         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23435         mapping here.
23436
23437         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23438         of the exact size and return that.
23439
23440         (Class::LookupMethodByBuilder): New function that maps
23441         MethodBuilders to its methods.  Required to locate the information
23442         on methods because System.Reflection bit us again.
23443
23444         * support.cs: New file, contains an interface ParameterData and
23445         two implementations: ReflectionParameters and InternalParameters
23446         used to access Parameter information.  We will need to grow this
23447         as required.
23448
23449         * expression.cs (Invocation::GetParameterData): implement a cache
23450         and a wrapper around the ParameterData creation for methods. 
23451         (Invocation::OverloadResolve): Use new code.
23452
23453 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23454
23455         * class.cs (TypeContainer::EmitField): Remove and move into 
23456         (Field::Define): here and modify accordingly.
23457         (Field.FieldBuilder): New member.
23458         (TypeContainer::Populate): Update accordingly.
23459         (TypeContainer::FindMembers): Implement.
23460
23461 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23462
23463         * statement.cs: (VariableInfo::VariableType): New field to be
23464         initialized with the full type once it is resolved. 
23465
23466 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23467
23468         * parameter.cs (GetParameterInfo): Use a type cache to compute
23469         things only once, and to reuse this information
23470
23471         * expression.cs (LocalVariableReference::Emit): Implement.
23472         (OpcodeCast::Emit): fix.
23473
23474         (ParameterReference::Resolve): Implement.
23475         (ParameterReference::Emit): Implement.
23476
23477         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23478         that are expressions need to stay as Expressions.
23479
23480         * typemanager.cs (CSharpName): Returns the C# name of a type if
23481         possible. 
23482
23483         * expression.cs (Expression::ConvertImplicit): New function that
23484         implements implicit type conversions.
23485
23486         (Expression::ImplicitReferenceConversion): Implements implicit
23487         reference conversions.
23488
23489         (EmptyCast): New type for transparent casts.
23490
23491         (OpcodeCast): New type for casts of types that are performed with
23492         a sequence of bytecodes.
23493
23494         (BoxedCast): New type used for casting value types into reference
23495         types.  Emits a box opcode.
23496
23497         (Binary::DoNumericPromotions): Implements numeric promotions of
23498         and computation of the Binary::Type.
23499
23500         (Binary::EmitBranchable): Optimization.
23501
23502         (Binary::Emit): Implement code emission for expressions.
23503
23504         * typemanager.cs (TypeManager): Added two new core types: sbyte
23505         and byte.
23506
23507 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23508
23509         * class.cs (TypeContainer::FindMembers): Method which does exactly
23510         what Type.FindMembers does, only we don't have to use reflection. No
23511         implementation yet.
23512
23513         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23514         typecontainer objects as we need to get at them.
23515         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23516
23517         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23518         typecontainer object.
23519
23520         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23521         of just a Report object.
23522
23523 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23524
23525         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23526         "remove_"
23527         (TypeContainer::Populate): Now define the delegates of the type too.
23528         (TypeContainer.Delegates): Property to access the list of delegates defined
23529         in the type.
23530
23531         * delegates.cs (Delegate::Define): Implement partially.
23532
23533         * modifiers.cs (TypeAttr): Handle more flags.
23534
23535 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23536
23537         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23538         and not <=
23539         (Operator::Define): Re-write logic to get types by using the LookupType method
23540         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23541         (Indexer::Define): Ditto.
23542         (Event::Define): Ditto.
23543         (Property::Define): Ditto.
23544
23545 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23546
23547         * class.cs (TypeContainer::Populate): Now define operators too. 
23548         (TypeContainer.Operators): New property to access the list of operators
23549         in a type.
23550         (Operator.OperatorMethodBuilder): New member to hold the method builder
23551         for the operator we are defining.
23552         (Operator::Define): Implement.
23553
23554 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23555
23556         * class.cs (Event::Define): Make the prefixes of the accessor methods
23557         addOn_ and removeOn_ 
23558
23559         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23560         of the location being passed in too. Ideally, this should go later since all
23561         error reporting should be done through the Report object.
23562
23563         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23564         (Populate): Iterate thru the indexers we have and define them too.
23565         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23566         for the get and set accessors.
23567         (Indexer::Define): Implement.
23568
23569 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23570
23571         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23572         my previous implementation, did not work.
23573
23574         * typemanager.cs: Add a couple of missing types (the longs).
23575
23576         * literal.cs: Use TypeManager.bool_type instead of getting it.
23577
23578         * expression.cs (EventExpr): New kind of expressions.
23579         (Expressio::ExprClassFromMemberInfo): finish
23580
23581 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23582
23583         * assign.cs: Emit stores to static fields differently.
23584
23585 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23586
23587         * Merge in changes and adjust code to tackle conflicts. Backed out my
23588         code in Assign::Resolve ;-) 
23589
23590 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23591
23592         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23593         instead Report.Error and also pass in the location.
23594         (CSharpParser::Lexer): New readonly property to return the reference
23595         to the Tokenizer object.
23596         (declare_local_variables): Use Report.Error with location instead of plain 
23597         old error.
23598         (CheckDef): Ditto.
23599
23600         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23601         (Operator.CheckBinaryOperator): Ditto.
23602
23603         * cs-parser.jay (operator_declarator): Update accordingly.
23604
23605         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23606         (CheckBinaryOperator): Same here.
23607
23608         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23609         on the name without any prefixes of namespace names etc. This is because we
23610         already might have something already fully qualified like 
23611         'System.Console.WriteLine'
23612
23613         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23614
23615 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23616
23617         * cs-tokenizer.cs (location): Return a string which also contains
23618         the file name.
23619
23620         * expression.cs (ElementAccess): New class for expressions of the
23621         type 'element access.'
23622         (BaseAccess): New class for expressions of the type 'base access.'
23623         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23624         respectively.
23625
23626         * cs-parser.jay (element_access): Implement action.
23627         (base_access): Implement actions.
23628         (checked_expression, unchecked_expression): Implement.
23629
23630         * cs-parser.jay (local_variable_type): Correct and implement.
23631         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23632
23633         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23634
23635         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23636         name and the specifiers.
23637
23638         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23639
23640         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
23641         making them all public ;-)
23642
23643         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23644         class anyways.
23645
23646 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
23647
23648         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23649         PropertyExprs.
23650         (FieldExpr, PropertyExprs): New resolved expressions.
23651         (SimpleName::MemberStaticCheck): Perform static checks for access
23652         to non-static fields on static methods. Maybe this should be
23653         generalized for MemberAccesses. 
23654         (SimpleName::ResolveSimpleName): More work on simple name
23655         resolution. 
23656
23657         * cs-parser.jay (primary_expression/qualified_identifier): track
23658         the parameter index.
23659
23660         * codegen.cs (CodeGen::Save): Catch save exception, report error.
23661         (EmitContext::EmitBoolExpression): Chain to expression generation
23662         instead of temporary hack.
23663         (::EmitStatementExpression): Put generic expression code generation.
23664
23665         * assign.cs (Assign::Emit): Implement variable assignments to
23666         local variables, parameters and fields.
23667
23668 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
23669
23670         * statement.cs (Block::GetVariableInfo): New method, returns the
23671         VariableInfo for a variable name in a block.
23672         (Block::GetVariableType): Implement in terms of GetVariableInfo
23673
23674         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23675         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23676
23677 2001-09-06  Ravi Pratap  <ravi@ximian.com>
23678
23679         * cs-parser.jay (operator_declaration): Continue on my quest : update
23680         to take attributes argument.
23681         (event_declaration): Ditto.
23682         (enum_declaration): Ditto.
23683         (indexer_declaration): Ditto.
23684
23685         * class.cs (Operator::Operator): Update constructor accordingly.
23686         (Event::Event): Ditto.
23687
23688         * delegate.cs (Delegate::Delegate): Same here.
23689
23690         * enum.cs (Enum::Enum): Same here.
23691
23692 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23693
23694         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23695
23696         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23697
23698         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23699         being passed around as an arraylist.
23700         (Attributes::AddAttribute): Method to add attribute sections.
23701
23702         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23703         (struct_declaration): Update accordingly.
23704         (constant_declaration): Update.
23705         (field_declaration): Update.
23706         (method_header): Update.
23707         (fixed_parameter): Update.
23708         (parameter_array): Ditto.
23709         (property_declaration): Ditto.
23710         (destructor_declaration): Ditto.
23711
23712         * class.cs (Struct::Struct): Update constructors accordingly.
23713         (Class::Class): Ditto.
23714         (Field::Field): Ditto.
23715         (Method::Method): Ditto.
23716         (Property::Property): Ditto.
23717         (TypeContainer::OptAttribute): update property's return type.
23718
23719         * interface.cs (Interface.opt_attributes): New member.
23720         (Interface::Interface): Update to take the extra Attributes argument.
23721
23722         * parameter.cs (Parameter::Parameter): Ditto.
23723
23724         * constant.cs (Constant::Constant): Ditto.
23725
23726         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23727         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23728         the attributes as a parameter.
23729         (InterfaceProperty): Update constructor call.
23730         (InterfaceEvent): Ditto.
23731         (InterfaceMethod): Ditto.
23732         (InterfaceIndexer): Ditto.
23733
23734         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23735         pass the attributes too.
23736         (interface_event_declaration): Ditto.
23737         (interface_property_declaration): Ditto.
23738         (interface_method_declaration): Ditto.
23739         (interface_declaration): Ditto.
23740
23741 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23742
23743         * class.cs (Method::Define): Track the "static Main" definition to
23744         create an entry point. 
23745
23746         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23747         EntryPoint if we find it. 
23748
23749         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23750         (EmitContext::ig): Make this variable public.
23751
23752         * driver.cs: Make the default output file be the first file name
23753         with the .exe extension.  
23754
23755         Detect empty compilations
23756
23757         Handle various kinds of output targets.  Handle --target and
23758         rename -t to --dumper.
23759
23760         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23761         methods inherited from Expression return now an Expression.  This
23762         will is used during the tree rewriting as we resolve them during
23763         semantic analysis.
23764
23765         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23766         the spec.  Missing entirely is the information about
23767         accessability of elements of it.
23768
23769         (Expression::ExprClassFromMemberInfo): New constructor for
23770         Expressions that creates a fully initialized Expression based on
23771         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23772         a Type.
23773
23774         (Invocation::Resolve): Begin implementing resolution of invocations.
23775
23776         * literal.cs (StringLiteral):  Implement Emit.
23777
23778 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23779
23780         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23781         member.
23782
23783 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23784
23785         * cs-parser.jay (attribute_arguments): Implement actions.
23786         (attribute): Fix bug in production. Implement action.
23787         (attribute_list): Implement.
23788         (attribute_target): Implement.
23789         (attribute_target_specifier, opt_target_specifier): Implement
23790         (CheckAttributeTarget): New method to check if the attribute target
23791         is valid.
23792         (attribute_section): Implement.
23793         (opt_attributes): Implement.
23794
23795         * attribute.cs : New file to handle attributes.
23796         (Attribute): Class to hold attribute info.
23797
23798         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23799         (attribute_section): Modify production to use 2 different rules to 
23800         achieve the same thing. 1 s/r conflict down !
23801         Clean out commented, useless, non-reducing dimension_separator rules.
23802
23803         * class.cs (TypeContainer.attributes): New member to hold list
23804         of attributes for a type.
23805         (Struct::Struct): Modify to take one more argument, the attribute list.
23806         (Class::Class): Ditto.
23807         (Field::Field): Ditto.
23808         (Method::Method): Ditto.
23809         (Property::Property): Ditto.
23810
23811         * cs-parser.jay (struct_declaration): Update constructor call to
23812         pass in the attributes too.
23813         (class_declaration): Ditto.
23814         (constant_declaration): Ditto.
23815         (field_declaration): Ditto.
23816         (method_header): Ditto.
23817         (fixed_parameter): Ditto.
23818         (parameter_array): Ditto.
23819         (property_declaration): Ditto.
23820
23821         * constant.cs (Constant::Constant): Update constructor similarly.
23822         Use System.Collections.
23823
23824         * parameter.cs (Parameter::Parameter): Update as above.
23825
23826 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23827
23828         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23829         (TypeContainer.delegates): New member to hold list of delegates.
23830
23831         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23832         this time as I seem to be on crack ;-)
23833
23834 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23835
23836         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23837         tell whether an identifier represents a namespace.
23838
23839         * expression.cs (NamespaceExpr): A namespace expression, used only
23840         temporarly during expression resolution.
23841         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23842         utility functions to resolve names on expressions.
23843
23844 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23845
23846         * codegen.cs: Add hook for StatementExpressions. 
23847
23848         * class.cs: Fix inverted test for static flag in methods.
23849
23850 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23851
23852         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23853         to make it coincide with MS' number.
23854         (Operator::CheckBinaryOperator): Ditto.
23855
23856         * ../errors/errors.txt : Remove error numbers added earlier.
23857
23858         * ../errors/cs1019.cs : Test case for error # 1019
23859
23860         * ../errros/cs1020.cs : Test case for error # 1020
23861
23862         * cs-parser.jay : Clean out commented cruft.
23863         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23864         used anywhere - non-reducing rule.
23865         (namespace_declarations): Non-reducing rule - comment out.
23866
23867         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23868         with TypeContainer::AddEnum.
23869
23870         * delegate.cs : New file for delegate handling classes.
23871         (Delegate): Class for declaring delegates.
23872
23873         * makefile : Update.
23874
23875         * cs-parser.jay (delegate_declaration): Implement.
23876
23877 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23878
23879         * class.cs (Event::Define): Implement.
23880         (Event.EventBuilder): New member.
23881
23882         * class.cs (TypeContainer::Populate): Update to define all enums and events
23883         we have.
23884         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23885         readonly fields for all these cases ?
23886
23887 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23888
23889         * class.cs (Property): Revamp to use the convention of making fields readonly.
23890         Accordingly modify code elsewhere.
23891
23892         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23893         the Define method of the Property class.
23894
23895         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23896         trivial bug.
23897         (TypeContainer::Populate): Update to define all the properties we have. Also
23898         define all enumerations.
23899
23900         * enum.cs (Define): Implement.
23901
23902 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23903
23904         * cs-parser.jay (overloadable_operator): The semantic value is an
23905         enum of the Operator class.
23906         (operator_declarator): Implement actions.
23907         (operator_declaration): Implement.
23908
23909         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23910         validity of definitions.
23911         (Operator::CheckBinaryOperator): Static method to check for binary operators
23912         (TypeContainer::AddOperator): New method to add an operator to a type.
23913
23914         * cs-parser.jay (indexer_declaration): Added line to actually call the
23915         AddIndexer method so it gets added ;-)
23916
23917         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23918         already taken care of by the MS compiler ?  
23919
23920 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23921
23922         * class.cs (Operator): New class for operator declarations.
23923         (Operator::OpType): Enum for the various operators.
23924
23925 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23926
23927         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23928         ostensibly handle this in semantic analysis.
23929
23930         * cs-parser.jay (general_catch_clause): Comment out
23931         (specific_catch_clauses, specific_catch_clause): Ditto.
23932         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23933         (catch_args, opt_catch_args): New productions.
23934         (catch_clause): Rewrite to use the new productions above
23935         (catch_clauses): Modify accordingly.
23936         (opt_catch_clauses): New production to use in try_statement
23937         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23938         and re-write the code in the actions to extract the specific and
23939         general catch clauses by being a little smart ;-)
23940
23941         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23942         Hooray, try and catch statements parse fine !
23943
23944 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23945
23946         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23947         string from the hashtable of variables.
23948
23949         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23950         I end up making that mistake ;-)
23951         (catch_clauses): Fixed gross error which made Key and Value of the 
23952         DictionaryEntry the same : $1 !!
23953
23954 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23955
23956         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23957
23958         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23959         when the add and remove accessors are specified. 
23960
23961 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23962
23963         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23964         information about indexer_declarator.
23965         (indexer_declarator): Implement actions.
23966         (parsing_indexer): New local boolean used to keep track of whether
23967         we are parsing indexers or properties. This is necessary because 
23968         implicit_parameters come into picture even for the get accessor in the 
23969         case of an indexer.
23970         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23971
23972         * class.cs (Indexer): New class for indexer declarations.
23973         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23974         (TypeContainer::indexers): New member to hold list of indexers for the
23975         type.
23976
23977 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23978
23979         * cs-parser.jay (add_accessor_declaration): Implement action.
23980         (remove_accessor_declaration): Implement action.
23981         (event_accessors_declaration): Implement
23982         (variable_declarators): swap statements for first rule - trivial.
23983
23984         * class.cs (Event): New class to hold information about event
23985         declarations.
23986         (TypeContainer::AddEvent): New method to add an event to a type
23987         (TypeContainer::events): New member to hold list of events.
23988
23989         * cs-parser.jay (event_declaration): Implement actions.
23990
23991 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23992
23993         * cs-parser.jay (dim_separators): Implement. Make it a string
23994         concatenating all the commas together, just as they appear.
23995         (opt_dim_separators): Modify accordingly
23996         (rank_specifiers): Update accordingly. Basically do the same
23997         thing - instead, collect the brackets here.
23998         (opt_rank_sepcifiers): Modify accordingly.
23999         (array_type): Modify to actually return the complete type string
24000         instead of ignoring the rank_specifiers.
24001         (expression_list): Implement to collect the expressions
24002         (variable_initializer): Implement. We make it a list of expressions
24003         essentially so that we can handle the array_initializer case neatly too.
24004         (variable_initializer_list): Implement.
24005         (array_initializer): Make it a list of variable_initializers
24006         (opt_array_initializer): Modify accordingly.
24007
24008         * expression.cs (New::NType): Add enumeration to help us
24009         keep track of whether we have an object/delegate creation
24010         or an array creation.
24011         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24012         members to hold data about array creation.
24013         (New:New): Modify to update NewType
24014         (New:New): New Overloaded contructor for the array creation
24015         case.
24016
24017         * cs-parser.jay (array_creation_expression): Implement to call
24018         the overloaded New constructor.
24019
24020 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24021
24022         * class.cs (TypeContainer::Constructors): Return member
24023         constructors instead of returning null.
24024
24025 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24026
24027         * typemanager.cs (InitCoreTypes): Initialize the various core
24028         types after we have populated the type manager with the user
24029         defined types (this distinction will be important later while
24030         compiling corlib.dll)
24031
24032         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24033         on Expression Classification.  Now all expressions have a method
24034         `Resolve' and a method `Emit'.
24035
24036         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24037         generation from working.     Also add some temporary debugging
24038         code. 
24039
24040 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24041
24042         * codegen.cs: Lots of code generation pieces.  This is only the
24043         beginning, will continue tomorrow with more touches of polish.  We
24044         handle the fundamentals of if, while, do, for, return.  Others are
24045         trickier and I need to start working on invocations soon.
24046
24047         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24048         s.InitStatement. 
24049
24050         * codegen.cs (EmitContext): New struct, used during code
24051         emission to keep a context.   Most of the code generation will be
24052         here. 
24053
24054         * cs-parser.jay: Add embedded blocks to the list of statements of
24055         this block.  So code generation proceeds in a top down fashion.
24056
24057 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24058
24059         * statement.cs: Add support for multiple child blocks.
24060
24061 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24062
24063         * codegen.cs (EmitCode): New function, will emit the code for a
24064         Block of code given a TypeContainer and its ILGenerator. 
24065
24066         * statement.cs (Block): Standard public readonly optimization.
24067         (Block::Block constructors): Link children. 
24068         (Block::Child): Child Linker.
24069         (Block::EmitVariables): Emits IL variable declarations.
24070
24071         * class.cs: Drop support for MethodGroups here, delay until
24072         Semantic Analysis.
24073         (Method::): Applied the same simplification that I did before, and
24074         move from Properties to public readonly fields.
24075         (Method::ParameterTypes): Returns the parameter types for the
24076         function, and implements a cache that will be useful later when I
24077         do error checking and the semantic analysis on the methods is
24078         performed.
24079         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24080         and made a method, optional argument tells whether this is a class
24081         or a structure to apply the `has-this' bit.
24082         (Method::GetCallingConvention): Implement, returns the calling
24083         convention. 
24084         (Method::Define): Defines the type, a second pass is performed
24085         later to populate the methods.
24086
24087         (Constructor::ParameterTypes): implement a cache similar to the
24088         one on Method::ParameterTypes, useful later when we do semantic
24089         analysis. 
24090
24091         (TypeContainer::EmitMethod):  New method.  Emits methods.
24092
24093         * expression.cs: Removed MethodGroup class from here.
24094
24095         * parameter.cs (Parameters::GetCallingConvention): new method.
24096
24097 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24098
24099         * class.cs (TypeContainer::Populate): Drop RootContext from the
24100         argument. 
24101
24102         (Constructor::CallingConvention): Returns the calling convention.
24103         (Constructor::ParameterTypes): Returns the constructor parameter
24104         types. 
24105
24106         (TypeContainer::AddConstructor): Keep track of default constructor
24107         and the default static constructor.
24108
24109         (Constructor::) Another class that starts using `public readonly'
24110         instead of properties. 
24111
24112         (Constructor::IsDefault): Whether this is a default constructor. 
24113
24114         (Field::) use readonly public fields instead of properties also.
24115
24116         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24117         track of static constructors;  If none is used, turn on
24118         BeforeFieldInit in the TypeAttributes. 
24119
24120         * cs-parser.jay (opt_argument_list): now the return can be null
24121         for the cases where there are no arguments. 
24122
24123         (constructor_declarator): If there is no implicit `base' or
24124         `this', then invoke the default parent constructor. 
24125
24126         * modifiers.cs (MethodAttr): New static function maps a set of
24127         modifiers flags into a MethodAttributes enum
24128         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24129         MethodAttr, TypeAttr to represent the various mappings where the
24130         modifiers are used.
24131         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24132
24133 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24134
24135         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24136         method arguments.
24137
24138         * interface.cs (PopulateIndexer): Implemented the code generator
24139         for interface indexers.
24140
24141 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24142
24143         * interface.cs (InterfaceMemberBase): Now we track the new status
24144         here.  
24145
24146         (PopulateProperty): Implement property population.  Woohoo!  Got
24147         Methods and Properties going today. 
24148
24149         Removed all the properties for interfaces, and replaced them with
24150         `public readonly' fields. 
24151
24152 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24153
24154         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24155         initialize their hashtables/arraylists only when they are needed
24156         instead of doing this always.
24157
24158         * parameter.cs: Handle refs and out parameters.
24159
24160         * cs-parser.jay: Use an ArrayList to construct the arguments
24161         instead of the ParameterCollection, and then cast that to a
24162         Parameter[] array.
24163
24164         * parameter.cs: Drop the use of ParameterCollection and use
24165         instead arrays of Parameters.
24166
24167         (GetParameterInfo): Use the Type, not the Name when resolving
24168         types. 
24169
24170 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24171
24172         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24173         and instead use public readonly fields.
24174
24175         * class.cs: Put back walking code for type containers.
24176
24177 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24178
24179         * class.cs (MakeConstant): Code to define constants.
24180
24181         * rootcontext.cs (LookupType): New function.  Used to locate types 
24182
24183
24184 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24185
24186         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24187         this System.Reflection code is.  Kudos to Microsoft
24188
24189         * typemanager.cs: Implement a type cache and avoid loading all
24190         types at boot time.  Wrap in LookupType the internals.  This made
24191         the compiler so much faster.  Wow.  I rule!
24192
24193         * driver.cs: Make sure we always load mscorlib first (for
24194         debugging purposes, nothing really important).
24195
24196         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24197         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24198
24199         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24200         on namespaces that have been imported using the `using' keyword.
24201
24202         * class.cs (TypeContainer::TypeAttr): Virtualize.
24203         (Class::TypeAttr): Return attributes suitable for this bad boy.
24204         (Struct::TypeAttr): ditto.
24205         Handle nested classes.
24206         (TypeContainer::) Remove all the type visiting code, it is now
24207         replaced with the rootcontext.cs code
24208
24209         * rootcontext.cs (GetClassBases): Added support for structs. 
24210
24211 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24212
24213         * interface.cs, statement.cs, class.cs, parameter.cs,
24214         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24215         Drop use of TypeRefs, and use strings instead.
24216
24217 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24218
24219         * rootcontext.cs: 
24220
24221         * class.cs (Struct::Struct): set the SEALED flags after
24222         checking the modifiers.
24223         (TypeContainer::TypeAttr): new property, returns the
24224         TypeAttributes for a class.  
24225
24226         * cs-parser.jay (type_list): Oops, list production was creating a
24227         new list of base types.
24228
24229         * rootcontext.cs (StdLib): New property.
24230         (GetInterfaceTypeByName): returns an interface by type name, and
24231         encapsulates error handling here.
24232         (GetInterfaces): simplified.
24233         (ResolveTree): Encapsulated all the tree resolution here.
24234         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24235         types. 
24236
24237         * driver.cs: Add support for --nostdlib, to avoid loading the
24238         default assemblies.
24239         (Main): Do not put tree resolution here. 
24240
24241         * rootcontext.cs: Beginning of the class resolution.
24242
24243 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24244
24245         * rootcontext.cs: Provide better error reporting. 
24246
24247         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24248
24249         * rootcontext.cs (CreateInterface): Handle the case where there
24250         are no parent interfaces.
24251
24252         (CloseTypes): Routine to flush types at the end.
24253         (CreateInterface): Track types.
24254         (GetInterfaces): Returns an array of Types from the list of
24255         defined interfaces.
24256
24257         * typemanager.c (AddUserType): Mechanism to track user types (puts
24258         the type on the global type hash, and allows us to close it at the
24259         end). 
24260
24261 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24262
24263         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24264         RecordInterface instead.
24265
24266         * cs-parser.jay: Updated to reflect changes above.
24267
24268         * decl.cs (Definition): Keep track of the TypeBuilder type that
24269         represents this type here.  Not sure we will use it in the long
24270         run, but wont hurt for now.
24271
24272         * driver.cs: Smaller changes to accomodate the new code.
24273
24274         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24275         when done. 
24276
24277         * rootcontext.cs (CreateInterface):  New method, used to create
24278         the System.TypeBuilder type for interfaces.
24279         (ResolveInterfaces): new entry point to resolve the interface
24280         hierarchy. 
24281         (CodeGen): Property, used to keep track of the code generator.
24282
24283 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24284
24285         * cs-parser.jay: Add a second production for delegate_declaration
24286         with `VOID'.
24287
24288         (enum_body): Put an opt_comma here instead of putting it on
24289         enum_body or enum_member_declarations so we can handle trailing
24290         commas on enumeration members.  Gets rid of a shift/reduce.
24291
24292         (type_list): Need a COMMA in the middle.
24293
24294         (indexer_declaration): Tell tokenizer to recognize get/set
24295
24296         * Remove old targets.
24297
24298         * Re-add the parser target.
24299
24300 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24301
24302         * cs-parser.jay: Add precendence rules for a number of operators
24303         ot reduce the number of shift/reduce conflicts in the grammar.
24304
24305 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24306
24307         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24308         and put it here.
24309
24310         Get rid of old crufty code.
24311
24312         * rootcontext.cs: Use this to keep track of the parsed
24313         representation and the defined types available to the program. 
24314
24315         * gen-treedump.cs: adjust for new convention.
24316
24317         * type.cs: Split out the type manager, and the assembly builder
24318         from here. 
24319
24320         * typemanager.cs: the type manager will live here now.
24321
24322         * cil-codegen.cs: And the code generator here. 
24323
24324 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24325
24326         * makefile: Fixed up for easy making.
24327
24328 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24329
24330         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24331         the 
24332
24333         (unary_expression): Expand pre_increment_expression and
24334         post_decrement_expression to reduce a shift/reduce.
24335
24336 2001-07-11  Simon Cozens
24337
24338         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24339
24340         Improve allow_keyword_as_indent name.
24341
24342 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24343
24344         * Adjustments for Beta2. 
24345
24346 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24347
24348         * decl.cs: Added `Define' abstract method.
24349         (InTransit): new property, used to catch recursive definitions. 
24350
24351         * interface.cs: Implement `Define'. 
24352
24353         * modifiers.cs: Map Modifiers.constants to
24354         System.Reflection.TypeAttribute flags.
24355
24356         * class.cs: Keep track of types and user-defined types.
24357         (BuilderInit): New method for creating an assembly
24358         (ResolveType): New function to launch the resolution process, only
24359         used by interfaces for now.
24360
24361         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24362         that are inserted into the name space. 
24363
24364 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24365
24366         * ARGH.  I have screwed up my tree so many times due to the use of
24367         rsync rather than using CVS.  Going to fix this at once. 
24368
24369         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24370         load types.
24371
24372 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24373
24374         * Experiment successful: Use System.Type rather that our own
24375         version of Type.  
24376
24377 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24378
24379         * cs-parser.jay: Removed nsAliases from here.
24380
24381         Use new namespaces, handle `using XXX;' 
24382
24383         * namespace.cs: Reimplemented namespace handling, use a recursive
24384         definition of the class.  Now we can keep track of using clauses
24385         and catch invalid using clauses.
24386
24387 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24388
24389         * gen-treedump.cs: Adapted for all the renaming.
24390
24391         * expression.cs (Expression): this class now has a Type property
24392         which returns an expression Type.
24393
24394         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24395         `Type', as this has a different meaning now in the base
24396
24397 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24398
24399         * interface.cs, class.cs: Removed from all the sources the
24400         references to signature computation, as we can not do method
24401         signature computation during the parsing time, as we are not
24402         trying to solve at that point distinguishing:
24403
24404         class X {
24405                 void a (Blah x) {}
24406                 void a (NS.Blah x) {}
24407         }
24408
24409         Which depending on the context might be valid or not, as we do not
24410         know if Blah is the same thing as NS.Blah at that point.
24411
24412         * Redid everything so the code uses TypeRefs now instead of
24413         Types.  TypeRefs are just temporary type placeholders, that need
24414         to be resolved.  They initially have a pointer to a string and the
24415         current scope in which they are used.  This is used later by the
24416         compiler to resolve the reference to an actual Type. 
24417
24418         * DeclSpace is no longer a CIR.Type, and neither are
24419         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24420         are all DeclSpaces, but no Types. 
24421
24422         * type.cs (TypeRefManager): This implements the TypeRef manager,
24423         which keeps track of all the types that need to be resolved after
24424         the parsing has finished. 
24425
24426 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24427
24428         * ARGH.  We are going to have to store `foreach' as a class rather
24429         than resolving it, as we need to verify error 1579 after name
24430         resolution.   *OR* we could keep a flag that says `This request to
24431         IEnumerator comes from a foreach statement' which we can then use
24432         to generate the error.
24433
24434 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24435
24436         * class.cs (TypeContainer.AddMethod): we now add methods to the
24437         MethodGroup instead of the method hashtable.  
24438
24439         * expression.cs: Add MethodGroup abstraction, which gets us one
24440         step closer to the specification in the way we handle method
24441         declarations.  
24442
24443         * cs-parser.jay (primary_expression): qualified_identifier now
24444         tried to match up an identifier to a local variable reference or
24445         to a parameter reference.
24446
24447         current_local_parameters is now a parser global variable that
24448         points to the current parameters for the block, used during name
24449         lookup.
24450
24451         (property_declaration): Now creates an implicit `value' argument to
24452         the set accessor.
24453
24454 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24455
24456         * parameter.cs: Do not use `param' arguments as part of the
24457         signature, per the spec.
24458
24459 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24460
24461         * decl.cs: Base class for classes, structs and interfaces.  This
24462         is the "Declaration Space" 
24463
24464         * cs-parser.jay: Use CheckDef for checking declaration errors
24465         instead of having one on each function.
24466
24467         * class.cs: Factor out some code for handling error handling in
24468         accordance to the "Declarations" section in the "Basic Concepts"
24469         chapter in the ECMA C# spec.
24470
24471         * interface.cs: Make all interface member classes derive from
24472         InterfaceMemberBase.
24473
24474 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24475
24476         * Many things: all interfaces are parsed and generated in
24477         gen-treedump.  Support for member variables, constructors,
24478         destructors, properties, constants is there.
24479
24480         Beginning of the IL backend, but very little done, just there for
24481         testing purposes. 
24482
24483 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24484
24485         * cs-parser.jay: Fix labeled statement.
24486
24487         * cs-tokenizer.cs (escape): Escape " and ' always.
24488         ref_line, ref_name: keep track of the line/filename as instructed
24489         by #line by the compiler.
24490         Parse #line.
24491
24492 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24493
24494         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24495         to match the values in System.CodeDOM.
24496
24497         Divid renamed to Divide.
24498
24499         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24500         statements. 
24501         (Statements.set): remove.
24502
24503         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24504         statements. 
24505
24506         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24507         falseStatements always have valid values. 
24508
24509         * cs-parser.jay: Use System.CodeDOM now.
24510