85dd39e2edab47ac887740a8780b75b945a31e6b
[mono.git] / mcs / mcs / ChangeLog
1 2007-03-20  Martin Baulig  <martin@ximian.com>
2
3         * class.cs (TypeContainer.Interfaces): Removed; they're now
4         included in `TypeContainer.Types'.
5
6 2007-03-20  Martin Baulig  <martin@ximian.com>
7
8         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
9
10         * class.cs (TypeContainer.CreateType): New public method.  This is
11         now called before DefineType() to create the TypeBuilders.
12         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
13         has already been created by CreateType().
14         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
15         don't resolve our base classes here; this has been moved into
16         DefineBaseTypes().  We're now called from CreateType().
17         (TypeContainer.DefineBaseTypes): New private method; resolve our
18         base classes here.  We're now called from DefineType().
19
20         * rootcontext.cs
21         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
22         our types first to create all the TypeBuilders.  After that, call
23         TypeContainer.DefineType() on all the types which'll resolve their
24         base classes and setup the resolve order.
25
26 2007-03-20  Martin Baulig  <martin@ximian.com>
27
28         * class.cs (TypeContainer.Enums): Removed; they're now included in
29         `TypeContainer.Types'.  
30
31 2007-03-20  Martin Baulig  <martin@ximian.com>
32
33         * class.cs
34         (TypeContainer.DefineType): Don't call ResolveMembers() here.
35         (TypeContainer.DoResolveMembers): Call DefineType() on our
36         `compiler_generated' classes; moved here from DefineNestedTypes().
37
38         * rootcontext.cs
39         (RootContext.ResolveTree): Call ResolveMembers() on all
40         TypeContainer's in the `type_container_resolve_order'.
41
42 2007-03-19  Marek Safar  <marek.safar@gmail.com>
43
44         * class.cs: Use corlib to handle InternalMethodImplAttribute.
45
46 2007-03-17  Marek Safar  <marek.safar@gmail.com>
47
48         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
49         implementation flags.
50
51 2007-03-17  Marek Safar  <marek.safar@gmail.com>
52
53         * class.cs: More optimizations for type parameters.
54
55 2007-03-15  Marek Safar  <marek.safar@gmail.com>
56
57         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
58
59         * ecore.cs, parameter.cs: More common code for both corlibs.
60
61         * typemanager.cs (IsGenericMethod): Simplified.
62
63 2007-03-15  Raja R Harinath  <rharinath@novell.com>
64
65         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
66         'returns'.
67         * statement.cs, iterators.cs, lambda.cs: Update to changes.
68
69         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
70         unconditionally.  Simplify explanation.
71         (Try.Resolve, Using.Resolve): Likewise.
72
73 2007-03-15  Martin Baulig  <martin@ximian.com>
74
75         Fix #80731.
76
77         * decl.cs (DeclSpace): If we're a partial class, use our
78         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
79
80 2007-03-15  Raja R Harinath  <rharinath@novell.com>
81
82         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
83         'throws'.
84         (FlowBranching.UsageVector): Update to changes.
85         (FlowBranching.MergeSiblings): Likewise.
86         * statement.cs: Likewise.
87
88 2007-03-15  Martin Baulig  <martin@ximian.com>
89
90         Fix #79302.
91
92         * decl.cs
93         (MemberCache): Added a special .ctor for type parameters.
94
95         * typemanager.cs
96         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
97         `MemberCache'.  
98
99 2007-03-09  Martin Baulig  <martin@ximian.com>
100
101         * enum.cs (Enum): Make this a TypeContainer.
102         (EnumMember): Derive from `Const'.
103
104         * const.cs
105         (Const.DoResolveValue): New protected virtual method; move most of
106         the functionality of ResolveValue() here so we can override it in
107         `EnumMember'.
108         (Const.CreateConstantReference): Make this virtual.
109
110         * class.cs (Kind): Add `Kind.Enum'.
111         (TypeContainer.Emit): Don't emit the enums here; they're already
112         in the `RootContext.typecontainer_resolve_order'.
113
114         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
115         here; they're already in the `typecontainer_resolve_order'.
116
117         * ecore.cs (EnumConstant.ConvertImplicitly): Add
118         TypeManager.DropGenericTypeArguments().
119
120         * typemanager.cs
121         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
122         (TypeManager.IsEnumType): Likewise.
123         (TypeManager.EnumToUnderlying): Likewise.
124         (TypeManager.IsEqual): Add support for enums.
125
126 2007-03-12  Raja R Harinath  <rharinath@novell.com>
127
128         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
129         DefaultParameterValueAttribute to be undefined, say if System.dll
130         is not referenced.
131
132 2007-03-11  Marek Safar  <marek.safar@gmail.com>
133
134         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
135         any mscorlib.
136
137 2007-03-10  Marek Safar  <marek.safar@gmail.com>
138
139         * class.cs, parameter.cs: Unified parameters verification.
140
141 2007-03-08  Martin Baulig  <martin@ximian.com>
142
143         * cs-parser.jay (constructor_header): Pass the location to the
144         newly created TopLevelBlock.
145
146 2007-03-07  Martin Baulig  <martin@ximian.com>
147
148         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
149
150 2007-03-06  Miguel de Icaza  <miguel@novell.com>
151
152         * convert.cs (ExplicitReferenceConversionExists): Sync this method
153         with the changes from David, fixes the build.
154
155 2007-03-05  David Mitchell  <dmitchell@logos.com>
156
157         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
158         and its base interfaces to a one-dimensional array type S[],
159         provided there is an implicit or explicit reference conversion
160         from S to T.
161
162 2007-03-03  Marek Safar  <marek.safar@gmail.com>
163
164         * cs-tokenizer.cs: Implemented basic linq grammar.
165
166         * driver.cs: Set linq lang version on demand.
167
168 2007-02-26  Marek Safar  <marek.safar@gmail.com>
169
170         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
171
172 2007-02-25  Marek Safar  <marek.safar@gmail.com>
173
174         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
175         (Fixes #80455)
176
177         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
178         here.
179         Check property and event extern attributes.
180
181         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
182         charset.
183
184 2007-02-24  Marek Safar  <marek.safar@gmail.com>
185
186         A fix for bug #80407
187         * ecore.cs: Don't report ambiguity error when methods have same parent.
188
189 2007-02-23  Marek Safar  <marek.safar@gmail.com>
190
191         A fix for bug #80878
192         * class.cs, cs-parser.jay: Event property can host anonymous methods.
193
194 2007-02-22  Marek Safar  <marek.safar@gmail.com>
195
196         * attribute.cs: Enable ExtensionAttribute presence test.
197
198 2007-02-22  Marek Safar  <marek.safar@gmail.com>
199
200         * class.cs: Warn about missing GetHashCode only when Equals is override.
201
202         * decl.cs: Check accessibility of type arguments.
203
204         * typemanager.cs: Correctly report nullable array.
205
206 2007-02-20  Marek Safar  <marek.safar@gmail.com>
207
208         * class.cs, report.cs: Capture more details when things go wrong.
209
210 2007-02-20  Marek Safar  <marek.safar@gmail.com>
211
212         A fix for bug #80650
213         * cs-parser.jay: Anonymous container starts at constructor declaration
214         and not at block beginning because it has to be usable in constructor
215         initializer.
216
217         * statement.cs: Use context location and not block one for error reporting.
218
219 2007-02-18  Marek Safar  <marek.safar@gmail.com>
220
221         A fix for bug #78712
222         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
223         too.
224
225 2007-02-18  Marek Safar  <marek.safar@gmail.com>
226
227         A fix for bug #80493 by Atsushi Enomoto
228         * cs-parser.jay: Ignore invalid attribute target.
229
230 2007-02-18  Marek Safar  <marek.safar@gmail.com>
231  
232         * cs-tokenizer.cs: Ignore '\0' as white space character.
233
234 2007-02-17  Miguel de Icaza  <miguel@novell.com>
235
236         * cs-parser.jay: Add support for lambda expressions to the mcs
237         compiler as well.
238
239         * lambda.cs: Only clone when we are probing, not on the final call
240         (Compatible is the final call). 
241
242         * statement.cs (CloneContext): Introduce class to provide block
243         remapping during clone.
244
245         All statements Clone themselves now.
246
247         (Clone): special handling for blocks, when we clone a block, we
248         register the block inside this routine, as children of the block
249         might trigger a lookup. 
250         
251         * expression.cs: Add support for CloneContext in all expressions. 
252         
253 2007-02-17  Marek Safar  <marek.safar@gmail.com>
254  
255         A fix for bug #80493
256         * statement.cs: Report ambiguous warning when interfaces are not related.
257
258 2007-02-15  Marek Safar  <marek.safar@gmail.com>
259
260         C# 3.0 extension methods.
261
262         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
263         cannot be used directly.
264
265         * class.cs (Class.Emit): Emit extension attribute if any class method
266         is extension method.
267         (Method.Define): Add basic extension method validation conditions.
268         (Method.Emit): Emit extension attribute for method.
269
270         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
271         extension method exists. Currently we follow same approach as Microsoft
272         does, emit even if a method or a class are private but this can change
273         later.
274
275         * cs-parser.jay: Add handling of `this' keyword in method parameters
276         context.
277
278         * decl.cs (DeclSpace.IsStaticClass): New property.
279         (MemberCache.FindExtensionMethods): Looks for extension methods with
280         defined name and extension type.
281
282         * doc.cs: Updated after OverloadResolve changes.
283
284         * driver.cs: Add new soft reference to System.Core.dll.
285
286         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
287         (ExtensionMethodGroupExpr): Represents group of extension methods.
288
289         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
290         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
291         to MethodGroupExpr and made non-static for easier customization.
292         (Invocation.DoResolve): Add extension method lookup when no standard
293         method was found.
294         (MemberAccess.DoResolve): Try extension methods if no member exists.
295
296         * modifiers.cs: Add METHOD_EXTENSION modifier.
297
298         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
299         as well as candidate extension type.
300         (ComputeNamespaces): When assembly constains extension methods registers
301         them.
302         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
303         extension method lookup.
304         (Namespace.LookupExtensionMethod): Looks for extension method in this
305         namespace.
306         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
307         find a method which matches name and extensionType.
308
309         * parameter.cs (Parameter): Add This modifer.
310         (HasExtensionMethodModifier): New property.
311         (Resolve): Add extension parameter check.
312         (ModFlags): turned to property to exclude this modifier as it is not real
313         parameter modifier.
314         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
315
316         * support.cs (ParameterData): Add ExtensionMethodType.
317         (ReflectionParameters): Implemented ExtensionMethodType interface property.
318
319         * typemanager.cs: Add type and ctor extension attribute type.
320
321 2007-02-15  Miguel de Icaza  <miguel@novell.com>
322
323         * report.cs (DisableErrors, EnableErrors): used to prevent error
324         output when we are "trying" to compile various methods with
325         different types. 
326
327         * ecore.cs (Expression): Add Clone method that calls the virtual
328         CloneTo method.  The current CloneTo method in Expression throws
329         an exception so we can track down all the places where this must
330         be implemented (not using abstract, because that would be a lot of
331         up-front-work before we can start testing the implementation
332         idea). 
333
334         Important: we only need Clone capabilities for expressions created
335         by the parser, as the expressions we will be cloning are
336         expressions in the pre-resolved state.   This vastly simplifies
337         the work required. 
338         
339         (SimpleName): Add CloneTo that does nothing.
340         (EmptyCast): Add CloneTo.
341         
342         * expression.cs (Binary): Implement CloneTo.
343         (Invocation.IsApplicable): Store the current ec in
344         EmitContext.TempEc and restore it on return.  This is used so we
345         do not have to sprinkle hundres of methods with an extra
346         EmitContext, we know that the only user is the lambda expression
347         ImplicitConversionExists code. 
348         
349         (Argument): Add Cloning capabilities.
350         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
351         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
352         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
353         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
354         IndexerAccess): Add Clone capability.
355
356         (LocalVariableReference, This): TODO: needs cloned Block mapping.
357
358         (Argument): Add cloning capability.
359
360         * assign.cs (Assign): Implement CloneTo.
361
362         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
363         
364         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
365         version by calling Convert with the EmitContext (that we are
366         currently storing in ec, this is not great, but will do for now,
367         to avoid passing EmitContext parameters to hundreds of functions
368         that do not need them now).
369
370         (SetExpression): Remove, it is not needed.
371         
372         (ContextualReturn): Implement CloneTo.
373
374         * statement.cs (Statement): Implement cloning infrastructure,
375         similar to expressions.
376
377         (Block): Partial implementation of Clone for statements.
378
379         (Return): Implement clone.
380         
381         * constant.cs (Constant.CloneTo): New method, does nothing.
382
383         * codegen.cs (TempEc): Add a static EmitContext as a temporary
384         solution, until we decide how to exactly do this.  
385         
386 2007-02-14  Marek Safar  <marek.safar@gmail.com>
387  
388         A fix for bug #80493
389         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
390         a property is override we need to use second accessor.
391
392 2007-02-13  Marek Safar  <marek.safar@gmail.com>
393  
394         A fix for bug #80418
395         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
396         methods.
397
398 2007-02-13  Marek Safar  <marek.safar@gmail.com>
399
400         Another fix for bug #80749
401         * pending.cs: Abstract class has priority over interfaces.
402
403 2007-02-13  Marek Safar  <marek.safar@gmail.com>
404
405         Another fix for bug #80749
406         * pending.cs: Abstract class has priority over interfaces.
407
408 2007-02-13  Marek Safar  <marek.safar@gmail.com>
409
410         Another fix for bug #80749
411         * pending.cs: Abstract class has priority over interfaces.
412
413 2007-02-13  Marek Safar  <marek.safar@gmail.com>
414
415         Another fix for bug #80749
416         * pending.cs: Abstract class has priority over interfaces.
417
418 2007-02-13  Marek Safar  <marek.safar@gmail.com>
419
420         * class.cs Better error message.
421
422         * driver.cs: Add shorter versions of -optimize option.
423
424 2007-02-13  Martin Baulig  <martin@ximian.com>
425
426         * class.cs (Constructor.Emit): Check the return value of
427         ec.ResolveTopBlock() and return on error.
428
429 2007-02-13  Raja R Harinath  <rharinath@novell.com>
430
431         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
432         message to fix error message regression.
433
434 2007-02-12  Marek Safar  <marek.safar@gmail.com>
435
436         * delegate.cs: Delegate creation expression cannot be of Nullable type.
437
438 2007-02-12  Marek Safar  <marek.safar@gmail.com>
439
440         A fix for bug #80749
441         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
442         its parent container.
443
444         * class.cs (DefineFieldInitializers): Each initializer can has different
445         resolve context.
446
447         * const.cs: Updated.
448
449 2007-02-11  Miguel de Icaza  <miguel@novell.com>
450
451         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
452         now all the heavy lifting to check that embedded statements or
453         expressions have the right form is done in the ContextualReturn.
454
455         (ContextualReturn): New class.  
456
457         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
458         method that can be invoked to report 201, so we do not replicate
459         this everywhere.
460
461         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
462         
463         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
464         treating tabs as spaces. 
465
466 2007-02-09  Marek Safar  <marek.safar@gmail.com>
467
468         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
469         * assign.cs: Use full implicit conversion for right side check.
470
471 2007-02-09  Marek Safar  <marek.safar@gmail.com>
472
473         * statement.cs (Switch): Switch over boolean type is not standardized.
474
475 2007-02-08  Marek Safar  <marek.safar@gmail.com>
476
477         A fix for bug #80755
478         * decl.cs (FindBaseEvent): Don't use method cache for events.
479
480 2007-02-07  Marek Safar  <marek.safar@gmail.com>
481
482         * cs-parser.jay: Better syntax error handling.
483
484         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
485         instead of underlying type value.
486
487 2007-02-06  Marek Safar  <marek.safar@gmail.com>
488
489         * driver.cs: Check define identifier before is registered.
490
491         * namespace.cs: Use existing error message.
492
493         * report.cs: New warning.
494
495 2007-02-06  Marek Safar  <marek.safar@gmail.com>
496
497         A fix for bug #80742
498         * expression.cs: Delegate Invoke method can be called directly.
499
500 2007-02-06  Marek Safar  <marek.safar@gmail.com>
501
502         A fix for bug #80676
503         * class.cs (IsEntryPoint): The Main method can have params modifier.
504
505 2007-02-04  Miguel de Icaza  <miguel@novell.com>
506
507         * parameter.cs (Parameter, Parameters): Add Clone method.
508
509         * anonymous.cs (Compatible): Turn method into virtual method, so
510         LambdaExpression can implement a different behavior.
511
512         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
513         out the basic checking here, so it can be used by
514         LambdaExpressions.
515         
516         * lambda.cs: Introduce "Compatible" function that will do the
517         heavy lifting.
518
519 2007-02-02  Marek Safar  <marek.safar@gmail.com>
520
521         * attribute.cs: Unified one error message.
522
523         * class.cs (Class): Use type attributes and not properties to test static
524         class.
525         (IsEntryPoint): Don's pass local variable.
526
527         * convert.cs: Removed duplicate check.
528
529         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
530
531         * driver.cs: Don't crash when soft reference does not exist.
532
533         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
534         (UsingEntry): Removed redundant allocation.
535
536         * parameter.cs: Add fast path for type parameters.
537
538         * support.cs: Don't allocate attribute when it's not used.
539
540 2007-01-30  Miguel de Icaza  <miguel@novell.com>
541
542         * anonymous.cs
543         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
544         this into a virtual method, so we can override it in LambdaExpression.
545
546         * driver.cs: Improve diagnostics in case of failure. 
547
548         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
549         write a function that is slightly more complex and that parses:
550
551         type identifier [, type identifier]* )
552
553         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
554         this expression:
555
556                 (canEmpty ? i >= 0 : i > 0)
557
558 2007-01-30  Raja R Harinath  <rharinath@novell.com>
559
560         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
561         exception on possibly valid code.
562
563 2007-01-29  Raja R Harinath  <rharinath@novell.com>
564
565         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
566         Push/PopPosition.
567         (parse_opt_type_arguments): Remove.  It's almost the same as
568         parse_less_than.
569         (parse_namespace_or_typename): Use parse_less_than.
570
571 2007-01-28  Miguel de Icaza  <miguel@novell.com>
572
573         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
574         this bug took a few hours to find, because the state saved and
575         restored by PushPosition and PopPosition was ignoring the state of
576         parse_generic_less_than.
577
578         I can also now remove the handling of OP_LT and OP_GT, this solves
579         the big mistery.
580         
581         * cs-tokenizer.cs: store the location for the ARROW token, we use
582         that in the parser.
583
584         (PushPosition, PopPosition): save/restore also `current_token',
585         restore `parse_generic_less_than' (was missing).
586
587         (parse_opt_type_arguments): use parse_type, not
588         parse_namespace_or_typename to parse types.
589
590         * lambda.cs: Empty new file, will eventually have the lambda
591         expression implementation.
592
593         * lambda.test: used to test the internal tokenizer. 
594
595         * report.cs (FeatureIsNotISO1): Rename from
596         FeatureIsNotStandardized, because it was about the language level
597         (1 vs 2) it was not about standarization.
598
599         (FeatureRequiresLINQ): New.
600
601         * support.cs (SeekableStreamReader): Only require that the reader
602         is a TextReader, not a StreamReader, so we can plug StringReader. 
603
604         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
605         given position in the input stream the following tokens can be
606         parsed as a type followed by an identifier.
607
608         (is_punct): after a '(' if parse_type_and_parameter returns true,
609         then return a special token OPEN_PARENS_LAMBDA which is used to
610         avoid reduce/reduce errors in the grammar for the
611         lambda_expression rules.
612
613         (parse_type): implement a type parser inside the
614         tokenizer, the parser only returns true or false depending on
615         whether the input at a given position can be parsed as a type.
616
617         (peek_token): new method used during type parsing.
618
619 2007-01-28  Raja R Harinath  <rharinath@novell.com>
620
621         Fix #80531
622         * anonymous.cs (ScopeInfo.InflateParameters): New.
623         (AnonymousContainer.Resolve): Use it to redirect types of
624         delegate parameters.
625
626 2007-01-27  Raja R Harinath  <rharinath@novell.com>
627
628         Fix #80530
629         * expression.cs (Error_InvalidArguments): Don't use two different
630         messages for CS1503.  Use ExtraInformation and
631         SymbolRelatedToPreviousError instead.
632
633         Fix #80358
634         * decl.cs (DeclSpace.initialize_type_params): Don't access
635         'type_params' of a partial class directly.
636
637 2007-01-26  Miguel de Icaza  <miguel@novell.com>
638
639         * constant.cs: Removed a handful of out-of-range checks that were
640         not necessary. 
641
642 2007-01-25  Marek Safar  <marek.safar@gmail.com>
643
644         * expression.cs (CheckUselessComparison): Add additional check for char
645         constants.
646
647         * namespace.cs: Fixed typo.
648
649 2007-01-23  Miguel de Icaza  <miguel@novell.com>
650
651         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
652         gone, instead we inline the test, preventing the needless casts to
653         longs, ulongs and doubles for the parameters, avoiding calls to
654         methods that overchecked stuff, and instead inlined things
655         nicely. 
656
657 2007-01-20  Marek Safar  <marek.safar@gmail.com>
658
659         * cs-parser.jay: Better parameter error handling.
660
661 2007-01-17  Marek Safar  <marek.safar@gmail.com>
662
663         A fix for bug #80368, #80522
664         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
665         whether array initializer contains constants only.
666         (ArrayCreation.Emit): Use better formula to decide when
667         are array initializers for static initialization.
668         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
669         have to emit even constants otherwise they are pre-initialized.
670
671 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
672             Raja R Harinath  <rharinath@novell.com>
673
674         Fix emit order of 'get' vs. 'set'.
675         * support.cs (Accessors): New.
676         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
677         Note the order in which accessors are declared in the source.
678         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
679         Refactored from Property.Define and Indexer.Define.
680         (PropertyBase.DefineAccessors): New helper that calls the above in
681         appropriate order as noted by the parser.
682         (Property.Define, Indexer.Define): Update to changes.
683         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
684
685 2007-01-17  Raja R Harinath  <rharinath@novell.com>
686
687         Fix cs0029-6.cs and gcs0029-2.cs (regression)
688         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
689         there's an implicit conversion from the current type to the target
690         type before converting the underlying constant.
691
692 2007-01-16  Marek Safar  <marek.safar@gmail.com>
693
694         * const.cs (ResolveValue): Updated after constant conversion was made more
695         generic.
696
697         * constant.cs (GetAttributableValue): constant to object conversion is
698         used for attributes only.
699         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
700         constant conversions.
701         (LongConstant.ConvertImplicitly): Ditto.
702
703         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
704         (ImplicitConversionStandard): Handle constant conversion as extra step.
705         It solves the issue when constant conversion was called indirectly like
706         inside array initializer and constant folding was skipped.
707
708         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
709         this change.
710
711         * statement.cs(ImplicitConversionStandard): Updated after constant
712         conversion was made more generic.
713
714 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
715
716         * expression.cs (As.DoResolve): Use GenericConstraints instead of
717         Constraints, solves the problem where the compiler incorrectly
718         reported that a type parameter was not constrained to a class (Bug
719         80518)
720
721 2007-01-14  Marek Habersack  <grendello@gmail.com>
722
723         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
724
725 2007-01-14  Marek Safar  <marek.safar@gmail.com>
726
727         A fix for bug #80368
728         * assign.cs (FieldInitializer): New class implements field
729         initializer statement.
730
731         * attribute.cs: Update after FieldMember rename.
732
733         * class.cs (PropertyBasedMember): New common class for property based
734         types.
735         (InterfaceMemberBase): New base class for all members which can be used as
736         an interface members.
737         (MethodCore): Moved really common code to InterfaceMemberBase.
738         (Method.Define): Equal and GetHasCode detection is relevant for methods
739         only.
740         (MethodData.Define): Don't assume that public event implements an
741         interface automatically.
742         (MethodData.DefineMethodBuilder): Issue an error even if only extern
743         modifier is used.
744         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
745         (FieldMember): Merged with FieldBase.
746         (EventProperty.AEventPropertyAccessor): New specialization to check whether
747         event extern modifier can be used.
748         (EventField.EventFieldAccessor): Moved event field specific code here.
749         (Event.AllowedModifiers): Even event can be extern.
750         (Event.FindOutBaseMethod): New override specific to events.
751         (Indexer.parameters): Reintroduce parameters because base class holds
752         only properties common data.
753         (Indexer.CheckForDuplications): Indexers are threated as methods so we
754         need do extra parameters check.
755
756         * const.cs: Update after FieldMember rename.
757
758         * decl.cs (MemberCache.FindBaseEvent): New method.
759
760         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
761         to reflect that indexer is now derived from PropertyBased.
762
763         * ecore.cs (GetMemberType): Made public.
764         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
765         obsolete event.
766
767         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
768         
769         * typemanager.cs (CSharpSignature): Correctly print event accessors.
770         (RegisterEvent): Removed.
771         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
772         (GetPrivateFieldOfEvent): Renamed to GetEventField.
773
774 2007-01-11  Raja R Harinath  <rharinath@novell.com>
775
776         Fix #80249
777         * statement.cs (CollectionForeach.TryType): Prefer generic
778         GetEnumerator over non-generic variant.  Fix code to follow comments.
779
780 2007-01-09  Raja R Harinath  <rharinath@novell.com>
781
782         Fix #80446
783         * support.cs (ReflectionParameter): Don't use an invalid index on
784         the generic parameter data.
785
786 2007-01-08  Miguel de Icaza  <miguel@novell.com>
787
788         * driver.cs: Just add a tiny bit of infrastructure.
789
790 2007-01-02  Marek Safar  <marek.safar@gmail.com>
791
792         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
793         where field type is struct from current assembly.
794         
795         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
796         it is possible.
797
798 2007-01-02  Marek Safar  <marek.safar@gmail.com>
799
800         A fix for bug #80381
801         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
802         the core types.
803
804         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
805         messages.
806         (Namespace.LookupType): Always use core types from corlib when speficied.
807
808         * report.cs: A new warning.
809
810         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
811         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
812         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
813
814         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
815         (InitCoreTypes): Set expression type of object_type and value_type
816         immediately after lookup.
817
818 2007-01-01  Miguel de Icaza  <miguel@novell.com>
819
820         * cs-tokenizer.cs: Accept Pc class characters (Connector
821         Punctuation) as valid identifiers.  Fixes #78259
822
823         * expression.cs (Invocation.DoResolve): Moved the check for the
824         use of `this' for doing method calls to the Invocation resolution
825         step, after overload resolution has taken place instead of doing
826         the check at the low-level `This.DoResolve' level.
827
828         The `This.DoResolve' happens before overload resolution, so it has
829         no way of knowing if the method that will be called will be
830         instace or static, triggering an erroneous report for cs0188 (Bug
831         78113).
832
833         We now do the check for instance method invocations after we know
834         what method will be called.
835
836         (This.CheckThisUsage): Move the actual use of this structure
837         checking into its own method and expose it. 
838
839         * Everywhere that called Error_ValueCannotBeConverted: pass a new
840         EmitContext.
841
842         Exceptions: Null.ConvertImplicitly,
843         Constant.ImplicitConversionRequired as there are too many call
844         sites for passing the ec. 
845
846         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
847         EmitContext, if the value is null, then we do not try to provide
848         the extra information from the error (If a userdefined conversion
849         exists, as UserDefinedConversion requires a non null-EmitContext).
850
851         Fixes: #80347
852
853 2006-12-30  Raja R Harinath  <rharinath@novell.com>
854
855         * flowanalysis.cs (MyBitVector): Document some invariants.
856         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
857         introduced below, and add a couple of others, 
858
859 2006-12-30  Marek Safar  <marek.safar@gmail.com>
860
861         * attribute.cs (GetMethodObsoleteAttribute): Uses new
862         GetPropertyFromAccessor and GetEventFromAccessor.
863         
864         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
865         overrides non-obsolete one.
866         (Indexer.Define): Error message has been moved to the parser.
867
868         * cs-parser.jay: Better syntax errors handling.
869
870         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
871         when an invocation has no arguments.
872
873         * ecore.cs: Removed not used caching.
874
875         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
876         implementation.
877
878         * report.cs: Add a new warning.
879
880         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
881
882         * typemanager.cs (enumeration_type): Removed.
883         (CSharpSignature): Reuses IsSpecialMethod.
884         (IsEqual): Hack for MS BCL.
885         (GetPropertyFromAccessor): New method.
886         (GetEventFromAccessor): New method.
887         (IsSpecialMethod): Fixed to handle more cases.
888
889 2006-12-30  Marek Safar  <marek.safar@gmail.com>
890
891         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
892         Made white spaces array static.
893
894         * ecore.cs (RemoveGenericArity): Optimized.
895
896         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
897         10 times faster).
898         (MyBitVector.initialize_vector): Simplified.
899
900 2006-12-22  Miguel de Icaza  <miguel@novell.com>
901
902         * ecore.cs: Am not entirely happy with this hack, but it seems to
903         address the issue in 80257 (a small test case for
904         CreativeDocs.NET). 
905
906         I set the MethodGroupExpr.Type to an internal compiler type
907         (itself in this case) to force the resolution to take place.   Why
908         it does not take place with a null is beyond me.
909
910 2006-12-20  Marek Safar  <marek.safar@gmail.com>
911
912         A fix for bug #80288
913         * expression.cs (ResolveOperator): Consider user defined conversion for
914         logical and operator too.
915         (EmitBranchable): Optimization for logical and when full constant folding
916         could not be applied but one operand is constant.
917
918 2006-12-19  Marek Safar  <marek.safar@gmail.com>
919
920         * class.cs (GetClassBases): Write 5 times every day, will never use
921         FullName for error reporting.
922
923         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
924
925 2006-12-19  Martin Baulig  <martin@ximian.com>
926
927         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
928         the symbol file info here.
929
930 2006-12-18  Marek Safar  <marek.safar@gmail.com>
931
932         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
933         of `elseif' is taking then following sections are not taking.
934         Fixes an issue reported on mono mailing list.
935
936 2006-12-18  Marek Safar  <marek.safar@gmail.com>
937
938         A fix for bug #80300
939         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
940         a caller is not taking.
941
942 2006-12-18  Raja R Harinath  <rharinath@novell.com>
943
944         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
945         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
946         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
947         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
948         * class.cs: Update to changes.
949
950 2006-12-17  Marek Safar  <marek.safar@gmail.com>
951
952         A fix for bug #79934
953         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
954         partial container.
955
956         * class.cs (ResolveMembers): Register an iterator in current container and
957         not in shared one.
958
959 2006-12-16  Raja R Harinath  <rharinath@novell.com>
960
961         Fix test-543.cs
962         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
963         satisfy a params annotated parameter.
964
965 2006-12-16  Marek Safar  <marek.safar@gmail.com>
966
967         A fix for bug #77014
968         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
969         paramters correctly and not rely on hacks in Parameters class.
970         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
971         at any possition.
972         (Invocation.VerifyArgumentsCompat): Ditto.
973         (Invocation.EmitArguments): Changed to correctly emit params arguments at
974         any possition.
975
976         * parameter.cs (HasParams): Don't assume that params is the last one.
977
978         * support.cs (ReflectionParameters.ctor): Look for params attribute
979         correctly.
980         (ReflectionParameters.ParameterType): Removed hack when we returned last
981         parameter for out of range parameters.
982         (ParameterName, ParameterModifier): Ditto.
983
984 2006-12-14  Marek Safar  <marek.safar@gmail.com>
985
986         A fix for bug #79987
987         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
988         when assembly is not CLS compliant but type is. I have no idea why is this
989         allowed.
990
991         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
992
993 2006-12-13  Miguel de Icaza  <miguel@novell.com>
994
995         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
996         in struct constructors, they are basically no-ops.
997
998 2006-12-12  Marek Safar  <marek.safar@gmail.com>
999
1000         * cs-tokenizer.cs (Position): Save preprocessor status too.
1001
1002 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1003
1004         A fix for bug #77794
1005         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
1006
1007 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1008
1009         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
1010         Fixes #69299.
1011         (pp_expr): Report error for an invalid expression.
1012         (handle_preprocessing_directive): Simplified; add more error checking.
1013
1014 2006-12-11  Marek Safar  <marek.safar@gmail.com>
1015
1016         A fix for bug #74939
1017         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
1018         directives handling.
1019
1020 2006-12-10  Marek Safar  <marek.safar@gmail.com>
1021
1022         A fix for bugs #80093, and #75984
1023         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
1024         logic, it seems to me as it worked before "by coincidence".
1025         (xtoken): Simplified to use reworked handle_preprocessing_directive.
1026         (cleanup): Enabled endif check.
1027
1028 2006-12-09  Marek Safar  <marek.safar@gmail.com>
1029
1030         A fix for bug #80162
1031         * statement.cs (CollectionForeach.TryType): Generics and non-generics
1032         enumerators are never ambiguous.
1033
1034 2006-12-08  Raja R Harinath  <rharinath@novell.com>
1035
1036         Fix #80060
1037         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
1038
1039 2006-12-06  Marek Safar  <marek.safar@gmail.com>
1040
1041         A fix for bug #80144
1042         * class.cs (EventProperty.Define): Explicit implementation means
1043         that an even is used.
1044
1045 2006-12-06  Marek Safar  <marek.safar@gmail.com>
1046
1047         Fixes the operators implementation (part II)
1048
1049         * cfold.cs (DoConstantNumericPromotions): Renamed to
1050         DoBinaryNumericPromotions and simplified.
1051         (BinaryFold): Couple of conversion fixes; simplified.
1052
1053         * constant.cs, ecore.cs, literal.cs
1054         (ToType): Renamed to ConvertImplicitly.
1055         (Reduce): Renamed to ConvertExplicitly.
1056
1057         * class.cs, convert.cs: Updated.
1058
1059         * expression.cs: TryReduce doesn't throw an exception.
1060
1061 2006-12-01  Marek Safar  <marek.safar@gmail.com>
1062
1063         A fix for bug #80108
1064         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
1065         compatible.
1066
1067 2006-11-30  Marek Safar  <marek.safar@gmail.com>
1068
1069         Fixes unary operators implementation (part I)
1070         Also fixes #80026
1071
1072         * cfold.cs (Error_CompileTimeOverflow): Made internal
1073
1074         * const.cs (IConstant): Changed to use reference to constant and
1075         not constant itself.
1076         Updated IConstant implementations.
1077
1078         * constant.cs (CreateConstant): New factory method.
1079         Updated IConstant implementation.
1080
1081         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
1082
1083         * ecore.cs: Updated to use CreateConstantReference.
1084
1085         * enum.cs: Reflects IConstant changes.
1086
1087         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
1088
1089         * literal.cs (NullConstant): Change to be independently usable.
1090
1091 2006-11-29  Martin Baulig  <martin@ximian.com>
1092
1093         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
1094         we need to emit the scope initializer before calling the base .ctor.
1095
1096         * anonymous.cs: Merged back from the new anonymous methods branch.
1097         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
1098
1099         * expression.cs (ParameterReference.DoResolveBase): Create a
1100         "normal" ScopeInfo when capturing parameters rather than using the
1101         root scope; this makes things work with anonymous methods having
1102         parameters.
1103
1104         * statement.cs
1105         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
1106
1107 2006-11-22  Marek Safar  <marek.safar@gmail.com>
1108
1109         A fix for bug #79987
1110         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
1111         check to a base class.
1112         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
1113         only when assembly has missing attribute.
1114         * report.cs: Update.
1115
1116 2006-11-21  Marek Safar  <marek.safar@gmail.com>
1117
1118         * cs-tokenizer.cs: Merged with gmcs version.
1119
1120 2006-11-20  Marek Safar  <marek.safar@gmail.com>
1121
1122         * cs-tokenizer.cs,
1123         * cs-parser.jay: Better error message when partial keyword is misplaced.
1124
1125 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
1126
1127         A fix for bug #79810
1128         report.cs: CS1058 only applies to 2.0 profile (gmcs).
1129         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
1130         a RuntimeWrappedException by default.
1131
1132 2006-11-18  Marek Safar  <marek.safar@gmail.com>
1133
1134         A fix for bug #79843
1135         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
1136         implementation.
1137         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
1138
1139 2006-11-18  Marek Safar  <marek.safar@gmail.com>
1140
1141         * driver.cs, namespace.cs: Uses faster IndexOf version.
1142
1143 2006-11-17  Marek Safar  <marek.safar@gmail.com>
1144
1145         A fix for bug #79941
1146         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
1147         operators.
1148         (Operator.Define): Implicit/Explicit operator of same type is duplicate
1149         even if internal name is different.
1150         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
1151         (UserDefinedConversion): Simplified as the operators cannot be internal.
1152         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
1153         conversions.
1154         (MethodLookup): Replaced EmitContext with parentType.
1155         * expression.cs: Updated.
1156
1157 2006-11-09  Raja R Harinath  <rharinath@novell.com>
1158
1159         * driver.cs (BadAssembly): Handle all the ugliness of
1160         DefineDynamicAssembly.
1161
1162 2006-11-08  Raja R Harinath  <rharinath@novell.com>
1163
1164         Address parts of #58244 -- most of what's left is in the runtime
1165         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
1166         CS1509 error checks, and handle them for all assembly loads, not
1167         just the first invocation.
1168         (LoadModule): Likewise.  Move handling of 'adder_method' ...
1169         * codegen.cs (AssemblyClass.AddModule): ... here.
1170
1171 2006-11-02  Marek Safar  <marek.safar@gmail.com>
1172
1173         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
1174         IEnumerable<T> is ambiguous.
1175
1176 2006-10-31  Marek Safar  <marek.safar@gmail.com>
1177
1178         A fix for bug #67689
1179         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
1180         GetEnumerator is ambiguous.
1181
1182         * report.cs: Add new warning.
1183
1184 2006-10-29  Marek Safar  <marek.safar@gmail.com>
1185
1186         A fix for bug #78602
1187         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1188         to protected member can be nested type.
1189
1190 2006-10-28  Marek Safar  <marek.safar@gmail.com>
1191
1192         A fix for bug #78965
1193         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1194         to protected member must derive from current type.
1195
1196 2006-10-27  Marek Safar  <marek.safar@gmail.com>
1197
1198         assign.cs: Reuses error method.
1199
1200         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
1201         instead of type for constants.
1202         (Expression.Error_ValueAssignment): Common error method.
1203
1204         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
1205         for any assignment.
1206
1207 2006-10-27  Marek Safar  <marek.safar@gmail.com>
1208
1209         A fix for bug #79081
1210         * expression.cs (MemberAccess.DoResolve): Check nested type
1211         accessibility.
1212
1213 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
1214
1215         * doc.cs : nested delegates were not handled. Fixed bug #79754.
1216
1217 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1218
1219         A fix for bug #76591
1220         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
1221
1222 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1223
1224         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
1225         type forwarder of the same type multiple times.
1226
1227 2006-10-26  Raja R Harinath  <rharinath@novell.com>
1228
1229         Fix #78820
1230         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
1231         instance as an rvalue, even when we later resolve as an lvalue.
1232
1233 2006-10-25  Martin Baulig  <martin@ximian.com>
1234
1235         * anonymous.cs: Fix #79673.
1236
1237 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
1238
1239         A fix for bug #79666
1240         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
1241         ignored when is optimized (= default value) as its value is already set.
1242
1243 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1244
1245         A fix for bug #79724
1246         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
1247         TypeContainer for type lookup.
1248
1249 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1250
1251         A fix for bug #79231
1252         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
1253         * expression.cs (OverloadResolve): Always convert type name for
1254         an error message.
1255         (ResolveNamespaceOrType): Don't confuse a nested type with any 
1256         other member.
1257
1258 2006-10-18  Martin Baulig <martin@ximian.com>
1259
1260         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
1261
1262 2006-10-17  Miguel de Icaza  <miguel@novell.com>
1263
1264         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
1265         an int32, but requesting an int64 from the conversion
1266
1267 2006-10-12  Martin Baulig  <martin@ximian.com>
1268
1269         * anonymous.cs
1270         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
1271         
1272 2006-10-12  Martin Baulig  <martin@ximian.com>
1273
1274         * statement.cs
1275         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
1276
1277 2006-10-11  Miguel de Icaza  <miguel@novell.com>
1278
1279         * convert.cs: Remove broken code: I was doing the "Existance"
1280         tests for Implicit conversions.
1281
1282 2006-10-10  Miguel de Icaza  <miguel@novell.com>
1283
1284         * convert.cs: Added one missing case in
1285         ImplicitStandardConversionExists uint64 to intptr.
1286
1287         Fixes #59800
1288         
1289         * typemanager.cs (uintptr_type): another core known type.   
1290
1291         * ecore.cs (OperatorCast): routine used to do cast operations that
1292         depend on op_Explicit.  We could change some of the Decimal
1293         conversions to use this.
1294
1295         This one has a probe mechanism that checks both types for an op_
1296         which it coudl be used to eliminate two classes: CastToDecimal
1297         and CastFromDecimal.
1298
1299         * convert.cs: Implement the conversions documented in #59800
1300         
1301 2006-10-10  Martin Baulig  <martin@ximian.com>
1302
1303         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
1304         before RootScope.ResolveMembers().
1305
1306         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
1307         `CurrentType' if appropriate.
1308
1309 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
1310
1311         A fix for bug #78568
1312         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
1313         when contains binary operators.
1314         * cs-parser.jay: Updated.
1315
1316 2006-10-09  Martin Baulig  <martin@ximian.com>
1317
1318         * delegate.cs
1319         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
1320         moved that into Define() and also do the other type parameter
1321         checks there.  Fixes #79094.  Added gtest-292.cs.
1322
1323         * expression.cs
1324         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
1325         since that doesn't include type parameters; don't use `Ldelema'
1326         for type parameters.  Fixes #78980.  Added gtest-293.cs.
1327
1328 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
1329
1330         A fix for #77796
1331         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
1332         conversion is allowed.
1333
1334 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1335
1336         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
1337         error reporting when no error occurs.
1338
1339 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1340
1341         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
1342         does not exist.
1343
1344 2006-10-06  Raja R Harinath  <rharinath@novell.com>
1345
1346         Fix #79584
1347         * class.cs (DefineTypeBuilder): Check circular dependencies before
1348         setting the parent of the TypeBuilder.
1349         (CheckRecursiveDefinition): Don't use 'BaseType', since
1350         it may not be valid until after DefineTypeBuilder.  Use
1351         'base_type' instead.
1352
1353 2006-10-04  Martin Baulig  <martin@ximian.com>
1354
1355         Merged the Anonymous Methods patch.
1356
1357         * anonymous.cs, iterators.cs: The new anonymous methods code.
1358
1359         * statement.cs (Variable): New public abstract class.
1360         (LocalInfo.Variable): New public property.
1361         (LocalInfo.ResolveVariable): New public method.
1362         (Block.Flags): Add `IsIterator'.
1363         (Block.AddVariable): Improved the CS0136 check.
1364         (Block.AnonymousChildren): New public property.
1365         (Block.AddAnonymousChild): New public method.
1366         (ToplevelBlock): Update to use the new anonymous method framework.
1367         (ToplevelBlock.ctor): `container' is now a `Block' and not a
1368         `ToplevelBlock'; this is required to correctly implement the
1369         CS0136 check.
1370         (Fixed, Using): Use `TemporaryVariable' instead of directly
1371         creating the `LocalBuilder'.
1372
1373         * parameter.cs (Parameter.ResolveVariable): New public method.
1374         (Parameters.ResolveVariable): Likewise.
1375
1376         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
1377
1378         * class.cs (TypeContainer): Replaced the `iterators' list and
1379         corresponding methods with a list of `CompilerGeneratedClass'es.
1380         (TypeContainer.ResolveMembers): New public method.
1381         (Method): `IIteratorContainer' has been replaced by
1382         `IAnonymousHost'.
1383
1384         * expression.cs (VariableReference): New public abstract base
1385         class for `LocalVariableReference', `ParameterReference' and
1386         `This'.
1387
1388         * codegen.cs (EmitContext): Removed `capture_context',
1389         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
1390         (EmitContext.EmitThis): Removed.
1391
1392         * cs-parser.jay: Replace `iterator_container' with
1393         `anonymous_host'.       
1394
1395 2006-10-04  Martin Baulig  <martin@ximian.com>
1396
1397         * generic.cs (GenericMethod): Don't make this abstract.
1398         (Constraints.Clone): Added dummy implementation.
1399
1400 2006-10-04  Raja R Harinath  <harinath@gmail.com>
1401
1402         Fix #79577
1403         * namespace.cs (LookForAnyGenericType): Avoid nullref on
1404         'declspaces'.  Avoid allocating arrays willy-nilly.
1405
1406         Fix #79553
1407         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
1408         cases out of the switch.
1409
1410 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
1411
1412         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
1413         message when non-generic type is used with the type arguments.
1414         * expression.cs: Updated.
1415
1416 2006-09-28  Raja R Harinath  <rharinath@novell.com>
1417
1418         Fix #79013
1419         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
1420         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1421         Change semantics slightly.  Don't insist on having only one
1422         temporary EmptyExpression -- just throttle the creation of new ones.
1423
1424         Fix #79451
1425         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
1426         non-interfaces too.  If no methods are found, don't try to create
1427         a MethodGroupExpr.
1428
1429 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
1430
1431         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
1432         generic type.
1433
1434         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
1435         us produce better error message.
1436
1437 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
1438
1439         * expression.cs (Binary.ResolveOperator): Warn about a side effect
1440         of the `|' operator.
1441
1442         * report.cs: A new warning added.
1443
1444 2006-09-27  Martin Baulig  <martin@ximian.com>
1445
1446         * generic.cs (GenericMethod): Don't make this abstract.
1447
1448 2006-09-27  Martin Baulig  <martin@ximian.com>
1449
1450         * report.cs
1451         (InternalErrorException): Added overloaded ctor taking a params array.
1452
1453 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
1454
1455         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
1456         Fixed the cases when same error was reported twice.
1457
1458         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
1459         now report symbol information.
1460
1461 2006-09-25  Martin Baulig  <martin@ximian.com>
1462
1463         * class.cs: Completely unified with the gmcs version.
1464
1465 2006-09-25  Martin Baulig  <martin@ximian.com>
1466
1467         * typemanager.cs (TypeManager.IsNullableType): New public function.
1468         (TypeManager.IsNullableTypeOf): Likewise.
1469         (TypeManager.IsNullableValueType): Likewise.
1470
1471         * class.cs (MethodCore): Added the `GenericMethod' argument from
1472         gmcs and also unified all classes derived from `MethodCore' with gmcs.
1473
1474 2006-09-24  Raja R Harinath  <harinath@gmail.com>
1475
1476         * convert.cs: Unify with gmcs version.
1477
1478 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1479
1480         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
1481         verify them as well.
1482
1483         * report.cs: New warning.
1484
1485 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1486
1487         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
1488         for anonymous block with out argument.
1489
1490 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1491
1492         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
1493         not used private events only.
1494
1495 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
1496
1497         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
1498
1499         * const.cs (Const.Define): Check for constant type.
1500         (Const.IsConstantTypeValid): Looks for valid constant types.
1501
1502         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
1503
1504         * ecore.cs (EmptyConstantCast): New common class for all constant based
1505         EmptyCast(s).
1506
1507         * expression.cs (Is.DoResolve): Handle null constant especially.
1508         (New.DoResolve): Check for new void().
1509         (MemberAccess.DoResolve): Cope with all kind of nulls.
1510
1511         * literal.cs (NullConstant): Uses EmptyConstantCast.
1512         (NullDefault): Based on EmptyConstantCast.
1513         (NullLiteral): Uses EmptyConstantCast.
1514
1515         * statement.cs (Block.ResolveMeta): Check for constant type.
1516
1517 2006-09-22  Martin Baulig  <martin@ximian.com>
1518
1519         * delegate.cs, attribute.cs: Merged with the gmcs versions.
1520
1521 2006-09-22  Raja R Harinath  <rharinath@novell.com>
1522
1523         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
1524         not the null type.
1525
1526         Fix part of #79451
1527         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
1528         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
1529         code slightly.
1530
1531 2006-09-22  Martin Baulig  <martin@ximian.com>
1532
1533         * ecore.cs: Merged with the gmcs version.
1534
1535         * generic.cs (ConstructedType): New dummy class.
1536         (TypeArguments): Don't make this abstract.
1537
1538         * typemanager.cs
1539         (TypeManager.IsGenericTypeDefinition): New method.
1540         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
1541
1542 2006-09-22  Raja R Harinath  <rharinath@novell.com>
1543
1544         * expression.cs (ComposedCast): Check for arrays of TypedReference
1545         before creating the type, not after.
1546
1547 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
1548
1549         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
1550         after ToType change.
1551
1552         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
1553         when constant must be implicitly convertible.
1554
1555         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
1556
1557         * ecore.cs (NullCast): Derives from NullConstant.
1558
1559         * expression.cs (Is.DoResolve): Removed useless variables.
1560         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
1561         (New.Constantify): Add enum support.
1562         (MemberAccess.DoResolve): Add warning when accessing null constant or
1563         variable.
1564
1565         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
1566         property.
1567
1568         * literal.cs (NullConstant): New abstract class with common
1569         functionality for all null specializations.
1570         (NullDefault): Represents default(X) when result can be
1571         reduced to null.
1572         (NullLiteral): Updated.
1573
1574         * report.cs: Add new warning.
1575
1576 2006-09-21  Martin Baulig  <martin@ximian.com>
1577
1578         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
1579
1580 2006-09-21  Martin Baulig  <martin@ximian.com>
1581
1582         * generic.cs (GenericConstraints): New dummy class.
1583         (Constraints): Likewise.
1584         (TypeParameter): Likewise.
1585         (TypeParameterName): Likewise.
1586         (GenericMethod): Likewise.
1587
1588         * typemanager.cs (TypeManager.GetGenericArguments): New method.
1589
1590         * decl.cs: Merged with the gmcs version.
1591
1592 2006-09-21  Raja R Harinath  <rharinath@novell.com>
1593
1594         * generic.cs (TypeParameter): Implement IMemberContainer.
1595         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
1596
1597         * rootcontext.cs: Unify with gmcs version.
1598
1599         * report.cs: Unify with gmcs version.
1600         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
1601         from gmcs/generics.cs.
1602         * generics.cs (TypeParameter): New dummy class.
1603
1604         * support.cs: Unify with gmcs version.
1605
1606 2006-09-20  Raja R Harinath  <rharinath@novell.com>
1607
1608         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
1609         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
1610
1611         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
1612         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
1613         * mcs.exe.sources: Add generic.cs.
1614
1615         * codegen.cs: Unify with gmcs version.
1616
1617         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1618         (EmitContext): Add GenericDeclContainer implementation.
1619         * decl.cs (MemberCore, DeclSpace): Likewise.
1620         * namespace.cs: Remove #ifdef GMCS_SOURCE.
1621
1622         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1623         MCS TypeManager has a corresponding dummy method.
1624
1625 2006-09-19  Martin Baulig  <martin@ximian.com>
1626
1627         * expression.cs: Completely merged with the gmcs version.
1628
1629 2006-09-19  Martin Baulig  <martin@ximian.com>
1630
1631         * expression.cs (Invocation): Merged with the gmcs version.
1632         (ArrayAccess.GetStoreOpcode): Likewise.
1633
1634 2006-09-19  Martin Baulig  <martin@ximian.com>
1635
1636         * typemanager.cs
1637         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1638         (TypeManager.IsGenericMethodDefinition): Likewise.
1639
1640 2006-09-19  Martin Baulig  <martin@ximian.com>
1641
1642         * typemanager.cs
1643         (TypeManager.IsEqual): Moved the gmcs implementation here.
1644         (TypeManager.DropGenericTypeArguments): Likewise.
1645         (TypeManager.DropGenericMethodArguments): Likewise.
1646         (TypeManager.GetTypeArguments): Moved here from gmcs.
1647         (TypeManager.HasGenericArguments): Likewise.
1648
1649 2006-09-19  Martin Baulig  <martin@ximian.com>
1650
1651         * expression.cs (Binary): Merged with the gmcs version.
1652
1653 2006-09-19  Martin Baulig  <martin@ximian.com>
1654
1655         * expression.cs (Probe, As, Is): Merged with the gmcs version.
1656
1657 2006-09-19  Martin Baulig  <martin@ximian.com>
1658
1659         * typemanager.cs: Merged with the gmcs version.
1660
1661 2006-09-16  Raja R Harinath  <rharinath@novell.com>
1662
1663         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1664         * driver.cs: Likewise.
1665
1666 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
1667
1668         A fix for #79401
1669         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1670         only if parent type is class.
1671         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1672         update.
1673
1674 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
1675
1676         * cs-parser.jay,
1677         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1678         keywords are used.
1679         * typemanager.cs(CSharpName): Converts NullType to null.
1680
1681 2006-09-15  Martin Baulig  <martin@ximian.com>
1682
1683         * typemanager.cs
1684         (TypeManager.GetMethodName): Added mcs implementation.
1685         (TypeManager.IsEqual): Likewise.
1686
1687         * ecore.cs
1688         (SimpleName.RemoveGenericArity): Added dummy implementation.
1689
1690         * pending.cs: Merged with the gmcs version.     
1691
1692 2006-09-15  Martin Baulig  <martin@ximian.com>
1693
1694         * statement.cs: Merge with the gmcs version.
1695
1696 2006-09-15  Martin Baulig  <martin@ximian.com>
1697
1698         * statement.cs (Switch): Merge with the gmcs implementation
1699         (without nullables), which is newer.
1700
1701 2006-09-15  Martin Baulig  <martin@ximian.com>
1702
1703         * statement.cs (Block.Variables): Make this public.
1704         (ToplevelBlock.Parameters): Make this a property.
1705         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1706
1707 2006-09-15  Martin Baulig  <martin@ximian.com>
1708
1709         * namespace.cs: Merge with the gmcs version.
1710
1711 2006-09-15  Martin Baulig  <martin@ximian.com>
1712
1713         * decl.cs (MemberName): Minor code cleanups.
1714
1715 2006-09-15  Martin Baulig  <martin@ximian.com>
1716
1717         * parameter.cs: Merge with the gmcs version.
1718
1719 2006-09-15  Martin Baulig  <martin@ximian.com>
1720
1721         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
1722         and an error in mcs.
1723
1724 2006-09-15  Martin Baulig  <martin@ximian.com>
1725
1726         * flowanalysis.cs: Merged from GMCS; added the generics code into
1727         a `GMCS_SOURCE' conditional so we can share this file.
1728
1729 2006-09-08  Martin Baulig  <martin@ximian.com>
1730
1731         * typemanager.cs (TypeManager.interlocked_type): New public field.
1732         (TypeManager.int_interlocked_compare-exchange): New public field.
1733         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
1734         enumerator types here and call InitGenericCoreTypes().
1735         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
1736         after calling InitEnumUnderlyingTypes().
1737
1738         * rootcontext.cs
1739         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
1740         `classes_second_stage'. 
1741
1742 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
1743
1744         * assign.cs, ecore.cs, expression.cs: Share error message text.
1745         * class.cs (FieldMember.Define): Check for varible of static type.
1746         * driver.cs (LoadAssembly): Uses error output for errors.
1747         * statement.cs: Updated.
1748
1749 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
1750
1751         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
1752         type instance.
1753
1754 2006-09-07  Martin Baulig  <martin@ximian.com>
1755
1756         * driver.cs
1757         (MainDriver): Revert r62663 from Marek; see #70506 for details.
1758
1759 2006-08-29  Miguel de Icaza  <miguel@novell.com>
1760
1761         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
1762         
1763 2006-08-17  Miguel de Icaza  <miguel@novell.com>
1764
1765         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
1766         #52019 and #79064, the use of the \uXXXX sequence in source code
1767         to represent unicode characters.
1768
1769 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
1770
1771         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
1772         support.
1773         * class.cs, ecore.cs, statement.cs: Merged to one error message.
1774
1775 2006-08-13  Miguel de Icaza  <miguel@novell.com>
1776
1777         * assign.cs: Catch attempts to assign to a method groups in += and
1778         report as 1656
1779
1780 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
1781
1782         A fix for #79056
1783         * cs-parser.jay: Don't destroy current array type by typeof of array's.
1784
1785 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
1786
1787         * class.cs (Method.Define): Issue a warning when generic method looks like
1788         an entry point.
1789         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1790         as well.
1791
1792 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
1793  
1794         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1795         looking for ctor.
1796         * decl.cs (MemberCache.FindMembers): When container is interface we need to
1797         search all base interfaces as a member can be ambiguous.
1798         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1799         Constructor member type filter. 
1800         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1801         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1802         reporting for returned memberinfos.
1803         * report.cs: Updated.
1804         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1805         version to work on all runtimes.
1806         (TypeManager.RealMemberLookup): Removed members filtering.
1807
1808 2006-08-08  Raja R Harinath  <rharinath@novell.com>
1809
1810         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1811         (PropertyExpr.EmitAssign): Likewise.
1812         * expression.cs (Indirection.EmitAssign): Likewise.
1813         (LocalVariableReference.EmitAssign): Likewise.
1814         (ParameterReference.EmitAssign): Likewise.
1815         (Invocation.EmitArguments): Likewise.
1816         (ArrayAccess.EmitAssign): Likewise.
1817         (IndexerAccess.EmitAssign): Likewise.
1818         (This.EmitAssign): Likewise.
1819         (ConditionalLogicalOperator.Emit): Likewise.
1820
1821         Fix #79026
1822         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
1823         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
1824         leave it in after returning it.
1825         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
1826
1827 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
1828
1829         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1830         message.
1831
1832 2006-08-03  Raja R Harinath  <rharinath@novell.com>
1833
1834         Fix cs0146-3.cs and cs0146-4.cs.
1835         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1836         enclosing types don't depend on the current type.
1837
1838 2006-08-02  Raja R Harinath  <rharinath@novell.com>
1839
1840         Fix #77963
1841         * class.cs (TypeContainer.DoDefineMembers): Use
1842         FindBaseMemberWithSameName on Parent, since we're interested in
1843         whether we hide inherited members or not.
1844         (FindBaseMemberWithSameName): Make slightly more robust.
1845
1846         Fix the non-generic testcase from #77396
1847         * decl.cs (DeclSpace.DeclContainer): Remove override.
1848
1849         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1850         declspaces for doppelgangers too.
1851         (UsingEntry): Implement IResolveContext.
1852         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
1853         'this' as the resolve context.
1854         (LocalAliasEntry): Likewise.
1855
1856         Implement parts of #77403
1857         * roottypes.cs (RootDeclSpace): New.  Used to represent the
1858         toplevel declaration space.  Each namespace declaration introduces
1859         a "partial" root declaretion space.
1860         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1861         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1862         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1863         from 'current_namespace.SlaveDeclSpace'.
1864         (namespace_declaration): Likewise.
1865         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1866         check.  It can't happen now.
1867         * decl.cs (DeclSpace.LookupType): Likewise.
1868         * driver.cs (MainDriver): Sanity check.
1869
1870 2006-08-01  Raja R Harinath  <rharinath@novell.com>
1871
1872         * decl.cs (DeclSpace.FindNestedType): Remove.
1873         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1874         LookupTypeContainer to get the container of the nested type.
1875         * class.cs (TypeContainer.FindNestedType): Make non-override.
1876
1877 2006-07-31  Raja R Harinath  <rharinath@novell.com>
1878
1879         * decl.cs (DeclSpace.PartialContainer): Move field from ...
1880         * class.cs (TypeContainer.PartialContainer): ... here.
1881         (TypeContainer.AddBasesForPart): New helper.
1882         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
1883         instead.
1884         * cs-parser.jay (current_class): Convert to DeclSpace.
1885         (struct_declaration, interface_declaration, class_declaration):
1886         Use AddBasesForPart instead of .Bases directly.
1887         * const.cs, iterators.cs: Update to changes.
1888
1889 2006-07-28  Raja R Harinath  <rharinath@novell.com>
1890
1891         * class.cs (TypeContainer.AddMemberType): Rename from
1892         AddToTypeContainer.
1893         (TypeContainer.AddMember): Rename from AddToMemberContainer.
1894         (AddTypeContainer): New.  Combine AddClassOrStruct and
1895         AddInterface.
1896         (AddPartial): Update.  Add 'is_partial' argument.
1897         * roottypes.cs: Update to changes.
1898         * cs-parser.jay (push_current_class): New helper for handling
1899         current_container and current_class.
1900         (struct_declaration, interface_declaration, class_declaration):
1901         Use it.
1902
1903 2006-07-26  Raja R Harinath  <rharinath@novell.com>
1904
1905         * roottypes.cs: Rename from tree.cs.
1906
1907         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1908         * tree.cs (Tree, ITreeDump): Remove types.
1909         * rootcontext.cs (tree, Tree): Remove fields.
1910         (root, ToplevelTypes): New.
1911         * *.cs: Update to rename.
1912
1913         * tree.cs (Tree.RecordDecl): Remove.
1914         (RootTypes.AddToTypeContainer): Record the toplevel type in its
1915         namespace here.
1916         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1917
1918 2006-07-23  Raja R Harinath  <harinath@gmail.com>
1919
1920         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1921         DoFlowAnalysis and OmitStructFlowAnalysis here.
1922         (ec.With): Rename from WithUnsafe and generalize.
1923         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
1924         (ec.WithFlowAnalyis): New.
1925         * ecore.cs, expression.cs, statement.cs: Update.
1926
1927 2006-07-22  Raja R Harinath  <harinath@gmail.com>
1928
1929         * statement.cs (Block.ResolveMeta): Simplify slightly.
1930
1931         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
1932         multiple boolean fields.  Convert InUnsafe, constant_check_state,
1933         check_state to flags.
1934         (CheckState, ConstantCheckState): Update.
1935         (InUnsafe): New read-only property.
1936         (FlagsHandle): Rename from CheckStateHandle and convert to handle
1937         arbitrary flags.
1938         (WithUnsafe): New helper similar to WithCheckState.
1939         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1940         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1941
1942 2006-07-21  Raja R Harinath  <rharinath@novell.com>
1943
1944         Make comparisons use the same IL irrespective of whether they're
1945         in a 'checked' or 'unchecked' context: one of the issues in #78899
1946         * codegen.cs (EmitContext.CheckState): Make read-only property.
1947         (EmitContext.ConstantCheckState): Likewise.
1948         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1949         helper that implement a save/restore stack for CheckState
1950         values.  This is the only way to change check-state.
1951         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1952         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1953         (CheckedExpr.EmitBranchable): New forwarding method.
1954         (UnCheckedExpr): Likewise.
1955         * statement.cs (Block.ResolveMeta): Use WithCheckState.
1956         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1957         (Checked.Resolve, checked.DoEmit): Likewise.
1958
1959 2006-07-20  Miguel de Icaza  <miguel@novell.com>
1960
1961         * anonymous.cs: Cache the resolved anonymous delegate, and return
1962         this so that the ResolveTopBlock is only triggered once, not
1963         twice.
1964
1965         Currently we trigger ResolvetopBlock twice due to a first pass of
1966         argument check compatibility, and a second pass that does the
1967         actual resolution.   
1968         
1969 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1970
1971         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1972         modifiers.
1973         * rootcontext.cs (Reset): Add helper_classes.
1974
1975 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1976
1977         A fix for #78860
1978         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1979         correctly.
1980
1981 2006-07-13  Miguel de Icaza  <miguel@novell.com>
1982
1983         * statement.cs (Lock): Handle expressions of type
1984         TypeManager.null_type specially.  Fixes #78770
1985
1986 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1987
1988         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1989         to an event.
1990
1991 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1992
1993         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1994         for accessors as well.
1995         * ecore.cs (EventExpr): Add AccessorTable.
1996
1997 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
1998
1999         A fix for #78738
2000         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
2001         for CS0122 where appropriate.
2002         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
2003         level attributes.
2004         (Filter): Assembly can be null in the case of top level attributes.
2005
2006 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
2007
2008         A fix for #78690
2009
2010         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
2011         is done at global level.
2012
2013 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
2014
2015         A fix for #77002, Implemented TypeForwarder support.
2016
2017         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
2018         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
2019         * typemanager.cs (): Add type_forwarder_attr_type.
2020
2021 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
2022
2023         * report.cs: Add CS0469 warning.
2024
2025 2006-06-21  Martin Baulig  <martin@ximian.com>
2026
2027         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
2028         the `try'-block, so we also report CS0016 etc. there.
2029
2030 2006-06-21  Martin Baulig  <martin@ximian.com>
2031
2032         * delegate.cs
2033         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
2034
2035 2006-06-21  Martin Baulig  <martin@ximian.com>
2036
2037         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
2038         also report CS1686 for parameters.
2039
2040 2006-06-21  Martin Baulig  <martin@ximian.com>
2041
2042         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
2043         instead of an error if the value is not implicitly convertible to
2044         the switch types; fixes #77964.
2045
2046 2006-06-21  Raja R Harinath  <rharinath@novell.com>
2047
2048         Fix #78673
2049         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
2050         FieldBuilder is null.
2051
2052         Fix #78662
2053         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
2054         'left' and 'right' before error-checking.
2055
2056 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
2057
2058         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
2059         Fixed bug #78601.
2060         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
2061         (FieldExpr.DoResolve): likewise.
2062         (PropertyExpr.InstanceResolve): likewise.
2063         (EventExpr.InstanceResolve): likewise. 
2064
2065 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
2066
2067         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
2068         attribute applicable tests for attribute argument.
2069
2070 2006-06-02  Raja R Harinath  <rharinath@novell.com>
2071
2072         Fix #78079
2073         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
2074         (Binary.OverloadResolve_PredefinedIntegral): New.
2075         (Binary.OverloadResolve_PredefinedFloating): New.
2076         (Binary.OverloadResolve_PredefinedString): New.
2077         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
2078         Follow the standard more closely, and treat numeric promotions in
2079         terms of overload resolution.
2080         (Binary.CheckShiftArguments): Simplify.
2081
2082 2006-06-01  Raja R Harinath  <rharinath@novell.com>
2083
2084         * flowanalysis.cs (MyBitVector): Simplify representation.
2085         (MyBitVector.Clone): Avoid allocating BitArray.
2086         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
2087         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
2088         (*): Update.  Change all references to MyBitVector.And and
2089         MyBitVector.Or to &= and |=.
2090
2091 2006-05-29  Raja R Harinath  <rharinath@novell.com>
2092
2093         Fix cs0231-[34].cs.
2094         * cs-parser.jay (formal_parameter_list): Extend the pattern below
2095         to param arguments too.
2096
2097 2006-05-26  Miguel de Icaza  <miguel@novell.com>
2098
2099         * cs-parser.jay: Catch another parsing form for arglist being
2100         followed by other arguments.  Fixes #78313.
2101
2102 2006-05-24  Raja R Harinath  <rharinath@novell.com>
2103
2104         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
2105         checking of out parameters to ...
2106         (FlowBranchingToplevel.Merge): ... here.
2107         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
2108         set, propagate the origin upward, and only complain if there was
2109         no other error.
2110         (FlowBranchingException.AddContinueOrigin): Likewise.
2111         (FlowBranchingException.AddReturnOrigin): Likewise.
2112         (FlowBranchingException.AddGotoOrigin): Likewise.       
2113
2114 2006-05-23  Raja R Harinath  <rharinath@novell.com>
2115
2116         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
2117         unreachable, skip it.
2118         (FlowBranchingException.Merge): Always propagate jumps, even if
2119         the finally block renders subsequent code unreachable.
2120
2121 2006-05-18  Raja R Harinath  <rharinath@novell.com>
2122
2123         Fix #77601
2124         * statement.cs (Goto.Resolve): Move responsibility for resolving
2125         'goto' to FlowBranching.AddGotoOrigin.
2126         (Goto.SetResolvedTarget): New.  Callback to set the
2127         LabeledStatement that's the target of the goto.
2128         (Goto.DoEmit): Use Leave instead of Br when crossing an
2129         unwind-protect boundary.
2130         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
2131         LookupLabel and adjust to new semantics.
2132         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
2133         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
2134         Goto.SetResolvedTarget to update target.
2135         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
2136         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
2137         AddBreakOrigin & co.  Delay propagation until ...
2138         (FlowBranchingException.Merge): ... this.
2139
2140         * statement.cs (Block.Resolve): Always depend on flow-branching to
2141         determine unreachability.  Kill workaround that originally emitted
2142         only one statement after an "unreachable" label (see infloop in
2143         test-515.cs).
2144
2145         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
2146         This is still "wrong", but anything better would probably need a
2147         multi-pass algorithm.
2148         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
2149         usage vector.  Force current usage vector to be reachable, to
2150         optimistically signify backward jumps.
2151         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
2152         detected.
2153         (FlowBranchingLabeled.Merge): New.  If no backward jump was
2154         detected, return the original salted-away usage vector instead,
2155         updated with appropriate changes.  Print unreachable warning if
2156         necessary.
2157         * statement.cs (Block.Resolve): Don't print unreachable warning on
2158         a labeled statement.
2159
2160 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
2161
2162         * driver.cs: Pass filename without path to AssemblyBuilder's 
2163         AddResourceFile. Fixes bug #78407.
2164
2165 2006-05-17  Raja R Harinath  <rharinath@novell.com>
2166
2167         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
2168         * flowanalysis.cs (FlowBranchingLabeled): ... here.
2169         (FlowBranching.MergeChild): Overwrite
2170         reachability information from Labeled branchings too.
2171
2172 2006-05-16  Raja R Harinath  <rharinath@novell.com>
2173
2174         * statement.cs (Goto.Resolve): Merge jump origins here ...
2175         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
2176
2177         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
2178         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
2179         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
2180         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
2181         here, ...
2182         * statement.cs (Goto.Resolve): ... not here.
2183         (Goto.Emit): Remove CS1632 check.
2184
2185 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
2186
2187         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
2188         error message.
2189
2190 2006-05-11  Raja R Harinath  <rharinath@novell.com>
2191
2192         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
2193         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
2194         (FlowBranchingException.Label): Likewise.
2195
2196         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
2197         given value.
2198         (MyBitVector.Or): Use it to avoid losing information (Count).
2199         (FlowBranching.MergeOrigins): Likewise.
2200
2201         * flowanalysis.cs (UsageVector.IsDirty): Remove.
2202         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
2203         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
2204         (UsageVector.ToString): Simplify.
2205         (UsageVector.MergeSiblings): Move here from ...
2206         (FlowBranching.Merge): ... here.
2207         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
2208         not a MyBitVector.
2209
2210 2006-05-10  Raja R Harinath  <rharinath@novell.com>
2211
2212         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
2213         null bitvector is treated as all-true.
2214
2215         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
2216         (MyBitVector): Rationalize invariants.  'vector != null' implies
2217         that we have our own copy of the bitvector.  Otherwise,
2218         'InheritsFrom == null' implies all inherited bits are true.
2219
2220 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
2221
2222         * statement.cs (LocalInfo): Add IsConstant.
2223         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
2224         local variable for constants.
2225
2226 2006-05-09  Raja R Harinath  <rharinath@novell.com>
2227
2228         * flowanalysis.cs (MyBitVector.Empty): New.
2229         (MyBitVector): Don't allow InheritedFrom to be null.
2230         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
2231         (UsageVector, FlowBranching): Update to changes.
2232
2233         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
2234         recursion.  The 'Parent == null' condition isn't sufficient for
2235         anonymous methods.
2236         (FlowBranching.AddBreakOrigin): Likewise.
2237         (FlowBranching.AddContinueOrigin): Likewise.
2238         (FlowBranching.AddReturnOrigin): Likewise.
2239         (FlowBranching.StealFinallyClauses): Likewise.
2240         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
2241         (FlowBranching.CheckOutParameters): Likewise.
2242         (FlowBranchingToplevel): Terminate all the above recursions here.
2243         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
2244         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
2245
2246         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
2247         toplevel block.
2248         (FlowBranchingToplevel): New.  Empty for now.
2249         (FlowBranching.MergeTopBlock): Update.
2250         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
2251         branching for the anonymous delegate.
2252         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
2253
2254         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
2255         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
2256         information at the start of the merge.  Reorganize.
2257
2258 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2259
2260         * class.cs (MethodData.Define): Method cannot implement interface accessor.
2261
2262 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2263
2264         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
2265         to newly introduced ctor.
2266
2267         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
2268         message to one place.
2269         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
2270         global namespace.
2271
2272 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2273
2274         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
2275
2276         * ecore.cs (Expression.ResolveAsConstant): Updated.
2277
2278         * statement.cs (ResolveMeta): Updated.
2279
2280 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2281
2282         * cs-parser.jay: __arglist cannot be used in initializer.
2283
2284 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2285
2286         A fix for #77879
2287         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
2288         private types.
2289
2290 2006-05-05  Raja R Harinath  <rharinath@novell.com>
2291
2292         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
2293         (LabeledStatement): Add 'name' parameter.
2294         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
2295         (Block.AddLabel): Update to changes.
2296         * cs-parser.jay (labeled_statement): Likewise.
2297
2298         * flowanalysis.cs (BranchingType.Labeled): New.
2299         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
2300         (FlowBranchingLabeled): New.  Does nothing for now, but will
2301         eventually handle 'goto' flows.
2302         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
2303         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
2304         that's terminated ...
2305         (Block.Resolve): ... here.
2306
2307         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
2308         (UsageVector.MergeFinallyOrigins): Likewise.
2309         (FlowBranching.InTryOrCatch): Likewise.
2310         (FlowBranching.AddFinallyVector): Likewise.
2311         (FlowBranchingException): Update to changes.
2312
2313         Fix #78290
2314         * statement.cs (Return.Resolve): Move error checking to ...
2315         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
2316         (FlowBranchingException): Handle return origins like break and
2317         continue origins.
2318         (FlowBranching.UsageVector.CheckOutParameters): Remove.
2319
2320 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2321
2322         A fix for #76122
2323         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
2324         filter.
2325
2326 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2327
2328         A fix for #77543
2329         * class.cs (MethodData.Define): Do public accessor check only when method
2330         implements an interface.
2331
2332 2006-05-04  Raja R Harinath  <rharinath@novell.com>
2333
2334         Remove special handling of 'break'
2335         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
2336         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
2337         (UsageVector.Break): Remove.
2338         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
2339         reachability.
2340         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
2341
2342         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
2343         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
2344
2345 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2346
2347         A fix for #75726
2348         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
2349         be the interface member.
2350
2351 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2352
2353         A fix for #60069
2354         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
2355         for emitting small (int) values.
2356
2357 2006-05-03  Raja R Harinath  <rharinath@novell.com>
2358
2359         Fix #59427
2360         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
2361         control-flow passes through the 'finally' after merging-in all the
2362         control-flows from 'try' and the 'catch' clauses.
2363
2364         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
2365         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
2366         always true at the only non-recursive entry point.
2367         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
2368         FlowBranchingBreakable.
2369         (FlowBranchingLoop): Remove.
2370         * statement.cs (Return.DoResolve): Update to changes.
2371
2372         Fix #76471, #76665
2373         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
2374         (FlowBranching.CreateBranching): Handle it: create a
2375         FlowBranchingContinuable.
2376         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
2377         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
2378         except that it handles the 'continue' command.
2379         (FlowBranching.UsageVector.MergeOrigins): Rename from
2380         MergeBreakOrigins.
2381         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
2382         except that it overrides AddContinueOrigin.
2383         (FlowBranchingException): Override AddContinueOrigin, similar to
2384         AddBreakOrigin.
2385         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
2386         Create a new branching around the embedded statement.
2387         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
2388         control flow after the embedded statement.
2389         (Continue.Resolve): Move all error checking to AddContinueOrigin.
2390
2391         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
2392         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
2393         FlowBranchingBreakable.
2394         (FlowBranchingSwitch): Remove.
2395
2396         Fix test-503.cs
2397         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
2398         error reporting to ...
2399         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
2400         Rename from 'AddBreakVector'.  Add new location argument.  Return
2401         a bool indicating whether the 'break' crosses an unwind-protect.
2402         (FlowBranchingException.AddBreakOrigin): Add.
2403         (FlowBranchingException.Merge): Propagate 'break's to surrounding
2404         flowbranching after updating with the effects of the 'finally'
2405         clause.
2406         (FlowBranchingBreakable): New common base class for
2407         FlowBranchingLoop and FlowBranchingSwitch.
2408
2409         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
2410         embedded statement.
2411         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
2412
2413 2006-05-02  Raja R Harinath  <rharinath@novell.com>
2414
2415         * statement.cs (Do.Resolve): If the loop is infinite, set the
2416         barrier.
2417         (While.Resolve, For.Resolve): Set a barrier after the embedded
2418         statement.  There's no direct control flow that goes from the end
2419         of the embedded statement to the end of the loop.
2420         * flowanalysis.cs (FlowBranching.Infinite): Remove.
2421         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
2422         above ensure that the reachability is correctly computed.
2423
2424         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
2425         (UsageVector.MergeBreakOrigins): If the current path is
2426         unreachable, treat it as if all parameters/locals are initialized.
2427         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
2428         infinite loops before merging-in break origins.
2429
2430         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
2431         (Reachability.Reachable): Split part into ...
2432         (Reachability.Unreachable): ... this.  Simplify.
2433         (Reachability.IsUnreachable): Use 'Unreachable' instead.
2434
2435         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
2436         (Reachability.SetThrowsSometimes): Likewise.
2437         (FlowBranchingBlock.MergeTopBlock): Don't compare against
2438         TriState.Always, use corresponding property.
2439         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
2440         (Block.Resolve): Likewise.  Remove some redundant checks.
2441
2442 2006-05-02  Raja R Harinath  <harinath@gmail.com>
2443
2444         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
2445         (Reachability.Meet): Don't bother checking AlwaysThrows --
2446         barrier is always set.
2447         (FlowBranchingBlock.Merge): Likewise.
2448
2449 2006-05-01  Raja R Harinath  <harinath@gmail.com>
2450
2451         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
2452         checks for unreachable.
2453
2454 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
2455
2456         A fix for #77980
2457         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
2458
2459         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
2460         whether field is really assigned.
2461
2462 2006-04-30  Raja R Harinath  <harinath@gmail.com>
2463
2464         * flowanalysis.cs (Reachability): Make 4-argument constructor
2465         private.
2466         (Reachability.Meet): Rename from 'And'.  Remove static variant.
2467         (Reachability.Always): Rename from the highly misleading
2468         'Reachability.Never'.
2469         (FlowBranching.Merge): Update to changes.  Mark an impossible
2470         situation with a 'throw'.
2471         (*): Update to changes.
2472
2473 2006-04-29  Raja R Harinath  <harinath@gmail.com>
2474
2475         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
2476         Remove 'Undefined'.
2477         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
2478         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
2479         (*): Update to changes.
2480         * statement.cs: Update to changes.
2481
2482 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
2483
2484         A fix for #78049
2485         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
2486
2487 2006-04-28  Raja R Harinath  <harinath@gmail.com>
2488
2489         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
2490         dummy UsageVector.
2491
2492         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
2493         argument to two arguments: an usage-vector and a bool.  Move call
2494         to FlowBranching.Merge () ...
2495         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
2496
2497         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
2498         handling of loop and switch reachability to ...
2499         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
2500
2501 2006-04-27  Raja R Harinath  <harinath@gmail.com>
2502
2503         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
2504         handling to FlowBranchingLoop.InLoop.
2505         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
2506
2507 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
2508
2509         A fix for #78115
2510         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
2511         anonymous method is allowed from AnonymousContainer here.
2512
2513         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
2514
2515 2006-04-24  Raja R Harinath  <rharinath@novell.com>
2516
2517         Fix #78156
2518         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
2519
2520 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
2521
2522         A fix for #49011.
2523         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
2524         (DoubleConstant.Reduce): Ditto.
2525
2526 2006-04-23  Raja R Harinath  <rharinath@novell.com>
2527
2528         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
2529         Remove 'lvalue_right_side' argument.  Move parts to ...
2530         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
2531         (LocalVariable.DoResolveLValue): ... these.
2532
2533 2006-04-21  Raja R Harinath  <rharinath@novell.com>
2534
2535         Fix cs1655.cs
2536         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
2537         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
2538         (LocalVariableReference.DoResolveBase): Use it to implement new
2539         CS1655 check.
2540         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
2541         (Argument.Resolve): Simplify.  Move CS1510 check ...
2542         * ecore.cs (Expression.ResolveLValue): ... here.
2543         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
2544         (PropertyExpr.DoResolveLValue): Likewise.
2545         (FieldExpr.Report_AssignToReadonly): Likewise.
2546         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
2547         LValueMemberAccess or LValueMemberOutAccess on instance depending
2548         on it.
2549         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
2550         DoResolve as appropriate.
2551
2552 2006-04-20  Raja R Harinath  <rharinath@novell.com>
2553
2554         Fix #75800
2555         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
2556         implicit conversions on 'out' and 'ref' arguments.
2557
2558         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
2559         improve clarity.  Remove dead code.
2560
2561         Fix #66031
2562         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
2563         (Catch.Resolve): Resolve VarBlock if it exists.
2564
2565 2006-04-19  Miguel de Icaza  <miguel@novell.com>
2566
2567         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
2568         twice, this was some residual code, the enumerator was emitted
2569         properly in the two branche of if later.
2570
2571 2006-04-19  Raja R Harinath  <rharinath@novell.com>
2572
2573         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
2574         cast is never an lvalue.
2575         (Cast.DoResolve, Cast.ResolveRest): Combine.
2576         (Argument.Emit): Simplify slightly.  Move 'Expr is
2577         IMemoryLocation' check ...
2578         (Argument.Resolve): ... here.
2579         (Argument.Error_LValueRequired): Remove.  Inline into only user.
2580
2581         Simplifications.  Fix cs0191-2.cs
2582         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
2583         CS1649 and CS1651 to ...
2584         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
2585         the actual selection of the error code and message to a lookup
2586         table.  Add a dummy return value to simplify callsites.
2587         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
2588         readonly fields of other instances of the same type.  Move CS0197
2589         warning from ...
2590         * expression.cs (Argument.Resolve): ... here.  Simplify code.
2591         Ensure that ec.InRefOutArgumentResolving is only set during LValue
2592         resolution of an out or ref argument.  The code simplification
2593         above uses this invariant.
2594
2595 2006-04-18  Raja R Harinath  <rharinath@novell.com>
2596
2597         Possibly fix #77752.  Fix cs1690-[4-7].cs.
2598         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
2599         CheckMarshallByRefAccess.  Drop parameter.
2600         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
2601         warning.
2602         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
2603         InstanceExpression.
2604         * report.cs (AllWarnings): Add CS1690.
2605         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
2606         for ref access too.
2607         (LocalVariableReference.DoResolveBase): Update.
2608
2609 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2610
2611         * class.cs (MethodOrOperator): Moved common parts from method class.
2612         detect obsolete attributes.
2613         (Method.Define): Simplified as it reuses code from base.
2614         (Constructor.ValidAttributeTargets): Fixed issue found during
2615         refactoring.
2616         (Destructor.ValidAttributeTargets): Fixed issue found during
2617         refactoring.
2618         (Operator): Finished refactoring set off by #78020. Operator class is now
2619         ordinary method class.
2620
2621         * anonymous.cs: Updated.
2622
2623         * decl.cs (DeclSpace): Add IsGeneric
2624
2625 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2626
2627         * class.cs (Constructor.Emit): Don't emit the attributes twice.
2628
2629 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2630
2631         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2632         detect obsolete attributes.
2633         (Method.CreateEmitContext): Moved to MethodOrOperator.
2634
2635 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2636
2637         A fix for #78048.
2638         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2639         customized exception to make crash detection easier.
2640         (MethodOrOperator): Started to work on new base class for methods and
2641         operators.
2642         (Method): Derives from MethodOrOperator.
2643         (Constructor.Emit): Emits its own attributes.
2644         (AbstractPropertyEventMethod.Emit): Ditto.
2645         (Operator): Derives from MethodOrOperator, will refactor fully in extra
2646         patch.
2647         (Operator.Emit): It's temporary more tricky than should be.
2648         
2649         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2650
2651         * report.cs (InternalErrorException): Add ctor with inner exception.
2652
2653 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
2654
2655         A fix for #76744.
2656         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2657         only not visible.
2658
2659 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
2660
2661         A fix for #77916.
2662         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2663         array.
2664
2665 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2666
2667         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2668         attribute is present and Guid not.
2669         (Interface.ApplyAttributeBuilder): Ditto.
2670
2671         * attribute.cs: Add error message.
2672
2673 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2674
2675         A fix for #78020.
2676
2677         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2678         sources (it's composite) so hold them in extra array as they are used in
2679         Emit phase only. It worked in the previous versions by mistake.
2680         (Attribute.Emit): Emit attribute for more owners when exist.
2681
2682         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2683         it has now different behaviour.
2684
2685 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
2686
2687         * constant.cs (Constant.IsDefaultInitializer): New method.
2688
2689         * class.cs: Updated.
2690
2691         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2692         re-initialize default values. It saves KBs almost for every assembly.
2693         Thanks Zoltan for the idea.
2694         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2695         (ArrayCreation.DoResolve): Resolve only once.
2696         (ArrayCreation.Emit): Emit static initializer only when it is faster.
2697         (ArrayCreation.GetAttributableValue): Cope with optimized values.
2698
2699 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
2700
2701         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2702         From #77961.
2703
2704 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2705
2706         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2707         in an embedded statement too.
2708
2709 2006-04-01  Raja R Harinath  <rharinath@novell.com>
2710
2711         Fix #77958
2712         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2713
2714 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2715
2716         A fix for #77966.
2717
2718         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
2719         was not specified.
2720
2721         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
2722
2723 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
2724
2725         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
2726         phase.
2727
2728         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
2729         LocalTemporary change.
2730
2731         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
2732         TypeContainer.
2733         (ClassOrStruct.DefineFieldInitializers): Implemented static field
2734         initializers optimization.
2735         (ClassOrStruct.TypeAttr): Moved from modifiers.
2736         (Constructor.CheckBase): Don't crash when static ctor has parameters.
2737         (FieldBase.ResolveInitializer): Resolves initializer.
2738         (FieldBase.HasDefaultInitializer): New property.
2739
2740         * cs-parser.jay: Removed message.
2741
2742         * expression.cs (CompilerGeneratedThis): New specialization.
2743
2744         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
2745
2746 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
2747
2748         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
2749
2750 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
2751
2752         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
2753         be now EnumConstants only.
2754
2755 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
2756
2757         * attribute.cs, driver.cs: Reset more caches.
2758
2759 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2760
2761         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
2762
2763 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2764
2765         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
2766         for easier reuse. Updated all overrides.
2767         (IntegralConstant): New base class for all integral constants.
2768         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
2769         of the constant range, report custom error.
2770         (UIntConstant.Reduce): Fixed uint conversion.
2771
2772         * ecore.cs, literal.cs: Reduce updates.
2773
2774 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2775
2776         A fix for #75813.
2777
2778         * class.cs (Constructor.Define): Removed extra if for default ctors.
2779         A patch from Atsushi Enomoto.
2780
2781 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2782
2783         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2784         GetAttributableValue.
2785
2786         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2787         when required.
2788
2789         * convert.cs (ImplicitConversionRequired): Error message moved to
2790         DoubleLiteral.
2791
2792         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2793         automatic implicit conversion of an output value.
2794         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2795
2796         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2797         conversion.
2798         (TypeOf.GetAttributableValue): Add extra handling for object type.
2799
2800         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2801         special error message.
2802
2803 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
2804
2805         * class.cs (Constructor.Emit): Don't crash when struct ctor is
2806         InternalCall.
2807         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2808         compatible with MS runtime.
2809
2810 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
2811
2812         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2813         attribute arguments here.
2814
2815         * class.cs (Indexer.Define): The check was moved to attribute class.
2816
2817 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
2818
2819         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2820         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2821         easier.
2822
2823 2006-03-22  Raja R Harinath  <rharinath@novell.com>
2824
2825         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
2826         mcs to keep code differences small.
2827         * attribute.cs (Attribute.GetParameterDefaultValue): New.
2828         * typemanager.cs (parameter_default_value_attribute_type): New.
2829         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
2830         CS1908 check.
2831
2832 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2833
2834         * expression.cs (StringConcat.Append): Reverted back to no warning state.
2835
2836 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2837
2838         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2839
2840         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2841         the blocks too.
2842
2843 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
2844
2845         * doc-bootstrap.cs : fix build.
2846
2847 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2848
2849         * expression.cs (StringConcat.Append): Issue a warning when empty string
2850         is going to append.
2851
2852 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2853
2854         * assign.cs (CompoundAssign.ResolveSource): Removed.
2855
2856         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2857         clean up.
2858
2859         * class.cs (TypeContainer.FindMethods): Removed.
2860         (TypeContainer.CheckMemberUsage): Made static.
2861
2862         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2863
2864         * constant.cs (CheckRange): Removed unused type argument.
2865         (CheckUnsigned): Removed unused type argument.
2866
2867         * cs-parser.jay: Updated after MemberAccess clean up.
2868         Uses Length for empty string test.
2869
2870         * cs-tokenizer.cs: Uses Length for empty string test.
2871         (IsCastToken): Made static.
2872         (is_hex): Made static.
2873         (real_type_suffix): Made static.
2874
2875         * decl.cs (SetupCache): Made static.
2876         (OnGenerateDocComment): Removed unused ds argument.
2877
2878         * delegate.cs (VerifyDelegate): Removed unused argument.
2879
2880         * doc.cs: Uses Length for empty string test.
2881
2882         * driver.cs: Uses Length for empty string test.
2883
2884         * enum.cs (IsValidEnumType): Made static
2885
2886         * expression.cs (EnumLiftUp): Removed unused argument.
2887         (ResolveMethodGroup): Ditto.
2888         (BetterConversion): Ditto.
2889         (GetVarargsTypes): Ditto.
2890         (UpdateIndices): Ditto.
2891         (ValidateInitializers): Ditto.
2892         (MemberAccess.ctor): Ditto.
2893         (GetIndexersForType): Ditto.
2894
2895         * flowanalysis.cs: (MergeFinally): Removed unused argument.
2896
2897         * iterators.cs: Updated after MemberAccess clean up.
2898
2899         * location.cs: Uses Length for empty string test.
2900
2901         * namespace.cs: Uses Length for empty string test.
2902
2903          * report.cs (CheckWarningCode): Made static.
2904
2905         * statement.cs (LabeledStatement): Removed unused argument.
2906
2907         * typemanager.cs (FilterNone): Removed.
2908
2909 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2910
2911         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2912         obsolete.
2913
2914         * class.cs: Updated.
2915
2916 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2917
2918         * cs-parser.jay.cs: __arglist is not allowed for delegates.
2919
2920 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2921
2922         A fix for #77822.
2923
2924         * expression.cs (VerifyArgumentsCompat): Reverted to double error
2925         reporting, it's more tricky than I thought.
2926
2927 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2928
2929         A fix for #77816.
2930
2931         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
2932         host container.
2933         (AnonymousMethod.ImplicitStandardConversionExists): New method.
2934         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2935         Add more error reporting; Fixed issue with params.
2936
2937         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2938
2939         * cs-parser.jay: AnonymousMethod requires host container.
2940
2941         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2942
2943 2006-03-18  Raja R Harinath  <harinath@gmail.com>
2944
2945         * class.cs: Change 'TypeContainer ds' constructor argument to
2946         'DeclSpace parent'.  Some classes were missed below due to
2947         different naming convention.
2948
2949         * class.cs (MemberCore.Parent): Delete.  This makes the
2950         ParentContainer changes below enforceable by the compiler.
2951
2952         Treat pointers to enclosing declaration space as 'DeclSpace', not
2953         'TypeContainer'.
2954         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2955         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2956
2957         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2958         of TypeContainer.
2959         (Block.AddThisVariable): Likewise.
2960         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2961         (AbstractPropertyEventMethod.Emit): Likewise.
2962         (AbstractPropertyEventMethod.EmitMethod): Likewise.
2963         (GetMethod.Define, SetMethod.Define): Likewise.
2964         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2965         (DelegateMethod.EmitMethod): Likewise.
2966
2967         Fix regression test-partial-13.cs.
2968         Rationalize use of PartialContainer.  Ensure that the partial
2969         class semantics can be tied to type-correctness, i.e., any
2970         violation will cause a compile error.
2971         * class.cs, const.cs: Access all fields that belong to class
2972         TypeContainer via ParentContainer.  Arguments of EmitContexts and
2973         Resolve()-like functions still use 'Parent'.
2974
2975         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2976         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2977         (PropertyMethod.CheckModifiers): Remove unused argument.
2978         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2979         DeclSpace.
2980
2981 2006-03-17  Raja R Harinath  <harinath@gmail.com>
2982
2983         Make semantics of PartialContainer simpler.
2984         * decl.cs (DeclSpace.IsPartial): Remove.
2985         * class.cs (TypeContainer.IsPartial): Likewise.
2986         (TypeContainer..ctor): Set PartialContainer to point to self.
2987         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2988         (TypeContainer.FindNestedType): Likewise.
2989         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
2990
2991 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
2992
2993         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2994
2995 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2996
2997         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2998         classes.
2999
3000 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
3001
3002         * class.cs (Operator.Define): An error for base conversion was not
3003         reported correctly.
3004
3005 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
3006
3007         * iterator.cs : yield break is allowed in try statement which has
3008           catch clauses. Fixed bug #77767.
3009
3010 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
3011
3012         A fix for #77593, #77574.
3013
3014         * class.cs (MethodCore.CheckBase): Another if for operator.
3015
3016 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
3017
3018         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
3019         were not resolved
3020
3021         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
3022         (DelegateCreation.ImplicitStandardConversionExists): New method for just
3023         conversion test.
3024         
3025         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
3026         not needed.
3027
3028         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
3029         Updated after another emitcontext usage was clean up. It should help us to
3030         synchronize with gmcs easier.
3031
3032 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
3033
3034         A fix for #77353.
3035
3036         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
3037         (Event.Define): ditto
3038         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
3039
3040         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
3041         Removed redundant code and set NewSlot for Invoke method too.
3042
3043         * parameter.cs (Parameters.ctor): Add custom, type ctor.
3044         (Parameters.MergeGenerated): New method. Use this method when you merge
3045         compiler generated argument with user arguments.
3046
3047 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
3048
3049         * attribute.cs (ResolveAsTypeTerminal): Removed.
3050
3051         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
3052         specialization for predefined types; 30% speed up.
3053         Finally placed obsolete check to right place.
3054         (Expression.ResolveType): Removed.
3055
3056         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
3057         Updated after ResolveType was removed.
3058
3059         * expression.cs (Cast.ctor): Check void cast.
3060         (Binary.ResolveAsTypeTerminal): Is never type.
3061         (Conditional.ResolveAsTypeTerminal): Is never type.
3062
3063         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
3064
3065 2006-03-01  Raja R Harinath  <rharinath@novell.com>
3066
3067         Fix #77679.
3068         * expression.cs (ParameterReference.DoResolveBase): Change return
3069         type to bool.
3070         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
3071         Update.
3072
3073         Fix #77628.
3074         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
3075
3076         Fix #77642.
3077         * typemanager.cs (GetFullNameSignature): Don't nullref on
3078         protected accessors.
3079
3080 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
3081
3082         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
3083         these two separated members to simplify the code.
3084         (Attribute.Resolve): Refactored to use new fields and methods.
3085         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
3086         implemented obsolete attribute checking.
3087         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
3088         implemented obsolete checking again. It look line never ending quest ;-)
3089         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
3090
3091         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
3092
3093         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
3094
3095         *class.cs (Property.Define): Add RegisterProperty call.
3096
3097         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
3098         argument groups (only 2).
3099
3100         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
3101         encoding expression to arguments.
3102         (Expression.ExprClassToResolveFlags): Just turned to property.
3103
3104         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
3105         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
3106         optimized as well as implemented support for zero-length attributes.
3107
3108         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
3109         Add caching of PropertyInfo's.
3110
3111 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3112
3113         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
3114         error multiple times.
3115
3116 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3117
3118         New partial class implementation.
3119         A fix for #77027, #77029, #77403
3120
3121         * attribute.cs (Attributable): Made attributes protected.
3122
3123         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
3124         the replacements of ClassPart and PartialContainer.
3125         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
3126         (TypeContainer.AddInterface): Ditto.
3127         (TypeContainer.AddPartial): The main method for partial classes. It checks
3128         for errors and merges ModFlags and attributes. At the end class is added to
3129         partial_parts list.
3130         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
3131         required here.
3132         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
3133         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
3134         from the rest of partial classes.
3135         (TypeContainer.GetClassBases): Simplified.
3136         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
3137         DefineType.
3138         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
3139         (TypeContainer.HasExplicitLayout): Uses Flags now.
3140         (PartialContainer): Removed.
3141         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
3142         (StaticClass): Was merged with Class.
3143         (Class.GetClassBases): class and static class bases are verified here.
3144         (Class.TypeAttr): Added static attributes when class is static.
3145         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
3146         (MemberBase): In some cases we need to call parent container for partial
3147         class. It should be eliminated but it's not easy now.
3148
3149         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
3150
3151         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
3152         partial classed to accumulate class comments.
3153         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
3154
3155         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
3156
3157         * driver.cs (MainDriver): Tree.GetDecl was removed.
3158
3159         * modifiers.cs (Modifiers): Add partial modifier.
3160
3161         * tree.cs (Tree.decl): Removed.
3162         (RootTypes): Started to use this class more often for root types
3163         specializations.
3164
3165 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
3166
3167         A fix for #77615
3168
3169         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
3170         external interface does not have an attribute.
3171
3172 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
3173
3174         Another prerequisites for new partial classs implementation.
3175         
3176         * attribute.cs (Attribute.Equal): Implemented.
3177         (Attribute.Emit): Changed as attributes can be applied more than twice.
3178         (Attributes.Emit): Check for duplicate attributes here.
3179
3180         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
3181         as a parameter, clean-up.
3182
3183 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
3184
3185         A fix for #77485
3186
3187         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
3188         contains obsolete attribute check which can in some cases look for base
3189         type of current class which is not initialized yet.
3190         (TypeContainer.BaseType): Replacement of ptype.
3191
3192         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
3193
3194 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
3195
3196         First of prerequisites for new partial classs implemention.
3197         
3198         * attribute.cs (Attributable): Extended by ResolveContext;
3199         Attributes finally have correct context for resolving in all cases.
3200         (AttachTo): Attribute owner is assigned here.
3201
3202         * codegen.cs (IResolveContext): Introduce new interface to hold
3203         all information needed in resolving phase.
3204         (EmitContext): Implements IResolveContext; more clean-up needed here.
3205         
3206         * decl.cs (MemberCore): Implemented IResolveContext.
3207
3208         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
3209         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
3210         parameter.cs, statement.cs, tree.cs, typemanager.cs:
3211         Refactored to use new IResolveContext instead of EmitContext; cleanup
3212
3213 2006-02-06  Miguel de Icaza  <miguel@novell.com>
3214
3215         * codegen.cs (EmitScopeInitFromBlock): check here the
3216         capture_context, there is no need to make two calls to the
3217         EmitContext. 
3218
3219         * anonymous.cs: Add some debugging messages that might help me
3220         track other instances of this problem in the future (the
3221         regression of test 467).
3222
3223         * cs-parser.jay: track the variable block, as we need to initalize
3224         any captured variables declared in this block for the "catch"
3225         portion of the "Try" statement.
3226
3227         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
3228         scope initialization for captured variables. 
3229
3230         Also, move the emit for the variables after the block location has
3231         been marked.
3232
3233 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
3234
3235         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
3236
3237 2006-02-02  Miguel de Icaza  <miguel@novell.com>
3238
3239         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
3240         commit yesterday, the initialization for the roots is necessary.
3241         What is not necessary is the scope activation.
3242
3243 2006-02-02  Raja R Harinath  <rharinath@novell.com>
3244
3245         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
3246         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
3247         CS0206 checks.
3248         (Argument.Resolve): Remove CS0206 checks.
3249
3250 2006-02-01  Miguel de Icaza  <miguel@novell.com>
3251
3252         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
3253         scopes for all the roots, the scopes will now be emitted when the
3254         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
3255
3256         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
3257         code.  This reduces a lot of existing cruft.
3258         
3259         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
3260         that the ScopeInfo is generated as we enter the scope, not at the
3261         time of use, which is what we used to do before.
3262
3263         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
3264         every time a Block is about to be emitted if we have a
3265         CaptureContext. 
3266
3267 2006-02-01  Raja R Harinath  <rharinath@novell.com>
3268
3269         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
3270         (Reset): Update.
3271         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
3272
3273         * typemanager.cs (cons_param_array_attribute): Make private.
3274         (Reset): Set it to null.
3275         (InitCoreHelpers): Don't initialize it.
3276         (ConsParamArrayAttribute): New.  Initialize it as needed.
3277         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
3278
3279 2006-01-31  Miguel de Icaza  <miguel@novell.com>
3280
3281         * expression.cs: There might be errors reported during the
3282         selection of applicable methods.  If there are errors, do not
3283         continue execution as it will lead the compiler to crash.
3284
3285 2006-01-30  Miguel de Icaza  <miguel@novell.com>
3286
3287         * expression.cs: Member access is not allowed on anonymous
3288         methods.  Fixes #77402.
3289
3290 2006-01-30  Raja R Harinath  <rharinath@novell.com>
3291
3292         Fix #77401
3293         * cs-parser.jay (VariableDeclaration): Don't set
3294         current_array_type to null.
3295         (field_declaration, event_declaration, declaration_statement):
3296         Set it to null here.
3297
3298 2006-01-28  Raja R Harinath  <harinath@gmail.com>
3299
3300         * typemanager.cs (GenericParameterPosition): New.
3301         * doc.cs: Use it.
3302
3303 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
3304
3305         * doc.cs : To process "include" elements, first we should create
3306           another list than XmlNodeList, because it could result in node
3307           removal, which could result in that the XmlNodeList gives up
3308           yielding next node.
3309
3310           (Also made code identical to gmcs again.)
3311
3312 2006-01-25  Miguel de Icaza  <miguel@novell.com>
3313
3314         * ecore.cs: Introduce an error report that we were not catching
3315         before, if not silent, we must report the error.  Gonzalo ran into
3316         it.
3317
3318 2006-01-23  Miguel de Icaza  <miguel@novell.com>
3319
3320         A fix for bug: #76957
3321         
3322         * iterators.cs (MoveNextMethod.CreateMethodHost): call
3323         ComputeMethodHost before creating the method, this is a new
3324         requirement. 
3325
3326         * anonymous.cs (AnonymousContainer): Now we track all the scopes
3327         that this method references (RegisterScope).  The actual scope
3328         where the method is hosted is computed with the ComputeMethodHost
3329         before we create the method.
3330
3331         Moved the Deepest routine here.
3332
3333         (AnonymousContainer.ComputeMethodHost): New routine used to
3334         compute the proper ScopeInfo that will host the anonymous method.
3335
3336         (ScopeInfo): Deal with multiple roots.  The problem was that we
3337         did not have a unique root where all ScopeInfos could be hanged
3338         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
3339         of roots.  
3340
3341         Remove AdjustMethodScope which is now computed at the end.  Remove
3342         LinkScope which did a partial link, instead link all ScopeInfos
3343         before code generation from the new "LinkScopes" routine. 
3344
3345         Simplify all the Add* routines as they no longer need to maintain
3346         the tree, they just need to record that they are using variables
3347         from a ScopeInfo.
3348
3349         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
3350         routines to produce the forest of ScopeInfo trees.
3351
3352         * class.cs (TypeContainer.AppendMethod): This is just like
3353         AddMethod, but ensures that an interface implementation method
3354         (IEnumerable.XXX) is not inserted at the beginning of the queue of
3355         methods, but at the end.
3356
3357         We use this functionality to ensure that the generated MoveNext
3358         method in the iterator class is resolved/emitted before the
3359         enumerator methods created.   
3360
3361         This is required because the MoveNext method computes the right
3362         ScopeInfo for the method.  And the other methods will eventually
3363         need to resolve and fetch information computed from the anonymous
3364         method. 
3365
3366 2006-01-21  Raja R Harinath  <harinath@gmail.com>
3367             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
3368
3369         Fix rest of #76995.
3370         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
3371         the 'aliases' hash.
3372         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
3373         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
3374
3375 2006-01-18  Raja R Harinath  <rharinath@novell.com>
3376
3377         Fix #76656, cs0231-2.cs.
3378         * cs-parser.jay (formal_parameter_list): Make error case catch
3379         more issues.
3380         (parenthesized_expression_0): Add CS1026 check.
3381         (invocation_expression): Remove unused { $$ = lexer.Location }.
3382
3383 2006-01-17  Raja R Harinath  <rharinath@novell.com>
3384
3385         Fix #76824.
3386         * cs-parser.jay (statement_expression): Don't list out the
3387         individual statement-expressions.  Convert syntax error into
3388         CS0201 check.
3389
3390 2006-01-16  Raja R Harinath  <rharinath@novell.com>
3391
3392         Fix #76874.
3393         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
3394         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
3395         CheckIntermediateModification.
3396         (FieldExpr.DoResolve): Add new two-argument version that
3397         allows us to resolve the InstanceExpression as an lvalue.
3398         The one-argument variant is now just a wrapper.
3399         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
3400         Resolve the lhs as an lvalue if the it has a value type.
3401         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
3402         from Assign.DoResolve.
3403         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
3404         resolved as an lvalue.
3405         (PropertyExpr.DoResolve): Update.
3406         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
3407         has a value type.  Move CS1612 check here from
3408         CheckIntermediateModification.
3409         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
3410         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
3411         'right_side' of a ResolveLValue on an 'out' argument.
3412         (EmptyExpression.LValueMemberAccess): New.  Used as the
3413         'right_side' of a propagated ResolveLValue on a value type.
3414         (LocalVariableReference.DoResolveBase): Recognize
3415         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
3416         Add CS1654 check.
3417         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
3418         EmptyExpression.Null.
3419
3420 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
3421
3422         * typemanager.cs : added IsGenericParameter(). In mcs it always
3423           return false.
3424         * doc.cs : for generic parameters, use GenericParameterPosition,
3425           not FullName.
3426
3427 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
3428
3429         * expression.cs: Fix Console.WriteLine ((this = x).foo);
3430
3431 2006-01-12  Miguel de Icaza  <miguel@novell.com>
3432
3433         This fixes the problem where we used ldfld instead of ldflda to
3434         load the "THIS" pointer on captured parameters, when THIS is a
3435         value type.  See bug #77205.
3436         
3437         * iterators.cs (CapturedThisReference.Emit): Pass false to
3438         EmitThis (we do not need the address).
3439
3440         * codegen.cs (EmitThis): it needs to know whether we need the
3441         address of `this' or not.  This is used by value types.  
3442
3443         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
3444         every other call passes false.
3445
3446 2006-01-12  Raja R Harinath  <rharinath@novell.com>
3447
3448         Fix #77221.
3449         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
3450         GetOverride.
3451         * expression.cs (Invocation.OverloadResolve): Update.
3452         (Invocation.DoResolve): Avoid double resolution of invocation.
3453
3454 2006-01-11  Raja R Harinath  <rharinath@novell.com>
3455
3456         Fix #77180.
3457         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
3458         unary negation of floating point types as 0-expr; negation cannot
3459         overflow in floating point types.
3460
3461         Fix #77204.
3462         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
3463         on operands of 'void' type.
3464
3465         Fix #77200.
3466         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
3467         and ExclusiveOr for boolean constants too.
3468
3469 2006-01-09  Raja R Harinath  <rharinath@novell.com>
3470
3471         Fix #75636.
3472         * expression.cs (Invocation.OverloadResolve): Replace reflected
3473         override methods with their base virtual methods, rather than
3474         skipping over them.
3475         * typemanager.cs (TypeManager.GetOverride): New.
3476
3477 2006-01-05  Jb Evain  <jbevain@gmail.com>
3478
3479         * class.cs (Property.Define, Indexer.Define): do not tag the
3480         properties as SpecialName | RTSpecialName.
3481
3482 2006-01-04  Miguel de Icaza  <miguel@novell.com>
3483
3484         * class.cs (MethodCore.IsDuplicateImplementation): This method was
3485         doing a low-level comparission of parameter types.  It was lacking
3486         a check for __argslist. 
3487
3488 2005-12-30  Miguel de Icaza  <miguel@novell.com>
3489
3490         * expression.cs (ParameterReference.DoResolveBase): Allow
3491         reference parameters if they are local to this block. 
3492
3493         This allows the ref and out parameters of a delegate to be used in
3494         an anonymous method, for example:
3495
3496         delegate void set (out int x);
3497
3498         set s = delegate (out int x){
3499                 x = 0;
3500         };
3501
3502         This is used by functionality introduced late in the C# language.
3503         
3504         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
3505         method that take ref and out parameters. 
3506
3507         Fixes #77119 which was a late change in the spec.
3508
3509 2005-12-23  Miguel de Icaza  <miguel@novell.com>
3510
3511         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
3512         parent if its the same scope.  Fixes #77060.
3513
3514 2005-12-21  Miguel de Icaza  <miguel@novell.com>
3515
3516         * driver.cs: Report the case of no source files and no -out:
3517         argument provided.
3518
3519 2005-12-20  Raja R Harinath  <rharinath@novell.com>
3520
3521         Fix #77035.
3522         * expression.cs (ComposedCast.GetSignatureForError): Define.
3523
3524 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3525
3526         Fix #76995
3527
3528         * namespace.cs (NamespaceEntry): Add extern_aliases as a
3529         ListDictionary, to contain the ExternAliasEntry entries (in
3530         addition to the NamespaceEntry.aliases hashtable). This field is
3531         shared between the original entry and its doppelganger (bodyless 
3532         copy of it).
3533         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
3534         extern_aliases field.
3535         (NamespaceEntry.Lookup): Move the IsImplicit check after the
3536         lookup in extern_aliases.
3537
3538 2005-12-16  Raja R Harinath  <rharinath@novell.com>
3539
3540         Fix #77006.
3541         * class.cs (TypeContainer.Mark_HasEquals): New.
3542         (TypeContainer.Mark_HasGetHashCode): New.
3543         (ClassPart): Override them.
3544         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
3545
3546         Fix #77008.
3547         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
3548         'parent' argument to the base constructor.
3549
3550         Remove all mention of TypeContainer from decl.cs.
3551         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
3552         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
3553         (DeclSpace.DeclSpace): Likewise.
3554         (DeclSpace.DefineMembers): Remove unused argument.
3555         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
3556         debugging check -- we don't care if the debug code throws an
3557         InvalidCastException instead of an InternalErrorException.
3558         * class.cs (TypeContainer.DefineMembers): Update to changes.
3559         (TypeContainer.DoDefineMembers): Likewise.
3560         (TypeContainer.GetMethods): Likewise.
3561         (PropertyMember.Define): Likewise.
3562         (MemberBase.Parent): New property that forwards to
3563         MemberCore.Parent, but ensures that we get a TypeContainer.
3564         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
3565         (RootContext.PopulateTypes): Likewise.  Remove special case code
3566         for !RootContext.StdLib: DefineMembers is idempotent.
3567
3568 2005-12-14  Miguel de Icaza  <miguel@novell.com>
3569
3570         * convert.cs (ExplicitConversionCore): Check the return value from
3571         ExplicitConversionCore which can return null on failure.  Fixes #76914
3572
3573 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
3574
3575         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
3576
3577 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
3578
3579         * doc.cs : The search for referenced namespace was insufficient to
3580           get global one as it used to do. Fixed bug #76965.
3581
3582 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
3583
3584         * doc.cs : check name in cref in the last phase that whether it is
3585           namespace or not.
3586
3587 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3588
3589         * cs-tokenizer.cs : reverted the latest change: it somehow broke
3590           Mono.C5.
3591
3592 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3593
3594         * doc.cs : so it turned out that we cannot skip override check for 
3595           interface members. Fixed bug #76954.
3596
3597 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3598
3599         * cs-tokenizer.cs : fixed bug #75984:
3600           - #warning and #error should not be handled when the source line
3601             is disabled.
3602           - #line is not checked strictly when the source line is disabled.
3603           - #define and #undef is on the other hand checked strictly at any
3604             state.
3605
3606 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
3607
3608         * cs-tokenizer.cs : missing Location (actually, filename) in one of
3609           CS1027 report.
3610
3611 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3612
3613         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
3614
3615         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
3616         event initializers.
3617         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3618         (FieldBase.Initializer): Initializer is now optional.
3619         (EventField.Define): Only event field can have initializer.
3620
3621         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3622
3623         * const.cs (Const): Reuse initializer.
3624
3625         * cs-parser.jay: Updated after FieldBase changes.
3626         Added current_array_type to simplify array initializers.
3627
3628         * ecore.cs (NullCast.IsDefaultValue): Implemented.
3629
3630         * expression.cs, iterators.cs: Updated.
3631
3632         * namespace.cs (NamespaceEntry): Made UsingFound private.
3633
3634 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3635
3636         * parameterCollection.cs: Obsolete, removed.
3637         * parser.cs: Obsolete, removed.
3638
3639 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3640
3641         Fix #76849.
3642         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3643
3644         * enum.cs (Enum.Define): Set obsolete context here.
3645
3646 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3647
3648         * doc.cs :
3649           - FindDocumentedMember() now expects 1) paramList as null
3650             when "we don't have to check the number of parameters" and
3651             2) Type.EmptyTypes when "there is no arguments".
3652           - Introduced FoundMember struct to hold the exact type which was
3653             used to find the documented member (the above change broke
3654             test-xml-044; it might be better just to use DeclaringType than
3655             what MS does, like this change does, but it depends on usage.)
3656
3657 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3658
3659         * doc.cs : documented member might be from DeclaringType for nested
3660           types. Fixed bug #76782.
3661
3662 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
3663
3664         * anonymous.cs: Have the param code handle leaving copies on the
3665         stack etc. Allows anonymous params to take part in the assignment
3666         code (++, +=, etc). Fixes bug #76550
3667
3668         * expression.cs: Handle the prepare_for_load/leave_copy by passing
3669         it down to the anon code.
3670
3671         * iterators.cs: Use dummy var here
3672
3673         * codegen.cs: Handle new vars
3674
3675 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3676
3677         Fix #76849.
3678         * class.cs (MethodData.Define): Set proper Obsolete context.
3679
3680         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3681         obsolete context.
3682         (FieldExpr.DoResolve): Ditto.
3683
3684 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3685
3686         Fix #76849.
3687         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3688         parent is not obsolete.
3689
3690 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
3691
3692         * doc.cs : (FindDocumentedMember) find parameterless members first
3693           and get CS0419 in the early stage. Fixed first case of bug #76727.
3694
3695 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
3696
3697         Fix #76859.
3698         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3699         no error was reported.
3700
3701         *expression.cs (Binary.DoResolve): left can be null.
3702
3703 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
3704
3705         Fix #76783.
3706         * class.cs (MethodData.Emit): Parameters should be labeled first.
3707
3708 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
3709
3710         Fix #76761.
3711         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3712
3713 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
3714
3715         * attribute.cs (AreParametersCompliant): Moved to Parameter.
3716
3717         * class.cs (MethodCore): Parameter clean up.
3718         (IMethodData): Added ParameterInfo.
3719         (MethodData): Parameter clean up.
3720         (Indexer.Define): Parameter clean up.
3721
3722         * anonymous.cs,
3723         * codegen.cs,
3724         * cs-parser.jay,
3725         * decl.cs,
3726         * doc.cs,
3727         * ecore.cs,
3728         * flowanalysis.cs,
3729         * iterators.cs,
3730         * pending.cs,
3731         * statement.cs,
3732         * typemanager.cs: Parameter clean up.
3733
3734         * delegate.cs (Define): Get rid of duplicated code.
3735
3736         * expression.cs (ParameterReference): Removed useless parameters
3737         and simplified.
3738         (Invocation): Ditto.
3739
3740         * parameter.cs (ParamsParameter): New class, params specialization.
3741         (ArglistParameter): Attemp to separate arglist.
3742         (Parameter): Refactored to be reusable and faster.
3743         (Parameter.Modifier): Made understandable.
3744         (Parameters): Changed to be used as a class for `this' assembly
3745         parameters. Refactored to use new specialized classes.
3746
3747         * support.cs (ParameterData): Added Types property.
3748         (InternalParameters): Deleted.
3749
3750 2005-08-20  Martin Baulig  <martin@ximian.com>
3751
3752         Merging this patch from GMCS to fix #75867.
3753
3754         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3755         scope if we don't already have it.
3756
3757 2005-11-17  Martin Baulig  <martin@ximian.com>
3758
3759         * anonymous.cs
3760         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3761         inherit the scope from our parent.  Fixes #76653.
3762
3763 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3764
3765         * doc.cs : the previous patch does not actually fix the bug.
3766           PropertyInfo override check is now implemented and really fixed it.
3767         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3768
3769 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3770
3771         * doc.cs : apply "override filter" also to properties.
3772           Fixed bug #76730.
3773
3774 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3775
3776         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3777           no need to check overrides. For classes, omit those results from 
3778           interfaces since they must exist in the class. Fixed bug #76726.
3779
3780 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3781
3782         * typemanager.cs : (GetFullNameSignature) differentiate indexers
3783           with different parameters. Fixed the second problem in #76685.
3784
3785 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3786
3787         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3788           get expected 'protected' access in CheckValidFamilyAccess()).
3789           Fixed bug #76692.
3790
3791 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3792
3793         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3794           Fixed bug #76705.  CS1569 was incorrectly commented out.
3795
3796 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3797
3798         * doc.cs : use Invocation.IsOverride() to do real override check.
3799         * expression.cs : made Invocation.IsOverride() internal.
3800
3801 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3802
3803         * doc.cs : use TypeManager.FindMembers() instead of (possible)
3804           TypeBuilder.FindMembers() and filter overriden base members out.
3805           Fixed bug #76990.
3806
3807 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3808
3809         * doc.cs : ref/out parameters are represented as '@' (instead of
3810           '&' in type FullName). Fixed bug #76630 (additionally crefs).
3811
3812 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3813
3814         * doc.cs : when there was no '.' in cref to methods in doc comment,
3815           then parameters were missing in the output. Fixed bug #76691.
3816
3817 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3818
3819         * driver.cs : don't output docs when there is an error.
3820           Fixed bug #76693.
3821
3822 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3823
3824         * doc.cs :
3825           Now it should detect indexers. Fixed primary concern in bug #76685.
3826           Fixed CS0419 message to not show the identical member signature in
3827           the message.
3828
3829 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3830
3831         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3832           instead of Type.FindMembers() since it does not handle events.
3833           Fixed bug #71604.
3834
3835 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3836
3837         * codegen.cs: Fixed typo (speficied -> specified).
3838
3839 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3840
3841         Fix #76369.
3842         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3843
3844 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3845
3846         * attribute.cs: Changed error message.
3847
3848         * cs-tokenizer.cs: One more check.
3849
3850 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3851
3852         * statement.cs (Block.Resolve): Ignore empty statement.
3853
3854 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3855
3856         * report.cs: Made error/warning methods more strict to avoid
3857         their misuse.
3858
3859         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3860         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3861         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3862         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3863
3864 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3865
3866         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3867         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3868
3869         * class.cs (TypeContainer.IsComImport): New property.
3870         (Constructor.Define): Create proper ctor for ComImport types.
3871
3872         * expression.cs (New.CheckComImport): Fixed.
3873
3874 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3875
3876         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3877         that a parameter has been captured does not mean that we do not
3878         have to do the rest of the processing.  This fixes the second part
3879         of #76592.  If there was another anonymous method capturing
3880         values in the past, the Scope would never be set for the second
3881         method that captured the same parameter.
3882
3883         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3884         properly manipulate the stack.   Second part of fix for #76592.
3885
3886         * expression.cs (New): Add support for invoking "new" on
3887         interfaces that have been flagged with the ComImport attribute and
3888         the CoClass.  Fixes #76637 
3889
3890         * statement.cs (Try.DoEmit): When a variable is captured, do not
3891         try to emit the vi.LocalBuilder variable as it has been captured.
3892         Create a temporary variable and store the results on the
3893         FieldBuilder.  Fixes #76642
3894
3895 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3896
3897         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3898
3899         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3900
3901         * expression.cs (Binary.DoResolve): Added && optimalization.
3902     
3903         * typemanager.cs (AddUserType): Removed useless argument.
3904
3905 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3906
3907         * statement.cs (Block.variables): Uses ListDictionary.
3908
3909 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3910
3911         Fix #75969.
3912         * class.cs (PartialContainer.EmitType): Customized to emit
3913         security attributes.
3914         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3915         for partial classes.
3916
3917 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3918
3919         Fix #76599.
3920         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3921         access has to be fixed.
3922         
3923         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3924
3925 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3926
3927         Fix #76590.
3928         * ecore.cs (NullCast.Reduce): Implemented.
3929
3930         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3931         constant type.
3932         
3933         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3934         properly.
3935         (Foreach.Resolve): Catch null properly.
3936
3937 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3938  
3939         * cs-tokenizer.cs: Warning text fix.
3940
3941         * driver.cs: AllWarningNumbers exposed on public interface.
3942
3943         * report.cs (): Reviewed warning numbers.
3944         (IsValidWarning): Use binary search.
3945
3946 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3947  
3948         * driver.cs: Implemeted resource visibility.
3949         (Resources): New class for code sharing between /res: and
3950         /linkres:
3951  
3952 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3953
3954         Fix #76568.
3955         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3956         folding.
3957         
3958         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3959         contants only.
3960         
3961         * ecore.cs (NullCast): Child is contant only.
3962         
3963         * literal.cs (NullLiteral.Reduce): null can be converted to any
3964         reference type.
3965
3966 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3967
3968         * driver.cs: Use Encoding.Default as default code page instead
3969           of ISO-28591.
3970
3971 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3972
3973         Fix #76085.
3974         * expression.cs (Invocation.Error_InvalidArguments): Handle
3975         __arglist parameters.
3976         (Invocation.VerifyArgumentsCompat): Likewise.
3977         * support.cs (ReflectionParameters.GetSignatureForError): Print
3978         __arglist parameters.
3979         (InternalParamters.GetSignatureForError): Likewise.
3980         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3981
3982 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3983
3984         * attribute.cs (GetPropertyValue): Made public.
3985
3986         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3987         Resolve.
3988         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3989         attribute.
3990         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3991         is not defined.
3992         
3993         * driver.cs: Reflect method name change.
3994         
3995         * statement.cs (Try.Resolve): Warn when try has both general
3996         exception handlers.
3997         
3998         * typemanager.cs: runtime_compatibility_attr_type new predefined
3999         type.
4000
4001 2005-10-26  Raja R Harinath  <harinath@gmail.com>
4002
4003         Fix #76419.
4004         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
4005         treat it as an empty parameter list.
4006
4007 2005-10-26  Raja R Harinath  <rharinath@novell.com>
4008
4009         Fix #76271.     
4010         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
4011         ResolveAsTypeStep silent.
4012         * statement.cs (Block.AddConstant): Mark block as used.
4013         (Block.ResolveMeta): Avoid piling on error messages
4014         if a constant initializer resolution fails.
4015
4016 2005-10-25  Raja R Harinath  <rharinath@novell.com>
4017
4018         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
4019         Remove.
4020         (NamespaceEntry.VerifyAllUsing): New.
4021         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
4022         behaviour.  Delegates actual resolution of alias to ...
4023         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
4024         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
4025         Update.
4026         * driver.cs (Driver.MainDriver): Update.
4027         
4028         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
4029         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
4030         property.
4031         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
4032         Remove.
4033         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
4034         RootNamespace.DefineNamespacesForAll.
4035
4036 2005-10-24  Raja R Harinath  <harinath@gmail.com>
4037
4038         * typemanager.cs (assemblies, external_aliases, modules)
4039         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
4040         (ComputeNamespaces, GetRootNamespace): Remove extra staging
4041         overhead.  Move resposibility ...
4042         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
4043         * driver.cs, attribute.cs, codegen.cs: Update to changes.
4044
4045 2005-10-23  Raja R Harinath  <harinath@gmail.com>
4046
4047         * namespace.cs (RootNamespace.all_namespaces): Renamed from
4048         cached_namespaces.  Improve usage.
4049         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
4050         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
4051         Move from GlobalRootNamespace and simplify.
4052         (RootNamespace.Global): Make instance variable.
4053         (RootNamespace.RootNamespace): Add "alias name" parameter.
4054         (GlobalRootNamespace): Simplify drastically.
4055         (Namespace.Lookup): Don't use GetNamespace.
4056         * typemanager.cs (GetRootNamespace): Rename from
4057         ComputeNamespaceForAlias.
4058         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
4059
4060 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4061
4062         * anonymous.cs (AnonymousContainer): Don't crash when container
4063         doesn't exist.
4064
4065 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4066
4067         * expression.cs (Binary.DoResolve): Warn when comparing same
4068         values.
4069
4070 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4071
4072         Fix #76486.
4073         * expression.cs (Binary.DoResolve): It looks like there are no
4074         convetsion rules in enum context.
4075
4076 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4077
4078         Add support for extern alias qualifiers.
4079         * typemanager.cs: Move some LookupTypeReflection code
4080         to namespace.cs, to have cleaner code. Added some methods
4081         to help us keep track of the extern aliased references.
4082         * driver.cs: Add suport for extern alias assemblies on command
4083         line and check for their warnings/errors. Also keep track of the
4084         extern aliased assemblies.
4085         * namespace.cs: Move the global functionality of Namespace
4086         to GlobalRootNamespace/RootNamespace. Now the global namespace
4087         is GlobalRootNamespace.Globa. Also the code moved from 
4088         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
4089         Finally added LocalAliasEntry (AliasEntry before) and
4090         ExternAliasEntry, to handle alias statements.
4091         * cs-parser.jay: Add support in the grammar for extern alias
4092         statement.
4093         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
4094         Update callings to Namespace (now in GlobalRootNamespace).
4095
4096 2005-10-18  Raja R Harinath  <rharinath@novell.com>
4097
4098         Fix #76371.
4099         * class.cs (TypeContainer.DefineType): Move updating of
4100         topological sort earlier in the code.
4101         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
4102
4103 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
4104
4105         Fix #76273.
4106         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
4107         
4108         * constant.cs (Constant.TryReduce): Moved from Cast class.
4109         (Reduce): Made little bit more OO and fixed missing conversions.
4110         
4111         * ecore.cs (Reduce): Implemented.
4112         (Binary.EnumLiftUp): New method to upgrade values to enum values.
4113         
4114         * literal.cs (Reduce): Implemented.
4115         
4116         * class.cs: Reverted Miguel's wrong commit.
4117
4118 2005-10-14  Miguel de Icaza  <miguel@novell.com>
4119
4120         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
4121
4122 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
4123
4124         * cs-parser.jay, expression.cs : CS0214 was missing error location
4125           for constants. Fixed bug #76404.
4126
4127 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
4128
4129         Fix #76370.
4130         * convert.cs (ExplicitConversionCore): Fixed object->enum
4131         conversion.
4132
4133 2005-10-10  Raja R Harinath  <rharinath@novell.com>
4134
4135         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
4136         InstanceExpression.
4137         (PropertyExpr.EmitCall): Likewise.
4138         * expression.cs (Invocation.EmitArguments): Handle case where
4139         arguments == null.
4140         (Invocation.EmitCall): Avoid allocating temporary variable if
4141         there are no arguments.
4142
4143 2005-10-07  Raja R Harinath  <rharinath@novell.com>
4144
4145         Fix #76323.
4146         * convert.cs (ImplicitConversionStandard): Move conversion of
4147         void* to arbitrary pointer types ...
4148         (ExplicitConversionStandard): .. here.
4149         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
4150         error to always print typenames.
4151
4152 2005-10-07  Raja R Harinath  <rharinath@novell.com>
4153
4154         * convert.cs (GetConversionOperator): Rename from
4155         GetConversionOperators.  Move operator selection code from ...
4156         (UserDefinedConversion): ... here.
4157
4158 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
4159
4160         * convert.cs (ExplicitConversionCore): Removed duplicate enum
4161         conversion.
4162
4163 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
4164
4165         * assign.cs (Assign.DoResolve): Error method changed.
4166
4167         * cfold.cs (DoConstantNumericPromotions): Error method changed.
4168         
4169         * const.cs (ResolveValue): Reset in_transit immediately.
4170         
4171         * constant.cs: Error method changed.
4172         
4173         * convert.cs: Removed useless location parameter.
4174         (ExplicitNumericConversion): Don't do double enum check.
4175         (ExplicitConversionCore): Renamed from ExplicitConversion.
4176         (ExplicitUnsafe): Extracted from ExplicitConversion.
4177         (ExplicitConversion): Uses for error reporting.
4178         
4179         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
4180         error messages.
4181         (ResolveBoolean): Uses common error method.
4182         (CastToDecimal): Get rid of ec.
4183         (CastFromDecimal): Optimized.
4184         (ConvCast): Get rid of ec.
4185         
4186         * enum.cs (ResolveValue): Reset in_transit immediately.
4187         (Emit): Return after first error.
4188         
4189         * expression.cs: Convert changes.
4190         
4191         * literal.cs: Error method changed.
4192         
4193         * statement.cs: Error method changed.
4194
4195 2005-10-03  Raja R Harinath  <rharinath@novell.com>
4196
4197         * support.cs (SeekableStreamReader.Position): Don't error out when
4198         the requested position is just beyond the end of the current
4199         buffered data.
4200
4201 2005-09-28  Raja R Harinath  <rharinath@novell.com>
4202
4203         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
4204         try to keep in sync with the byte count of the underlying Stream.
4205         However, this limits us to a window size of 2048 characters: i.e.,
4206         the maximum lookahead of our lexer/parser can be 2048 characters.
4207
4208 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
4209
4210         Fix #76255.
4211         * driver.cs: Fix compilation files with full root path.
4212
4213 2005-09-25  Miguel de Icaza  <miguel@novell.com>
4214
4215         * report.cs (SymbolRelatedToPreviousError): Format the output so
4216         it does not use an open parenthesis that is never closed. 
4217
4218         * driver.cs: Follow coding guidelines
4219
4220 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4221
4222         Fix #72930.
4223         * const.cs (Const.ResolveValue): Check for assigning non-null
4224         value to reference type.
4225
4226 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4227
4228         * anonymous.cs: Implemented ExprClassName.
4229         
4230         * assign.cs (Assign.DoResolve): Don't chrash when type is not
4231         delegate.
4232         
4233         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
4234         check.
4235         
4236         * class.cs (StaticClass.DefineContainerMembers): Report protected
4237         members as error.
4238         
4239         * codegen.cs: if(ed) PRODUCTION.
4240         
4241         * convert.cs (Error_CannotImplicitConversion): Better error
4242         distinction.
4243         
4244         * cs-parser.jay: More error checks.
4245         
4246         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
4247         
4248         * driver.cs (CSCParseOption): Enabled wrong option check.
4249         
4250         * ecore.cs (Expression.ExprClassName): Turned to property.
4251         (MemberExpr.CheckIntermediateModification): For checking boxed
4252         value types     modification.
4253         
4254         * statement.cs (Fixed.Resolve): Expression type must be
4255         convertible to fixed type.
4256         (CollectionForeach.GetEnumeratorFilter,TryType):
4257         Small refactoring for easier error checking.
4258
4259 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
4260
4261         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4262         attributes.
4263         
4264         * class.cs (GeneratedBaseInitializer): New class for customization
4265         compiler generated initializers.
4266         (MemberBase.DoDefine): Check Obsolete attribute here.
4267         (FieldMember.DoDefine): Ditto.
4268         
4269         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
4270         constants.
4271         
4272         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
4273         (MemberCore.GetObsoleteAttribute): Removed argument.
4274         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
4275         (MemberCore.CheckObsoleteType): New helper.
4276         
4277         * delegate.cs,
4278         * enum.cs,
4279         * statement.cs: Updates after MemberCore changes.
4280         
4281         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
4282         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
4283         
4284         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
4285         obsolete attribute for compiler construct.
4286         (As.DoResolve): Cache result.
4287         
4288         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
4289
4290 2005-09-26  Raja R Harinath  <rharinath@novell.com>
4291
4292         Fix #76133.
4293         * expression.cs (This.VerifyFixed): In a value type T, the type of
4294         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
4295         value type R, 'this' is treated as a value parameter.
4296
4297 2005-09-22  Miguel de Icaza  <miguel@novell.com>
4298
4299         * statement.cs (Lock): Use the TemporaryVariable class instead of
4300         manually using local variables as those do not work when variables
4301         are captured.
4302
4303         * ecore.cs: Moved the TemporaryVariable class from being a nested
4304         class inside Foreach to be a public class that can be employed in
4305         other places. 
4306
4307 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
4308
4309         * cs-parser.jay: interface_accessors replaced by
4310         accessor_declarations.
4311
4312         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
4313         location.
4314         
4315         * statement.cs (GotoCase.Resolve): Convert null constant to
4316         null case.
4317         (SwitchLabel.ResolveAndReduce): Ditto.
4318         (SwitchLabel.NullStringCase): Custom null stamp.
4319         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
4320         
4321         typemanager.cs (CSharpSignature): Don't skip first argument
4322         for full names.
4323
4324 2005-09-18  Miguel de Icaza  <miguel@novell.com>
4325
4326         * driver.cs: Set InEmacs based on the environment variable EMACS. 
4327
4328         * location.cs (InEmacs): in this mode, do not report column
4329         location as it confuses Emacs.
4330
4331 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
4332
4333         * cfold.cs, constant.cs, convert.cs, ecore.cs,
4334         expression.cs, iterators.cs, literal.cs: Store constants and
4335         literals location.
4336         
4337         * class.cs (MemberBase.ShortName): Pass location.
4338         
4339         * cs-parser.jay: Some location fixes.
4340         
4341         * ecore.cs (Expression.Location): Made virtual.
4342
4343 2005-09-05  Miguel de Icaza  <miguel@novell.com>
4344
4345         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
4346         if the underlying types are the same, otherwise we need to produce
4347         code that will do the proper cast.
4348
4349         This was exposed by Marek's constant rewrite which produced
4350         invalid code for the call site:
4351
4352         enum X : long { a }
4353         void Method (X v) {}
4354
4355         Method ((X) 5)
4356
4357         This fixes test-49.cs
4358
4359 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4360
4361         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
4362           Type/Object should be allowed as well. Fixed bug #75968.
4363
4364 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4365
4366         * expression.cs : (Binary.DoResolve): when one is enum constant and
4367           another is constant 0, then return enum one *as enum type*.
4368           Fixed bug 74846.
4369
4370 2005-09-02  Raja R Harinath  <rharinath@novell.com>
4371
4372         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4373         internal.
4374
4375         Fix #75941.
4376         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4377         flow-branching for LocalVariableReferences in case we were invoked
4378         from a MemberAccess.
4379         * expression.cs (LocalVariableReference.VerifyAssigned): New.
4380         Carved out of ...
4381         (LocalVariableReference.DoResolveBase): ... this.
4382         (MemberAccess.Resolve): Do the check that was disabled during
4383         SimpleNameResolve.
4384
4385 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4386
4387         * class.cs :
4388           (PartialContainer.Create): check abstract/sealed/static strictly
4389           but abstract/sealed can exist only at one side. Fixed bug #75883.
4390
4391 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
4392
4393         Fix #75945.
4394         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4395         specified, don't default to UnmanagedType.I4.
4396
4397 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4398
4399         * expression.cs : conditional operator should check possibly
4400           incorrect assign expression. Fixed bug #75946.
4401
4402 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
4403
4404         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
4405           Reverting the change. gmcs is much complex than mcs on this matter.
4406
4407 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
4408
4409         * cs-tokenizer.cs : To read another token ahead of the actual 
4410           consumption, use new SavedToken and cache token instead of moving
4411           back the stream with SeekableStreamReader (it seemed problematic).
4412         * cs-parser.jay,
4413           driver.cs : Thus use StreamReader directly.
4414         * support.cs : Thus removed SeekableStreamReader.
4415
4416 2005-08-30  Raja R Harinath  <rharinath@novell.com>
4417
4418         Fix #75934.
4419         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
4420         (ScopeInfo.EmitScopeType): Use it to construct field names from
4421         names of captured locals.
4422
4423         Fix #75929.
4424         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
4425         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
4426         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
4427         (ExplicitConversion): Remove enum cases already handled by
4428         implicit conversion.  Move implicit conversion check to the beginning.
4429         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
4430         * expression.cs (ArrayCreation.EmitDynamicInitializers):
4431         Don't treat System.Enum as a struct.
4432
4433 2005-08-30  Jb Evain  <jbevain@gmail.com>
4434
4435         * attribute.cs: handles as expression in parameters.
4436
4437 2005-08-30  Raja R Harinath  <rharinath@novell.com>
4438
4439         Fix #75802.
4440         * class.cs (TypeContainer.VerifyClsName): Don't use a
4441         PartialContainer when verifying CLS compliance.
4442         (AbstractPropertyEventMethod): Set Parent here, ...
4443         (PropertyMethod): ... not here.
4444
4445 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
4446
4447         * attribute.cs : escaped attribute name should not be allowed to be
4448           resolved (e.g. @class as classAttribute). Fixed bug #75930.
4449
4450 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4451
4452         Fix #75927.
4453         * convert.cs (ImplicitStandardConversionExists): Allow zero also
4454         when converting a long constant to unsigned long.
4455         * expression.cs (Invocation.OverloadResolve): Add sanity check to
4456         detect where IsApplicable and VerifyArgumentsCompat disagree.
4457
4458 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4459         and Carlos Alberto Cortez  <carlos@unixmexico.org>
4460
4461         Fix #75848.
4462         * class.cs (TypeContainer.CanElideInitializer): New helper.
4463         (TypeContainer.EmitFieldInitializers): Use it to determine if we
4464         can safely emitting the initializer of a field.
4465
4466 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4467
4468         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4469           allowed inside a switch (without loop). Fixed bug #75433.
4470
4471 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4472
4473         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4474         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4475
4476 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4477
4478         * driver.cs : kinda reverting the default encoding changes (not exact 
4479           revert since I noticed that "codepage:reset" might not work fine).
4480
4481 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4482
4483         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4484           Location. Now getter and setter store location correctly.
4485           (errors/cs0111-12.cs now reports the expected location.)
4486
4487 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4488
4489         * driver.cs : Use default encoding on the environment.
4490           Removed (now that) extra parameter for SeekableStreamReader.
4491         * support.cs : (SeekableStreamReader) third .ctor() argument for
4492           StreamReader is not required (always true). preamble size could
4493           be acquired in simpler and safe way.
4494
4495 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4496
4497         * cs-parser.jay: report CS0642 at warning level 3
4498           and report CS0642 for an if else statement also
4499           fixes bug #74745. Patch by John Luke (and a bit
4500           modified by me).
4501           Removed extra CS0642 warning check for "while",
4502           "for" and "fixed".
4503         * statement.cs: In Block.Resolve(), CS0642 check
4504           is reimplemented to check a sequence of an empty
4505           statement and a block.
4506
4507           Both fix bug #66777.
4508
4509 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
4510
4511         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4512         detection until I fix it.
4513         
4514         * cs-tokenizer.cs: Changed error message.
4515         
4516         * cs-parser.jay: Fixed 2 error locations.
4517         
4518         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4519         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4520         properties.
4521         
4522         * enum.cs (GetSignatureForError): Fixed.
4523         
4524         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4525         method detection.
4526         
4527         * class.cs,
4528         * typemanager.cs (RegisterProperty): Removed.
4529         
4530         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4531
4532 2005-08-24  Raja R Harinath  <rharinath@novell.com>
4533
4534         Fix #75874.
4535         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4536         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4537
4538 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4539
4540         * expression.cs : tiny fix is required for not warning positive ulong.
4541           See test-441.cs.
4542
4543 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4544
4545         * expression.cs : add CS0652 check for constant and integral
4546           expression. Fixed bug #53974.
4547
4548 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4549
4550         * expression.cs : in DoNumericPromotions(), check if there is implicit
4551           conversion overload for string (to check CS0034). Fixed bug #52492.
4552
4553 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4554
4555         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4556
4557 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4558
4559         * ecore.cs : report location when it is *not* Null.
4560
4561 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4562
4563         * codegen.cs,
4564           ecore.cs,
4565           flowanalysis.cs,
4566           expression.cs:
4567           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4568           correctly. Fixed bug #75721.
4569
4570 2005-08-23  Raja R Harinath  <rharinath@novell.com>
4571
4572         * support.cs (SeekableStreamReader.Position): Avoid an expensive
4573         loop that performs 'min (pos, char_count)'.
4574
4575         Fix #75862.
4576         * expression.cs (Unary.ResolveOperator): Don't discard implicit
4577         converted value in Operator.OnesComplement.
4578
4579 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
4580
4581         * anonymous.cs: If the anon method is pulled into a helper class,
4582         it needs to be `internal' not `private'. Fixes runtime behavior on
4583         msft. bug #75704
4584
4585 2005-08-20  Martin Baulig  <martin@ximian.com>
4586
4587         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4588         scope if we don't already have it.
4589
4590         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4591         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4592         fixes #75867.
4593
4594 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
4595
4596         Fix #75803
4597         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4598         is a partial class.
4599
4600 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
4601
4602         The big constants rewrite
4603         Fix #75746, #75685 and more
4604         As a side effect saved 1MB for MWF ;-)
4605         
4606         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4607         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4608         enum based for corlib compilation.
4609         
4610         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4611         subtractions.
4612         
4613         * class.cs (FixedField.Define): Use ResolveAsConstant.
4614         
4615         * const.cs (IConstant): Interface constants and enums.
4616         (Const.ResolveValue): New method for constant resolvning.
4617         (ExternalConstant): Constants from imported assemblies.
4618         
4619         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4620         conversion; like enums.
4621         (Constant.ToType): Converts this constant to different type.
4622         (Constant.Increment): Adds 1.
4623         
4624         * convert.cs (ImplicitConversionRequired): Simplified.
4625         
4626         * cs-parser.jay: Create EnumMember directly.
4627         
4628         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4629         
4630         * doc.cs (GenerateEnumDocComment): Removed.
4631         
4632         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4633         (ConvertIntLiteral): Removed.
4634         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4635         
4636         * enum.cs (EnumMember): Implement IConstant.
4637         (Enum.IsValidEnumConstant): Removed.
4638         (Enum.GetNextDefaultValue): Removed.
4639         (Enum.FindMembers): Updated.
4640         (Enum.GenerateDocComment): Iterate enum members.
4641         
4642         * expression.cs (Cast.TryReduce): Handle enums correctly.
4643         (New.Constantify): Made public.
4644         (MemberAccess.DoResolve): Removed contant specific if(s).
4645         
4646         * literal.cs (NullLiteral): Implement new abstract methods.
4647         
4648         * statement.cs (GotoCase.Resolve): Use new constant methods.
4649         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4650         
4651         * typemanager.cs (LookupEnum): Removed.
4652         (IsEnumType): Fixed to work with corlib.
4653         (RegisterConstant): Removed.
4654         (LookupConstant): Removed.
4655         (GetConstant): Changed to work with IConstant.
4656
4657 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4658
4659         * location.cs : Fixed overflown (>255) column number.
4660
4661 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4662
4663         First cut of the qualified-alias-member feature.
4664         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4665         token.
4666         * cs-parser.jay (DOUBLE_COLON): New token.
4667         (namespace_or_type_name): Add rule for recognizing
4668         qualified-alias-members.
4669         (primary_expression): Likewise.
4670         (element_access): Allow QualifiedAliasMember as a possible
4671         type-bearing expression.
4672         (local_variable_type, local_variable_pointer_type): Likewise.
4673         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4674         aliases in the current and enclosing namespace declarations.
4675         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4676         * decl.cs (MemberName.is_double_colon): New.
4677         (MemberName.MemberName): Add new constructor for alias-member.
4678         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4679         * expression.cs (QualifiedAliasMember): New expression type.
4680
4681 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4682
4683         * location.cs : it borked when no argument was specified.
4684
4685 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4686
4687         * location.cs : tiny ToString() format fix.
4688
4689 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4690
4691         * statement.cs : oops, it was missing.
4692
4693 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4694
4695         A set of fixes for precise line/column location.
4696
4697         * location.cs :
4698           "token" field now holds a file/line "delta", a line number offset 
4699           from the segment, and a column number. See also:
4700           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4701           December/009508.html
4702           Removed static IsNull. Use instance IsNull property instead.
4703         * cs-tokenizer.cs :
4704           For some tokens it stores Location. For Identifier it stores
4705           LocatedToken which is a pair of string name and location.
4706           Column numbers are adjusted only at getChar().
4707         * report.cs :
4708           Use Location.ToString() for reporting (it now contains column).
4709         * cs-parser.jay :
4710           Largely modified to use LocatedToken instead of
4711           string (IDENTIFIER), and to acquire Location from some tokens.
4712         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4713           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4714           codegen.cs :
4715           Now MemberName holds Location. DeclSpace.ctor() receives Location
4716           as a parameter. Removed extra parameters to all derived classes.
4717           Replaced Location.IsNull() with instance property.
4718         * assign.cs, expression.cs :
4719           Added .ctor() overload that omits Location.
4720         * attribute.cs :
4721           Added "nameEscaped" flag that indicates the identifier was escaped
4722           in the source file. This fixes bug #57047.
4723
4724 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4725
4726         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4727         New method, looking for lo-case imported cls type.
4728
4729         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4730         here.
4731
4732         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4733
4734         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4735
4736         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4737         all_imported_types.
4738         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4739
4740         Optimized to save 3.5 MB for SWF compilation.
4741
4742 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4743
4744         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4745         (PartialContainer.Create): Moved logic AddToContainer.
4746         (PartialContainer.MarkForDuplicationCheck): Shares name.
4747         
4748         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4749         place.
4750         
4751         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4752         initialization.
4753         (Namespace.GetSignatureForError): New method.
4754         
4755         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4756         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4757
4758 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4759
4760         Fix #75669.
4761         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4762         member lookup rather than qualifier_type, since qualifier_type can
4763         be null.
4764
4765 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4766
4767         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4768         enum member.
4769
4770 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4771
4772         * statement.cs: Copy the local exception into the exception
4773         captured local.  Fixes 75674
4774
4775 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4776
4777         Fix #75658.
4778         * expression.cs (Invocation.OverloadResolve): Don't report error
4779         CS1501 if error CS1502 has been reported.
4780         (New.DoResolve): Delegate CS1501 reporting to
4781         Invocation.OverloadResolve.
4782
4783         Fix #75656.
4784         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4785         invariant-meaning-in-block property in an enclosing block if
4786         necessary.
4787
4788 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4789
4790         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4791         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4792         (Switch.CheckSwitch): Just save 50kb for SWF.
4793
4794 2005-07-27  Martin Baulig  <martin@ximian.com>
4795
4796         * anonymous.cs (CaptureContext.AddField): Added
4797         `AnonymousContainer am' argument; compute its toplevel scope if
4798         it's not already computed.  Fixes #75649.
4799
4800 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4801
4802         Fix #75628.
4803         * class.cs (Constructor.Emit): Reset block to null if the block
4804         resolve fails.
4805
4806 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4807
4808         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4809
4810 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4811
4812         * class.cs (MethodData.Define): Check whether accessor implementing
4813         interface is public.
4814
4815         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4816
4817 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4818
4819         Fix #57245
4820         * namespace.cs (LookupType): Moved same type check to...
4821         
4822         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4823         with the same name.
4824
4825 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4826
4827         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4828         already found a typebuilder.
4829         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4830         MemberNames, not strings.
4831
4832         * const.cs (Error_ExpressionMustBeConst): 
4833         Rename from Error_EpressionMustBeConst.
4834         * const.cs, class.cs, statement.cd: Update.
4835
4836 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4837
4838         Fix #65573
4839
4840         * const.cs (Const.LookupConstantValue): Report missing contant expression
4841         everytime.
4842         (Error_EpressionMustBeConstant): Only one error method.
4843
4844         * class.cs, statement.c: Updated.
4845
4846 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4847
4848         * statement.cs (Block.Flags): Add back HasVarargs.
4849         (Block.flags): Make protected.
4850         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4851
4852         * typemanager.cs (types, typecontainers, user_types): Remove.
4853         (UserTypes, TypeContainers): Likewise.
4854         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4855         (CleanUp, Reset): Update.
4856         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4857         (GetNestedType): Use Type.GetNestedType.
4858         (CoreLookupType): Take two arguments, the namespace and the
4859         basename of the type.  Update to use the Namespace.Lookup
4860         mechanism.
4861         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4862         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4863         string concatenation and substring matches.
4864         * class.cs, enum.cs, delegate.cs: Update to changes.
4865
4866 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4867
4868         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4869         Expression and made virtual.
4870
4871         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4872         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4873
4874         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4875
4876         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4877         error message.
4878
4879         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4880         change.
4881
4882 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4883
4884         Fix #57707
4885         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4886         AssemblyCultureAttribute is not used on executable.
4887
4888         * rootcontext.cs,
4889         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4890
4891 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4892
4893         Fix #60638.
4894         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4895         New.  Reports CS0252/CS0253.
4896         Mostly taken from preliminary patch by Duncak Mak.
4897         (Binary.DoResolveOperator): Store results of operator lookup.
4898         Use them to detect if we need to warn about unintended reference
4899         comparisons.
4900
4901 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4902
4903         Fix #72969.
4904         * namespace.cs (Namespace.Lookup): Add back location parameter.
4905         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4906         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4907
4908         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4909         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4910         (Namespace.LookupType): ... this.
4911         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4912         of namespaces.
4913         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4914         purported to handle pointers.
4915         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4916         CoreLookupType.
4917
4918 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4919
4920         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4921         type as namespace.
4922
4923 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4924
4925         * namespace.cs (Namespace.Lookup): Drop location parameter.
4926         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4927         (NamespaceEntry.Lookup): ... this.
4928         (NamespaceEntry.Error_AmbiguousTypeReference):
4929         Move here from DeclSpace.
4930         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4931         names ...
4932         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4933         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4934         Move to NamespaceEntry.
4935         * delegate.cs, expression.cs: Update to changes.
4936
4937 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4938
4939         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4940         CheckAttributeType and refactored.
4941         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4942         ResolveAsTypeTerminal error handling.
4943         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4944         handling.
4945         (GetSignatureForError): Print errors in same way.
4946
4947         * class.cs,
4948         * codegen.cs: Reflect attribute GetSignatureForError change.
4949
4950         * ecore.cs,
4951         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4952
4953         * namespace.cs (UsingEntry): Refactored to make fields private.
4954
4955         * assign.cs,
4956         statement.cs: Error_UnexpectedKind has extra parameter.
4957
4958 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4959
4960         * ecore.cs (IAlias): Remove.
4961         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4962         that implement the interface.
4963         * namespace.cs (Namespace): Likewise.
4964         (Namespace.declspaces): Renamed from 'defined_names'.
4965         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4966         DeclSpace instead of an IAlias.
4967         * tree.cs (Tree.AddDecl): Update.
4968
4969 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4970
4971         * statement.cs (Block.Flags); Remove HasVarargs.
4972         (Block.HasVarargs): Move to ToplevelBlock.
4973         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4974         (Block.Variables): Make protected.  Initialize variable hashtable
4975         if necessary.
4976         (Block.AddVariable): Update.
4977         (Block.Resolve): Update to changes.
4978         (ToplevelBlock.HasVarargs): New boolean.
4979         (ToplevelBlock.ThisVariable): Move here from Block.
4980         (ToplevelBlock.AddThisVariable): Likewise.
4981         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4982         * expression.cs (This.ResolveBase): Update to changes.
4983         (ArglistAccess.DoResolve): Likewise.
4984
4985 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4986
4987         Fix #75321
4988         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4989
4990         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4991         not used and not used & assigned.
4992         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4993
4994 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4995
4996         Fix #75053
4997         * expression.cs (Is.DoResolve): null is never provided type.
4998
4999 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
5000
5001         Fix #52496
5002         * cs-parser.jay: Less strict event error rule to catch more errors.
5003
5004 2005-07-08  Martin Baulig  <martin@ximian.com>
5005
5006         Fix test-iter-10.cs - distinguish whether we `yield' in a property
5007         gettter (allowed) or setter (not allowed).
5008
5009         * class.cs (Accessor): Implement IIteratorContainer.
5010         (Accessor.Yields): New public field.
5011         (PropertyBase.PropertyMethod.Define): Handle iterators on a
5012         per-accessor basis.
5013
5014         * cs-parser.jay
5015         (get_accessor_declaration, set_accessor_declaration): Set the
5016         `yields' flag on the accessor, not the property.
5017         (property_declaration): Do the iterators check on a per-accessor
5018         basis and not for the whole property.
5019
5020 2005-07-08  Martin Baulig  <martin@ximian.com>
5021
5022         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
5023         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
5024
5025 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
5026
5027         Fix #74975
5028         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
5029         (ExtractSecurityPermissionSet): Cope with self referencing security
5030         attributes properly.
5031
5032         * driver.cs (SetOutputFile): Made public property OutputFile.
5033
5034 2005-07-07  Raja R Harinath  <rharinath@novell.com>
5035
5036         Fix #75486.
5037         * class.cs (TypeContainer.first_nonstatic_field): Rename from
5038         has_nonstatic_fields.  Make into a FieldBase pointer.
5039         (TypeContainer.AddField): Add CS0282 check.
5040         (TypeContainer.EmitType): Update.
5041
5042 2005-07-06  Miguel de Icaza  <miguel@novell.com>
5043
5044         * cs-tokenizer.cs (consume_identifier): Do not create strings to
5045         compare if they start with __.
5046
5047 2005-07-06  Raja R Harinath  <rharinath@novell.com>
5048
5049         * statement.cs (Switch.SwitchGoverningType): Only look at
5050         UserCasts that don't need implicit standard conversions to one of
5051         the allowed switch types (Fixes test-322.cs).
5052         (LocalInfo.Resolve): Re-enable sanity-test.
5053
5054 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
5055
5056         * cs-tokenizer.cs (consume_identifier): Detect double undescores
5057         
5058         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
5059         
5060         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
5061
5062 2005-07-06  Raja R Harinath  <rharinath@novell.com>
5063
5064         Fix #75472.
5065         * ecore.cs (SimpleName.GetSignatureForError): Add.
5066         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
5067         (MemberAccess.GetSignatureForError): Add.
5068
5069 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
5070  
5071         The big error and warning messages review.
5072         
5073         * anonymous.cs,
5074         * assign.cs,
5075         * attribute.cs,
5076         * class.cs,
5077         * codegen.cs,
5078         * convert.cs,
5079         * cs-parser.jay,
5080         * cs-tokenizer.cs,
5081         * decl.cs,
5082         * delegate.cs,
5083         * doc.cs,
5084         * driver.cs,
5085         * ecore.cs,
5086         * enum.cs,
5087         * expression.cs,
5088         * flowanalysis.cs,
5089         * iterators.cs,
5090         * literal.cs,
5091         * location.cs,
5092         * modifiers.cs,
5093         * namespace.cs,
5094         * parameter.cs,
5095         * pending.cs,
5096         * report.cs,
5097         * rootcontext.cs,
5098         * statement.cs,
5099         * support.cs,
5100         * tree.cs,
5101         * typemanager.cs: Updated.
5102         
5103         * class.cs: (MethodCore.SetYields): Moved here to share.
5104         (PropertyMethod.Define): Moved iterator setup here.
5105         
5106         * iterators.cs: Add orig_method to have full access to parent
5107         container.
5108
5109 2005-07-05  Raja R Harinath  <rharinath@novell.com>
5110
5111         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
5112         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
5113         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
5114         variable of struct type.
5115         * expression.cs (Unary.ResolveOperator): Update to change.
5116         (Indirection.VerifyFixed): Likewise.
5117         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
5118         (ParameterReference.VerifyFixed): Value parameters are fixed.
5119         (This.VerifyFixed): Treat 'this' as a value parameter.
5120         * statement.cs (LocalInfo.IsFixed): Remove.
5121
5122 2005-07-01  Martin Baulig  <martin@ximian.com>
5123
5124         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
5125         `ec.EmitThis ()' to get the correct scope.
5126
5127 2005-07-01  Martin Baulig  <martin@ximian.com>
5128
5129         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
5130         instance is a ParameterReference; fixes #75299.
5131
5132 2005-07-01  Martin Baulig  <martin@ximian.com>
5133
5134         Reverted Marek's latest patch (r46725):
5135         - it contains structural changes which are neither mentioned in
5136           the ChangeLog nor explained anywhere; for example the additional
5137           argument of EmitContext's and Iterator's .ctor's and the
5138           TypeContainer.DefineMembers() change.
5139         - structural changes like this should go in in seperate patches
5140           and not be hidden in a huge patch which just seems to affect
5141           warnings and errors.
5142           a big and hard to understand patch.
5143         - it breaks iterators and causes regressions, for instance in
5144           test-iter-03.cs.      
5145
5146 2005-06-30  Raja R Harinath  <rharinath@novell.com>
5147
5148         Fix #75412.
5149         * expression.cs (Indexers.map): Remove.
5150         (Indexers.Append): Filter out inaccessible setters and getters.
5151         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
5152
5153         Fix #75283.
5154         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
5155         Refactored from ...
5156         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
5157         (FieldExpr.Emit, PropertyExpr.Emit): Update.
5158         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
5159         * expression.cs (Invocation.EmitCall): Add CS0120 check.
5160
5161 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
5162
5163         Fix #75322
5164         * class.cs (FieldBase.GetInitializerExpression): One more field
5165         for backup.
5166
5167 2005-06-28  Miguel de Icaza  <miguel@novell.com>
5168
5169         * pending.cs: Do not define a proxy if the base method is virtual,
5170         it will be picked up by the runtime (bug 75270).
5171
5172 2005-06-08  Martin Baulig  <martin@ximian.com>
5173
5174         The big Iterators rewrite :-)
5175
5176         * iterators.cs: Rewrite this to use the anonymous methods framework.
5177
5178         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5179         before the TypeContainers; see 2test-21.cs.
5180
5181         * class.cs
5182         (TypeContainer.DefineType): Don't create a new EmitContext if we
5183         already have one (this only happens if we're an Iterator).
5184         (TypeContainer.Define): Also call Define() on all our iterators.
5185         (Method.CreateEmitContext): Added support for iterators.
5186
5187         * anonymous.cs
5188         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5189         (AnonymousContainer.CreateMethodHost): Moved here from
5190         AnonymousMethod and made abstract.
5191         (AnonymousContainer.CreateScopeType): New abstract method.
5192         (AnonymousContainer.IsIterator): New public property.
5193         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5194         get the ScopeTypeBuilder rather than manually defining it here. 
5195         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5196         iterators here.
5197
5198         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5199         before RootContext.DefineTypes().
5200
5201         * codegen.cs (EmitContext.RemapToProxy): Removed.
5202         (EmitContext.CurrentAnonymousMethod): Changed type from
5203         AnonymousMethod -> AnonymousContainer.
5204         (EmitContext.ResolveTopBlock): Protect from being called twice.
5205         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5206         (EmitContext.EmitThis): Removed the iterators hacks; use the
5207         anonymous methods framework for that.
5208
5209         * statement.cs
5210         (ToplevelBlock.Container): Make this a property, not a field.
5211         (ToplevelBlock.ReParent): New public method; move the
5212         ToplevelBlock into a new container.
5213         (Foreach.TemporaryVariable): Simplify.
5214
5215 2005-06-05  Martin Baulig  <martin@ximian.com>
5216
5217         * statement.cs (LocalInfo.CompilerGenerated): New flag.
5218         (Block.AddTemporaryVariable): New public method; creates a new
5219         `LocalInfo' for a temporary variable.
5220         (Block.EmitMeta): Create the LocalBuilders for all the temporary
5221         variables here.
5222         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5223         non-iterator variables.
5224
5225 2005-06-05  Martin Baulig  <martin@ximian.com>
5226
5227         * statement.cs (Foreach.TemporaryVariable): Create the
5228         LocalBuilder in the Emit phase and not in Resolve since in some
5229         situations, we don't have an ILGenerator during Resolve; see
5230         2test-19.cs for an example.
5231
5232 2005-06-04  Martin Baulig  <martin@ximian.com>
5233
5234         **** Merged r45395 from GCS ****
5235
5236         The big Foreach rewrite - Part II.
5237
5238         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5239         with `PropertyInfo ienumerator_getcurrent'.
5240
5241         * codegen.cs (VariableStorage): Removed.
5242
5243         * statement.cs
5244         (Foreach): Derive from Statement, not ExceptionStatement.
5245         (Foreach.CollectionForeach): New nested class.  Moved all the code
5246         dealing with collection foreach here.
5247         (Foreach.ForeachHelperMethods): Removed.
5248         (Foreach.TemporaryVariable): Implement IMemoryLocation.
5249
5250 2005-05-23  Martin Baulig  <martin@ximian.com>
5251
5252         * statement.cs (Try.DoResolve): Don't create a `finally' if we
5253         don't need to.  Fix #75014.
5254
5255 2005-05-20  Martin Baulig  <martin@ximian.com>
5256
5257         Merged r44808 from GMCS.
5258
5259         * class.cs (TypeContainer.CircularDepException): Removed.
5260         (TypeContainer.DefineType): Removed the `InTransit' stuff.
5261         (TypeContainer.CheckRecursiveDefinition): Check for circular class
5262         (CS0146) and interface (CS0529) dependencies here.
5263
5264 2005-06-21  Raja R Harinath  <rharinath@novell.com>
5265
5266         * expression.cs (Invocation.EmitCall): Fix initialization
5267         'this_call' to reflect current behaviour.  Fix indentation.
5268
5269         * convert.cs (FindMostEncompassedType): Add two trivial special
5270         cases (number_of_types == 0 || number_of_types == 1).
5271         (FindMostEncompasingType): Likewise.
5272
5273 2005-06-17  Raja R Harinath  <rharinath@novell.com>
5274
5275         Some cleanups preparing for the fix of #75283.
5276         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
5277         error testing.
5278         (EventExpr.InstanceResolve): Likewise.
5279         (EventExpr.DoResolve): Remove redundant checks.
5280
5281 2005-06-10  Duncan Mak  <duncan@novell.com>
5282
5283         * cs-tokenizer.cs (process_directives): New flag for controlling
5284         the processing of preprocessor directives.
5285         (x_token): After seeing a '#', return Token.NONE instead of going
5286         to handle_preprocessing_directive() when not processing
5287         directives. This avoids unnecessary processing during the token peek in
5288         is_punct().
5289
5290         This fixes #74939.
5291
5292         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
5293         the existing error reporting methods instead of Report.Error.
5294
5295         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
5296         after Raja's rewrite.
5297
5298 2005-06-08  Miguel de Icaza  <miguel@novell.com>
5299
5300         * class.cs: Small fix.
5301
5302 2005-06-08  Raja R Harinath  <rharinath@novell.com>
5303
5304         Fix #75160.
5305         * class.cs (GetPartialBases): Fix return value check of
5306         part.GetClassBases.
5307
5308 2005-06-07  Raja R Harinath  <rharinath@novell.com>
5309
5310         Ensure that partial classes are registered in their enclosing
5311         namespace.  Initial part of fix of #75160.
5312         * tree.cs (Tree.RecordDecl): Add new namespace argument.
5313         Register declspace with namespace here, not in
5314         DeclSpace.RecordDecl.
5315         * cs-parser.jay: Pass namespace to RecordDecl.
5316         * class.cs (PartialContainer.Create): Likewise.
5317         (ClassPart.DefineType): New sanity-check.  Throws an exception if
5318         called.
5319         * decl.cs (Declspace.RecordDecl): Remove.
5320         * namespace.cs (NamespaceEntry.DefineName): Remove.
5321
5322 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
5323
5324         * rootcontext.cs: Reset TargetExt as well.
5325
5326 2005-06-03  Raja R Harinath  <rharinath@novell.com>
5327
5328         * ecore.cs (Expression.Resolve): Emit CS0654 error when
5329         -langversion:ISO-1.
5330
5331 2005-06-02  Raja R Harinath  <rharinath@novell.com>
5332
5333         Fix #75080, cs0119.cs.
5334         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
5335         of ...
5336         (Expression.Resolve): ... this.  Use it.  Remove bogus code
5337         allowing ExprClass.Type and ExprClass.Namespace for
5338         ResolveFlags.VariableOrValue.
5339         (Expression.Resolve) [1-argument variant]: Change default resolve
5340         flags based on language version.
5341         (Expression.Error_UnexpectedKind): Use a simple string array
5342         rather than an ArrayList.
5343         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
5344         not ExprClass.Type.
5345         (TypeOfVoid.DoResolve): Likewise.
5346         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
5347         flags argument -- it always has the same value.
5348
5349 2005-05-31  Raja R Harinath  <rharinath@novell.com>
5350
5351         Fix #75081.
5352         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5353         Use it in the error message.
5354         * assign.cs, expression.cs, statement.cs: Update.
5355
5356 2005-05-30  Raja R Harinath  <rharinath@novell.com>
5357
5358         Fix #75088.
5359         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
5360         the "almostMatchedMember" case too.
5361         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
5362         that failed the accessibility checks to 'almost_match'.
5363
5364 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
5365
5366         * attribute.cs: Use internal MethodBuilder methods to set
5367         ExactSpelling and SetLastError on PInvoke methods, instead
5368         of passing them via charset.  Fixes #75060.
5369
5370 2005-05-27  Raja R Harinath  <rharinath@novell.com>
5371
5372         * parameter.cs (Parameter): Remove TODO comment.
5373         (Parameter.DefineParameter): Remove Location parameter.
5374         (Parameters.LabelParameters): Likewise.
5375         * class.cs (Constructor.Emit): Update to change.
5376         (MethodData.Emit): Likewise.
5377         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
5378         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5379
5380 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
5381
5382         * parameter.cs,
5383           Removed Parameters.Location and added Parameter.Location instead.
5384           Removed Location parameter from Emit() and GetSignature().
5385         * anonymous.cs,
5386           class.cs,
5387           cs-parser.jay,
5388           delegate.cs,
5389           iterators.cs,
5390           statement.cs :
5391           Modified all related calls.
5392
5393 2005-05-26  Raja R Harinath  <rharinath@novell.com>
5394
5395         Improve user-defined conversion handling.
5396         * convert.cs (GetConversionOperators): Rewrite.  Return only the
5397         applicable operators.
5398         (AddConversionOperators): New.  Helper for GetConversionOperators.
5399         (FindMostEncompassedType, FindMostEncompassingType): Verify that
5400         there is only one most encompassed/encompassing type.
5401         (FindMostSpecificSource, FindMostSpecificTarget): Remove
5402         "applicable operator" handling.
5403         (UserConversion): Move cache here from GetConversionOperators.
5404         Directly cache the chosen operator, rather than the whole
5405         MethodGroup.
5406         (ExplicitNumericConversion): Fix buggy implementation of Decimal
5407         case.  Allow conversion of decimal to sbyte and byte too.
5408         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5409         New static methods.  Used to avoid allocating EmptyExpressions in
5410         convert.cs.
5411
5412 2005-05-24  Duncan Mak  <duncan@novell.com>
5413
5414         * ecore.cs (CastFromDecimal): New class for casting a decimal to
5415         another class, used in Convert.ExplicitNumericConversion.
5416         (CastToDecimal): New class, similar to above, but casts to
5417         System.Decimal, used in Convert.ImplicitNumericConversion and also
5418         in explicit convesion from double/float to decimal.
5419
5420         * convert.cs (ImplicitNumericConversion): Handle implicit
5421         conversions to System.Decimal.
5422         (ExplicitNumericConversion): handle explicit conversions to
5423         System.Decimal.
5424
5425         This fixes #68711.
5426         
5427 2005-05-20  Miguel de Icaza  <miguel@novell.com>
5428
5429         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
5430         know the type at this stage, just break through.   Fixes #75008 
5431
5432 2005-05-19  Martin Baulig  <martin@ximian.com>
5433
5434         * delegate.cs
5435         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5436         to disable error reporting.
5437
5438         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5439         here since we don't want to report an error; see the new test-336.cs.
5440
5441 2005-05-19  Raja R Harinath  <rharinath@novell.com>
5442
5443         * statement.cs (ToplevelBlock.GetParameterReference)
5444         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5445         Move here from class Block.
5446         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5447         * expression.cs (ParameterReference.DoResolveBase): Likewise.
5448
5449 2005-05-18  Martin Baulig  <martin@ximian.com>
5450
5451         Fix #74978.
5452
5453         * flowanalysis.cs
5454         (FlowBranching.Reachability): Add non-static public And() and Or()
5455         methods.
5456         (FlowBranchingSwitch): New class; do the `break_origins' thing
5457         like in FlowBranchingLoop.
5458         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5459         reachability, not just locals and parameters.
5460         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5461         switch; MergeBreakOrigins() now takes care of that.
5462
5463 2005-05-18  Martin Baulig  <martin@ximian.com>
5464
5465         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5466         a loop and may leave it, reset the barrier; fixes #74974.
5467
5468 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
5469         
5470         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5471         is back.
5472         
5473         * cs-parser.jay: Catch more lexical errors.
5474         
5475         * report.cs: Add one more Error method.
5476         
5477         * rootcontext.cs,
5478         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5479
5480 2005-05-17  Martin Baulig  <martin@ximian.com>
5481
5482         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5483         #70970. 
5484
5485 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5486
5487         Fix test-382.cs.  Emit values of decimal constants.
5488         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5489         Carved out of ...
5490         (TypeContainer.AddField): ... this.
5491         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5492         with initializers to include 'Const's.
5493         (ClassPart.RegisterFieldForInitialization): Forward to
5494         PartialContainer.
5495         * const.cs (Const.Const): Pass initializer to base class.
5496         (Const.Define): In case of decimal constants, register them for
5497         initialization in a static constructor.
5498
5499 2005-05-14  Martin Baulig  <martin@ximian.com>
5500
5501         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5502         do not call ResolveUnreachable() on unreachable statements in
5503         here, see the comment in the source code.
5504
5505 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5506
5507         Fix #74934.
5508         * expression.cs (BinaryResolveOperator): If one of the operands of
5509         an equality comparison is 'null' and the other is a pointer type,
5510         convert the null to a NullPointer.
5511         * convert.cs (ImplicitReferenceConversion): If the expression is a
5512         NullLiteral and the target type is a pointer type, return a
5513         NullPointer instead.
5514         (ImplicitConversionStandard): Likewise.
5515
5516 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5517         
5518         * cs-parser.jay: Set readonly context based on special constructs.
5519         
5520         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5521         readonly variable error handling.
5522         
5523         * rootcontext.cs (EmitCode): Don't verify members when error
5524         occurred.
5525         
5526         * statement.cs (LocalInfo): Add reaodnly context information.
5527         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5528
5529 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5530
5531         * statement.cs (Block.Resolve): Revert change below.  Modify fix
5532         for #74041 to initialize 'resolved' to false only for explicit
5533         blocks.  Fixes #74873.
5534
5535 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5536
5537         Fix #74920.
5538         * typemanager.cs (unmanaged_enclosing_types): New.
5539         (IsUnmanagedType): Avoid infloops by using
5540         'unmanaged_enclosing_types' to talk with recursive invocations.
5541
5542 2005-05-13  Martin Baulig  <martin@ximian.com>
5543
5544         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5545         instance variable, not a local.  Fix #74873.
5546         (Block.ResolveUnreachable): Set it to true here.
5547
5548 2005-05-11  Duncan Mak  <duncan@novell.com>
5549
5550         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5551         continuing to process for 'arg'.
5552         (handle_preprocessing_directive): Check the argument of the #endif
5553         directive and report error CS1025 if there are any trailing
5554         characters.
5555
5556         According to the C# spec, having even whitespace after the #endif
5557         directive is illegal; however, because we call arg.TrimEnd ()
5558         beforehand, we have the same behavior as csc, allowing whitespace
5559         after the directive.
5560
5561         Fixes #74892.
5562
5563 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5564
5565         Fix #74863.
5566         
5567         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5568         (Constructor.GetObsoleteAttribute): Implemented correctly.
5569
5570 2005-05-10  Martin Baulig  <martin@ximian.com>
5571
5572         * support.cs (ReflectionParameters.ParameterModifier): Use
5573         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5574         and `ParameterAttributes.In'.  Fixes #74884.
5575
5576 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5577
5578         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5579         
5580         * expression.cs (Argument.GetParameterModifier): Turned to property.
5581         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5582         
5583         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5584         its C# equivalent.
5585         
5586 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5587
5588         Fix #74852.
5589         * decl.cs (MemberCache.AddMethods): Register override methods,
5590         rather than non-override methods.
5591         * typemanager.cs (RegisterOverride): New.
5592         (IsOverride): Update.
5593
5594 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5595
5596         Fix #73105.
5597         
5598         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5599         recursive declaration.
5600         
5601         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5602         
5603 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5604
5605         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5606         
5607         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5608
5609 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5610
5611         Fix #74797.
5612         * decl.cs (DeclSpace.FamilyAccessible): 
5613         Use TypeManager.IsNestedFamilyAccessible.
5614
5615         Fix reopened #64812.
5616         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5617         internal'.
5618
5619 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5620             Abin Thomas  <projectmonokochi@rediffmail.com>
5621             Anoob V E  <projectmonokochi@rediffmail.com>
5622             Harilal P R  <projectmonokochi@rediffmail.com>
5623
5624         Fix #64812.
5625         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5626         allow access to all static members.
5627
5628 2005-05-04  Martin Baulig  <martin@ximian.com>
5629
5630         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5631
5632 2005-05-04  Martin Baulig  <martin@ximian.com>
5633
5634         Fix #74655.
5635
5636         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5637         section at the end; make things work if `default' is not the last
5638         section.        
5639
5640 2005-05-04  Martin Baulig  <martin@ximian.com>
5641
5642         Fix #70400.
5643
5644         * statement.cs (Switch): Replaced the `got_default' field with a
5645         `default_section' one.
5646         (Switch.CheckSwitch): Set `default_section' here.
5647         (Switch.Resolve): If we're a constant switch and the constant is
5648         not found, use the default section.
5649
5650 2005-05-03  Martin Baulig  <martin@ximian.com>
5651
5652         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5653
5654         * statement.cs (Foreach.ArrayForeach): New nested class.
5655         (Foreach.TemporaryVariable): New nested class.
5656         (Foreach.EmitArrayForeach): Removed; this is now in the new
5657         ArrayForeach class.
5658
5659 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5660
5661         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5662         more conservative.
5663         (VerifyPendingMethods): Revert change below.
5664
5665         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5666         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5667         that used to trigger warning -28.  Remove warning -28.
5668         * expression.cs (Invocation.OverloadResolve): Use
5669         TypeManager.IsOverride to distinguish override methods.
5670
5671         Fix #74773.
5672         * pending.cs (VerifyPendingMethods): If a base type implements the
5673         requested interface, don't bother checking individual methods of
5674         the base type.  As a side-effect, this prevents the creation of
5675         unnecessary proxies.
5676
5677 2005-05-02  Martin Baulig  <martin@ximian.com>
5678
5679         Fix #70182.
5680
5681         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5682         Also `And' the locals if the old vector is null.
5683         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5684         null; in this case we basically reset all the variables.        
5685
5686 2005-05-02  Martin Baulig  <martin@ximian.com>
5687
5688         Fix #74529.
5689
5690         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5691         Added `FlowBranching branching' argument; always `and' the
5692         variables instead of `or'ing them unless we're an infinite loop.
5693
5694         * statement.cs (While.Resolve): Create a new sibling unless we're
5695         infinite.       
5696
5697 2005-05-02  Martin Baulig  <martin@ximian.com>
5698
5699         Fix #70140.
5700
5701         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5702         arguments; use it instead of creating a new TopLevelBlock.
5703         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5704         our ConstructorInitializer.
5705
5706         * statement.cs
5707         (TopLevelBlock.TopLevelBranching): New public property.
5708         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5709         and create our `TopLevelBranching'.
5710
5711         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5712         anonymous method host, use `block.TopLevelBranching' rather than
5713         creating a new branching.
5714
5715 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5716
5717         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5718         a ScopeInfo, if any of the current children is a child of the new
5719         entry, move those children there.
5720
5721 2005-04-30  Martin Baulig  <martin@ximian.com>
5722
5723         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5724         at the beginning of a SwitchSection.  Fix #73335.
5725
5726 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5727
5728         Fix #74378
5729         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5730         
5731         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5732         (FieldExpr.DoResolve): Obsolete members are ignored for field
5733         initializers.
5734         
5735 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5736
5737         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5738         of arrays detection.
5739
5740         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5741         verification.
5742         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5743
5744         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5745         arrays report.
5746
5747 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5748
5749         * cs-parser.jay: Use the prefered version of -unsafe in error
5750         message.
5751
5752 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5753
5754         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5755         circumstances.
5756
5757 2005-04-20  John Luke  <john.luke@gmail.com>
5758
5759         * driver.cs: fix typo in error message, --outout to --output
5760
5761 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5762
5763         * codegen.cs (InRefOutArgumentResolving): New field.
5764         
5765         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5766         fields outside contructor.
5767         
5768         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5769         
5770 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5771
5772         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5773         parameter code was not completed ever, so it was not as up-to-date
5774         as local variables.  Must finish it.
5775
5776         The bug fix was to compare the Toplevel of the block, not the
5777         current block.  Thanks for Ben for pointing this out. 
5778
5779 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5780
5781         * decl.cs (AddMethods): Use the declaring type of the problem
5782         method to determine if we want to squash a warning.
5783
5784 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5785
5786         * attribute.cs: Removed debug output.
5787
5788         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5789         
5790         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5791         Report.Stderr.
5792         
5793 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5794
5795         Fix #74481.
5796         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5797         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5798         all null comparisons against reference types.
5799
5800 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5801
5802         Fix# 74565
5803         * class.cs (TypeContainer.CircularDepException) New nested
5804         exception class.
5805         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5806         (TypeContainer.DefineType): Removed error, reset InTransit before
5807         exit.
5808         (Class.DefineType): Throw exception when is in Transit.
5809         Catch exception and report error.
5810         (Struct.DefineType): Throw exception when is in Transit.
5811         Catch exception and report error.
5812         (Interface.DefineType): Throw exception when is in Transit.
5813         Catch exception and report error.
5814
5815         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5816         handle nested exception handlers.
5817
5818         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5819         a catch.
5820
5821         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5822         InFinally and InCatch storage.
5823
5824         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5825         (Catch.Resolve): Set and Restore ec.InCatch.
5826         (Try.Resolve): Set and Restore ec.InFinally.
5827         (Try.HasCatch): True when try has catch.
5828
5829 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5830
5831         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5832           for the same event member, so exclude such cases from warning 419.
5833           Fixed bug #74633.
5834
5835 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5836
5837         * expression.cs (Binary.ResolveOperator): Apply patch from John
5838         Luke to fix bug 59864: operators &, | and ^ on enumerations
5839         require that the same enum type on both sides.
5840
5841         * driver.cs: Add warnings to old flag usage, this is to assist
5842         people who produce Makefiles and hope that the Makefiles will be
5843         used on Windows.
5844
5845         * class.cs (TypeContainer.EmitType): Moved the definition of the
5846         special $PRIVATE$ field from the resolve phase to the Emit phase.
5847         During resolve we do not know if we are a struct with
5848         HasExplicitLayout, we know this only after the attributes for the
5849         type are emitted.
5850
5851         Set the FieldOffset to zero on the dummy field that we create for
5852         the class.   Fixes 74590.
5853
5854 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5855
5856         Fix #73834.
5857         * ecore.cs (PropertyExpr.resolved): New.
5858         (DoResolve): Use it to handle a case of double resolution here.
5859         Handle a case of identical-name-and-type-name.
5860         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5861         resolution by storing the results of expression resolution back
5862         into the "probes" array.
5863
5864 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5865
5866         Fix cs0208-7.cs and cs0208-8.cs.
5867         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5868         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5869         error reporting to point out the reason a struct is not unmanaged.
5870
5871 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5872
5873         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5874           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5875
5876 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5877
5878         Fix #74528.
5879         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5880         IdenticalNameAndTypeName here.
5881         (EventExpr.InstanceResolve): Likewise.
5882
5883 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5884
5885         C# 2.0 DefaultCharSetAttribute implementation
5886         
5887         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5888         which allows us to set GlobalNamespace for every resolve.
5889         (Attribute.ResolveArguments): Cut from Resolve.
5890         (Attribute.GetCharSetValue): Returns CharSet named argument.
5891         (Attribute.DefinePInvokeMethod): Gets default charset from
5892         module settings.
5893         (GlobalAttribute.ResolveAsTypeStep): Override.
5894         (GlobalAttribute.ResolveArguments): Override.
5895         
5896         * class.cs (TypeAttr): Is protected.
5897         
5898         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5899         (ModuleClass.DefaultCharSetType): New memeber.
5900         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5901         
5902         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5903         charset from module.
5904         
5905         * delegate.cs (TypeAttr): Override.
5906         (Delegate.DefineType): Use this TypeAttr.
5907         
5908         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5909         at very early stage (before types are defined) to resolve model
5910         module attributes. It will probably not work with corlib but it
5911         should be ok.
5912         
5913         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5914         charset from module.
5915         
5916         * typemanager.cs (default_charset_type): New type.
5917
5918 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5919
5920         * decl.cs (MemberCache.AddMethods): Don't warn if
5921         System.Object.Finalize has buggy MethodAttributes.
5922
5923         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5924         removed below.
5925
5926 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5927
5928         * doc.cs : detect ambiguous reference to overloaded members.
5929           Fixed bug #71603. MS 1.1 csc does not detect it.
5930
5931 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5932
5933         * doc.cs : delegates must not be referenced with parameters.
5934           Fixed bug #71605.
5935
5936 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5937
5938         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5939
5940 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5941
5942         * driver.cs (MainDriver): Stop processing if the CLS stage found
5943         errors. 
5944
5945         (CompilerCallableEntryPoint.InvokeCompiler): Always
5946         reset after execution;   Take a TextWriter argument for the
5947         output.
5948
5949         * report.cs: Use the error stream instead of hardcoding stderr. 
5950
5951 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5952
5953         * class.cs: Reduce code paths to test, too small of an
5954         optimization to make it worth the extra testing.  Always perform
5955         it. 
5956
5957 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5958
5959         Fix #74510.
5960         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5961         operators that had errors reported on them.
5962
5963 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5964
5965         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5966         argument types.
5967         (Attribute.Resolve): Add named argument type checking.
5968         
5969         * class.cs (FixedField.Define): Use IsPrimitiveType
5970         
5971         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5972         
5973         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5974         unsafe parameter types.
5975         
5976         * statement.cs (Using.ResolveExpression): Add better error description.
5977         
5978         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5979         
5980 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5981
5982         Fix #74484.
5983         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5984         AttributeUsageAttribute in the emitcontext of the attribute class,
5985         not in the emitcontext of the attributable entity it was attached to.
5986         * cs-parser.jay: Use 'current_class', not 'current_container',
5987         when creating a GlobalAttribute.
5988
5989 2005-04-08  Alp Toker  <alp@atoker.com>
5990
5991         * pending.cs: The fix to #58413 failed to compile methods implementing
5992         interfaces with/without params modifiers and vice versa, even though
5993         params modifiers aren't part of the signature. Make the modifier check
5994         less strict as in csc.
5995
5996 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5997             Anoob V E  <projectmonokochi@rediffmail.com>
5998             Harilal P R  <projectmonokochi@rediffmail.com>
5999
6000         Fix #58413.
6001         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
6002         modifiers of pending methods.
6003         (PendingImplementation.PendingImplementation): Initialize it.
6004         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
6005         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
6006         with ParameterData.  Add check for modifiers.
6007         * class.cs (MethodData.Define): Update to changes.
6008
6009 2005-04-07  Raja R Harinath  <rharinath@novell.com>
6010
6011         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
6012
6013 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
6014
6015         * class.cs (PropertyMethod.Define): Check private accessor in abstract
6016         property.
6017         
6018         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
6019         
6020         * rootcontext.cs,
6021         * typemanager.cs: Registered RequiredAttributeAttribute.
6022         
6023 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
6024
6025         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
6026         Warning CS0169 is back at level 3.
6027         (IMethodData.SetMemberIsUsed): New method.
6028         
6029         * decl.cs (IsUsed): New value; moved from FieldBase.Status
6030         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
6031         
6032         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
6033
6034         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
6035         contants.
6036         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
6037         is used.
6038         
6039         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
6040         is used.
6041         
6042         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
6043         to avoid the problems with nested types.
6044
6045 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
6046             Anoob V.E  <projectmonokochi@rediffmail.com>
6047             Harilal P.R  <projectmonokochi@rediffmail.com>
6048             Raja R Harinath  <rharinath@novell.com>
6049
6050         Fix #73820.
6051         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
6052         attribute.
6053         * typemanager (GetConstructor): Make public.
6054
6055 2005-04-05  John Luke  <john.luke@gmail.com>
6056             Raja R Harinath  <rharinath@novell.com>
6057
6058         Fix #62232.
6059         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
6060         struct too.  Return false quicker in a few cases.
6061         (VerifyUnManaged): Use it.
6062
6063 2005-04-05  Raja R Harinath  <rharinath@novell.com>
6064
6065         Fix #74041.
6066         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
6067         not 'unreachable_seen'.
6068
6069 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
6070
6071         * attribute.cs (Attribute.GetValue): Removed unused.
6072         
6073         * codegen.cs (CodeGen.TrimExt): Removed unused.
6074         
6075         * cs-parser.jay (output): Removed unused.
6076         
6077         * cs-tokenizer.cs (hex_digits): Removed unused.
6078         
6079         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6080         
6081         * expression.cs (Indirection.LoadExprValue): Removed unused.
6082         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6083         
6084         * iterators.cs (Iterator.param_types): Removed unused.
6085         
6086         * statement.cs (Goto.block): Removed unused.
6087         (ToplevelBlock.did): Removed unused.
6088         (Switch.ResolveConstantSwitch): Removed unused.
6089
6090 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
6091
6092         * rootcontext.cs: Allow mcs to bootstrap with the compilation
6093         resetting thingy.
6094
6095 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6096
6097         Fix #74232 and cs0208-3.cs.
6098         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6099         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6100         unmanaged type.  Don't use FieldBuilders when 't' is a
6101         TypeBuilder.  Use ModFlags and MemberType fields.
6102         * class.cs (MemberBase.member_type): Rename from MemberType.
6103         (MemberBase.MemberType): New property.  Determines member_type on
6104         demand.
6105         (MemberBase.DoDefine): Don't initialize MemberType here.
6106         (FieldMember.Define): Likewise.
6107
6108 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
6109
6110         Fix #74241
6111         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6112         Attributes are emitted there.
6113         
6114 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6115
6116         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6117         keyword in 'partial enum' too.
6118         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6119         is not allowed).
6120         Report from Kamil Skalski <nazgul@omega.pl>.
6121
6122         Fix #74309.
6123         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6124         have partial containers too.
6125
6126         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6127         in block' checks to Block.CheckInvariantMeaningInBlock.
6128         * statement.cs (Block.GetKnownVariableInfo): Make private.
6129         (Block.IsVariableUsedInChildBlock): Remove.
6130         (Block.IsVariableUsedInBlock): Likewise.
6131         (Block.CheckInvariantMeaningInBlock): New.  Show location of
6132         conflicting declaration.
6133         (Block.AddVariable): Make error messages less long-winded and more
6134         specific.  Show location of conflicting declaration.
6135         * parameter.cs (Parameters.Location): New readonly property.
6136
6137 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6138
6139         Clean up semantics of invoking ResolveMemberAccess.
6140         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
6141         can have an instance, ensure that we pass in a non-TypeExpression
6142         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
6143         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
6144         argument.  Update to changes and simplify.
6145         (FieldExpr.Emitinstance): Remove CS0120 check.
6146         (PropertyExpr.EmitInstance): Likewise.
6147         * expression.cs (Argument.Resolve): Likewise.
6148         (Invocation.DoResolve): Update to changes in semantics of
6149         InstanceExpression.
6150
6151 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
6152
6153         Fix #74241
6154         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
6155         customization.
6156         
6157         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6158
6159 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6160
6161         Fix difference in behaviour with commandline invocation.
6162         * driver.cs (Driver.Reset): New.
6163         (CompilerCallableEntryPoint): Call it.
6164
6165         * statement.cs (If.Resolve): Avoid spurious "uninitialized
6166         variable" warnings if the boolean expression failed to resolve.
6167
6168 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
6169
6170         * attribute.cs: Fix the union of several permissions when some of them
6171         are unrestricted (so the result isn't an unrestricted permission set).
6172         Fix #74036.
6173
6174 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6175
6176         * ecore.cs (MemberExpr): New class.  Convert from interface
6177         IMemberExpr.
6178         (MemberExpr.ResolveMemberAccess): Refactor and move here from
6179         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
6180         error checks.
6181         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6182         (MethodGroupExpr.IsExplicitImpl): Remove.
6183         (Expression.GetFieldFromEvent): Remove.
6184         (SimpleName.MemberStaticCheck): Remove.
6185         (SimpleName.DoSimpleNameResolve): Update to changes.
6186         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6187         (MemberAccess.IdenticalNameAndTypeName): Remove.
6188         (MemberAccess.error176): Move to MemberExpr.
6189         (MemberAccess.DoResolve): Update to changes.
6190         (BaseAccess.DoResolve): Likewise.
6191
6192 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
6193
6194         C# 2.0 Conditional attribute class implementation
6195         
6196         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6197         Analyzes class whether it has attribute which has ConditionalAttribute
6198         and its condition is not defined.
6199         
6200         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6201         (Class.IsExcluded): New method. Search for at least one defined
6202         condition in ConditionalAttribute of attribute class.
6203
6204 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6205
6206         * ecore.cs (PropertyExpr): Derive from Expression, not
6207         ExpressionStatement.
6208         (PropertyExpr.EmitStatement): Remove.
6209
6210 2005-03-29  Raja R Harinath  <rharinath@novell.com>
6211
6212         Fix #74060.
6213         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6214         internal field "value__" of an enum be private.  The examples for
6215         "value__" that I found on MSDN all used FieldAttributes.Private.
6216
6217         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6218         Don't mention IL method attribute names.
6219
6220         Fix #47991.  Remove a TODO.
6221         * statement.cs (Block.Toplevel): Make into a field.
6222         (Block.Parameters): Move into ToplevelBlock.
6223         (Block.known_variables): Rename from child_variable_names.
6224         (Block.Block): Remove variants that take Parameters.  Initialize
6225         'Toplevel' with the immediately surrounding toplevel block.
6226         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
6227         LocalInfo parameter.
6228         (Block.GetKnownVariableInfo): New.
6229         (Block.IsVariableNameUsedInChildBlock): Update.
6230         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
6231         the block, even though it may not be in scope.
6232         (Block.AddVariable): Remove Parameters parameter.  Use
6233         Toplevel.Parameters instead.
6234         (Block.AddConstant): Remove Parameters parameter.
6235         (Block.GetParameterReference): Update to use Toplevel.Parameters.
6236         (Block.IsParamaterReference): Likewise.
6237         (Block.IsLocalParameter): Likewise.  Simplify a lot.
6238         (ToplevelBlock.Parameters): New.  Moved from Block.
6239         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
6240         initialize Parameters to a non-null value.
6241         * cs-parser.jay: Update to changes.
6242         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6243         simple names that mean different things in the same block.  Use
6244         Block.IsVariableNameUsedInBlock.
6245
6246 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6247
6248         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6249         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6250         GetTypeHandle.  It is possible for a reflected type to derive from
6251         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6252         System.Array during mscorlib compilation).
6253         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6254         contain a method_hash, don't create one either.  Don't create a
6255         deep copy of the base cache's method_hash.
6256         (MemberCache.SetupCache): Rename back from DeepCopy.
6257         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6258         already initialized.  If we see an override function, add its
6259         underlying base virtual function to the member_hash too.
6260
6261         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6262
6263 2005-03-26  Raja R Harinath  <harinath@acm.org>
6264
6265         Fix #73038.
6266         * assign.cs (Assign.DoResolve): When the RHS of an assignment
6267         fails to resolve, ensure that the LHS is still resolved as an
6268         lvalue.
6269
6270 2005-03-25  Raja R Harinath  <harinath@acm.org>
6271
6272         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6273         ec.ContainerType.
6274         (Enum.current_ec): Remove.
6275         (Enum.LookupEnumValue): Remove EmitContext argument.
6276         Just uses the one created during DefineType.
6277         (Enum.FindMembers): Update.
6278         * expression.cs (MemberAccess.DoResolve): Update.
6279
6280 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
6281
6282         * assign.cs (Assign.DoResolve): Check for CS1717 when
6283         source and target are same (uses Equals).
6284
6285         * expression.cs (LocalVariableReference, ParameterReference,
6286         This): Implemented Equals, GetHashCode.
6287
6288         * statement.cs (Block.GetParameterReference): Removed useless
6289         local variable.
6290
6291 2005-03-22  Raja R Harinath  <rharinath@novell.com>
6292
6293         Fix cs0128.cs
6294         * statement.cs (Block.AddVariable): Ensure that we skip implicit
6295         blocks before deciding whether the error is cs0136 or cs0128.
6296
6297         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6298         (using_alias_directive, using_namespace_directive): Pass
6299         MemberName, not an expression to Namespace.UsingAlias and
6300         Namespace.Using.
6301         (MakeName): Use the MemberName of the namespace.
6302         * namespace.cs (Namespace.MemberName): New.
6303         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6304         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6305         Likewise.
6306         * decl.cs (MemberName.Name): Make readonly.
6307         (MemberName.FromDotted): New "constructor".
6308         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6309         (MemberCore.Name): Compute from MemberName on demand.
6310         (MemberCore.SetMemberName): Provide a way to change the
6311         MemberName.
6312         (MemberCore.AddToContainer): Don't take a fullname parameter.
6313         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6314         fully qualified name of the container to the member name.
6315         (TypeContainer.AddToTypeContainer): Use a fully qualified name
6316         only if the type is a member of the root container.
6317         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6318         MemberName.Left rather than searching for an embedded ".".
6319         (PartialContainer.CreatePart): Update to changes in RootContext.
6320         (MemberBase.ShortName): Turn into a property.  Use
6321         MemberCore.SetMemberName.
6322         (MemberBase.ExplicitInterfaceName): Remove.
6323         (MemberBase.UpdateMemberName): Remove.
6324         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6325         (PropertyBase.SetMemberName): New override.
6326         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6327         (Tree.GetDecl): New.
6328         (Tree.AllDecls): Rename from Decls.
6329         * attribute.cs, enum.cs, report.cs: Update to changes.
6330         * driver.cs (MainDriver): Use MemberName.FromDotted on
6331         RootContext.MainClass.
6332
6333 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6334
6335         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6336         checks.
6337
6338         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6339
6340 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6341
6342         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6343         property accessor modifiers.
6344
6345         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6346         fixed buffer attribute (CS1716).
6347         (PropertyMethod.HasCustomAccessModifier): When property accessor
6348         has custom modifier.
6349
6350         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6351         modifiers.
6352         (PropertyExpr.DoResolveLValue): Add CS0272.
6353
6354 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6355
6356         * convert.cs: When converting to a pointer, use the proper Conv.U
6357         or Conv.I depending on the source data type.
6358
6359         * cs-tokenizer.cs: Make the size for large decimal constants,
6360         fixes #72957.
6361
6362 2005-03-17  Martin Baulig  <martin@ximian.com>
6363
6364         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6365         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6366
6367 2005-03-17  Martin Baulig  <martin@ximian.com>
6368
6369         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6370         to bool so we can return an error condition.
6371         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6372         returned an error.
6373
6374 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6375
6376         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6377         attributes.
6378
6379 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6380
6381         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6382         Refactor to avoid traversing the list of assemblies, and to avoid
6383         string concatenation.
6384         * typemanager.cs (guid_attr_type): Remove.
6385         (negative_hits, pointers, references): Remove hashes.
6386         (type_hash): New.
6387         (GetConstructedType): New.  Uses type_hash to handle constructed
6388         types (arrays, references, pointers).
6389         (GetReferenceType, GetPointerType): Use it.
6390         (GetNestedType): New.  Uses type_hash to handle nested types of
6391         reflected types.
6392         (LookupType, LookupTypeDirect): Remove.
6393         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6394         'types' hash and LookupTypeReflection directly.
6395         (params_string, params_object): Use GetConstructedType.
6396         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6397         top-level types.
6398         (Namespace.Lookup): Use cached_types.
6399         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6400         provided by old TypeManager.LookupType.
6401         * rootcontext.cs (MakeFQN): Remove.
6402         * decl.cs (DeclSpace.MakeFQN): Likewise.
6403         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6404         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6405         TypeManager.GetConstructedType.
6406         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6407
6408 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
6409
6410         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
6411         indexers.
6412
6413         * cs-parser.jay: Reports CS1527 for any namespace element.
6414
6415         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6416         Added CS0407.
6417
6418         * expression.cs (ParameterReference.IsAssigned): Changed error to
6419         CS0269.
6420         (Error_WrongNumArguments): Moved CS0245 detection here.
6421
6422         * statement.cs (Return.Resolve): Add CS1622 report.
6423
6424 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
6425
6426         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6427
6428 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
6429
6430         * attribute.cs expression.cs: Get rid of some allocations.
6431
6432 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
6433
6434         * doc.cs : just eliminate the latest change.
6435
6436 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6437
6438         * doc.cs : commented out the latest change. It breaks xml-030.cs
6439
6440 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6441
6442         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6443           fail. So invoke CreateType() in FindDocumentedType().
6444
6445 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6446
6447         * cs-tokenizer.cs : added IsKeyword().
6448         * doc.cs : Detect keyword incorrectly used as identifier.
6449           Allow identifiers prefixed by @.
6450
6451 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6452
6453         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6454         It caused exception in namespace resolving (again!).
6455         
6456         * class.cs (Class.ctor): Removed exit.
6457         (PropertyMethod.ctor): ditto.
6458         
6459         * codegen.cs (Codegen.Reset): Reset static data.
6460         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6461         
6462         * cs-tokenizer.cs (Cleanup): Removed.
6463         
6464         * driver.cs (GetSystemDir): Rewrote to one line command.
6465         It caused problem with unloaded dynamic modules.
6466         (UnixParseOption): Removed Exit.
6467         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6468         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6469         Now can be mcs used as library.
6470         
6471         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6472         empty location.
6473         
6474         * location.cs (Reset): Reset static data.
6475         
6476         * namespace.cs (Reset): Reset static data.
6477         
6478         * report.cs (Report.Reset): Reset static data.
6479         
6480         * rootcontext.cs (RootContext.Reset): Reset static data.
6481         
6482         * tree.cs (RootTypes.ctor): Use Location.Null
6483         
6484         * typemanager.cs (TypeManager.Reset): Reset static data.
6485         (CoreLookupType): Removed Exit.
6486         (TypeHandle.Reset): Reset static data.
6487         
6488 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6489
6490         Fix #73516.
6491         * typemanager.cs (ComputeNamespaces): Import namespaces from
6492         referenced modules too.
6493
6494 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6495
6496         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6497         than '.'.
6498
6499 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6500
6501         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6502         enclosing DeclSpace.  This ensures that a name-lookup populates
6503         more caches and there are fewer 'TypeExpression's.  Carve out
6504         nested type lookup into ...
6505         (LookupNestedTypeInHierarchy): ... this.
6506
6507 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6508
6509         Clean up a few partial-class semantics.  
6510         Fixes test-357.cs and cs1618-2.cs.
6511         * cs-parser.jay (struct_declaration): Use 'current_class' as
6512         parent of newly-created struct.  Remove call to Register ().
6513         Use 'pop_current_class' to complete handing the current struct.
6514         (interface_declaration): Likewise.
6515         (class_declaration): Likewise.
6516         (enum_declaration): Use 'current_class' as parent of newly created
6517         enum.
6518         (delegate_declaration): Likewise.
6519         (pop_current_class): New function.  This is used to handle closing
6520         up the 'current_class' and 'current_container', and pointing them
6521         to the enclosing class/container.
6522         (CSharpParser): Initialize 'current_class' too.
6523         * decl.cs (MemberCore): Add check for invariant: a partial
6524         container is not a parsed entity, and thus does not enclose any
6525         parsed members.
6526         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6527         (DeclSpace.BaseTypeExpr): Use it.
6528         (DeclSpace.LookupType): Add check for invariant.
6529         * class.cs (TypeContainer): Add check for invariant: a nested
6530         class should have the same NamespaceEntry as its enclosing class.
6531         (TypeContainer.EmitFieldInitializers): Make virtual.
6532         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6533         MemberCore.
6534         (TypeContainer.Register): Remove.
6535         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6536         null.  Use TypeResolveEmitContext for resolving base types and
6537         interfaces.  Move initialization of Parts.TypeBuilder here from
6538         ...
6539         (TypeContainer.DefineNestedTypes): ... here.
6540         (PartialContainer): Take a Namespace not a NamespaceEntry.
6541         (PartialContainer.Create): Don't use Register.  Call the
6542         appropriate Add... function directly.
6543         (ClassPart): Take both the PartialContainer and the enclosing
6544         class as constructor arguments.
6545         (ClassPart.EmitFieldInitializers): Override.
6546         (ClassPart.PartFindNestedTypes): Remove.
6547         (FieldBase.GetInitializerExpression): Resolve the initializer
6548         expression in the emit context of the enclosing class.
6549         * tree.cs (RootTypes): Remove Register ().
6550         
6551 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6552
6553         * cs-parser.jay: Removed CS0134.
6554         
6555         * driver.cs: Removed CS1901.
6556         
6557         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6558         for predefined types.
6559
6560 2005-03-07  Duncan Mak  <duncan@novell.com>
6561
6562         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6563         well. Fixes bug #73454.
6564
6565 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6566
6567         * cs-tokenizer.cs (xtoken): Add CS1035.
6568         
6569         * class.cs (MethodData.Define): Add CS0683.
6570         (FieldMember.ctor): Add CS0681.
6571
6572 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6573
6574         * ecore.cs (SimpleName.DoResolve): Rename from
6575         SimpleName.DoResolveAllowStatic.
6576         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6577         Pass 'intermediate' flag to MemberStaticCheck.
6578         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6579         of "intermediate" lookups via MemberAccess.
6580         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6581         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6582
6583 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6584
6585         Fix #73394.
6586         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6587         slipped in because of variable names that are identical to a
6588         builtin type's BCL equivalent ('string String;', 'int Int32;').
6589         (PropertyExpr.EmitInstance): Likewise.
6590
6591 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6592
6593         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6594         
6595         * report.cs (warning_ignore_table): Made public.
6596
6597 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6598
6599         Fix #73282.
6600         * class.cs (MethodData.Emit): Pass 'container' to
6601         container.GetObsoleteAttribute instead of 'container.Parent'.
6602
6603 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6604
6605         * cs-parser.jay: Add 1534 error test.
6606
6607         * iterators.cs (Yield.CheckContext): Add error 1629.
6608         (Iterator.ctor): Save unsafe modifier.
6609         (MoveNextMethod.DoEmit): Restore unsafe context.
6610
6611         * namespace.cs (UsingAlias): Better error message.
6612
6613 2005-03-03  Dan Winship  <danw@novell.com>
6614
6615         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6616         the warning message [#73219]
6617
6618 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6619
6620         Fix compile with MCS 1.0.0.0.
6621         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6622         w_restore to not depend on string constant folding.
6623
6624 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6625
6626         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6627         CS0246 check to users who passed 'silent = false'.
6628         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6629         check.
6630         (SimpleName.SimpleNameResolve): Update.
6631         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6632         (MemberAccess.IdenticalNameAndTypeName): Update.
6633         * doc.cs (FindDocumentedTypeNonArray): Update.
6634
6635 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6636
6637         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6638         * parameters.cs (ComputeAndDefineParameters): Remove.
6639         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6640         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6641         Use GetParameterInfo.
6642
6643 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6644
6645         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6646
6647 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6648
6649         Unify DeclSpace.LookupType and DeclSpace.FindType.
6650         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6651         is in charge of defining nested types on demand.
6652         (DeclSpace.LookupType): Use it when the current_type is a
6653         TypeBuilder.  Use LookupTypeDirect for reflected types.
6654         (DeclSpace.FindType): Remove.
6655         (DeclSpace.LookupInterfaceOrClass): Likewise.
6656         (DeclSpace.DefineTypeAndParents): Likewise.
6657         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6658         DeclSpace.LookupType.
6659         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6660         * typemanager.cs (LookupType): Simplify.
6661         (AddUserType): Remove type from negative_hits.
6662         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6663         * class.cs (TypeContainer.FindMembers): Move handling of nested
6664         types ...
6665         (TypeContainer.FindMembers_NestedTypes): ... here.
6666         (TypeContainer.FindNestedType): Implement override.
6667         (ClassPart.FindNestedType): Delegate to PartialContainer.
6668         (ClassPart.PartFindNestedType): Looks up the nested types of the
6669         part alone.
6670
6671 2005-03-02  Martin Baulig  <martin@ximian.com>
6672
6673         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6674         static constructor in static classes.
6675
6676 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6677
6678         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6679         sizeParamIndex is not specified.
6680
6681 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6682
6683         Fix #73117
6684         * report.cs (WarningMessage.IsEnabled): Missing null check.
6685
6686 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6687
6688         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6689         in the fields and not in the properties.
6690
6691 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6692
6693         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6694         fields as well.
6695
6696 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6697
6698         * attribute.cs: Small refactoring (improved robustness).
6699         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6700         (ValidateGuid): Removed.
6701         (Resolve): Removed referenced to above mentioned.
6702         (GetAttributeUsage): Made private and changed to work without
6703         class assistance.
6704         (GetIndexerAttributeValue): Don't crash.
6705         (GetConditionalAttributeValue): Ditto.
6706         (GetClsCompliantAttributeValue): Ditto.
6707         (ExtractSecurityPermissionSet): All attributes exceptions are
6708         error 648.
6709         (GetPropertyValue): New helper.
6710         (GetMethodImplOptions): New method.
6711         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6712         some missing properties.
6713         
6714         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6715         (Method.ApplyAttributeBuilder): Updated.
6716         
6717         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6718         exception.
6719
6720 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6721
6722         Fix #73052.
6723         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6724         non-simple types (array, pointer, reference).
6725
6726 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6727
6728         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6729
6730         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6731         for operators.
6732         (Method.CheckBase): Catch wrong destructor here.
6733         (MethodData.Define): Add errors 550, 668.
6734
6735         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6736
6737         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6738
6739         * pending.cs (VerifyPendingMethods): Add error 551.
6740
6741         * typemanager.cs (CSharpName): Next error report helper.
6742
6743 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6744
6745         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6746         attributes. Removed useless attribute double check.
6747         It saves almost 2MBs for corlib.
6748
6749 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6750
6751         Fix #72924.
6752         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6753         called twice in case of error.
6754
6755 2005-02-23  Chris Toshok  <toshok@ximian.com>
6756
6757         Fix compiler portions of #72827.
6758         * statement.cs (Block.Emit): call Begin/EndScope on the
6759         EmitContext instead of the ILGenerator.
6760
6761         * codegen.cs (EmitContext.BeginScope): new method, call
6762         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6763         we have one.)
6764         (EmitContext.BeginScope): same, but EndScope and CloseScope
6765
6766         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6767         offset and call the superclass's OpenScope(int) with it.
6768         (SymbolWriter.CloseScope): get the current il
6769         offset and call superclass's CloseScope(int) with it.
6770
6771 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6772
6773         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6774         CS1677 for out and ref as well.
6775
6776         * class.cs (Method.Define): Add error CS1599 detection.
6777         
6778         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6779         
6780         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6781         
6782         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6783         
6784         * support.cs.cs (ModifierDesc): New helper method.
6785
6786 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6787             Abin Thomas  <projectmonokochi@rediffmail.com>
6788             Anoob V E  <projectmonokochi@rediffmail.com>
6789             Harilal P R  <projectmonokochi@rediffmail.com>
6790
6791         Fix #57851, #72718.
6792         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6793         MemberLookup (used for error reporting) actually returns a result.
6794         Fix error report number (122, not 112).
6795
6796 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6797             Anoob V E  <projectmonokochi@rediffmail.com>
6798             Harilal P R  <projectmonokochi@rediffmail.com>
6799
6800         Fix #71134.
6801         * pending.cs (PendingImplementation.GetAbstractMethods):
6802         Find NonPublic members too.
6803
6804 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6805
6806         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6807         Fixed error 217.
6808         
6809         * class.cs (MethodCore.CheckMethodAgainstBase):
6810         Add error 239 report.
6811
6812 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6813
6814         Fix #68955.
6815         * expression.cs (Invocation.IsApplicable): Make public.
6816         (Invocation.IsParamsMethodApplicable): Likewise.
6817         * delegate.cs (Delegate.VerifyApplicability): Don't use
6818         Invocation.VerifyArgumentCompat for parameter applicability
6819         testing.  Use Invocation.IsApplicable and
6820         Invocation.IsParamsMethodApplicable.
6821
6822 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6823
6824         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6825         
6826         * class.cs (Operator.Define): Add error 217 report.
6827         
6828 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6829
6830         * namespace.cs (UsingEntry.Resolve): Undo change below.
6831
6832 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6833
6834         Fix #72756.
6835         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6836         disable the error message when the extended MemberLookup also
6837         fails.
6838         (Expression.MemberLookupFinal): Update.
6839         (SimpleName.DoSimpleNameResolve): Update.
6840         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6841         Don't use MemberLookupFinal.
6842         (New.DoResolve): Update.
6843         (BaseAccess.CommonResolve): Update.
6844
6845 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6846
6847         Fix #72732.
6848         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6849         occured previously, don't resolve again.
6850
6851 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6852
6853         Fix #69949
6854         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6855         argument. Call ResolveAttributeUsage for unresolved.
6856         when types doesn't match ctor arguments.
6857         
6858         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6859         for nested attribute classes.
6860         (Class.attribute_usage): Removed.
6861         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6862         for attribute class.
6863         
6864         * ecore.cs (IsAttribute): Removed.
6865         
6866         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6867         
6868         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6869         now normal types.
6870         (attribute_types): Removed.
6871         (EmitCode): Global attributes are emited as the latest.
6872
6873 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6874
6875         * class.cs (EmitFieldInitializers): Don't emit field initializer
6876         for default values when optimilization is on.
6877         
6878         * constant.cs (Constant.IsDefaultValue): New property.
6879         
6880         * driver.cs: Add /optimize handling.
6881         
6882         * constant.cs,
6883         * ecore.cs,
6884         * literal.cs: Implement new IsDefaultValue property.
6885         
6886         * rootcontext.cs (Optimize): New field, holds /optimize option.
6887
6888 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6889
6890         Fix crasher in re-opened #72347.
6891         * namespace.cs (Namespace.Lookup): Return null if
6892         DeclSpace.DefineType returns null.
6893
6894         Fix #72678.
6895         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6896
6897 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6898
6899         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6900         now returns null if it cannot resolve to an lvalue.
6901         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6902         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6903         returned null.  Remove check for SimpleName.
6904         (EventExpr.DoResolveLValue): New.
6905         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6906         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6907         error from ...
6908         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6909         avoid CS0131 error.
6910         (Unary.ResolveOperator): Move CS0211 check ...
6911         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6912         CS0131 error.
6913         (Unary.DoResolveLValue): Simplify.
6914         (AddressOf.DoResolveLValue): New.
6915         (ArrayAccess.DoResolveLValue): New.
6916
6917 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6918
6919         * attribute.cs (Attribute.Resolve): Add arguments casting for
6920         when types doesn't match ctor arguments.
6921
6922 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6923
6924         Fix parts of #63202.
6925         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6926         lookup of operator in base type.  Ensure that all checks happen
6927         when the operator resolves to an "op_..." method.
6928
6929 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6930
6931         Fix #71992.
6932         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6933         'ignore_cs0104' parameter.  Pass it to ...
6934         (NamespaceEntry.Lookup): ... this.
6935         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6936         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6937         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6938         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6939         Update.  Request that cs0104 errors be ignored.
6940         (ComposedCast.ResolveAsTypeStep): Update.
6941
6942 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6943
6944         Fix #59209.
6945         * expression.cs (Invocation.BetterFunction): Remove support for
6946         comparing virtual functions and their overrides.
6947         (Invocation.IsOverride): New.
6948         (Invocation.OverloadResolve): Don't consider 'override' functions
6949         during candidate selection.  Store them in a lookaside list.
6950         If the selected method is a 'virtual' function, use the list to
6951         find any overrides that are closer to the LHS type.
6952
6953 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6954
6955         * expression.cs (New.DoResolve): Add complex core type reduction.
6956         (New.Constantify): Converts complex core type syntax like 'new int ()'
6957         to simple constant.
6958         
6959 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6960
6961         * decl.cs (EntryType.EntryType): New constructor to create an
6962         updated copy of a cache entry.
6963         (MemberCache.AddMethods): Use it.
6964         (MemberCache.ClearDeclaredOnly): Remove.
6965         (MemberCache.MemberCache): Update.
6966
6967 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6968
6969         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6970         variable.  This one is represents the actual low-level declaration
6971         of the method, as opposed to the semantic level `IsStatic'.   
6972
6973         An anonymous method which is hosted into a static method might be
6974         actually an instance method.  IsStatic would reflect the
6975         container, while MethodIsStatic represents the actual code
6976         generated.
6977
6978         * expression.cs (ParameterReference): Use the new MethodIsStatic
6979         instead of IsStatic.
6980
6981         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6982         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6983         set on the current EmitContext. 
6984
6985         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6986         resolve our casted expression as an LValue.  This triggers the
6987         proper LValue processing that is later required by Assign.
6988
6989         This fixes 72347.
6990
6991         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6992
6993 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6994
6995         C# 2.0 Fixed buffer implementation
6996
6997         * anonymous.cs: Update after RegisterHelperClass renaming.
6998
6999         * attribute.cs (AttributeTester.fixed_buffer_cache):
7000         Cache of external fixed buffers.
7001         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
7002         implementation if field is fixed buffer else null.
7003
7004         * class.cs
7005         (TypeContainer.AddField): Accept FieldMember instead of Field.
7006         (FieldBase.IsFieldClsCompliant): Extracted code from
7007         VerifyClsCompliance descendant customization.
7008         (FixedField): New class handles fixed buffer fields.
7009         (FixedFieldExternal): Keeps information about imported fixed
7010         buffer.
7011         (IFixedField): Make access to internal or external fixed buffer
7012         same.
7013
7014         * cs-parser.jay: Add fixed buffer parsing.
7015
7016         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
7017         buffer.
7018
7019         * expression.cs (Indirection): Extended implementation to accept
7020         fixed buffer field.
7021         (PointerArithmetic.Emit): Get element from fixed buffer as well.
7022         (ElementAccess.MakePointerAccess): Get type as parameter.
7023         (DoResolve): Add fixed buffer field expression conversion.
7024         (DoResolveLValue): Ditto.
7025         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
7026         (ArrayPtr): Derives from FixedBufferPtr.
7027         (ArrayPtr.Emit): Add extra emit for array elements.
7028
7029         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
7030
7031         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
7032         for compiler generated types.
7033         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
7034
7035         * statement.cs (Fixed): Refactored to be easier add fixed buffer
7036         and consume less memory.
7037         (Fixed.Resolve): Add fixed buffer case.
7038
7039         * typemanager.cs (compiler_generated_attr_ctor,
7040         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
7041         (HasElementType): Add our own implementation to work on every
7042         runtime.
7043
7044 2005-02-11  Miguel de Icaza  <miguel@novell.com>
7045
7046         * anonymous.cs (CaptureContext): Track whether `this' has been
7047         referenced.   
7048
7049         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
7050         only captured `this' if it was implicitly done (instance
7051         methods/variables were used). 
7052
7053         * codegen.cs (EmitContext.CaptureThis): New method to flag that
7054         `this' must be captured.
7055
7056 2005-01-30  Miguel de Icaza  <miguel@novell.com>
7057  
7058         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
7059         is null it means that there has been no need to capture anything,
7060         so we just create a sibling.
7061
7062         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7063
7064         Just a partial fix.  The other half is fairly elusive.
7065         
7066 2005-02-10  Raja R Harinath  <rharinath@novell.com>
7067
7068         Fix #52586, cs0121-4.cs.
7069         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
7070         and return a hashtable.
7071         (MemberCache.ClearDeclaredOnly): New.
7072         (MemberCache.MemberCache): Update to change.  Make a deep copy of
7073         the method_hash of a base type too.
7074         (MemberCache.AddMethods): Adapt to having a deep copy of the base
7075         type methods.  Overwrite entries with the same MethodHandle so
7076         that the ReflectedType is correct.  The process leaves in base
7077         virtual functions and their overrides as distinct entries.
7078         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
7079         matters since it was boxed in a ArrayList before.
7080         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7081         modifier.
7082         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
7083         case of a virtual function and its override (choose the overload
7084         as better).
7085         (Invocation.OverloadResolve): Avoid 'override' members during
7086         'applicable_type' calculation.
7087
7088 2005-02-09  Raja R Harinath  <rharinath@novell.com>
7089
7090         Combine two near-redundant caches.
7091         * typemanager.cs (method_params): Rename from method_internal_params.
7092         (TypeManager.GetParameterData): New.  Replace
7093         Invocation.GetParameterData.
7094         (TypeManager.LookupParametersByBuilder): Remove.
7095         * expression.cs (Invocation.method_parameter_cache): Remove.
7096         (Invocation.GetParameterData): Remove.
7097         Update to changes.
7098         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7099         Update to changes.
7100
7101 2005-02-08  Raja R Harinath  <rharinath@novell.com>
7102
7103         Fix #72015.
7104         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7105         TypeManager.multicast_delegate_type is null, resolve it by looking
7106         up "System.MulticastDelegate".
7107         * rootcontext.cs (RootContext.ResolveCore): Simplify.
7108
7109 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
7110             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
7111             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
7112
7113         Fix cs0164.cs.
7114         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7115         (LabeledStatement.AddReference): New.  Set 'referenced'.
7116         (Goto.Resolve): Use it.
7117
7118 2005-02-05  John Luke  <john.luke@gmail.com>
7119
7120         * driver.cs: remove duplicate -doc line in Usage ()
7121
7122 2005-02-04  Raja R Harinath  <rharinath@novell.com>
7123
7124         * location.cs (Location.AddFile): Fix CS2002 error report.
7125
7126 2005-02-02  Martin Baulig  <martin@ximian.com>
7127
7128         * delegate.cs (Delegate.DefineType): Report an internal error if
7129         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7130         details.        
7131
7132 2005-02-02  Raja R Harinath  <rharinath@novell.com>
7133
7134         Fix a crasher in a variant of #31984.
7135         * const.cs (Constant.CheckBase): New override that defers the
7136         new-or-override check in case the base type hasn't been populated
7137         yet.
7138         (Constant.Define): Ensure the new-or-override check is performed.
7139
7140 2005-02-01  Duncan Mak  <duncan@ximian.com>
7141
7142         * const.cs (LookupConstantValue): Check that `ce' is not null
7143         before calling GetValue ().
7144
7145 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7146
7147         Fix test-334.cs (#69519).
7148         * cs-parser.jay (using_alias_directive): Pass in an expression to
7149         NamespaceEntry.UsingAlias.
7150         (using_namespace_directive): Pass in an expression to
7151         NamespaceEntry.Using.
7152         (namespace_name): Don't flatten to a string.
7153         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7154         (NamespaceEntry.AliasEntry.Resolve): Lookup using
7155         ResolveAsTypeStep.
7156         (NamespaceEntry.UsingEntry): Likewise.
7157         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7158         changes.
7159         (NamespaceEntry.LookupForUsing): Remove.
7160         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7161         names.
7162         (NamespaceEntry.Lookup): Remove support for dotted names.
7163
7164 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7165
7166         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7167         split into two.
7168         (NamespaceEntry.ImplicitParent): Compute on demand.
7169         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7170         parallels the current.
7171         (NamespaceEntry.LookupForUsing): Use it.
7172         (NamespaceEntry.Lookup): If the current namespace-entry is
7173         implicit, don't search aliases and using tables.
7174
7175 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7176
7177         Fix #31984.
7178         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7179         BaseCache here.
7180         (TypeContainer.BaseCache): Compute on demand.
7181         (TypeContainer.FindMembers): Define constants and types if they're
7182         not already created.
7183         (FieldMember.Define): Move resetting of ec.InUnsafe before error
7184         check.
7185         * const.cs (Constant.Define): Make idempotent.
7186
7187 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7188
7189         * pending.cs: Produce better code (no nops produced by using Ldarg
7190         + value).
7191         
7192         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7193         i - 1' it should be arg + 1.
7194
7195         Fixes bug #71819.
7196
7197 2005-01-28  Raja R Harinath  <rharinath@novell.com>
7198
7199         * attribute.cs (Attribute.CheckAttributeType): Make private
7200         non-virtual.
7201         (Attribute.ResolveType): Make virtual.
7202         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7203         handling of RootContext.Tree.Types.
7204
7205 2005-01-27  Raja R Harinath  <rharinath@novell.com>
7206
7207         Update attribute-handling to use the SimpleName/MemberAccess
7208         mechanisms.
7209         * cs-parser.jay (attribute): Pass in an expression to the
7210         constructors of Attribute and GlobalAttribute.
7211         * attribute.cs (Attribute): Take an expression for the name.
7212         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
7213         passed in attribute name expression.
7214         (Attribute.CheckAttributeType): Use it.
7215         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7216         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7217         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
7218         argument to prevent error messages if the lookup fails.
7219
7220 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
7221
7222         * expression.cs (Indirection): Implemented IVariable interface
7223         to support indirection in AddressOf operator.
7224         (PointerArithmetic.Emit): Add optimalization for case where
7225         result can be precomputed.
7226
7227 2005-01-26  Martin Baulig  <martin@ximian.com>
7228
7229         * class.cs (TypeContainer.AttributeTargets): Return the correct
7230         AttributeTargets depending on our `Kind' instead of throwing an
7231         exception; fixes #71632.
7232
7233 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
7234
7235         Fix #71257
7236         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7237         constant members.
7238
7239 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7240
7241         Fix #71602.
7242         * expression.cs (MemberAccess.DoResolve): Don't complain with
7243         cs0572 when the LHS of a member access has identical name and type
7244         name.
7245
7246 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7247
7248         Fix #71651, #71675
7249         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7250         CreatePermission.
7251         Create custom PermissionSet only for PermissionSetAttribute.
7252
7253 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7254
7255         Fix #71649
7256         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7257         delegates in static class.
7258
7259 2005-01-24  Martin Baulig  <martin@ximian.com>
7260
7261         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7262         merging an implicit block, just use its reachability.
7263
7264         * statement.cs (Block.Resolve): Make the unreachable code check
7265         work wrt. implicit blocks; see test-337 from #63842.
7266
7267 2005-01-21  Alp Toker  <alp@atoker.com>
7268  
7269         * cs-parser.jay: destructor_declaration's container is PartialContainer
7270         not Class when partial types are used, so use Kind prop instead of
7271         'is'.
7272         
7273 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7274
7275         * cs-parser.jay: Improve error reporting when an interface
7276         declares new types.
7277
7278 2005-01-20  Dick Porter  <dick@ximian.com>
7279
7280         * support.cs: SeekableStreamReader fix from Sandor Dobos
7281         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7282         chars are read.  Fixes bug 70369.
7283
7284 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7285
7286         * cs-parser.jay (catch_clause): Simplify current_block handling
7287         somewhat.
7288
7289 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7290
7291         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7292         code with ImplicitStandardConversion to handle the implicit
7293         conversion of method groups into valid delegate invocations. 
7294
7295         The problem is that in parameter handling we were using this code
7296         path.  Fixes bug #64698
7297
7298 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7299
7300         * cs-parser.jay: Fix several infelicities.
7301         - Avoid assigning to the parser value stack.  Code like 
7302           '$3 = null' is unclean.  Synthesize a value for the code block
7303           instead. 
7304         - Avoid using oob_stack for storing location information.  Use ...
7305         (_mark_): ... this.  New (empty) rule.  Saves the current location
7306         in $$.
7307         (foreach_statement): Avoid using oob_stack for current_block
7308         handling.  Use technique used in for_statement and
7309         using_statement.  Synthesize a value for the code block to store
7310         additional intermediate information.
7311
7312 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7313
7314         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7315         of a different type is only allowed to private fields of a
7316         containing type, not on fields of a base class.
7317
7318         See test-174.cs and error cs0122-9.cs
7319
7320 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7321
7322         Fix test-335.cs (bug #58126).
7323         * cs-parser.jay (argument): Split out non-expression parts of the
7324         rule into 'non_simple_argument'.
7325         (invocation_expression): Support parenthesized invocations with
7326         multiple arguments, and with single non-simple arguments.
7327
7328 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7329
7330         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7331         places.
7332
7333 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7334
7335         Fix cs0038-1.cs, cs1640-6.cs.
7336         * ecore.cs (Expression.Resolve): Remove special-case for
7337         SimpleName in error-handling.
7338         (Expression.almostMatchedMembers): Relax access permission to
7339         protected.
7340         (Expression.MemberLookupFailed): Handle duplicates in
7341         almostMatchedMembers list.
7342         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7343         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7344         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7345         overload if the passed in MemberInfo is a MethodBase.
7346
7347 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7348
7349         Fix #70749
7350         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7351         for non-CAS & merge permission sets properly.
7352
7353 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7354
7355         Improve standard-compliance of simple name and member access 
7356         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7357         * ecore.cs (FullNamedExpression): New abstract base class 
7358         for Namespaces and TypeExpressions.
7359         (ResolveFlags.SimpleName): Remove.
7360         (SimpleName): Remove support for dotted names.
7361         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7362         DeclSpace.FindType and DeclSpace.LookupType.
7363         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7364         (Expression.ExprClassName): Make member function.
7365         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7366         a namespace.  Remove creation of dotted "SimpleName"s.
7367         (MemberAccess.DoResolve): Likewise.
7368         * decl.cs (DeclSpace.Cache): Make private.
7369         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7370         (DeclSpace.FindType): Update.
7371         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7372         FullNamedExpression.
7373         * namespace.cs (Namespace): Derive from FullNamedExpression
7374         so that it can be part of expression resolution.
7375         (Namespace.Lookup): Return an FullNamedExpression.
7376         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7377         namespace.
7378         * rootcontext.cs (NamespaceLookup): Remove.
7379         (LookupType): Move to DeclSpace.
7380         * attribute.cs (CheckAttributeType): Update.
7381         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7382         (FindDocumentedTypeNonArray): Likewise.
7383
7384 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7385
7386         Fix cs0509.cs, cs1632.cs.
7387         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7388         is the same as IsInterface.
7389         (TypeContainer.GetClassBases): Likewise.
7390         * statement.cs (LabeledStatement.ig): New field.
7391         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7392         label.
7393         (LabeledStatement.DoEmit): Check that the label was created with
7394         the same ILGenerator.
7395
7396 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7397
7398         Fix #71058
7399         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7400         accessors to its properties.
7401
7402         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7403         from accessors to property.
7404         
7405 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7406
7407         Fix #70722
7408         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7409         only for overrides.
7410         
7411 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
7412
7413         * attribute.cs: Check for null and empty strings.  
7414
7415         I have lost another battle to Paolo.
7416
7417 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
7418
7419         Fix #70942
7420         * class.cs (PropertyMethod): Set Parent field in ctors.
7421         (SetMethod.InternalParameters): Add unsafe switch hack.
7422         Override MarkForDuplicationCheck where it is appropriate.
7423
7424         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7425         It says whether container allows members with the same name.
7426         Base default is no.
7427         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7428         Removed is_method parameter.
7429
7430 2005-01-06  Duncan Mak  <duncan@ximian.com>
7431
7432         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7433         because the previous change led to incorrect reporting of CS1032
7434         ("Cannot define/undefine preprocessor symbols after first token in
7435         file"). Instead of using `tokens_seen' as the only flag that
7436         triggers CS1040, introduce `comments_seen'. This new flag is used
7437         to signify having seen comments on the current line, so it is
7438         unset after a newline.
7439
7440 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7441
7442         * doc.cs : When searching for a type, find nested type too.
7443           This fixes bug #71040.
7444
7445 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7446
7447         * doc.cs :
7448           - Warn missing member comment on those classes which also does not
7449             have doc comments. Fixed bug #71041.
7450           - Don't warn missing doc comment on default constructor.
7451             Fixed bug #71042.
7452
7453 2005-01-06  Duncan Mak  <duncan@ximian.com>
7454
7455         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7456         comments, set `tokens_seen' to true. This allows us to detect
7457         misplaced preprocessor directives (i.e. not at the beginning of
7458         the a line, nor after whitespaces). In that case, report error
7459         CS1040. This fixes bug #56460.
7460
7461         * cs-parser.jay (interface_member_declaration): Add checks for
7462         IsExplicitImpl, and report CS0541 error if an interface member is
7463         defined as an explicit interface declaration.
7464
7465 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7466
7467         Fix #70817
7468         * class.cs (PropertyMethod): Set Parent field in ctors.
7469         (SetMethod.InternalParameters): Add unsafe switch hack.
7470         
7471         * decl.cs (MemberCore.Parent): Cannot be readonly.
7472
7473 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7474
7475         * decl.cs (DeclSpace.ResolveType): Remove.
7476         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7477         Merge in code from ...
7478         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7479         * class.cs, enum.cs: Update to changes.
7480
7481 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7482
7483         * anonymous.cs: Ensure that we init the scope of our parent if it
7484         has not been initialized yet.
7485
7486 2004-12-30  Duncan Mak  <duncan@ximian.com>
7487
7488         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7489         if field.FieldBuilder is null. Fixes #70758.
7490
7491         * convert.cs: Fixed some typos and updated some of the comments.
7492         (ImplicitStandardConversionExists):
7493         (TryImplicitIntConversion): If `target_type' is an interface and
7494         the type of `ic' implements this interface, return true or a new
7495         BoxedCast instead of null. This fixes #70468.
7496
7497 2004-12-29  Duncan Mak  <duncan@ximian.com>
7498
7499         * expression.cs (Argument.Emit): Check that Expr is
7500         IMemoryLocation before casting to it, and report CS1510 otherwise.
7501
7502         This fixes #70402.
7503
7504 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7505
7506         * statement.cs (Block.ThisVariable): remove the recursion here, to
7507         make the --profile more sane.
7508
7509 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7510
7511         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7512         assembly, by JB Evain.
7513
7514 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7515
7516         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7517           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7518         "parent" refers to enclosing type/class.  "base" refers to superclass.
7519
7520 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7521
7522         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7523         Ensure that we only have GlobalAttributes.
7524         * attribute.cs (Attribute.Emit): Make non-virtual.
7525         (GlobalAttribute.Emit): Remove.
7526         (Attribute.Resolve): Make virtual.
7527         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7528         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7529         the argument. Don't create one.
7530         (Attribute.GetObsoleteAttribute): Likewise.
7531         (Attribute.GetClsCompliantAttributeValue): Likewise.
7532         * class.cs, decl.cs: Update to changes.
7533
7534 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7535
7536         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7537         
7538         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7539         
7540         * statement.cs (Foreach.Resolve): Add error 186 report.
7541
7542 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7543
7544         * expression.cs (Conditional.DoResolve): Add warning 429.
7545         
7546         * statement.cs (If.Resolve): Add warning 665.
7547
7548 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7549
7550         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7551         except when in the parser, and in GlobalAttribute.
7552         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7553         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7554         RootContext.Tree.Types.NamespaceEntry once work is done.
7555         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7556         and resets RootContext.Tree.Types.NamespaceEntry.
7557
7558 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7559
7560         * cs-parser.jay: Don't create a block for every variable.
7561
7562 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7563
7564         * location.cs: Provide extra information.
7565
7566         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7567         variables from the captured environment, it is the ldarg_0.
7568
7569 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7570
7571         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7572         find a conclusion.
7573         
7574         * class.cs: Changed warning level for 169 to avoid developer
7575         displeasure from warning flooding. It will be changed back when they
7576         fix most of current BCL warnings.
7577         
7578         * RootContext.cs: Pushed default WarningLevel to 3.
7579         
7580         * statement.cs: Removed unused variable.
7581
7582 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7583
7584         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7585         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7586         Add error 502 report.
7587         (StaticClass.DefineType): Add error 441 report.
7588         (Class.AllowedModifiersProp): New virtual property as temporary
7589         extension to AllowedModifiers.
7590         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7591         to share implementation with StaticClass and don't call virtual
7592         methods from ctor.
7593         
7594         * driver.cs (MainDriver): Add error 1558 test.
7595
7596         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7597         report. Moved error 36 test here.
7598
7599         * statement.cs (Throw.Resolve): Add error 724 report.
7600
7601         * typemanager.cs: Add out_attribute_type core type.
7602         
7603 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7604
7605         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7606         3018 report.
7607         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7608
7609         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7610         3017 report.
7611         
7612         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7613
7614         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7615         Add error 3023 report.
7616         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7617
7618         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7619         implementation.
7620
7621 2004-12-12  John Luke  <john.luke@gmail.com>
7622
7623         * driver.cs (AddArgs): take -- into account when
7624         adding arguments, fixes bug 65710 
7625
7626 2004-12-12  Martin Baulig  <martin@ximian.com>
7627
7628         * expression.cs (Unary.TryReduceNegative): Added support for
7629         SByteConstant and ByteConstant.
7630         (Unary.Reduce): Check error values from TryReduceNegative().
7631
7632 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7633
7634         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7635         and report exception as error 182.
7636
7637 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7638
7639         * driver.cs (Main): Fix message when there are warnings.
7640
7641 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7642
7643         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7644
7645 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7646
7647         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7648         Reduced number of warnings.
7649         
7650         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7651
7652 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7653
7654         * driver.cs: Removed message.
7655
7656         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7657
7658 2004-12-08    <vargaz@freemail.hu>
7659
7660         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7661
7662 2004-12-08  Martin Baulig  <martin@ximian.com>
7663
7664         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7665         instead of a CS3002 for properties and indexer.
7666
7667 2004-12-08  Martin Baulig  <martin@ximian.com>
7668
7669         * decl.cs (MemberName.ToString): Make this work again.
7670
7671 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7672
7673         * attribute.cs (Resolve): Add error 591 detection.
7674
7675         * class.cs (FieldMember.Define): Add error 1547 detection.
7676         (Indexer.Define): Add error 620 detection.
7677         (Operator.Define): Add error 590 detection.
7678
7679         * ecore.cs: Missing argument for error 79.
7680
7681         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7682         detection.
7683
7684 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7685
7686         Fix #70106
7687         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7688         only.
7689
7690 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7691
7692         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7693           Some operator comments were suppressed.
7694         * doc.cs : Implicit/explicit operator name in doc comments are like
7695           "op_Explicit(type)~returnType", so added suffix handling.
7696
7697 2004-12-07  Martin Baulig  <martin@ximian.com>
7698
7699         * decl.cs
7700         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7701         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7702         (DeclSpace.ec): New protected field; store the EmitContext here.
7703         (DeclSpace.EmitContext): New public property; moved here from
7704         `TypeContainer'.
7705         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7706         EmitContext.
7707
7708         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7709         (Enum.Emit): Don't create a new EmitContext.
7710
7711         * delegate.cs (Delegate.DefineType): Always create the
7712         EmitContext.
7713
7714         * iterators.cs (Iterators.DefineIterator): Create a new
7715         EmitContext and store it in `ec'.
7716
7717 2004-08-24  Martin Baulig  <martin@ximian.com>
7718
7719         * typemanager.cs
7720         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7721         this for accessibility checks.
7722         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7723         IsNestedFamilyAccessible.
7724         (TypeManager.IsSubclassOf): New method, do what the name actually
7725         says.   
7726
7727 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7728
7729         Fix crash on cs0657-17.cs.
7730         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7731         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7732         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7733         the case where the NamespaceEntry gets overwritten.
7734
7735 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7736
7737         Fixed #69195, #56821
7738         * ecore.cs (ResolveBoolean): Tiny refactoring.
7739
7740         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7741         of right expression resolving when left is false constant and
7742         operator is LogicalAnd OR true constant and operator is LogicalOr.
7743
7744         * statement.cs (ResolveUnreachable): Always reports warning.
7745
7746 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7747
7748         * class.cs: Distinguish between 1721 and 1722 (just a little help
7749         for the programmer).
7750
7751 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7752
7753         * delegate.cs: Only allow this on new versions of the language. 
7754
7755 2004-12-02  Duncan Mak  <duncan@ximian.com>
7756
7757         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7758         Expression class.
7759         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7760         here as a static method. Take an additional bool out parameter
7761         `must_do_cs1540_check' for signaling to InstanceResolve.
7762         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7763         member field from PropertyExpr class and made it an argument of
7764         the method instead.
7765         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7766         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7767         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7768         and `remove_accessor' as well as InstanceResolve: report CS0122
7769         where applicable.
7770
7771         Fixes #70129.
7772
7773 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7774
7775         Fix test-327.cs, test-328.cs, and put in early infrastructure
7776         for eventually fixing #52697.
7777         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7778         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7779         from other methods.
7780         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7781         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7782         (VerifyUsing, error246): Update.
7783         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7784         'NamespaceEntry.LookupNamespaceOrType'.
7785
7786 2004-12-03  Martin Baulig  <martin@ximian.com>
7787
7788         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7789         method as our child, call AnonymousMethod.Compatible() on it.
7790
7791 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7792
7793         Disable XML documentation support in 'basic' profile.
7794         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7795         Redirect XmlElement to System.Object.
7796         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7797         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7798         * mcs.exe.sources: Add doc-bootstrap.cs.
7799         * doc-bootstrap.cs: New file.  Contains empty stub implementation
7800         of doc.cs.
7801
7802 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7803
7804         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7805           comments are allowed.
7806
7807 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7808
7809         * delegate.cs: Add checks for subtypes in paramaters and return values
7810         in VerifyMethod () to add support for Covariance/Contravariance
7811         in delegates.
7812         
7813 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7814
7815         * report.cs: Remove extra closing parenthesis.
7816
7817         * convert.cs (Error_CannotImplicitConversion): If the name of the
7818         types are the same, provide some extra information.
7819
7820         * class.cs (FieldBase): Use an unused bit field from the field to
7821         encode the `has_offset' property from the FieldMember.  This saves
7822         a couple of Ks on bootstrap compilation.
7823
7824         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7825         method as our child, return the AnonymousMethod resolved
7826         expression.
7827
7828         * expression.cs (New.DoResolve): Allow return values from
7829         NewDelegate to also include AnonymousMethods.
7830
7831         Fixes #70150.
7832
7833 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7834
7835         Fix bug #70102
7836         * attribute.cs (Resolve): Improved implementation of params
7837         attribute arguments.
7838
7839         * support.cs (ParameterData): Add HasParams to be faster.
7840
7841 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7842
7843         all things are for /doc support:
7844
7845         * doc.cs: new file that supports XML documentation generation.
7846         * mcs.exe.sources: added doc.cs.
7847         * driver.cs:
7848           Handle /doc command line option.
7849           Report error 2006 instead of 5 for missing file name for /doc.
7850           Generate XML documentation when required, after type resolution.
7851         * cs-tokenizer.cs:
7852           Added support for picking up documentation (/// and /** ... */),
7853           including a new XmlCommentState enumeration.
7854         * cs-parser.jay:
7855           Added lines to fill Documentation element for field, constant,
7856           property, indexer, method, constructor, destructor, operator, event
7857           and class, struct, interface, delegate, enum.
7858           Added lines to warn incorrect comment.
7859         * rootcontext.cs :
7860           Added Documentation field (passed only when /doc was specified).
7861         * decl.cs:
7862           Added DocComment, DocCommentHeader, GenerateDocComment() and
7863           OnGenerateDocComment() and some supporting private members for
7864           /doc feature to MemberCore.
7865         * class.cs:
7866           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7867         * delegate.cs:
7868           Added overriden DocCommentHeader.
7869         * enum.cs:
7870           Added overriden DocCommentHeader and GenerateDocComment().
7871
7872 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7873
7874         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7875         unwrapping the enumeration values, chain to
7876         DoConstantNumericPromotions again, so we can promote things to the
7877         fundamental types (takes care of enums that are bytes, sbytes).
7878
7879         Fixes bug #62054.
7880
7881 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7882
7883         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7884         Fix long-standing bug in type-lookup.  Use FindType instead of
7885         LookupType when ec.ResolvingTypeTree.
7886         (Attribute.ResolveType, Attribute.Resolve)
7887         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7888         Update to changes.
7889         (Attributes.Search): Remove internal version.  Update.
7890         (Attributes.SearchMulti): Update.
7891         (Attributes.GetClsCompliantAttribute): Remove.
7892         (Attributes.GetIndexerNameAttribute): Remove.
7893         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7894         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7895         * class.cs (Indexer.Define): Likewise.
7896
7897 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7898
7899         Fix bug #68790
7900         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7901         MarshallByReference members access.
7902
7903         * expression.cs: Use CheckMarshallByRefAccess;
7904         Better error CS0197 message.
7905
7906         * report.cs: Print whole related error message.
7907
7908 2004-11-30  Raja R Harinath  <rharinath@novell.com>
7909
7910         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7911         the current directory to help debugging.
7912
7913 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7914
7915         * class (GetClassBases): Better error 60 report.
7916         (EventProperty): Disabled warning 67 detection.
7917
7918 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7919
7920         Fix bug #60324
7921         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7922
7923         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7924         precise values.
7925
7926 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7927
7928         Fix bug #49488
7929         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7930
7931         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7932
7933 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7934
7935         * attribute.cs (Attribute.Resolve): Refine error reporting and
7936         report a cs0117 if the identifier does not exist, to distinguish
7937         from 0617 which is a miss-use of the actual identifier.
7938
7939         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7940         between cs0070 and cs0079.
7941
7942         * class.cs (MemberBase.DoDefine): When reporting a wrong
7943         accessibility level, we use MethodCore to compare instead of
7944         Method (this was a regression in some refactoring effort).
7945
7946         So now we correctly report cs0056 again.
7947
7948         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7949         testing the target_type (which was known to be object_type) and
7950         not the source type (which is anonymous_method).
7951
7952         Fixed reporting of error cs1660.
7953
7954         * expression.cs (UserCast.Source): Expose the underlying cast.
7955
7956         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7957         allowed types to find a match to int32 first (most common).
7958
7959         In addition, it ignores any ImplicitUserConversions that did an
7960         internal implicit conversion (as the switch statement allows only
7961         one integral conversion to exist).
7962
7963         * class.cs (PartialContainer.Create): rename `name' to
7964         `member_name' for clarity.  Then replace the string calls with a
7965         call to MemberName.GetPartialName, as now using
7966         MemberName.ToString is an error (this is due to the side effects
7967         it had, that were fixed in the past).
7968
7969         This will restore the error reporting on a number of partial class
7970         errors that were missusing this (and getting an exception as a
7971         results, which is now just a plain textual warning, because
7972         yyparse debug output would crash otherwise).
7973
7974 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7975
7976         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7977
7978 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7979
7980         * rootcontext.cs (LookupType): Make sure to cache lookups that
7981         don't give us a negative result. This saves about 5% of corlib
7982         compilation time.
7983
7984 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7985
7986         * report.cs (AbstractMessage.Print): messages are sent to stderr
7987
7988         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7989         non-interface in the list of interfaces (at this point, either
7990         parent was properly set, or a base class is being listed in the
7991         interfaces section).
7992
7993         This flags error 1722, and resolves the crash from bug 69259.
7994
7995 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7996
7997         * statement.cs (Using.EmitExpressionFinally): make this work right
7998         for valuetypes. Fixes 69926.
7999
8000 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8001
8002         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8003         converted to an enum" here, before we try to change the underlying
8004         type.  This code exists, but it is a different code path than the
8005         one used while encoding constants.
8006
8007         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8008         old bug: when converting from the null literal to a pointer,
8009         return an EmptyCast, not the NullLiteral.
8010
8011         This fixes #69921, the recent null_type changes probably made this
8012         bug more prominent.
8013
8014         (ImplicitReferenceConversionExists): In addition, resynchronized
8015         the code here, so it matches the same code in
8016         ImplicitReferenceConversionExists for the `from any class-type S
8017         to any interface-type T'.
8018         
8019
8020 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8021
8022         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8023
8024 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8025
8026         * cs-parser.jay: Use verbosity accordingly. 
8027
8028 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8029
8030         * expression.cs (Unary.ResolveOperator): Do not report warning;
8031         AddressOf reads from variable.
8032         
8033         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8034
8035 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8036
8037         Fix bug #69462
8038
8039         * attribute.cs (Attributable): Removed CheckTargets.
8040         (Attributes.Emit): Explicit attribute targets are tested here.
8041
8042         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8043         not enabled for interfaces.
8044
8045         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8046         (GetAssemblyName): Ouch next bug there.
8047
8048 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8049
8050         * expression.cs: Error 275 added.
8051         
8052 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8053
8054         Fix bug #69177 (Implemented decimal constant support)
8055
8056         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8057         (BinaryFold): Add DecimalConstant.
8058
8059         * const.cs (Define): Decimal constant 
8060         (is not constant.
8061         (ChangeType): Add decimal type handling.
8062         (LookupConstantValue): Don't set value for decimal type but
8063         emit DecimalConstantAttribute. Needed for constant optimization.
8064
8065         * constant.cs (ToDecimal): New method.
8066         (ConvertToDecimal): New method.
8067         (IntConstant): Implemented ConvertToDecimal.
8068         (DecimalConstant.Emit): Emit optimized version for decimals in
8069         int range.
8070
8071         * expression.cs (ResolveOperator): Changed order of constant
8072         reduction to work correctly with native types which have
8073         overloaded operators.
8074         (ResolveMemberAccess): Extract constant value from attribute
8075         for decimal type.
8076
8077         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8078
8079         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8080         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8081         (ChangeType): Decimal is special.
8082         (TypeToCoreType): Add decimal type.
8083
8084 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8085
8086         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8087         decimal types.
8088
8089 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8090
8091         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8092         test cs1667-5.cs.
8093
8094 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8095
8096         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8097
8098         * pending.cs (PendingImplementation): Grab only interfaces.
8099
8100 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8101
8102         * statement.cs (ForeachHelperMethods): Add location member and
8103         error 202 detection.
8104
8105 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8106
8107         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
8108         automatically handled by executable.make.
8109         (PROGRAM): Make profile-specific.
8110
8111 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8112
8113         * expression.cs (DoResolveBase): Fixed wrong warning for out
8114         variables.
8115
8116 2004-11-18  Martin Baulig  <martin@ximian.com>
8117
8118         Merged latest changes into gmcs.  Please keep this comment in
8119         here, it makes it easier for me to see what changed in MCS since
8120         the last time I merged.
8121
8122 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8123
8124         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8125         (TypeHandle.GetMemberCache): New.
8126         (TypeHandle.TypeHandle): Update.
8127         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8128         (TypeManager.LookupParentInterfacesCache):
8129         Rename from LookupInterfaceCache.  Optimize slightly.
8130         (TypeManager.MemberLookup_FindMembers): Update.
8131         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8132         multi-type variant.
8133         (AddCacheContents): Rename from AddHashtable.
8134         * class.cs (TypeContainer.parent_container): Remove.
8135         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8136         (TypeContainer.DoDefineMembers): Don't initialize it.
8137         Update to name changes.
8138         
8139 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8140
8141         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8142         that factors the code to check access modifiers on override.  
8143
8144         (PropertyBase): Use the code here.
8145
8146         Patch from Lluis S'anchez, fixes bug #69361.
8147
8148 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8149
8150         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8151         routine that is used to report the use of a captured variable
8152         whose address has been taken.
8153
8154         There are two checks: one when variables are being captured and
8155         the other check is when the address of a variable is taken. 
8156         
8157         (because an anonymous methods might be resolved before *or* after
8158         the address has been taken) and 
8159
8160         * expression.cs (Conditional.DoResolve): Remove the special
8161         casing that Martin added to trueExpr and falseExpr being both
8162         NullLiteral.  We get the right behavior now just by introducing
8163         the null_type into the compiler. 
8164
8165         * convert.cs (ExplicitConversion): Change the code to use
8166         null_type instead of testing `expr is NullLiteral'.
8167         (ImplicitConversionStandard): use null_type too.
8168         (ImplicitReferenceConversionExists): use null_type too.
8169         (ImplicitReferenceConversion): use null_type too.
8170
8171         * literal.cs: The type of `NullLiteral' is now null_type instead
8172         of object_type. 
8173         (Resolve): Set the type here.
8174
8175         * typemanager.cs: Introduce null_type.
8176
8177 2004-11-17  Martin Baulig  <martin@ximian.com>
8178
8179         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8180         direction, like FindMembers() does.  Fixes #69546, testcase is in
8181         test-315.cs.    
8182
8183 2004-11-16  Martin Baulig  <martin@ximian.com>
8184
8185         This is based on a patch from Marek Safar, see bug #69082.
8186         Fixes bugs #63705 and #67130.
8187
8188         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8189         method; create a MemberCache for an interface type and cache the
8190         result.
8191
8192         * decl.cs (IMemberContainer.ParentContainer): Removed.
8193         (IMemberContainer.ParentCache): New property.
8194         (MemberCache.SetupCacheForInterface): Removed.
8195         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8196         to create a cache for an interface's "parent".
8197
8198         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8199         interfaces too.
8200
8201 2004-11-16  Martin Baulig  <martin@ximian.com>
8202
8203         Merged back from gmcs; these changes already went into gmcs a
8204         couple of weeks ago.
8205
8206         * typemanager.cs
8207         (TypeManager.AddUserType): Removed the `ifaces' argument.
8208         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
8209         `TypeExpr []'.
8210         (TypeManager.AddUserInterface): Removed.
8211         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
8212         `TypeExpr []'.
8213         (TypeManager.GetInterfaces): Likewise.
8214         (TypeManager.GetExplicitInterfaces): Likewise.
8215
8216         * ecore.cs (TypeExpr.GetInterfaces): Removed.
8217
8218         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
8219         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
8220
8221 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8222
8223         * statement.cs: Avoid adding bools to a hashtable.
8224
8225 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8226
8227         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8228         calling an unsafe method from a safe location.
8229
8230 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8231
8232         Fix #69167
8233         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8234
8235 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8236
8237         * namespace.cs (VerifyUsing): use GetPartialName instead of
8238         ToString. 
8239
8240 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8241
8242         * statement.cs (Return.Resolve): Fix regression in typo: if
8243         `in_exc', we have to request a NeedReturnLabel, this was a typo
8244         introduced in the anonymous method check-in.  Fixes #69131.
8245
8246         * Indexers were using the ShortName when defining themselves,
8247         causing a regression in the compiler bootstrap when applying the
8248         patch from 2004-11-02 (first part), now they use their full name
8249         and the bug is gone.
8250
8251 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8252
8253         * driver.cs: Strip the path from the names of embedded resources. Fixes
8254         #68519.
8255
8256 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8257
8258         Fix error message regression: cs0104-2.cs.
8259         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8260         (AliasEntry.Resolve): Update.
8261         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8262         'silent' flag.
8263         (RootContext.LookupType): Update.
8264
8265 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8266
8267         * cs-parser.jay: Add support for handling accessor modifiers
8268         * class: Add support port accessor modifiers and error checking,
8269         define PropertyMethod.Define as virtual (not abstract anymore)
8270         * ecore.cs: Add checking for proeprties access with access modifiers
8271         * iterators.cs: Modify Accessor constructor call based in the modified
8272         constructor
8273 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8274
8275         * expression.cs (StringConcat): Handle being called twice,
8276         as when we have a concat in a field init with more than two
8277         ctors in the class
8278
8279 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8280
8281         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8282         special case explicit implementations, we should always produce
8283         the .property or .event declaration.
8284         
8285         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8286         since it will not return correct data if people use this
8287         unresolved in the presence of using statements (see test-313).
8288
8289         * class.cs (MethodData.Define): If we are an explicit interface
8290         implementation, set the method name to the full name of the
8291         interface plus the name of the method.  
8292
8293         Notice that using the method.MethodName.GetFullName() does not
8294         work, as it will only contain the name as declared on the source
8295         file (it can be a shorthand in the presence of using statements)
8296         and not the fully qualifed type name, for example:
8297
8298         using System;
8299
8300         class D : ICloneable {
8301                 object ICloneable.Clone ()  {
8302                 }
8303         }
8304
8305         Would produce a method called `ICloneable.Clone' instead of
8306         `System.ICloneable.Clone'.
8307
8308         * namespace.cs (Alias.Resolve): Use GetPartialName.
8309         
8310 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8311
8312         * cs-parser.jay: Add error 1055 report.
8313
8314 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8315
8316         * assign.cs (Assign.DoResolve): Only do the transform of
8317         assignment into a New if the types are compatible, if not, fall
8318         through and let the implicit code deal with the errors and with
8319         the necessary conversions. 
8320
8321 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8322
8323         * cs-parser.jay: Add error 1031 report.
8324
8325         * cs-tokenizer.cs: Add location for error 1038.
8326
8327 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8328
8329         * cs-parser.jay: Add error 1016 report.
8330
8331 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8332
8333         * cs-parser.jay: Add errors 1575,1611 report.
8334
8335 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8336
8337         * cs-parser.jay: Add error 1001 report.
8338
8339 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8340
8341         Fix #68850
8342         * attribute.cs (GetMarshal): Add method argument for
8343         caller identification.
8344
8345         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8346         agument for GetMarshal and RuntimeMissingSupport.
8347
8348 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8349
8350         * attribute.cs (ExtractSecurityPermissionSet): Removed
8351         TypeManager.code_access_permission_type.
8352
8353         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8354
8355 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8356
8357         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8358         for obsolete use of a variable here.   Fixes regression on errors
8359         cs0619-25 and cs0619-26.
8360
8361 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8362
8363         Fix #62358, implemented security attribute encoding.
8364
8365         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8366         Tests permitted SecurityAction for assembly or other types.
8367         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8368         data from SecurityPermissionAttribute to PermisionSet class.
8369
8370         * class.cs (ApplyAttributeBuilder): Added special handling
8371         for System.Security.Permissions.SecurityAttribute based types.
8372
8373         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8374         special handling for System.Security.Permissions.SecurityAttribute
8375         based types.
8376
8377         * enum.cs (ApplyAttributeBuilder): Added special handling
8378         for System.Security.Permissions.SecurityAttribute based types.
8379
8380         * parameter.cs (ApplyAttributeBuilder): Added special handling
8381         for System.Security.Permissions.SecurityAttribute based types.
8382
8383         * rootcontext.cs: Next 2 core types.
8384
8385         * typemanager.cs (TypeManager.security_permission_attr_type):
8386         Built in type for the SecurityPermission Attribute.
8387         (code_access_permission_type): Build in type.
8388
8389 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8390
8391         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8392         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8393         all of this information into
8394         EmitContext.EmitCapturedVariableInstance.
8395         
8396         * codegen.cs (EmitCapturedVariableInstance): move here the
8397         funcionality of emitting an ldarg.0 in the presence of a
8398         remapping.   This centralizes the instance emit code.
8399
8400         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8401         then emit a load of this: it means that we have reached the
8402         topmost ScopeInfo: the one that contains the pointer to the
8403         instance of the class hosting the anonymous method.
8404
8405         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8406         captures to the topmost CaptureContext.
8407
8408 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8409
8410         * expression.cs (LocalVariableReference): Move the knowledge about
8411         the iterators into codegen's EmitCapturedVariableInstance.
8412
8413 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8414
8415         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8416         all code paths return a value from an anonymous method (it is the
8417         same as the 161 error, but for anonymous methods).
8418
8419 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8420
8421         The introduction of anonymous methods in the compiler changed
8422         various ways of doing things in the compiler.  The most
8423         significant one is the hard split between the resolution phase
8424         and the emission phases of the compiler.
8425
8426         For instance, routines that referenced local variables no
8427         longer can safely create temporary variables during the
8428         resolution phase: they must do so from the emission phase,
8429         since the variable might have been "captured", hence access to
8430         it can not be done with the local-variable operations from the runtime.
8431         
8432         * statement.cs 
8433
8434         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8435         is a toplevel block.
8436
8437         (ToplevelBlock): A new kind of Block, these are the blocks that
8438         are created by the parser for all toplevel method bodies.  These
8439         include methods, accessors and anonymous methods.
8440
8441         These contain some extra information not found in regular blocks:
8442         A pointer to an optional CaptureContext (for tracking captured
8443         local variables and parameters).  A pointer to the parent
8444         ToplevelBlock.
8445         
8446         (Return.Resolve): Catch missmatches when returning a value from an
8447         anonymous method (error 1662).
8448         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8449         phase.
8450
8451         (Break.Resolve): ditto.
8452
8453         (SwitchLabel): instead of defining the labels during the
8454         resolution phase, we now turned the public ILLabel and ILLabelCode
8455         labels into methods called GetILLabelCode() and GetILLabel() that
8456         only define the label during the Emit phase.
8457
8458         (GotoCase): Track the SwitchLabel instead of the computed label
8459         (its contained therein).  Emit the code by using
8460         SwitchLabel.GetILLabelCode ().
8461
8462         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8463         whether the Local has been captured or not.
8464
8465         (LocalInfo.IsCaptured): New property, used to tell whether the
8466         local has been captured.
8467         
8468         * anonymous.cs: Vastly updated to contain the anonymous method
8469         support.
8470
8471         The main classes here are: CaptureContext which tracks any
8472         captured information for a toplevel block and ScopeInfo used to
8473         track the activation frames for various local variables.   
8474
8475         Each toplevel block has an optional capture context associated
8476         with it.  When a method contains an anonymous method both the
8477         toplevel method and the anonymous method will create a capture
8478         context.   When variables or parameters are captured, they are
8479         recorded on the CaptureContext that owns them, for example:
8480
8481         void Demo () {
8482              int a;
8483              MyDelegate d = delegate {
8484                  a = 1;
8485              }
8486         }
8487
8488         Here `a' will be recorded as captured on the toplevel
8489         CapturedContext, the inner captured context will not have anything
8490         (it will only have data if local variables or parameters from it
8491         are captured in a nested anonymous method.
8492
8493         The ScopeInfo is used to track the activation frames for local
8494         variables, for example:
8495
8496         for (int i = 0; i < 10; i++)
8497                 for (int j = 0; j < 10; j++){
8498                    MyDelegate d = delegate {
8499                         call (i, j);
8500                    }
8501                 }
8502
8503         At runtime this captures a single captured variable `i', but it
8504         captures 10 different versions of the variable `j'.  The variable
8505         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8506         recorded on a child.  
8507
8508         The toplevel ScopeInfo will also track information like the `this'
8509         pointer if instance variables were referenced (this is necessary
8510         as the anonymous method lives inside a nested class in the host
8511         type of the method). 
8512
8513         (AnonymousMethod): Expanded to track the Toplevel, implement
8514         `AnonymousMethod.Compatible' to tell whether an anonymous method
8515         can be converted to a target delegate type. 
8516
8517         The routine now also produces the anonymous method content
8518
8519         (AnonymousDelegate): A helper class that derives from
8520         DelegateCreation, this is used to generate the code necessary to
8521         produce the delegate for the anonymous method that was created. 
8522
8523         * assign.cs: API adjustments for new changes in
8524         Convert.ImplicitStandardConversionExists.
8525
8526         * class.cs: Adjustments to cope with the fact that now toplevel
8527         blocks are of type `ToplevelBlock'. 
8528
8529         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8530         insteda of standard blocks.
8531
8532         Flag errors if params arguments are passed to anonymous methods.
8533
8534         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8535         `CurrentAnonymousMethod' which points to the current Anonymous
8536         Method.  The variable points to the AnonymousMethod class that
8537         holds the code being compiled.  It is set in the new EmitContext
8538         created for the anonymous method.
8539
8540         (EmitContext.Phase): Introduce a variable and an enumeration to
8541         assist in enforcing some rules about when and where we are allowed
8542         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8543         only one that enfonces this right now).
8544
8545         (EmitContext.HaveCaptureInfo): new helper method that returns
8546         whether we have a CapturedContext initialized.
8547
8548         (EmitContext.CaptureVariable): New method used to register that a
8549         LocalInfo must be flagged for capturing. 
8550
8551         (EmitContext.CapturedParameter): New method used to register that a
8552         parameters must be flagged for capturing. 
8553         
8554         (EmitContext.CapturedField): New method used to register that a
8555         field must be flagged for capturing. 
8556
8557         (EmitContext.HaveCapturedVariables,
8558         EmitContext.HaveCapturedFields): Return whether there are captured
8559         variables or fields. 
8560
8561         (EmitContext.EmitMethodHostInstance): This is used to emit the
8562         instance for the anonymous method.  The instance might be null
8563         (static methods), this (for anonymous methods that capture nothing
8564         and happen to live side-by-side with the current method body) or a
8565         more complicated expression if the method has a CaptureContext.
8566
8567         (EmitContext.EmitTopBlock): Routine that drives the emission of
8568         code: it will first resolve the top block, then emit any metadata
8569         and then emit the code.  The split is done so that we can extract
8570         any anonymous methods and flag any captured variables/parameters.
8571         
8572         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8573         during this phase, the ILGenerator should not be used as labels
8574         and local variables declared here might not be accessible to any
8575         code that is part of an anonymous method.  
8576
8577         Exceptions to this include the temporary variables that are
8578         created by some statements internally for holding temporary
8579         variables. 
8580         
8581         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8582         metadata for a cb
8583
8584         (EmitContext.TemporaryReturn): This method is typically called
8585         from the Emit phase, and its the only place where we allow the
8586         ReturnLabel to be defined other than the EmitMeta.  The reason is
8587         that otherwise we would have to duplicate a lot of logic in the
8588         Resolve phases of various methods that today is on the Emit
8589         phase. 
8590
8591         (EmitContext.NeedReturnLabel): This no longer creates the label,
8592         as the ILGenerator is not valid during the resolve phase.
8593
8594         (EmitContext.EmitThis): Extended the knowledge in this class to
8595         work in anonymous methods in addition to iterators. 
8596
8597         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8598         code is necessary on the stack to access the instance to a local
8599         variable (the variable will be accessed as a field).
8600
8601         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8602         EmitContext.EmitAddressOfParameter): Routines to support
8603         parameters (not completed at this point). 
8604         
8605         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8606         will also remove the parameters.
8607
8608         * convert.cs (Convert): Define a `ConstantEC' which points to a
8609         null.  This is just to prefity some code that uses
8610         ImplicitStandardConversion code and do not have an EmitContext
8611         handy.
8612
8613         The idea is to flag explicitly that at that point in time, it is
8614         known that the conversion will not trigger the delegate checking
8615         code in implicit conversions (which requires a valid
8616         EmitContext). 
8617
8618         Everywhere: pass new EmitContext parameter since
8619         ImplicitStandardConversionExists now requires it to check for
8620         anonymous method conversions. 
8621
8622         (Convert.ImplicitStandardConversionExists): If the type of an
8623         expression is the anonymous_method_type, and the type is a
8624         delegate, we invoke the AnonymousMethod.Compatible method to check
8625         whether an implicit conversion is possible. 
8626
8627         (Convert.ImplicitConversionStandard): Only do implicit method
8628         group conversions if the language level is not ISO_1.
8629
8630         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8631         MethodInfo for the Invoke method.  used by Delegate and
8632         AnonymousDelegate.
8633
8634         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8635         method conversions if the target type is a delegate.
8636
8637         Removed extra debugging nops.
8638
8639         (LocalVariableReference): Turn the `local_info' into a public
8640         field. 
8641
8642         Add `prepared' field, the same hack used for FieldExprs to cope
8643         with composed assignments, as Local variables do not necessarily
8644         operate purely on the stack as they used to: they can be captured
8645         fields. 
8646
8647         Add `temp' for a temporary result, like fields.
8648
8649         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8650
8651         It now copes with Local variables that are captured and emits the
8652         proper instance variable to load it from a field in the captured
8653         case. 
8654
8655         (ParameterReference.DoResolveBase): During the resolve phase,
8656         capture parameters if we are in an anonymous method.
8657
8658         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8659         anonymous method, use the EmitContext helper routines to emit the
8660         parameter reference.
8661
8662         * iterators.cs: Set RemapToProxy to true/false during the
8663         EmitDispose class.
8664
8665         * parameters.cs (GetParameterByName): New helper method. 
8666
8667         * typemanager.cs (anonymous_method_type) a new type that
8668         represents an anonyous method.  This is always an internal type,
8669         used as a fencepost to test against the anonymous-methodness of an
8670         expression. 
8671         
8672 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8673
8674         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8675         561 report.
8676         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8677
8678 2004-10-18  Martin Baulig  <martin@ximian.com>
8679
8680         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8681         `Type' directly, but call ResolveType() on it.
8682         (Catch.Resolve): Likewise.
8683         (Foreach.Resolve): Likewise.
8684
8685 2004-10-18  Martin Baulig  <martin@ximian.com>
8686
8687         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8688         `Type' directly, but call ResolveType() on it.
8689         (Probe.DoResolve): Likewise.
8690         (ArrayCreation.LookupType): Likewise.
8691         (TypeOf.DoResolve): Likewise.
8692         (SizeOf.DoResolve): Likewise.
8693
8694 2004-10-18  Martin Baulig  <martin@ximian.com>
8695
8696         * expression.cs (Invocation.BetterFunction): Put back
8697         TypeManager.TypeToCoreType().
8698
8699 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8700
8701         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8702         the ResolveType.
8703
8704 2004-10-18  Martin Baulig  <martin@ximian.com>
8705
8706         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
8707         `Type' directly, but call ResolveType() on it.
8708
8709 2004-10-18  Martin Baulig  <martin@ximian.com>
8710
8711         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8712         `Type' directly, but call ResolveType() on it.
8713         (MemberBase.DoDefine): Likewise.
8714
8715         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8716         `Type' directly, but call ResolveType() on it.
8717         (ComposedCast.DoResolveAsTypeStep): Likewise.
8718
8719         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8720         `Type' directly, but call ResolveType() on it.
8721
8722 2004-10-17  John Luke  <john.luke@gmail.com>
8723
8724         * class.cs (Operator.GetSignatureForError): use CSharpName
8725
8726         * parameter.cs (Parameter.GetSignatureForError): Returns
8727         correct name even if was not defined.
8728
8729 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8730
8731         Fix #65816.
8732         * class.cs (TypeContainer.EmitContext): New property.
8733         (DefineNestedTypes): Create an emitcontext for each part.
8734         (MethodCore.DoDefineParameters): Use container's emitcontext.
8735         Pass type array to InternalParameters.
8736         (MemberBase.DoDefine): Use container's emitcontext.
8737         (FieldMember.Define): Likewise.
8738         (Event.Define): Likewise.
8739         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8740         Pass type array to InternalParameters.
8741         (SetIndexerMethod.GetParameterInfo): Likewise.
8742         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8743         * delegate.cs (Define): Pass emitcontext to
8744         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8745         array to InternalParameters.
8746         * expression.cs (ParameterReference.DoResolveBase): Pass
8747         emitcontext to GetParameterInfo.
8748         (ComposedCast.DoResolveAsTypeStep): Remove check on
8749         ec.ResolvingTypeTree.
8750         * parameter.cs (Parameter.Resolve): Change argument to
8751         EmitContext.  Use ResolveAsTypeTerminal.
8752         (Parameter.GetSignature): Change argument to EmitContext.
8753         (Parameters.ComputeSignature): Likewise.
8754         (Parameters.ComputeParameterTypes): Likewise.
8755         (Parameters.GetParameterInfo): Likewise.
8756         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8757         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8758         * support.cs (InternalParameters..ctor): Remove variant that takes
8759         a DeclSpace.
8760         * typemanager.cs (system_intptr_expr): New.
8761         (InitExpressionTypes): Initialize it.
8762
8763 2004-10-12  Chris Toshok  <toshok@ximian.com>
8764
8765         * cs-parser.jay: fix location for try_statement and catch_clause.
8766
8767 2004-10-11  Martin Baulig  <martin@ximian.com>
8768
8769         * report.cs: Don't make --fatal abort on warnings, we have
8770         -warnaserror for that.
8771
8772 2004-10-07  Raja R Harinath  <rharinath@novell.com>
8773
8774         More DeclSpace.ResolveType avoidance.
8775         * decl.cs (MemberCore.InUnsafe): New property.
8776         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
8777         with newly created EmitContext.
8778         (FieldMember.Define): Likewise.
8779         * delegate.cs (Delegate.Define): Likewise.
8780         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8781         only if normal name-lookup fails.
8782         (TypeExpr.DoResolve): Enable error-checking.
8783         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8784         (SizeOf.DoResolve): Likewise.
8785         (ComposedCast.DoResolveAsTypeStep): Likewise.
8786         (StackAlloc.DoResolve): Likewise.
8787         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8788         (Block.Unsafe): New property.
8789         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8790         (Unsafe): Set 'unsafe' flag of contained block.
8791         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8792         (Fixed.Resolve): Likewise.
8793         (Catch.Resolve): Likewise.
8794         (Using.ResolveLocalVariableDecls): Likewise.
8795         (Foreach.Resolve): Likewise.
8796
8797 2004-10-05  John Luke <john.luke@gmail.com>
8798
8799         * cs-parser.jay: add location to error CS0175
8800
8801 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8802
8803         * ecore.cs (Expression.Constantity): Add support for turning null
8804         into a constant.
8805
8806         * const.cs (Const.Define): Allow constants to be reference types
8807         as long as the value is Null.
8808
8809 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8810
8811         * namespace.cs (NamespaceEntry.Using): No matter which warning
8812         level is set, check if this namespace name has already been added.
8813
8814 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8815
8816         * expression.cs: reftype [!=]= null should always use br[true,false].
8817         # 67410
8818
8819 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8820
8821         Fix #67108
8822         * attribute.cs: Enum conversion moved to 
8823         GetAttributeArgumentExpression to be applied to the all
8824         expressions.
8825
8826 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8827
8828         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8829         * class.c (TypeContainer.DefineType): Flag error if
8830         base types aren't accessible due to access permissions.
8831         * decl.cs (DeclSpace.ResolveType): Move logic to
8832         Expression.ResolveAsTypeTerminal.
8833         (DeclSpace.ResolveTypeExpr): Thin layer over
8834         Expression.ResolveAsTypeTerminal.
8835         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8836         Refactor code into NestedAccess.  Use it.
8837         (DeclSpace.NestedAccess): New.
8838         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8839         argument to silence errors.  Check access permissions.
8840         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8841         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8842         (Cast.DoResolve): Likewise.
8843         (New.DoResolve): Likewise.
8844         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8845         (TypeOf.DoResolve): Likewise.
8846
8847         * expression.cs (Invocation.BetterConversion): Return the Type of
8848         the better conversion.  Implement section 14.4.2.3 more faithfully.
8849         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8850         section 14.4.2.2 explicit.
8851         (Invocation.OverloadResolve): Update.
8852         (Invocation): Remove is_base field.
8853         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8854         (Invocation.Emit): Likewise.
8855
8856 2004-09-27  Raja R Harinath  <rharinath@novell.com>
8857
8858         * README: Update to changes.
8859
8860 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8861
8862         * cs-parser.jay: Reverted 642 warning fix.
8863
8864 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8865
8866         Fix bug #66615
8867         * decl.cs (FindMemberWithSameName): Indexer can have more than
8868         1 argument.
8869
8870 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8871
8872         * expression.cs (LocalVariableReference.DoResolveLValue):
8873         Do not report warning 219 for out values.
8874         (EmptyExpression.Null): New member to avoid extra allocations.
8875
8876 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8877
8878         * cs-parser.jay: Fix wrong warning 642 report.
8879
8880         * cs-tokenizer.cs (CheckNextToken): New helper;
8881         Inspect next character if is same as expected.
8882
8883 2004-09-23  Martin Baulig  <martin@ximian.com>
8884
8885         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8886         (Convert.ImplicitReferenceConversionExists): Likewise.
8887
8888 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8889
8890         * class.cs (Operator.Define): Add error 448 and 559 report.
8891
8892 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8893
8894         * class.cs (MemberBase.IsTypePermitted): New protected
8895         method for checking error CS0610.
8896
8897 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8898
8899         * class.cs (TypeContainer.HasExplicitLayout): New property
8900         Returns whether container has StructLayout attribute set Explicit.
8901         (FieldMember): New abstract class for consts and fields.
8902         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8903         (Field): Reuse FieldMember.
8904
8905         * const.cs (Const): Reuse FieldMember.
8906
8907         * rootcontext.cs: EmitConstants call moved to class.
8908
8909 2004-09-22  Martin Baulig  <martin@ximian.com>
8910
8911         Thanks to Peter Sestoft for this bug report.
8912
8913         * expression.cs (Conditional): If both the `trueExpr' and the
8914         `falseExpr' is a NullLiteral, return a NullLiteral.
8915
8916 2004-09-22  Martin Baulig  <martin@ximian.com>
8917
8918         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8919         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8920         for the "get_Current" call.
8921
8922 2004-09-22  Martin Baulig  <martin@ximian.com>
8923
8924         Marek and me just fixed one of our oldest bugs: #28562 :-)
8925
8926         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8927
8928         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8929         we're an EnumConstant, just return that.
8930         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8931         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8932         to get the value which'll actually be written into the attribute.
8933         However, we have to use GetValue() to access the attribute's value
8934         in the compiler.        
8935
8936 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8937
8938         * constant.cs (Constant.IsNegative): New abstract property
8939         IsNegative.
8940
8941         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8942         (StackAlloc.DoResolve): Reused IsNegative.
8943
8944 2004-09-21  Martin Baulig  <martin@ximian.com>
8945
8946         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8947         if we're used in an iterator, we may be called from different
8948         methods.
8949
8950         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8951         we actually have an exception block.
8952
8953 2004-09-20  John Luke <jluke@cfl.rr.com>
8954
8955         * class.cs, cs-parser.jay: Improve the error report for 1520:
8956         report the actual line where the error happens, not where the
8957         class was declared.
8958
8959         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8960         Pass location information that was available elsewhere.
8961
8962 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
8963
8964         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8965         runtime to delay sign assemblies.
8966
8967 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8968
8969         * cs-parser.jay: Do not report the stack trace, this is barely
8970         used nowadays.
8971
8972 2004-08-22  John Luke  <john.luke@gmail.com>
8973  
8974         * driver.cs : check that a resource id is not already used
8975         before adding it, report CS1508 if it is, bug #63637
8976
8977 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8978
8979         * ecore.cs: Removed dead code.
8980
8981 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
8982
8983         * class.cs: Do not report warning CS0067 on the interfaces.
8984
8985 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8986
8987         * cs-parser.jay: Add error 504 report.
8988
8989 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8990
8991         * rootcontext.cs: WarningLevel is 4 by default now.
8992
8993         * statement.cs (Fixed.Resolve): Do not null
8994         VariableInfo.
8995
8996 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8997
8998         Fixed bug #55780
8999         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
9000         deep search when property is not virtual.
9001         (PropertyExpr.ResolveAccessors): Make one call for both
9002         accessors.
9003
9004 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9005
9006         Fixed bug #65766
9007         * statement.cs: Error 152 report constains also location.
9008
9009 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9010
9011         Fixed bug #65766
9012         * const.cs: Explicitly set constant as static.
9013
9014 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9015
9016         Fixed bug #64226
9017         * cs-parser.jay: Add error 1017 report.
9018
9019 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9020
9021         Fixed bug #59980, #64224
9022         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
9023
9024         * typemanager.cs (IsSpecialMethod): Simplified
9025
9026 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9027
9028         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
9029         condition with better params.
9030
9031 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9032
9033         Fixed bug #65238
9034         * attribute.cs (Resolve): Property has to have both
9035         accessors.
9036
9037 2004-09-14  Martin Baulig  <martin@ximian.com>
9038
9039         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9040
9041 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9042
9043         Fixed bug #61902
9044         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9045         called and is obsolete then this member suppress message
9046         when call is inside next [Obsolete] method or type.
9047
9048         * expression.cs: Use TestObsoleteMethodUsage member.
9049
9050 2004-09-14  Martin Baulig  <martin@ximian.com>
9051
9052         * cs-parser.jay: Sync a bit with the GMCS version.
9053
9054 2004-09-14  Martin Baulig  <martin@ximian.com>
9055
9056         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
9057         (CSharpParser.yacc_verbose_flag): New public field.
9058
9059         * genericparser.cs: Removed.
9060
9061 2004-09-14  Raja R Harinath  <rharinath@novell.com>
9062
9063         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
9064
9065 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9066
9067         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9068
9069 2004-09-10  Martin Baulig  <martin@ximian.com>
9070
9071         Backported my MemberName changes from GMCS into MCS.
9072
9073         - we are now using a special `MemberName' class instead of using
9074         strings; in GMCS, the `MemberName' also contains the type
9075         arguments.
9076
9077         - changed the grammar rules a bit:
9078           * the old `member_name' is now a `namespace_or_type_name':
9079             The rule is that we use `namespace_or_type_name' everywhere
9080             where we expect either a "member name" (GetEnumerator) or a
9081             "member name" with an explicit interface name
9082             (IEnumerable.GetEnumerator).
9083             In GMCS, the explicit interface name may include type arguments
9084             (IEnumerable<T>.GetEnumerator).
9085           * we use `member_name' instead of just `IDENTIFIER' for
9086             "member names":
9087             The rule is that we use `member_name' wherever a member may
9088             have type parameters in GMCS.       
9089
9090         * decl.cs (MemberName): New public class.
9091         (MemberCore.MemberName): New public readonly field.
9092         (MemberCore.ctor): Take a `MemberName' argument, not a string.
9093         (DeclSpace): Likewise.
9094
9095         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
9096         * enum.cs (Enum.ctor): Likewise.
9097
9098         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
9099         MemberName.     
9100         (AliasEntry.ctor): Take a MemberName, not an Expression.
9101         (AliasEntry.UsingAlias): Likewise.
9102
9103         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
9104         (IMethodData.MemberName): Changed type from string to MemberName.
9105         (MemberBase.ExplicitInterfaceName): Likewise.
9106         (AbstractPropertyEventMethod.SetupName): Make this private.
9107         (AbstractPropertyEventMethod.ctor): Added `string prefix'
9108         argument; compute the member name here.
9109         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
9110         on the `member.MemberName' and the `prefix'.
9111
9112         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
9113         not `type_name'.
9114         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
9115         thus, we get a `MemberName' instead of a `string'.  These
9116         declarations may have type parameters in GMCS.
9117         (interface_method_declaration, delegate_declaration): Likewise.
9118         (class_declaration, interface_declaration): Likewise.
9119         (method_header): Use `namespace_or_type_name' instead of
9120         `member_name'.  We may be an explicit interface implementation.
9121         (property_declaration, event_declaration): Likewise.
9122         (member_name): This is now just an `IDENTIFIER', not a
9123         `namespace_or_type_name'.
9124         (type_name, interface_type): Removed.
9125         (namespace_or_type_name): Return a MemberName, not an Expression.
9126         (primary_expression): Use `member_name' instead of `IDENTIFIER';
9127         call GetTypeExpression() on the MemberName to get an expression.
9128         (IndexerDeclaration.interface_type): Changed type from string to
9129         MemberName.
9130         (MakeName): Operate on MemberName's instead of string's.
9131
9132 2004-09-13  Raja R Harinath  <rharinath@novell.com>
9133
9134         Fix bug #55770.
9135         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
9136         (NamespaceEntry.Lookup): Add new argument to flag if we want the
9137         lookup to avoid symbols introduced by 'using'.
9138         * rootcontext.cs (NamespaceLookup): Update.
9139
9140 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9141
9142         * class.cs (TypeContainer.DoDefineMembers): Do not call
9143         DefineDefaultConstructor for static classes.
9144
9145 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9146
9147         * attribute.cs (Attribute.Resolve): Add error 653 report.
9148
9149         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9150         report.
9151         (Method.ApplyAttributeBuilder): Add error 685 report.
9152         (Operator.Define): Add error 564 report.
9153
9154         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9155
9156         * expression.cs (Invocation.DoResolve): Add error
9157         245 and 250 report.
9158
9159         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9160         error 674 report.
9161
9162 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9163
9164         * class.cs (ConstructorInitializer.Resolve):
9165         Wrong error number (515->516).
9166
9167 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9168
9169         * class.cs (Indexer.Define): Add error 631 report.
9170
9171 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9172
9173         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9174
9175 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9176
9177         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9178
9179 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9180
9181         * cs-parser.jay: Added error CS0241 report.
9182
9183 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9184
9185         * cs-parser.jay (fixed_statement): Introduce a scope for the
9186         declaration in the 'fixed' statement.
9187
9188 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9189
9190         * cs-parser.jay: Added CS0230 error report.
9191
9192 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9193
9194         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9195
9196 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9197
9198         * expression.cs (Argument.Resolve): Added error CS0192 and
9199         CS0199 report.
9200
9201 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9202
9203         C# 2.0 #pragma warning feature
9204
9205         * cs-tokenizer.cs (PreProcessPragma): New method; 
9206         Handles #pragma directive.
9207
9208         * report.cs (WarningRegions): New class; Support
9209         class for #pragma warning directive. It tests whether
9210         warning is enabled for a given line.
9211
9212 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9213
9214         * const.cs: Add more descriptive error report, tahnks to
9215         Sebastien. 
9216
9217 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9218
9219         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9220
9221 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9222
9223         * expression.cs: Apply patch from Ben: Remove dead code from
9224         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9225         as that code just threw an exception anwyays.
9226
9227         * const.cs: Remove the call to the turnintoconstant, for details
9228         see bug: #63144
9229         
9230         * literal.cs: The type of the null-literal is the null type;  So
9231         we use a placeholder type (literal.cs:System.Null, defined here)
9232         for it.
9233
9234         * expression.cs (Conditional.DoResolve): Remove some old code that
9235         is no longer needed, conversions have been fixed.
9236
9237         (ArrayCreationExpression.DoResolve): Return false if we fail to
9238         resolve the inner expression.
9239
9240 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9241
9242         Fix test-290.cs.
9243         * cs-parser.jay (delegate_declaration): Record a delegate
9244         declaration as a type declaration.
9245         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9246
9247 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9248
9249         * parameter.cs: Do not crash if the type can not be resolved. 
9250
9251         * expression.cs: Report errors with unsafe pointers, fixes #64896
9252
9253 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9254
9255         * expression.cs: Pointer arith always needs to do a conv.i
9256         if the operand is a long. fix 65320
9257
9258 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9259
9260         Fixed cs0619-37.cs, cs0619-38.cs
9261
9262         * enum.cs (GetObsoleteAttribute): Removed.
9263
9264         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9265         on Enum member is double staged. The first is tested member
9266         and then enum.
9267
9268 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9269
9270         Fixed #56986, #63631, #65231
9271
9272         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9273         adds member to name container.
9274         (TypeContainer.AddToTypeContainer): New method, adds type to
9275         name container.
9276         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9277         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9278         AddOperator): Simplified by reusing AddToMemberContainer.
9279         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9280         instead of field.
9281         (Method.CheckForDuplications): Fixed implementation to test all
9282         possibilities.
9283         (MemberBase): Detection whether member is explicit interface
9284         implementation is now in constructor.
9285         (MemberBase.UpdateMemberName): Handles IndexerName.
9286         (Accessor): Changed to keep also location information.
9287         (AbstractPropertyEventMethod): Is derived from MemberCore.
9288         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9289         will be emited or not.
9290         (PropertyBase.AreAccessorsDuplicateImplementation):
9291         Tests whether accessors are not in collision with some method.
9292         (Operator): Is derived from MethodCore to simplify common
9293         operations.
9294
9295         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9296         must be performed.
9297         (DeclSpace.AddToContainer): Adds the member to defined_names
9298         table. It tests for duplications and enclosing name conflicts.
9299
9300         * enum.cs (EnumMember): Clean up to reuse the base structures
9301
9302 2004-09-03  Martin Baulig  <martin@ximian.com>
9303
9304         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9305         into TypeContainer, to make partial classes work again.
9306
9307 2004-09-03  Martin Baulig  <martin@ximian.com>
9308
9309         * rootcontext.cs (RootContext.V2): Removed.
9310
9311 2004-03-23  Martin Baulig  <martin@ximian.com>
9312
9313         * expression.cs (Invocation.OverloadResolve): Added `bool
9314         may_fail' argument and use it instead of the Location.IsNull() hack.
9315
9316 2004-09-03  Martin Baulig  <martin@ximian.com>
9317
9318         Merged latest changes into gmcs.  Please keep this comment in
9319         here, it makes it easier for me to see what changed in MCS since
9320         the last time I merged.
9321
9322 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9323
9324         Fix #61128.
9325         * expression.cs (BetterConversion): Don't allow either conversion 
9326         to be null.  Remove redundant implicit conversion test when 'q ==
9327         null' -- when this function is invoked, we already know that the
9328         implicit conversion exists.
9329         (BetterFunction): Assume that 'best' is non-null.  Remove
9330         redundant reimplementation of IsApplicable when 'best' is null.
9331         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9332         number of arguments.
9333         (IsAncestralType): Extract from OverloadResolve.
9334         (OverloadResolve): Make robust to the MethodGroupExpr being
9335         unsorted.  Implement all the logic of Section 14.5.5.1, and
9336         support overloading of methods from multiple applicable types.
9337         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9338
9339         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9340         (RealError, Warning): Append type of report to related symbol.
9341
9342 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9343
9344         * enum.cs: Fixed CLS-Compliance checks for enum members.
9345         Error tests cs3008-8.cs, cs3014-8.cs
9346
9347 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9348
9349         Fixed bug #62342, #63102
9350         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9351         like ImplementMethod.
9352
9353 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9354
9355         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9356         Fixed bug #65170.
9357
9358 2004-09-02  Martin Baulig  <martin@ximian.com>
9359
9360         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9361         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9362         on the MethodBase.
9363
9364 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9365
9366         C# 2.0 Static classes implemented
9367
9368         * class.cs (TypeContainer): instance_constructors,
9369         initialized_fields, initialized_static_fields,
9370         default_constructor, base_inteface_types are protected to be
9371         accessible from StaticClass.
9372         (TypeContainer.DefineDefaultConstructor): New virtual method
9373         for custom default constructor generating
9374         (StaticClass): New class to handle "Static classes" feature.
9375
9376         * cs-parser.jay: Handle static keyword on class like instance
9377         of StaticClass.
9378
9379         * driver.cs: Added "/langversion" command line switch with two
9380         options (iso-1, default).
9381
9382 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9383
9384         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9385
9386 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9387
9388         * delegate.cs: Style.
9389
9390 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9391
9392         * delegate.cs: Add seperate instance expr field for miguel.
9393
9394 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9395
9396         * PointerArithmetic (Resolve): make sure we are not doing
9397         pointer arith on void*. Also, make sure we are resolved
9398         by not setting eclass until resolve.
9399
9400         All callers: Make sure that PointerArithmetic gets resolved.
9401
9402 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9403
9404         * ArrayCreation (LookupType): If the type does not resolve 
9405         to an array, give an error.
9406
9407 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9408
9409         * statement.cs (Try.Resolve): Fixed bug #64222
9410
9411 2004-08-27  Martin Baulig  <martin@ximian.com>
9412
9413         * class.cs
9414         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9415         crash here.     
9416
9417 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9418
9419         * ecore.cs (Constantify): Get underlying type via
9420         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9421         Windows in special cases.
9422
9423 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9424
9425         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9426         for obtaining also private methods.
9427         (GetRemoveMethod): Used GetRemoveMethod (true)
9428         for obtaining also private methods.
9429
9430 2004-08-24  Martin Baulig  <martin@ximian.com>
9431
9432         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9433         MethodAttributes.HideBySig for operators.
9434
9435 2004-08-23  Martin Baulig  <martin@ximian.com>
9436
9437         Back to the old error reporting system :-)
9438
9439         * report.cs (Message): Removed.
9440         (Report.MessageData, ErrorData, WarningData): Removed.
9441         (Report.Error, Warning): Back to the old system.
9442
9443 2004-08-23  Martin Baulig  <martin@ximian.com>
9444
9445         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9446
9447         * class.cs (TypeContainer.ParentContainer): New public virtual
9448         method; replaces the explicit interface implementation.
9449         (ClassPart.ParentContainer): Override.
9450
9451 2004-08-23  Martin Baulig  <martin@ximian.com>
9452
9453         * statement.cs (Switch): Added support for constant switches; see
9454         #59428 or test-285.cs.
9455
9456 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9457
9458         Fixed bug #62740.
9459         * statement.cs (GetEnumeratorFilter): Removed useless
9460         logic because C# specs is strict. GetEnumerator must be
9461         public.
9462
9463 2004-08-22  Martin Baulig  <martin@ximian.com>
9464
9465         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9466         a switch and may break, reset the barrier.  Fixes #59867.
9467
9468 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9469
9470         CLS-Compliance speed up (~5% for corlib)
9471
9472         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9473         New method. Tests container for CLS-Compliant names
9474
9475         * class.cs (TypeContainer.VerifyClsName): New method.
9476         Checks whether container name is CLS Compliant.
9477         (Constructor): Implements IMethodData.
9478
9479         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9480         low-case table for CLS Compliance test.
9481         (MemberCache.VerifyClsParameterConflict): New method.
9482         Checks method parameters for CS3006 error.
9483
9484         * enum.cs (EnumMember): Is derived from MemberCore.
9485         (Enum.VerifyClsName): Optimized for better performance.
9486
9487 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9488
9489         * report.cs: Renamed Error_T to Error and changed all
9490         references.
9491
9492 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9493
9494         * class.cs (TypeContainer.IndexerArrayList): New inner class
9495         container for indexers.
9496         (TypeContainer.DefaultIndexerName): New constant for default
9497         indexer name. Replaced all "Item" with this constant.
9498         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9499
9500         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9501         DefaultMemberAttribute constructor.
9502
9503 2004-08-05  Martin Baulig  <martin@ximian.com>
9504
9505         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9506         Fix bug #59429.
9507
9508 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9509
9510         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9511         multi platforms problem.
9512
9513         * compiler.csproj: Included shared files.
9514
9515 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9516
9517         Fix bug 60333, 55971 in the more general way
9518         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9519         Added arg_type argument for constant conversion.
9520         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9521
9522 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9523
9524         Fix bug #59760
9525         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9526         OperatorArrayList, MethodCoreArrayList for typecontainer
9527         containers. Changed class member types to these new types.
9528         (MethodArrayList.DefineMembers): Added test for CS0659.
9529
9530 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9531
9532         * cfold.cs: Synchronize the folding with the code in expression.cs
9533         Binary.DoNumericPromotions for uint operands.
9534
9535         * attribute.cs: Revert patch from Raja, it introduced a regression
9536         while building Blam-1.2.1 (hard to isolate a test case).
9537
9538 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9539
9540         Fix for #55382
9541         * class.cs:
9542         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9543         name collision.
9544         (MethodCore.parent_method): New member. The method we're overriding
9545         if this is an override method.
9546         (MethodCore.CheckBase): Moved from Method class and made common.
9547         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9548         private.
9549         (MethodCore.CheckForDuplications): New abstract method. For custom
9550         member duplication search in a container
9551         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9552         method and its return type.
9553         (Event.conflict_symbol): New member. Symbol with same name in the
9554         parent class.
9555
9556         * decl.cs:
9557         (MemberCache.FindMemberWithSameName): New method. The method
9558         is looking for conflict with inherited symbols.
9559
9560 2004-08-04  Martin Baulig  <martin@ximian.com>
9561
9562         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9563
9564         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9565
9566 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9567
9568         * report.cs (Message): New enum for better error, warning reference in
9569         the code.
9570         (MessageData): New inner abstract class. It generally handles printing of
9571         error and warning messages.
9572         Removed unused Error, Warning, Message methods.
9573
9574 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9575
9576         Fix for cs0592-8.cs test
9577         * attribute.cs
9578         (Attributable.ValidAttributeTargets): Made public.
9579         (Attribute.ExplicitTarget): New member for explicit target value.
9580         (Attribute.CheckTargets): Now we translate explicit attribute
9581         target to Target here.
9582
9583 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9584
9585         * ecore.cs (MethodGroupExpr): new IsBase property.
9586
9587         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9588
9589         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9590         rather than an instance expr.
9591
9592         (DelegateCreation.Emit): Use the method group rather than
9593         the instance expression. Also, if you have base.Foo as the
9594         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9595
9596         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9597
9598         (NewDelegate.DoResolve): Only check for the existance of Invoke
9599         if the method is going to be needed. Use MethodGroupExpr.
9600
9601         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9602
9603         * expression.cs: For pointer arith., make sure to use
9604         the size of the type, not the size of the pointer to
9605         the type.
9606
9607 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9608
9609         Fix for #60722
9610         * class.cs (Class): Added error CS0502 test.
9611
9612 2004-08-03  John Luke  <jluke@cfl.rr.com>
9613             Raja R Harinath  <rharinath@novell.com>
9614
9615         Fix for #60997.
9616         * attribute.cs (Attribute.complained_before): New flag.
9617         (Attribute.ResolveType, Attribute.Resolve),
9618         (Attribute.DefinePInvokeMethod): Set it.
9619         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9620         
9621 2004-08-03  Martin Baulig  <martin@ximian.com>
9622
9623         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9624         use a user-defined operator; we still need to do numeric
9625         promotions in case one argument is a builtin type and the other
9626         one has an implicit conversion to that type.  Fixes #62322.
9627
9628 2004-08-02  Martin Baulig  <martin@ximian.com>
9629
9630         * statement.cs (LocalInfo.Flags): Added `IsThis'.
9631         (LocalInfo.IsThis): New public property.
9632         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9633
9634 2004-08-01  Martin Baulig  <martin@ximian.com>
9635
9636         * class.cs (TypeContainer.GetClassBases): Don't set the default
9637         here since we may get called from GetPartialBases().
9638         (TypeContainer.DefineType): If GetClassBases() didn't return a
9639         parent, use the default one.
9640
9641 2004-07-30  Duncan Mak  <duncan@ximian.com>
9642
9643         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9644
9645 2004-07-30  Martin Baulig  <martin@ximian.com>
9646
9647         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9648
9649         * class.cs (SourceMethod): New public class, derive from the
9650         symbol writer's ISourceMethod.
9651         (Method): Use the new symbol writer API.
9652
9653         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9654         as argument and use the new symbol writer.
9655
9656         * location.cs
9657         (SourceFile): Implement the symbol writer's ISourceFile.
9658         (Location.SymbolDocument): Removed.
9659         (Location.SourceFile): New public property.
9660
9661         * symbolwriter.cs: Use the new symbol writer API.
9662
9663 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9664
9665         * Makefile (install-local): Remove.  Functionality moved to
9666         executable.make.
9667
9668 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9669
9670         * Makefile: Install mcs.exe.config file together with mcs.exe.
9671         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9672         correct runtime version.
9673         
9674 2004-07-25  Martin Baulig  <martin@ximian.com>
9675
9676         * class.cs
9677         (TypeContainer.RegisterOrder): Removed, this was unused.
9678         (TypeContainer, interface_order): Removed.
9679         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9680         TypeContainer as argument since we can also be called with a
9681         `PartialContainer' for a partial class/struct/interface.
9682         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9683         of checking whether we're an `Interface' - we could be a
9684         `PartialContainer'.
9685         (PartialContainer.Register): Override; call
9686         AddClass()/AddStruct()/AddInterface() on our parent.
9687
9688         * cs-parser.jay (interface_member_declaration): Add things to the
9689         `current_container', not the `current_class'.
9690
9691         * rootcontext.cs (RegisterOrder): The overloaded version which
9692         takes an `Interface' was unused, removed.
9693
9694         * typemanager.cs (TypeManager.LookupInterface): Return a
9695         `TypeContainer', not an `Interface'.
9696         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9697         contain a `PartialContainer' for an interface, so check it's
9698         `Kind' to figure out what it is.
9699
9700 2004-07-25  Martin Baulig  <martin@ximian.com>
9701
9702         * class.cs (Class.DefaultTypeAttributes): New public constant.
9703         (Struct.DefaultTypeAttributes): Likewise.
9704         (Interface.DefaultTypeAttributes): Likewise.
9705         (PartialContainer.TypeAttr): Override this and add the
9706         DefaultTypeAttributes.
9707
9708 2004-07-25  Martin Baulig  <martin@ximian.com>
9709
9710         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9711         we can just use the `Parent' field instead.
9712
9713 2004-07-25  Martin Baulig  <martin@ximian.com>
9714
9715         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9716
9717 2004-07-25  Martin Baulig  <martin@ximian.com>
9718
9719         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9720         our parts before defining any methods.
9721         (TypeContainer.VerifyImplements): Make this virtual.
9722         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9723         on our PartialContainer.
9724
9725 2004-07-25  Martin Baulig  <martin@ximian.com>
9726
9727         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9728
9729         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9730         argument, we can just use the `Parent' field instead.
9731
9732         * class.cs
9733         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9734         (MemberBase.DoDefine): Likewise.
9735
9736 2004-07-24  Martin Baulig  <martin@ximian.com>
9737
9738         * decl.cs (MemberCore.Parent): New public field.
9739         (DeclSpace.Parent): Moved to MemberCore.
9740
9741         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9742         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9743         parent's .ctor.
9744         (FieldBase, Field, Operator): Likewise.
9745         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9746         (EventField, Event): Likewise.
9747
9748 2004-07-23  Martin Baulig  <martin@ximian.com>
9749
9750         * class.cs (PartialContainer): New public class.
9751         (ClassPart): New public class.
9752         (TypeContainer): Added support for partial classes.
9753         (TypeContainer.GetClassBases): Splitted some of the functionality
9754         out into GetNormalBases() and GetPartialBases().
9755
9756         * cs-tokenizer.cs (Token.PARTIAL): New token.
9757         (Tokenizer.consume_identifier): Added some hacks to recognize
9758         `partial', but only if it's immediately followed by `class',
9759         `struct' or `interface'.
9760
9761         * cs-parser.jay: Added support for partial clases.
9762
9763 2004-07-23  Martin Baulig  <martin@ximian.com>
9764
9765         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9766         a `DeclSpace' and also made it readonly.
9767         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9768         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9769         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9770
9771         * cs-parser.jay: Pass the `current_class', not the
9772         `current_container' (at the moment, this is still the same thing)
9773         to a new Method, Property, Event, Indexer or Constructor.
9774
9775 2004-07-23  Martin Baulig  <martin@ximian.com>
9776
9777         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9778         and removed the `current_interface' one.
9779         (struct_declaration, class_declaration, interface_declaration):
9780         Set `current_class' to the newly created class/struct/interface;
9781         set their `Bases' and call Register() before parsing their body.
9782
9783 2004-07-23  Martin Baulig  <martin@ximian.com>
9784
9785         * class.cs (Kind): New public enum.
9786         (TypeContainer): Made this class abstract.
9787         (TypeContainer.Kind): New public readonly field.
9788         (TypeContainer.CheckDef): New public method; moved here from
9789         cs-parser.jay.
9790         (TypeContainer.Register): New public abstract method.
9791         (TypeContainer.GetPendingImplementations): New public abstract
9792         method.
9793         (TypeContainer.GetClassBases): Removed the `is_class' and
9794         `is_iface' parameters.
9795         (TypeContainer.DefineNestedTypes): Formerly known as
9796         DoDefineType().
9797         (ClassOrStruct): Made this class abstract.
9798
9799         * tree.cs (RootTypes): New public type. 
9800
9801 2004-07-20  Martin Baulig  <martin@ximian.com>
9802
9803         * tree.cs (Tree.RecordNamespace): Removed.
9804         (Tree.Namespaces): Removed.
9805
9806         * rootcontext.cs (RootContext.IsNamespace): Removed.
9807
9808         * cs-parser.jay (namespace_declaration): Just create a new
9809         NamespaceEntry here.
9810
9811 2004-07-20  Martin Baulig  <martin@ximian.com>
9812
9813         * statement.cs (ExceptionStatement): New abstract class.  This is
9814         now used as a base class for everyone who's using `finally'.
9815         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9816         our local variables before using them.
9817
9818         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9819         virtual method.  This is used by Yield.Resolve() to "steal" an
9820         outer block's `finally' clauses.
9821         (FlowBranchingException): The .ctor now takes an ExceptionStatement
9822         argument.
9823
9824         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9825         version which takes an ExceptionStatement.  This version must be
9826         used to create exception branchings.
9827
9828         * iterator.cs
9829         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9830         (Iterator.EmitMoveNext): Added exception support; protect the
9831         block with a `fault' clause, properly handle 'finally' clauses.
9832         (Iterator.EmitDispose): Run all the `finally' clauses here.
9833
9834 2004-07-20  Martin Baulig  <martin@ximian.com>
9835
9836         * iterator.cs: This is the first of a set of changes in the
9837         iterator code.  Match the spec more closely: if we're an
9838         IEnumerable, then GetEnumerator() must be called.  The first time
9839         GetEnumerator() is called, it returns the current instance; all
9840         subsequent invocations (if any) must create a copy.
9841
9842 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
9843
9844         * expression.cs: Resolve the constant expression before returning
9845         it. 
9846
9847 2004-07-19  Martin Baulig  <martin@ximian.com>
9848
9849         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9850         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9851         the return type of the new EmitContext.
9852
9853 2004-07-18  Martin Baulig  <martin@ximian.com>
9854
9855         * class.cs (Property.Define): Fix iterators.
9856
9857         * iterators.cs (Iterator.Define): Moved the
9858         `container.AddInterator (this)' call here from the .ctor; only do
9859         it if we resolved successfully.
9860
9861 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
9862
9863         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9864         `true' for preprocessing directives that we parse.  The return
9865         value indicates whether we should return to regular tokenizing or
9866         not, not whether it was parsed successfully.
9867
9868         In the past if we were in: #if false ... #line #endif, we would
9869         resume parsing after `#line'.  See bug 61604.
9870
9871         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9872         building: IsEnumType should return true only for enums, not for
9873         enums or System.Enum itself.  This fixes #61593.
9874
9875         Likely what happened is that corlib was wrong: mcs depended on
9876         this bug in some places.  The bug got fixed, we had to add the
9877         hack, which caused bug 61593.
9878
9879         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9880         that was a workaround for the older conditions.
9881
9882 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
9883
9884         * assign.cs: IAssignMethod has a new interface, as documented
9885         inline. All assignment code now uses this new api.
9886
9887         * ecore.cs, expression.cs: All classes which implement
9888         IAssignMethod now use the new interface.
9889
9890         * expression.cs (Invocation): add a hack to EmitCall so that
9891         IndexerAccess can be the target of a compound assignment without
9892         evaluating its arguments twice.
9893
9894         * statement.cs: Handle changes in Invocation api.
9895
9896 2004-07-16  Martin Baulig  <martin@ximian.com>
9897
9898         * iterators.cs: Rewrote this.  We're now using one single Proxy
9899         class for both the IEnumerable and the IEnumerator interface and
9900         `Iterator' derives from Class so we can use the high-level API.
9901
9902         * class.cs (TypeContainer.AddIterator): New method.
9903         (TypeContainer.DoDefineType): New protected virtual method, which
9904         is called from DefineType().
9905         (TypeContainer.DoDefineMembers): Call DefineType() and
9906         DefineMembers() on all our iterators.
9907         (TypeContainer.Emit): Call Emit() on all our iterators.
9908         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9909
9910         * codegen.cs (EmitContext.CurrentIterator): New public field.
9911
9912 2004-07-15  Martin Baulig  <martin@ximian.com>
9913
9914         * typemanager.cs
9915         (TypeManager.not_supported_exception_type): New type.   
9916
9917 2004-07-14  Martin Baulig  <martin@ximian.com>
9918
9919         * iterators.cs: Use real error numbers.
9920
9921 2004-07-14  Martin Baulig  <martin@ximian.com>
9922
9923         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9924         requires this to be a System.Collection.IEnumerable and not a
9925         class implementing that interface.
9926         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9927
9928 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9929
9930         * class.cs: Fixed previous fix, it broke some error tests.
9931
9932 2004-07-12  Martin Baulig  <martin@ximian.com>
9933
9934         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9935         Fixes #61293.
9936
9937 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9938
9939         * assign.cs (LocalTemporary): Add new argument: is_address,If
9940         `is_address' is true, then the value that we store is the address
9941         to the real value, and not the value itself.
9942         
9943         * ecore.cs (PropertyExpr): use the new local temporary
9944         stuff to allow us to handle X.Y += z (where X is a struct)
9945
9946 2004-07-08  Martin Baulig  <martin@ximian.com>
9947
9948         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9949         not always return, just like we're doing in Using.Resolve().
9950
9951 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9952
9953         * cs-parser.jay (fixed_statement): flag this as Pinned.
9954
9955 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9956
9957         * typemanager.cs (TypeManager): Removed MakePinned method, this
9958         mechanism is replaced with the .NET 2.x compatible mechanism of
9959         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9960
9961         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9962         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9963         `IsFixed' property which has a different meaning.
9964
9965 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9966
9967         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9968         visible from inside a nested class, not just the names of the
9969         immediately enclosing class.
9970         Fix for bug #60730.
9971
9972 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9973
9974         * expression.cs (BetterConversion): Remove buggy special-case
9975         handling of "implicit constant expression conversions".  At this
9976         point, we already know that the conversion is possible -- we're
9977         only checking to see which is better.
9978
9979 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9980
9981         * cs-parser.jay: Added error CS0210 test.
9982
9983 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9984
9985         * cs-parser.jay: Added error CS0134 test.
9986
9987 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9988
9989         Fix bug #52507
9990         * cs-parser.jay: Added error CS0145 test.
9991
9992 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9993
9994         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9995
9996 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9997         
9998         * expression.cs (StackAlloc.Resolve): The argument may not
9999         be a constant; deal with this case.
10000         
10001 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10002
10003         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10004         GetIndexerAttributeValue.
10005         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10006
10007         * class.cs (Indexer.Define): Added error tests for CS0415,
10008         CS0609.
10009
10010 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10011
10012         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10013         property code.
10014
10015 2004-06-23  Martin Baulig  <martin@ximian.com>
10016
10017         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10018         neither return nor throw, reset the barrier as well.  Fixes #60457.
10019
10020 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10021
10022         * class.cs : EventAttributes is now set to None by default.
10023           This fixes bug #60459.
10024
10025 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10026
10027         Fix bug #60219
10028         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10029         Don't throw exception but return null (it's sufficient now).
10030
10031 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10032
10033         * typemanager.cs (GetArgumentTypes): Faster implementation.
10034
10035 2004-06-18  Martin Baulig  <martin@ximian.com>
10036
10037         * attribute.cs (Attribute.Resolve): Check whether we're an
10038         EmptyCast which a Constant child.  Fixes #60333.
10039
10040 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10041
10042         * statement.cs (EmitCollectionForeach): Account for the fact that
10043         not all valuetypes are in areas which we can take the address of.
10044         For these variables, we store to a temporary variable. Also, make
10045         sure that we dont emit a `callvirt' on a valuetype method.
10046
10047 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10048
10049         * expression.cs (StackAlloc.DoReSolve): Added test for
10050         negative parameter (CS0247).
10051
10052 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10053
10054         Fix bug #59792
10055         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10056
10057 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10058
10059         Fix bug #59781
10060         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10061         ulong.
10062
10063 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10064
10065         Fix bug #58254 & cs1555.cs, cs1556.cs
10066         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10067
10068 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10069
10070         * cs-parser.jay: Added error CS1669 test for indexers.
10071
10072 2004-06-11  Martin Baulig  <martin@ximian.com>
10073
10074         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10075         call this twice: for params and varargs methods.
10076
10077 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10078
10079         * class.cs:
10080         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10081
10082 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10083
10084         * attribute.cs (Attribute.GetValidTargets): Made public.
10085
10086         * class.cs: 
10087         (AbstractPropertyEventMethod): New class for better code sharing.
10088         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10089         CS1667 report.
10090         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10091
10092 2004-06-11  Raja R Harinath  <rharinath@novell.com>
10093
10094         Fix bug #59477.
10095         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
10096         that the call to Resolve is part of a MemberAccess.
10097         (Expression.Resolve): Use it for SimpleName resolution.
10098         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
10099         Add 'intermediate' boolean argument.
10100         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
10101         error message when the SimpleName can be resolved ambiguously
10102         between an expression and a type.
10103         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
10104         public.
10105         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
10106         call on the left-side.
10107
10108 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10109
10110         * class.cs:
10111         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
10112
10113 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10114
10115         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
10116
10117 2004-06-11  Martin Baulig  <martin@ximian.com>
10118
10119         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
10120         varargs methods if applicable.
10121
10122 2004-06-11  Martin Baulig  <martin@ximian.com>
10123
10124         * expression.cs (Invocation.EmitCall): Don't use
10125         `method.CallingConvention == CallingConventions.VarArgs' since the
10126         method could also have `CallingConventions.HasThis'.
10127
10128 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10129
10130         * class.cs (Event.GetSignatureForError): Implemented.
10131         Fixed crash in error test cs3010.cs
10132
10133 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
10134
10135         * cs-tokenizer.cs: Change the way we track __arglist to be
10136         consistent with the other keywords.
10137
10138 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
10139
10140         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
10141         tomorrow.
10142
10143 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
10144
10145         * codegen.cs: Check that all referenced assemblies have a strongname
10146         before strongnaming the compiled assembly. If not report error CS1577.
10147         Fix bug #56563. Patch by Jackson Harper.
10148         * typemanager.cs: Added a method to return all referenced assemblies.
10149         Fix bug #56563. Patch by Jackson Harper.
10150
10151 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
10152
10153         * class.cs:
10154         (Method.ApplyAttributeBuilder): Moved and added conditional
10155         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
10156
10157         * delegate.cs:
10158         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
10159
10160 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
10161
10162         Fixed #59640
10163         * class.cs: (EventField.attribute_targets): Changed default target.
10164
10165 2004-06-08  Martin Baulig  <martin@ximian.com>
10166
10167         * expression.cs (Invocation.EmitCall): Enable varargs methods.
10168
10169 2004-06-08  Martin Baulig  <martin@ximian.com>
10170
10171         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
10172
10173 2004-06-07  Martin Baulig  <martin@ximian.com>
10174
10175         Added support for varargs methods.
10176
10177         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
10178         keyword.
10179
10180         * cs-parser.jay: Added support for `__arglist'.
10181
10182         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
10183
10184         * expression.cs (Argument.AType): Added `ArgList'.
10185         (Invocation): Added support for varargs methods.
10186         (ArglistAccess): New public class.
10187         (Arglist): New public class.
10188
10189         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
10190
10191         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
10192         a method's top-level block if the method has varargs.
10193
10194         * support.cs (ReflectionParameters, InternalParameters): Added
10195         support for varargs methods.    
10196
10197 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
10198
10199         * class.cs: Provide location in indexer error report.
10200
10201         * driver.cs: Use standard names.
10202
10203         * namespace.cs: Catch the use of using after a namespace has been
10204         declared also on using aliases.
10205
10206 2004-06-03  Raja R Harinath  <rharinath@novell.com>
10207
10208         Bug #50820.
10209         * typemanager.cs (closure_private_ok, closure_invocation_type)
10210         (closure_qualifier_type, closure_invocation_assembly)
10211         (FilterWithClosure): Move to ...
10212         (Closure): New internal nested class.
10213         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
10214         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
10215         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
10216         (MemberLookup, MemberLookupFailed): Use it.
10217         * expression.cs (New.DoResolve): Treat the lookup for the
10218         constructor as being qualified by the 'new'ed type.
10219         (Indexers.GetIndexersForTypeOrInterface): Update.
10220
10221 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
10222
10223         * attribute.cs
10224         (GetConditionalAttributeValue): New method. Returns
10225         condition of ConditionalAttribute.
10226         (SearchMulti): New method.  Returns all attributes of type 't'.
10227         Use it when attribute is AllowMultiple = true.
10228         (IsConditionalMethodExcluded): New method.
10229
10230         * class.cs
10231         (Method.IsExcluded): Implemented. Returns true if method has conditional
10232         attribute and the conditions is not defined (method is excluded).
10233         (IMethodData): Extended interface for ConditionalAttribute support.
10234         (PropertyMethod.IsExcluded): Implemented.
10235
10236         * decl.cs
10237         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
10238
10239         * expression.cs
10240         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
10241         on the method.
10242
10243 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10244
10245         * expression.cs (ArrayCreationExpression): Make this just an
10246         `expression'. It can't be a statement, so the code here was
10247         dead.
10248
10249 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10250
10251         Fixed #59072
10252         * typemanager.cs (GetFullNameSignature): New method for
10253         MethodBase types.
10254
10255 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10256
10257         Fixed #56452
10258         * class.cs (MemberBase.GetSignatureForError): New virtual method.
10259         Use this method when MethodBuilder is null.
10260         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
10261         Added test for error CS0626 (MONO reports error for this situation).
10262         (IMethodData.GetSignatureForError): Extended interface.
10263
10264 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10265
10266         * attribute.cs
10267         (AttributeTester.GetObsoleteAttribute): Returns instance of
10268         ObsoleteAttribute when type is obsolete.
10269
10270         * class.cs
10271         (TypeContainer.VerifyObsoleteAttribute): Override.
10272         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10273         (MethodCode.VerifyObsoleteAttribute): Override.
10274         (MemberBase.VerifyObsoleteAttribute): Override.
10275
10276         * decl.cs
10277         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10278         and report proper error.
10279
10280         *delegate.cs
10281         Delegate.VerifyObsoleteAttribute): Override.
10282
10283         * ecore.cs
10284         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10285         and report proper error.
10286         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10287
10288         * enum.cs
10289         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10290         and enum member.
10291
10292         * expression.cs
10293         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10294         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10295         Added test for ObsoleteAttribute.
10296
10297         * statement.cs
10298         (Catch): Derived from Statement.
10299
10300 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10301  
10302         Fixed bug #59071 & cs0160.cs
10303  
10304         * statement.cs (Try.Resolve): Check here whether order of catch
10305         clauses matches their dependencies.
10306
10307 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
10308
10309         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
10310         caused a regression: #59343.  Referencing nested classes from an
10311         assembly stopped working.
10312
10313 2004-05-31  Martin Baulig  <martin@ximian.com>
10314
10315         MCS is now frozen for beta 2.
10316
10317 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10318
10319         * convert.cs: add a trivial cache for overload operator resolution.
10320
10321 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10322
10323         * decl.cs: If possible, use lookuptypedirect here. We can only do
10324         this if there is no `.' after the namespace. Avoids using
10325         LookupType, which does lots of slow processing.
10326         (FindNestedType) New method, does what it says :-).
10327         * namespace.cs: use LookupTypeDirect.
10328         * rootcontext.cs: use membercache, if possible.
10329         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10330
10331 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10332
10333         * expression.cs:
10334         According to the spec, 
10335
10336         In a member access of the form E.I, if E is a single identifier,
10337         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10338         field, property, localvariable, or parameter with the same type as
10339         the meaning of E as a type-name (§3.8), then both possible
10340         meanings of E are permitted.
10341
10342         We did not check that E as a simple-name had the same type as E as
10343         a type name.
10344
10345         This trivial check gives us 5-7% on bootstrap time.
10346
10347 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10348
10349         * expression.cs (Invocation.OverloadResolve): Avoid the
10350         use of hashtables and boxing here by allocating on demand.
10351
10352 2004-05-30  Martin Baulig  <martin@ximian.com>
10353
10354         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10355         we're doing a silent lookup.  Don't try to lookup nested types in
10356         TypeManager.object_type (thanks to Ben Maurer).
10357
10358 2004-05-30  Martin Baulig  <martin@ximian.com>
10359
10360         Committing a patch from Ben Maurer.
10361
10362         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10363
10364 2004-05-29  Martin Baulig  <martin@ximian.com>
10365
10366         * class.cs (IMethodData.ShouldIgnore): New method.
10367
10368         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10369         `Location' argument, we don't need it anywhere.  Use
10370         `IMethodData.ShouldIgnore ()' instead of
10371         `MethodData.GetMethodFlags ()'.
10372         (TypeManager.AddMethod): Removed.
10373         (TypeManager.AddMethod2): Renamed to AddMethod.
10374
10375 2004-05-29  Martin Baulig  <martin@ximian.com>
10376
10377         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10378
10379         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10380         converting from a class type S to an interface type and we already
10381         have an object on the stack, don't box it again.  Fixes #52578.
10382
10383 2004-05-29  Martin Baulig  <martin@ximian.com>
10384
10385         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10386         Added support for `params' parameters.  Fixes #59267.
10387
10388 2004-05-29  Martin Baulig  <martin@ximian.com>
10389
10390         * literal.cs (NullPointer): Provide a private .ctor which sets
10391         `type' to TypeManager.object_type.  Fixes #59048.
10392
10393 2004-05-29  Martin Baulig  <martin@ximian.com>
10394
10395         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10396         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10397
10398         * ecore.cs (EventExpr.instance_expr): Make the field private.
10399
10400 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10401
10402         Fixed bug #50080 & cs0214-2.cs
10403         * expression.cs (Cast.DoResolve): Check unsafe context here.
10404         
10405         * statement.cs (Resolve.DoResolve): Likewise.
10406
10407 2004-05-26  Martin Baulig  <martin@ximian.com>
10408
10409         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10410
10411         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10412         (RootContext.LookupType): Pass down the `silent' flag.
10413
10414 2004-05-25  Martin Baulig  <martin@ximian.com>
10415
10416         * expression.cs
10417         (MethodGroupExpr.IdenticalTypeName): New public property.
10418         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10419         expression actually refers to a type.
10420
10421 2004-05-25  Martin Baulig  <martin@ximian.com>
10422
10423         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10424         for #56176 and made it actually work.
10425
10426 2004-05-25  Martin Baulig  <martin@ximian.com>
10427
10428         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10429         (FieldExpr, PropertyExpr): Override and implement
10430         CacheTemporaries.  Fixes #52279.
10431
10432 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10433
10434         * location.cs: In the new compiler listing a file twice is a
10435         warning, not an error.
10436
10437 2004-05-24  Martin Baulig  <martin@ximian.com>
10438
10439         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10440         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10441
10442 2004-05-24  Martin Baulig  <martin@ximian.com>
10443
10444         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10445         walking the `using' list.  Fixes #53921.
10446
10447 2004-05-24  Martin Baulig  <martin@ximian.com>
10448
10449         * const.cs (Const.LookupConstantValue): Added support for
10450         EmptyCast's; fixes #55251.
10451
10452 2004-05-24  Martin Baulig  <martin@ximian.com>
10453
10454         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10455         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10456         which does the CS0135 check.  The reason is that we first need to
10457         check whether the variable actually exists.
10458
10459 2004-05-24  Martin Baulig  <martin@ximian.com>
10460
10461         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10462         than RootContext.LookupType() to find the explicit interface
10463         type.  Fixes #58584.
10464
10465 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10466
10467         * Makefile: Simplify.  Use executable.make.
10468         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10469
10470 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10471
10472         * decl.cs:
10473         * enum.cs:
10474         Use the invariant culture when doing String.Compare for CLS case
10475         sensitivity.
10476         
10477 2004-05-23  Martin Baulig  <martin@ximian.com>
10478
10479         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10480         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10481
10482         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10483         
10484 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10485
10486         * class.cs (MemberBase.Define): Reuse MemberType member for 
10487         resolved type. Other methods can use it too.
10488
10489 2004-05-23  Martin Baulig  <martin@ximian.com>
10490
10491         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10492         the variable also exists in the current block (otherwise, we need
10493         to report a CS0103).  Fixes #58670.
10494
10495 2004-05-23  Martin Baulig  <martin@ximian.com>
10496
10497         * flowanalysis.cs (Reachability.Reachable): Compute this
10498         on-the-fly rather than storing it as a field.
10499
10500 2004-05-23  Martin Baulig  <martin@ximian.com>
10501
10502         * flowanalysis.cs (Reachability.And): Manually compute the
10503         resulting `barrier' from the reachability.      
10504        
10505 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10506
10507         Fix bug #57835
10508         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10509         instance of ObsoleteAttribute when symbol is obsolete.
10510
10511         * class.cs
10512         (IMethodData): Extended interface for ObsoleteAttribute support.
10513
10514 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10515
10516         * attribute.cs: Fix bug #55970
10517
10518 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10519
10520         Fix bug #52705
10521         * attribute.cs
10522         (GetObsoleteAttribute): New method. Creates the instance of
10523         ObsoleteAttribute.
10524         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10525         ObsoleteAttribute when member is obsolete.
10526         (AttributeTester.Report_ObsoleteMessage): Common method for
10527         Obsolete error/warning reporting.
10528
10529         * class.cs
10530         (TypeContainer.base_classs_type): New member for storing parent type.
10531
10532         * decl.cs
10533         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10534         for this MemberCore.
10535
10536 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10537
10538         * attribute.cs, const.cs: Fix bug #58590
10539
10540 2004-05-21  Martin Baulig  <martin@ximian.com>
10541
10542         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10543         out parameters if the end of the method is unreachable.  Fixes
10544         #58098. 
10545
10546 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10547
10548         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10549         Hari was right, why extra method.
10550
10551 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10552
10553         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10554
10555 2004-05-20  Martin Baulig  <martin@ximian.com>
10556
10557         Merged this back from gmcs to keep the differences to a minumum.
10558
10559         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
10560         instead of a Declspace.
10561         (Attribute.ResolveType): Likewise.
10562         (Attributes.Search): Likewise.
10563         (Attributes.Contains): Likewise.
10564         (Attributes.GetClsCompliantAttribute): Likewise.
10565
10566         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
10567         argument.
10568         (MethodData.ApplyAttributes): Take an EmitContext instead of a
10569         DeclSpace.
10570
10571 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10572
10573         Fix bug #58688 (MCS does not report error when the same attribute
10574         is assigned twice)
10575
10576         * attribute.cs (Attribute.Emit): Distinction between null and default.
10577
10578 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10579
10580         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10581         of a top-level attribute without an attribute target.
10582         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10583         Make non-static.
10584         (Attribute.Conditional_GetConditionName), 
10585         (Attribute.Obsolete_GetObsoleteMessage): Update.
10586         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10587         part of ScanForIndexerName.
10588         (Attribute.CanIgnoreInvalidAttribute): New function.
10589         (Attribute.ScanForIndexerName): Move to ...
10590         (Attributes.ScanForIndexerName): ... here.
10591         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10592         (Attributes.Search): New internal variant that can choose not to
10593         complain if types aren't resolved.  The original signature now
10594         complains.
10595         (Attributes.GetClsCompliantAttribute): Use internal variant, with
10596         complaints suppressed.
10597         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10598         only if it not useful.
10599         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10600         top-level for attributes that are shared between the assembly
10601         and a top-level class.
10602         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10603         * class.cs: Update to reflect changes.
10604         (DefineIndexers): Fuse loops.
10605         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10606         a couple more variants of attribute names.
10607
10608 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10609
10610         Fix bug #52585 (Implemented explicit attribute declaration)
10611
10612         * attribute.cs:
10613         (Attributable.ValidAttributeTargets): New abstract method. It gets
10614         list of valid attribute targets for explicit target declaration.
10615         (Attribute.Target): It holds target itself.
10616         (AttributeSection): Removed.
10617         (Attribute.CheckTargets): New method. It checks whether attribute
10618         target is valid for the current element.
10619
10620         * class.cs:
10621         (EventProperty): New class. For events that are declared like
10622         property (with add and remove accessors).
10623         (EventField): New class. For events that are declared like field.
10624         class.cs
10625
10626         * cs-parser.jay: Implemented explicit attribute target declaration.
10627
10628         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10629         Override ValidAttributeTargets.
10630
10631         * parameter.cs:
10632         (ReturnParameter): Class for applying custom attributes on 
10633         the return type.
10634         (ParameterAtribute): New class. Class for applying custom
10635         attributes on the parameter type.
10636
10637 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10638
10639         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10640         definitions. 
10641
10642         (Method): Allow UNSAFE here.
10643
10644         * modifiers.cs: Support unsafe reporting.
10645
10646 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10647
10648         * decl.cs: Fix bug #58478.
10649
10650 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10651
10652         * statement.cs: When checking for unreachable code on an EmptyStatement,
10653         set the location. Fixes bug #58488.
10654
10655 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10656
10657         * driver.cs: Add -pkg handling.
10658
10659         From Gonzalo: UseShelLExecute=false
10660
10661 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10662
10663         * attribute.cs:
10664         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10665         for attribute.
10666         (Attribute.IsClsCompliaceRequired): Moved to base for better
10667         accesibility.
10668         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10669         when attribute is AttributeUsageAttribute.
10670         (Attribute.GetValidTargets): Simplified.
10671         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10672         attribute for this type.
10673         (Attribute.ApplyAttributes): Method renamed to Emit and make
10674         non-static.
10675         (GlobalAttributeSection): New class for special handling of global
10676         attributes (assembly, module).
10677         (AttributeSection.Emit): New method.
10678
10679         * class.cs: Implemented Attributable abstract methods.
10680         (MethodCore.LabelParameters): Moved to Parameter class.
10681         (Accessor): Is back simple class.
10682         (PropertyMethod): Implemented Attributable abstract class.
10683         (DelegateMethod): Implemented Attributable abstract class.
10684         (Event): New constructor for disctintion between normal Event
10685         and Event with accessors.
10686
10687         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10688
10689         * codegen.cs, const.cs, decl.cs, delegate.cs:
10690         (CommonAssemblyModulClass): Implemented Attributable abstract class
10691         and simplified.
10692
10693         * enum.cs: Implement IAttributeSupport interface.
10694         (EnumMember): New class for emum members. Implemented Attributable
10695         abstract class
10696
10697         * parameter.cs:
10698         (ParameterBase): Is abstract.
10699         (ReturnParameter): New class for easier [return:] attribute handling.
10700
10701         * typemanager.cs: Removed builder_to_attr.
10702
10703 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10704
10705         Fix bug #57151.
10706         * attribute.cs (Attribute.GetPositionalValue): New function.
10707         * class.cs (TypeContainer.VerifyMembers): New function.
10708         (TypeContainer.Emit): Use it.
10709         (ClassOrStruct): New base class for Class and Struct.
10710         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10711         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10712         class.
10713         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10714         then each non-static field should have a FieldOffset attribute.
10715         Otherwise, none of the fields should have a FieldOffset attribute.
10716         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
10717         and FieldOffset attributes.
10718         * typemanager.cs (TypeManager.struct_layout_attribute_type)
10719         (TypeManager.field_offset_attribute_type): New core types.
10720         (TypeManager.InitCoreTypes): Initialize them.
10721
10722 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
10723
10724         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10725         Return correct type.
10726         From bug #58270.
10727
10728 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
10729
10730         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10731         be implicitly converted to ulong.
10732         
10733         * expression.cs: The logic for allowing operator &, | and ^ worked
10734         was wrong, it worked before because we did not report an error in
10735         an else branch.  Fixes 57895.
10736
10737         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10738         allow volatile fields to be reference types.
10739
10740 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
10741
10742         * driver.cs: Add support for /debug-
10743
10744 2004-05-07  Raja R Harinath  <rharinath@novell.com>
10745
10746         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
10747         Add a 'complain' parameter to silence errors.
10748         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
10749         silently overlooked type-resolutions.
10750         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10751         to reflect changes.
10752         (Attributes.Search): New function.
10753         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10754         (Attributes.GetAttributeFullName): Remove hack.
10755         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
10756         Update to reflect changes.
10757         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10758         Use Attributes.Search instead of nested loops.
10759
10760 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
10761
10762         * decl.cs:
10763         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10764         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10765         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10766
10767         * report.cs: (Report.Warning): Renamed to Warning_T because of
10768         parameter collision.
10769
10770 2004-05-05  Raja R Harinath  <rharinath@novell.com>
10771
10772         * expression.cs (MemberAccess.ResolveMemberAccess):
10773         Exit with non-zero status after Report.Error.
10774         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10775         Likewise.
10776         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10777
10778 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10779
10780         * support.cs: Don't hang when the file is empty.
10781
10782 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10783
10784         * support.cs: In SeekableStreamReader, compute the preamble size of the
10785           underlying stream. Position changes should take into account that initial
10786           count of bytes.
10787
10788 2004-05-03  Todd Berman  <tberman@sevenl.net>
10789
10790         * driver.cs: remove unused GetSysVersion function.
10791
10792 2004-05-03  Todd Berman  <tberman@sevenl.net>
10793
10794         * driver.cs: Remove the hack from saturday, as well as the hack
10795         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10796         link_paths to get that bit proper.
10797
10798 2004-05-01  Todd Berman  <tberman@sevenl.net>
10799
10800         * driver.cs: Try a LoadFrom before a Load, this checks the current
10801         path. This is currently a bug in mono that is be fixed, however, this
10802         provides a workaround for now. This will be removed when the bug
10803         is fixed.
10804
10805 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10806
10807         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10808         incomplete key pairs (#57941).
10809
10810 2004-05-01  Todd Berman  <tberman@sevenl.net>
10811
10812         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10813         from the GAC
10814
10815 2004-04-30  Jackson Harper  <jackson@ximian.com>
10816
10817         * codegen.cs: Open keys readonly.
10818         
10819 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10820
10821         * typemanager.cs: don't report cyclic struct layout when a struct
10822         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10823         which has 2 Pango.Rectangle fields.
10824
10825 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10826
10827         * expression.cs: Handle IntPtr comparisons with IL code
10828         rather than a method call.
10829
10830 2004-04-29  Martin Baulig  <martin@ximian.com>
10831
10832         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10833         the list of PropertyInfo's in class hierarchy and find the
10834         accessor.  Fixes #56013.
10835
10836 2004-04-29  Martin Baulig  <martin@ximian.com>
10837
10838         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10839
10840 2004-04-29  Martin Baulig  <martin@ximian.com>
10841
10842         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10843
10844         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10845
10846 2004-04-29  Martin Baulig  <martin@ximian.com>
10847
10848         * class.cs (ConstructorInitializer.Resolve): Check whether the
10849         parent .ctor is accessible.  Fixes #52146.
10850
10851 2004-04-29  Martin Baulig  <martin@ximian.com>
10852
10853         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10854
10855         * statement.cs (Using.EmitLocalVariableDecls): Use
10856         TypeManager.idisposable_type, not typeof (IDisposable).
10857         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10858
10859 2004-04-29  Martin Baulig  <martin@ximian.com>
10860
10861         * class.cs (Event.Define): Don't emit the field and don't set
10862         RTSpecialName and SpecialName for events on interfaces.  Fixes
10863         #57703. 
10864
10865 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10866
10867         Refactor Attribute.ApplyAttributes.
10868         * attribute.cs (Attributable): New base class for objects that can
10869         have Attributes applied on them.
10870         (Attribute): Make AttributeUsage fields public.
10871         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10872         (Attribute.IsInternalCall): New property.
10873         (Attribute.UsageAttr): Convert to a public read-only property.
10874         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10875         (Attribute.ResolveType, Attribute.Resolve)
10876         (Attribute.ScanForIndexerName): Update to reflect changes.
10877         (Attribute.CheckAttributeTarget): Re-format.
10878         (Attribute.ApplyAttributes): Refactor, to various
10879         Attributable.ApplyAttributeBuilder methods.
10880         * decl.cs (MemberCore): Make Attributable.
10881         * class.cs (Accessor): Make Attributable.
10882         (MethodData.ApplyAttributes): Use proper attribute types, not
10883         attribute names.
10884         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10885         (TypeContainer.ApplyAttributeBuilder)
10886         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10887         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10888         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10889         (Operator.ApplyAttributeBuilder): New factored-out methods.
10890         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10891         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10892         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10893         * parameter.cs (ParameterBase): New Attributable base class
10894         that can also represent Return types.
10895         (Parameter): Update to the changes.
10896
10897 2004-04-29  Jackson Harper  <jackson@ximian.com>
10898
10899         * driver.cs: Prefer the corlib system version when looking for
10900         assemblies in the GAC. This is still a hack, but its a better hack
10901         now.
10902         
10903 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10904
10905         * decl.cs, enum.cs: Improved error 3005 reporting.
10906   
10907         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10908         (related_symbols): New private member for list of symbols
10909         related to reported error/warning.
10910         
10911         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10912
10913 2004-04-29  Martin Baulig  <martin@ximian.com>
10914
10915         * ecore.cs (Expression.Constantify): If we're an enum and
10916         TypeManager.TypeToCoreType() doesn't give us another type, use
10917         t.UnderlyingSystemType.  Fixes #56178.  
10918
10919 2004-04-29  Martin Baulig  <martin@ximian.com>
10920
10921         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10922         interfaces and for each interface, only add members directly
10923         declared in that interface.  Fixes #53255.
10924
10925 2004-04-28  Martin Baulig  <martin@ximian.com>
10926
10927         * expression.cs (ConditionalLogicalOperator): Use a temporary
10928         variable for `left' to avoid that we evaluate it more than once;
10929         bug #52588.
10930
10931 2004-04-28  Martin Baulig  <martin@ximian.com>
10932
10933         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10934         `void[]' (CS1547).
10935
10936 2004-04-28  Martin Baulig  <martin@ximian.com>
10937
10938         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10939         void (CS1547).
10940
10941         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10942         whether the type is not void (CS1547).
10943
10944 2004-04-28  Martin Baulig  <martin@ximian.com>
10945
10946         * expression.cs (Unary.DoResolveLValue): Override this and report
10947         CS0131 for anything but Operator.Indirection.
10948
10949 2004-04-28  Martin Baulig  <martin@ximian.com>
10950
10951         Committing a patch from Ben Maurer; see bug #50820.
10952
10953         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10954         check for classes.
10955
10956         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10957         classes.        
10958
10959 2004-04-28  Martin Baulig  <martin@ximian.com>
10960
10961         Committing a patch from Ben Maurer; see bug #50820.
10962
10963         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10964         check for classes.
10965
10966         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10967         classes.        
10968
10969 2004-04-28  Martin Baulig  <martin@ximian.com>
10970
10971         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10972         (Block.AddLabel): Call DoLookupLabel() to only search in the
10973         current block.
10974
10975 2004-04-28  Martin Baulig  <martin@ximian.com>
10976
10977         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10978         comparing StringConstants and NullLiterals in Equality and Inequality.
10979
10980 2004-04-28  Jackson Harper  <jackson@ximian.com>
10981
10982         * driver.cs: Attempt to load referenced assemblies from the
10983         GAC. This is the quick and dirty version of this method that
10984         doesnt take into account versions and just takes the first
10985         canidate found. Will be good enough for now as we will not have more
10986         then one version installed into the GAC until I update this method.
10987
10988 2004-04-28  Martin Baulig  <martin@ximian.com>
10989
10990         * typemanager.cs (TypeManager.CheckStructCycles): New public
10991         static method to check for cycles in the struct layout.
10992
10993         * rootcontext.cs (RootContext.PopulateTypes): Call
10994         TypeManager.CheckStructCycles() for each TypeContainer.
10995         [Note: We only need to visit each type once.]
10996
10997 2004-04-28  Martin Baulig  <martin@ximian.com>
10998
10999         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11000
11001         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11002         success and added `out object value'.  Use a `bool resolved' field
11003         to check whether we've already been called rather than
11004         `ConstantValue != null' since this breaks for NullLiterals.
11005
11006 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11007
11008         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11009         setting of this flag, since the 'set' method may be non-public.
11010
11011 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11012
11013         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11014         check on current_vector.Block.
11015
11016 2004-04-27  Martin Baulig  <martin@ximian.com>
11017
11018         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11019         a field initializer.  Fixes #56459.
11020
11021 2004-04-27  Martin Baulig  <martin@ximian.com>
11022
11023         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11024         we're not attempting to use an indexer.  Fixes #52154.
11025
11026 2004-04-27  Martin Baulig  <martin@ximian.com>
11027
11028         * statement.cs (Return): Don't create a return label if we don't
11029         need it; reverts my change from January 20th.  Thanks to Ben
11030         Maurer for this.
11031
11032 2004-04-27  Martin Baulig  <martin@ximian.com>
11033
11034         According to the spec, `goto' can only leave a nested scope, but
11035         never enter it.
11036
11037         * statement.cs (Block.LookupLabel): Only lookup in the current
11038         block, don't recurse into parent or child blocks.
11039         (Block.AddLabel): Check in parent and child blocks, report
11040         CS0140/CS0158 if we find a duplicate.
11041         (Block): Removed this indexer for label lookups.
11042         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11043         this already does the error reporting for us.
11044
11045         * flowanalysis.cs
11046         (FlowBranching.UsageVector.Block): New public variable; may be null.
11047         (FlowBranching.CreateSibling): Added `Block' argument.
11048         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11049         label for the target of a `goto' and check whether we're not
11050         leaving a `finally'.
11051
11052 2004-04-27  Martin Baulig  <martin@ximian.com>
11053
11054         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11055         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11056         just for returns).
11057
11058 2004-04-27  Martin Baulig  <martin@ximian.com>
11059
11060         * statement.cs (Block.AddLabel): Also check for implicit blocks
11061         and added a CS0158 check.
11062
11063 2004-04-27  Martin Baulig  <martin@ximian.com>
11064
11065         * flowanalysis.cs (FlowBranchingLoop): New class.
11066         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11067         UsageVector's instead of an ArrayList.
11068         (FlowBranching.Label): Likewise.
11069         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11070         (FlowBranching.AddBreakVector): New method.
11071
11072 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11073
11074         * attribute.cs: Small regression fix: only convert the type if we
11075         the type is different, fixes System.Drawing build.
11076
11077 2004-04-27  Martin Baulig  <martin@ximian.com>
11078
11079         * attribute.cs (Attribute.Resolve): If we have a constant value
11080         for a named field or property, implicity convert it to the correct
11081         type.
11082
11083 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11084
11085         * statement.cs (Block.Block): Implicit blocks share
11086         'child_variable_names' fields with parent blocks.
11087         (Block.AddChildVariableNames): Remove.
11088         (Block.AddVariable): Mark variable as "used by a child block" in
11089         every surrounding block.
11090         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11091         been used in a child block, complain about violation of "Invariant
11092         meaning in blocks" rule.
11093         * cs-parser.jay (declare_local_variables): Don't use
11094         AddChildVariableNames.
11095         (foreach_statement): Don't create an implicit block: 'foreach'
11096         introduces a scope.
11097
11098 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11099
11100         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11101         converting from 0L to ulong.  Fixes 57522.
11102
11103 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11104
11105         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11106         derived class hides via 'new' keyword field from base class (test-242.cs).
11107         TODO: Handle this in the more general way.
11108         
11109         * class.cs (CheckBase): Ditto.
11110
11111 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11112
11113         * decl.cs (caching_flags): New member for storing cached values
11114         as bit flags.
11115         (MemberCore.Flags): New enum where bit flags for caching_flags
11116         are defined.
11117         (MemberCore.cls_compliance): Moved to caching_flags.
11118         (DeclSpace.Created): Moved to caching_flags.
11119
11120         * class.cs: Use caching_flags instead of DeclSpace.Created
11121         
11122 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11123
11124         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11125         if we are only a derived class, not a nested class.
11126
11127         * typemanager.cs: Same as above, but do this at the MemberLookup
11128         level (used by field and methods, properties are handled in
11129         PropertyExpr).   Allow for the qualified access if we are a nested
11130         method. 
11131
11132 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11133
11134         * class.cs: Refactoring.
11135         (IMethodData): New inteface; Holds links to parent members
11136         to avoid member duplication (reduced memory allocation).
11137         (Method): Implemented IMethodData interface.
11138         (PropertyBase): New inner classes for get/set methods.
11139         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11140         (Event): New inner classes for add/remove methods.
11141         (Event.DelegateMethod): Implemented IMethodData interface.
11142
11143         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11144         EmitContext (related to class.cs refactoring).
11145
11146 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11147
11148         * delegate.cs (Delegate.VerifyApplicability): If the number of
11149         arguments are the same as the number of parameters, first try to
11150         verify applicability ignoring  any 'params' modifier on the last
11151         parameter.
11152         Fixes #56442.
11153
11154 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11155
11156         * class.cs (TypeContainer.AddIndexer): Use
11157         'ExplicitInterfaceName' to determine if interface name was
11158         explicitly specified.  'InterfaceType' is not initialized at this time.
11159         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11160         Indexers array is already in the required order.  Initialize
11161         'IndexerName' only if there are normal indexers.
11162         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11163         (TypeContainer.Emit): Emit DefaultMember attribute only if
11164         IndexerName is initialized.
11165         Fixes #56300.
11166
11167 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11168
11169         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11170         Fixes #57007
11171
11172 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11173
11174         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11175         attributes.
11176         Fix for #56456.
11177
11178         * attribute.cs (Attribute.Resolve): Check for duplicate named
11179         attributes.
11180         Fix for #56463.
11181
11182 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11183
11184         * iterators.cs (MarkYield): track whether we are in an exception,
11185         and generate code accordingly.  Use a temporary value to store the
11186         result for our state.
11187
11188         I had ignored a bit the interaction of try/catch with iterators
11189         since their behavior was not entirely obvious, but now it is
11190         possible to verify that our behavior is the same as MS .NET 2.0
11191
11192         Fixes 54814
11193
11194 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11195
11196         * iterators.cs: Avoid creating temporaries if there is no work to
11197         do. 
11198
11199         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11200         Enumerations, use TypeManager.EnumToUnderlying and call
11201         recursively. 
11202
11203         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11204         bug #57013
11205
11206         (This.Emit): Use EmitContext.EmitThis to emit our
11207         instance variable.
11208
11209         (This.EmitAssign): Ditto.
11210
11211         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11212         codepaths, we will move all the functionality into
11213         Mono.CSharp.This 
11214
11215         (FieldExpr.EmitAssign): Ditto.
11216
11217         This fixes several hidden bugs that I uncovered while doing a code
11218         review of this today.
11219
11220         * codegen.cs (EmitThis): reworked so the semantics are more clear
11221         and also support value types "this" instances.
11222
11223         * iterators.cs: Changed so that for iterators in value types, we
11224         do not pass the value type as a parameter.  
11225
11226         Initialization of the enumerator helpers is now done in the caller
11227         instead of passing the parameters to the constructors and having
11228         the constructor set the fields.
11229
11230         The fields have now `assembly' visibility instead of private.
11231
11232 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11233
11234         * expression.cs (Argument.Resolve): Check if fields passed as ref
11235         or out are contained in a MarshalByRefObject.
11236
11237         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11238         another compiler type.
11239
11240 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11241
11242         * class.cs (Indexer.Define): use the new name checking method.
11243         Also, return false on an error.
11244         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11245         (is_identifier_[start/part]_character): make static.
11246
11247 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11248
11249         * expression.cs (Binary.ResolveOperator): Do no append strings
11250         twice: since we can be invoked more than once (array evaluation)
11251         on the same concatenation, take care of this here.  Based on a fix
11252         from Ben (bug #56454)
11253
11254 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11255
11256         * codegen.cs: Fix another case where CS1548 must be reported (when 
11257         delay-sign isn't specified and no private is available #56564). Fix
11258         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11259         error when MCS is used on the MS runtime and we need to delay-sign 
11260         (which seems unsupported by AssemblyBuilder - see #56621).
11261
11262 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11263
11264         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11265         (TypeManager.ComputeNamespaces): Faster implementation for
11266         Microsoft runtime.
11267
11268         * compiler.csproj: Updated AssemblyName to mcs.
11269
11270 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11271
11272         * rootcontext.cs: Add new types to the boot resolution.
11273
11274         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11275         MulticastDelegate is not allowed.
11276
11277         * typemanager.cs: Add new types to lookup: System.TypedReference
11278         and ArgIterator.
11279
11280         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11281         check for TypedReference or ArgIterator, they are not allowed. 
11282
11283         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11284         makes us properly catch 1510 in some conditions (see bug 56016 for
11285         details). 
11286
11287 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11288
11289         * CryptoConvert.cs: update from corlib version
11290         with endian fixes.
11291
11292 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11293
11294         * class.cs (Indexer.Define): Check indexername declaration
11295
11296 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
11297
11298         * attribute.cs (IsClsCompliant): Fixed problem with handling
11299         all three states (compliant, not-compliant, undetected).
11300
11301 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
11302
11303         * attribute.cs (Attribute): Location is now public.
11304         (Resolve): Store resolved arguments (pos_values) in attribute class.
11305         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11306         (GetClsCompliantAttributeValue): New method that gets
11307         CLSCompliantAttribute value.
11308         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11309         if exists else null.
11310         (AttributeTester): New class for CLS-Compliant verification routines.
11311
11312         * class.cs (Emit): Add CLS-Compliant verification.
11313         (Method.GetSignatureForError): Implemented.
11314         (Constructor.GetSignatureForError): Implemented
11315         (Constructor.HasCompliantArgs): Returns if constructor has
11316         CLS-Compliant arguments.
11317         (Constructor.Emit): Override.
11318         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11319         is needed to test only parameters.
11320         (FieldBase.GetSignatureForError): Implemented.
11321         (TypeContainer): New member for storing base interfaces.
11322         (TypeContainer.FindMembers): Search in base interfaces too.
11323
11324         * codegen.cs (GetClsComplianceAttribute): New method that gets
11325         assembly or module CLSCompliantAttribute value.
11326         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11327         for assembly.
11328         (ModuleClass.Emit): Add error 3012 test.
11329
11330         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11331
11332         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11333         state for all decl types.
11334         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11335         if CLS-Compliant tests are required.
11336         (IsClsCompliaceRequired): New method. Analyze whether code
11337         must be CLS-Compliant.
11338         (IsExposedFromAssembly): New method. Returns true when MemberCore
11339         is exposed from assembly.
11340         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11341         value or gets cached value.
11342         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11343         is explicitly marked with CLSCompliantAttribute.
11344         (IsIdentifierClsCompliant): New abstract method. This method is
11345         used to testing error 3005.
11346         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11347         for identifier and parameters CLS-Compliant testing.
11348         (VerifyClsCompliance): New method. The main virtual method for
11349         CLS-Compliant verifications.
11350         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11351         null. I don't know why is null (too many public members !).
11352         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11353         and get value of first CLSCompliantAttribute that found.
11354
11355         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11356         (VerifyClsCompliance): Override and add extra tests.
11357
11358         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11359         clscheck- disable CLS-Compliant verification event if assembly is has
11360         CLSCompliantAttribute(true).
11361
11362         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11363         ApllyAttribute is now called in emit section as in the other cases.
11364         Possible future Emit integration.
11365         (IsIdentifierClsCompliant): New override.
11366         (VerifyClsCompliance): New override.
11367         (GetEnumeratorName): Returns full enum name.
11368
11369         * parameter.cs (GetSignatureForError): Implemented.
11370
11371         * report.cs (WarningData): New struct for Warning message information.
11372         (LocationOfPreviousError): New method.
11373         (Warning): New method. Reports warning based on the warning table.
11374         (Error_T): New method. Reports error based on the error table.
11375
11376         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11377         verifications are done here.
11378
11379         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11380
11381         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11382         CLSCompliantAttribute.
11383         (all_imported_types): New member holds all imported types from other
11384         assemblies.
11385         (LoadAllImportedTypes): New method fills static table with exported types
11386         from all referenced assemblies.
11387         (Modules): New property returns all assembly modules.
11388
11389 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11390
11391         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11392         throwing a parser error.
11393
11394         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11395         which removes the hardcoded get_/set_ prefixes for properties, as
11396         IL allows for the properties to be named something else.  
11397
11398         Bug #56013
11399
11400         * expression.cs: Do not override operand before we know if it is
11401         non-null.  Fix 56207
11402
11403 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11404
11405         * typemanager.cs: support for pinned variables.
11406
11407 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11408
11409         * decl.cs, typemanager.cs: Avoid using an arraylist
11410         as a buffer if there is only one result set.
11411
11412 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11413
11414         * expression.cs: Make sure you cant call a static method
11415         with an instance expression, bug #56174.
11416
11417 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
11418
11419         * class.cs (IsDuplicateImplementation): Improve error reporting to
11420         flag 663 (method only differs in parameter modifier).
11421
11422         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11423         in preprocessor directives.
11424
11425         * location.cs (LookupFile): Allow for the empty path.
11426
11427         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
11428         better approach for some of that patch, but its failing with the
11429         CharSet enumeration.  For now try/catch will do.
11430
11431         * typemanager.cs: Do not crash if a struct does not have fields.
11432         Fixes 56150.
11433
11434 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11435
11436         * expression.cs: cs0213, cant fix a fixed expression.
11437         fixes 50231.
11438
11439 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11440
11441         * cs-parser.jay: detect invalid embeded statements gracefully.
11442         bug #51113.
11443
11444 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11445
11446         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11447         As a regex:
11448         s/
11449         the invocation type may not be a subclass of the tye of the item/
11450         The type of the item must be a subclass of the invocation item.
11451         /g
11452
11453         Fixes bug #50820.
11454
11455 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11456
11457         * attribute.cs: Added methods to get a string and a bool from an
11458         attribute. Required to information from AssemblyKeyFileAttribute,
11459         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11460         * codegen.cs: Modified AssemblyName creation to include support for
11461         strongnames. Catch additional exceptions to report them as CS1548.
11462         * compiler.csproj: Updated include CryptoConvert.cs.
11463         * compiler.csproj.user: Removed file - user specific configuration.
11464         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11465         Mono.Security assembly. The original class is maintained and tested in
11466         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11467         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11468         like CSC 8.0 (C# v2) supports.
11469         * Makefile: Added CryptoConvert.cs to mcs sources.
11470         * rootcontext.cs: Added new options for strongnames.
11471
11472 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11473
11474         * driver.cs: For --expect-error, report error code `2'
11475         if the program compiled with no errors, error code `1' if
11476         it compiled with an error other than the one expected.
11477
11478 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11479
11480         * compiler.csproj: Updated for Visual Studio .NET 2003.
11481         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11482         * compiler.sln: Updated for Visual Studio .NET 2003.
11483
11484 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11485
11486         * expression.cs: Fix bug #47234. We basically need to apply the
11487         rule that we prefer the conversion of null to a reference type
11488         when faced with a conversion to 'object' (csc behaviour).
11489
11490 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11491
11492         * statement.cs: Shorter form for foreach, eliminates
11493         a local variable. r=Martin.
11494
11495 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11496
11497         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11498         checks if we can use brtrue/brfalse to test for 0.
11499         * expression.cs: use the above in the test for using brtrue/brfalse.
11500         cleanup code a bit.
11501
11502 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11503
11504         * expression.cs: Rewrite string concat stuff. Benefits:
11505
11506         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11507         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11508         rather than a concat chain.
11509
11510         * typemanager.cs: Add lookups for more concat overloads.
11511
11512 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11513
11514         * expression.cs: Emit shorter il code for array init.
11515
11516         newarr
11517         dup
11518         // set 1
11519
11520         // set 2
11521
11522         newarr
11523         stloc.x
11524
11525         ldloc.x
11526         // set 1
11527
11528         ldloc.x
11529         // set 2
11530
11531 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11532
11533         * statement.cs: Before, two switch blocks would be merged if the
11534         total size of the blocks (end_item - begin_item + 1) was less than
11535         two times the combined sizes of the blocks.
11536
11537         Now, it will only merge if after the merge at least half of the
11538         slots are filled.
11539
11540         fixes 55885.
11541
11542 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11543
11544         * class.cs : csc build fix for GetMethods(). See bug #52503.
11545
11546 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11547
11548         * expression.cs: Make sure fp comparisons work with NaN.
11549         This fixes bug #54303. Mig approved this patch a long
11550         time ago, but we were not able to test b/c the runtime
11551         had a related bug.
11552
11553 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11554
11555         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11556
11557 2004-03-19  Martin Baulig  <martin@ximian.com>
11558
11559         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11560         error here and not in our caller.
11561
11562 2004-03-19  Martin Baulig  <martin@ximian.com>
11563
11564         * interface.cs: Completely killed this file.
11565         (Interface): We're now a TypeContainer and live in class.cs.
11566
11567         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11568         argument; we're now also called for interfaces.
11569         (TypeContainer.DefineMembers): Allow this method being called
11570         multiple times.
11571         (TypeContainer.GetMethods): New public method; formerly known as
11572         Interface.GetMethod().  This is used by PendingImplementation.
11573         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11574         it's now private and non-static.
11575         (Interface): Moved this here; it's now implemented similar to
11576         Class and Struct.
11577         (Method, Property, Event, Indexer): Added `bool is_interface'
11578         argument to their .ctor's.
11579         (MemberBase.IsInterface): New public field.
11580
11581         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11582         instances instead of InterfaceMethod, InterfaceProperty, etc.
11583         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11584         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11585
11586 2004-03-19  Martin Baulig  <martin@ximian.com>
11587
11588         * class.cs (MethodCore.IsDuplicateImplementation): New private
11589         method which does the CS0111 checking.
11590         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11591         Use IsDuplicateImplementation().
11592
11593 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11594
11595         * decl.cs (FindMemberToOverride): New method to find the correct
11596         method or property to override in the base class.
11597         * class.cs
11598             - Make Method/Property use the above method to find the
11599               version in the base class.
11600             - Remove the InheritableMemberSignatureCompare as it is now
11601               dead code.
11602
11603         This patch makes large code bases much faster to compile, as it is
11604         O(n) rather than O(n^2) to do this validation.
11605
11606         Also, it fixes bug 52458 which is that nested classes are not
11607         taken into account when finding the base class member.
11608
11609         Reviewed/Approved by Martin.
11610
11611 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11612
11613         * interface.cs: In all interface classes removed redundant
11614         member initialization.
11615
11616 2004-03-16  Martin Baulig  <martin@ximian.com>
11617
11618         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11619
11620 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11621
11622         * decl.cs (DefineTypeAndParents): New helper method to define a
11623         type's containers before the type itself is defined;  This is a
11624         bug exposed by the recent changes to Windows.Forms when an
11625         implemented interface was defined inside a class that had not been
11626         built yet.   
11627
11628         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11629
11630         (Check): Loop correctly to report errors modifiers
11631         (UNSAFE was not in the loop, since it was the same as TOP).
11632
11633         * interface.cs: Every interface member now takes a ModFlags,
11634         instead of a "is_new" bool, which we set on the base MemberCore. 
11635
11636         Every place where we called "UnsafeOk" in the interface, now we
11637         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11638         the unsafe settings from the member declaration instead of the
11639         container interface. 
11640
11641         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11642
11643         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11644         `set_indexer_name' to the pending bits (one per type).
11645
11646         We fixed a bug today that was picking the wrong method to
11647         override, since for properties the existing InterfaceMethod code
11648         basically ignored the method name.  Now we make sure that the
11649         method name is one of the valid indexer names.
11650
11651 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11652  
11653         * support.cs (SeekableStreamReader): Keep track of stream byte
11654         positions and don't mix them with character offsets to the buffer.
11655
11656         Patch from Gustavo Giráldez
11657
11658 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11659
11660         * interface.cs (InterfaceSetGetBase): Removed double member
11661         initialization, base class does it as well.
11662
11663 2004-03-13  Martin Baulig  <martin@ximian.com>
11664
11665         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11666         when compiling corlib.
11667
11668 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11669
11670         * convert.cs (ExplicitConversion): We were reporting an error on
11671         certain conversions (object_type source to a value type, when the
11672         expression was `null') before we had a chance to pass it through
11673         the user defined conversions.
11674
11675         * driver.cs: Replace / and \ in resource specifications to dots.
11676         Fixes 50752
11677
11678         * class.cs: Add check for duplicate operators.  Fixes 52477
11679
11680 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11681
11682         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11683         that are in the middle of the statements, not only at the end.
11684         Fixes #54987
11685
11686         * class.cs (TypeContainer.AddField): No longer set the
11687         `HaveStaticConstructor' flag, now we call it
11688         `UserDefineStaticConstructor' to diferentiate the slightly
11689         semantic difference.
11690
11691         The situation is that we were not adding BeforeFieldInit (from
11692         Modifiers.TypeAttr) to classes that could have it.
11693         BeforeFieldInit should be set to classes that have no static
11694         constructor. 
11695
11696         See:
11697
11698         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11699
11700         And most importantly Zoltan's comment:
11701
11702         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11703
11704         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11705          before its static fields are used', i.e. initialization does not need
11706          to be triggered by the first access to the type. Setting this flag
11707          helps the JIT to compile better code, since it can run the static
11708          constructor at JIT time, and does not need to generate code to call it
11709          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11710          this flag for lots of classes like String. 
11711          
11712          csc sets this flag if the type does not have an explicit static 
11713          constructor. The reasoning seems to be that if there are only static
11714          initalizers for a type, and no static constructor, then the programmer
11715          does not care when this initialization happens, so beforefieldinit
11716          can be used.
11717          
11718          This bug prevents the AOT compiler from being usable, since it 
11719          generates so many calls to mono_runtime_class_init that the AOT code
11720          is much slower than the JITted code. The JITted code is faster, 
11721          because it does not generate these calls if the vtable is type is
11722          already initialized, which is true in the majority of cases. But the
11723          AOT compiler can't do this."
11724
11725 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11726
11727         * class.cs (MethodData.Emit): Refactor the code so symbolic
11728         information is generated for destructors;  For some reasons we
11729         were taking a code path that did not generate symbolic information
11730         before. 
11731
11732 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11733
11734         * class.cs: Create a Constructor.CheckBase method that
11735         takes care of all validation type code. The method
11736         contains some code that was moved from Define.
11737
11738         It also includes new code that checks for duplicate ctors.
11739         This fixes bug #55148.
11740
11741 2004-03-09  Joshua Tauberer <tauberer@for.net>
11742
11743         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11744         a { ... }-style array creation invokes EmitStaticInitializers
11745         which is not good for reference-type arrays.  String, decimal
11746         and now null constants (NullCast) are not counted toward
11747         static initializers.
11748
11749 2004-03-05  Martin Baulig  <martin@ximian.com>
11750
11751         * location.cs (SourceFile.HasLineDirective): New public field;
11752         specifies whether the file contains or is referenced by a "#line"
11753         directive.
11754         (Location.DefineSymbolDocuments): Ignore source files which
11755         either contain or are referenced by a "#line" directive.        
11756
11757 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11758
11759         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11760         direct access to our parent, so check the method inline there.
11761
11762 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11763
11764         * expression.cs (Invocation.EmitCall): Miguel's last commit
11765         caused a regression. If you had:
11766
11767             T t = null;
11768             t.Foo ();
11769
11770         In Foo the implict this would be null.
11771
11772 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11773
11774         * expression.cs (Invocation.EmitCall): If the method is not
11775         virtual, do not emit a CallVirt to it, use Call.
11776
11777         * typemanager.cs (GetFullNameSignature): Improve the method to
11778         cope with ".ctor" and replace it with the type name.
11779
11780         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11781         as an argument the ConstructorBuilder where it is being defined,
11782         to catch the recursive constructor invocations.
11783
11784 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11785
11786         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11787         routines to check if a type is an enumerable/enumerator allow
11788         classes that implement the IEnumerable or IEnumerator interfaces.
11789
11790         * class.cs (Property, Operator): Implement IIteratorContainer, and
11791         implement SetYields.
11792
11793         (Property.Define): Do the block swapping for get_methods in the
11794         context of iterators.   We need to check if Properties also
11795         include indexers or not.
11796
11797         (Operator): Assign the Block before invoking the
11798         OperatorMethod.Define, so we can trigger the Iterator code
11799         replacement. 
11800
11801         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11802         Property and Operator classes are not created when we parse the
11803         declarator but until we have the block completed, so we use a
11804         singleton SimpleIteratorContainer.Simple to flag whether the
11805         SetYields has been invoked.
11806
11807         We propagate this setting then to the Property or the Operator to
11808         allow the `yield' to function.
11809
11810 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11811
11812         * codegen.cs: Implemented attribute support for modules.
11813         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11814         Assembly/Module functionality.
11815
11816         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11817         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11818         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11819
11820 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11821
11822         * interface.cs (FindMembers): The operation is performed on all base
11823         interfaces and not only on the first. It is required for future CLS Compliance patch.
11824
11825 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11826
11827         * statement.cs, codegen.cs:
11828         This patch deals with patterns such as:
11829
11830         public class List : IEnumerable {
11831
11832                 public MyEnumerator GetEnumerator () {
11833                         return new MyEnumerator(this);
11834                 }
11835
11836                 IEnumerator IEnumerable.GetEnumerator () {
11837                         ...
11838                 }
11839                 
11840                 public struct MyEnumerator : IEnumerator {
11841                         ...
11842                 }
11843         }
11844
11845         Before, there were a few things we did wrong:
11846         1) we would emit callvirt on a struct, which is illegal
11847         2) we emited ldarg when we needed to emit ldarga
11848         3) we would mistakenly call the interface methods on an enumerator
11849         type that derived from IEnumerator and was in another assembly. For example:
11850
11851         public class MyEnumerator : IEnumerator
11852
11853         Would have the interface methods called, even if there were public impls of the
11854         method. In a struct, this lead to invalid IL code.
11855
11856 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11857
11858         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11859           renamed to Emit.
11860
11861         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11862
11863 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11864
11865         * cs-parser.jay: Fix small regression: we were not testing V2
11866         compiler features correctly.
11867
11868         * interface.cs: If the emit context is null, then create one
11869
11870 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11871
11872         * decl.cs (GetSignatureForError): New virtual method to get full name
11873           for error messages.
11874
11875         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11876           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11877
11878         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11879           Duplicated members and code in these classes has been removed.
11880           Better encapsulation in these classes.
11881
11882 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11883
11884         * assign.cs (Assign.DoResolve): When dealing with compound
11885         assignments, there is a new rule in ECMA C# 2.4 (might have been
11886         there before, but it is documented here) that states that in:
11887
11888         a op= b;
11889
11890         If b is of type int, and the `op' is a shift-operator, then the
11891         above is evaluated as:
11892
11893         a = (int) a op b 
11894
11895         * expression.cs (Binary.ResolveOperator): Instead of testing for
11896         int/uint/long/ulong, try to implicitly convert to any of those
11897         types and use that in pointer arithmetic.
11898
11899         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11900         method to print information for from the type, not from the
11901         null-method we were given.
11902
11903 2004-02-01  Duncan Mak  <duncan@ximian.com>
11904
11905         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11906         parsing for cmd, fixes bug #53694.
11907
11908 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11909
11910         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11911         in the member name duplication tests. Property and operator name duplication
11912         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11913
11914 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11915
11916         * interface.cs (PopulateMethod): Fixed crash when interface method
11917         returns not existing type (error test cs0246-3.cs).
11918
11919 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11920
11921         * cs-parser.jay (interface_accessors): Re-write actions to also
11922         store attributes attached to get and set methods. Fix spelling
11923         while at it.
11924
11925         (inteface_property_declaration): Modify accordingly.
11926
11927         (InterfaceAccessorInfo): New helper class to store information to pass
11928         around between rules that use interface_accessors.
11929
11930         * interface.cs (Emit): Apply attributes on the get and set
11931         accessors of properties and indexers too.
11932
11933         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11934         right MethodBuilder when applying attributes to the get and set accessors.
11935
11936 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11937
11938         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11939
11940 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11941
11942         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11943
11944 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11945
11946         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11947         changes that treat `yield' specially when present before `break'
11948         or `return' tokens.
11949
11950         * cs-tokenizer.cs: yield is no longer a keyword.
11951
11952 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11953
11954         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11955         setting for default constructors.
11956         For default constructors are almost every time set wrong Modifier. The
11957         generated IL code has been alright. But inside mcs this values was
11958         wrong and this was reason why several of my CLS Compliance tests
11959         failed.
11960
11961 2004-01-22  Martin Baulig  <martin@ximian.com>
11962
11963         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11964         not a QualifiedIdentifier.  This is what `type_name_expression'
11965         was previously doing.
11966         (type_name_expression): Removed; the code is now in
11967         `namespace_or_type_name'.
11968         (qualified_identifier): Removed, use `namespace_or_type_name'
11969         instead.
11970         (QualifiedIdentifier): Removed this class.      
11971
11972 2004-01-22  Martin Baulig  <martin@ximian.com>
11973
11974         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11975         not a string as alias name.
11976
11977 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11978
11979         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11980         #52730 bug, and instead compute correctly the need to use a
11981         temporary variable when requesting an address based on the
11982         static/instace modified of the field and the constructor.
11983  
11984 2004-01-21  Martin Baulig  <martin@ximian.com>
11985
11986         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11987         class and namespace before looking up aliases.  Fixes #52517.
11988
11989 2004-01-21  Martin Baulig  <martin@ximian.com>
11990
11991         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11992         assinged in a 'try'; fixes exception4.cs.
11993
11994 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11995         * class.cs : Implemented parameter-less constructor for TypeContainer
11996
11997         * decl.cs: Attributes are now stored here. New property OptAttributes
11998
11999         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12000
12001         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12002
12003 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12004
12005         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12006           (CSharpSignature): New method for indexer and property signature.
12007
12008 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12009
12010         * pending.cs (IsVirtualFilter): Faster implementation.
12011
12012 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12013
12014         * typemanager.cs: Avoid inclusion of same assembly more than once.
12015
12016 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12017
12018         * cs-parser.jay: Fixed problem where the last assembly attribute
12019           has been applied also to following declaration (class, struct, etc.)
12020           
12021 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12022
12023         * class.cs: Added error CS0538, CS0539 reporting.
12024         Fixed crash on Microsoft runtime when field type is void.
12025
12026         * cs-parser.jay: Added error CS0537 reporting.
12027
12028         * pending.cs: Added error CS0535 reporting.
12029         Improved error report for errors CS0536, CS0534.
12030
12031 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
12032
12033         Merge a few bits from the Anonymous Method MCS tree.
12034
12035         * statement.cs (ToplevelBlock): New class for toplevel methods,
12036         will hold anonymous methods, lifted variables.
12037
12038         * cs-parser.jay: Create toplevel blocks for delegates and for
12039         regular blocks of code. 
12040
12041 2004-01-20  Martin Baulig  <martin@ximian.com>
12042
12043         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12044         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12045         and `NeedExplicitReturn'; added `IsLastStatement'.
12046         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12047         have a `ReturnLabel' or we're not unreachable.
12048
12049         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12050         child's reachability; don't just override ours with it.  Fixes
12051         #58058 (lluis's example).
12052         (FlowBranching): Added public InTryOrCatch(), InCatch(),
12053         InFinally(), InLoop(), InSwitch() and
12054         BreakCrossesTryCatchBoundary() methods.
12055
12056         * statement.cs (Return): Do all error checking in Resolve().
12057         Unless we are the last statement in a top-level block, always
12058         create a return label and jump to it.
12059         (Break, Continue): Do all error checking in Resolve(); also make
12060         sure we aren't leaving a `finally'.
12061         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12062         statement in a top-level block.
12063         (Block.Flags): Added `IsDestructor'.
12064         (Block.IsDestructor): New public property.
12065
12066 2004-01-20  Martin Baulig  <martin@ximian.com>
12067
12068         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12069
12070 2004-01-20  Martin Baulig  <martin@ximian.com>
12071
12072         * statement.cs (Statement.ResolveUnreachable): New public method.
12073         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12074         (Block.Resolve): Resolve unreachable statements.
12075
12076 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12077
12078         * expression.cs: We need to fix the case where we do
12079         not have a temp variable here.
12080
12081         * assign.cs: Only expression compound assignments need
12082         temporary variables.
12083
12084 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12085
12086         * flowanalysis.cs: Reduce memory allocation in a few ways:
12087           - A block with no variables should not allocate a bit
12088             vector for itself.
12089           - A method with no out parameters does not need any tracking
12090             for assignment of the parameters, so we need not allocate
12091             any data for it.
12092           - The arrays:
12093                 public readonly Type[] VariableTypes;
12094                 public readonly string[] VariableNames;
12095             Are redundant. The data is already stored in the variable
12096             map, so we need not allocate another array for it.
12097           - We need to add alot of checks for if (params | locals) == null
12098             due to the first two changes.
12099
12100 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12101
12102         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12103         implement IMemoryLocation, we store a copy on a local variable and
12104         take the address of it.  Patch from Benjamin Jemlich
12105
12106         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12107         to use a special "type_name_expression" rule which reduces the
12108         number of "QualifiedIdentifier" classes created, and instead
12109         directly creates MemberAccess expressions.
12110
12111 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12112
12113         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12114         that fixes #52853.  Null literal assignment to ValueType
12115
12116         * class.cs (MethodData.Emit): Instead of checking the name of the
12117         method to determine if its a destructor, create a new derived
12118         class from Method called Destructor, and test for that.  
12119
12120         * cs-parser.jay: Create a Destructor object instead of a Method.  
12121
12122         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12123
12124         Fixes: 52933
12125
12126 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12127
12128         * expression.cs (Binary.ResolveOperator): Perform an implicit
12129         conversion from MethodGroups to their delegate types on the
12130         Addition operation.
12131
12132         * delegate.cs: Introduce a new class DelegateCreation that is the
12133         base class for `NewDelegate' and `ImplicitDelegateCreation',
12134         factor some code in here.
12135
12136         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12137         conversion from MethodGroups to compatible delegate types. 
12138
12139         * ecore.cs (Expression.Resolve): Do not flag error 654
12140         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12141         we allow conversions from MethodGroups to delegate types now.
12142
12143         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12144         assignments in v2 either.
12145
12146 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12147
12148         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12149         static read-only fields in ctors.
12150
12151         Applied patch from Benjamin Jemlich 
12152
12153         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12154
12155 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12156
12157         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12158         here to return true, as they can be used like this:
12159
12160                 (XXX) int.MEMBER ()
12161
12162         Fixed 49836 and all the other dups
12163
12164 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12165
12166         * driver.cs: Implement /win32res and /win32icon.
12167
12168 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12169
12170         * cs-parser.jay: Add a rule to improve error handling for the
12171         common mistake of placing modifiers after the type.
12172
12173 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12174
12175         * cs-parser.jay (interface_event_declaration): Catch
12176         initialization of events on interfaces, and report cs0068
12177
12178         * cs-parser.jay (interface_event_declaration): Catch
12179         initialization of events. 
12180
12181         * ecore.cs: Better report missing constructors.
12182
12183         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12184         the error reporting done in the wrong place.  Fix.
12185
12186         * expression.cs (Binary.ResolveOperator): Catch the 
12187         operator + (E x, E y) error earlier, and later allow for implicit
12188         conversions in operator +/- (E e, U x) from U to the underlying
12189         type of E.
12190
12191         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12192         52596, if the container class is abstract, the default constructor
12193         is protected otherwise its public (before, we were always public).
12194
12195         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12196         fixed statement.
12197
12198         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12199         Jemlich that fixes bug #52597, MCS was generating invalid code for
12200         idisposable structs.   Thanks to Ben for following up with this
12201         bug as well.
12202
12203 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12204
12205         * driver.cs: Allow assemblies without code to be generated, fixes
12206         52230.
12207
12208 2004-01-07  Nick Drochak <ndrochak@gol.com>
12209
12210         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12211
12212 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12213
12214         * cs-parser.jay: Add rules to improve error reporting if fields or
12215         methods are declared at the namespace level (error 116)
12216
12217         * Add rules to catch event add/remove
12218
12219 2004-01-04  David Sheldon <dave-mono@earth.li>
12220
12221   * expression.cs: Added matching ")" to error message for 
12222   CS0077
12223
12224 2004-01-03 Todd Berman <tberman@gentoo.org>
12225
12226         * ecore.cs, attribute.cs:
12227         Applying fix from #52429.
12228
12229 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12230
12231         * ecore.cs, expression.cs, statement.cs:
12232         Total rewrite of how we handle branching. We
12233         now handle complex boolean expressions with fewer
12234         jumps. As well if (x == 0) no longer emits a ceq.
12235
12236         if (x is Foo) is much faster now, because we generate
12237         better code.
12238
12239         Overall, we get a pretty big improvement on our benchmark
12240         tests. The code we generate is smaller and more readable.
12241
12242         I did a full two-stage bootstrap. The patch was reviewed
12243         by Martin and Miguel.
12244
12245 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12246
12247         * cs-parser.jay: Make primary_expression not take a QI.
12248         we dont need this because the member_access rule covers
12249         us here. So we replace the rule with just IDENTIFIER.
12250
12251         This has two good effects. First, we remove a s/r conflict.
12252         Second, we allocate many fewer QualifiedIdentifier objects.
12253
12254 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12255
12256         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12257         set the correct information via SRE. This prevents
12258         hanging on the MS runtime. Fixes #29374.
12259
12260 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12261
12262         * convert.cs: correctly handle conversions to value types
12263         from Enum and ValueType as unboxing conversions.
12264
12265         Fixes bug #52569. Patch by Benjamin Jemlich.
12266
12267 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12268
12269         * expression.cs (BetterConversion): Prefer int -> uint
12270         over int -> ulong (csc's behaviour). This fixed bug #52046.
12271
12272 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12273
12274         * decl.cs (MemberCache.FindMembers): now returns a
12275         MemberInfo [].
12276
12277         * typemanager.cs: In general, go with with ^^.
12278         (CopyNewMethods): take an IList.
12279         (RealMemberLookup): Only allocate an arraylist
12280         if we copy from two sets of methods.
12281
12282         This change basically does two things:
12283         1) Fewer array lists allocated due to CopyNewMethods.
12284         2) the explicit cast in MemberList costed ALOT.
12285
12286 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12287
12288         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12289         a hashtable to avoid needless string allocations when an identifier is
12290         used more than once (the common case).
12291
12292 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12293
12294         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12295         is broken, it will not return anything. So, we
12296         have to use the information we have in mcs to
12297         do the task.
12298
12299         * typemanager.cs: Add a cache for GetInterfaces,
12300         since this will now be used more often (due to ^^)
12301
12302         (GetExplicitInterfaces) New method that gets the
12303         declared, not effective, interfaces on a type
12304         builder (eg, if you have interface IFoo, interface
12305         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12306         { IBar }.
12307
12308         This patch makes MCS able to bootstrap itself on
12309         Windows again.
12310
12311 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12312
12313         * expression.cs: Remove the Nop's that Miguel put
12314         in by mistake.
12315
12316 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12317
12318         * report.cs, codegen.cs: Give the real stack trace to
12319         the error when an exception is thrown.
12320
12321 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12322
12323         * decl.cs: only allocate hashtables for ifaces if 
12324         it is an iface!
12325
12326 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12327
12328         * expression.cs: fix the error from cs0121-2.cs
12329         (a parent interface has two child interfaces that
12330         have a function with the same name and 0 params
12331         and the function is called through the parent).
12332
12333 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12334
12335         * class.cs, rootcontext.cs, typmanager.cs: do not
12336         leak pointers.
12337
12338 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12339
12340         * codegen.cs: remove stack for the ec flow branching.
12341         It is already a linked list, so no need.
12342
12343 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12344
12345         * Makefile: Allow custom profiler here.
12346
12347 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12348
12349         * typemanager.cs (LookupType):
12350           - Use a static char [], because split takes
12351             a param array for args, so it was allocating
12352             every time.
12353           - Do not store true in a hashtable, it boxes.
12354
12355 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12356
12357         * flowanalysis.cs: bytify common enums.
12358
12359 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12360
12361         * modifiers.cs: Add a new set of flags for the
12362         flags allowed on explicit interface impls.
12363         * cs-parser.jay: catch the use of modifiers in
12364         interfaces correctly.
12365         * class.cs: catch private void IFoo.Blah ().
12366
12367         All related to bug #50572.
12368
12369 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12370
12371         * decl.cs: Rewrite the consistant accessability checking.
12372         Accessability is not linear, it must be implemented in
12373         a tableish way. Fixes #49704.
12374
12375 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12376
12377         * expression.cs: Handle negation in a checked context.
12378         We must use subtraction from zero. Fixes #38674.
12379
12380 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12381
12382         * class.cs: Ignore static void main in DLLs.
12383         * rootcontext.cs: Handle the target type here,
12384         since we are have to access it from class.cs
12385         * driver.cs: account for the above.
12386
12387 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12388
12389         * report.cs: Give line numbers and files if available.
12390
12391 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12392
12393         * driver.cs: Implement /addmodule.
12394
12395         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12396         ModuleBuilders.
12397
12398 2003-12-20  Martin Baulig  <martin@ximian.com>
12399
12400         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12401         (FieldBase.IsAssigned): Removed this field.
12402         (FieldBase.SetAssigned): New public method.
12403         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12404
12405 2003-12-20  Martin Baulig  <martin@ximian.com>
12406
12407         * expression.cs (LocalVariableReference.DoResolve): Don't set
12408         `vi.Used' if we're called from DoResolveLValue().
12409
12410         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12411         returns the usage vector it just merged into the current one -
12412         pass this one to UsageWarning().
12413         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12414         of the `EmitContext', don't call this recursively on our children.
12415
12416 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12417
12418         * driver.cs: Implement /target:module.
12419
12420 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12421
12422         * support.cs (CharArrayHashtable): New helper class.
12423
12424         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12425         char arrays, not strings, so we can avoid creating a string in
12426         consume_identifier if the identifier is a keyword.
12427
12428 2003-12-16  Martin Baulig  <martin@ximian.com>
12429
12430         * statement.cs (LocalInfo.Assigned): Removed this property.
12431         (LocalInfo.Flags): Removed `Assigned'.
12432         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12433         and uses flow analysis.
12434         (Block.UsageWarning): Made this method private.
12435         (Block.Resolve): Call UsageWarning() if appropriate.
12436
12437         * expression.cs (LocalVariableReference.DoResolve): Always set
12438         LocalInfo.Used here.
12439
12440 2003-12-13  Martin Baulig  <martin@ximian.com>
12441
12442         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12443         any value here; we're now using flow analysis to figure out
12444         whether a statement/block returns a value.
12445
12446 2003-12-13  Martin Baulig  <martin@ximian.com>
12447
12448         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12449         working again.
12450         (FlowBranching.MergeFinally): Don't call
12451         `branching.CheckOutParameters()' here, this is called in
12452         MergeTopBlock().
12453         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12454         when adding the `finally' vector.       
12455
12456 2003-12-13  Martin Baulig  <martin@ximian.com>
12457
12458         * flowanalysis.cs
12459         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12460         actually work and also fix #48962.
12461
12462 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12463
12464         * decl.cs: Do not check System.Object for nested types,
12465         since we know it does not have any. Big bang for buck:
12466
12467         BEFORE:
12468            Run 1:   8.35 seconds
12469            Run 2:   8.32 seconds
12470            corlib:  17.99 seconds
12471         AFTER:
12472            Run 1:   8.17 seconds
12473            Run 2:   8.17 seconds
12474            corlib:  17.39 seconds
12475
12476 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12477
12478         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12479         time we are returning 0 members, so we save alot here.
12480
12481 2003-12-11  Martin Baulig  <martin@ximian.com>
12482
12483         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12484         `MergeChild()', also just take the `FlowBranching' as argument;
12485         call Merge() on it and return the result.
12486         (FlowBranching.Merge): We don't need to do anything if we just
12487         have one sibling.
12488
12489 2003-12-11  Martin Baulig  <martin@ximian.com>
12490
12491         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12492         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12493         Maurer for this idea.
12494
12495 2003-12-11  Martin Baulig  <martin@ximian.com>
12496
12497         * flowanalysis.cs (MergeResult): This class is now gone; we now
12498         use the `UsageVector' for this.  The reason for this is that if a
12499         branching just has one sibling, we don't need to "merge" them at
12500         all - that's the next step to do.
12501         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12502         `MergeResult'.
12503
12504 2003-12-11  Martin Baulig  <martin@ximian.com>
12505
12506         Reworked flow analyis and made it more precise and bug-free.  The
12507         most important change is that we're now using a special `Reachability'
12508         class instead of having "magic" meanings of `FlowReturns'.  I'll
12509         do some more cleanups and optimizations and also add some more
12510         documentation this week.
12511
12512         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12513         largely reworked this class.
12514         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12515         the new `Reachability' class instead of having "magic" values here.
12516         (FlowBranching): We're now using an instance of `Reachability'
12517         instead of having separate `Returns', `Breaks' etc. fields.
12518
12519         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12520         based on flow analysis; ignore the return value of block.Emit ().
12521
12522 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12523
12524         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12525         if they are private.
12526
12527 2003-12-09  Martin Baulig  <martin@ximian.com>
12528
12529         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12530         call them directly on the UsageVector.
12531
12532 2003-12-09  Martin Baulig  <martin@ximian.com>
12533
12534         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12535         Changed return type from `FlowReturns' to `Reachability'.
12536
12537 2003-12-09  Martin Baulig  <martin@ximian.com>
12538
12539         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12540         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12541         `Reachable' fields with a single `Reachability' one.
12542
12543 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12544
12545         * class.cs (FindMembers): Remove foreach's.
12546
12547         Bootstrap times:
12548
12549         BEFORE
12550                 Run 1:   8.74 seconds
12551                 Run 2:   8.71 seconds
12552
12553         AFTER
12554                 Run 1:   8.64 seconds
12555                 Run 2:   8.58 seconds
12556
12557
12558 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12559
12560         * cs-parser.jay:
12561         * gen-treedump.cs:
12562         * statement.cs:
12563         This patch does a few things:
12564                 1. EmptyStatement is now a singleton, so it is never reallocated.
12565                 2. All blah is EmptyStatement constructs have been changed to
12566                    blah == EmptyStatement.Value, which is much faster and valid
12567                    now that EmptyStatement is a singleton.
12568                 3. When resolving a block, rather than allocating a new array for
12569                    the non-empty statements, empty statements are replaced with
12570                    EmptyStatement.Value
12571                 4. Some recursive functions have been made non-recursive.
12572         Mainly the performance impact is from (3), however (1) and (2) are needed for
12573         this to work. (4) does not make a big difference in normal situations, however
12574         it makes the profile look saner.
12575
12576         Bootstrap times:
12577
12578         BEFORE
12579         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12580         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12581         Total memory allocated: 56397 KB
12582
12583         AFTER
12584         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12585         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12586         Total memory allocated: 55666 KB
12587
12588 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12589
12590         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12591         than the hashtable in a hashtable version
12592
12593         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12594         we always end up concating a string. This results in a huge perf
12595         loss, because many strings have to be tracked by the GC. In this
12596         patch, we first use a hashtable that works with two keys, so that
12597         the strings do not need to be concat'ed.
12598
12599         Bootstrap times:
12600         BEFORE
12601                 Run 1:   8.74 seconds
12602                 Run 2:   8.71 seconds
12603
12604         AFTER
12605                 Run 1:   8.65 seconds
12606                 Run 2:   8.56 seconds
12607
12608 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12609
12610         * Makefile: Add a new target `do-time' that does a quick and simple
12611         profile, leaving easy to parse output.
12612
12613 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12614
12615         * codegen.cs (Init): Create the dynamic assembly with 
12616         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12617
12618 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12619
12620         * support.cs: Make the PtrHashtable use only one
12621         instance of its comparer.
12622
12623 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12624
12625         * typemanager.cs: Fix lookup of GetNamespaces.
12626
12627 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12628
12629         * expression.cs: Removed redundant line.
12630
12631         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12632         ArrayLists, use for loops with bounds.  
12633
12634         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12635         arraylist.
12636
12637         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12638         arraylists, use for loop with bounds.
12639
12640         The above three changes give us a 0.071 second performance
12641         improvement out of 3.294 seconds down to 3.223.  On my machine
12642         the above changes reduced the memory usage by 1,387 KB during
12643         compiler bootstrap.
12644
12645         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12646         QualifiedIdentifiers.  Before we created a new string through
12647         concatenation, and mostly later on, the result would be
12648         manipulated by DecomposeQI through string manipulation.
12649
12650         This reduced the compiler memory usage for bootstrapping from
12651         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12652         compile times in 0.05 seconds.
12653
12654 2003-11-28  Dick Porter  <dick@ximian.com>
12655
12656         * support.cs: Do string compares with the Invariant culture.
12657
12658         * rootcontext.cs: 
12659         * gen-treedump.cs: 
12660         * expression.cs: 
12661         * driver.cs: 
12662         * decl.cs: 
12663         * codegen.cs: 
12664         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12665         the comparison is done with the Invariant culture.
12666
12667 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12668
12669         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12670         GetEnumerator method.
12671
12672         (ProbeCollectionType): Iterate starting at the most specific type
12673         upwards looking for a GetEnumerator
12674
12675         * expression.cs: Shift count can be up to 31 for int/uint and 63
12676         for long/ulong.
12677
12678 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12679
12680         * statement.cs (Block.LookupLabel): Also look for the label on the
12681         children blocks.  Use a hash table to keep track of visited
12682         nodes. 
12683
12684         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12685         we actually did transform the other operand, otherwise fall back
12686         to the common codepath that casts to long.
12687
12688         * cs-tokenizer.cs: Use the same code pattern as the int case.
12689         Maybe I should do the parsing myself, and avoid depending on the
12690         Parse routines to get this done.
12691
12692 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12693
12694         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12695         which fixes bug 51347.  This time test it.
12696
12697         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12698         attributes for example can not tell the difference between these.
12699         The difference was only a syntax feature of the language. 
12700
12701         * attribute.cs: Apply attributes to delegates.
12702
12703         * delegate.cs: Call the apply attributes method.
12704
12705 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12706
12707         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12708         comparing 0 vs Byte.MinValue, not the value
12709
12710         (ImplicitConversionRequired): When reporting a conversion error,
12711         use error 31 to print out the constant error instead of the
12712         simpler 29.
12713
12714         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12715         which fixes bug 51347.
12716
12717 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12718
12719         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12720         which fixes the -warnaserror command line option.
12721
12722 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12723
12724         * cfold.cs (DoNumericPromotions): During constant folding of
12725         additions on UIntConstant, special case intconstants with
12726         IntConstants like we do on the expression binary operator. 
12727
12728 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12729
12730         * convert.cs (ImplicitReferenceConversion): We were missing a case
12731         (System.Enum are not value types or class types, so we need to
12732         classify them separatedly).
12733
12734         * driver.cs: We do not support error 2007.
12735
12736 2003-11-12 Jackson Harper <jackson@ximian.com>
12737
12738         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12739         system directory. Also use the full file name so users can
12740         libraries names mscorlib-o-tron.dll in a non system dir.
12741
12742 2003-11-10  Martin Baulig  <martin@ximian.com>
12743
12744         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12745         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12746         calling `ResolveType()' on them, directly assign their `Type'.
12747
12748 2003-11-08  Martin Baulig  <martin@ximian.com>
12749
12750         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12751         return value and the `out parent' parameter.
12752         (TypeContainer.DefineType): Moved the CS0644 check into
12753         GetClassBases().  Don't pass the interface types to the
12754         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12755         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12756
12757         * ecore.cs (TypeExpr.IsAttribute): New property.
12758         (TypeExpr.GetInterfaces): New method.
12759
12760         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12761         TypeExpr instead of a Type.
12762         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12763         (Interface.DefineType): Don't pass the interface types to the
12764         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12765         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12766
12767         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12768         instead of a `Type[]'.
12769         (TypeManager.RegisterBuilder): Likewise.
12770         (TypeManager.AddUserInterface): Likewise.
12771         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12772         `Type[]' and also return a `TypeExpr[]'.
12773         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12774
12775 2003-11-08  Martin Baulig  <martin@ximian.com>
12776
12777         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12778         Expression.     
12779
12780 2003-11-08  Martin Baulig  <martin@ximian.com>
12781
12782         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12783         TypeManager.ResolveExpressionTypes().
12784
12785         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12786         instead of an Expression.
12787         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12788         (TypeExpression): New public class; formerly known as `TypeExpr'.
12789
12790         * expression.cs (ComposedCast): Derive from TypeExpr.
12791
12792         * typemanager.cs (TypeManager.system_*_expr): These are now
12793         TypExpr's instead of Expression's.
12794         (TypeManager.ResolveExpressionTypes): New public static function;
12795         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12796         of them.        
12797
12798 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12799
12800         * expression.cs (New.DoResolve): Do not dereference value that
12801         might be a null return.
12802
12803         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12804         sure that the constant value has the right type.  Fixes an
12805         unreported bug, similar to 50425.
12806
12807         * const.cs (Const.LookupConstantValue): Call
12808         ImplicitStandardConversionExists before doing a conversion to
12809         avoid havng the TypeManager.ChangeType do conversions.
12810
12811         Reduced the number of casts used
12812
12813         (Const.ChangeType): New routine to enable reuse of the constant
12814         type changing code from statement.
12815
12816         * typemanager.cs (ChangeType): Move common initialization to
12817         static global variables.
12818
12819         Fixes #50425.
12820
12821         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12822         every value type to go through, even if it was void.  Fix that. 
12823
12824         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12825         character of the define, and the is_identifier_part_character for
12826         the rest of the string.
12827
12828 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12829
12830         * expression.cs (UnaryMutator.EmitCode): When I updated
12831         LocalVariableReference.DoResolve, I overdid it, and dropped an
12832         optimization done on local variable references.
12833
12834 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12835
12836         * ecore.cs: Convert the return from Ldlen into an int.
12837
12838 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12839
12840         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12841         the accessibility, this is a special case for toplevel non-public
12842         classes (internal for instance).
12843
12844 2003-10-20  Nick Drochak <ndrochak@gol.com>
12845
12846         * ecore.cs: Fix typo and build.  Needed another right paren.
12847
12848 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12849
12850         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12851         `internal' case regular and protected, but not allowing protected
12852         to be evaluated later.  Bug 49840
12853
12854 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12855
12856         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12857         to kb.Nlast, and not the kb.nFirst to isolate the switch
12858         statement.
12859
12860         Extract the underlying type, so enumerations of long/ulong are
12861         treated like long/ulong.
12862
12863 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12864
12865         * expression.cs (New): Overload the meaning of RequestedType to
12866         track the possible creation of the NewDelegate type, since
12867         DoResolve is invoked more than once for new constructors on field
12868         initialization.
12869
12870         See bugs: #48800 and #37014
12871
12872         * cs-parser.jay (declare_local_constants): Take an arraylist
12873         instead of a single constant.
12874
12875         (local_constant_declaration): It should take a
12876         constant_declarators, not a constant_declarator.  Fixes 49487
12877
12878         * convert.cs: Fix error report.
12879
12880 2003-10-13 Jackson Harper <jackson@ximian.com>
12881
12882         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12883         bug #49611
12884
12885 2003-10-09  Martin Baulig  <martin@ximian.com>
12886
12887         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12888         to the .ctor.
12889         (MethodCore.DoDefineParameters): Removed the TypeContainer
12890         argument; use the DeclSpace which was passed to the .ctor instead.
12891         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12892         TypeContainer; we only need a DeclSpace here.
12893
12894 2003-10-09  Martin Baulig  <martin@ximian.com>
12895
12896         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12897         to the .ctor.
12898         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12899         EmitContext's .ctor.    
12900
12901 2003-10-09  Martin Baulig  <martin@ximian.com>
12902
12903         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12904         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12905         AsAccessible(), moved them as well.
12906
12907         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12908
12909 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12910
12911         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12912
12913 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12914
12915         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12916         generation for >=, as spotted by Paolo, bug 48679.  
12917         Patch from David Waite.
12918
12919         * cs-tokenizer.cs: Add handling for #pragma.
12920
12921         * cs-parser.jay: Allow for both yield and yield return in the
12922         syntax.  The anti-cobolization of C# fight will go on!
12923
12924         * class.cs (TypeBuilder.DefineType): Catch error condition here
12925         (Parent.DefineType erroring out and returning null).
12926
12927         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12928         coping with enumerations variables, we were mistakenly processing
12929         them as a regular value type instead of built-in types.  Fixes the
12930         bug #48063
12931
12932         * typemanager.cs (IsBuiltinOrEnum): New method.
12933
12934 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12935
12936         * cs-parser.jay: Upgrade: yield now needs the return clause.
12937
12938 2003-09-19  Martin Baulig  <martin@ximian.com>
12939
12940         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12941         `MemberCache parent' argument.  Normally, an interface doesn't
12942         have a parent type except System.Object, but we use this in gmcs
12943         for generic type parameters.
12944
12945 2003-09-18  Martin Baulig  <martin@ximian.com>
12946
12947         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12948         on `type.IsInterface'; don't check whether the type has a parent
12949         to determine whether it's an interface.
12950
12951 2003-09-15  Martin Baulig  <martin@ximian.com>
12952
12953         * class.cs (TypeContainer.DefineType): Added an error flag to
12954         avoid reporting duplicate CS0146's ("class definition is
12955         circular.").
12956
12957         * driver.cs (Driver.MainDriver): Abort if
12958         RootContext.ResolveTree() reported any errors.
12959
12960 2003-09-07  Martin Baulig  <martin@ximian.com>
12961
12962         * report.cs (Error, Warning): Added overloaded versions which take
12963         a `params object[] args' and call String.Format().
12964
12965 2003-09-07  Martin Baulig  <martin@ximian.com>
12966
12967         * decl.cs (DeclSpace..ctor): Don't call
12968         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12969         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12970         (DeclSpace.RecordDecl): New method.
12971
12972         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12973
12974 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12975
12976         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12977         value attributes to be applied to ParameterBuilders.
12978
12979         * class.cs (MethodCore.LabelParameters): Make static and more
12980         generic so that it can be used from other places - like interface
12981         methods, for instance.
12982
12983         * interface.cs (Interface.Emit): Call LabelParameters before
12984         emitting attributes on the InterfaceMethod.
12985
12986 2003-08-26  Martin Baulig  <martin@ximian.com>
12987
12988         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12989         resolving aliases; fixes #47927.
12990
12991 2003-08-26  Martin Baulig  <martin@ximian.com>
12992
12993         * statement.cs (Using.DoResolve): This is internally emitting a
12994         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12995         do not always return.  Fixes #47681.
12996
12997 2003-08-26  Martin Baulig  <martin@ximian.com>
12998
12999         * decl.cs (MemberCore): Moved WarningNotHiding(),
13000         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13001         into MemberBase.
13002         (AdditionResult): Make this nested in DeclSpace.
13003         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13004         argument; call NamespaceEntry.Define() unless we're nested in a
13005         class or struct.
13006
13007         * namespace.cs (Namespace.DefineName): New public function.  This
13008         is called from DeclSpace's .ctor to add 
13009         (Namespace.Lookup): Include DeclSpaces in the lookup.
13010
13011         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13012
13013         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13014
13015 2003-08-25  Martin Baulig  <martin@ximian.com>
13016
13017         * convert.cs (Convert.ExplicitReferenceConversion): When
13018         converting from an interface type to a class, unbox if the target
13019         type is a struct type.  Fixes #47822.
13020
13021 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13022
13023         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13024         #47854.
13025
13026 2003-08-22  Martin Baulig  <martin@ximian.com>
13027
13028         * class.cs (TypeManager.DefineType): When defining a nested type,
13029         call DefineType() on our parent; fixes #47801.
13030
13031 2003-08-22  Martin Baulig  <martin@ximian.com>
13032
13033         * class.cs (MethodData.Define): While checking if a method is an
13034         interface implementation, improve the test a bit more to fix #47654.
13035
13036 2003-08-22  Martin Baulig  <martin@ximian.com>
13037
13038         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13039         correctly; fixes #47722.
13040
13041 2003-08-22  Martin Baulig  <martin@ximian.com>
13042
13043         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13044         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13045
13046         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13047
13048 2003-08-22  Martin Baulig  <martin@ximian.com>
13049
13050         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13051         can only be assigned in static constructors.  Fixes #47161.
13052
13053 2003-08-22  Martin Baulig  <martin@ximian.com>
13054
13055         Rewrote and improved the flow analysis code.
13056
13057         * flowbranching.cs (FlowBranching): Make this class abstract.
13058         (FlowBranching.CreateBranching): New static function to create a
13059         new flow branching.
13060         (FlowBranchingBlock, FlowBranchingException): New classes.
13061         (FlowBranching.UsageVector.Type): New public readonly field.
13062         (FlowBranching.UsageVector.Breaks): Removed the setter.
13063         (FlowBranching.UsageVector.Returns): Removed the setter.
13064         (FlowBranching.UsageVector): Added Break(), Return(),
13065         NeverReachable() and Throw() methods to modify the reachability.
13066         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13067         done by FlowBranching.Merge().
13068         (FlowBranching.UsageVector.MergeChild): New method; merges the
13069         merge result into the current vector.
13070         (FlowBranching.Merge): New abstract method to merge a branching.
13071
13072 2003-08-12  Martin Baulig  <martin@ximian.com>
13073
13074         * expression.cs (Indirection.CacheTemporaries): Create the
13075         LocalTemporary with the pointer type, not its element type.
13076
13077 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13078
13079         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13080         token was a keyword or not.
13081
13082         Add `error' options where an IDENTIFIER was expected;  Provide
13083         CheckToken and CheckIdentifierToken convenience error reporting
13084         functions. 
13085
13086         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13087
13088         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13089         NameSpaceEntry NameSpaceEntry.
13090
13091         (LookupInterfaceOrClass): Avoid creating a full qualified name
13092         from namespace and name: avoid doing lookups when we know the
13093         namespace is non-existant.   Use new Tree.LookupByNamespace which
13094         looks up DeclSpaces based on their namespace, name pair.
13095
13096         * driver.cs: Provide a new `parser verbose' to display the
13097         exception thrown during parsing.  This is turned off by default
13098         now, so the output of a failure from mcs is more graceful.
13099
13100         * namespace.cs: Track all the namespaces defined in a hashtable
13101         for quick lookup.
13102
13103         (IsNamespace): New method
13104
13105 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13106
13107         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13108         we know that we need to concatenate (full typename can never be
13109         null). 
13110
13111         * class.cs: ditto.
13112
13113         * statement.cs: Use a bitfield;  Do not initialize to null things
13114         which are done by the constructor by default.
13115
13116         * cs-parser.jay: bug fix, parameter was 4, not 3.
13117
13118         * expression.cs: Just use the property;
13119
13120         * statement.cs: No need for GetVariableInfo method.
13121
13122 2003-08-08  Martin Baulig  <martin@ximian.com>
13123
13124         * flowanalysis.cs (FlowReturns): This is now nested in the
13125         `FlowBranching' class.
13126         (MyBitVector): Moved this here from statement.cs.
13127         (FlowBranching.SiblingType): New enum type.
13128         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13129
13130 2003-08-07  Martin Baulig  <martin@ximian.com>
13131
13132         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13133         `FlowBranching' class and called `BranchingType'.
13134
13135 2003-08-07  Martin Baulig  <martin@ximian.com>
13136
13137         * flowanalysis.cs: Moved all the control flow analysis code into
13138         its own file.
13139
13140 2003-08-07  Martin Baulig  <martin@ximian.com>
13141
13142         * assign.cs (Assign.DoResolve): `target' must either be an
13143         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13144         #37319.
13145
13146 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13147
13148         * expression.cs (BinaryMethod): This kind of expression is created by the
13149         Binary class if it determines that the operator has to be handled
13150         by a method.
13151
13152         (BinaryDelegate): This kind of expression is created if we are
13153         dealing with a + or - operator on delegates.
13154
13155         (Binary): remove method, argumetns, and DelegateOperator: when
13156         dealing with methods, 
13157
13158         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13159
13160         * statement.cs (Block): use bitfields for the three extra booleans
13161         we had in use.   Remove unused topblock parameter.
13162
13163         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13164
13165         * assign.cs: Drop extra unneeded tests.
13166
13167 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13168
13169         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13170
13171         * statement.cs (Foreach): Use VariableStorage instead of
13172         LocalBuilders.   
13173
13174         * codegen.cs (VariableStorage): New class used by clients that
13175         require a variable stored: locals or fields for variables that
13176         need to live across yield.
13177
13178         Maybe provide a convenience api for EmitThis+EmitLoad?
13179
13180         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13181         these bad boys.
13182
13183 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13184
13185         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13186         RemapParameterLValue): New methods that are used to turn a
13187         precomputed FieldInfo into an expression like this:
13188
13189                 instance.FieldInfo
13190
13191         The idea is to use this instead of making LocalVariableReference
13192         have more than one meaning.
13193
13194         * cs-parser.jay: Add error production to BASE.
13195
13196         * ecore.cs: Deal with TypeManager.GetField returning null, which
13197         is now a valid return value.
13198
13199         (FieldExprNoAddress): New expression for Fields whose address can
13200         not be taken.
13201
13202         * expression.cs (LocalVariableReference): During the resolve
13203         phases, create new expressions if we are in a remapping context.
13204         Remove code that dealt with remapping here.
13205
13206         (ParameterReference): same.
13207
13208         (ProxyInstance): New expression, like the `This' expression, but
13209         it is born fully resolved.  We know what we are doing, so remove
13210         the errors that are targeted to user-provided uses of `this'.
13211
13212         * statement.cs (Foreach): our variable is now stored as an
13213         Expression;  During resolution, follow the protocol, dont just
13214         assume it will return this.
13215
13216 2003-08-06  Martin Baulig  <martin@ximian.com>
13217
13218         * support.cs (SeekableStreamReader.cs): New public class.
13219
13220         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13221         SeekableStreamReader instead of the normal StreamReader.
13222
13223 2003-08-04  Martin Baulig  <martin@ximian.com>
13224
13225         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13226         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13227         deambiguate casts and delegate invocations.
13228         (parenthesized_expression): Use the new tokens to ensure this is
13229         not a cast of method invocation.
13230
13231         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13232         when reading a `)' and Deambiguate_CloseParens () was previously
13233         called.
13234
13235         * expression.cs (ParenthesizedExpression): New class.  This is
13236         just used for the CS0075 test.
13237         (Binary.DoResolve): Check for CS0075.   
13238
13239 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13240
13241         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13242         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13243         reference comparison.
13244
13245         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13246         examine the ReturnType for equality - this is necessary in the
13247         cases of implicit and explicit operators whose signature also
13248         includes the return type.
13249
13250 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13251
13252         * namespace.cs: Cache the result of the namespace computation,
13253         instead of computing it every time.
13254
13255 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13256
13257         * decl.cs: Use a global arraylist that we reuse over invocations
13258         to avoid excesive memory consumption.  Reduces memory usage on an
13259         mcs compile by one meg (45 average).
13260
13261         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13262         private, work around that.
13263
13264 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13265
13266         * literal.cs (IntLiteral): Define Zero and One static literals. 
13267
13268         * cs-parser.jay (integer_literal): use static literals to reduce
13269         memory usage for the most used literals (0, 1 and -1).  211kb
13270         reduced in memory usage.
13271
13272         Replace all calls to `new ArrayList' with `new
13273         ArrayList(4)' which is a good average number for most allocations,
13274         and also requires only 16 bytes of memory for its buffer by
13275         default. 
13276
13277         This reduced MCS memory usage in seven megabytes for the RSS after
13278         bootstrapping.
13279
13280 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13281
13282         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13283         handle params methods the correct way by forming only one
13284         applicable set with params and normal methods in them. Earlier we
13285         were looking at params methods only if we found no normal methods
13286         which was not the correct thing to do.
13287
13288         (Invocation.BetterFunction): Take separate arguments indicating
13289         when candidate and the best method are params methods in their
13290         expanded form.
13291
13292         This fixes bugs #43367 and #46199.
13293
13294         * attribute.cs: Documentation updates.
13295
13296         (CheckAttribute): Rename to CheckAttributeTarget.
13297         (GetValidPlaces): Rename to GetValidTargets.
13298
13299         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13300         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13301
13302         Fixes bug #44468.
13303
13304 2003-07-28  Martin Baulig  <martin@ximian.com>
13305
13306         * class.cs (TypeContainer.DefineMembers): Use the base type's full
13307         name when looking up the base class of a nested class.  Fixes #46977.
13308
13309 2003-07-26  Martin Baulig  <martin@ximian.com>
13310
13311         * expression.cs (Indexers.Indexer): New nested struct; contains
13312         getter, setter and the indexer's type.
13313         (Indexers.Properties): This is now an ArrayList of
13314         Indexers.Indexer's.
13315         (IndexerAccess.DoResolveLValue): Correctly set the type if the
13316         indexer doesn't have any getters.
13317
13318         * assign.cs (Assign.DoResolve): Also do the implicit conversions
13319         for embedded property and indexer assignments.
13320
13321 2003-07-26  Martin Baulig  <martin@ximian.com>
13322
13323         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
13324         preprocessor directive is not the first non-whitespace character
13325         on a line.
13326
13327 2003-07-26  Martin Baulig  <martin@ximian.com>
13328
13329         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
13330         namespace parsing, follow the spec more closely.
13331
13332         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
13333         NamespaceEntry.Lookup().
13334
13335 2003-07-25  Martin Baulig  <martin@ximian.com>
13336
13337         * MethodCore.cs (OverridesSomething): New public field; it's set
13338         from TypeContainer.DefineMembers if this method overrides
13339         something (which doesn't need to be a method).  Fix #39462.
13340
13341 2003-07-25  Ravi Pratap  <ravi@ximian.com>
13342
13343         * typemanager.cs (GetMembers): Ensure that the list of members is
13344         reversed. This keeps things in sync.
13345
13346         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
13347         find an AttributeUsage attribute.
13348
13349         * expression.cs (Invocation.OverloadResolve): Perform the check
13350         which disallows Invoke to be directly called on a Delegate.
13351
13352         (Error_InvokeOnDelegate): Report error cs1533.
13353
13354 2003-07-25  Martin Baulig  <martin@ximian.com>
13355
13356         * expression.cs (Indexers.GetIndexersForType): Only look in the
13357         interface hierarchy if the requested type is already an
13358         interface.  Fixes #46788 while keeping #46502 fixed.
13359
13360 2003-07-25  Martin Baulig  <martin@ximian.com>
13361
13362         * class.cs (TypeContainer.DefineMembers): Check whether all
13363         readonly fields have been assigned and report warning CS0649 if
13364         not.
13365
13366         * statement.cs (LocalInfo.IsFixed): Always return true if this is
13367         a valuetype.
13368
13369 2003-07-24  Ravi Pratap  <ravi@ximian.com>
13370
13371         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
13372         returned from GetMethods to make things consistent with the
13373         assumptions MCS makes about ordering of methods.
13374
13375         This should comprehensively fix bug #45127 and it does :-)
13376
13377         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
13378         ordering is actually reverse.
13379
13380         * Clean up some debug messages I left lying around.
13381
13382         * interface.cs (Populate*): Get rid of code which emits attributes
13383         since the stage in which we emit attributes is the 'Emit' stage,
13384         not the define stage.
13385
13386         (Emit): Move attribute emission for interface members here.
13387
13388 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13389
13390         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13391         closely: we eliminate methods in base types when we have an
13392         applicable method in a top-level type.
13393
13394         Please see section 14.5.5.1 for an exact description of what goes
13395         on. 
13396
13397         This fixes bug #45127 and a host of other related to corlib compilation.
13398
13399         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13400         array is the method corresponding to the top-level type (this is
13401         because of the changes made to icall.c) so we change this
13402         accordingly.
13403
13404         (MethodGroupExpr.Name): This too.
13405
13406         * typemanager.cs (GetElementType): New method which does the right
13407         thing when compiling corlib. 
13408
13409         * everywhere: Make use of the above in the relevant places.
13410
13411 2003-07-22  Martin Baulig  <martin@ximian.com>
13412
13413         * cs-parser.jay (invocation_expression): Moved
13414         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13415         `cast_expression', but create a InvocationOrCast which later
13416         resolves to either an Invocation or a Cast.
13417
13418         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13419         method; call this before EmitStatement() to make sure that this
13420         expression can be used as a statement.
13421
13422         * expression.cs (InvocationOrCast): New class; resolves to either
13423         an Invocation or a Cast.
13424
13425         * statement.cs (StatementExpression): Call ResolveStatement() on
13426         the ExpressionStatement before emitting it.
13427
13428 2003-07-21  Martin Baulig  <martin@ximian.com>
13429
13430         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13431         `ref' and `out' attributes match; fixes #46220.
13432         (MemberAccess.ResolveMemberAccess): You can't reference a type
13433         through an expression; fixes #33180.
13434         (Indexers.GetIndexersForType): Don't return the indexers from
13435         interfaces the class implements; fixes #46502.
13436
13437 2003-07-21  Martin Baulig  <martin@ximian.com>
13438
13439         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13440         CS0661 checks; fixes bug #30442.
13441
13442 2003-07-21  Martin Baulig  <martin@ximian.com>
13443
13444         * decl.cs (AdditionResult): Added `Error'.
13445
13446         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13447
13448         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
13449         makes cs0031.cs actually work.
13450
13451 2003-07-20  Martin Baulig  <martin@ximian.com>
13452
13453         * namespace.cs: Fixed that bug which caused a crash when compiling
13454         the debugger's GUI.
13455
13456 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13457
13458         * typemanager.cs (LookupTypeReflection): Never expose types which
13459         are NotPublic, NestedPrivate, NestedAssembly, or
13460         NestedFamANDAssem.  We used to return these, and later do a check
13461         that would report a meaningful error, but the problem is that we
13462         would not get the real match, if there was a name override.
13463
13464 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13465
13466         * namespace.cs (Namespace, Name): Do not compute the namespace
13467         name dynamically, compute it in the constructor.  This reduced
13468         memory usage by 1697 KB.
13469
13470         * driver.cs: Use --pause to pause at the end.
13471
13472 2003-07-17  Peter Williams  <peter@newton.cx>
13473
13474         * Makefile: Change the name of the test target so that it doesn't
13475         conflict with the recursive test target.
13476
13477 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13478
13479         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13480         AddressOf): Do not use EmitThis, that was wrong, use the actual
13481         this pointer.
13482
13483 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13484
13485         * class.cs (MethodData.Define): While checking if a method is an
13486         interface implementation, improve the test: If we are not public
13487         (use new test here: use the computed MethodAttributes directly,
13488         instead of the parsed modifier flags) check if the `implementing'
13489         method comes from an interface or not.
13490
13491         * pending.cs (VerifyPendingMethods): Slightly better error
13492         message.
13493
13494         * makefile: add test target that does the mcs bootstrap.
13495
13496 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13497
13498         * interface.cs (Define): Do nothing here since there are no
13499         members to populate etc. Move the attribute emission out of here
13500         since this was just totally the wrong place to put it. Attribute
13501         application happens during the 'Emit' phase, not in the 'Define'
13502         phase.
13503
13504         (Emit): Add this method and move the attribute emission here
13505
13506         * rootcontext.cs (EmitCode): Call the Emit method on interface
13507         types too.
13508
13509 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13510
13511         * expression.cs (OverloadResolve): Report error only if Location
13512         is not 'Null' which means that there was a probe going on.
13513
13514 2003-07-14  Martin Baulig  <martin@ximian.com>
13515
13516         * expression.cs (ConditionalLogicalOperator): New public class to
13517         implement user defined conditional logical operators.
13518         This is section 14.11.2 in the spec and bug #40505.
13519
13520 2003-07-14  Martin Baulig  <martin@ximian.com>
13521
13522         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13523
13524 2003-07-14  Martin Baulig  <martin@ximian.com>
13525
13526         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13527
13528         * ecore.cs (IVariable.VerifyFixed): New interface method.
13529
13530         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13531         operator, check whether the variable is actually fixed.  Fixes bug
13532         #36055.  Set a variable definitely assigned when taking its
13533         address as required by the spec.
13534
13535         * statement.cs (LocalInfo.IsFixed): New field.
13536         (LocalInfo.MakePinned): Set `IsFixed' to true.
13537
13538 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13539
13540         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13541         for .ctors, ensure that we only ask for members declared in the
13542         attribute type (BindingFlags.DeclaredOnly).
13543
13544         Fixes bug #43632.
13545
13546         * expression.cs (Error_WrongNumArguments): Report error 1501
13547         correctly the way CSC does.
13548
13549 2003-07-13  Martin Baulig  <martin@ximian.com>
13550
13551         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13552         lookup on the fully qualified name, to make things like "X.X" work
13553         where "X.X" is a fully qualified type name, but we also have a
13554         namespace "X" in the using list.  Fixes #41975.
13555
13556 2003-07-13  Martin Baulig  <martin@ximian.com>
13557
13558         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13559         function. If we're a CompoundAssign, we need to create an embedded
13560         CompoundAssign, not an embedded Assign.
13561         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13562         Fixes #45854.
13563
13564 2003-07-13  Martin Baulig  <martin@ximian.com>
13565
13566         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13567         work to fix bug #46088.
13568
13569 2003-07-13  Ravi Pratap <ravi@ximian.com>
13570
13571         * class.cs (Operator.Emit): Do not emit attributes here - it is
13572         taken care of by the Method class that we delegate too. This takes
13573         care of bug #45876.
13574
13575 2003-07-10  Martin Baulig  <martin@ximian.com>
13576
13577         * expression.cs (TypeOfVoid): New class.
13578         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13579
13580 2003-07-10  Martin Baulig  <martin@ximian.com>
13581
13582         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13583         bug #35957.
13584
13585 2003-07-10  Martin Baulig  <martin@ximian.com>
13586
13587         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13588         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13589
13590         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13591
13592         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13593
13594 2003-07-10  Martin Baulig  <martin@ximian.com>
13595
13596         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13597         of decimal.  Fixes #42850.
13598
13599         NOTE: I also fixed the created byte blob, but this doesn't work on
13600         the MS runtime and csc never produces any byte blobs for decimal
13601         arrays.
13602
13603 2003-07-10  Martin Baulig  <martin@ximian.com>
13604
13605         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13606         structs; fixes #32068.
13607         (Block.AddChildVariableNames): Fixed #44302.
13608
13609 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13610
13611         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13612
13613 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13614
13615         * attribute.cs: And this test is onger needed.
13616
13617 2003-07-08  Martin Baulig  <martin@ximian.com>
13618
13619         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13620         inaccessible types.  Fixes #36313.
13621
13622         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13623
13624         * namespace.cs (NamespaceEntry): Create implicit entries for all
13625         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13626         implicit entries for N1.N2 and N1.
13627
13628 2003-07-08  Martin Baulig  <martin@ximian.com>
13629
13630         Rewrote the handling of namespaces to fix a lot of the issues
13631         wrt. `using' aliases etc.
13632
13633         * namespace.cs (Namespace): Splitted this class into a
13634         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13635
13636         * typemanager.cs (TypeManager.IsNamespace): Removed.
13637         (TypeManager.ComputeNamespaces): Only compute namespaces from
13638         loaded assemblies here, not the namespaces from the assembly we're
13639         currently compiling.
13640
13641 2003-07-08  Martin Baulig  <martin@ximian.com>
13642
13643         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13644
13645 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13646
13647         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13648         already fixed it.  
13649
13650         I thought about the memory savings here, but LookupTypeReflection
13651         is used under already very constrained scenarios.  Compiling
13652         corlib or mcs only exposes one hit, so it would not really reduce
13653         any memory consumption.
13654
13655 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13656
13657         * typemanager.cs: fixes bug #45889 by only adding public types from
13658         other assemblies to the list of known types.
13659
13660 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13661
13662         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13663         on the type we resolved.
13664
13665 2003-07-05  Martin Baulig  <martin@ximian.com>
13666
13667         * pending.cs (PendingImplementation.ParentImplements): Don't
13668         create the proxy if the parent is abstract.
13669
13670         * class.cs (TypeContainer.DefineIndexers): Process explicit
13671         interface implementations first.  Fixes #37714.
13672
13673 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13674
13675         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13676         defined recursively;  but since we modify the input parameters
13677         (left is set to `this' temporarily), we reset this value if the
13678         left_is_explicit is false, which gives the original semantics to
13679         the code.  
13680
13681         * literal.cs (NullPointer): new class used to represent a null
13682         literal in a pointer context.
13683
13684         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13685         type is a pointer, use a NullPointer object instead of a
13686         NullLiteral.   Closes 43687
13687
13688         (ExplicitConversion): Convert pointer values using
13689         the conv opcode to the proper type.
13690
13691         * ecore.cs (New): change ValueTypeVariable property into a method,
13692         that returns whether the valuetype is suitable for being used.
13693
13694         * expression.cs (Binary.DoNumericPromotions): Only return if we
13695         the int constant was a valid uint, and we can return both left and
13696         right as uints.  If not, we continue processing, to trigger the
13697         type conversion.  This fixes 39018.
13698
13699         * statement.cs (Block.EmitMeta): During constant resolution, set
13700         the CurrentBlock property on the emitcontext, so that we resolve
13701         constants propertly.
13702
13703 2003-07-02  Martin Baulig  <martin@ximian.com>
13704
13705         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13706         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13707
13708         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13709         than emitting it here.
13710
13711         * statement.cs: Fixed some more flow analysis bugs.
13712
13713 2003-07-02  Martin Baulig  <martin@ximian.com>
13714
13715         * class.cs (MethodData.Define): When implementing interface
13716         methods, set Final unless we're Virtual.
13717
13718         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13719         check work for interface methods.
13720
13721 2003-07-01  Martin Baulig  <martin@ximian.com>
13722
13723         * ecore.cs (EmitContext.This): Replaced this property with a
13724         GetThis() method which takes a Location argument.  This ensures
13725         that we get the correct error location for a CS0188.
13726
13727 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13728
13729         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13730         ImplicitStandardConversion.
13731
13732         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13733
13734 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13735
13736         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13737         optimization.
13738
13739 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13740
13741         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13742         constructors.
13743
13744         (MethodData.Define): Turn off initlocals for unsafe methods.
13745
13746 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13747
13748         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13749         complete;  Fixes #37521.
13750
13751         * delegate.cs: Use Modifiers.TypeAttr to compute the
13752         TypeAttributes, instead of rolling our own.  This makes the flags
13753         correct for the delegates.
13754
13755 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13756
13757         * class.cs (Constructor.Define): Set the private flag for static
13758         constructors as well.
13759
13760         * cs-parser.jay (statement_expression): Set the return value to
13761         null, to avoid a crash when we catch an error.
13762
13763 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13764
13765         * cs-parser.jay: Applied patch from Jackson that adds support for
13766         extern and unsafe modifiers to destructor declarations.
13767
13768         * expression.cs: Report error 21 if the user is trying to index a
13769         System.Array.
13770
13771         * driver.cs: Add an error message, suggested by the bug report.
13772
13773         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13774         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13775
13776 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13777
13778         * namespace.cs: Add some information to reduce FAQs.
13779
13780 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13781
13782         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13783         underlying enumeration types.  Fixes #43915.
13784
13785         * expression.cs: Treat ushort/short as legal values to be used in
13786         bitwise operations.
13787
13788 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13789
13790         * delegate.cs: transfer custom attributes for paramenters from
13791         the delegate declaration to Invoke and BeginInvoke.
13792
13793 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13794
13795         * attribute.cs: handle custom marshalers and emit marshal info
13796         for fields, too.
13797
13798 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13799
13800         * makefile.gnu: Added anonymous.cs to the compiler sources.
13801
13802 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13803
13804         * iterators.cs: Change the name of the proxy class to include two
13805         underscores.
13806
13807         * cs-parser.jay: Update grammar to include anonymous methods.
13808
13809         * anonymous.cs: new file.
13810
13811 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13812
13813         * class.cs (Field.Define): Add missing test for pointers and
13814         safety. 
13815
13816 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13817
13818         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13819         we use the stobj opcode.
13820
13821         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13822         since it wasn't the correct fix. 
13823
13824         It still is puzzling that we are required to use stobj for IntPtr
13825         which seems to be a ValueType.
13826
13827 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13828
13829         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13830         during regular simple name resolution.   Now, the trick is that
13831         instead of returning for processing the simplename, we do a
13832         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13833         contextual lookup type).   If a match is found, return that, if
13834         not, return for further composition.
13835
13836         This fixes long-standing 30485.
13837
13838         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13839         using the address to initialize an object, do an Stobj instead of
13840         using the regular Stelem.
13841
13842         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13843         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13844         Because if we are a BaseIndexerAccess that value will be true.
13845         Fixes 43643.
13846
13847         * statement.cs (GotoCase.Resolve): Return after reporting an
13848         error, do not attempt to continue. 
13849
13850         * expression.cs (PointerArithmetic.Emit): If our operand is a
13851         long, convert our constants to match the operand before
13852         multiplying.  Convert to I type before adding.   Fixes 43670.
13853
13854 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13855
13856         * enum.cs (ImplicitConversionExists) : Rename to
13857         ImplicitEnumConversionExists to remove ambiguity. 
13858
13859         * ecore.cs (NullCast): New type of cast expression class which
13860         basically is very similar to EmptyCast with the difference being
13861         it still is a constant since it is used only to cast a null to
13862         something else
13863         (eg. (string) null)
13864
13865         * convert.cs (ImplicitReferenceConversion): When casting a null
13866         literal, we return a NullCast.
13867
13868         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13869         should be around anymore.
13870
13871         The renaming (reported was slightly wrong). Corrections:
13872
13873         ConvertImplicitStandard -> ImplicitConversionStandard
13874         ConvertExplicitStandard -> ExplicitConversionStandard
13875
13876         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13877         before passing them in !
13878
13879         * convert.cs (ImplicitConversionStandard): When comparing for
13880         equal expr and target types, ensure that expr is not a
13881         NullLiteral.
13882
13883         In general, we must not be checking (expr_type ==
13884         target_type) in the top level conversion methods
13885         (ImplicitConversion, ExplicitConversion etc). This checking is
13886         done in the methods that they delegate to.
13887
13888 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13889
13890         * convert.cs: Move Error_CannotConvertType,
13891         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13892         ImplicitNumericConversion, ImplicitConversionExists,
13893         ImplicitUserConversionExists, StandardConversionExists,
13894         FindMostEncompassedType, FindMostSpecificSource,
13895         FindMostSpecificTarget, ImplicitUserConversion,
13896         ExplicitUserConversion, GetConversionOperators,
13897         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13898         TryImplicitIntConversion, Error_CannotConvertImplicit,
13899         ConvertImplicitRequired, ConvertNumericExplicit,
13900         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13901         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13902         its own file.
13903
13904         Perform the following renames:
13905
13906         StandardConversionExists -> ImplicitStandardConversionExists
13907         ConvertImplicit -> ImplicitConversion
13908         ConvertImplicitStandard -> ImplicitStandardConversion
13909         TryImplicitIntConversion -> ImplicitIntConversion
13910         ConvertImplicitRequired -> ImplicitConversionRequired
13911         ConvertNumericExplicit -> ExplicitNumericConversion
13912         ConvertReferenceExplicit -> ExplicitReferenceConversion
13913         ConvertExplicit -> ExplicitConversion
13914         ConvertExplicitStandard -> ExplicitStandardConversion
13915
13916 2003-05-19  Martin Baulig  <martin@ximian.com>
13917
13918         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13919         (TypeInfo): Added support for structs having structs as fields.
13920
13921         * ecore.cs (FieldExpr): Implement IVariable.
13922         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13923         VariableInfo for the field.
13924
13925 2003-05-18  Martin Baulig  <martin@ximian.com>
13926
13927         * expression.cs (This.DoResolve): Report a CS0027 if we're
13928         emitting a field initializer.
13929
13930 2003-05-18  Martin Baulig  <martin@ximian.com>
13931
13932         * expression.cs (This.ResolveBase): New public function.
13933         (This.DoResolve): Check for CS0188.
13934
13935         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13936         This.Resolve().
13937
13938         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13939         `instance_expression' to null if we don't have any non-static
13940         methods.
13941
13942 2003-05-18  Martin Baulig  <martin@ximian.com>
13943
13944         Reworked the way how local variables and parameters are handled by
13945         the flow analysis code.
13946
13947         * statement.cs (TypeInfo, VariableMap): New public classes.
13948         (VariableInfo): New public class.  This is now responsible for
13949         checking whether a variable has been assigned.  It is used for
13950         parameters and local variables.
13951         (Block.EmitMeta): Take the InternalParameters as argument; compute
13952         the layout of the flow vectors here.
13953         (Block.LocalMap, Block.ParameterMap): New public properties.
13954         (FlowBranching): The .ctor doesn't get the InternalParameters
13955         anymore since Block.EmitMeta() now computes the layout of the flow
13956         vector.
13957         (MyStructInfo): This class is now known as `StructInfo' and nested
13958         in `TypeInfo'; we don't access this directly anymore.
13959
13960         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13961         property and removed IsAssigned(), IsFieldAssigned(),
13962         SetAssigned() and SetFieldAssigned(); we now call them on the
13963         VariableInfo so we don't need to duplicate this code everywhere.
13964
13965         * expression.cs (ParameterReference): Added `Block block' argument
13966         to the .ctor.
13967         (LocalVariableReference, ParameterReference, This): The new
13968         VariableInfo class is now responsible for all the definite
13969         assignment stuff.
13970
13971         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13972         IsParameterAssigned, SetParameterAssigned): Removed.
13973
13974 2003-05-18  Martin Baulig  <martin@ximian.com>
13975
13976         * typemanager.cs (InitCoreTypes): Try calling
13977         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13978         the 3-args-version.  Corlib now also needs our `void_type'.
13979         (GetMethod): Added overloaded version which takes an optional
13980         `bool report_errors' to allow lookups of optional methods.
13981
13982 2003-05-12  Martin Baulig  <martin@ximian.com>
13983
13984         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13985         only used for locals and not for parameters.
13986
13987 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13988
13989         * support.cs (InternalParameters.ParameterType): Return the
13990         ExternalType of the parameter.
13991
13992         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13993         they were unused.
13994
13995 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13996
13997         * class.cs (MethodData.Define): Do not set the `newslot' on
13998         interface members, if they are also flagged as "override".
13999
14000         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14001         better code for ++i and i++.  This only works for static fields
14002         and local variables.
14003
14004         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14005         want to pull the DeclSpace out of the builder_to_declspace instead
14006         of the TypeBuilder (like in TypeContainer.FindMembers).
14007
14008         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14009         instead of LookupTypeContainer.  Fixes the crash on .NET for
14010         looking up interface members.
14011
14012         * const.cs: Create our own emit context during the Definition
14013         stage, so that constants are evaluated in the proper context, when
14014         a recursive definition happens.
14015
14016 2003-05-11  Martin Baulig  <martin@ximian.com>
14017
14018         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14019         new block for a switch section.
14020         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14021         the adding/lookup in the switch block.  Fixes #39828.
14022
14023 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14024
14025         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14026         functionality: I needed to convert the data after I had performed
14027         the add/sub operation into the operands type size.
14028
14029         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14030         pass the type for the box operation, otherwise the resulting
14031         object would have been of type object.
14032
14033         (BoxedCast): Add constructor to specify the type to box as.
14034
14035 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14036
14037         * iterators.cs: I was reusing the `count' variable inadvertently,
14038         take steps to not allow this to happen.
14039
14040 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14041
14042         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14043         by creating an array at the point where the params starts and
14044         putting all those arguments there, then adjusting the size of the
14045         array.
14046
14047 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14048
14049         * expression.cs (New.AddressOf): Implement interface
14050         IMemoryLocation.  This is used when the `new' operator is used in
14051         the context of an invocation to a method on a value type.
14052
14053         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14054         example. 
14055
14056         * namespace.cs: Also check the using aliases here.
14057
14058         * driver.cs: Move the test for using validity after the types have
14059         been entered, so we do a single pass that also includes the using
14060         aliases. 
14061
14062         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14063         in the regular case.   CreateSiblingForFinally is doing extra
14064         error checking.
14065
14066         * attribute.cs (GetAttributeArgumentExpression): Store the result
14067         on an out value, and use the return value to indicate failure
14068         instead of using null (which is a valid return for Constant.GetValue).
14069
14070         * statement.cs: Perform the analysis flow for the increment
14071         portion after the statement, because this will be the real flow of
14072         execution.  Fixes #42385
14073
14074         * codegen.cs (EmitContext.EmitArgument,
14075         EmitContext.EmitStoreArgument): New helper functions when the
14076         RemapToProxy flag is set.
14077
14078         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14079         function.
14080
14081         Add support for remapping parameters. 
14082
14083         * iterators.cs: Propagate parameter values;  Store parameter
14084         values in the proxy classes.
14085
14086 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14087
14088         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14089         need a proxy reference;  I do not know what I was thinking
14090
14091         * cs-parser.jay (constructor_initializer): catch another error,
14092         and display nice message.
14093
14094         (field_declaration): catch void field declaration
14095         to flag a better error. 
14096
14097         * class.cs (MemberBase.CheckBase): Report an error instead of a
14098         warning if a new protected member is declared in a struct. 
14099         (Field.Define): catch the error of readonly/volatile.
14100
14101         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14102
14103         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14104         volatile variable is taken
14105
14106 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14107
14108         * statement.cs (Fixed.Resolve): Report an error if we are not in
14109         an unsafe context.
14110
14111 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14112
14113         * typemanager.cs: reuse the code that handles type clashes for
14114         delegates and enumerations.
14115
14116         * class.cs (Report28): Always report.
14117
14118         * expression.cs (EncodeAsAttribute): Allow nulls here.
14119
14120 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14121
14122         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14123         the functionality for testing whether an expression is valid for
14124         an attribute here.  Also handle the case of arrays of elements
14125         being stored. 
14126
14127         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14128         encoding a linear array into an array of objects that are suitable
14129         to be passed to an CustomAttributeBuilder.
14130
14131         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14132
14133         * ecore.cs: (FieldExpr): Handle field remapping here.
14134
14135         * iteratators.cs: Pass the instance variable (if the method is an
14136         instance method) to the constructors, so we can access the field
14137         variables on the class.
14138
14139         TODO: Test this with structs.  I think the THIS variable on
14140         structs might have to be a pointer, and not a refenrece
14141
14142 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14143
14144         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14145         local variables to fields in a proxy class.
14146
14147         * iterators.cs (PopulateProxy): Rename our internal fields to
14148         <XXX>.  
14149         Create a <THIS> field if we are an instance method, so we can
14150         reference our parent container variables.
14151         (MapVariable): Called back from the EmitContext code to enter a
14152         new variable to field mapping into the proxy class (we just create
14153         a FieldBuilder).
14154
14155         * expression.cs
14156         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14157         for using the remapped locals to fields.
14158
14159         I placed the code here, because that gives the same semantics to
14160         local variables, and only changes the Emit code.
14161
14162         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14163         statements inside iterators.
14164         (VariableInfo): Add a FieldBuilder for the cases when we are
14165         remapping local variables to fields in a proxy class
14166
14167         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14168         current_block != null.
14169
14170         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14171         not cope with strings, as it has been moved to the
14172         TableSwitchEmit.  Fixed bug in switch generation.
14173
14174         * expression.cs (New.DoResolve): Provide more context for the user
14175         when reporting an error.
14176
14177         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14178         pointers. 
14179
14180         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14181         check the permissions for it.  Note than in a type-resolution
14182         context the check was already present in DeclSpace.ResolveType,
14183         but was missing from the MemberAccess.
14184
14185         (ArrayCreation.CheckIndices): warn if the user has
14186         more nested levels of expressions, but there are no more
14187         dimensions specified.  Avoids crash on bug 41906.
14188
14189 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14190
14191         * statement.cs (Block): replace Implicit bool, for a generic
14192         flags.   
14193         New flag: `Unchecked'.  This is used during the EmitMeta phase
14194         (which is out-of-line with the regular Resolve/Emit process for a
14195         statement, as this is done ahead of time, but still gets a chance
14196         to call constant resolve).
14197
14198         (Block.Flags): new enum for adding a new flag.
14199
14200         (Block.EmitMeta): track the state of unchecked.
14201
14202         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14203         to enable constant resolution to work there as well.
14204
14205 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14206
14207         * typemanager.cs (ienumerable_type): Also look up
14208         System.Collections.IEnumerable. 
14209
14210 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14211
14212         TODO: Test more than one conditional per method.
14213
14214         * class.cs (Indexer.Define): Report the location where the user is
14215         referencing the unsupported feature.
14216
14217         (MethodData): Overload the use of `conditionals' to
14218         minimize the creation of needless ArrayLists.   This saves roughly
14219         212kb on my machine.
14220
14221         (Method): Implement the new IIteratorContainer interface.
14222         (Method.SetYields): Implement the method by setting the ModFlags
14223         to contain METHOD_YIELDS.
14224
14225         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14226         which just got set to null.
14227
14228         * iterators.cs: New file.
14229
14230         (Yield, YieldBreak): New statements.
14231
14232         * statement.cs (Return.Resolve): Flag an error if we are used in
14233         an iterator method.
14234
14235         * codegen.cs (InIterator): New flag set if the code is being
14236         compiled in an iterator method.
14237
14238         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14239         internal modifier, and we just use it to avoid adding extra
14240         fields, as this is seldom used.  
14241
14242         * cs-parser.jay: Add yield_statement (yield and yield break).
14243
14244         * driver.cs: New flag -v2 to turn on version 2 features. 
14245
14246         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14247         hashtable when v2 is enabled.
14248
14249 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14250
14251         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14252         there is already a namespace defined with this name.
14253
14254         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14255         people upgraded their corlibs.
14256
14257         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14258         always use fully qualified types, no need to use the compiler
14259         front end.
14260
14261         (TypeManager.IsNamespace): Use binarysearch.
14262
14263         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14264         AddDelegate): I did not quite use the new IsValid API properly: I
14265         have to pass the short-name and the fullname.  I was passing only
14266         the basename instead of the fullname sometimes. 
14267
14268         (TypeContainer.DefineType): call NamespaceClash.
14269
14270         * interface.cs (Interface.DefineType): use NamespaceClash before
14271         defining the type.
14272
14273         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14274         defining the type.
14275
14276         * enum.cs: (Enum.DefineType): use NamespaceClash before
14277         defining the type.
14278
14279         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14280         speed increase.  First, use the negative_hits cache when we get a
14281         negative.  Second, add the type with its full original name
14282         instead of the new . and + encoded name (reflection uses + to
14283         separate type from a nested type).  Use LookupTypeReflection
14284         directly which bypasses the type->name hashtable (that we already
14285         know does not contain the type.
14286
14287         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14288         location/container type. 
14289
14290         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14291
14292 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14293
14294         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14295
14296         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14297         method is being referenced in the method group from a static
14298         context, and report error 120 if so.
14299
14300         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14301         Error118. 
14302
14303         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14304         is created, we create the A namespace).
14305
14306         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14307         Fixes #41591
14308
14309 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14310
14311         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14312         invocation to ModuleBuilder.GetType with the same values will
14313         return a new type instance, so we need to cache its return
14314         values. 
14315
14316         * expression.cs (Binary.ResolveOperator): Only allow the compare
14317         operators on enums if they are of the same type.
14318
14319         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14320         types of ValueType on their own case.  Before we were giving them
14321         the same treatment as objects.
14322
14323         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14324         fullname.  Short name is used to compare against container name.
14325         Fullname is used to check against defined namespace names.
14326
14327         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14328         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14329
14330         (Method.CheckBase): Call parent.
14331         (MemberBase.CheckBase): Check for protected members on sealed
14332         classes.
14333         (PropertyBase.CheckBase): Call parent.
14334         (Field.Define): Call parent.
14335
14336         * report.cs: Negative error codes are now mapped to 8000 - code,
14337         so that the display is render more nicely.
14338
14339         * typemanager.cs: Do not use try/catch, instead report a regular
14340         error. 
14341
14342         (GetPointerType, GetReferenceType): These methods provide
14343         mechanisms to obtain the T* and T& from a T.  We had the code
14344         previously scattered around the code base, and it also used
14345         TypeManager.LookupType that would go through plenty of caches.
14346         This one goes directly to the type source.
14347
14348         In some places we did the Type.GetType followed by
14349         ModuleBuilder.GetType, but not in others, so this unifies the
14350         processing as well.
14351
14352         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14353         statements now that we have namespace information.
14354
14355         * typemanager.cs (IsNamespace): New method, returns whether the
14356         string presented is a namespace or not.
14357
14358         (ComputeNamespaces): New public entry point, computes the list of
14359         available namespaces, using the GetNamespaces API call in Mono, or
14360         the slower version in MS.NET.   
14361
14362         Now before we start the semantic analysis phase, we have a
14363         complete list of namespaces including everything that the user has
14364         provided.
14365
14366         Deleted old code to cache namespaces in .nsc files.
14367
14368 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14369
14370         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14371         class/struct location definition Location for the implicit
14372         constructor location.
14373
14374         (Operator.Define): Use the location of the operator for the
14375         implicit Method definition.
14376
14377         (Constructor.Emit): use the constructor location for the implicit
14378         base initializer constructor.
14379
14380         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14381         and the Expression class now contains two new methods:
14382
14383         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14384         isolate type lookup from the rest of the resolution process.
14385
14386         Since we use Expressions to hold type definitions due to the way
14387         we parse the input we have historically overloaded Resolve to
14388         perform the Type lookups if a special flag is passed.  Now this is
14389         eliminated and two methods take their place. 
14390
14391         The differences in the two methods between xStep and xTerminal is
14392         that xStep is involved in our current lookup system that uses
14393         SimpleNames to compose a name, while xTerminal is used just to
14394         catch the case where the simplename lookup failed.
14395
14396 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14397
14398         * expression.cs (ResolveMemberAccess): Remove redundant code.
14399         TypeExpr expressions are always born fully resolved.
14400
14401         * interface.cs (PopulateMethod): Do not lookup the types twice.
14402         We were doing it once during SemanticAnalysis and once during
14403         PopulateMethod.
14404
14405         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14406         in local variable type definitions, were being returned as a
14407         SimpleName (we decomposed everything into a string), that is
14408         because primary_expression was being used instead of a type in the
14409         grammar (reduce/reduce conflicts).
14410
14411         The part that was wrong is that we converted the expression into a
14412         string (an oversimplification in one hand, compounded with primary
14413         expressions doing string concatenation).
14414
14415         So things like:
14416
14417         A.B.C [] x;
14418
14419         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14420         using clauses from working on this particular context.  And a type
14421         was being matched directly against "A.B.C[]".
14422
14423         We now use the correct approach, and allow for ComposedCast to be
14424         part of the unary expression.  So the "A.B.C []" become a composed
14425         cast of "A.B.C" (as a nested group of MemberAccess with a
14426         SimpleName at the end) plus the rank composition "[]". 
14427
14428         Also fixes 35567
14429
14430 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14431
14432         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14433         for the access level checking.
14434
14435         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14436         `TypeContainer container', because I kept getting confused when I
14437         was debugging this code.
14438
14439         * expression.cs (Indexers): Instead of tracking getters/setters,
14440         we now track them in parallel.  We create one arraylist less, but
14441         most importantly it is possible now for the LValue code to find a
14442         matching get for a set.
14443
14444         (IndexerAccess.DoResolveLValue): Update the code.
14445         GetIndexersForType has been modified already to extract all the
14446         indexers from a type.  The code assumed it did not.
14447
14448         Also make the code set the correct return type for the indexer.
14449         This was fixed a long time ago for properties, but was missing for
14450         indexers.  It used to be void_type.
14451
14452         (Binary.Emit): Test first for doubles instead of
14453         floats, as they are more common.
14454
14455         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14456         when dealing with floats and the <=, >= operators.  This fixes bug
14457         #39314 
14458
14459         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14460         to load the array value by emitting a load on the foreach variable
14461         type.  This was incorrect.  
14462
14463         We now emit the code to load an element using the the array
14464         variable type, and then we emit the conversion operator.
14465
14466         Fixed #40176
14467
14468 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14469
14470         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14471
14472 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14473
14474         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14475         test for protection before we test for signatures. 
14476
14477         (MethodSignature.ToString): implement.
14478
14479         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14480         to the case where we reduced into a LongConstant.
14481
14482         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14483         depend on whether the information is acurrate, because the
14484         Microsoft runtime will always claim that the array type is public,
14485         regardless of the real state.
14486
14487         If the type is a pointer, another problem happens: the type is
14488         reported as non-public in Microsoft.  
14489
14490         In both cases we have to call CheckAccessLevel recursively with
14491         the underlying type as the argument to be tested.
14492
14493 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14494
14495         * assign.cs (Assign.Emit): If we are dealing with a compound
14496         assignment expression, we should use the code path that stores the
14497         intermediate result in a temporary value.  This fixes #40903.
14498
14499         *expression.cs (Indirection.ToString): Provide ToString method for
14500         debugging. 
14501
14502 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14503
14504         * class.cs: Null out fields holding references to Block objects so
14505         they can be garbage collected.
14506
14507         * expression.cs (OverloadResolve): Remove unused local.
14508
14509 2003-04-07  Martin Baulig  <martin@ximian.com>
14510
14511         * codegen.cs (EmitContext.CurrentFile): New public field.
14512         (EmitContext.Mark): Use the CurrentFile to check whether the
14513         location is in the correct file.
14514         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14515
14516 2003-04-07  Martin Baulig  <martin@ximian.com>
14517
14518         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14519
14520         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14521         location.  [FIXME: The location argument which gets passed to this
14522         method is sometimes wrong!]
14523
14524 2003-04-07  Nick Drochak <ndrochak@gol.com>
14525
14526         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14527
14528 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14529
14530         * expression.cs (Indirection.EmitAssign): We were using the
14531         temporary, but returning immediately instead of continuing the
14532         EmitAssing flow.
14533
14534 2003-04-06  Martin Baulig  <martin@ximian.com>
14535
14536         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14537         if it's a nested child, but also deriving from the outer class.
14538         See test 190.cs.
14539
14540         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14541         nested child, but also deriving from the outer class.  See
14542         test-190.cs.
14543         (FilterWithClosure): We may access private members of the outer
14544         class if we're a nested child and deriving from the outer class.
14545         (RealMemberLookup): Only set `closure_private_ok' if the
14546         `original_bf' contained BindingFlags.NonPublic.
14547
14548 2003-04-05  Martin Baulig  <martin@ximian.com>
14549
14550         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
14551
14552 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14553
14554         * class.cs (Event.Define): Do not allow abstract events to have
14555         initializers. 
14556
14557 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14558
14559         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14560         block in event declarations.
14561
14562         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14563         value type, get its address.
14564
14565         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14566         leaving a class on the stack instead of a boolean value (int
14567         0/1).  Change the code so we compare against null, and then the
14568         result against zero.
14569
14570         * class.cs (TypeContainer.GetClassBases): We were checking for the
14571         parent class being sealed too late.
14572
14573         * expression.cs (Binary.Emit): For <= and >= when dealing with
14574         floating point values, use cgt.un and clt.un instead of cgt and
14575         clt alone.
14576
14577 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14578
14579         * statement.cs: Apply the same optimization as MS: skip the 
14580         GetEnumerator returning an IEnumerator, and use the one returning a 
14581         CharEnumerator instead. This allows us to avoid the try-finally block 
14582         and the boxing.
14583
14584 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14585
14586         * cs-parser.jay: Attributes cannot be applied to
14587                          namespaces. Fixes #40473
14588
14589 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14590
14591         * class.cs:
14592         (Add*): check if the name is valid using the full name for constants,
14593         fields, properties and events.
14594
14595 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14596
14597         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14598         char constants to be part of the enumeration.
14599
14600         * expression.cs (Conditional.DoResolve): Add support for operator
14601         true. Implements the missing functionality from 14.12
14602
14603         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14604         operator true/false as required by the spec.
14605
14606         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14607         implicit conversion to boolean.
14608
14609         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14610         also one where the type implements `operator true'. 
14611
14612         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14613         get an expression that will invoke operator true based on an
14614         expression.  
14615
14616         (GetConversionOperators): Removed the hack that called op_True
14617         here.  
14618
14619         (Expression.ResolveBoolean): Move this from Statement.
14620
14621 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14622
14623         * ecore.cs (FieldExpr): do not allow initialization of initonly
14624         fields on derived classes
14625
14626 2003-03-13  Martin Baulig  <martin@ximian.com>
14627
14628         * statement.cs (Block.Emit): Call ig.BeginScope() and
14629         ig.EndScope() when compiling with debugging info; call
14630         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14631
14632 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14633
14634         * expression.cs (Indexers): Do not construct immediately, allow
14635         for new members to be appended as we go.  Fixes 38143
14636
14637 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14638
14639         * expression.cs: save/restore context when resolving an unchecked
14640         expression.
14641
14642 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14643
14644         * cfold.cs: Catch division by zero in modulus operator during
14645         constant folding.
14646
14647 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14648
14649         * interface.cs (Interface.DefineMembers): Avoid defining members
14650         twice. 
14651
14652 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14653
14654         * driver.cs: handle the +/- options for -noconfig
14655
14656         * statement.cs (Unckeched.Resolve): Also track the state of
14657         unchecked in the Resolve phase.
14658
14659 2003-02-27  Martin Baulig  <martin@ximian.com>
14660
14661         * ecore.cs (Expression.MemberLookup): Don't create a
14662         MethodGroupExpr for something which is not a method.  Fixes #38291.
14663
14664 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14665
14666         * class.cs (MemberBase.CheckParameters): Also check that the type
14667         is unmanaged if it is a pointer.
14668
14669         * expression.cs (SizeOf.Resolve): Add location information.
14670
14671         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14672         a managed type is declared.
14673
14674         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14675         parameter modifiers as well.  Fixes bug 38606
14676
14677         * class.cs: Very sad.  Am backing out the speed up changes
14678         introduced by the ArrayList -> Array in the TypeContainer, as they
14679         were not actually that much faster, and introduced a bug (no error
14680         reports on duplicated methods).
14681
14682         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14683         source first, this will guarantee that we have a valid expression
14684         before calling in lower levels functions that will require a
14685         resolved object.  Then use this original_source in the
14686         target.ResolveLValue instead of the original source that was
14687         passed to us.
14688
14689         Another change.  Use target.Resolve instead of LValueResolve.
14690         Although we are resolving for LValues, we will let the Assign code
14691         take care of that (it will be called again from Resolve).  This
14692         basically allows code like this:
14693
14694         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14695         class Y { void A (X x) { x [0] += o; }
14696
14697         The problem was that the indexer was trying to resolve for
14698         set_Item (idx, object o) and never finding one.  The real set_Item
14699         was set_Item (idx, X).  By delaying the process we get the right
14700         semantics. 
14701
14702         Fixes bug 36505
14703
14704 2003-02-23  Martin Baulig  <martin@ximian.com>
14705
14706         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14707         while calling DoEmit ().
14708
14709         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14710         source files; if you use the #line directive inside a method, the
14711         compiler stops emitting line numbers for the debugger until it
14712         reaches the end of the method or another #line directive which
14713         restores the original file.
14714
14715 2003-02-23  Martin Baulig  <martin@ximian.com>
14716
14717         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14718
14719 2003-02-23  Martin Baulig  <martin@ximian.com>
14720
14721         * statement.cs (Block.AddChildVariableNames): We need to call this
14722         recursively, not just for our immediate children.
14723
14724 2003-02-23  Martin Baulig  <martin@ximian.com>
14725
14726         * class.cs (Event.Define): Always make the field private, like csc does.
14727
14728         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14729         actually work, fixes bug #37521.
14730
14731 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14732
14733         * delegate.cs: When creating the various temporary "Parameters"
14734         classes, make sure that we call the ComputeAndDefineParameterTypes
14735         on those new parameters (just like we do with the formal ones), to
14736         allow them to be resolved in the context of the DeclSpace.
14737
14738         This fixes the bug that Dick observed in Bugzilla #38530.
14739
14740 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14741
14742         * expression.cs (ResolveMemberAccess): When resolving a constant,
14743         do not attempt to pull a constant if the value was not able to
14744         generate a valid constant.
14745
14746         * const.cs (LookupConstantValue): Do not report more errors than required.
14747
14748 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14749
14750         * expression.cs: fixes bug #38328.
14751
14752 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14753
14754         * class.cs: Changed all the various members that can be part of a
14755         class from being an ArrayList to be an Array of the right type.
14756         During the DefineType type_list, interface_list, delegate_list and
14757         enum_list are turned into types, interfaces, delegates and enums
14758         arrays.  
14759
14760         And during the member population, indexer_list, event_list,
14761         constant_list, field_list, instance_constructor_list, method_list,
14762         operator_list and property_list are turned into their real arrays.
14763
14764         Although we could probably perform this operation earlier, for
14765         good error reporting we need to keep the lists and remove the
14766         lists for longer than required.
14767
14768         This optimization was triggered by Paolo profiling the compiler
14769         speed on the output of `gen-sample-program.pl' perl script. 
14770
14771         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14772         not crash in methods like MemberLookupFailed that use this field.  
14773
14774         This problem arises when the compiler fails to resolve a type
14775         during interface type definition for example.
14776
14777 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14778
14779         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14780         inherit from System.Object, so we have to stop at null, not only
14781         when reaching System.Object.
14782
14783 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14784
14785         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14786         DeclaredOnly because the parent indexer might have had a different
14787         name, but did not loop until the top of the hierarchy was reached.
14788
14789         The problem this one fixes is 35492: when a class implemented an
14790         indexer from an interface, we were getting the interface method
14791         (which was abstract) and we were flagging an error (can not invoke
14792         abstract method).
14793
14794         This also keeps bug 33089 functioning, and test-148 functioning.
14795
14796         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14797         out if a method is special is to see if it is declared in a
14798         property or event, or whether it is one of the predefined operator
14799         names.   This should fix correctly #36804.
14800
14801 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14802
14803         The goal here is to remove the dependency on EmptyCast.Peel ().
14804         Killing it completely.
14805
14806         The problem is that currently in a number of places where
14807         constants are expected, we have to "probe" for an EmptyCast, and
14808         Peel, which is not the correct thing to do, as this will be
14809         repetitive and will likely lead to errors. 
14810
14811         The idea is to remove any EmptyCasts that are used in casts that
14812         can be reduced to constants, so we only have to cope with
14813         constants. 
14814
14815         This bug hunt was triggered by Bug 37363 and the desire to remove
14816         the duplicate pattern where we were "peeling" emptycasts to check
14817         whether they were constants.  Now constants will always be
14818         constants.
14819
14820         * ecore.cs: Use an enumconstant here instead of wrapping with
14821         EmptyCast.  
14822
14823         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14824         throwing me off.  By handling this we can get rid of a few hacks.
14825
14826         * statement.cs (Switch): Removed Peel() code.
14827
14828 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14829
14830         * class.cs: Location information for error 508
14831
14832         * expression.cs (New.DoResolve): Add a guard against double
14833         resolution of an expression.  
14834
14835         The New DoResolve might be called twice when initializing field
14836         expressions (see EmitFieldInitializers, the call to
14837         GetInitializerExpression will perform a resolve on the expression,
14838         and later the assign will trigger another resolution
14839
14840         This leads to bugs (#37014)
14841
14842         * delegate.cs: The signature for EndInvoke should contain any ref
14843         or out parameters as well.  We were not doing this in the past. 
14844
14845         * class.cs (Field.Define): Do not overwrite the type definition
14846         inside the `volatile' group.  Turns out that volatile enumerations
14847         were changing the type here to perform a validity test, which
14848         broke conversions. 
14849
14850 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14851
14852         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14853         and structs, we do not want to load the instance variable
14854
14855         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14856         enum_type has to be handled like an object reference (implicit
14857         conversions exists from this to object), but the regular IsClass
14858         and IsValueType tests will never return true for this one.
14859
14860         Also we use TypeManager.IsValueType instead of type.IsValueType,
14861         just for consistency with the rest of the code (this is only
14862         needed if we ever use the construct exposed by test-180.cs inside
14863         corlib, which we dont today).
14864
14865 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14866
14867         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14868         just InternalCall.
14869
14870 2003-02-09  Martin Baulig  <martin@ximian.com>
14871
14872         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14873         (Namespace.DefineNamespaces): New static public method; this is
14874         called when we're compiling with debugging to add all namespaces
14875         to the symbol file.
14876
14877         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14878         pass it to the Namespace's .ctor.
14879
14880         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14881         and MethodBase arguments; pass the namespace ID to the symwriter;
14882         pass the MethodBase instead of the token to the symwriter.
14883         (SymbolWriter.DefineNamespace): New method to add a namespace to
14884         the symbol file.
14885
14886 2003-02-09  Martin Baulig  <martin@ximian.com>
14887
14888         * symbolwriter.cs: New file.  This is a wrapper around
14889         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14890         methods here in near future.
14891
14892 2003-02-09  Martin Baulig  <martin@ximian.com>
14893
14894         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14895         ILGenerator.MarkSequencePoint() which are actually used by the
14896         symbol writer.
14897
14898 2003-02-09  Martin Baulig  <martin@ximian.com>
14899
14900         * location.cs (SourceFile): New public sealed class.  This
14901         contains the name and an index which is used in the location's token.
14902         (Location): Reserve an appropriate number of bits in the token for
14903         the source file instead of walking over that list, this gives us a
14904         really huge performance improvement when compiling with debugging.
14905
14906         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14907         `SourceFile' argument instead of a string.
14908         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14909         but don't parse/tokenize here, we need to generate the list of all
14910         source files before we do that.
14911         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14912         the files.
14913
14914         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14915         instead of a string.
14916
14917         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14918         of a string.
14919
14920 2003-02-09  Martin Baulig  <martin@ximian.com>
14921
14922         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14923         filename on `#line default'.
14924
14925 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14926
14927         * statement.cs: don't clear the pinned var when the fixed statement
14928         returns from the method (fixes bug#37752).
14929
14930 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14931
14932         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14933         to IsValueType.
14934
14935 2003-02-07  Martin Baulig  <martin@ximian.com>
14936
14937         * driver.cs: Removed the `--debug-args' command line argument.
14938
14939         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14940         automatically by the AsssemblyBuilder.
14941         (CodeGen.InitializeSymbolWriter): We don't need to call any
14942         initialization function on the symbol writer anymore.  This method
14943         doesn't take any arguments.
14944
14945 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14946
14947         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14948         from referenced assemblies as well.
14949
14950 2003-02-02  Martin Baulig  <martin@ximian.com>
14951
14952         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14953
14954 2003-02-02  Martin Baulig  <martin@ximian.com>
14955
14956         * class.cs (Constructor.Emit): Open the symbol writer before
14957         emitting the constructor initializer.
14958         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14959         single-stepping through constructor initializers.
14960
14961 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14962
14963         * class.cs: Handle error 549: do not allow virtual methods in
14964         sealed classes. 
14965
14966 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14967
14968         * decl.cs: Check access levels when resolving types
14969
14970 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14971
14972         * statement.cs: Add parameters and locals set in catch blocks that might 
14973         return to set vector
14974
14975 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14976
14977         * class.cs (Operator): Set the SpecialName flags for operators.
14978
14979         * expression.cs (Invocation.DoResolve): Only block calls to
14980         accessors and operators on SpecialName methods.
14981
14982         (Cast.TryReduce): Handle conversions from char constants.
14983
14984
14985 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14986
14987         * statement.cs: small memory and time optimization in FlowBranching.
14988
14989 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14990
14991         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14992         problem that the last fix but in the other sid (Set).
14993
14994         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14995         access when there is no indexer in the hierarchy.
14996
14997 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14998
14999         * class.cs: Combine some if statements.
15000
15001 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15002
15003         * driver.cs: fixed bug #37187.
15004
15005 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15006
15007         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15008         any indexer, it's needed to build a list with all the indexers in the
15009         hierarchy (AllGetters), else we have problems. Fixes #35653.
15010
15011 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15012
15013         * class.cs (MethodData.Define): It is wrong for an interface
15014         implementation to be static in both cases: explicit and implicit.
15015         We were only handling this in one case.
15016
15017         Improve the if situation there to not have negations.
15018
15019         * class.cs (Field.Define): Turns out that we do not need to check
15020         the unsafe bit on field definition, only on usage.  Remove the test.
15021
15022 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15023
15024         * driver.cs: use assembly.Location instead of Codebase (the latest
15025         patch made mcs fail when using MS assemblies).
15026
15027 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15028
15029         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15030         get the path to *corlib.dll.
15031
15032 2003-01-21  Nick Drochak <ndrochak@gol.com>
15033
15034         * cs-tokenizer.cs:
15035         * pending.cs:
15036         * typemanager.cs: Remove compiler warnings
15037
15038 2003-01-20  Duncan Mak  <duncan@ximian.com>
15039
15040         * AssemblyInfo.cs: Bump the version number to 0.19.
15041
15042 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15043
15044         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15045
15046 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15047
15048         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15049
15050 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15051
15052         * cs-parser.jay: Small fix: we were not comparing the constructor
15053         name correctly.   Thanks to Zoltan for the initial pointer.
15054
15055 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15056
15057         * cs-tokenizer.cs: Set file name when specified with #line
15058
15059 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15060
15061         * cs-parser.jay: Only perform the constructor checks here if we
15062         are named like the class;  This will help provider a better
15063         error.  The constructor path is taken when a type definition is
15064         not found, but most likely the user forgot to add the type, so
15065         report that rather than the constructor error.
15066
15067 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15068
15069         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15070         allocations.
15071
15072 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15073
15074         * cs-parser.jay: Add cleanup call.
15075
15076 2003-01-13  Duncan Mak  <duncan@ximian.com>
15077
15078         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15079         consistent with other methods.
15080
15081 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15082
15083         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15084
15085 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15086
15087         * attribute.cs: only set GuidAttr to true when we have a
15088         GuidAttribute.
15089
15090 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15091
15092         * ecore.cs:
15093         * expression.cs:
15094         * typemanager.cs: fixes to allow mcs compile corlib with the new
15095         Type.IsSubclassOf fix.
15096
15097 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15098
15099         * expression.cs (LocalVariableReference.DoResolve): Classify a
15100         constant as a value, not as a variable.   Also, set the type for
15101         the variable.
15102
15103         * cs-parser.jay (fixed_statement): take a type instead of a
15104         pointer_type, so we can produce a better error message later.
15105
15106         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15107         as an error.  
15108
15109         (For.DoEmit): Make inifinite loops have a
15110         non-conditional branch back.
15111
15112         (Fixed.DoEmit): First populate the pinned variables, then emit the
15113         statement, then clear the variables.  Before I was emitting the
15114         code once for each fixed piece.
15115
15116
15117 2003-01-08  Martin Baulig  <martin@ximian.com>
15118
15119         * statement.cs (FlowBranching.MergeChild): A break in a
15120         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15121
15122 2003-01-08  Martin Baulig  <martin@ximian.com>
15123
15124         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15125         lives in the same number space than `param_map'.  Fixes #36154.
15126
15127 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15128
15129         * cs-parser.jay (constructor_declaration): Set the
15130         Constructor.ModFlags before probing for it.  This makes the
15131         compiler report 514, 515 and 132 (the code was there, but got
15132         broken). 
15133
15134         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15135         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15136         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15137
15138 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15139
15140         * enum.cs: create the enum static fields using the enum type.
15141
15142 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15143
15144         * class.cs: don't try to create the ParamBuilder for the return
15145         type if it's not needed (and handle it breaking for the ms runtime
15146         anyway).
15147
15148 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15149
15150         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15151
15152 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15153
15154         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15155         the command.   This showed up while compiling the JANET source
15156         code, which used \r as its only newline separator.
15157
15158 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15159
15160         * class.cs (Method.Define): If we are an operator (because it
15161         reuses our code), then set the SpecialName and HideBySig.  #36128
15162
15163 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15164
15165         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15166         exception, report error 120 `object reference required'.
15167
15168         * driver.cs: Add --pause option, used during to measure the size
15169         of the process as it goes with --timestamp.
15170
15171         * expression.cs (Invocation.DoResolve): Do not allow methods with
15172         SpecialName to be invoked.
15173
15174 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15175
15176         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15177         number before adding it.
15178
15179 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15180
15181         * ecore.cs (StandardImplicitConversion): When in an unsafe
15182         context, we allow conversion between void * to any other pointer
15183         type. This fixes bug #35973.
15184
15185 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15186
15187         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15188         is not thrown when extensionless outputs are used 
15189
15190 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15191
15192         * rootcontext.cs: fixed compilation of corlib.
15193
15194 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15195
15196         * attribute.cs (Attributes.Contains): Add new method.
15197
15198         * class.cs (MethodCore.LabelParameters): if the parameter is an
15199         `out' parameter, check that no attribute `[In]' has been passed.
15200
15201         * enum.cs: Handle the `value__' name in an enumeration.
15202
15203 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15204
15205         * decl.cs: Added special case to allow overrides on "protected
15206         internal" methods
15207
15208 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15209
15210         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15211         since it makes much more sense.
15212
15213         (Attributes.ctor): Don't require a Location parameter.
15214
15215         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15216
15217         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15218         since we already have that information per attribute.
15219
15220         * everywhere : make appropriate changes.
15221
15222         * class.cs (LabelParameters): Write the code which actually
15223         applies attributes to the return type. We can't do this on the MS
15224         .NET runtime so we flag a warning in the case an exception is
15225         thrown.
15226
15227 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15228
15229         * const.cs: Handle implicit null conversions here too.
15230
15231 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15232
15233         * class.cs (MethodCore.LabelParameters): Remove the extra
15234         Type [] parameter since it is completely unnecessary. Instead
15235         pass in the method's attributes so that we can extract
15236         the "return" attribute.
15237
15238 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15239
15240         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15241         of ignoring it and letting the compile continue.
15242
15243         * typemanager.cs (ChangeType): use an extra argument to return an
15244         error condition instead of throwing an exception.
15245
15246 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15247
15248         * expression.cs (Unary.TryReduce): mimic the code for the regular
15249         code path.  Perform an implicit cast in the cases where we can
15250         implicitly convert to one of the integral types, and then reduce
15251         based on that constant.   This fixes bug #35483.
15252
15253 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15254
15255         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15256
15257 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15258
15259         * namespace.cs: fixed bug #35489.
15260
15261 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15262
15263         * class.cs: Remove some dead code.
15264
15265         * cs-parser.jay: Estimate the number of methods needed
15266         (RootContext.MethodCount);
15267
15268         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15269         numbers instead of StringBuilders.
15270
15271         * support.cs (PtrHashtable): Add constructor with initial size;
15272         We can now reduce reallocations of the method table.
15273
15274 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15275
15276         * attribute.cs (ApplyAttributes): Keep track of the emitted
15277         attributes on a per-target basis. This fixes bug #35413.
15278
15279 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15280
15281         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15282         default to the Windows 1252 encoding.
15283
15284         (UnixParseOption): Support version, thanks to Alp for the missing
15285         pointer. 
15286
15287         * AssemblyInfo.cs: Add nice assembly information.
15288
15289         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15290         (bug 35169).
15291
15292         * cs-parser.jay: Allow a trailing comma before the close bracked
15293         in the attribute_section production.
15294
15295         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15296         address of the instance was being taken, I will take this out,
15297         because we take the address of the object immediately here.
15298
15299 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15300
15301         * typemanager.cs (AreMultipleAllowed): Take care of the most
15302         obvious case where attribute type is not in the current assembly -
15303         stupid me ;-)
15304
15305 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15306
15307         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15308         definitions, instead of doing that afterwards.  
15309
15310         Also we use a nice little hack, depending on the constructor, we
15311         know if we are a "composed" name or a simple name.  Hence, we
15312         avoid the IndexOf test, and we avoid 
15313
15314         * codegen.cs: Add code to assist in a bug reporter to track down
15315         the source of a compiler crash. 
15316
15317 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15318
15319         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15320         types have been emitted for a given element and flag an error
15321         if something which does not have AllowMultiple set is used more
15322         than once.
15323
15324         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15325         attribute types and their corresponding AllowMultiple properties
15326
15327         (AreMultipleAllowed): Check the property for a given type.
15328
15329         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15330         property in the case we have a TypeContainer.
15331
15332         (Attributes.AddAttribute): Detect duplicates and just skip on
15333         adding them. This trivial fix catches a pretty gross error in our
15334         attribute emission - global attributes were being emitted twice!
15335
15336         Bugzilla bug #33187 is now fixed.
15337
15338 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15339
15340         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15341         instead of pp_and).
15342
15343         * expression.cs (Binary.ResolveOperator): I can only use the
15344         Concat (string, string, string) and Concat (string, string,
15345         string, string) if the child is actually a concatenation of
15346         strings. 
15347
15348 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15349
15350         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15351         context where we need a 2-character lookahead.
15352
15353         * pending.cs (PendingImplementation): Rework so we can keep track
15354         of interface types all the time, and flag those which were
15355         implemented by parents as optional.
15356
15357 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15358
15359         * expression.cs (Binary.ResolveOperator): Use
15360         String.Concat(string,string,string) or
15361         String.Concat(string,string,string,string) when possible. 
15362
15363         * typemanager: More helper methods.
15364
15365
15366 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15367
15368         * pending.cs: remove the bogus return from GetMissingInterfaces()
15369         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15370
15371 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15372
15373         * namespace.cs: avoid duplicated 'using xxx' being added to
15374         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15375         when we get more than one 'using' statement for the same namespace.
15376         Report a CS0105 warning for it.
15377
15378 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15379
15380         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15381         of calling getChar/putback, uses internal knowledge of it.    
15382
15383         (xtoken): Reorder tokenizer so most common patterns are checked
15384         first.  This reduces the compilation time in another 5% (from 8.11s
15385         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15386
15387         The parsing time is 22% of the compilation in mcs, and from that
15388         64% is spent on the tokenization process.  
15389
15390         I tried using a binary search for keywords, but this is slower
15391         than the hashtable.  Another option would be to do a couple of
15392         things:
15393
15394                 * Not use a StringBuilder, instead use an array of chars,
15395                   with a set value.  Notice that this way we could catch
15396                   the 645 error without having to do it *afterwards*.
15397
15398                 * We could write a hand-parser to avoid the hashtable
15399                   compares altogether.
15400
15401         The identifier consumption process takes 37% of the tokenization
15402         time.  Another 15% is spent on is_number.  56% of the time spent
15403         on is_number is spent on Int64.Parse:
15404
15405                 * We could probably choose based on the string length to
15406                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15407                   computations. 
15408
15409         Another 3% is spend on wrapping `xtoken' in the `token' function.
15410
15411         Handle 0xa0 as whitespace (#34752)
15412
15413 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15414
15415         * typemanager.cs (IsCLRType): New routine to tell whether a type
15416         is one of the builtin types.  
15417
15418         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15419         typecode in more places instead of doing pointer comparissions.
15420         We could leverage some knowledge about the way the typecodes are
15421         laid out.
15422
15423         New code to cache namespaces in assemblies, it is currently not
15424         invoked, to be used soon.
15425
15426         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15427
15428         * expression.cs (Binary.ResolveOperator): specially handle
15429         strings, and do not perform user-defined operator overloading for
15430         built-in types.
15431
15432 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15433
15434         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15435         internalcall as it is a pretty simple operation;  Avoid whenever
15436         possible to call Char.IsLetter.
15437
15438         (consume_identifier): Cut by half the number of
15439         hashtable calls by merging the is_keyword and GetKeyword behavior.
15440
15441         Do not short-circuit, because if we do, we
15442         report errors (ie, #if false && true would produce an invalid
15443         directive error);
15444
15445
15446 2002-11-24  Martin Baulig  <martin@ximian.com>
15447
15448         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15449         check constant ranges and report a CS0221.  Fixes #33186.
15450
15451 2002-11-24  Martin Baulig  <martin@ximian.com>
15452
15453         * cs-parser.jay: Make this work for uninitialized variable
15454         declarations in the `for' initializer.  Fixes #32416.
15455
15456 2002-11-24  Martin Baulig  <martin@ximian.com>
15457
15458         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15459         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15460
15461 2002-11-24  Martin Baulig  <martin@ximian.com>
15462
15463         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15464         argument; if true, we also check for user-defined conversions.
15465         This is only needed if both arguments are of a user-defined type.
15466         Fixes #30443, added test-175.cs.
15467         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15468
15469         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15470
15471 2002-11-24  Martin Baulig  <martin@ximian.com>
15472
15473         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15474         function to get the store opcode.
15475         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15476         only emit the Ldelema if the store opcode is Stobj.  You must run
15477         both test-34 and test-167 to test this.  Fixes #34529.
15478
15479 2002-11-23  Martin Baulig  <martin@ximian.com>
15480
15481         * ecore.cs (Expression.MemberLookup): Added additional
15482         `qualifier_type' argument which is used when we're being called
15483         from MemberAccess.DoResolve() and null if we're called from a
15484         SimpleName lookup.
15485         (Expression.MemberLookupFailed): New method to report errors; this
15486         does the CS1540 check and reports the correct error message.
15487
15488         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15489         argument for the CS1540 check and redone the way how we're dealing
15490         with private members.  See the comment in the source code for details.
15491         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15492         `closure_start_type' to `closure_qualifier_type' and check whether
15493         it's not null.  It was not this filter being broken, it was just
15494         being called with the wrong arguments.
15495
15496         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15497         and pass it the correct `qualifier_type'; this also does the error
15498         handling for us.
15499
15500 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15501
15502         * expression.cs (Invocation.EmitParams): If the we are dealing
15503         with a non-built-in value type, load its address as well.
15504
15505         (ArrayCreation): Use a a pretty constant instead
15506         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15507         static initializers.  
15508
15509         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15510         because they are not really value types, just glorified integers. 
15511
15512         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15513
15514         * ecore.cs: Remove redundant code for enumerations, make them use
15515         the same code path as everything else, fixes the casting issue
15516         with enumerations in Windows.Forms.
15517
15518         * attribute.cs: Do only cast to string if it is a string, the
15519         validation happens later.
15520
15521         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15522         people upgrade their corlibs.
15523
15524         * ecore.cs: Oops, enumerations were not following the entire code path
15525
15526 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15527
15528         * typemanager.cs (FilterWithClosure): Commented out the test for
15529         1540 in typemanager.cs, as it has problems when accessing
15530         protected methods from a parent class (see test-174.cs). 
15531
15532         * attribute.cs (Attribute.ValidateGuid): new method.
15533         (Attribute.Resolve): Use above.
15534
15535 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15536
15537         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15538
15539         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15540         handling for enumerations, as we only needed the TypeContainer
15541         functionality to begin with (this is required for the fix below to
15542         work for enums that reference constants in a container class for
15543         example). 
15544
15545         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15546
15547         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15548         a valid TypeBuilder to perform lookups on.o
15549
15550         * class.cs (InheritableMemberSignatureCompare): Use true in the
15551         call to GetGetMethod and GetSetMethod, because we are comparing
15552         the signature, and we need to get the methods *even* if they are
15553         private. 
15554
15555         (PropertyBase.CheckBase): ditto.
15556
15557         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15558         GotoCase.Resolve): Use Peel on EmpytCasts.
15559
15560         * ecore.cs (EmptyCast): drop child, add Peel method.
15561
15562 2002-11-17  Martin Baulig  <martin@ximian.com>
15563
15564         * ecore.cs (EmptyCast.Child): New public property.
15565
15566         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15567         label resolved to an EmptyCast.  Fixes #34162.
15568         (GotoCase.Resolve): Likewise.
15569         (Block.EmitMeta): Likewise.
15570
15571 2002-11-17  Martin Baulig  <martin@ximian.com>
15572
15573         * expression.cs (Invocation.BetterConversion): Prefer int over
15574         uint; short over ushort; long over ulong for integer literals.
15575         Use ImplicitConversionExists instead of StandardConversionExists
15576         since we also need to check for user-defined implicit conversions.
15577         Fixes #34165.  Added test-173.cs.
15578
15579 2002-11-16  Martin Baulig  <martin@ximian.com>
15580
15581         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15582         with the `true' and `false' literals.  Fixes #33151.
15583
15584 2002-11-16  Martin Baulig  <martin@ximian.com>
15585
15586         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15587         October 22nd; don't do the cs1540 check for static members.
15588
15589         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15590         now using our own filter here and doing the cs1540 check again.
15591
15592 2002-11-16  Martin Baulig  <martin@ximian.com>
15593
15594         * support.cs (InternalParameters): Don't crash if we don't have
15595         any fixed parameters.  Fixes #33532.
15596
15597 2002-11-16  Martin Baulig  <martin@ximian.com>
15598
15599         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15600         when looking up static methods to make this work on Windows.
15601         Fixes #33773.
15602
15603 2002-11-16  Martin Baulig  <martin@ximian.com>
15604
15605         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15606         a setter rather than using PropertyInfo.CanWrite.
15607
15608 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15609
15610         * class.cs: Allow acces to block member by subclasses. Fixes build
15611         breaker.
15612
15613 2002-11-14  Martin Baulig  <martin@ximian.com>
15614
15615         * class.cs (Constructor.Emit): Added the extern/block check.
15616         Fixes bug #33678.
15617
15618 2002-11-14  Martin Baulig  <martin@ximian.com>
15619
15620         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15621         iteration while looking for indexers, this is needed because the
15622         indexer may have a different name in our base classes.  Fixed the
15623         error reporting (no indexers at all, not get accessor, no
15624         overloaded match).  Fixes bug #33089.
15625         (IndexerAccess.DoResolveLValue): Likewise.
15626
15627 2002-11-14  Martin Baulig  <martin@ximian.com>
15628
15629         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15630         indexers.  Fixes the first part of bug #33089.
15631         (MethodSignature.InheritableMemberSignatureCompare): Added support
15632         for properties.
15633
15634 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15635
15636         * attribute.cs (Attribute.Resolve): Catch the
15637         NullReferenceException and report it since it isn't supposed to
15638         happen. 
15639
15640 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15643         LogicalOr and LogicalAnd that can benefit from recursively
15644         handling EmitBranchable.  The code now should be nice for Paolo.
15645
15646 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15647
15648         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15649         the Type lookups, as we perform quite a number of lookups on
15650         non-Types.  This can be removed once we can deterministically tell
15651         whether we have a type or a namespace in advance.
15652
15653         But this might require special hacks from our corlib.
15654
15655         * TODO: updated.
15656
15657         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15658         and double which avoids a conversion from an integer to a double.
15659
15660         * expression.cs: tiny optimization, avoid calling IsConstant,
15661         because it effectively performs the lookup twice.
15662
15663 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15664
15665         But a bogus return here to keep the semantics of the old code
15666         until the Mono runtime is fixed.
15667
15668         * pending.cs (GetMissingInterfaces): New method used to remove all
15669         the interfaces that are already implemented by our parent
15670         classes from the list of pending methods. 
15671
15672         * interface.cs: Add checks for calls after ResolveTypeExpr.
15673
15674 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15675
15676         * class.cs (Class.Emit): Report warning 67: event not used if the
15677         warning level is beyond 3.
15678
15679         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15680         being a NullLiteral.
15681
15682         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15683         specifiers. 
15684
15685         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15686         path that might fail if a type can not be resolved.
15687
15688         * expression.cs (Binary.Emit): Emit unsigned versions of the
15689         operators. 
15690
15691         * driver.cs: use error 5.
15692
15693 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15694
15695         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15696
15697 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15698
15699         * cs-parser.jay (switch_section): A beautiful patch from Martin
15700         Baulig that fixed 33094.
15701
15702 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15703
15704         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15705         Check whether the base is abstract and report an error if so.
15706
15707         * expression.cs (IndexerAccess.DoResolveLValue,
15708         IndexerAccess.DoResolve): ditto. 
15709
15710         (Invocation.DoResolve): ditto.
15711
15712         (Invocation.FullMethodDesc): Improve the report string.
15713
15714         * statement.cs (Block): Eliminate IsVariableDefined as it is
15715         basically just a wrapper for GetVariableInfo.
15716
15717         * ecore.cs (SimpleName): Use new 
15718
15719         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15720         type, as we return the actual parameter ref/unref state on a
15721         different call.
15722
15723 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15724
15725         * support.cs: Return proper flags REF/OUT fixing the previous
15726         commit.  
15727
15728         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15729         not used to mean `ref' but `ref or out' in ParameterReference
15730
15731         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15732         full type signature instead of calling TypeManger.CSharpName
15733         ourselves. 
15734
15735         * support.cs (InternalParameters.ParameterDesc): Do not compare
15736         directly to the modflags, because REF/OUT will actually be bitsets
15737         if set. 
15738
15739         * delegate.cs (VerifyMethod): Check also the modifiers.
15740
15741         * cs-tokenizer.cs: Fix bug where floating point values with an
15742         exponent where a sign was missing was ignored.
15743
15744         * driver.cs: Allow multiple assemblies to be specified in a single
15745         /r: argument
15746
15747 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15748
15749         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15750         because identifiers after a parenthesis would end up in this kind
15751         of production, and we needed to desamiguate it for having casts
15752         like:
15753
15754                 (UserDefinedType *) xxx
15755
15756 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15757
15758         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15759         we should set on the Bindingflags.NonPublic, but not turn on
15760         private_ok.  private_ok controls whether a Private member is
15761         returned (this is chekced on the filter routine), while the
15762         BindingFlags.NonPublic just controls whether private/protected
15763         will be allowed.   This fixes the problem part of the problem of
15764         private properties being allowed to be used in derived classes.
15765
15766         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15767         so we can call the children DoResolveLValue method (this will
15768         properly signal errors on lvalue assignments to base properties)
15769
15770         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15771         getter are null, and we have a property info, we know that this
15772         happened because the lookup failed, so we report an error 122 for
15773         protection level violation.
15774
15775         We also silently return if setter and getter are null in the
15776         resolve functions, this condition only happens if we have flagged
15777         the error before.  This is the other half of the problem. 
15778
15779         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15780         not have accessibility information, that is why we were returning
15781         true in the filter function in typemanager.cs.
15782
15783         To properly report 122 (property is inaccessible because of its
15784         protection level) correctly, we report this error in ResolveAccess
15785         by failing if both the setter and the getter are lacking (ie, the
15786         lookup failed). 
15787
15788         DoResolve and DoLResolve have been modified to check for both
15789         setter/getter being null and returning silently, the reason being
15790         that I did not want to put the knowledge about this error in upper
15791         layers, like:
15792
15793         int old = Report.Errors;
15794         x = new PropertyExpr (...);
15795         if (old != Report.Errors)
15796                 return null;
15797         else
15798                 return x;
15799
15800         So the property expr is returned, but it is invalid, so the error
15801         will be flagged during the resolve process. 
15802
15803         * class.cs: Remove InheritablePropertySignatureCompare from the
15804         class, as we no longer depend on the property signature to compute
15805         whether it is possible to implement a method or not.
15806
15807         The reason is that calling PropertyInfo.GetGetMethod will return
15808         null (in .NET, in Mono it works, and we should change this), in
15809         cases where the Get Method does not exist in that particular
15810         class.
15811
15812         So this code:
15813
15814         class X { public virtual int A { get { return 1; } } }
15815         class Y : X { }
15816         class Z : Y { public override int A { get { return 2; } } }
15817
15818         Would fail in Z because the parent (Y) would not have the property
15819         defined.  So we avoid this completely now (because the alternative
15820         fix was ugly and slow), and we now depend exclusively on the
15821         method names.
15822
15823         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15824         reference method, instead of using the property.
15825
15826         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15827         routines are gone now.
15828
15829         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15830         names, they were incorrectly named.
15831
15832         * cs-tokenizer.cs: Return are more gentle token on failure. 
15833
15834         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15835         had an out-of-sync index variable, which caused it to remove from
15836         the list of pending methods the wrong method sometimes.
15837
15838 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15839
15840         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15841         CanWrite, because those refer to this particular instance of the
15842         property, and do not take into account the fact that we can
15843         override single members of a property.
15844
15845         Constructor requires an EmitContext.  The resolution process does
15846         not happen here, but we need to compute the accessors before,
15847         because the resolution does not always happen for properties.
15848
15849         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15850         subclass, before we did not update this flag, but we did update
15851         bindingflags. 
15852
15853         (GetAccessors): Drop this routine, as it did not work in the
15854         presence of partially overwritten set/get methods. 
15855
15856         Notice that this broke the cs1540 detection, but that will require
15857         more thinking. 
15858
15859 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15860
15861         * class.cs:
15862         * codegen.cs:
15863         * driver.cs: issue a warning instead of an error if we don't support
15864         debugging for the platform. Also ignore a couple of errors that may
15865         arise when trying to write the symbols. Undo my previous patch.
15866
15867 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15868
15869         * driver.cs: ignore /debug switch except for Unix platforms.
15870
15871 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15872
15873         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15874
15875 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15876
15877         * driver.cs: Do not make mcs-debug conditional, so we do not break
15878         builds that use it.
15879
15880         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15881         review this patch.  But basically after all the children variables
15882         have been merged, the value of "Breaks" was not being set to
15883         new_breaks for Switch blocks.  I think that it should be set after
15884         it has executed.  Currently I set this to the value of new_breaks,
15885         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15886         conservative, but I do not understand this code very well.
15887
15888         I did not break anything in the build, so that is good ;-)
15889
15890         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15891
15892 2002-10-20  Mark Crichton  <crichton@gimp.org>
15893
15894         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15895
15896 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15897
15898         * cfold.cs: Fixed compile blocker.
15899
15900 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15901
15902         * driver.cs: I was chekcing the key, not the file.
15903
15904 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15905
15906         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15907         message that we were generating - we just need to silently return
15908         a null.
15909
15910 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15911
15912         * class.cs (Event.Define): Change my previous commit, as this
15913         breaks the debugger.  This is a temporary hack, as it seems like
15914         the compiler is generating events incorrectly to begin with.
15915
15916         * expression.cs (Binary.ResolveOperator): Added support for 
15917         "U operator - (E x, E y)"
15918
15919         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15920         y)".
15921
15922         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15923         init-only variables, but this path did not take into account that
15924         there might be also instance readonly variables.  Correct this
15925         problem. 
15926
15927         This fixes bug 32253
15928
15929         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15930         delegates as well.
15931
15932         * driver.cs: Change the extension for modules to `netmodule'
15933
15934         * cs-parser.jay: Improved slightly the location tracking for
15935         the debugger symbols.
15936
15937         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15938         modifiers that were specified instead of the hardcoded value
15939         (FamAndAssem).  This was basically ignoring the static modifier,
15940         and others.  Fixes 32429.
15941
15942         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15943         fixed a bug in the process (32476)
15944
15945         * expression.cs (ArrayAccess.EmitAssign): Patch from
15946         hwang_rob@yahoo.ca that fixes bug 31834.3
15947
15948 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15949
15950         * driver.cs: Make the module extension .netmodule.
15951
15952 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15953
15954         * driver.cs: Report an error if the resource file is not found
15955         instead of crashing.
15956
15957         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15958         false, like Emit does.
15959
15960 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15961
15962         * typemanager.cs: Remove unused private member.  Also reported mcs
15963         bug to report this as a warning like csc.
15964
15965 2002-10-15  Martin Baulig  <martin@gnome.org>
15966
15967         * statement.cs (Statement.Emit): Made this a virtual method; emits
15968         the line number info and calls DoEmit().
15969         (Statement.DoEmit): New protected abstract method, formerly knows
15970         as Statement.Emit().
15971
15972         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15973
15974 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15975
15976         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15977         have fixed a remaining problem: not every AddXXXX was adding a
15978         fully qualified name.  
15979
15980         Now everyone registers a fully qualified name in the DeclSpace as
15981         being defined instead of the partial name.  
15982
15983         Downsides: we are slower than we need to be due to the excess
15984         copies and the names being registered this way.  
15985
15986         The reason for this is that we currently depend (on the corlib
15987         bootstrap for instance) that types are fully qualified, because
15988         we dump all the types in the namespace, and we should really have
15989         types inserted into the proper namespace, so we can only store the
15990         basenames in the defined_names array.
15991
15992 2002-10-10  Martin Baulig  <martin@gnome.org>
15993
15994         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15995         from bug #31834, see the bug report for a testcase which is
15996         miscompiled.
15997
15998 2002-10-10  Martin Baulig  <martin@gnome.org>
15999
16000         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16001         flow analysis code for this.
16002
16003         * statement.cs (Do, While, For): Tell the flow analysis code about
16004         infinite loops.
16005         (FlowBranching.UsageVector): Added support for infinite loops.
16006         (Block.Resolve): Moved the dead code elimination here and use flow
16007         analysis to do it.
16008
16009 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16010
16011         * class.cs (Field.Define): Catch cycles on struct type
16012         definitions. 
16013
16014         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16015         fields if the fields are static.  We only need to check instance
16016         fields. 
16017
16018         * expression.cs (As.DoResolve): Test for reference type.
16019
16020         * statement.cs (Using.ResolveExpression): Use
16021         ConvertImplicitRequired, not ConvertImplicit which reports an
16022         error on failture
16023         (Using.ResolveLocalVariableDecls): ditto.
16024
16025         * expression.cs (Binary.ResolveOperator): Report errors in a few
16026         places where we had to.
16027
16028         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16029
16030 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16031
16032         * expression.cs: Use StoreFromPtr instead of extracting the type
16033         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16034
16035         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16036         an enumeration value to a System.Enum, but System.Enum is not a
16037         value type, but an class type, so we need to box.
16038
16039         (Expression.ConvertExplicit): One codepath could return
16040         errors but not flag them.  Fix this.  Fixes #31853
16041
16042         * parameter.cs (Resolve): Do not allow void as a parameter type.
16043
16044 2002-10-06  Martin Baulig  <martin@gnome.org>
16045
16046         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16047         if it's a class type and not a struct.  Fixes #31815.
16048
16049 2002-10-06  Martin Baulig  <martin@gnome.org>
16050
16051         * statement.cs: Reworked the flow analysis code a bit to make it
16052         usable for dead code elimination.
16053
16054 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16055
16056         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16057
16058 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16059
16060         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16061         to fix the test 165, will investigate deeper.
16062
16063 2002-10-04  Martin Baulig  <martin@gnome.org>
16064
16065         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16066         finally blocks actually work.
16067         (Try.Resolve): We don't need to create a sibling for `finally' if
16068         there is no finally block.
16069
16070 2002-10-04  Martin Baulig  <martin@gnome.org>
16071
16072         * class.cs (Constructor.Define): The default accessibility for a
16073         non-default constructor is private, not public.
16074
16075 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16076
16077         * class.cs (Constructor): Make AllowedModifiers public, add
16078         EXTERN.
16079
16080         * cs-parser.jay: Perform the modifiers test here, as the
16081         constructor for the Constructor class usually receives a zero
16082         because of the way we create it (first we create, later we
16083         customize, and we were never checking the modifiers).
16084
16085         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16086         is a version of LookupTypeReflection that includes the type-name
16087         cache.  This can be used as a fast path for functions that know
16088         the fully qualified name and are only calling into *.GetType() to
16089         obtain a composed type.
16090
16091         This is also used by TypeManager.LookupType during its type
16092         composition.
16093
16094         (LookupType): We now also track the real type name, as sometimes
16095         we can get a quey for the real type name from things like
16096         ComposedCast.  This fixes bug 31422.
16097
16098         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16099         complete type fullname, it does not have to go through the type
16100         resolution system to obtain the composed version of the type (for
16101         obtaining arrays or pointers).
16102
16103         (Conditional.Emit): Use the EmitBoolExpression to
16104         generate nicer code, as requested by Paolo.
16105
16106         (ArrayCreation.CheckIndices): Use the patch from
16107         hwang_rob@yahoo.ca to validate the array initializers. 
16108
16109 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16110
16111         * class.cs (ConstructorInitializer.Emit): simplify code by using
16112         Invocation.EmitCall, and at the same time, fix the bugs in calling
16113         parent constructors that took variable arguments. 
16114
16115         * ecore.cs (Expression.ConvertNumericExplicit,
16116         Expression.ImplicitNumericConversion): Remove the code that
16117         manually wrapped decimal (InternalTypeConstructor call is now gone
16118         as well).
16119
16120         * expression.cs (Cast.TryReduce): Also handle decimal types when
16121         trying to perform a constant fold on the type.
16122
16123         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16124
16125         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16126         that only turned off an error report, and did nothing else. 
16127
16128 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16129
16130         * driver.cs: Handle and ignore /fullpaths
16131
16132 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16133
16134         * expression.cs (Binary.ResolveOperator): Catch the case where
16135         DoNumericPromotions returns true, 
16136
16137         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16138
16139 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16140
16141         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16142         report error 70.
16143
16144 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16145
16146         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16147         conversion exists, but it is also required that the conversion be
16148         performed.  This manifested in "(Type64Enum) 2".  
16149
16150         * class.cs (TypeManager.AddMethod): The fix is not to change
16151         AddEnum, because that one was using a fully qualified name (every
16152         DeclSpace derivative does), but to change the AddMethod routine
16153         that was using an un-namespaced name.  This now correctly reports
16154         the duplicated name.
16155
16156         Revert patch until I can properly fix it.  The issue
16157         is that we have a shared Type space across all namespaces
16158         currently, which is wrong.
16159
16160         Options include making the Namespace a DeclSpace, and merge
16161         current_namespace/current_container in the parser.
16162
16163 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16164
16165         * cs-parser.jay: Improve error reporting when we get a different
16166         kind of expression in local_variable_type and
16167         local_variable_pointer_type. 
16168
16169         Propagate this to avoid missleading errors being reported.
16170
16171         * ecore.cs (ImplicitReferenceConversion): treat
16172         TypeManager.value_type as a target just like object_type.   As
16173         code like this:
16174
16175         ValueType v = 1;
16176
16177         Is valid, and needs to result in the int 1 being boxed before it
16178         is assigned to the value type v.
16179
16180         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16181         to validate the enumeration name.
16182
16183         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16184         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16185         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16186
16187         * ecore.cs (TryImplicitIntConversion): When doing an
16188         implicit-enumeration-conversion, check if the type is 64-bits and
16189         perform a conversion before passing to EnumConstant.
16190
16191 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16192
16193         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16194         report ambiguous type references.  Unlike the MS version, we
16195         report what the ambiguity is.   Innovation at work ;-)
16196
16197         (DeclSpace.FindType): Require a location argument to
16198         display when we display an ambiguous error.
16199
16200         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16201
16202         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16203
16204         * expression.cs (EmitDynamicInitializers): Apply patch from
16205         hwang_rob@yahoo.ca that fixes the order in which we emit our
16206         initializers. 
16207
16208 2002-09-21  Martin Baulig  <martin@gnome.org>
16209
16210         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16211         delegate takes no arguments.
16212
16213 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16214
16215         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16216         from integers.
16217
16218         * expression.cs: Extract the underlying type.
16219
16220         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16221
16222         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16223
16224 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16225
16226         * class.cs (TypeContainer.DefineType): We can not use the nice
16227         PackingSize with the size set to 1 DefineType method, because it
16228         will not allow us to define the interfaces that the struct
16229         implements.
16230
16231         This completes the fixing of bug 27287
16232
16233         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16234         means also structs.  This fixes part of the problem. 
16235         (Expresion.ImplicitReferenceConversionExists): ditto.
16236
16237         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16238         error if there were no errors reported during the type lookup
16239         process, to avoid duplicates or redundant errors.  Without this
16240         you would get an ambiguous errors plus a type not found.  We have
16241         beaten the user enough with the first error.  
16242
16243         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16244         reference. 
16245
16246         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16247         during the resolution process, stop the lookup, this avoids
16248         repeated error reports (same error twice).
16249
16250         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16251
16252         * typemanager.cs (LookupType): Redo the type lookup code to match
16253         the needs of System.Reflection.  
16254
16255         The issue is that System.Reflection requires references to nested
16256         types to begin with a "+" sign instead of a dot.  So toplevel
16257         types look like: "NameSpace.TopLevelClass", and nested ones look
16258         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16259         levels. 
16260
16261 2002-09-19  Martin Baulig  <martin@gnome.org>
16262
16263         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16264         says that a method always returns or always throws an exception,
16265         don't report the CS0161.
16266
16267         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16268         set `Returns = new_returns'.
16269
16270 2002-09-19  Martin Baulig  <martin@gnome.org>
16271
16272         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16273         to an enum constant, check for a CS0176.
16274
16275 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16276
16277         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16278         for operators that must be in pairs and report errors.
16279
16280         * ecore.cs (SimpleName.DoResolveType): During the initial type
16281         resolution process, when we define types recursively, we must
16282         check first for types in our current scope before we perform
16283         lookups in the enclosing scopes.
16284
16285         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16286
16287         (Invocation.VerifyArgumentsCompat): Call
16288         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16289         I thought we were supposed to always call this, but there are a
16290         few places in the code where we dont do it.
16291
16292 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16293
16294         * driver.cs: Add support in -linkres and -resource to specify the
16295         name of the identifier.
16296
16297 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16298
16299         * ecore.cs (StandardConversionExists): Sync with the conversion
16300         code: allow anything-* to void* conversions.
16301
16302         (FindMostSpecificSource): Use an Expression argument
16303         instead of a Type, because we might be handed over a Literal which
16304         gets a few more implicit conversions that plain types do not.  So
16305         this information was being lost.
16306
16307         Also, we drop the temporary type-holder expression when not
16308         required.
16309
16310 2002-09-17  Martin Baulig  <martin@gnome.org>
16311
16312         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16313         this is an explicit interface implementation.
16314
16315 2002-09-17  Martin Baulig  <martin@gnome.org>
16316
16317         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16318         different `IndexerName' attributes.
16319
16320         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16321         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16322         virtual CommonResolve().
16323
16324 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16325
16326         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16327         and convert that to the UnderlyingType.
16328
16329         * statement.cs (Foreach.Resolve): Indexers are just like variables
16330         or PropertyAccesses.
16331
16332         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16333         inside quoted strings, we were not doing this before.
16334
16335 2002-09-16  Martin Baulig  <martin@gnome.org>
16336
16337         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16338         resolve it.  This is needed for the definite assignment check of the
16339         instance expression, fixes bug #29846.
16340         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16341
16342 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16343
16344         * parameter.cs: Fix compile error.  Cannot reference static member
16345         from an instance object.  Is this an mcs bug?
16346
16347 2002-09-14  Martin Baulig  <martin@gnome.org>
16348
16349         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16350         multiple times.  Fixes bug #30295, added test-166.cs.
16351
16352 2002-09-14  Martin Baulig  <martin@gnome.org>
16353
16354         * statement.cs (Block.Emit): Don't emit unreachable code.
16355         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16356         `break' statements.
16357         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16358
16359 2002-09-14  Martin Baulig  <martin@gnome.org>
16360
16361         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16362         is set.
16363
16364 2002-09-14  Martin Baulig  <martin@gnome.org>
16365
16366         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16367         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16368         be false on the ms runtime.
16369
16370 2002-09-13  Martin Baulig  <martin@gnome.org>
16371
16372         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16373         the CS0038 error message.
16374
16375 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16376
16377         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16378         constant inside, return it.
16379
16380 2002-09-12  Martin Baulig  <martin@gnome.org>
16381
16382         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16383         implicit conversion can be done between enum types.
16384
16385         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16386         check whether an implicit conversion to the current enum's UnderlyingType
16387         exists and report an error if not.
16388
16389         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16390         without debugging support.
16391
16392         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16393         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16394
16395 2002-09-12  Martin Baulig  <martin@gnome.org>
16396
16397         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16398
16399         * ecore.cs (IMemberExpr.DeclaringType): New property.
16400         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16401         nonstatic member of an outer type (CS0038).
16402
16403 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16404
16405         * driver.cs: Activate the using-error detector at warning level
16406         4 (at least for MS-compatible APIs).
16407
16408         * namespace.cs (VerifyUsing): Small buglett fix.
16409
16410         * pending.cs (PendingImplementation): pass the container pointer. 
16411
16412         * interface.cs (GetMethods): Allow for recursive definition.  Long
16413         term, I would like to move every type to support recursive
16414         definitions, not the current ordering mechanism that we have right
16415         now.
16416
16417         The situation is this: Attributes are handled before interfaces,
16418         so we can apply attributes to interfaces.  But some attributes
16419         implement interfaces, we will now handle the simple cases
16420         (recursive definitions will just get an error).  
16421
16422         * parameter.cs: Only invalidate types at the end if we fail to
16423         lookup all types.  
16424
16425 2002-09-09  Martin Baulig  <martin@gnome.org>
16426
16427         * ecore.cs (PropertyExpr.Emit): Also check for
16428         TypeManager.system_int_array_get_length so this'll also work when
16429         compiling corlib.  Fixes #30003.
16430
16431 2002-09-09  Martin Baulig  <martin@gnome.org>
16432
16433         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16434         and throw an exception if we can't get the type's size.  Fixed #30040,
16435         added test-165.cs.
16436
16437 2002-09-09  Martin Baulig  <martin@gnome.org>
16438
16439         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16440
16441         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16442         context.  Fixes bug #30027.
16443
16444         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16445         virtual functions.  Fixes bug #30043, added test-164.cs.
16446
16447 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16448
16449         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16450
16451 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16452
16453         * driver.cs: Use an object to get the windows codepage since it's not a
16454         static property.
16455
16456 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16457
16458         * statement.cs (For.Emit): for infinite loops (test == null)
16459         return whether there is a break inside, not always "true".
16460
16461         * namespace.cs (UsingEntry): New struct to hold the name of the
16462         using definition, the location where it is defined, and whether it
16463         has been used in a successful type lookup.
16464
16465         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16466         strings.
16467
16468         * decl.cs: ditto.
16469
16470 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16471
16472         * attribute.cs : Fix incorrect code which relied on catching
16473         a NullReferenceException to detect a null being passed in
16474         where an object was expected.
16475
16476 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16477
16478         * statement.cs (Try): flag the catch variable as assigned
16479
16480         * expression.cs (Cast): Simplified by using ResolveType instead of
16481         manually resolving.
16482
16483         * statement.cs (Catch): Fix bug by using ResolveType.
16484
16485 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16486
16487         * expression.cs (BetterConversion): Special case for when we have
16488         a NullLiteral as the argument and we have to choose between string
16489         and object types - we choose string the way csc does.
16490
16491         * attribute.cs (Attribute.Resolve): Catch the
16492         NullReferenceException and report error #182 since the Mono
16493         runtime no more has the bug and having this exception raised means
16494         we tried to select a constructor which takes an object and is
16495         passed a null.
16496
16497 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16498
16499         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16500         message (1502, 1503) when we can't locate a method after overload
16501         resolution. This is much more informative and closes the bug
16502         Miguel reported.
16503
16504         * interface.cs (PopulateMethod): Return if there are no argument
16505         types. Fixes a NullReferenceException bug.
16506
16507         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16508         expressions too. Previously we were checking only in one place for
16509         positional arguments leaving out named arguments.
16510
16511         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16512         type to the enum type is not allowed. Remove code corresponding to
16513         that.
16514
16515         (ConvertNumericExplicit): Allow explicit conversions from
16516         the underlying type to enum type. This precisely follows the spec
16517         and closes a bug filed by Gonzalo.
16518
16519 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16520
16521         * compiler.csproj:
16522         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16523
16524 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16525
16526         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16527         it was important that we stored the right value after the
16528         reduction in `converted'.
16529
16530 2002-09-04  Martin Baulig  <martin@gnome.org>
16531
16532         * location.cs (Location.SymbolDocument): Use full pathnames for the
16533         source files.
16534
16535 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16536
16537         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16538         of the expression resolve mechanism, because that will catch the
16539         SimpleName error failures.
16540
16541         (Conditional): If we can not resolve the
16542         expression, return, do not crash.
16543
16544 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16545
16546         * cs-tokenizer.cs:
16547         (location): display token name instead of its number.
16548
16549 2002-08-28  Martin Baulig  <martin@gnome.org>
16550
16551         * expression.cs (Binary.ResolveOperator): Don't silently return
16552         but return an error if an operator cannot be applied between two
16553         enum types.
16554
16555 2002-08-28  Martin Baulig  <martin@gnome.org>
16556
16557         * class.cs (Constructor.Define): Set the permission attributes
16558         correctly instead of making all constructors public.
16559
16560 2002-08-28  Martin Baulig  <martin@gnome.org>
16561
16562         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16563         for private members before reporting a CS0103; if we find anything,
16564         it's a CS0122.
16565
16566 2002-08-28  Martin Baulig  <martin@gnome.org>
16567
16568         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16569         to check whether `closure_start_type == closure_invocation_type',
16570         we also need to check whether `m.DeclaringType == closure_invocation_type'
16571         before bypassing the permission checks.  We might be accessing
16572         protected/private members from the base class.
16573         (TypeManager.RealMemberLookup): Only set private_ok if private
16574         members were requested via BindingFlags.NonPublic.
16575
16576         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16577
16578         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16579         MethodGroupExpr.IsExplicitImpl if appropriate.
16580         (Invocation.DoResolve): Don't report the CS0120 for explicit
16581         interface implementations.
16582
16583 2002-08-27  Martin Baulig  <martin@gnome.org>
16584
16585         * expression.cs (Invocation.DoResolve): If this is a static
16586         method and we don't have an InstanceExpression, we must report
16587         a CS0120.
16588
16589 2002-08-25  Martin Baulig  <martin@gnome.org>
16590
16591         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16592         `==' between a valuetype and an object.
16593
16594 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16595
16596         * ecore.cs (TypeExpr): Provide a ToString method.
16597
16598 2002-08-24  Martin Baulig  <martin@gnome.org>
16599
16600         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16601         now called proggie.dbg and it's a binary file.
16602
16603 2002-08-23  Martin Baulig  <martin@gnome.org>
16604
16605         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16606
16607 2002-08-23  Martin Baulig  <martin@gnome.org>
16608
16609         * struct.cs (MyStructInfo.ctor): Make this work with empty
16610         structs; it's not allowed to use foreach() on null.
16611
16612 2002-08-23  Martin Baulig  <martin@gnome.org>
16613
16614         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16615         writer the full pathname of the generated assembly.
16616
16617 2002-08-23  Martin Baulig  <martin@gnome.org>
16618
16619         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16620         A `finally' block never returns or breaks; improved handling of
16621         unreachable code.
16622
16623 2002-08-23  Martin Baulig  <martin@gnome.org>
16624
16625         * statement.cs (Throw.Resolve): Allow `throw null'.
16626
16627 2002-08-23  Martin Baulig  <martin@gnome.org>
16628
16629         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16630         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16631         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16632         MemberLookup would return a wrong event if this is an explicit
16633         interface implementation and the class has an event with the same
16634         name.
16635
16636 2002-08-23  Martin Baulig  <martin@gnome.org>
16637
16638         * statement.cs (Block.AddChildVariableNames): New public method.
16639         (Block.AddChildVariableName): Likewise.
16640         (Block.IsVariableNameUsedInChildBlock): Likewise.
16641         (Block.AddVariable): Check whether a variable name has already
16642         been used in a child block.
16643
16644         * cs-parser.jay (declare_local_variables): Mark all variable names
16645         from the current block as being used in a child block in the
16646         implicit block.
16647
16648 2002-08-23  Martin Baulig  <martin@gnome.org>
16649
16650         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16651         find the symbol writer.
16652
16653         * driver.cs: csc also allows the arguments to /define being
16654         separated by commas, not only by semicolons.
16655
16656 2002-08-23  Martin Baulig  <martin@gnome.org>
16657
16658         * interface.cs (Interface.GetMembers): Added static check for events.
16659
16660 2002-08-15  Martin Baulig  <martin@gnome.org>
16661
16662         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16663         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16664
16665         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16666         why the MethodData.EmitDestructor() change was necessary.
16667
16668 2002-08-20  Martin Baulig  <martin@gnome.org>
16669
16670         * class.cs (TypeContainer.FindMembers): Added static check for events.
16671
16672         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16673
16674         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16675         use Type.GetEvents(), not Type.FindMembers().
16676
16677 2002-08-20  Martin Baulig  <martin@gnome.org>
16678
16679         * decl.cs (MemberCache): Added a special method cache which will
16680         be used for method-only searched.  This ensures that a method
16681         search will return a MethodInfo with the correct ReflectedType for
16682         inherited methods.      
16683
16684 2002-08-20  Martin Baulig  <martin@gnome.org>
16685
16686         * decl.cs (DeclSpace.FindMembers): Made this public.
16687
16688 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16689
16690         * delegate.cs: fixed build on windows.
16691         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16692
16693 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16694
16695         * ecore.cs (StandardConversionExists): Return a false
16696         if we are trying to convert the void type to anything else
16697         since that is not allowed.
16698
16699         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16700         we flag error 70 in the event an event is trying to be accessed
16701         directly from outside the declaring type.
16702
16703 2002-08-20  Martin Baulig  <martin@gnome.org>
16704
16705         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16706         MemberCache from typemanager.cs to decl.cs.
16707
16708 2002-08-19  Martin Baulig  <martin@gnome.org>
16709
16710         * class.cs (TypeContainer): Implement IMemberContainer.
16711         (TypeContainer.DefineMembers): Create the MemberCache.
16712         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16713         return public members if BindingFlags.Public was given, check
16714         whether members are static.
16715
16716 2002-08-16  Martin Baulig  <martin@gnome.org>
16717
16718         * decl.cs (DeclSpace.Define): Splitted this in Define and
16719         DefineMembers.  DefineMembers is called first and initializes the
16720         MemberCache.
16721
16722         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16723         DefineMembers() on all our DeclSpaces.
16724
16725         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16726         but call DefineMembers() on all nested interfaces.  We call their
16727         Define() in our new Define() function.
16728
16729         * interface.cs (Interface): Implement IMemberContainer.
16730         (Interface.Define): Moved all code except the attribute stuf to
16731         DefineMembers().
16732         (Interface.DefineMembers): Initialize the member cache.
16733
16734         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16735         need this anymore since we can use MemberCache.FindMembers directly.
16736
16737 2002-08-19  Martin Baulig  <martin@gnome.org>
16738
16739         * typemanager.cs (MemberCache): When creating the cache for an
16740         interface type, add all inherited members.
16741         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16742         to `out bool used_cache' and documented it.
16743         (TypeManager.MemberLookup): If we already used the cache in the first
16744         iteration, we don't need to do the interfaces check.
16745
16746 2002-08-19  Martin Baulig  <martin@gnome.org>
16747
16748         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16749         here from IMemberFinder and don't implement this interface anymore.
16750         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16751
16752         * typemanager.cs (IMemberFinder): This interface is now only used by
16753         classes which actually support the member cache.
16754         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16755         since we only put DeclSpaces into this Hashtable.
16756         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16757         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16758
16759 2002-08-16  Martin Baulig  <martin@gnome.org>
16760
16761         * typemanager.cs (ICachingMemberFinder): Removed.
16762         (IMemberFinder.MemberCache): New property.
16763         (TypeManager.FindMembers): Merged this with RealFindMembers().
16764         This function will never be called from TypeManager.MemberLookup()
16765         so we can't use the cache here, just the IMemberFinder.
16766         (TypeManager.MemberLookup_FindMembers): Check whether the
16767         IMemberFinder has a MemberCache and call the cache's FindMembers
16768         function.
16769         (MemberCache): Rewrote larger parts of this yet another time and
16770         cleaned it up a bit.
16771
16772 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16773
16774         * driver.cs (LoadArgs): Support quoting.
16775
16776         (Usage): Show the CSC-like command line arguments.
16777
16778         Improved a few error messages.
16779
16780 2002-08-15  Martin Baulig  <martin@gnome.org>
16781
16782         * typemanager.cs (IMemberContainer.Type): New property.
16783         (IMemberContainer.IsInterface): New property.
16784
16785         The following changes are conditional to BROKEN_RUNTIME, which is
16786         defined at the top of the file.
16787
16788         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16789         class'es members, but add all members from TypeHandle.ObjectType
16790         if we're an interface.
16791         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16792         is the current type.
16793         (MemberCache.CacheEntry.Container): Removed this field.
16794         (TypeHandle.GetMembers): Include inherited members.
16795
16796 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16797
16798         * typemanager.cs: fixed compilation and added a comment on a field that
16799         is never used.
16800
16801 2002-08-15  Martin Baulig  <martin@gnome.org>
16802
16803         * class.cs (ConstructorInitializer.Resolve): In the
16804         Expression.MemberLookup call, use the queried_type as
16805         invocation_type.
16806
16807         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16808         declared' attribute, it's always true.
16809         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16810         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16811         temporary wrapper for FindMembers which tells MemberLookup whether
16812         members from the base classes are included in the return value.
16813         This will go away soon.
16814         (TypeManager.MemberLookup): Use this temporary hack here; once the
16815         new MemberCache is completed, we don't need to do the DeclaredOnly
16816         looping here anymore since the MemberCache will take care of this.
16817         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16818         (MemberCache): When creating the MemberCache for a class, get
16819         members from the current class and all its base classes.
16820         (MemberCache.CacheEntry.Container): New field.  This is a
16821         temporary hack until the Mono runtime is fixed to distinguish
16822         between ReflectedType and DeclaringType.  It allows us to use MCS
16823         with both the MS runtime and the unfixed Mono runtime without
16824         problems and without accecting performance.
16825         (MemberCache.SearchMembers): The DeclaredOnly looping from
16826         TypeManager.MemberLookup is now done here.      
16827
16828 2002-08-14  Martin Baulig  <martin@gnome.org>
16829
16830         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16831         Type.GetFields on dynamic types but get the fields from the
16832         corresponding TypeContainer.
16833         (MyStructInfo.GetStructInfo): Added check for enum types.
16834
16835         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16836         (MemberList.SyncRoot): Implemented.
16837         (TypeManager.FilterWithClosure): No need to check permissions if
16838         closure_start_type == closure_invocation_type, don't crash if
16839         closure_invocation_type is null.
16840
16841 2002-08-13  Martin Baulig  <martin@gnome.org>
16842
16843         Rewrote TypeContainer.FindMembers to use a member cache.  This
16844         gives us a speed increase of about 35% for the self-hosting MCS
16845         build and of about 15-20% for the class libs (both on GNU/Linux).
16846
16847         * report.cs (Timer): New class to get enhanced profiling.  This
16848         whole class is "TIMER" conditional since it remarkably slows down
16849         compilation speed.
16850
16851         * class.cs (MemberList): New class.  This is an IList wrapper
16852         which we're now using instead of passing MemberInfo[]'s around to
16853         avoid copying this array unnecessarily.
16854         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16855         (ICachingMemberFinder, IMemberContainer): New interface.
16856         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16857         has already been checked, otherwise use it for the name comparision.
16858         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16859         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16860         if possible.  Returns a MemberList, not a MemberInfo [].
16861         (TypeHandle): New class, implements IMemberContainer.  We create
16862         one instance of this class per type, it contains a MemberCache
16863         which is used to do the member lookups.
16864         (MemberCache): New class.  Each instance of this class contains
16865         all members of a type and a name-based hash table.
16866         (MemberCache.FindMembers): This is our new member lookup
16867         function.  First, it looks up all members of the requested name in
16868         the hash table.  Then, it walks this list and sorts out all
16869         applicable members and returns them.
16870
16871 2002-08-13  Martin Baulig  <martin@gnome.org>
16872
16873         In addition to a nice code cleanup, this gives us a performance
16874         increase of about 1.4% on GNU/Linux - not much, but it's already
16875         half a second for the self-hosting MCS compilation.
16876
16877         * typemanager.cs (IMemberFinder): New interface.  It is used by
16878         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16879         Enum, Delegate or Interface.
16880         (TypeManager.finder_to_member_finder): New PtrHashtable.
16881         (TypeManager.finder_to_container): Removed.
16882         (TypeManager.finder_to_delegate): Removed.
16883         (TypeManager.finder_to_interface): Removed.
16884         (TypeManager.finder_to_enum): Removed.
16885
16886         * interface.cs (Interface): Implement IMemberFinder.
16887
16888         * delegate.cs (Delegate): Implement IMemberFinder.
16889
16890         * enum.cs (Enum): Implement IMemberFinder.
16891
16892         * class.cs (TypeContainer): Implement IMemberFinder.
16893
16894 2002-08-12  Martin Baulig  <martin@gnome.org>
16895
16896         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16897
16898 2002-08-12  Martin Baulig  <martin@gnome.org>
16899
16900         * ecore.cs (ITypeExpression): New interface for expressions which
16901         resolve to a type.
16902         (TypeExpression): Renamed to TypeLookupExpression.
16903         (Expression.DoResolve): If we're doing a types-only lookup, the
16904         expression must implement the ITypeExpression interface and we
16905         call DoResolveType() on it.
16906         (SimpleName): Implement the new ITypeExpression interface.
16907         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16908         hack, the situation that we're only looking up types can't happen
16909         anymore when this method is called.  Moved the type lookup code to
16910         DoResolveType() and call it.
16911         (SimpleName.DoResolveType): This ITypeExpression interface method
16912         is now doing the types-only lookup.
16913         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16914         (ResolveFlags): Added MaskExprClass.
16915
16916         * expression.cs (MemberAccess): Implement the ITypeExpression
16917         interface.
16918         (MemberAccess.DoResolve): Added support for a types-only lookup
16919         when we're called via ITypeExpression.DoResolveType().
16920         (ComposedCast): Implement the ITypeExpression interface.
16921
16922         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16923         Expression.Resolve() with ResolveFlags.Type instead.
16924
16925 2002-08-12  Martin Baulig  <martin@gnome.org>
16926
16927         * interface.cs (Interface.Define): Apply attributes.
16928
16929         * attribute.cs (Attribute.ApplyAttributes): Added support for
16930         interface attributes.
16931
16932 2002-08-11  Martin Baulig  <martin@gnome.org>
16933
16934         * statement.cs (Block.Emit): Only check the "this" variable if we
16935         do not always throw an exception.
16936
16937         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16938         whether the property has a set accessor.
16939
16940 2002-08-11  Martin Baulig  <martin@gnome.org>
16941
16942         Added control flow analysis support for structs.
16943
16944         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16945         with control flow analysis turned off.
16946         (IVariable): New interface.
16947         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16948         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16949         (FieldExpr.DoResolve): Resolve the instance expression with flow
16950         analysis turned off and do the definite assignment check after the
16951         resolving when we know what the expression will resolve to.
16952
16953         * expression.cs (LocalVariableReference, ParameterReference):
16954         Implement the new IVariable interface, only call the flow analysis
16955         code if ec.DoFlowAnalysis is true.
16956         (This): Added constructor which takes a Block argument.  Implement
16957         the new IVariable interface.
16958         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16959         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16960         This does the definite assignment checks for struct members.
16961
16962         * class.cs (Constructor.Emit): If this is a non-static `struct'
16963         constructor which doesn't have any initializer, call
16964         Block.AddThisVariable() to tell the flow analysis code that all
16965         struct elements must be initialized before control returns from
16966         the constructor.
16967
16968         * statement.cs (MyStructInfo): New public class.
16969         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16970         argument to this indexer.  If non-zero, check an individual struct
16971         member, not the whole struct.
16972         (FlowBranching.CheckOutParameters): Check struct members.
16973         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16974         overloaded versions of these methods which take an additional
16975         `int field_idx' argument to check struct members.
16976         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16977         overloaded versions of these methods which take an additional
16978         `string field_name' argument to check struct member.s
16979         (VariableInfo): Implement the IVariable interface.
16980         (VariableInfo.StructInfo): New public property.  Returns the
16981         MyStructInfo instance of the variable if it's a struct or null.
16982         (Block.AddThisVariable): New public method.  This is called from
16983         Constructor.Emit() for non-static `struct' constructor which do
16984         not have any initializer.  It creates a special variable for the
16985         "this" instance variable which will be checked by the flow
16986         analysis code to ensure that all of the struct's fields are
16987         initialized before control returns from the constructor.
16988         (UsageVector): Added support for struct members.  If a
16989         variable/parameter is a struct with N members, we reserve a slot
16990         in the usage vector for each member.  A struct is considered fully
16991         initialized if either the struct itself (slot 0) or all its
16992         members are initialized.
16993
16994 2002-08-08  Martin Baulig  <martin@gnome.org>
16995
16996         * driver.cs (Driver.MainDriver): Only report an error CS5001
16997         if there were no compilation errors.
16998
16999         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17000         `UnsafeContext' property to determine whether the parent is in
17001         unsafe context rather than checking the parent's ModFlags:
17002         classes nested in an unsafe class are unsafe as well.
17003
17004 2002-08-08  Martin Baulig  <martin@gnome.org>
17005
17006         * statement.cs (UsageVector.MergeChildren): Distinguish between
17007         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17008         we return.  Added test17() and test18() to test-154.cs.
17009
17010 2002-08-08  Martin Baulig  <martin@gnome.org>
17011
17012         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17013         Family access, make sure the invoking type isn't a subclass of the
17014         queried type (that'd be a CS1540).
17015
17016         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17017         this method which takes an additional `Type invocation_type'.
17018
17019         * expression.cs (BaseAccess.DoResolve): Use the base type as
17020         invocation and query type.
17021         (MemberAccess.DoResolve): If the lookup failed and we're about to
17022         report a CS0122, try a lookup with the ec.ContainerType - if this
17023         succeeds, we must report a CS1540.
17024
17025 2002-08-08  Martin Baulig  <martin@gnome.org>
17026
17027         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17028         (MethodGroupExpr): Implement the IMemberExpr interface.
17029
17030         * expression (MemberAccess.ResolveMemberAccess): No need to have
17031         any special code for MethodGroupExprs anymore, they're now
17032         IMemberExprs.   
17033
17034 2002-08-08  Martin Baulig  <martin@gnome.org>
17035
17036         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17037         Family, FamANDAssem and FamORAssem permissions.
17038         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17039
17040 2002-08-08  Martin Baulig  <martin@gnome.org>
17041
17042         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17043         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17044         or loop block.
17045
17046 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17047
17048         * driver.cs: implemented /resource option to embed managed resources.
17049
17050 2002-08-07  Martin Baulig  <martin@gnome.org>
17051
17052         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17053         (FieldBase.HasFieldInitializer): New public property.
17054         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17055         returns the field initializer and makes sure it is only resolved once.
17056         (TypeContainer.EmitFieldInitializers): Call
17057         FieldBase.GetInitializerExpression to get the initializer, this ensures
17058         that it isn't resolved multiple times.
17059
17060         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17061         the resolving process (SimpleName/MemberLookup) that we're currently
17062         emitting a field initializer (which must not access any instance members,
17063         this is an error CS0236).
17064
17065         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17066         argument, if the `IsFieldInitializer' flag is set, we must report and
17067         error CS0236 and not an error CS0120.   
17068
17069 2002-08-07  Martin Baulig  <martin@gnome.org>
17070
17071         * ecore.cs (IMemberExpr): New public interface.
17072         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17073         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17074         if the expression is an IMemberExpr.
17075
17076         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17077         to be null, implicitly default to `this' if we're non-static in
17078         this case.  Simplified the code a lot by using the new IMemberExpr
17079         interface.  Also fixed bug #28176 here.
17080
17081 2002-08-06  Martin Baulig  <martin@gnome.org>
17082
17083         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17084         ParameterReferences during semantic analysis so that we can do a
17085         type-only search when resolving Cast, TypeOf and SizeOf.
17086         (block): Pass the `current_local_parameters' to the Block's
17087         constructor.
17088
17089         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17090         argument to the constructor.
17091         (ConstructorInitializer.Resolve): Create a temporary implicit
17092         block with the parameters.
17093
17094         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17095         references here if we aren't doing a type-only search.
17096
17097         * statement.cs (Block): Added constructor which takes a
17098         `Parameters parameters' argument.
17099         (Block.Parameters): New public property.
17100
17101         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17102         to `Parameters' and made it public readonly.
17103
17104 2002-08-06  Martin Baulig  <martin@gnome.org>
17105
17106         * ecore.cs (Expression.Warning): Made this public as well.
17107
17108         * report.cs (Report.Debug): Print the contents of collections.
17109
17110 2002-08-06  Martin Baulig  <martin@gnome.org>
17111
17112         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17113         used to tell Resolve() which kinds of expressions it may return.
17114         (Expression.Resolve): Added overloaded version of this method which
17115         takes a `ResolveFlags flags' argument.  This can be used to tell
17116         Resolve() which kinds of expressions it may return.  Reports a
17117         CS0118 on error.
17118         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17119         ResolveFlags.SimpleName.
17120         (Expression.Error118): Added overloaded version of this method which
17121         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17122         which kinds of expressions are allowed.
17123
17124         * expression.cs (Argument.ResolveMethodGroup): New public method.
17125         Resolves an argument, but allows a MethodGroup to be returned.
17126         This is used when invoking a delegate.
17127
17128         * TODO: Updated a bit.
17129
17130 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17131
17132         Fixed compilation with csc.
17133
17134         * ecore.cs: Expression.Error made public. Is this correct? Should
17135         Warning be made public too?
17136
17137         * expression.cs: use ea.Location instead of ea.loc.
17138         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17139
17140 2002-08-06  Martin Baulig  <martin@gnome.org>
17141
17142         * ecore.cs (Expression.loc): Moved the location here instead of
17143         duplicating it in all derived classes.
17144         (Expression.Location): New public property.
17145         (Expression.Error, Expression.Warning): Made them non-static and
17146         removed the location argument.
17147         (Expression.Warning): Added overloaded version which takes an
17148         `int level' argument.
17149         (Expression.Error118): Make this non-static and removed the
17150         expression and location arguments.
17151         (TypeExpr): Added location argument to the constructor.
17152
17153         * expression.cs (StaticCallExpr): Added location argument to
17154         the constructor.
17155         (Indirection, PointerArithmetic): Likewise.
17156         (CheckedExpr, UnCheckedExpr): Likewise.
17157         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17158         (StringPtr): Likewise.
17159
17160
17161 2002-08-05  Martin Baulig  <martin@gnome.org>
17162
17163         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17164
17165         * assign.cs (Assign.DoResolve): Check whether the source
17166         expression is a value or variable.
17167
17168         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17169         while resolving the corresponding blocks.
17170
17171         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17172         an error, don't silently return null.
17173
17174         * statement.cs (Block.AddVariable): Do the error reporting here
17175         and distinguish between CS0128 and CS0136.
17176         (Block.DoResolve): Report all unused labels (warning CS0164).
17177         (LabeledStatement): Pass the location to the constructor.
17178         (LabeledStatement.HasBeenReferenced): New property.
17179         (LabeledStatement.Resolve): Set it to true here.
17180
17181         * statement.cs (Return.Emit): Return success even after reporting
17182         a type mismatch error (CS0126 or CS0127), this is what csc does and
17183         it avoids confusing the users with any consecutive errors.
17184
17185 2002-08-05  Martin Baulig  <martin@gnome.org>
17186
17187         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17188
17189         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17190
17191         * expression.cs (MemberAccess.DoResolve): Silently return if an
17192         error has already been reported.
17193
17194         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17195         error has already been reported.
17196
17197 2002-08-05  Martin Baulig  <martin@gnome.org>
17198
17199         * statement.cs (UsageVector): Only initialize the `parameters'
17200         vector if we actually have any "out" parameters.
17201
17202 2002-08-05  Martin Baulig  <martin@gnome.org>
17203
17204         * expression.cs (Binary.ResolveOperator): When combining delegates,
17205         they must have the same type.
17206
17207 2002-08-05  Martin Baulig  <martin@gnome.org>
17208
17209         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17210         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17211         work with the ms runtime and we also don't need it: if we're a
17212         PropertyBuilder and not in the `indexer_arguments' hash, then we
17213         are a property and not an indexer.
17214
17215         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17216         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17217         since the latter one doesn't work with the ms runtime.
17218
17219 2002-08-03  Martin Baulig  <martin@gnome.org>
17220
17221         Fixed bugs #27998 and #22735.
17222
17223         * class.cs (Method.IsOperator): New public field.
17224         (Method.CheckBase): Report CS0111 if there's already a method
17225         with the same parameters in the current class.  Report CS0508 when
17226         attempting to change the return type of an inherited method.
17227         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17228         and it's not marked abstract or extern.
17229         (PropertyBase): New abstract base class for Property and Indexer.
17230         (PropertyBase.CheckBase): Moved here from Property and made it work
17231         for indexers.
17232         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17233         the same so we can reuse it there.
17234         (Property, Indexer): Derive from PropertyBase.
17235         (MethodSignature.inheritable_property_signature_filter): New delegate
17236         to find properties and indexers.
17237
17238         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17239         argument and improved error reporting.
17240
17241         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17242         EmptyReadOnlyParameters and made it a property.
17243
17244         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17245         version of this method which takes a `PropertyInfo indexer'.
17246         (TypeManager.RegisterIndexer): New method.
17247
17248         * class.cs: Added myself as author of this file :-)
17249
17250 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17251
17252         * class.cs: fixed compilation on windoze.
17253
17254 2002-08-03  Martin Baulig  <martin@gnome.org>
17255
17256         * interface.cs (Interface.GetInterfaceBases): Check whether all
17257         base interfaces are at least as accessible than the current one.
17258
17259         * class.cs (TypeContainer.GetClassBases): Check whether base types
17260         are at least as accessible than the current type.
17261         (TypeContainer.AsAccessible): Implemented and made non-static.
17262         (MemberBase.CheckParameters): Report errors if the accessibility
17263         checks fail.
17264
17265         * delegate.cs (Delegate.Delegate): The default visibility is
17266         internal for top-level types and private for nested types.
17267         (Delegate.Define): Report errors if the accessibility checks fail.
17268
17269         * enum.cs (Enum.Enum): The default visibility is internal for
17270         top-level types and private for nested types.
17271         (Enum.DefineType): Compute the correct visibility.
17272
17273         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17274         function which takes a `bool is_toplevel' instead of a TypeContainer.
17275
17276         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17277         builtin type.
17278
17279 2002-08-02  Martin Baulig  <martin@gnome.org>
17280
17281         * expression.cs (LocalVariableReferenc): Added constructor which
17282         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17283         (LocalVariableReference.IsReadOnly): New property.
17284         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17285         variable is readonly, use our own readonly flag to do this; you can
17286         use the new constructor to get a writable reference to a read-only
17287         variable.
17288
17289         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17290         reference to the local variable.
17291
17292 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17293
17294         * rootcontext.cs (ResolveCore): Also include System.Exception
17295
17296         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17297         we reach an EmptyStatement.
17298
17299         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17300         is also fine.
17301
17302         * expression.cs (Binary.ResolveOperator): Check error result in
17303         two places.
17304
17305         use brtrue/brfalse directly and avoid compares to null.
17306
17307 2002-08-02  Martin Baulig  <martin@gnome.org>
17308
17309         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17310         Fixes bug #28407, added test-155.cs.
17311
17312 2002-08-01  Martin Baulig  <martin@gnome.org>
17313
17314         * class.cs (Event.EmitDefaultMethod): Make this work with static
17315         events.  Fixes #28311, added verify-3.cs.
17316
17317 2002-08-01  Martin Baulig  <martin@gnome.org>
17318
17319         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17320         `is_disposable' fields.
17321         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17322         `hm.is_disposable' if we're using the collection pattern.
17323         (Foreach.EmitCollectionForeach): Use the correct type for the
17324         enumerator's local variable, only emit the try/finally block if
17325         necessary (fixes #27713).
17326
17327 2002-08-01  Martin Baulig  <martin@gnome.org>
17328
17329         * ecore.cs (Expression.report118): Renamed to Error118 and made
17330         it public static.
17331
17332         * statement.cs (Throw.Resolve): Check whether the expression is of
17333         the correct type (CS0118) and whether the type derives from
17334         System.Exception (CS0155).
17335         (Catch.Resolve): New method.  Do the type lookup here and check
17336         whether it derives from System.Exception (CS0155).
17337         (Catch.CatchType, Catch.IsGeneral): New public properties.
17338
17339         * typemanager.cs (TypeManager.exception_type): Added.
17340
17341 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17342
17343         * driver.cs: Updated About function.
17344
17345 2002-07-31  Martin Baulig  <martin@gnome.org>
17346
17347         Implemented Control Flow Analysis.
17348
17349         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17350         (EmitContext.CurrentBranching): Added.
17351         (EmitContext.StartFlowBranching): Added.
17352         (EmitContext.EndFlowBranching): Added.
17353         (EmitContext.KillFlowBranching): Added.
17354         (EmitContext.IsVariableAssigned): Added.
17355         (EmitContext.SetVariableAssigned): Added.
17356         (EmitContext.IsParameterAssigned): Added.
17357         (EmitContext.SetParameterAssigned): Added.
17358         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17359         Added control flow analysis stuff here.
17360
17361         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17362         resolve the expression as lvalue.
17363         (LocalVariableReference.DoResolve): Check whether the variable has
17364         already been assigned.
17365         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17366         the parameter as assigned here.
17367         (ParameterReference.DoResolve): Check whether the parameter has already
17368         been assigned.
17369         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17370         expression as lvalue.
17371
17372         * statement.cs (FlowBranching): New class for the flow analysis code.
17373         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17374         (LabeledStatement.IsDefined): New public property.
17375         (LabeledStatement.AddUsageVector): New public method to tell flow
17376         analyis that the label may be reached via a forward jump.
17377         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17378         flow analysis.
17379         (VariableInfo.Number): New public field.  This is used by flow analysis
17380         to number all locals of a block.
17381         (Block.CountVariables): New public property.  This is the number of
17382         local variables in this block (including the locals from all parent
17383         blocks).
17384         (Block.EmitMeta): Number all the variables.
17385
17386         * statement.cs: Added flow analysis support to all classes.
17387
17388 2002-07-31  Martin Baulig  <martin@gnome.org>
17389
17390         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17391         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17392         then use this argument.
17393
17394         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17395
17396         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17397         use this to specify /define options.
17398
17399 2002-07-29  Martin Baulig  <martin@gnome.org>
17400
17401         * statement.cs (Fixed): Moved all code that does variable lookups
17402         and resolvings from Emit to Resolve.
17403
17404         * statement.cs (For): Moved all code that does variable lookups
17405         and resolvings from Emit to Resolve.
17406
17407         * statement.cs (Using): Moved all code that does variable lookups
17408         and resolvings from Emit to Resolve.
17409
17410 2002-07-29  Martin Baulig  <martin@gnome.org>
17411
17412         * attribute.cs (Attribute.Resolve): Explicitly catch a
17413         System.NullReferenceException when creating the
17414         CustromAttributeBuilder and report a different warning message.
17415
17416 2002-07-29  Martin Baulig  <martin@gnome.org>
17417
17418         * support.cs (ParameterData.ParameterName): Added method to
17419         get the name of a parameter.
17420
17421         * typemanager.cs (TypeManager.IsValueType): New public method.
17422
17423 2002-07-29  Martin Baulig  <martin@gnome.org>
17424
17425         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17426         is a flag which specifies that it's either ref or out.
17427         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17428         the out parameter to `out Parameter.Modifier mod', also set the
17429         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17430
17431         * support.cs (InternalParameters.ParameterModifier): Distinguish
17432         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17433         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17434
17435         * expression.cs (Argument.GetParameterModifier): Distinguish
17436         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17437         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17438
17439 2002-07-29  Martin Baulig  <martin@gnome.org>
17440
17441         * expression.cs (ParameterReference.ParameterReference): Added
17442         `Location loc' argument to the constructor.
17443
17444         * cs-parser.jay: Pass location to ParameterReference.
17445
17446 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17447
17448         * statement.cs (Try): Initialize the location.
17449
17450         * cs-parser.jay: pass location to Try.
17451
17452         * expression.cs (Unary.Reduce): Change the prototype to return
17453         whether a constant fold could be performed or not.  The result is
17454         returned in an out parameters.  In the case of Indirection and
17455         AddressOf, we want to perform the full tests.
17456
17457 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17458
17459         * statement.cs (Statement.Emit): Flag dead code.
17460
17461 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17462
17463         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17464
17465 2002-07-27  Martin Baulig  <martin@gnome.org>
17466
17467         * class.cs (MethodData.Define): Put back call to
17468         TypeManager.AddMethod(), accidentally commented this out.
17469
17470         * report.cs (Debug): New public method to print debugging information,
17471         this is `[Conditional ("DEBUG")]'.
17472
17473 2002-07-26  Martin Baulig  <martin@gnome.org>
17474
17475         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17476         (switch_statement): Push the current_block to the switch_stack and
17477         pop it again when we're done with the switch.
17478         (switch_section): The new block is a child of the current_block.
17479         Fixes bug #24007, added test-152.cs.
17480
17481 2002-07-27  Martin Baulig  <martin@gnome.org>
17482
17483         * expression.cs (Invocation.EmitArguments): When calling a varargs
17484         function with only its fixed arguments, we need to pass an empty
17485         array.
17486
17487 2002-07-27  Martin Baulig  <martin@gnome.org>
17488
17489         Mono 0.13 has been released.
17490
17491 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17492
17493         * driver.cs: Rename --resource to --linkres, because that is what
17494         we do currently, we dont support --resource yet.
17495
17496         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17497
17498 2002-07-25  Martin Baulig  <martin@gnome.org>
17499
17500         * class.cs (MethodData): New public class.  This is a `method builder'
17501         class for a method or one accessor of a Property/Indexer/Event.
17502         (MethodData.GetMethodFlags): Moved here from MemberBase.
17503         (MethodData.ApplyAttributes): Likewise.
17504         (MethodData.ApplyObsoleteAttribute): Likewise.
17505         (MethodData.ApplyConditionalAttribute): Likewise.
17506         (MethodData.ApplyDllImportAttribute): Likewise.
17507         (MethodData.CheckAbstractAndExternal): Likewise.
17508         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17509         (MethodData.Emit): Formerly known as Method.Emit().
17510         (MemberBase): Moved everything which was specific to a single
17511         accessor/method to MethodData.
17512         (Method): Create a new MethodData and call Define() and Emit() on it.
17513         (Property, Indexer, Event): Create a new MethodData objects for each
17514         accessor and call Define() and Emit() on them.
17515
17516 2002-07-25  Martin Baulig  <martin@gnome.org>
17517
17518         Made MethodCore derive from MemberBase to reuse the code from there.
17519         MemberBase now also checks for attributes.
17520
17521         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17522         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17523         as virtual.
17524         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17525         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17526         (MemberBase.ApplyAttributes): New virtual method; applies the
17527         attributes to a method or accessor.
17528         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17529         (MemberBase.ApplyConditionalAttribute): Likewise.
17530         (MemberBase.ApplyDllImportAttribute): Likewise.
17531         (MemberBase.CheckAbstractAndExternal): Likewise.
17532         (MethodCore.ParameterTypes): This is now a property instead of a
17533         method, it's initialized from DoDefineParameters().
17534         (MethodCore.ParameterInfo): Removed the set accessor.
17535         (MethodCore.DoDefineParameters): New protected virtual method to
17536         initialize ParameterTypes and ParameterInfo.
17537         (Method.GetReturnType): We can now simply return the MemberType.
17538         (Method.GetMethodFlags): Override the MemberBase version and add
17539         the conditional flags.
17540         (Method.CheckBase): Moved some code from Define() here, call
17541         DoDefineParameters() here.
17542         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17543         here to avoid some larger code duplication.
17544         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17545         ensure that abstract and external accessors don't declare a body.
17546
17547         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17548         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17549         lookup in the attribute's parent classes, so we need to abort as soon
17550         as we found the first match.
17551         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17552         the attribute has no arguments.
17553
17554         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17555         of a Method.
17556
17557 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17558
17559         * cs-parser.jay: reverted previous patch.
17560
17561 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17562
17563         * cs-parser.jay: fixed bug #22119.
17564
17565 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17566
17567         * attribute.cs: fixed compilation. The error was:
17568         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17569         be assigned to before control leaves the current method."
17570         [FIXME:  Filed as bug #28186: MCS must report this error.]
17571
17572 2002-07-25  Martin Baulig  <martin@gnome.org>
17573
17574         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17575         method to pull the condition name ouf of a Conditional attribute.
17576         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17577         the obsolete message and error flag out of an Obsolete attribute.
17578
17579         * class.cs (Method.GetMethodFlags): New public method to get the
17580         TypeManager.MethodFlags for this method.
17581         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17582         private methods.
17583         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17584         if we're overriding a virtual function, set the new private variable
17585         `parent_method'; call the new TypeManager.AddMethod().
17586
17587         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17588         the MethodBuilder and the Method in a PtrHashtable.
17589         (TypeManager.builder_to_method): Added for this purpose.
17590         (TypeManager.MethodFlags): Added IsObsoleteError.
17591         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17592         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17593         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17594         the message from the attribute.
17595
17596 2002-07-24  Martin Baulig  <martin@gnome.org>
17597
17598         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17599         preprocessor directives, ensure that the argument to #define/#undef is
17600         exactly one identifier and that it's actually an identifier.
17601
17602         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17603         did not work ....
17604
17605 2002-07-24  Martin Baulig  <martin@gnome.org>
17606
17607         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17608         initialize it to TypeManager.object_type in the constructor.
17609         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17610         of the `hm.get_current' method if we're using the collection pattern.
17611         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17612         for the explicit conversion to make it work when we're using the collection
17613         pattern and the `Current' property has a different return type than `object'.
17614         Fixes #27713.
17615
17616 2002-07-24  Martin Baulig  <martin@gnome.org>
17617
17618         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17619         does not match, but don't report any errors.  This method is called in
17620         order for all methods in a MethodGroupExpr until a matching method is
17621         found, so we don't want to bail out if the first method doesn't match.
17622         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17623         matches, report the 123.  Fixes #28070.
17624
17625 2002-07-24  Martin Baulig  <martin@gnome.org>
17626
17627         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17628         TypeManager.TypeToCoreType() to the top of the method so the
17629         following equality checks will work.  Fixes #28107.
17630
17631 2002-07-24  Martin Baulig  <martin@gnome.org>
17632
17633         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17634         operand is of type uint, and the other operand is of type sbyte,
17635         short or int, the operands are converted to type long." -
17636         Actually do what this comment already told us.  Fixes bug #28106,
17637         added test-150.cs.
17638
17639 2002-07-24  Martin Baulig  <martin@gnome.org>
17640
17641         * class.cs (MethodBase): New abstract class.  This is now a base
17642         class for Property, Indexer and Event to avoid some code duplication
17643         in their Define() and DefineMethods() methods.
17644         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17645         generic methods for Define() and DefineMethods().
17646         (FieldBase): Derive from MemberBase, not MemberCore.
17647         (Property): Derive from MemberBase, not MemberCore.
17648         (Property.DefineMethod): Moved all the code from this method to the
17649         new MethodBase.DefineAccessor(), just call it with appropriate
17650         argumetnts.
17651         (Property.Define): Call the new Property.DoDefine(), this does some
17652         sanity checks and we don't need to duplicate the code everywhere.
17653         (Event): Derive from MemberBase, not MemberCore.
17654         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17655         accessors, this will also make them work with interface events.
17656         (Indexer): Derive from MemberBase, not MemberCore.
17657         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17658         (Indexer.Define): Use the new MethodBase functions.
17659
17660         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17661         argument to the constructor.
17662         (Interface.FindMembers): Added support for interface events.
17663         (Interface.PopluateEvent): Implemented.
17664
17665         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17666
17667 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17668
17669         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17670         but this is required to check for a method name being the same as
17671         the containing class.  
17672
17673         Handle this now.
17674
17675 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17676
17677         * interface.cs: initialize variable.
17678
17679 2002-07-23  Martin Baulig  <martin@gnome.org>
17680
17681         Implemented the IndexerName attribute in interfaces.
17682
17683         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17684         name if this is an explicit interface implementation.
17685         (Indexer.InterfaceIndexerName): New public variable.  If we're
17686         implementing an interface indexer, this is the IndexerName in that
17687         interface.  Otherwise, it's the IndexerName.
17688         (Indexer.DefineMethod): If we're implementing interface indexer,
17689         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17690         and Pending.ImplementIndexer methods.
17691         (Indexer.Define): Also define the PropertyBuilder if we're
17692         implementing an interface indexer and this is neither an explicit
17693         interface implementation nor do the IndexerName match the one in
17694         the interface.
17695
17696         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17697         If a method is defined here, then we always need to create a proxy
17698         for it.  This is used when implementing interface indexers.
17699         (Pending.IsInterfaceIndexer): New public method.
17700         (Pending.ImplementIndexer): New public method.
17701         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17702         This is used when implementing interface indexers to define a proxy
17703         if necessary.
17704         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17705         define a proxy if necessary.
17706
17707         * interface.cs (Interface.IndexerName): New public variable.
17708         (Interface.PopulateIndexer): Set the IndexerName.
17709         (Interface.DefineIndexers): New private method.  Populate all the
17710         indexers and make sure their IndexerNames match.
17711
17712         * typemanager.cs (IndexerPropertyName): Added support for interface
17713         indexers.
17714
17715 2002-07-22  Martin Baulig  <martin@gnome.org>
17716
17717         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17718         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17719         ret if HasReturnLabel.
17720         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17721         variables.
17722
17723         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17724         and set the ec.LoopBeginTryCatchLevel.
17725         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17726         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17727         the current ec.TryCatchLevel, the branch goes out of an exception
17728         block.  In this case, we need to use Leave and not Br.
17729
17730 2002-07-22  Martin Baulig  <martin@gnome.org>
17731
17732         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17733         block unless the block does not always return or it is contained in
17734         another try { ... } catch { ... } block.  Fixes bug #26506.
17735         Added verify-1.cs to the test suite.
17736
17737 2002-07-22  Martin Baulig  <martin@gnome.org>
17738
17739         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17740         then we do not always return.  Fixes bug #24985.
17741
17742 2002-07-22  Martin Baulig  <martin@gnome.org>
17743
17744         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17745         lookup on a per-class level; ie. walk up the class hierarchy until we
17746         found at least one applicable method, then choose the best among them.
17747         Fixes bug #24463 and test-29.cs.
17748
17749 2002-07-22  Martin Baulig  <martin@gnome.org>
17750
17751         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17752         return types of the methods.  The return type is not part of the
17753         signature and we must not check it to make the `new' modifier work.
17754         Fixes bug #27999, also added test-147.cs.
17755         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17756
17757         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17758         on the method's return type.
17759
17760 2002-07-21  Martin Baulig  <martin@gnome.org>
17761
17762         * assign.cs: Make this work if the rightmost source is a constant and
17763         we need to do an implicit type conversion.  Also adding a few more tests
17764         to test-38.cs which should have caught this.
17765
17766         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17767         target in the makefile for this.  The makefile.gnu is primarily intended
17768         for end-users who don't want to debug the compiler.
17769
17770 2002-07-21  Martin Baulig  <martin@gnome.org>
17771
17772         * assign.cs: Improved the Assign class so it can now handle embedded
17773         assignments (X = Y = Z = something).  As a side-effect this'll now also
17774         consume less local variables.  test-38.cs now passes with MCS, added
17775         a few new test cases to that test.
17776
17777 2002-07-20  Martin Baulig  <martin@gnome.org>
17778
17779         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17780         instructions.  Fixes bug #27977, also added test-146.cs.
17781
17782 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17783
17784         * cs-tokenizer.cs: fixed getHex ().
17785
17786 2002-07-19  Martin Baulig  <martin@gnome.org>
17787
17788         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17789         not Type.GetType() to lookup the array type.  This is needed when
17790         we're constructing an array of a user-defined type.
17791         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17792         single-dimensional arrays, but also for single-dimensial arrays of
17793         type decimal.
17794
17795 2002-07-19  Martin Baulig  <martin@gnome.org>
17796
17797         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17798         this function is called, it's not allowed to share LocalBuilders
17799         among ILGenerators.
17800
17801 2002-07-19  Martin Baulig  <martin@gnome.org>
17802
17803         * expression.cs (Argument.Resolve): Report an error 118 when trying
17804         to pass a type as argument.
17805
17806 2002-07-18  Martin Baulig  <martin@gnome.org>
17807
17808         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17809         Conv_R_Un for the signed `long' type.
17810
17811 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17812
17813         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17814         `expr' for the temporary result, as that will fail if we do
17815         multiple resolves on the same expression.
17816
17817 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17818
17819         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17820         ec.TypeContainer for looking up aliases. 
17821
17822         * class.cs (TypeContainer): Remove LookupAlias from here.
17823
17824         * decl.cs (DeclSpace); Move here.
17825
17826 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17827
17828         * class.cs (FindMembers): Only call filter if the constructor
17829         bulider is not null.
17830
17831         Also handle delegates in `NestedTypes' now.  Now we will perform
17832         type lookups using the standard resolution process.  This also
17833         fixes a bug.
17834
17835         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17836         This uses Expressions (the limited kind that can be parsed by the
17837         tree) instead of strings.
17838
17839         * expression.cs (ComposedCast.ToString): Implement, used to flag
17840         errors since now we have to render expressions.
17841
17842         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17843         FormArrayType. 
17844
17845         * ecore.cs (SimpleName.ToString): ditto.
17846
17847         * cs-parser.jay: Instead of using strings to assemble types, use
17848         Expressions to assemble the type (using SimpleName, ComposedCast,
17849         MemberAccess).  This should fix the type lookups in declarations,
17850         because we were using a different code path for this.
17851
17852         * statement.cs (Block.Resolve): Continue processing statements
17853         even when there is an error.
17854
17855 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17856
17857         * class.cs (Event.Define): Also remove the `remove' method from
17858         the list of pending items.
17859
17860         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17861         generate more compact code. 
17862
17863 2002-07-17  Martin Baulig  <martin@gnome.org>
17864
17865         * const.cs (Const.LookupConstantValue): Add support for constant
17866         `unchecked' and `checked' expressions.
17867         Also adding test case test-140.cs for this.
17868
17869 2002-07-17  Martin Baulig  <martin@gnome.org>
17870
17871         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17872         check whether mi.ReturnType implements the IEnumerator interface; the
17873         `==' and the IsAssignableFrom() will fail in this situation.
17874
17875 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17876
17877         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17878         here too.
17879
17880 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17881
17882         * expression.cs: fixed bug #27811.
17883
17884 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17885
17886         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17887         Molaro: when we are a ref, the value already contains a pointer
17888         value, do not take the address of it.
17889
17890 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17891         * removed mb-parser.jay and mb-tokenizer.cs
17892
17893 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17894
17895         * expression.cs: check against the building corlib void type.
17896
17897 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17898
17899         * ecore.cs: fix for valuetype static readonly fields: when 
17900         initializing them, we need their address, not the address of a copy.
17901
17902 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17903
17904         * typemanager.cs: register also enum_type in corlib.
17905
17906 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17907
17908         * class.cs: allow calling this (but not base) initializers in structs.
17909
17910 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17911
17912         * ecore.cs: make sure we compare against the building base types
17913         in GetTypeSize ().
17914
17915 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17916
17917         * typemanager.cs: fix TypeToCoreType() to handle void and object
17918         (corlib gets no more typerefs after this change).
17919
17920 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17921
17922         * expression.cs (ArrayCreation.EmitArrayArguments): use
17923         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17924
17925         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17926         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17927         array indexes, the runtime actually forbids them.
17928
17929         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17930         for array arguments here.
17931
17932         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17933         instead of the default for ValueTypes.
17934
17935         (New.DoEmit): Use IsValueType instead of
17936         IsSubclassOf (value_type)
17937         (New.DoResolve): ditto.
17938         (Invocation.EmitCall): ditto.
17939
17940         * assign.cs (Assign): ditto.
17941
17942         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17943         Statements *are* currently doing part of their resolution during
17944         Emit.  
17945
17946         Expressions do always resolve during resolve, but statements are
17947         only required to propagate resolution to their children.
17948
17949 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17950
17951         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17952
17953         (LoadAssembly): Do not add the dll if it is already specified
17954
17955         (MainDriver): Add the System directory to the link path at the end,
17956         after all the other -L arguments. 
17957
17958         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17959         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17960         ldelem.u1) and using the opposite for sbytes.
17961
17962         This fixes Digger, and we can finally run it.
17963
17964         * driver.cs (UnixParseOption): Move the option parsing here.  
17965         (CSCParseOption): Implement CSC-like parsing of options.
17966
17967         We now support both modes of operation, the old Unix way, and the
17968         new CSC-like way.  This should help those who wanted to make cross
17969         platform makefiles.
17970
17971         The only thing broken is that /r:, /reference: and /lib: are not
17972         implemented, because I want to make those have the same semantics
17973         as the CSC compiler has, and kill once and for all the confussion
17974         around this.   Will be doing this tomorrow.
17975
17976         * statement.cs (Unsafe.Resolve): The state is checked during
17977         resolve, not emit, so we have to set the flags for IsUnsfe here.
17978
17979 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17980
17981         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17982         not catch the Error_ObjectRefRequired in SimpleName (as it is
17983         possible to have a class/instance variable name that later gets
17984         deambiguated), we have to check this here.      
17985
17986 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17987
17988         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17989         make static and put into Expression.
17990
17991         (Event.Define): Register the private field of the event with the 
17992         TypeManager so that GetFieldFromEvent can get at it.
17993
17994         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17995         keep track of the private field associated with an event which
17996         has no accessors.
17997
17998         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17999         private field.
18000
18001         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18002
18003 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18004
18005         * expression.cs (Binary.EmitBranchable): this routine emits the
18006         Binary expression in a branchable context.  This basically means:
18007         we need to branch somewhere, not just get the value on the stack.
18008
18009         This works together with Statement.EmitBoolExpression.
18010
18011         * statement.cs (Statement.EmitBoolExpression): Use
18012         EmitBranchable. 
18013
18014 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18015
18016         * statement.cs (For): Reduce the number of jumps in loops.
18017
18018         (For): Implement loop inversion for the For statement.
18019
18020         (Break): We can be breaking out of a Try/Catch controlled section
18021         (foreach might have an implicit try/catch clause), so we need to
18022         use Leave instead of Br.
18023
18024         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18025         now).  If the instace expression supports IMemoryLocation, we use
18026         the AddressOf method from the IMemoryLocation to extract the
18027         address instead of emitting the instance.
18028
18029         This showed up with `This', as we were emitting the instance
18030         always (Emit) instead of the Address of This.  Particularly
18031         interesting when This is a value type, as we dont want the Emit
18032         effect (which was to load the object).
18033
18034 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18035
18036         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18037
18038         * statement.cs (Checked): Set the CheckedState during the resolve
18039         process too, as the ConvCast operations track the checked state on
18040         the resolve process, and not emit.
18041
18042         * cs-parser.jay (namespace_member_declaration): Flag that we have
18043         found a declaration when we do.  This is used to flag error 1529
18044
18045         * driver.cs: Report ok when we display the help only.
18046
18047 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18048
18049         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18050
18051 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18052
18053         * cs-tokenizer.cs (define): We also have to track locally the
18054         defines.  AllDefines is just used for the Conditional Attribute,
18055         but we also need the local defines for the current source code. 
18056
18057 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18058
18059         * statement.cs (While, For, Do): These loops can exit through a
18060         Break statement, use this information to tell whether the
18061         statement is the last piece of code.
18062
18063         (Break): Flag that we break.
18064
18065         * codegen.cs (EmitContexts): New `Breaks' state variable.
18066
18067 2002-07-03  Martin Baulig  <martin@gnome.org>
18068
18069         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18070         modifiers in method declarations in structs.  Otherwise, you won't
18071         be able to override things like Object.Equals().
18072
18073 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18074
18075         * class.cs (Method, Property, Indexer): Do not allow the public
18076         modifier to be used in explicit interface implementations.
18077
18078         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18079         override modifiers in method declarations in structs
18080
18081 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18082
18083         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18084         integer or real overflow, report an error
18085
18086 2002-07-02  Martin Baulig  <martin@gnome.org>
18087
18088         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18089         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18090         to tell the runtime about our newly created System.Object and
18091         System.ValueType types.
18092
18093 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18094
18095         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18096         struct instead of Ldarg/Starg.
18097
18098 2002-07-02  Martin Baulig  <martin@gnome.org>
18099
18100         * expression.cs (Indirection.Indirection): Call
18101         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18102
18103 2002-07-02  Martin Baulig  <martin@gnome.org>
18104
18105         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18106         ValueType, call TypeManager.TypeToCoreType() on it.
18107         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18108         the OpCodes.Newarr argument.
18109
18110 2002-07-02  Martin Baulig  <martin@gnome.org>
18111
18112         * expression.cs (Invocation.EmitCall): When compiling corlib,
18113         replace all calls to the system's System.Array type to calls to
18114         the newly created one.
18115
18116         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18117         System.Array methods.
18118         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18119         from the system's System.Array type which must be replaced.
18120
18121 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18122
18123         * typemanager.cs: load unverifiable_code_ctor so we can build
18124         corlib using the correct type. Avoid using GetTypeCode() with
18125         TypeBuilders.
18126         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18127         TypeManager.object_type to allow building corlib.
18128
18129 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18130
18131         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18132
18133 2002-07-01  Martin Baulig  <martin@gnome.org>
18134
18135         * class.cs: Make the last change actually work, we need to check
18136         whether `ifaces != null' to avoid a crash.
18137
18138 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18139
18140         * class.cs: when we build structs without fields that implement
18141         interfaces, we need to add the interfaces separately, since there is
18142         no API to both set the size and add the interfaces at type creation
18143         time.
18144
18145 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18146
18147         * expression.cs: the dimension arguments to the array constructors
18148         need to be converted if they are a long.
18149
18150 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18151
18152         * class.cs: don't emit ldarg.0 if there is no parent constructor
18153         (fixes showstopper for corlib).
18154
18155 2002-06-29  Martin Baulig  <martin@gnome.org>
18156
18157         MCS now compiles corlib on GNU/Linux :-)
18158
18159         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18160         ie. check for MethodImplOptions.InternalCall.
18161
18162         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18163         and TypeManager.attribute_type are null, so we must explicitly check
18164         whether parent is not null to find out whether it's an attribute type.
18165         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18166         and SetBuilder, not only if the property is neither abstract nor external.
18167         This is necessary to set the MethodImplOptions on the accessor methods.
18168         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18169         SetBuilder, see Property.Emit().
18170
18171         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18172         populate "System.Object", "System.ValueType" and "System.Attribute" since
18173         they've already been populated from BootCorlib_PopulateCoreTypes().
18174
18175 2002-06-29  Martin Baulig  <martin@gnome.org>
18176
18177         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18178         is the NullLiteral, we also need to make sure that target_type is not
18179         an enum type.   
18180
18181 2002-06-29  Martin Baulig  <martin@gnome.org>
18182
18183         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18184         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18185         before calling BootstrapCorlib_ResolveDelegate ().
18186
18187 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18188
18189         * statement.cs: fixed build-breaker. All tests passed ok.
18190
18191 2002-06-27  Martin Baulig  <martin@gnome.org>
18192
18193         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18194         for System.Decimal when compiling corlib.
18195
18196 2002-06-27  Martin Baulig  <martin@gnome.org>
18197
18198         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18199         switch blocks which contain nothing but a default clause.
18200
18201 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18202
18203        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18204
18205 2002-06-27  Martin Baulig  <martin@gnome.org>
18206
18207         * ecore.cs (PropertyExpr.PropertyExpr): Call
18208         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18209
18210         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18211         is already a TypeBuilder.
18212
18213 2002-06-27  Martin Baulig  <martin@gnome.org>
18214
18215         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18216         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18217         the "from an array-type to System.Array" case.  This makes it work
18218         when compiling corlib.
18219
18220 2002-06-27  Martin Baulig  <martin@gnome.org>
18221
18222         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18223         non-static PropertyExpr, set its InstanceExpression.  This makes
18224         the `ICollection.Count' property work in System/Array.cs.
18225
18226 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18227
18228         * driver.cs: Made error handling more consistent.  Errors now
18229         tracked by Report class, so many methods which used to return int
18230         now return void.  Main() now prints success/failure and 
18231         errors/warnings message.
18232
18233         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18234         the magic number return values (123 and 124).  Now, if the
18235         expected error occurs, the compiler exits with success (exit value
18236         0).  If the compilation completes without seeing that particular
18237         error, the compiler exits with failure (exit value 1).  The
18238         makefile in mcs/errors has been changed to handle the new behaviour.
18239
18240         * report.cs: Made 'expected error' number a property and renamed
18241         it from 'Probe' to 'ExpectedError'.
18242
18243         * genericparser.cs: Removed error handling support, since it is
18244         now all done by Report class.
18245
18246         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18247         class, so parse() no longer returns an int.
18248
18249         * namespace.cs: Use Report.Error instead of GenericParser.error
18250
18251 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18252
18253         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18254         TypeContainer.AddOperator): At the front of the list put the
18255         explicit implementations, so they get resolved/defined first. 
18256
18257 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18258
18259         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18260         interface type is implemented by this TypeContainer.  Used during
18261         explicit interface implementation.
18262
18263         (Property.Define, Indexer.Define, Method.Define): Validate that
18264         the given interface in the explicit implementation is one of the
18265         base classes for the containing type.
18266
18267         Also if we are explicitly implementing an interface, but there is
18268         no match in the pending implementation table, report an error.
18269
18270         (Property.Define): Only define the property if we are
18271         not explicitly implementing a property from an interface.  Use the
18272         correct name also for those properties (the same CSC uses,
18273         although that is really not needed).
18274
18275         (Property.Emit): Do not emit attributes for explicitly implemented
18276         properties, as there is no TypeBuilder.
18277
18278         (Indexer.Emit): ditto.
18279
18280         Hiding then means that we do not really *implement* a pending
18281         implementation, which makes code fail.
18282
18283 2002-06-22  Martin Baulig  <martin@gnome.org>
18284
18285         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18286         the return value of Object.GetType().  [FIXME: we need to do this whenever
18287         we get a type back from the reflection library].
18288
18289 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18290
18291         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18292
18293 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18294
18295         * attribute.cs: Return null if we can not look up the type.
18296
18297         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18298         the interface types found.
18299
18300         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18301         interface types found.
18302
18303         * typemanager.cs (GetInterfaces): Make this routine returns alll
18304         the interfaces and work around the lame differences between
18305         System.Type and System.Reflection.Emit.TypeBuilder in the results
18306         result for GetInterfaces.
18307
18308         (ExpandInterfaces): Given an array of interface types, expand and
18309         eliminate repeated ocurrences of an interface.  This expands in
18310         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18311         be IA, IB, IC.
18312
18313 2002-06-21  Martin Baulig  <martin@gnome.org>
18314
18315         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18316         on System.Enum.
18317
18318 2002-06-21  Martin Baulig  <martin@gnome.org>
18319
18320         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18321         and called with one of the core types, return the corresponding typebuilder for
18322         that type.
18323
18324         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18325         element type.
18326
18327 2002-06-21  Martin Baulig  <martin@gnome.org>
18328
18329         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18330         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18331         (Expression.ConvertReferenceExplicit): Likewise.
18332
18333         * expression.cs (ElementAccess.DoResolve): Likewise.
18334         (ElementAccess.DoResolveLValue): Likewise.
18335
18336 2002-06-10  Martin Baulig  <martin@gnome.org>
18337
18338         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18339         add the "value" parameter to the parameter list.
18340
18341         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18342         to our caller.
18343
18344 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18345
18346         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18347         the argument to an int, uint, long or ulong, per the spec.  Also
18348         catch negative constants in array creation.
18349
18350 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18351
18352         * class.cs: do not allow the same interface to appear twice in
18353         the definition list.
18354
18355 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18356
18357         * ecore.cs: don't use ldlen with System.Array.
18358
18359 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18360
18361         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18362
18363 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18364
18365         * modifiers.cs: produce correct field attributes for protected
18366         internal. Easy fix so miguel can work on ther harder stuff:-)
18367
18368 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18369
18370         * pending.cs: New file.  Move the code from class.cs here.
18371         Support clearning the pending flag for all methods (when not doing
18372         explicit interface implementation).
18373
18374 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18375
18376         * rootcontext.cs: added a couple more types needed to bootstrap.
18377
18378 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18379
18380         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18381         constructor in the type, instead of any constructor in the type
18382         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18383         a bug in the Mono runtime when applying the params attribute). 
18384
18385 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18386         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18387
18388 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18389
18390         * expression.cs (Unary.ResolveOperator): Use TypeManager
18391         to resolve the type.
18392
18393 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18394
18395         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18396         attached.
18397
18398         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18399         with each member too.
18400
18401         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18402         field builders too - this takes care of the enum member case.
18403
18404 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18405
18406         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18407         address-of operator on both value types and pointers.
18408
18409 2002-06-10  Martin Baulig  <martin@gnome.org>
18410
18411         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18412         PropertyBuilder to the `property_builders' list.
18413
18414         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18415         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18416         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18417         find any indexers which are inherited from an interface.
18418
18419 2002-06-09  Martin Baulig  <martin@gnome.org>
18420
18421         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18422         the same type as the constant if necessary.  There's also a test-130.cs
18423         for this.
18424
18425         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18426
18427         * typemanager.cs (TypeManager.ChangeType): Previously known as
18428         Enum.ChangeEnumType().
18429
18430 2002-06-09  Martin Baulig  <martin@gnome.org>
18431
18432         * expression.cs (Cast.TryReduce): Added support for consts.
18433
18434 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18435
18436         * class.cs (Accessor): Hold attributes information so we can pass
18437         it along.
18438
18439         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18440         Modify to pass in attributes attached to the methods.
18441
18442         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18443
18444         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18445         to handle the Accessor kind :-)
18446
18447         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18448
18449 2002-06-08  Martin Baulig  <martin@gnome.org>
18450
18451         * expression.cs (Unary.TryReduceNegative): Added support for
18452         ULongConstants.
18453
18454 2002-06-08  Martin Baulig  <martin@gnome.org>
18455
18456         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18457         name can't be found in the `defined_names' - the caller will do a
18458         MemberLookup in this case and thus find methods in System.Enum
18459         such as Enum.IsDefined().
18460
18461 2002-06-08  Martin Baulig  <martin@gnome.org>
18462
18463         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18464         Convert.ChangeType() which works with TypeBuilder created types.
18465         (Enum.LookupEnumValue, Enum.Define): Use it here.
18466
18467         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18468         `TypeBuilder.BaseType != null' check.
18469         (TypeContainer.FindMembers): Only lookup parent members if we
18470         actually have a parent.
18471         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18472         (ConstructorInitializer.Resolve): Likewise.
18473
18474         * interface.cs (Interface.FindMembers): Added
18475         `TypeBuilder.BaseType != null' check.
18476
18477         * rootcontext.cs (RootContext.ResolveCore): Added
18478         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18479         classes_second_stage.
18480
18481         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18482         debug_type and trace_type when compiling with --nostdlib.       
18483
18484 2002-06-07  Martin Baulig  <martin@gnome.org>
18485
18486         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18487         (AddField): Set it to true when adding a non-static field.
18488         (DefineType): Use `have_nonstatic_fields' to find out whether we
18489         have non-static fields, not `Fields != null'.
18490
18491 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18492
18493         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18494         dereferencing a null on the static-field code path)
18495
18496 2002-05-30  Martin Baulig  <martin@gnome.org>
18497
18498         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18499         to take command line arguments.  Use reflection to call the new
18500         custom `Initialize' function on the symbol writer and pass it the
18501         command line arguments.
18502
18503         * driver.cs (--debug-args): New command line argument to pass command
18504         line arguments to the symbol writer.
18505
18506 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18507
18508         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18509         the target type for indexers and properties.  Thanks to Joe for
18510         catching this.
18511
18512 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18513
18514         * typemanager.cs (MethodFlags): returns the method flags
18515         (Obsolete/ShouldIgnore) that control warning emission and whether
18516         the invocation should be made, or ignored. 
18517
18518         * expression.cs (Invocation.Emit): Remove previous hack, we should
18519         not do this on matching a base type, we should do this based on an attribute
18520
18521         Only emit calls to System.Diagnostics.Debug and
18522         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18523         on the command line.
18524
18525         * rootcontext.cs: Global settings for tracing and debugging.
18526
18527         * cs-tokenizer.cs (define): New utility function to track
18528         defines.   Set the global settings for TRACE and DEBUG if found.
18529
18530 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18531
18532         * interface.cs (Populate*): Pass in the TypeContainer as well as
18533         the DeclSpace as parameters so that we can create EmitContexts and
18534         then use that to apply attributes etc.
18535
18536         (PopulateMethod, PopulateEvent, PopulateProperty)
18537         (PopulateIndexer): Apply attributes everywhere.
18538
18539         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18540         etc.
18541
18542         (ApplyAttributes): Update accordingly.
18543
18544         We now apply interface attributes for all members too.
18545
18546 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18547
18548         * class.cs (Indexer.Define); Correctly check if we are explicit
18549         implementation (instead of checking the Name for a ".", we
18550         directly look up if the InterfaceType was specified).
18551
18552         Delay the creation of the PropertyBuilder.
18553
18554         Only create the PropertyBuilder if we are not an explicit
18555         interface implementation.   This means that explicit interface
18556         implementation members do not participate in regular function
18557         lookups, and hence fixes another major ambiguity problem in
18558         overload resolution (that was the visible effect).
18559
18560         (DefineMethod): Return whether we are doing an interface
18561         implementation. 
18562
18563         * typemanager.cs: Temporary hack until we get attributes in
18564         interfaces (Ravi is working on that) and we get IndexerName
18565         support in interfaces.
18566
18567         * interface.cs: Register the indexers as properties.
18568
18569         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18570         warning, I have verified that this is a bug in the .NET runtime
18571         (JavaScript suffers of the same problem).
18572
18573         * typemanager.cs (MemberLookup): When looking up members for
18574         interfaces, the parent of an interface is the implicit
18575         System.Object (so we succeed in searches of Object methods in an
18576         interface method invocation.  Example:  IEnumerable x;  x.ToString
18577         ()) 
18578
18579 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18580
18581         * class.cs (Event): Events should also register if they do
18582         implement the methods that an interface requires.
18583
18584         * typemanager.cs (MemberLookup); use the new GetInterfaces
18585         method. 
18586
18587         (GetInterfaces): The code used to lookup interfaces for a type is
18588         used in more than one place, factor it here. 
18589
18590         * driver.cs: Track the errors at the bottom of the file, we kept
18591         on going.
18592
18593         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18594         instance if the method we are calling is static!
18595
18596 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18597
18598         * attribute.cs (ApplyAttributes): Make this function filter out
18599         the IndexerName attribute (as that attribute in reality is never
18600         applied) and return the string constant for the IndexerName
18601         attribute. 
18602
18603         * class.cs (TypeContainer.Emit): Validate that all the indexers
18604         have the same IndexerName attribute, and if so, set the
18605         DefaultName attribute on the class. 
18606
18607         * typemanager.cs: The return value might contain other stuff (not
18608         only methods).  For instance, consider a method with an "Item"
18609         property and an Item method.
18610
18611         * class.cs: If there is a problem with the parameter types,
18612         return. 
18613
18614 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18615
18616         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18617         looks at user defined conversion after making a call to 
18618         StandardConversionExists - we need this for overload resolution.
18619
18620         * expression.cs : Update accordingly the various method calls.
18621
18622         This fixes 2 bugs filed against implicit user defined conversions 
18623
18624 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18625
18626         * statement.cs: Track the result of the assignment.
18627
18628 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18629
18630         * expression.cs (MemberAccess): Improved error reporting for
18631         inaccessible members.
18632
18633 2002-05-22  Martin Baulig  <martin@gnome.org>
18634
18635         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18636         itself with debugging support.
18637
18638 2002-05-22  Martin Baulig  <martin@gnome.org>
18639
18640         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18641         Removed, this isn't needed anymore.
18642
18643 2002-05-20  Martin Baulig  <martin@gnome.org>
18644
18645         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18646         be underlying type for an enum.
18647
18648 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18649
18650         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18651         that splits out the loading of just the core types.
18652
18653         * rootcontext.cs (ResolveCore): Split the struct resolution in
18654         two, so we can load the enumeration underlying types before any
18655         enums are used.
18656
18657         * expression.cs (Is): Bandaid until we fix properly Switch (see
18658         bug #24985 for details).
18659
18660         * typemanager.cs (ImplementsInterface): The hashtable will contain
18661         a null if there are no interfaces implemented.
18662
18663 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18664
18665         * cs-parser.jay (indexer_declarator): It is fine to have array
18666         parameters
18667
18668 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18669
18670         * typemanager.cs: (RegisterBuilder): New function used to register
18671         TypeBuilders that implement interfaces.  Since
18672         TypeBuilder.GetInterfaces (as usual) does not work with lame
18673         Reflection.Emit. 
18674         (AddUserType): register interfaces.
18675
18676         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18677         dealing with TypeBuilder.  Also, arrays are showing up as
18678         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18679         methods can not be invoked on them!
18680
18681         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18682         (ImplicitReferenceConversionExists): Split out from
18683         StandardConversionExists. 
18684
18685         * expression.cs (As): We were only implementing one of the three
18686         cases for the as operator.  We now implement them all.
18687         (Is): Implement the various other cases for Is as well.
18688
18689         * typemanager.cs (CACHE): New define used to control if we want or
18690         not the FindMembers cache.  Seems to have a negative impact on
18691         performance currently
18692
18693         (MemberLookup): Nested types have full acess to
18694         enclosing type members
18695
18696         Remove code that coped with instance/static returns for events, we
18697         now catch this in RealFindMembers.
18698
18699         (RealFindMembers): only perform static lookup if the instance
18700         lookup did not return a type or an event.  
18701
18702 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18703
18704         * assign.cs (CompoundAssign): We pass more semantic information
18705         now to Compound Assignments than we did before: now we have all
18706         the information at hand, and now we resolve the target *before* we
18707         do the expression expansion, which allows the "CacheValue" method
18708         to have the effect we intended (before, a [x] += 1 would generate
18709         two differen ArrayAccess expressions from the ElementAccess,
18710         during the resolution process).
18711
18712         (CompoundAssign.DoResolve): Resolve target and original_source here.
18713
18714 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18715
18716         * expression.cs (ArrayAccess): dropped debugging information. 
18717
18718         * typemanager.cs: Small bug fix: I was always returning i_members,
18719         instead of one of i_members or s_members (depending on which had
18720         the content).
18721
18722         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18723         method is invoked before any code generation takes place, and it
18724         is a mechanism to inform that the expression will be invoked more
18725         than once, and that the method should use temporary values to
18726         avoid having side effects
18727
18728         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18729
18730         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18731         implementation.
18732
18733         * expression.cs (Indirection, ArrayAccess): Add support for
18734         CacheTemporaries in these two bad boys. 
18735
18736         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18737         ldobj or ldind_ref.  
18738         (StoreFromPtr): Handle stobj as well.
18739
18740         * expression.cs (UnaryMutator): Share more code.
18741
18742         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18743         down: I was not tracking the Filter function as well, which
18744         was affecting the results of the cache.
18745
18746 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18747
18748         * attribute.cs: Remove the hack to handle the CharSet property on
18749         StructLayouts. 
18750
18751 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18752
18753         * attribute.cs (DoResolve): More uglyness, we now only try to
18754         resolve the attribute partially, to extract the CharSet
18755         information (only if we are a StructLayout attribute).  Otherwise 
18756
18757         (GetExtraTypeInfo): Add some code to conditionally kill in the
18758         future this.   I am more and more convinced that the .NET
18759         framework has special code to handle the attribute setting on
18760         certain elements.
18761
18762         * expression.cs (IsParamsMethodApplicable): Revert my previous
18763         foreach change here, it was wrong.
18764
18765 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18766
18767         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18768         (pp_expr): do not abort on unknown input, just return.
18769         (eval): abort if there are pending chars.
18770
18771         * attribute.cs (Attribute.Resolve): Positional parameters are
18772         optional.  Deal with that case.
18773
18774         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18775         the Ansi/Unicode/Auto information for the type.
18776
18777         (TypeContainer.DefineType): instantiate the EmitContext here, as
18778         we will be using it during the type definition (to resolve
18779         attributes) and during the emit phase.
18780
18781         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18782         to pull type information out of the attributes
18783
18784         (Attribute.Resolve): track the constructor builder, and allow for
18785         multiple invocations (structs and classes will use this).
18786
18787         * ecore.cs (MemberLookupFinal): new version with all the
18788         parameters customizable.
18789
18790         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18791         constructors.  Return if the result value is null (as the error
18792         would have been flagged already by MemberLookupFinal)
18793
18794         Do not allow instances of abstract classes or interfaces to be
18795         created.
18796
18797         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18798         We have to compare the assembly property here when dealing with
18799         FamANDAssem and Assembly access modifiers, because we might be
18800         creating an assembly from *modules* (that means that we are not
18801         getting TypeBuilders for types defined in other modules that are
18802         part of this assembly).
18803
18804         (Method.Emit): If the method is marked abstract and has a body,
18805         emit an error. 
18806
18807         (TypeContainer.DefineMembers): If both the defined member and the
18808         parent name match are methods, then do not emit any warnings: let
18809         the Method.Define routine take care of flagging warnings.  But if
18810         there is a mismatch (method overrides something else, or method is
18811         overriwritten by something, then emit warning).
18812
18813         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18814         set to null, this means `do not check for the return type on the
18815         signature'. 
18816
18817         (Method.Define): set the return type for the method signature to
18818         null, so that we get methods with the same name and parameters and
18819         different return types.  This is used to flag warning 114 (you are
18820         hiding a method, and you probably want to use the new/override
18821         keywords instead).
18822
18823         * typemanager.cs (MemberLookup): Implemented proper access
18824         control, closing a long standing set of bug reports.  The problem
18825         was that the Framework only has two bits: Public and NonPublic,
18826         and NonPublic includes private and protected methods, but we need
18827         to enforce the FamANDAssem, FamOrAssem and Family. 
18828
18829 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18830
18831         * statement.cs (GotoCase): Return true: Ammounts to giving up
18832         knowledge on whether we return or not, and letting the other case
18833         be responsible for it.
18834
18835 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18836
18837         * driver.cs: Do not load directories for each file processed, only
18838         do it if there is a pattern.
18839
18840         * ecore.cs: Report readonly assigns here as well, as we might have
18841         been resolved only by MemberAccess.
18842
18843         (SimpleName.SimpleNameResolve): Also be useful for LValue
18844         resolution.   We need this to propagate assign to local readonly variables
18845
18846         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18847         do not want to reuse potential criteria memory.
18848
18849         * class.cs (MyEventBuilder): Set reflected_type;
18850
18851         * ecore.cs (Constantify): Added support for constifying bools.
18852
18853         (RootContext.LookupType): Added a cache for values looked up in
18854         the declaration space.
18855
18856         * typemanager.cs (FindMembers): Now is a front-end to
18857         RealFindMembers, and provides a two-level hashtable-based cache to
18858         the request.  
18859
18860         15% performance improvement: from 22.5 to 19.2 seconds.
18861
18862         * expression.cs (IsParamsMethodApplicable): use foreach.
18863         (Invocation.DoResolve): ditto.
18864         (New.DoResolve): ditto.
18865         (ArrayCreation.DoResolve): ditto.
18866
18867         * ecore.cs (FindMostEncompassingType): use foreach.
18868
18869         * delegate.cs (NewDelegate.DoResolve): Use foreach
18870
18871         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18872         (RemoveMethods): use foreach.
18873
18874         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18875         nested foreach statements instead of for, and also break out of
18876         the inner loop once a match is found.
18877
18878         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18879
18880 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18881
18882         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18883         we actually unwrap the expression to allow for extra information
18884         to be extracted. 
18885
18886         * expression.cs: Use Shr_Un on unsigned operations. 
18887
18888 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18889
18890         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18891         applicable operators was not being considered correctly. This closes
18892         the bug Miguel reported.
18893
18894 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18895
18896         * attribute.cs: check that the type derives from System.Attribute
18897         and report the correct error in that case (moved the duplicate code to
18898         its own method, too).
18899
18900 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18901
18902         * attribute.cs: lookup attribute type name as the spec says: first the
18903         bare attribute name and then name + "Attribute" (nant compiles with
18904         mcs after this fix).
18905
18906 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18907
18908         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18909         Because of the way we parse things, we should try to see if a
18910         UIntConstant can fit in an integer.
18911
18912 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18913
18914         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18915         when we are in an explicit context.
18916
18917         (ConvertReferenceExplicit): When converting from Iface type S to Class
18918         T make sure the rules are implemented as an OR.
18919
18920         * parameter.cs (ParameterType): Make it a property for now although the
18921         purpose really isn't anything immediate.
18922
18923         * expression.cs (Is*Applicable): Do better checking on the parameter type
18924         of a ref/out parameter. The ones from the system assemblies are already 
18925         marked with the correct type so we don't need to do any correction.
18926
18927         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18928         the object type is standard too so include that.
18929
18930 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18931
18932         * ecore.cs (StandardConversionExists): Augment with missing code:
18933         deal with IntConstant, LongConstants and Enumerations.
18934
18935         * assign.cs: Report the error, instead of failing silently
18936
18937         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18938         typecontainer that they are declared, because the
18939         typecontainer/namespace will have the list of using clauses that
18940         need to be applied.
18941
18942         Assembly Attributes were escaping the normal registration
18943         mechanism. 
18944
18945         (EmitCode): Apply attributes within an EmitContext that represents
18946         the container they were declared on.
18947
18948         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18949
18950 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18951
18952         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18953         Revamp completely - make much cleaner as we now operate only
18954         on a set of Types.
18955
18956         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18957         to implement the logic detailed in the spec more correctly.
18958
18959         (UserDefinedConversion): Update accordingly.
18960
18961 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18962
18963         * statement.cs: Return flow analysis information up.
18964
18965         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18966         and the default.
18967
18968         (token): Do not consume an extra character before calling
18969         decimal_digits.
18970
18971 2002-05-06  Piers Haken <piersh@friskit.com>
18972
18973         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18974
18975 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18976
18977         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18978         EmitContext during the instance constructor initializer
18979         resolution, to stop access to instance variables.
18980
18981         This is mandated by the spec, last paragraph of the `constructor
18982         initializers' section. 
18983
18984 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18985
18986         * cs-parser.jay, class.cs (Accessor): new class used to represent
18987         an accessor (get or set).  In the past we used `null' to represent
18988         a missing accessor.  But this is ambiguous because there was no
18989         way to tell in abstract indexers/properties if one of them was
18990         specified.
18991
18992         Now there is a way of addressing that.
18993
18994         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18995         instead of FindMembers.
18996
18997         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18998         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18999
19000         * attribute.cs: Treat indexers and properties as the same in terms
19001         of applying attributes
19002
19003         * ecore.cs (FindMostEncompassedType): Use statically initialized
19004         EmptyExpressions()s like we do elsewhere to avoid creating useless
19005         objects (and we take this out of the tight loop).
19006
19007         (GetConversionOperators): Move the code to extract the actual
19008         operators to a separate routine to clean things up.
19009
19010 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19011
19012         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19013         events are always registered FieldBuilders.
19014
19015         * class.cs (FieldBase): New class shared by Fields 
19016
19017         * delegate.cs: If we are a toplevel delegate, use our full name.
19018         If we are a nested delegate, then only use our tail name.
19019
19020 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19021
19022         * expression.cs (IsApplicable): Ensure that we add the "&" to
19023         ref/out types before comparing it with the type of the argument.
19024
19025         (IsParamsMethodApplicable): Ditto.
19026
19027         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19028         silly me ;-)
19029
19030         * delegate.cs : Handle the case when we have more than one applicable
19031         method. Flag an error only when we finish checking all.
19032
19033 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19034
19035         * expression.cs: Add support for boolean static initializers.
19036
19037 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19038
19039         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19040
19041         * parameter.cs (ComputeParameterTypes,
19042         ComputeAndDefineParameterTypes): Better error handling: now we
19043         clear the `types' cache if we fail during any of the type lookups.
19044         We also return the status code correctly to our caller
19045
19046         * delegate.cs: If we fail to define a delegate, abort the extra
19047         steps. 
19048
19049         * expression.cs (Binary.ResolveOperator): for
19050         operator==(object,object) and operator !=(object, object) we also
19051         have to verify that there is an implicit conversion from one to
19052         the other.
19053
19054         (ArrayAccess.DoResolve): Array Access can operate on
19055         non-variables. 
19056
19057 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19058
19059         * assign.cs (CompoundAssign): A new class used as a "flag" that
19060         the assignment actually is happening as part of a compound
19061         assignment operator.
19062
19063         During compound assignment, a few new rules exist to enable things
19064         like:
19065
19066         byte b |= 1 + 2
19067
19068         From the spec:
19069
19070         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19071         to the type of x) if y is implicitly convertible to the type of x,
19072         and the operator is a builtin operator and the return type of the
19073         operator is explicitly convertible to the type of x. 
19074
19075         * rootcontext.cs: Reset warning level to 2.  4 catches various
19076         "interesting" features in mcs, we must clean this up at some
19077         point, but currently am trying to kill other bugs ;-)
19078
19079         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19080         in container classes as well.  
19081
19082         * expression.cs (Binary.ResolveOperator): Handle string case
19083         before anything else (as operator overloading does emit an error
19084         before doing anything else).
19085
19086         This code could go away when we move to a table driven model, but
19087         i could not come up with a good plan last night.
19088
19089 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19090
19091         * typemanager.cs (CSharpName): reimplementation using regex.
19092         * class.cs: added null check for fields in Emit
19093         * rootcontext.cs: set warninglevel to 4
19094
19095 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19096
19097         * typemanager.cs (CSharpName): reimplemented with Lupus
19098         suggestion.
19099
19100 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19101
19102         * statement.cs (If): correclty implement Resolve, because we were
19103         not catching sem errors in there.  The same process is needed
19104         everywhere else. 
19105         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19106
19107
19108         (Statement.Warning_DeadCodeFound): Factorize code.
19109         (While): Report dead code here too.
19110
19111         (Statement): Added Resolve virtual method to allow
19112         for resolution split from the emit code.
19113
19114 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19115
19116         * statement.cs (EmitBoolExpression): No longer try to resolve the
19117         expression here.    
19118         (MakeBoolean): New utility function that resolve, implicitly
19119         converts to boolean and tags the expression. 
19120
19121
19122         (If, Do): Implement dead code elimination.
19123         (While): Implement loop inversion
19124
19125         (Do, While, For, If): Resolve the expression prior to calling our
19126         code generation.
19127
19128 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19129
19130         * class.cs:
19131           - added method Report28 (warning: program has more than one entry point)
19132           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19133           - modified method Method.Define, the part at the end of the method
19134
19135         * rootcontext.cs: added static public Location EntryPointLocation;
19136           
19137         * ../errors/cs0028.cs : Add test case for the above warning.              
19138
19139         * typemanager.cs:
19140           - modified method CSharpName to allow arrays of primitive type to
19141             be printed nicely (e.g. instead of System.Int32[][] it now prints
19142             int[][])
19143           - added method CSharpSignature: returns the signature of a method
19144             in string format to be used in reporting errors, warnings, etc.
19145
19146         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19147         with String.Empty.
19148
19149 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19150
19151         * delegate.cs (Define): Fix extremely silly bug where I was
19152         setting the type of the 'object' parameter of the BeginInvoke
19153         method to System.IAsyncResult instead of System.Object ;-)
19154
19155 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19156
19157         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19158         here. 
19159
19160         (Constructor.Emit): return if we fail to initialize the
19161         constructor.  Another door closed!  
19162
19163         * expression.cs (New.DoResolve): Improve error message (from -6 to
19164         1501).  Use DeclaredOnly lookup to find the exact constructor.
19165
19166         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19167         loop.  This is useful.
19168
19169         * cs-parser.jay: Adjust the default parameters so that destructors
19170         have the proper signature.
19171
19172 2002-04-26  Martin Baulig  <martin@gnome.org>
19173
19174         * driver.cs (LoadAssembly): If `assembly' contains any characters
19175         which are only valid in path names and not in assembly names
19176         (currently slash, backslash and point), use Assembly.LoadFrom ()
19177         instead of Assembly.Load () on the `assembly' (before iteration
19178         over the link_paths).
19179
19180 2002-04-26  Martin Baulig  <martin@gnome.org>
19181
19182         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19183
19184 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19185
19186         * class.cs (Property): use the new typemanager.MemberLookup
19187
19188         (TypeContainer.MemberLookup): Implement using the
19189         TypeManager.MemberLookup now. 
19190
19191         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19192         and return MemberInfos, so that these can be used without an
19193         EmitContext (what we had before).
19194
19195 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19196
19197         * expression.cs: Fix the case where the argument to params if the
19198         type of the params.  I omitted handling this before.   Fixed
19199
19200 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19201
19202         * driver.cs: Call BootCorlib_PopulateCoreType
19203
19204         * class.cs (Property.CheckBase): Check for properties only, not
19205         for all members. 
19206
19207         * interface.cs: Temporary hack: try/catch around the
19208         CustomAttributeBuilder, because I am getting an exception that I
19209         do not understand.
19210
19211         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19212         types whose definitions are required to be there (attributes are
19213         defined before standard types).
19214
19215         Compute definitions as we boot the various types, as they are used
19216         immediately (value_type class will need object_type, but if we do
19217         not initialize object_type, we will pass a null, which will let
19218         the runtime pick the System.Object from the existing corlib, which
19219         is not what we want).
19220
19221 2002-04-22  Patrik Torstensson <totte@labs2.com>
19222
19223         * cs-tokenizer.cs: fixed a number of trim() issues.
19224
19225 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19226
19227         * expression.cs (Argument.Type): Ensure that we return the correct
19228         type when we have out or ref parameters [in which case we 
19229         append a "&"].
19230
19231 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19232
19233         * class.cs (Property, Indexer): Allow extern modifier in there. 
19234
19235         * typemanager.cs (InitBaseTypes): Initializes object_type and
19236         value_type, since those will be used early on during the bootstrap
19237         process to compile corlib.
19238
19239         (InitCoreTypes): Move code from here to InitBaseTypes.
19240
19241 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19242
19243         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19244         single-dimension arrays as using the ldlen opcode.  
19245
19246         Daniel Lewis discovered this optimization.  
19247
19248         * typemanager.cs: Add signature for System.Array::get_Length
19249
19250 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19251
19252         * statement.cs: report the error when the foreach does not apply to an
19253         array nor a collection.
19254
19255 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19256
19257         * expression.cs: Add implicit conversions to the operator ~.
19258
19259         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19260
19261         * typemanager.cs: Locate the decimal constructor.
19262
19263 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19264
19265         * attribute.cs: use the new property of TypeOf.
19266         * expression.cs: added 'get' property around typearg.
19267
19268         These changes fix a build breaker reported by NickD. Is this the
19269         correct way to fix?  If not, please, revert my changes and make it
19270         work :-).
19271
19272 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19273
19274         * attribute.cs: Add support for typeof in attribute invocations.
19275         I am not sure that this is right though.
19276
19277 2002-04-14  Duncan Mak  <duncan@ximian.com>
19278
19279         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19280         Binary.Operator.Division case.
19281
19282 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19283
19284         * class.cs (DefineType): Ensure that we do a proper check on
19285         attribute types and also register it with the TypeManager.
19286
19287         (TypeContainer.Targets): The default for attribute types is
19288         AttributeTargets.All.
19289
19290         * attribute.cs (ApplyAttributes): Registering the attribute type
19291         is done elsewhere, not when we discover we have a Usage attribute.
19292
19293 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19294
19295         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19296         and get rid of is_delegate parameter.
19297
19298         * everywhere : update.
19299
19300 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19301
19302         * cs-parser.jay (compilation_unit): Revamp completely to use
19303         some new ideas that I got from Rhys' grammar to solve the problems
19304         with assembly level attributes.
19305
19306         (outer_declaration): New grammar production.
19307
19308         (attribute_sections): Add.
19309
19310         (opt_attributes): Base on attribute_sections
19311
19312         (namespace_declaration): Allow opt_attributes to tackle the case
19313         when we have assembly level attributes - we are clever in this
19314         regard now ;-)
19315
19316         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19317         attributes in the non-global context.
19318
19319         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19320         instead of SetGlobalAttributes.
19321
19322         * class.cs, rootcontext.cs : Ensure we define and generate 
19323         attribute types before anything else.
19324
19325         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19326         and flag the new error -20 for the case when the attribute type
19327         does not have valid targets specified. csc does not catch this.
19328
19329         * ../errors/errors.txt : update for error # -20
19330
19331 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19332
19333         * support.cs (InternalParameters.ParameterModifier): Do some null
19334         checking and return sane values.
19335
19336         * class.cs (Method.Define): If we are a PInvoke method, ensure
19337         that we are static and extern. Report error # 601
19338
19339         * ../errors/cs0601.cs : Add test case for the above error.
19340
19341 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19342
19343         * rootcontext.cs (attribute_types): We need to keep type of
19344         all attribute types separately and emit code for them first.
19345
19346         (RegisterAttribute) : Implement.
19347
19348         * class.cs (DefineType): Check if the current Type is a custom
19349         attribute type and register it accordingly.
19350
19351         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19352         adding the first attribute twice and rename to
19353
19354         (SetGlobalAttributes): this.
19355
19356         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19357         lookups.
19358
19359         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19360         if we are processing global arguments. Hmm, I am unsure of this.
19361
19362 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19363
19364         * expression.cs: added static array of strings to avoid calling
19365         Enum.ToString () for Operator in Binary. Significant recover of
19366         performance.
19367
19368 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19369
19370         * class.cs (FindMembers): Allow the Builders of the various
19371         members to be null.  If they are skip them.  This only happens
19372         during the PInvoke declaration.
19373
19374 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19375
19376         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19377         failure, so we do not keep going afterwards.
19378
19379         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19380         wanted to pass `false' as the `is_delegate' argument.  If this is
19381         the case, why not use delegate_type == null to mean `is_delegate =
19382         false' and anything else as is_delegate = true.
19383
19384 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19385
19386         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19387         code for the section, not the beginning of the tests.
19388
19389 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19390
19391         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19392
19393         * expression.cs (Binary): same.  Warn about errors where we have
19394         Enum/Enum in operator + as well.
19395
19396 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19397
19398         * statement.cs:
19399                 - added support for switch(bool)
19400                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19401                 - add TableSwitchEmit() to handle table-based switch statements
19402
19403 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19404
19405         * expression.cs (Invocation.OverloadResolve): Factor out code which
19406         does parameter compatibility checking with arguments so that we can 
19407         re-use the code even from Delegate.VerifyApplicability
19408
19409         (VerifyArgumentsCompat): Move above code here.
19410
19411         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19412         and instead make a call to the above method.
19413
19414 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19415
19416         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19417         We use it to keep track of classes which are attribute types.
19418
19419 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19420
19421         * delegate.cs (Delegate.Define): Correctly define the types in the
19422         presence of fixed and array parameters.
19423
19424         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19425         doing FindMembers.
19426
19427         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19428         include NonPublic after the first iteration.
19429
19430         * class.cs (Indexer.CheckBase): Only check if both parents are
19431         non-null. 
19432
19433         * cs-parser.jay (accessor_body): If empty, set to null.
19434
19435         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19436         same code path here to resolve constants names that we did have in
19437         MemberAccess.DoResolve.  There is too much code duplicated here.
19438
19439 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19440
19441         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19442
19443         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19444         to MakeUnionSet.
19445
19446         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19447         tokens, numbers and strings.
19448
19449         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19450         parenthesis.
19451
19452         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19453         asyncronous parameters and the regular parameters.  
19454
19455         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19456         specify the target directory.
19457
19458         * expression.cs: (This.DoResolve): Simplify
19459         (As.Emit): Optimize, do not generate IsInst if the expression is
19460         always of the given type.
19461
19462         (Is.DoResolve): Bug fix, we were reporting both always/never for
19463         the is expression.
19464
19465         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19466         creating too many unnecessary arrays.
19467
19468 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19469
19470         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19471         fields instead of rolling our own initializer.   Takes care of all
19472         implicit conversions, and drops unnecessary static checks/argument.
19473
19474 2002-03-31  Dick Porter  <dick@ximian.com>
19475
19476         * driver.cs: use the GetDirectories() return values properly, and
19477         use "/" as path separator.
19478
19479 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19480
19481         * expression.cs (Unary): Optimize - - expr into expr.
19482         (Binary): Optimize a + (-b) into a -b.
19483
19484         * codegen.cs (CodeGen): Made all methods static.
19485
19486 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19487
19488         * rootcontext.cs: 
19489
19490         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19491         TypeBuilder property.
19492
19493         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19494         instead. 
19495
19496         * tree.cs: Removed the various RecordXXXX, and replaced with a
19497         single RecordDecl.  Removed all the accessor methods, and just
19498         left a single access point Type 
19499
19500         * enum.cs: Rename DefineEnum to DefineType.
19501
19502         * decl.cs: New abstract method `DefineType' used to unify the
19503         Defines for Enumerations, Interfaces, TypeContainers and
19504         Delegates.
19505
19506         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19507         LookupBaseClasses method that used to live in class.cs and
19508         interface.cs here, and renamed to FindType.
19509
19510         * delegate.cs: Implement DefineType.  Take advantage of the
19511         refactored pattern for locating the parent builder without taking
19512         the parent_builder argument (which we know does not work if we are
19513         nested, and triggering a toplevel definition).
19514
19515 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19516
19517         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19518         accessibility of a member has changed during override and report
19519         an error if so.
19520
19521         * class.cs (Method.Define, Property.Define): Only complain on
19522         overrides if the method is private, any other accessibility is
19523         fine (and since we just checked the permission is the same, we are
19524         good to go).
19525
19526         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19527         and elif are processed always.  The other pre-processing
19528         directives are only processed if we are "taking" the path
19529
19530 2002-03-29  Martin Baulig  <martin@gnome.org>
19531
19532         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19533         current location is not Null.
19534
19535         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19536         a separate method so we can profile it.
19537
19538         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19539         `span.Seconds' are just seconds, but no minutes or hours.
19540         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19541
19542 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19543
19544         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19545         Remove the gratuitous set of Final:
19546
19547                                 // If an interface implementation, then we can set Final.
19548                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19549                                     implementing.DeclaringType.IsInterface)
19550                                         flags |= MethodAttributes.Final;
19551
19552         I do not know what I was smoking when I used that.
19553
19554
19555         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19556         step into fixing the name resolution issues for delegates and
19557         unifying the toplevel name resolution.
19558
19559 2002-03-28  Martin Baulig  <martin@gnome.org>
19560
19561         * class.cs (Method.Emit): If we have a symbol writer, call its
19562         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19563         tell it about the current method.
19564
19565         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19566         writer that we're going to emit the first byte of IL code for a new
19567         statement (a new source line).
19568         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19569         EmitContext.Mark() before emitting any code.
19570
19571         * location.cs (SymbolDocument): Return null when we're Null.
19572
19573         * statement.cs (Statement): Moved the `Location loc' variable here.
19574         (Statement.EmitBoolExpression): If we have a symbol writer, call
19575         ec.Mark() before emitting any code to tell it that we're at the
19576         beginning of a new statement.
19577         (StatementExpression): Added `Location' argument to the constructor.
19578         (Block): Added public readonly variable `StartLocation' and public
19579         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19580         (Block): Added constructor which takes a start and end location.
19581         (Block.SetEndLocation): New method. This sets the end location.
19582         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19583         local variables we create.
19584         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19585         each statement and do also mark the begin and end of the block.
19586
19587         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19588         tell it the current lexer.Location, use Location.Null for the end of the
19589         block.
19590         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19591         current block, set its end location using SetEndLocation().
19592         (statement_expression): StatementExpression constructor now takes the
19593         lexer.Location as additional argument.
19594         (for_statement, declare_local_variables): Likewise.
19595         (declare_local_variables): When creating a new implicit block, use the
19596         new Block constructor and pass it the lexer.Location.
19597
19598 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19599
19600         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19601         members also on the parent interfaces recursively.
19602
19603 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19604
19605         * report.cs: Use new formats, since Gonzalo finished the missing
19606         bits. 
19607
19608         * expression.cs (Binary.ResolveOperator): added missing operator|
19609         operator& and operator^ for bool/bool.
19610
19611         * cs-parser.jay: CheckDef now takes a Location argument that is
19612         used to report errors more precisly (instead of reporting the end
19613         of a definition, we try to track something which is a lot closer
19614         to the source of the problem).
19615
19616         * cs-tokenizer.cs: Track global token use, so we can properly flag
19617         the use of #define/#undef after the first token has been seen.
19618
19619         Also, rename the reportXXXX to Error_DescriptiveName
19620
19621         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19622         TypeContainer, so that Enum and Interface can use this too.
19623
19624         * class.cs (TypeContainer.LookupInterfaceOrClass,
19625         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19626         `builder' argument.  Typically this was used to pass the parent
19627         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19628         the definition).  
19629
19630         The problem is that a nested class could trigger the definition of
19631         a toplevel class, and the builder would be obviously wrong in that
19632         case. 
19633
19634         So we drop this argument, and we compute dynamically the
19635         TypeBuilder/ModuleBuilder (the correct information was available
19636         to us anyways from DeclSpace.Parent)
19637
19638         * interface.cs (Interface.DefineInterface): Drop builder
19639         parameter cleanup like class.cs
19640
19641         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19642         like class.cs
19643
19644         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19645         values. 
19646
19647         (Try.Emit): Propagate the returns value from the statement.
19648
19649         (Return.Emit): Even if we are leavning 
19650
19651         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19652
19653         * modifiers.cs: Fix the computation of MethodAttributes flags.
19654
19655 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19656
19657         * driver.cs: allow compilation of files that start with '/'.
19658         Add a default case when checking the argument of --target.
19659
19660 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19661
19662         * interface.cs: Implement the same search algorithm for types in
19663         the interface code.
19664
19665         * delegate.cs: Do not allow multiple definition.
19666
19667         * Recovered ChangeLog that got accidentally amputated
19668
19669         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19670
19671         * rootcontext.cs: Load manually enum to allow core classes to
19672         contain enumerations.
19673
19674         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19675         Update to new static methods in TypeManager.
19676
19677         * typemanager.cs (GetMethod, GetConstructor): Use our
19678         implementation of FindMembers to find the members, since during
19679         corlib compilation, the types are TypeBuilders and GetMethod and
19680         GetConstructor do not work.
19681
19682         Make all methods in TypeManager static.
19683
19684         (InitCodeHelpers): Split the functionality from
19685         the InitCodeTypes function.
19686
19687         * driver.cs: Call InitCodeHelpers after we have populated the
19688         types. 
19689
19690         * cs-parser.jay (delegate_declaration): we did not used to compute
19691         the delegate name correctly for void delegates.
19692
19693 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19694
19695         * rootcontext.cs (RootContext): Init the interface_resolve_order
19696         and type_container_resolve_order always.
19697
19698         (ResolveCore, BootstrapCorlib_ResolveClass,
19699         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19700         compiler when compiling with --nostdlib
19701
19702         * class.cs (TypeContainer.DefineType): Check that our parent is
19703         not null.  This test is most important when we are bootstraping
19704         the core types.
19705
19706         * codegen.cs: Split out the symbol writing code.
19707
19708 2002-03-25  Martin Baulig  <martin@gnome.org>
19709
19710         * driver.cs (-g): Made -g an alias for --debug.
19711
19712 2002-03-24  Martin Baulig  <martin@gnome.org>
19713
19714         * codegen.cs (SymbolWriter): New public variable. Returns the
19715         current symbol writer.
19716         (CodeGen): Added `bool want_debugging_support' argument to the
19717          constructor. If true, tell the ModuleBuild that we want debugging
19718         support and ask it for the ISymbolWriter.
19719         (Save): If we have a symbol writer, call it's Close() method after
19720         saving the assembly.
19721
19722         * driver.c (--debug): New command line argument to create a
19723         debugger information file.
19724
19725         * location.cs (SymbolDocument): New public property. Returns an
19726         ISymbolDocumentWriter object for the current source file or null
19727         if we don't have a symbol writer.
19728
19729 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19730
19731         * driver.cs (LoadAssembly): Correctly return when all the paths
19732         have been tried and not before.
19733
19734         * statement.cs (Switch.Emit): return the actual coverage for this
19735         statement (returns/not-returns)
19736
19737         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19738         switch of the statement if we are the last switch section.  That
19739         kills two problems: try/catch problems (we used to emit an empty
19740         nop at the end) and switch statements where all branches would
19741         return. 
19742
19743 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19744
19745         * driver.cs: Add default assemblies (the equivalent to the
19746         Microsoft CSC.RSP file)
19747
19748         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19749         also update tokens_seen and set it to false.
19750
19751         * driver.cs: Implement --recurse for Mike.
19752
19753         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19754         correctly splitting out the paths.
19755
19756 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19757
19758         * interface.cs (Interface.PopulateProperty): Instead of using
19759         `parent' as the declaration space for the set parameters, use
19760         `this' 
19761
19762         * support.cs (InternalParameters): InternalParameters constructor
19763         takes a DeclSpace instead of a TypeContainer.
19764
19765         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19766         types are being initialized, load the address of it before calling
19767         the function.  
19768
19769         (New): Provide a mechanism to disable the generation of local
19770         value type temporaries when the caller will be providing us with
19771         an address to store it.
19772
19773         (ArrayCreation.EmitDynamicInitializers): Use it.
19774
19775 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19776
19777         * expression.cs (Invocation.EmitArguments): Only probe for array
19778         property if there is more than one argument.  Sorry about that.
19779
19780         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19781         empty param arrays.
19782
19783         * class.cs (Method.LabelParameters): Fix incorrect code path that
19784         prevented the `ParamArrayAttribute' from being applied to the
19785         params attribute.
19786
19787 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19788
19789         * support.cs (ReflectionParameters): Correctly compute whether the
19790         last argument is a params array.  Fixes the problem with
19791         string.Split ('a')
19792
19793         * typemanager.cs: Make the assemblies array always be non-null
19794         (empty, but non-null)
19795
19796         * tree.cs (RecordDecl): New function that abstracts the recording
19797         of names.  This reports error 101, and provides a pointer to the
19798         previous declaration.  Fixes a crash in the compiler.
19799
19800         * cs-parser.jay (constructor_declaration): Update to new grammar,
19801         and provide a constructor_body that can be empty.
19802
19803 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19804
19805         * driver.cs: Add support for --resources.
19806
19807         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19808         Make all types for the various array helper methods be integer.
19809
19810         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19811         CheckState to ConvCast.
19812
19813         (ConvCast): Now it takes a `checked' state argument, to avoid
19814         depending on the emit context for the conversion, and just using
19815         the resolve time setting.
19816
19817         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19818         instead of Invocation.EmitArguments.  We do not emit the original
19819         arguments, instead we emit those which have been converted to
19820         unsigned int expressions.
19821
19822         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19823
19824         * codegen.cs: ditto.
19825
19826         * expression.cs (LocalVariableReference): Drop the use of the
19827         Store function that depended on the variable index.
19828
19829         * statement.cs (VariableInfo): Drop the `Idx' property from this
19830         class, as this is not taking into account the indexes for
19831         temporaries tat we generate during the execution, getting the
19832         indexes wrong.
19833
19834         * class.cs: First emit class initializers, then call the parent
19835         constructor. 
19836
19837         * expression.cs (Binary): Fix opcode emision.
19838         (UnaryMutator.EmitCode): Support checked code generation
19839
19840         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19841         matches for events for both the Static and Instance scans,
19842         pointing to the same element.   Fix that.
19843
19844 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19845
19846         * rootcontext.cs (ResolveTree): Always set the
19847         interface_resolve_order, because nested interfaces will be calling
19848         into us.
19849
19850         * class.cs (GetInterfaceOrClass): Track the same resolution
19851         process used by TypeManager.LookupType.  This fixes the nested
19852         type lookups in class declarations (separate path from
19853         LookupType). 
19854
19855         (TypeContainer.DefineType): Also define nested interfaces.
19856         (TypeContainer.RegisterOrder): New public function used to
19857         register the order in which child interfaces need to be closed.
19858
19859         Nested interfaces need to be closed after their parents have been
19860         created. 
19861
19862         * interface.cs (InterfaceAttr): Put all the logic for computing
19863         the interface attribute here. 
19864
19865         (DefineInterface): Register our interface order with the
19866         RootContext or with the TypeContainer depending on the case.
19867
19868 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19869
19870         * cs-parser.jay: rework foreach statement to work with the new
19871         changes to the policy on SimpleNames.
19872
19873         * report.cs: support Stacktrace on warnings as well.
19874
19875         * makefile: drop --unsafe and /unsafe from the compile.
19876
19877 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19878
19879         * ecore.cs (StandardConversionExists): Modify to take an Expression
19880         as the first parameter. Ensure we do null -> reference type conversion
19881         checking.
19882
19883         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19884         temporary Expression objects.
19885
19886 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19887
19888         * interface.cs: workaround bug in method overloading resolution
19889         (there is already a bugzilla bug for it).
19890
19891 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19892
19893         We could also solve this problem by having a separate path for
19894         performing type lookups, instead of DoResolve, we could have a
19895         ResolveType entry point, and only participating pieces of the
19896         production (simplename, deref, array) would implement this. 
19897
19898         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19899         signal SimpleName to only resolve type names and not attempt to
19900         resolve anything else.
19901
19902         * expression.cs (Cast): Set the flag.
19903
19904         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19905
19906         * class.cs: Only report 108 if there is no `new' modifier.
19907
19908         * cs-parser.jay: rework foreach statement to work with the new
19909         changes to the policy on SimpleNames.
19910
19911         * report.cs: support Stacktrace on warnings as well.
19912
19913         * makefile: drop --unsafe and /unsafe from the compile.
19914
19915 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19916
19917         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19918         lookups here, instead of doing that at parse time.  This means
19919         that our grammar will not introduce `LocalVariableReferences' as
19920         expressions at this point.  That solves the problem of code like
19921         this:
19922
19923         class X {
19924            static void Main ()
19925            { int X = 1;
19926             { X x = null }}}
19927
19928         This is only half the fix.  The full fix requires parameters to
19929         also be handled in this way.
19930
19931         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19932         makes the use more obvious of the DeclSpace.  The
19933         ec.TypeContainer.TypeBuilder is now only used to pull the
19934         TypeBuilder for it.
19935
19936         My theory is that I can get rid of the TypeBuilder completely from
19937         the EmitContext, and have typecasts where it is used (from
19938         DeclSpace to where it matters).  
19939
19940         The only pending problem is that the code that implements Aliases
19941         is on TypeContainer, and probably should go in DeclSpace.
19942
19943         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19944         lookups here, instead of doing that at parse time.  This means
19945         that our grammar will not introduce `LocalVariableReferences' as
19946         expressions at this point.  That solves the problem of code like
19947         this:
19948
19949         class X {
19950            static void Main ()
19951            { int X = 1;
19952             { X x = null }}}
19953
19954         This is only half the fix.  The full fix requires parameters to
19955         also be handled in this way.
19956
19957         * class.cs (Property.DefineMethod): When implementing an interface
19958         method, set newslot, when implementing an abstract method, do not
19959         set the flag (before we tried never setting it, or always setting
19960         it, which is the difference).
19961         (Indexer.DefineMethod): same.
19962         (Method.DefineMethod): same.
19963
19964         * ecore.cs: Only set the status used flag if we get back a Field.
19965
19966         * attribute.cs: Temporary hack, so Paolo can keep working.
19967
19968 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19969
19970         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19971         the unmanaged type in the case we have a MarshalAs attribute.
19972
19973         (Resolve): Handle the case when we are parsing the special MarshalAs
19974         attribute [we need to store the unmanaged type to use later]
19975
19976         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19977         MarshalAs Attribute.
19978
19979         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19980         on parameters and accordingly set the marshalling info.
19981
19982 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19983
19984         * class.cs: Optimizing slightly by removing redundant code after
19985         we switched to the `NoTypes' return value.
19986         (Property.DefineMethod): use NoTypes here too.
19987
19988         This fixes the bug I introduced in my last batch of changes.
19989
19990 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19991
19992         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19993
19994         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19995         Enums since those are types too. 
19996
19997         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19998
19999         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20000         thanks to a call during the lookup process.
20001
20002 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20003
20004         * statement.cs (Foreach): Lots of work to accomodate a particular
20005         kind of foreach statement that I had not kept in mind.  It is
20006         possible to have foreachs on classes that provide a GetEnumerator
20007         method that return objects that implement the "pattern" for using
20008         a foreach, there is no need to support GetEnumerator
20009         specifically. 
20010
20011         This is needed to compile nant.
20012
20013         * decl.cs: Only report 114 if the member is not `Finalize' and if
20014         the warning level is at least 2.
20015
20016         * class.cs: Moved the compare function from Method to
20017         MethodSignature. 
20018
20019         (MethodSignature.InheritableMemberSignatureCompare): Add new
20020         filter function that is used to extract inheritable methods from a
20021         class. 
20022
20023         (Method.Define): Use the new `inheritable_method_signature_filter'
20024         delegate
20025
20026         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20027         command. 
20028
20029 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20030
20031         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20032
20033         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20034
20035         * expression.cs: Pass location information to
20036         ConvertImplicitStandard. 
20037
20038         * class.cs: Added debugging code to track return values from
20039         interfaces. 
20040
20041 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20042
20043         * expression.cs (Is.DoResolve): If either side of the `is' is an
20044         interface, do not flag the warning.
20045
20046         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20047         for interfaces
20048
20049         * report.cs: Allow for --fatal to be used with --probe.
20050
20051         * typemanager.cs (NoTypes): Move the definition for the empty Type
20052         array here. 
20053
20054         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20055         properties. 
20056         (TypeContainer.DefineProxy): New function used to proxy to parent
20057         implementations when implementing interfaces.
20058         (TypeContainer.ParentImplements): used to lookup if our parent
20059         implements a public function that is required by an interface.
20060         (TypeContainer.VerifyPendingMethods): Hook this up.
20061
20062         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20063         `modules' and `assemblies' arraylists into arrays.  We only grow
20064         these are the very early start up of the program, so this improves
20065         the speedof LookupType (nicely measured).
20066
20067         * expression.cs (MakeByteBlob): Replaced unsafe code with
20068         BitConverter, as suggested by Paolo.
20069
20070         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20071         folding of string concatenation, but if either side is a string,
20072         and the other is not, then return null, and let the runtime use
20073         the concatenation on the string plus the object (using
20074         `Object.ToString'). 
20075
20076 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20077
20078         Constant Folding has been implemented now.
20079
20080         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20081         the error instead on types that are not supported in one's
20082         complement. 
20083
20084         * constant.cs (Constant and all children): New set of functions to
20085         perform implict and explicit conversions.
20086
20087         * ecore.cs (EnumConstant): Implement the new functions to perform
20088         conversion by proxying to the child expression.
20089
20090         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20091         own separate setting that can not be turned off from the command
20092         line using --unchecked or --checked and is only controlled using
20093         the checked/unchecked statements and expressions.  This setting is
20094         used by the constant folder to flag errors.
20095
20096         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20097         ConstantCheckState as well.   
20098
20099         During Resolve, they also have to flag the state, because the
20100         constant folder runs completely in the Resolve phase.
20101
20102         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20103         well.
20104
20105 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20106
20107         * cfold.cs: New file, this file contains the constant folder.
20108
20109         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20110         argument to track whether we are using the resulting address to
20111         load or store a value and provide better error messages. 
20112
20113         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20114         new AddressOf arguments.
20115
20116         * statement.cs (Foreach.EmitCollectionForeach): Update
20117
20118         * expression.cs (Argument.Emit): Call AddressOf with proper
20119         arguments to track usage.
20120
20121         (New.DoEmit): Call AddressOf with new arguments.
20122
20123         (Unary.Emit): Adjust AddressOf call.
20124
20125 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20126
20127         * cs-parser.jay (member_access): Change the case for pre-defined types
20128         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20129         this suggestion.
20130
20131         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20132         a method body.
20133
20134         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20135         essentially like methods and apply attributes like MethodImplOptions to them too.
20136
20137         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20138         not being null.
20139
20140         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20141         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20142         is the DeclSpace.
20143
20144         * Update code everywhere accordingly.
20145
20146         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20147
20148         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20149
20150 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20151
20152         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20153         try performing lookups against those instead of jumping straight into using
20154         the 'using' clauses.
20155
20156         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20157
20158         (LookupType): Perform lookups in implicit parents too.
20159
20160         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20161         sequence as RootContext.LookupType. 
20162
20163         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20164         the various cases of namespace lookups into this method.
20165
20166 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20167
20168         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20169         in positional arguments)
20170
20171         * class.cs (Operator): Update the AllowedModifiers to contain
20172         extern. 
20173
20174         * cs-parser.jay: Update operator declaration to allow for the
20175         operator body to be empty.
20176
20177         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20178         values. 
20179
20180 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20181
20182         * class.cs (Method.Emit): Label parameters.
20183
20184         * driver.cs: Return 1 or 0 as the program exit code.
20185
20186 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20187
20188         * expression.cs: Special case the `null' object when trying to
20189         auto-compute the type, as anything can be explicitly converted to
20190         that. 
20191
20192         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20193         spotting this Paolo.
20194
20195         (Expression.ImplicitNumericConversion): Perform comparissions of
20196         the type using the underlying type in the case of an enumeration
20197         rather than using the enumeration type for the compare.
20198
20199         Cope with the underlying == type case, which is not possible to
20200         catch before. 
20201
20202         (Expression.ConvertNumericExplicit): Perform comparissions of
20203         the type using the underlying type in the case of an enumeration
20204         rather than using the enumeration type for the compare.
20205
20206         * driver.cs: If the user does not supply an extension, assume .exe
20207
20208         * cs-parser.jay (if_statement): Rewrote so that we can track the
20209         location for the if statement.
20210
20211         * expression.cs (Binary.ConstantFold): Only concat strings when
20212         the operation is "+", not everything ;-)
20213
20214         * statement.cs (Statement.EmitBoolExpression): Take a location
20215         argument. 
20216         (If, While, Do): Track location.
20217
20218         * expression.cs (Binary.ResolveOperator): In the object + string
20219         case, I was missing a call to ConvertImplicit
20220
20221 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20222
20223         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20224         Location arguments. Ensure we use RootContext.LookupType to do our work
20225         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20226
20227         * interface.cs (PopulateMethod): Handle the type of the parameter being
20228         null gracefully.
20229
20230         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20231         have a params method with no fixed arguments and a call is made with no
20232         arguments.
20233
20234 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20235
20236         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20237         the verbatim-string-literal
20238
20239         * support.cs (InternalParameters.ParameterModifier): handle null
20240         fixed parameters.
20241         (InternalParameters.ParameterType): ditto.
20242
20243         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20244         duplicating the name of the variable parameter.
20245         (GetParameterByName): Fix bug where we were not looking up array
20246         paramters if they were the only present (thanks Paolo!).
20247         (GetParameterInfo): We only have an empty set of types if both
20248         fixed and array are set to null.
20249         (GetParameterInfo-idx): Handle FixedParameter == null
20250
20251         * cs-parser.jay: Handle the case where there is no catch
20252         statements (missing null test).
20253
20254 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20255
20256         * driver.cs (MainDriver): Be conservative on our command line
20257         handling.
20258
20259         Catch DirectoryNotFoundException when calling GetFiles.
20260
20261         (SplitPathAndPattern): Used to split the input specification into
20262         a path and a pattern that we can feed to Directory.GetFiles.
20263
20264 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20265
20266         * statement.cs (Fixed): Implement the last case of the Fixed
20267         statement (string handling).
20268
20269         * expression.cs (StringPtr): New class used to return a char * to
20270         a string;  Used by the Fixed statement.
20271
20272         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20273
20274         * expression.cs (Binary.ResolveOperator): Remove redundant
20275         MemberLookup pn parent type.
20276         Optimize union call, we do not need a union if the types are the same.
20277         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20278         type.
20279
20280         Specialize the use of MemberLookup everywhere, instead of using
20281         the default settings. 
20282
20283         (StackAlloc): Implement stackalloc keyword.
20284
20285         * cs-parser.jay: Add rule to parse stackalloc.
20286
20287         * driver.cs: Handle /h, /help, /?
20288
20289         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20290         before we supported unsafe code.
20291
20292         * makefile: add --unsafe to the self compilation of mcs.
20293
20294 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20295
20296         * expression.cs (PointerArithmetic): New class that is used to
20297         perform pointer arithmetic.
20298         (Binary.Resolve): Handle pointer arithmetic
20299         Handle pointer comparission.
20300         (ArrayPtr): Utility expression class that is used to take the
20301         address of an array.
20302
20303         (ElementAccess): Implement array access for pointers
20304
20305         * statement.cs (Fixed): Implement fixed statement for arrays, we
20306         are missing one more case before we are done.
20307
20308         * expression.cs (Indirection): Implement EmitAssign and set the
20309         ExprClass to Variable.  This allows pointer dereferences to be
20310         treated as variables, and to have values assigned to them.
20311
20312         * ecore.cs (Expression.StoreFromPtr): New utility function to
20313         store values dereferencing.
20314
20315 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20316
20317         * expression.cs (Binary.ResolveOperator): Ensure that we are
20318         not trying to operate on a void type - this fixes the reported
20319         bug.
20320
20321         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20322         the parent implementation is sealed.
20323
20324         * ../errors/cs0239.cs : Add.
20325
20326         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20327
20328         * typemanager.cs (unverifiable_code_type): Corresponds to 
20329         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20330         which have unsafe code in them.
20331
20332         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20333         unsafe context.
20334
20335 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20336
20337         * cs-tokenizer.cs: Add support for @"litreal strings"
20338
20339         Make tokenizer accept pre-processor directives
20340         on any column (remove the old C-like limitation). 
20341
20342         * rootcontext.cs (EmitCode): Emit any global attributes.
20343         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20344
20345         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20346
20347         * cs-parser.jay: Add support for global attributes.  
20348
20349 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20350
20351         * expression.cs (Indirection): New helper class.  Unary will
20352         create Indirection classes to be able to implement the
20353         IMemoryLocation interface on it.
20354
20355 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20356
20357         * cs-parser.jay (fixed_statement): reference the right statement.
20358
20359         * statement.cs (Fixed.Emit): Finish implementing the fixed
20360         statement for the &x case.
20361
20362 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20363
20364         * class.cs (Property.Define, Method.Define): Remove newslot when
20365         `implementing'.  
20366
20367         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20368         wrong.  NewSlot should only be used if the `new' keyword is present.
20369
20370         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20371         locating our system dir.  Sorry about this.
20372
20373 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20374
20375         * driver.cs (GetSystemDir): Compute correctly the location of our
20376         system assemblies.  I was using the compiler directory instead of
20377         the library directory.
20378
20379 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20380
20381         * expression.cs (BetterFunction): Put back in what Miguel commented out
20382         since it is the correct fix. The problem is elsewhere ;-)
20383
20384         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20385         parameters of the parms method are themselves compatible or not !
20386
20387         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20388         to check that a class implements an interface before saying that an implicit
20389         conversion was allowed. Use ImplementsInterface to do the checking.
20390
20391 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20392
20393         * class.cs (Method.Define): Track whether we are an explicit
20394         implementation or not.  And only call DefineMethodOverride if we
20395         are an explicit implementation.
20396
20397         (Property.DefineMethod): Ditto.
20398
20399 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20400
20401         * expression.cs (BetterFunction): Catch hideous bug which was
20402          preventing us from detecting ambiguous calls due to implicit casts i.e
20403         cs0121.
20404
20405 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20406
20407         * support.cs (Pair): Remove un-needed method.  I figured why I was
20408         getting the error in cs-parser.jay, the variable in a foreach loop
20409         is readonly, and the compiler does not really treat this as a variable.
20410
20411         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20412         instead of EQUALS in grammar.  
20413
20414         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20415
20416         * expression.cs (Unary.DoResolve): Check whether the argument is
20417         managed or not.
20418
20419 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20420
20421         * support.cs: Api for Pair to set a value.  Despite the fact that
20422         the variables are public the MS C# compiler refuses to compile
20423         code that accesses the field if the variable is part of a foreach
20424         statement. 
20425
20426         * statement.cs (Fixed): Begin implementation of the fixed
20427         statement.
20428
20429         (Block.AddVariable): Return the VariableInfo on success and null
20430         on failure instead of true/false. 
20431
20432         * cs-parser.jay (foreach): Catch errors on variables already
20433         defined (we were ignoring this value before) and properly unwind
20434         the block hierarchy
20435
20436         (fixed_statement): grammar for the fixed statement.
20437
20438 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20439
20440         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20441         pointer types to be incretemented.
20442
20443         (SizeOf): Implement.
20444
20445         * cs-parser.jay (pointer_member_access): Implement
20446         expr->IDENTIFIER production.
20447
20448         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20449         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20450         on safe contexts.
20451
20452         (Unary): Implement indirection.
20453
20454         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20455         use in non-unsafe context).
20456
20457         (SimpleName.DoResolve): Check for pointers in field access on safe
20458         contexts. 
20459
20460         (Expression.LoadFromPtr): Factor the load-indirect code in this
20461         function.  This was duplicated in UnboxCast and ParameterReference
20462
20463 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20464
20465         * expression.cs (ComposedCast): report an error if a pointer cast
20466         is used in a safe region.
20467
20468         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20469         pointer type casts in unsafe context.
20470
20471         * codegen.cs (EmitContext): Set up IsUnsafe.
20472
20473         * cs-parser.jay (non_expression_type): Add productions for pointer
20474         casts. 
20475
20476         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20477         code.  We should not use force into static mode if the method is
20478         not virtual.  Fixes bug in MIS
20479
20480         * statement.cs (Do.Emit, While.Emit, For.Emit,
20481         Statement.EmitBoolExpression): Add support to Do and While to
20482         propagate infinite loop as `I do return' semantics.
20483
20484         Improve the For case to also test for boolean constants.
20485
20486         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20487         to the list of attributes we can add.
20488
20489         Remove `EmitContext' argument.
20490
20491         * class.cs (Method.Define): Apply parameter attributes.
20492         (Constructor.Define): Apply parameter attributes.
20493         (MethodCore.LabelParameters): Move here the core of labeling
20494         parameters. 
20495
20496         * support.cs (ReflectionParameters.ParameterModifier,
20497         InternalParameters.ParameterModifier): Use IsByRef on the type and
20498         only return the OUT bit for these parameters instead of in/out/ref
20499         flags.
20500
20501         This is because I miss-understood things.  The ParameterInfo.IsIn
20502         and IsOut represent whether the parameter has the [In] and [Out]
20503         attributes set.  
20504
20505 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20506
20507         * ecore.cs (FieldExpr.Emit): Release temporaries.
20508
20509         * assign.cs (LocalTemporary.Release): new function.
20510
20511         * codegen.cs (EmitContext.GetTemporaryStorage,
20512         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20513         temporary storage.  Now we can "put back" localbuilders when we
20514         are done with them
20515
20516 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20517
20518         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20519         need to make a copy of the variable to generate verifiable code.
20520
20521 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20522
20523         * driver.cs: Compute dynamically the system directory.
20524
20525         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20526         Slower, but more generally useful.  Used by the abstract
20527         registering implementation. 
20528
20529         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20530         the rules for the special rule on Type/instances.  First check if
20531         we have the same name, and if so, try that special static path
20532         rather than the instance path.
20533
20534 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20535
20536         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20537         for, while and if.
20538
20539         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20540         Enum, ValueType, Delegate or Array for non-corlib compiles.
20541
20542         * cs-tokenizer.cs: Catch long identifiers (645)
20543
20544         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20545         piece of code.
20546
20547         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20548         fix, we were returning too early, so we were not registering
20549         pending methods from abstract classes.
20550
20551         Do not register pending methods if the class is abstract.
20552
20553         * expression.cs (Conditional.DoResolve): Report circular implicit
20554         conversions when we neecd to compute it for conditional
20555         expressions. 
20556
20557         (Is.DoResolve): If the expression is always of the provided type,
20558         flag warning 183.  If the expression can not ever be of the
20559         provided type flag warning 184.
20560
20561         * class.cs: Catch 169 as well.
20562
20563         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20564         read. 
20565
20566 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20567
20568         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20569
20570 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20571
20572         * interface.cs: (PopulateMethod): Check for pointers being defined
20573         only if the unsafe context is active.
20574         (PopulateProperty): ditto.
20575         (PopulateIndexer): ditto.
20576
20577         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20578         specified.  If pointers are present, make sure that they are
20579         present in an unsafe context.
20580         (Constructor, Constructor.Define): ditto.
20581         (Field, Field.Define): ditto.
20582         (Property, Property.Define): ditto.
20583         (Event, Event.Define): ditto.
20584
20585         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20586         hashtable if there are classes or structs defined.
20587
20588         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20589         code, as the constant resolution moved.
20590
20591         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20592         the metadata, so we can flag error 133. 
20593
20594         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20595         pointer is being declared in an unsafe context.
20596
20597 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20598
20599         * modifiers.cs (Modifiers.Check): Require a Location argument.
20600         Report error 227 for Unsafe use.
20601
20602         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20603
20604         * statement.cs (For.Emit): If the test is null, then report that
20605         we do `return', as we wont reach anything afterwards.
20606
20607         (Switch.SwitchGoverningType): Track the expression that matched
20608         the conversion.
20609
20610         * driver.cs: Allow negative numbers as an error code to flag.
20611
20612         * cs-parser.jay: Handle 1551.
20613
20614         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20615
20616 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20617
20618         * cs-parser.jay: Report 1518 (type declaration can only contain
20619         class, struct, interface, enum or delegate)
20620
20621         (switch_label): Report 1523 (keywords `case' or `default' must
20622         preced code)
20623
20624         (opt_switch_sections): Report 1522 (empty switch)
20625
20626         * driver.cs: Report 1515 (response file specified multiple times)
20627         Report 1516 (Source file specified multiple times).
20628
20629         * expression.cs (Argument.Resolve): Signal 1510
20630
20631         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20632         access not allowed in static code)
20633
20634 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20635
20636         * typemanager.cs (IsPointerType): Utility method which we are going
20637         to need a lot.
20638
20639         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20640         the object type, so we take care of that.
20641
20642         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20643
20644         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20645         added to non-params parameters :-)
20646
20647         * typemanager.cs (CSharpName): Include 'void' type too. 
20648
20649         (void_ptr_type): Include in the set of core types.
20650
20651         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20652         duplicating code.
20653
20654         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20655         an unsafe context.
20656
20657         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20658         completely forgotten about it.
20659
20660 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20661
20662         * cs-parser.jay (pointer_type): Add. This begins our implementation
20663         of parsing rules for unsafe code.
20664
20665         (unsafe_statement): Implement.
20666
20667         (embedded_statement): Modify to include the above.
20668
20669         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20670
20671         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20672         if the current context is an unsafe one.
20673
20674         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20675         are handled differently, we need separate rules for them.
20676
20677         (local_variable_declaration): Update to use local_variable_pointer_type
20678         to allow variable declarations of unmanaged pointer types.
20679
20680         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20681         in unsafe contexts.
20682
20683         * ../errors/cs0214.cs : Add.
20684
20685 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20686
20687         * makefile: remove 'response' file when cleaning.
20688
20689 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20690
20691         * cs-parser.jay: Report 1524.
20692
20693 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20694
20695         * typemanager.cs (RegisterMethod): drop checking if we have
20696         registered this from here
20697
20698 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20699
20700         * class.cs (Method.EmitDestructor): Implement calling our base
20701         destructor. 
20702
20703         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20704         value of InFinally.
20705
20706         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20707         this routine and will wrap the call in a try/catch block.  Deal
20708         with the case.
20709
20710 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20711
20712         * ecore.cs (Expression.MemberLookup): instead of taking a
20713         parameter `same_type' that was used to tell whether we could
20714         access private members we compute our containing type from the
20715         EmitContext.
20716
20717         (FieldExpr): Added partial support for volatile fields.  This does
20718         not work for volatile fields exposed from assemblies, as I can not
20719         figure out how to extract the modreq from it.
20720
20721         Updated all the source files to use this.
20722
20723         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20724         because it is referenced by MemberLookup very often. 
20725
20726 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20727
20728         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20729         TypeBuilder.GetCustomAttributes to retrieve what we need.
20730
20731         Get rid of redundant default_member_attr_type as this is the same as
20732         default_member_type which already exists.
20733
20734         * interface.cs, attribute.cs : Update accordingly.
20735
20736 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20737
20738         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20739         work for TYpeBuilders though.  Ravi, can you please fix this?
20740
20741         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20742
20743         * expression.cs (Argument.Emit): Handle the case of ref objects
20744         being passed to ref functions;  
20745
20746         (ParameterReference.EmitLoad): Loads the content of the pointer
20747         without dereferencing.
20748
20749 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20750
20751         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20752
20753 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20754
20755         * class.cs (Indexer.DefineMethod): Incorporate the interface
20756         type in the name of the method if we are doing explicit interface
20757         implementation.
20758
20759         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20760
20761         (BetterConversion): Fix extremely trivial bug where we were referring to
20762         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20763         again !
20764
20765         * ../errors/bug16.cs : Add although we have fixed it.
20766
20767 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20768
20769         * expression.cs (BaseIndexer): Begin implementation.
20770
20771         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20772
20773         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20774         production directly to remove a shift/reduce, and implement
20775         explicit interface implementation.
20776
20777         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20778         after a floating point suffix.
20779
20780         * expression.cs (DoNumericPromotions): Improved the conversion for
20781         uint/uint.  If we have a constant, we avoid doing a typecast to a
20782         larger type.
20783
20784         * class.cs (Indexer): Implement explicit interface implementation
20785         for indexers.
20786
20787 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20788
20789         * class.cs: make the default instance constructor public and hidebysig.
20790
20791 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20792
20793         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20794         so we can call it from elsewhere.
20795
20796         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20797         we emit it internally if the class has a defined indexer; otherwise the user
20798         emits it by decorating the class definition with the DefaultMemberAttribute.
20799
20800         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20801         attribute is not used on a type which defines an indexer.
20802
20803         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20804         character when we skip whitespace.
20805
20806         * ../errors/cs0646.cs : Add.
20807
20808 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20809
20810         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20811         again. 
20812
20813         * makefile: Add practical target `mcs3.exe' which builds the third
20814         generation compiler. 
20815
20816         * expression.cs (New): Fix structures constructor calling.
20817
20818         * class.cs (Property, Method, Indexer): Emit Final flag on the
20819         method if we are an interface implementation and we are not
20820         abstract. 
20821
20822         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20823         whether this property is referencing a `base' method.
20824
20825         * expression.cs (Invocation.EmitCall): take an extra argument:
20826         is_base, this is used to determine whether the `call' or
20827         `callvirt' opcode should be used.
20828
20829
20830         * delegate.cs: update EmitCall.
20831
20832         * class.cs (Method.Define): Set NewSlot for the cases where we are
20833         not implementing an interface method.
20834
20835         (Property.Define): ditto.
20836
20837 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20838
20839         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20840         'r'.  Allows mcs to parse itself fully.
20841
20842 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20843
20844         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20845         of the number of initializers that require the InitializeArray method.
20846
20847         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20848         update the above field where necessary.
20849
20850         (MakeByteBlob): Update accordingly.
20851
20852         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20853         greater than 2.
20854
20855         (EmitDynamicInitializers): Update in accordance with the new optimization.
20856
20857         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20858         same OpCode applies.
20859
20860         * cs-parser.jay : Fix some glaring errors I introduced.
20861
20862 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20863
20864         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20865         so that we can check for name clashes there too.
20866
20867         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20868         for interface indexers.
20869
20870         * interfaces.cs (Define): Emit the default member attribute.
20871
20872         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20873         variable was being referred to while setting the value ;-)
20874
20875 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20876
20877         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20878         byte-by-byte information when we know the data is zero.
20879
20880         Make the block always a multiple of 4, because
20881         DefineInitializedData has a bug.
20882
20883         * assign.cs: Fix, we should assign from the temporary, not from
20884         the source. 
20885
20886         * expression.cs (MakeByteBlob): Fix my incorrect code.
20887
20888 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20889
20890         * typemanager.cs (EnumToUnderlying): This function is used to get
20891         the underlying type from an enumeration, because it does not
20892         always work. 
20893
20894         * constant.cs: Use the I4_S form for values between -128 and 127.
20895
20896         * statement.cs (Block.LookupLabel): Looks up a label.
20897         (Block): Drop support for labeled blocks.
20898
20899         (LabeledStatement): New kind of statement that represents a label
20900         only.
20901
20902         (Goto): Finally implement this bad boy.
20903
20904         * cs-parser.jay: Update to reflect new mechanism to implement
20905         labels.
20906
20907 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20908
20909         * codegen.cs (EmitContext.This): a codegen property that keeps the
20910         a single instance of this instead of creating many different this
20911         instances. 
20912
20913         * delegate.cs (Delegate.DoResolve): Update to use the property;
20914
20915         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20916
20917         * expression.cs (BaseAccess.DoResolve): Ditto.
20918
20919 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20920
20921         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20922         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20923
20924         (InitCoreTypes): Update accordingly.
20925
20926         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20927         so we can quickly store the state.
20928
20929         (ApplyAttributes): Set the correct implementation flags
20930         for InternalCall methods.
20931
20932 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20933
20934         * expression.cs (EmitCall): if a method is not virtual, then do
20935         not use callvirt on it.
20936
20937         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20938         user defined stuff) requires the use of stobj, which takes an
20939         address on the stack instead of an array and an index.  So emit
20940         the Ldelema operation for it.
20941
20942         (EmitStoreOpcode): Use stobj for valuetypes.
20943
20944         (UnaryMutator.EmitCode): Use the right 1 value depending on
20945         whether we are dealing with int64/uint64, float or doubles.
20946
20947         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20948         constructors that I implemented last night.
20949
20950         (Constructor.IsDefault): Fix to work properly for static
20951         constructors.
20952
20953         * cs-parser.jay (CheckDef): report method signature errors.
20954         Update error number 103 to be 132.
20955
20956         * decl.cs: New AdditionResult enumeration value: MethodExists.
20957         Although we do this check for methods later on in the semantic
20958         analysis, catching repeated default constructors is so easy that
20959         we catch these here. 
20960
20961         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20962         promotions code.
20963
20964         (ParameterReference.EmitAssign, Emit): handle
20965         bools as bytes.
20966
20967         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20968         (ArrayAccess.EmitStoreOpcode): ditto.
20969
20970         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20971
20972         * expression.cs (MakeByteBlob): Complete all the missing types
20973         (uint, short, ushort, byte, sbyte)
20974
20975         * class.cs: Only init instance field initializers on instance
20976         constructors. 
20977
20978         Rename `constructors' to instance_constructors. 
20979
20980         (TypeContainer.AddConstructor): Only add constructors to the list
20981         if it is not static.
20982
20983         Make sure that we handle default_static_constructor independently
20984         everywhere where we handle instance_constructors
20985
20986 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20987
20988         * class.cs: Do not lookup or create a base initializer for a
20989         static constructor.
20990
20991         (ConstructorInitializer.Resolve): use the proper type to lookup
20992         for constructors.
20993
20994         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20995
20996         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20997         in DeclSpace. 
20998
20999         * decl.cs: CloseType is now an virtual method, the default
21000         implementation just closes this type.
21001
21002 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21003
21004         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21005         to PreserveSig by default. Also emit HideBySig on such methods.
21006
21007         Basically, set the defaults to standard values.
21008
21009         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21010         argument, if candidate is better, it can't be worse than the best !
21011
21012         (Invocation): Re-write bits to differentiate between methods being
21013         applicable in their expanded form and their normal form - for params
21014         methods of course.
21015
21016         Get rid of use_standard everywhere as only standard conversions are allowed
21017         in overload resolution. 
21018
21019         More spec conformance.
21020
21021 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21022
21023         * driver.cs: Add --timestamp, to see where the compiler spends
21024         most of its time.
21025
21026         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21027         `this' in static code.
21028
21029         (SimpleName.DoResolve): Implement in terms of a helper function
21030         that allows static-references to be passed upstream to
21031         MemberAccess.
21032
21033         (Expression.ResolveWithSimpleName): Resolve specially simple
21034         names when called by MemberAccess to implement the special
21035         semantics. 
21036
21037         (Expression.ImplicitReferenceConversion): Handle conversions from
21038         Null to reference types before others, as Null's type is
21039         System.Object. 
21040
21041         * expression.cs (Invocation.EmitCall): Handle the special case of
21042         calling methods declared on a reference type from a ValueType
21043         (Base classes System.Object and System.Enum)
21044
21045         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21046         the left hand side is a TypeExpr, not on every enumeration. 
21047
21048         (Binary.Resolve): If types are reference types, then do a cast to
21049         object on operators != and == of both arguments.
21050
21051         * typemanager.cs (FindMembers): Extract instance and static
21052         members if requested.
21053
21054         * interface.cs (PopulateProperty): Use void_type instead of null
21055         as the return type for the setter method.
21056
21057         (PopulateIndexer): ditto.
21058
21059 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21060
21061         * support.cs (ReflectionParameters): Fix minor bug where we
21062         were examining the wrong parameter for the ParamArray attribute.
21063
21064         Cope with requests for the type of the parameter at position
21065         greater than the params parameter's. We now return the element
21066         type of the params array as that makes more sense.
21067
21068         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21069         accordingly as we no longer have to extract the element type
21070         ourselves.
21071
21072         (Invocation.OverloadResolve): Update.
21073
21074 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21075
21076         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21077         against IEnumerator, test whether the return value is a descendant
21078         of the IEnumerator interface.
21079
21080         * class.cs (Indexer.Define): Use an auxiliary method to implement
21081         the other bits of the method definition.  Begin support for
21082         explicit interface implementation.
21083
21084         (Property.DefineMethod): Use TypeManager.void_type instead of null
21085         for an empty return value.
21086
21087 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21088
21089         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21090         dealing with a FieldExpr which is composed of a FieldBuilder, in
21091         the code path we did extract the constant, but we should have
21092         obtained the underlying value to be able to cast it (otherwise we
21093         end up in an infinite loop, this is what Ravi was running into).
21094
21095         (ArrayCreation.UpdateIndices): Arrays might be empty.
21096
21097         (MemberAccess.ResolveMemberAccess): Add support for section
21098         14.5.4.1 that deals with the special case of E.I when E is a type
21099         and something else, that I can be a reference to a static member.
21100
21101         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21102         handle a particular array type to create byte blobs, it is just
21103         something we dont generate byteblobs for.
21104
21105         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21106         arguments. 
21107
21108         * location.cs (Push): remove the key from the hashtable that we
21109         are about to add.   This happens for empty files.
21110
21111         * driver.cs: Dispose files after we have parsed them.
21112
21113         (tokenize): new function that only runs the tokenizer on its
21114         input, for speed testing.
21115
21116 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21117
21118         * class.cs (Event.Define): Define the private field only if there
21119         are no accessors defined.
21120
21121         * expression.cs (ResolveMemberAccess): If there is no associated
21122         field with the event, that means we have an event defined with its
21123         own accessors and we should flag error cs0070 since transforming
21124         ourselves into a field is not valid in that case.
21125
21126         * ecore.cs (SimpleName.DoResolve): Same as above.
21127
21128         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21129         and charset to sane values.
21130
21131 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21132
21133         * assign.cs (DoResolve): Perform check on events only if they 
21134         are being accessed outside the declaring type.
21135
21136         * cs-parser.jay (event_declarations): Update rules to correctly
21137         set the type of the implicit parameter etc.
21138
21139         (add_accessor, remove_accessor): Set current local parameters.
21140
21141         * expression.cs (Binary): For delegate addition and subtraction,
21142         cast the return value from the method into the appropriate delegate
21143         type.
21144
21145 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21146
21147         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21148         of these as the workaround is unnecessary.
21149
21150         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21151         delegate data - none of that is needed at all.
21152
21153         Re-write bits to extract the instance expression and the delegate method
21154         correctly.
21155
21156         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21157         on delegates too.
21158
21159         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21160         of attaching attributes instead of duplicating code everywhere.
21161
21162         * everywhere : Update code to do attribute emission using the above method.
21163
21164 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21165
21166         * expression.cs (IsParamsMethodApplicable): if there are not
21167         parameters, return immediately.
21168
21169         * ecore.cs: The 0 literal can be implicity converted to an enum
21170         type. 
21171
21172         (SimpleName.DoResolve): First lookup the type, then lookup the
21173         members. 
21174
21175         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21176         want to get its address.  If the InstanceExpression is not
21177         addressable, store the result in a temporary variable, then get
21178         the address of it.
21179
21180         * codegen.cs: Only display 219 errors on warning level or above. 
21181
21182         * expression.cs (ArrayAccess): Make it implement the
21183         IMemoryLocation interface.
21184
21185         (Binary.DoResolve): handle the operator == (object a, object b)
21186         and operator != (object a, object b) without incurring into a
21187         BoxedCast (because 5 != o should never be performed).
21188
21189         Handle binary enumerator operators.
21190
21191         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21192         value type, otherwise use Ldelem_ref.
21193
21194         Use precomputed names;
21195
21196         (AddressOf): Implement address of
21197
21198         * cs-parser.jay (labeled_statement): Fix recursive block
21199         addition by reworking the production.
21200
21201         * expression.cs (New.DoEmit): New has a special case:
21202                 
21203                  If we are dealing with a ValueType, we have a few
21204                  situations to deal with:
21205                 
21206                     * The target of New is a ValueType variable, that is
21207                       easy, we just pass this as the variable reference
21208                 
21209                     * The target of New is being passed as an argument,
21210                       to a boxing operation or a function that takes a
21211                       ValueType.
21212                 
21213                       In this case, we need to create a temporary variable
21214                       that is the argument of New.
21215
21216
21217 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21218
21219         * rootcontext.cs (LookupType): Check that current_type is not null before
21220         going about looking at nested types.
21221
21222         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21223         not implement the IAssignMethod interface any more.
21224
21225         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21226         where we tranform them into FieldExprs if they are being resolved from within
21227         the declaring type.
21228
21229         * ecore.cs (SimpleName.DoResolve): Do the same here.
21230
21231         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21232
21233         * ../errors/bug10.cs : Add.
21234
21235         * ../errors/cs0070.cs : Add.
21236
21237         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21238
21239         * assign.cs : Get rid of EventIsLocal everywhere.
21240
21241 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21242
21243         * ecore.cs (ConvertIntLiteral): finished the implementation.
21244
21245         * statement.cs (SwitchLabel): Convert the value we are using as a
21246         key before looking up the table.
21247
21248 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21249
21250         * codegen.cs (EmitTopBlock): Require a Location argument now.
21251
21252         * cs-parser.jay (constructor_declarator): We need to setup
21253         current_local_parameters before we parse the
21254         opt_constructor_initializer, to allow the variables to be bound
21255         to the constructor arguments.
21256
21257         * rootcontext.cs (LookupType): First lookup nested classes in our
21258         class and our parents before we go looking outside our class.
21259
21260         * expression.cs (ConstantFold): Extract/debox the values at the
21261         beginnning. 
21262
21263         * rootcontext.cs (EmitCode): Resolve the constants first before we
21264         resolve the types.  This is not really needed, but it helps debugging.
21265
21266         * statement.cs: report location.
21267
21268         * cs-parser.jay: pass location to throw statement.
21269
21270         * driver.cs: Small bug fix.
21271
21272         * report.cs: Updated format to be 4-zero filled digits.
21273
21274 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21275
21276         * expression.cs (CheckIndices): Fix minor bug where the wrong
21277         variable was being referred to ;-)
21278
21279         (DoEmit): Do not call EmitStaticInitializers when the 
21280         underlying type is System.Object.
21281
21282 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21283
21284         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21285         and do the usual workaround for SRE.
21286
21287         * class.cs (MyEventBuilder.EventType): New member to get at the type
21288         of the event, quickly.
21289
21290         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21291
21292         * assign.cs (Assign.DoResolve): Handle the case when the target
21293         is an EventExpr and perform the necessary checks.
21294
21295         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21296         interface.
21297
21298         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21299
21300         (EventExpr): Set the type in the constructor itself since we 
21301         are meant to be born fully resolved.
21302
21303         (EventExpr.Define): Revert code I wrote earlier.
21304                 
21305         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21306         instance expression is null. The instance expression is a This in that case
21307         or a null, depending on whether it is a static method or not.
21308
21309         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21310         refers to more than one method.
21311
21312         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21313         and accordingly flag errors.
21314
21315 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21316
21317         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21318
21319 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21320
21321         * location.cs (ToString): Provide useful rutine.
21322
21323 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21324
21325         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21326         objects, return the actual integral boxed.
21327
21328         * statement.cs (SwitchLabel): define an ILLabel for each
21329         SwitchLabel. 
21330
21331         (Switch.CheckSwitch): If the value is a Literal, extract
21332         the underlying literal.
21333
21334         Also in the unused hashtable we had, add the SwitchLabel so we can
21335         quickly look this value up.
21336
21337         * constant.cs: Implement a bunch of new constants.  Rewrite
21338         Literal based on this.  Made changes everywhere to adapt to this.
21339
21340         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21341         dereferencing array only once, and also copes with enumrations.
21342
21343         bytes are two bytes wide, not one.
21344
21345         (Cast): Perform constant conversions.
21346
21347         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21348         wrappers to the literals here.
21349
21350         * expression.cs (DoNumericPromotions): long literals can converted
21351         to ulong implicity (this is taken care of elsewhere, but I was
21352         missing this spot).
21353
21354         * ecore.cs (Expression.Literalize): Make the return type Literal,
21355         to improve type checking.
21356
21357         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21358
21359 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21360
21361         * literal.cs: Revert code from ravi that checked the bounds.  The
21362         bounds are sane by the definition of the type itself. 
21363
21364         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21365         need to actually look up in our parent hierarchy for interfaces
21366         implemented. 
21367
21368         * const.cs: Use the underlying type for enumerations
21369
21370         * delegate.cs: Compute the basename for the delegate creation,
21371         that should fix the delegate test case, and restore the correct
21372         Type Lookup semantics in rootcontext
21373
21374         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21375         referencing a nested type with the Reflection API is using the "+"
21376         sign. 
21377
21378         * cs-parser.jay: Do not require EOF token at the end.
21379
21380 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21381
21382         * rootcontext.cs (LookupType): Concatenate type names with
21383         a '.' instead of a '+' The test suite passes again.
21384
21385         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21386         field of the enumeration.
21387
21388         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21389         the case when the member is an EventExpr.
21390
21391         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21392         static has an associated instance expression.
21393
21394         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21395
21396         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21397
21398         * class.cs (Event.Define): Register event and perform appropriate checks
21399         for error #111.
21400
21401         We define the Add and Remove methods even if the use provides none because
21402         in that case, we provide default implementations ourselves.
21403
21404         Define a private field of the type of the event. This is done by the CSC compiler
21405         and we should be doing it too ;-)
21406
21407         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21408         More methods we use in code we generate.
21409
21410         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21411         is important.
21412
21413         (InitCoreTypes): Update accordingly for the above.
21414
21415         * class.cs (Event.Emit): Generate code for default accessors that we provide
21416
21417         (EmitDefaultMethod): Do the job in the above.
21418
21419         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21420         appropriate place.
21421
21422 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21423
21424         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21425         builders even if we were missing one.
21426
21427         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21428         pass the Basename as our class name instead of the Name.  The
21429         basename will be correctly composed for us.
21430
21431         * parameter.cs (Paramters): Now takes a Location argument.
21432
21433         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21434         make all the code call directly LookupType in RootContext and take
21435         this chance to pass the Location information everywhere.
21436
21437         * Everywhere: pass Location information.
21438
21439 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21440
21441         * class.cs (Constructor.Define): Updated way of detecting the
21442         length of the parameters.
21443
21444         (TypeContainer.DefineType): Use basename as the type name for
21445         nested types.
21446
21447         (TypeContainer.Define): Do not recursively define types here, as
21448         definition is taken care in order by the RootContext.
21449
21450         * tree.cs: Keep track of namespaces in a per-file basis.
21451
21452         * parameter.cs (Parameter.ComputeSignature): Update to use
21453         DeclSpace. 
21454
21455         (Parameters.GetSignature): ditto.
21456
21457         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21458         instead of a TypeContainer.
21459
21460         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21461         resolve names.  Because we need to be resolve in our context, not
21462         our parents.
21463
21464         * driver.cs: Implement response files.
21465
21466         * class.cs (TypeContainer.DefineType): If we are defined, do not
21467         redefine ourselves.
21468
21469         (Event.Emit): Emit the code for add/remove handlers.
21470         (Event.Define): Save the MethodBuilders for add/remove.
21471
21472         * typemanager.cs: Use pair here too.
21473
21474         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21475         DictionaryEntry requires the first argument to be non-null.  
21476
21477         (enum_declaration): Compute full name for registering the
21478         enumeration.
21479
21480         (delegate_declaration): Instead of using
21481         formal_parameter_list, use opt_formal_parameter_list as the list
21482         can be empty.
21483
21484         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21485         (EventParsing): New property that controls whether `add' and
21486         `remove' are returned as tokens or identifiers (for events);
21487
21488 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21489
21490         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21491         use MyEventBuilder only and let it wrap the real builder for us.
21492
21493         (MyEventBuilder): Revamp constructor etc.
21494
21495         Implement all operations that we perform on EventBuilder in precisely the same
21496         way here too.
21497
21498         (FindMembers): Update to use the EventBuilder member.
21499
21500         (Event.Emit): Update accordingly.
21501
21502 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21503
21504         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21505         by calling the appropriate methods.
21506
21507         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21508         useful.
21509
21510         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21511
21512 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21513
21514         * delegate.cs (Delegate.Populate): Check that the return type
21515         and various parameters types are indeed accessible.
21516
21517         * class.cs (Constructor.Define): Same here.
21518
21519         (Field.Define): Ditto.
21520
21521         (Event.Define): Ditto.
21522
21523         (Operator.Define): Check that the underlying Method defined itself
21524         correctly - so it's MethodBuilder should not be null.
21525
21526         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21527         expression happens to be null.
21528
21529         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21530         members but as of now we don't seem to be able to do anything really useful with it.
21531
21532         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21533         not the EventBuilder.
21534
21535 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21536
21537         * cs-tokenizer.cs: Add support for defines.
21538         Add support for #if, #elif, #else, #endif
21539
21540         (eval_var): evaluates a variable.
21541         (eval): stubbed for evaluating functions.
21542
21543         * cs-parser.jay: Pass the defines information
21544
21545         * driver.cs: Add --define command line option.
21546
21547         * decl.cs: Move MemberCore here.
21548
21549         Make it the base class for DeclSpace.  This allows us to catch and
21550         report 108 and 109 for everything now.
21551
21552         * class.cs (TypeContainer.Define): Extract all the members
21553         before populating and emit the warning 108 (new keyword required
21554         to override) instead of having each member implement this.
21555
21556         (MemberCore.Define): New abstract method, we will be using this in
21557         the warning reporting engine in Populate.
21558
21559         (Operator.Define): Adjust to new MemberCore protocol. 
21560
21561         * const.cs (Const): This does not derive from Expression, it is a
21562         temporary object we use to create fields, it is a MemberCore. 
21563
21564         * class.cs (Method.Define): Allow the entry point to be in a
21565         specific class.
21566
21567         * driver.cs: Rewrite the argument handler to clean it up a bit.
21568
21569         * rootcontext.cs: Made it just an auxiliary namespace feature by
21570         making everything static.
21571
21572         * driver.cs: Adapt code to use RootContext type name instead of
21573         instance variable.
21574
21575         * delegate.cs: Remove RootContext argument.
21576
21577         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21578         argument. 
21579
21580         * class.cs (Event.Define): The lookup can fail.
21581
21582         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21583
21584         * expression.cs: Resolve the this instance before invoking the code.
21585
21586 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21587
21588         * cs-parser.jay: Add a production in element_access that allows
21589         the thing to become a "type" reference.  This way we can parse
21590         things like "(string [])" as a type.
21591
21592         Note that this still does not handle the more complex rules of
21593         casts. 
21594
21595
21596         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21597
21598         * ecore.cs: (CopyNewMethods): new utility function used to
21599         assemble the list of methods from running FindMembers.
21600
21601         (MemberLookup): Rework FindMembers so that 
21602
21603 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21604
21605         * class.cs (TypeContainer): Remove Delegates who fail to be
21606         defined.
21607
21608         * delegate.cs (Populate): Verify that we dont get null return
21609         values.   TODO: Check for AsAccessible.
21610
21611         * cs-parser.jay: Use basename to emit error 574 (destructor should
21612         have the same name as container class), not the full name.
21613
21614         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21615         possible representation.  
21616
21617         Also implements integer type suffixes U and L.
21618
21619 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21620
21621         * expression.cs (ArrayCreation.DoResolve): We need to do the
21622         argument resolution *always*.
21623
21624         * decl.cs: Make this hold the namespace.  Hold the root context as
21625         well.
21626         (LookupType): Move here.
21627
21628         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21629
21630         * location.cs (Row, Name): Fixed the code, it was always returning
21631         references to the first file.
21632
21633         * interface.cs: Register properties defined through interfaces.
21634
21635         * driver.cs: Add support for globbing on the command line
21636
21637         * class.cs (Field): Make it derive from MemberCore as well.
21638         (Event): ditto.
21639
21640 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21641
21642         * class.cs (Event::Define): Check that the type of the event is a delegate
21643         type else flag error #66.
21644
21645         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21646         same.
21647
21648         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21649         values of EntryPoint, CharSet etc etc.
21650
21651         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21652
21653         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21654         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21655         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21656         which needs this to do its work.
21657
21658         * ../errors/cs0066.cs : Add.
21659
21660 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21661
21662         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21663         helper functions.
21664
21665         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21666         clears out the parameters field.
21667         (MemberSignatureCompare): Cleanup
21668
21669         (MemberCore): New base class used to share code between MethodCore
21670         and Property.
21671
21672         (RegisterRequiredImplementations) BindingFlags.Public requires
21673         either BindingFlags.Instace or Static.  Use instance here.
21674
21675         (Property): Refactored code to cope better with the full spec.
21676
21677         * parameter.cs (GetParameterInfo): Return an empty array instead
21678         of null on error.
21679
21680         * class.cs (Property): Abstract or extern properties have no bodies.
21681
21682         * parameter.cs (GetParameterInfo): return a zero-sized array.
21683
21684         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21685         method modifier validation to the typecontainer so we can reuse
21686         this on properties.
21687
21688         (MethodCore.ParameterTypes): return an empty sized array of types.
21689
21690         (Property.Define): Test property modifier validity.
21691
21692         Add tests for sealed/override too.
21693
21694         (Method.Emit): abstract or extern methods have no bodies.
21695
21696 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21697
21698         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21699         thing.
21700
21701         (Method::Define, ::Emit): Modify accordingly.
21702
21703         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21704
21705         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21706
21707         * makefile: Pass in /unsafe.
21708
21709 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21710
21711         * class.cs (MakeKey): Kill routine.
21712
21713         * class.cs (TypeContainer.Define): Correctly define explicit
21714         method implementations (they require the full interface name plus
21715         the method name).
21716
21717         * typemanager.cs: Deply the PtrHashtable here and stop using the
21718         lame keys.  Things work so much better.
21719
21720         This of course broke everyone who depended on `RegisterMethod' to
21721         do the `test for existance' test.  This has to be done elsewhere.
21722
21723         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21724         the object stupid Equals method (because, that like fails all over
21725         the place).  We still do not use it.
21726
21727         * class.cs (TypeContainer.SetRequiredInterface,
21728         TypeContainer.RequireMethods): Killed these two routines and moved
21729         all the functionality to RegisterRequiredImplementations.
21730
21731         (TypeContainer.RegisterRequiredImplementations): This routine now
21732         registers all the implementations required in an array for the
21733         interfaces and abstract methods.  We use an array of structures
21734         which can be computed ahead of time to reduce memory usage and we
21735         also assume that lookups are cheap as most classes will not
21736         implement too many interfaces.
21737
21738         We also avoid creating too many MethodSignatures.
21739
21740         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21741         clear the "pending" bit if we find that there are problems with
21742         the declaration.
21743
21744         (TypeContainer.VerifyPendingMethods): Update to report errors of
21745         methods that look like implementations but are not.
21746
21747         (TypeContainer.Define): Add support for explicit interface method
21748         implementation. 
21749
21750 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21751
21752         * typemanager.cs: Keep track of the parameters here instead of
21753         being a feature of the TypeContainer.
21754
21755         * class.cs: Drop the registration of parameters here, as
21756         InterfaceMethods are also interface declarations.
21757
21758         * delegate.cs: Register methods with the TypeManager not only with
21759         the TypeContainer.  This code was buggy.
21760
21761         * interface.cs: Full registation here.
21762
21763 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21764
21765         * expression.cs: Remove reducer for binary expressions, it can not
21766         be done this way.
21767
21768         * const.cs: Put here the code that used to go into constant.cs
21769
21770         * constant.cs: Put here the code for constants, this is a new base
21771         class for Literals.
21772
21773         * literal.cs: Make Literal derive from Constant.
21774
21775 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21776
21777         * statement.cs (Return.Emit): Report error 157 if the user
21778         attempts to return from a finally block.
21779
21780         (Return.Emit): Instead of emitting a return, jump to the end of
21781         the function.
21782
21783         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21784         LocalBuilder to store the result of the function.  ReturnLabel is
21785         the target where we jump.
21786
21787
21788 2001-12-09  Radek Doulik  <rodo@ximian.com>
21789
21790         * cs-parser.jay: remember alias in current namespace
21791
21792         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21793         namespaces
21794
21795         * class.cs (LookupAlias): lookup alias in my_namespace
21796
21797         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21798         aliases hashtable
21799         (LookupAlias): lookup alias in this and if needed in parent
21800         namespaces
21801
21802 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21803
21804         * support.cs: 
21805
21806         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21807         making things static.  I need this to avoid passing the
21808         TypeContainer when calling ParameterType.
21809
21810         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21811         that did string manipulation to compute the type and then call
21812         GetType.  Use Parameter.ParameterType instead.
21813
21814         * cs-tokenizer.cs: Consume the suffix for floating values.
21815
21816         * expression.cs (ParameterReference): figure out whether this is a
21817         reference parameter or not.  Kill an extra variable by computing
21818         the arg_idx during emission.
21819
21820         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21821         function that returns whether a parameter is an out/ref value or not.
21822
21823         (Parameter.ParameterType): The type of the parameter (base,
21824         without ref/out applied).
21825
21826         (Parameter.Resolve): Perform resolution here.
21827         (Parameter.ExternalType): The full type (with ref/out applied).
21828
21829         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21830         support for expressions on the using statement.
21831
21832 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21833
21834         * statement.cs (Using.EmitLocalVariableDecls): Split the
21835         localvariable handling of the using statement.
21836
21837         (Block.EmitMeta): Keep track of variable count across blocks.  We
21838         were reusing slots on separate branches of blocks.
21839
21840         (Try.Emit): Emit the general code block, we were not emitting it. 
21841
21842         Check the type of the declaration to be an IDisposable or
21843         something that can be implicity converted to it. 
21844
21845         Emit conversions if required.
21846
21847         * ecore.cs (EmptyExpression): New utility class.
21848         (Expression.ImplicitConversionExists): New utility function.
21849
21850 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21851
21852         * statement.cs (Using): Implement.
21853
21854         * expression.cs (LocalVariableReference): Support read only variables.
21855
21856         * statement.cs: Remove the explicit emit for the Leave opcode.
21857         (VariableInfo): Add a readonly field.
21858
21859 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21860
21861         * ecore.cs (ConvCast): new class used to encapsulate the various
21862         explicit integer conversions that works in both checked and
21863         unchecked contexts.
21864
21865         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21866         properly generate the overflow opcodes.
21867
21868 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21869
21870         * statement.cs: The correct type for the EmptyExpression is the
21871         element_type, not the variable type.  Ravi pointed this out.
21872
21873 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21874
21875         * class.cs (Method::Define): Handle PInvoke methods specially
21876         by using DefinePInvokeMethod instead of the usual one.
21877
21878         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21879         above to do the task of extracting information and defining the method.
21880
21881 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21882
21883         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21884         of the condition for string type.
21885
21886         (Emit): Move that here. 
21887
21888         (ArrayCreation::CheckIndices): Keep string literals in their expression
21889         form.
21890
21891         (EmitDynamicInitializers): Handle strings appropriately.
21892
21893 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21894
21895         * codegen.cs (EmitContext): Replace multiple variables with a
21896         single pointer to the current Switch statement.
21897
21898         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21899         EmitContext.
21900
21901 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21902
21903         * statement.cs 
21904
21905         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21906         default'.
21907
21908         (Foreach.Emit): Foreach on arrays was not setting
21909         up the loop variables (for break/continue).
21910
21911         (GotoCase): Semi-implented.
21912
21913 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21914
21915         * attribute.cs (CheckAttribute): Handle system attributes by using
21916         Attribute.GetAttributes to examine information we need.
21917
21918         (GetValidPlaces): Same here.
21919
21920         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21921
21922         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21923
21924         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21925
21926         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21927
21928         (Method::Emit): Handle the case when we are a PInvoke method.
21929
21930 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21931
21932         * expression.cs: Use ResolveWithSimpleName on compound names.
21933
21934 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21935
21936         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21937         before trying to reduce it.
21938
21939         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21940
21941         * constant.cs (LookupConstantValue): Implement.
21942
21943         (EmitConstant): Use the above in emitting the constant.
21944
21945         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21946         that are user-defined by doing a LookupConstantValue on them.
21947
21948         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21949         too, like above.
21950
21951 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21952
21953         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21954
21955         (BaseAccess.DoResolve): Implement.
21956
21957         (MemberAccess.DoResolve): Split this routine into a
21958         ResolveMemberAccess routine that can be used independently
21959
21960 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21961
21962         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21963         As that share bits of the implementation.  Is returns a boolean,
21964         while As returns the Type that is being probed.
21965
21966 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21967
21968         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21969         instead of a Literal - much easier.
21970
21971         (EnumInTransit): Remove - utterly useless :-)
21972
21973         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21974
21975         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21976
21977         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21978         chain when we have no associated expression.
21979
21980 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21981
21982         * constant.cs (Define): Use Location while reporting the errror.
21983
21984         Also emit a warning when 'new' is used and there is no inherited
21985         member to hide.
21986
21987         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21988         populated.
21989
21990         (LookupEnumValue): Implement to lookup an enum member's value and define it
21991         if necessary.
21992
21993         (Populate): Re-write accordingly to use the above routine.
21994
21995 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21996
21997         * expression.cs (This): Fix prototype for DoResolveLValue to
21998         override the base class DoResolveLValue.
21999
22000         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22001         declarations) 
22002
22003         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22004         (we need to load the address of the field here).  This fixes
22005         test-22. 
22006
22007         (FieldExpr.DoResolveLValue): Call the DoResolve
22008         function to initialize the Instance expression.
22009
22010         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22011         correctly the GetEnumerator operation on a value type.
22012
22013         * cs-parser.jay: Add more simple parsing error catches.
22014
22015         * statement.cs (Switch): Add support for string switches.
22016         Handle null specially.
22017
22018         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22019
22020 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22021
22022         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22023
22024         (declare_local_constant): New helper function.
22025
22026         * statement.cs (AddConstant): Keep a separate record of constants
22027
22028         (IsConstant): Implement to determine if a variable is a constant.
22029
22030         (GetConstantExpression): Implement.
22031
22032         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22033
22034         * statement.cs (IsVariableDefined): Re-write.
22035
22036 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22037
22038         * class.cs (TypeContainer::FindMembers): Look for constants
22039         in the case when we are looking for MemberTypes.Field
22040
22041         * expression.cs (MemberAccess::DoResolve): Check that in the
22042         case we are a FieldExpr and a Literal, we are not being accessed
22043         by an instance reference.
22044
22045         * cs-parser.jay (local_constant_declaration): Implement.
22046
22047         (declaration_statement): Implement for constant declarations.
22048
22049 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22050
22051         * statement.cs (Switch): Catch double defaults.
22052
22053         (Switch): More work on the switch() statement
22054         implementation.  It works for integral values now, need to finish
22055         string support.
22056
22057
22058 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22059
22060         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22061         integer literals into other integer literals.  To be used by
22062         switch. 
22063
22064 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22065
22066         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22067         some memory.
22068
22069         (EmitDynamicInitializers): Cope with the above since we extract data
22070         directly from ArrayData now.
22071
22072         (ExpectInitializers): Keep track of whether initializers are mandatory
22073         or not.
22074
22075         (Bounds): Make it a hashtable to prevent the same dimension being 
22076         recorded for every element in that dimension.
22077
22078         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22079         from being found.
22080
22081         Also fix bug which was causing the indices to be emitted in the reverse
22082         order.
22083
22084 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22085
22086         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22087         unfinished.  They do not work, because the underlying code is
22088         sloppy.
22089
22090 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22091
22092         * cs-parser.jay: Remove bogus fixme.
22093
22094         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22095         on Switch statement.
22096
22097 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22098
22099         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22100         the same. 
22101
22102         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22103         parameter. Apparently, any expression is allowed. 
22104
22105         (ValidateInitializers): Update accordingly.
22106
22107         (CheckIndices): Fix some tricky bugs thanks to recursion.
22108
22109         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22110         I was being completely brain-dead.
22111
22112         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22113         and re-write acordingly.
22114
22115         (DelegateInvocation): Re-write accordingly.
22116
22117         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22118
22119         (MakeByteBlob): Handle types more correctly.
22120
22121         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22122         initialization from expressions but it is incomplete because I am a complete
22123         Dodo :-|
22124
22125 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22126
22127         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22128         on If.  Basically, we have to return `true' (ie, we do return to
22129         our caller) only if both branches of the if return.
22130
22131         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22132         short-circuit operators, handle them as short circuit operators. 
22133
22134         (Cast.DoResolve): Resolve type.
22135         (Cast.Cast): Take an expression as the target type.
22136
22137         * cs-parser.jay (cast_expression): Remove old hack that only
22138         allowed a limited set of types to be handled.  Now we take a
22139         unary_expression and we resolve to a type during semantic
22140         analysis.
22141
22142         Use the grammar productions from Rhys to handle casts (this is
22143         not complete like Rhys syntax yet, we fail to handle that corner
22144         case that C# has regarding (-x), but we will get there.
22145
22146 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22147
22148         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22149         field which is an array type.
22150
22151         * cs-parser.jay (declare_local_variables): Support array initialization too.
22152
22153         * typemanager.cs (MakeKey): Implement.
22154
22155         (everywhere): Use the above appropriately.
22156
22157         * cs-parser.jay (for_statement): Update for array initialization while
22158         declaring variables.
22159
22160         * ecore.cs : The error message was correct, it's the variable's names that
22161         were misleading ;-) Make the code more readable.
22162
22163         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22164         the correct type etc.
22165
22166         (ConvertExplicit): Handle Enum types by examining the underlying type.
22167
22168 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22169
22170         * parameter.cs (GetCallingConvention): Always return
22171         CallingConventions.Standard for now.
22172
22173 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22174
22175         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22176         and `r' after calling DoNumericPromotions.
22177
22178         * ecore.cs: Fix error message (the types were in the wrong order).
22179
22180         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22181         BindingFlags.Instance as well 
22182
22183         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22184         implicit int literal conversion in an empty cast so that we
22185         propagate the right type upstream.
22186
22187         (UnboxCast): new class used to unbox value types.
22188         (Expression.ConvertExplicit): Add explicit type conversions done
22189         by unboxing.
22190
22191         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22192         the target type before applying the implicit LongLiterals to ULong
22193         literal cast.
22194
22195 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22196
22197         * cs-parser.jay (for_statement): Reworked the way For works: now
22198         we declare manually any variables that are introduced in
22199         for_initializer to solve the problem of having out-of-band code
22200         emition (that is what got for broken).
22201
22202         (declaration_statement): Perform the actual variable declaration
22203         that used to be done in local_variable_declaration here.
22204
22205         (local_variable_declaration): Do not declare anything, just pass
22206         the information on a DictionaryEntry
22207
22208 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22209
22210         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22211         re-write of the logic to now make it recursive.
22212
22213         (UpdateIndices): Re-write accordingly.
22214
22215         Store element data in a separate ArrayData list in the above methods.
22216
22217         (MakeByteBlob): Implement to dump the array data into a byte array.
22218
22219 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22220
22221         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22222         into CheckIndices.
22223
22224         * constant.cs (Define): Implement.
22225
22226         (EmitConstant): Re-write fully.
22227
22228         Pass in location info.
22229
22230         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22231         respectively.
22232
22233         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22234         DictionaryEntry since we need location info too.
22235
22236         (constant_declaration): Update accordingly.
22237
22238         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22239         code into another method : UpdateIndices.
22240
22241 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22242
22243         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22244         some type checking etc.
22245
22246 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22247
22248         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22249         bits to provide dimension info if the user skips doing that.
22250
22251         Update second constructor to store the rank correctly.
22252
22253 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22254
22255         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22256         and try to implement.
22257
22258         * ../errors/cs0150.cs : Add.
22259
22260         * ../errors/cs0178.cs : Add.
22261
22262 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22263
22264         * statement.cs: Implement foreach on multi-dimensional arrays. 
22265
22266         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22267         name of the params argument.
22268
22269         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22270         initializing the array.
22271
22272         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22273         we can use this elsewhere.
22274
22275         * statement.cs: Finish implementation of foreach for single
22276         dimension arrays.
22277
22278         * cs-parser.jay: Use an out-of-band stack to pass information
22279         around, I wonder why I need this.
22280
22281         foreach_block: Make the new foreach_block the current_block.
22282
22283         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22284         function used to return a static Parameters structure.  Used for
22285         empty parameters, as those are created very frequently.
22286
22287         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22288
22289 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22290
22291         * interface.cs : Default modifier is private, not public. The
22292         make verify test passes again.
22293
22294 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22295
22296         * support.cs (ReflectionParameters): Fix logic to determine
22297         whether the last parameter is a params one. Test 9 passes again.
22298
22299         * delegate.cs (Populate): Register the builders we define with
22300         RegisterParameterForBuilder. Test 19 passes again.
22301
22302         * cs-parser.jay (property_declaration): Reference $6 instead
22303         of $$ to get at the location.
22304
22305         (indexer_declaration): Similar stuff.
22306
22307         (attribute): Ditto.
22308
22309         * class.cs (Property): Register parameters for the Get and Set methods
22310         if they exist. Test 23 passes again.
22311
22312         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22313         call to EmitArguments as we are sure there aren't any params arguments. 
22314         Test 32 passes again.
22315
22316         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22317         IndexOutOfRangeException. 
22318
22319         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22320         Test 33 now passes again.
22321
22322 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22323
22324         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22325         broke a bunch of things.  Will have to come up with a better way
22326         of tracking locations.
22327
22328         * statement.cs: Implemented foreach for single dimension arrays.
22329
22330 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22331
22332         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22333         an error.  This removes the lookup from the critical path.
22334
22335         * cs-parser.jay: Removed use of temporary_loc, which is completely
22336         broken. 
22337
22338 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22339
22340         * support.cs (ReflectionParameters.ParameterModifier): Report
22341         whether the argument is a PARAMS argument or not.
22342
22343         * class.cs: Set the attribute `ParamArrayAttribute' on the
22344         parameter argument.
22345
22346         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22347         and cons_param_array_attribute (ConstructorInfo for
22348         ParamArrayAttribute)., 
22349
22350         * codegen.cs: Emit the return using the `Return' statement, that
22351         way we can report the error correctly for missing return values. 
22352
22353         * class.cs (Method.Emit): Clean up.
22354
22355         * expression.cs (Argument.Resolve): Take another argument: the
22356         location where this argument is used.  Notice that this is not
22357         part of the "Argument" class as to reduce the size of the
22358         structure (we know the approximate location anyways).
22359
22360         Test if the argument is a variable-reference, if not, then
22361         complain with a 206.
22362
22363         (Argument.Emit): Emit addresses of variables.
22364
22365         (Argument.FullDesc): Simplify.
22366
22367         (Invocation.DoResolve): Update for Argument.Resolve.
22368
22369         (ElementAccess.DoResolve): ditto.
22370
22371         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22372         method should be virtual, as this method is always virtual.
22373
22374         (NewDelegate.DoResolve): Update for Argument.Resolve.
22375
22376         * class.cs (ConstructorInitializer.DoResolve): ditto.
22377
22378         * attribute.cs (Attribute.Resolve): ditto.
22379
22380 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22381
22382         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22383
22384         * expression.cs (ParameterReference): Drop IStackStorage and implement
22385         IAssignMethod instead. 
22386
22387         (LocalVariableReference): ditto.
22388
22389         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22390         IAssignMethod instead. 
22391
22392 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22393
22394         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22395         enumerations that are used in heavily used structures derive from
22396         byte in a laughable and pathetic attempt to reduce memory usage.
22397         This is the kind of pre-optimzations that you should not do at
22398         home without adult supervision.
22399
22400         * expression.cs (UnaryMutator): New class, used to handle ++ and
22401         -- separatedly from the other unary operators.  Cleans up the
22402         code, and kills the ExpressionStatement dependency in Unary.
22403
22404         (Unary): Removed `method' and `Arguments' from this class, making
22405         it smaller, and moving it all to SimpleCall, so I can reuse this
22406         code in other locations and avoid creating a lot of transient data
22407         strucutres when not required.
22408
22409         * cs-parser.jay: Adjust for new changes.
22410
22411 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22412
22413         * enum.cs (Enum.Populate): If there is a failure during
22414         definition, return
22415
22416         * cs-parser.jay (opt_enum_base): we used to catch type errors
22417         here, but this is really incorrect.  The type error should be
22418         catched during semantic analysis.
22419
22420 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22421
22422         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22423         current_local_parameters as expected since I, in my stupidity, had forgotten
22424         to do this :-)
22425
22426         * attribute.cs (GetValidPlaces): Fix stupid bug.
22427
22428         * class.cs (Method::Emit): Perform check on applicability of attributes.
22429
22430         (Constructor::Emit): Ditto.
22431
22432         (Field::Emit): Ditto.
22433
22434         (Field.Location): Store location information.
22435
22436         (Property, Event, Indexer, Operator): Ditto.
22437
22438         * cs-parser.jay (field_declaration): Pass in location for each field.
22439
22440         * ../errors/cs0592.cs : Add.
22441
22442 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22443
22444         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22445
22446         (InitCoreTypes): Update accordingly.
22447
22448         (RegisterAttrType, LookupAttr): Implement.
22449
22450         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22451         info about the same.
22452
22453         (Resolve): Update to populate the above as necessary.
22454
22455         (Error592): Helper.
22456
22457         (GetValidPlaces): Helper to the above.
22458
22459         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22460
22461         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22462
22463 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22464
22465         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22466
22467         * ../errors/cs0617.cs : Add.
22468
22469 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22470
22471         * enum.cs (Emit): Rename to Populate to be more consistent with what
22472         we expect it to do and when exactly it is called.
22473
22474         * class.cs, rootcontext.cs : Update accordingly.
22475
22476         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22477         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22478
22479         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22480
22481         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22482         of a fieldinfo using the above, when dealing with a FieldBuilder.
22483
22484 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22485
22486         * ../errors/cs0031.cs : Add.
22487
22488         * ../errors/cs1008.cs : Add.
22489
22490         * ../errrors/cs0543.cs : Add.
22491
22492         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22493         enum type.
22494
22495         (FindMembers): Implement.
22496
22497         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22498         enums and delegates too.
22499
22500         (enum_types): Rename to builder_to_enum.
22501
22502         (delegate_types): Rename to builder_to_delegate.
22503
22504         * delegate.cs (FindMembers): Implement.
22505
22506 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22507
22508         * typemanager.cs (IsEnumType): Implement.
22509
22510         * enum.cs (Emit): Re-write parts to account for the underlying type
22511         better and perform checking etc.
22512
22513         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22514         of the underlying type.
22515
22516         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22517         value
22518
22519         * enum.cs (error31): Helper to report error #31.
22520
22521         * cs-parser.jay (enum_declaration): Store location of each member too.
22522
22523         * enum.cs (member_to_location): New hashtable. 
22524
22525         (AddEnumMember): Update location hashtable.
22526
22527         (Emit): Use the location of each member while reporting errors.
22528
22529 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22530
22531         * cs-parser.jay: A for_initializer if is a
22532         local_variable_declaration really ammount to have an implicit
22533         block with the variable declaration and no initializer for for.
22534
22535         * statement.cs (For.Emit): Cope with null initializers.
22536
22537         This fixes the infinite loop on for initializers.
22538
22539 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22540
22541         * enum.cs: More cleanup.
22542
22543         * ecore.cs: Remove dead code.
22544
22545         * class.cs (Property.Emit): More simplification.
22546         (Event.Emit): ditto.
22547
22548         Reworked to have less levels of indentation.
22549
22550 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22551
22552         * class.cs (Property): Emit attributes.
22553
22554         (Field): Ditto.
22555
22556         (Event): Ditto.
22557
22558         (Indexer): Ditto.
22559
22560         (Operator): Ditto.
22561
22562         * enum.cs (Emit): Ditto.
22563
22564         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22565         Enums too.
22566
22567         * class.cs (Field, Event, etc.): Move attribute generation into the
22568         Emit method everywhere.
22569
22570         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22571         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22572         as we had no way of defining nested enums !
22573
22574         * rootcontext.cs : Adjust code accordingly.
22575
22576         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22577
22578 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22579
22580         * expression.cs (EvalConstantExpression): Move into ecore.cs
22581
22582         * enum.cs (Enum): Rename some members and make them public and readonly
22583         according to our convention.
22584
22585         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22586         nothing else.
22587
22588         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22589
22590         (Enum::Emit): Write a simple version for now which doesn't try to compute
22591         expressions. I shall modify this to be more robust in just a while.
22592
22593         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22594
22595         (TypeContainer::CloseType): Create the Enum types too.
22596
22597         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22598
22599         * expression.cs (EvalConstantExpression): Get rid of completely.
22600
22601         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22602         user-defined values and other cases.
22603
22604         (IsValidEnumLiteral): Helper function.
22605
22606         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22607         out there in the case we had a literal FieldExpr.
22608
22609         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22610
22611         (Literalize): Revamp a bit to take two arguments.
22612
22613         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22614
22615 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22616
22617         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22618
22619         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22620
22621         (Resolve): Use the above to ensure we have proper initializers.
22622
22623 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22624
22625         * expression.cs (Expression::EvalConstantExpression): New method to 
22626         evaluate constant expressions.
22627
22628         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22629
22630 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22631
22632         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22633         in an array.
22634
22635         (Binary.ResolveOperator): Handle operator != (object a, object b)
22636         and operator == (object a, object b);
22637
22638         (Binary.DoNumericPromotions): Indicate whether the numeric
22639         promotion was possible.
22640
22641         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22642         Implement.  
22643
22644         Made the ArrayAccess implement interface IAssignMethod instead of
22645         IStackStore as the order in which arguments are passed reflects
22646         this.
22647
22648         * assign.cs: Instead of using expr.ExprClass to select the way of
22649         assinging, probe for the IStackStore/IAssignMethod interfaces.
22650
22651         * typemanager.cs: Load InitializeArray definition.
22652
22653         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22654         static data that can be used to initialize arrays. 
22655
22656 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22657
22658         * expression.cs: Handle operator== and operator!= for booleans.
22659
22660         (Conditioal.Reduce): Implement reducer for the ?: operator.
22661
22662         (Conditional.Resolve): Implement dead code elimination.
22663
22664         (Binary.Resolve): Catch string literals and return a new
22665         concatenated string.
22666
22667         (Unary.Reduce): Implement reduction of unary expressions.
22668
22669         * ecore.cs: Split out the expression core handling here.
22670
22671         (Expression.Reduce): New method used to perform constant folding
22672         and CSE.  This is needed to support constant-expressions. 
22673
22674         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22675         targets, and optimize for !x.
22676
22677 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22678
22679         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22680         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22681         set custom atttributes.
22682
22683         * literal.cs (Literal::GetValue): New abstract method to return the actual
22684         value of the literal, cast as an object.
22685
22686         (*Literal): Implement GetValue method.
22687
22688         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22689         expressions to the arraylist but objects of type Argument.
22690
22691         * class.cs (TypeContainer::Emit): Emit our attributes too.
22692
22693         (Method::Emit, Constructor::Emit): Ditto.
22694
22695         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22696         to be ignoring earlier.
22697
22698 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22699
22700         * attribute.cs (AttributeSection::Define): Implement to do the business
22701         of constructing a CustomAttributeBuilder.
22702
22703         (Attribute): New trivial class. Increases readability of code.  
22704
22705         * cs-parser.jay : Update accordingly.
22706
22707         (positional_argument_list, named_argument_list, named_argument): New rules
22708
22709         (attribute_arguments): Use the above so that we are more correct.
22710
22711 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22712
22713         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22714         to perform all checks for a method with a params parameter.
22715
22716         (Invocation::OverloadResolve): Update to use the above method and therefore
22717         cope correctly with params method invocations.
22718
22719         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22720         params too.
22721
22722         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22723         constructors in our parent too because we can't afford to miss out on 
22724         protected ones ;-)
22725
22726         * attribute.cs (AttributeSection): New name for the class Attribute
22727
22728         Other trivial changes to improve readability.
22729
22730         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22731         use the new class names.
22732
22733 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22734
22735         * class.cs (Method::Define): Complete definition for params types too
22736
22737         (Indexer::Define): Ditto.
22738
22739         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22740         Cope everywhere with a request for info about the array parameter.
22741
22742 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22743
22744         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22745
22746         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22747         local_variable_type to extract the string corresponding to the type.
22748
22749         (local_variable_type): Fixup the action to use the new helper method.
22750
22751         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22752         go.
22753
22754         * expression.cs : Clean out code which uses the above.
22755
22756 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22757
22758         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22759         and bale out if necessary by returning a false.
22760
22761         (RegisterProperty): Ditto.
22762
22763         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22764         and print out appropriate error messages.
22765
22766         * interface.cs (everywhere): Ditto.
22767
22768         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22769         location to constructor.
22770
22771         * class.cs (Property, Event, Indexer): Update accordingly.
22772
22773         * ../errors/cs111.cs : Added.
22774
22775         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22776         of a method, as laid down by the spec.
22777
22778         (Invocation::OverloadResolve): Use the above method.
22779
22780 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22781
22782         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22783         now take a TypeContainer and a Parameters object.
22784
22785         (ParameterData): Modify return type of ParameterModifier method to be 
22786         Parameter.Modifier and not a string.
22787
22788         (ReflectionParameters, InternalParameters): Update accordingly.
22789
22790         * expression.cs (Argument::GetParameterModifier): Same here.
22791
22792         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22793         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22794         symbol in it at all so maybe this is only for now.
22795
22796 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22797
22798         * support.cs (InternalParameters): Constructor now takes an extra argument 
22799         which is the actual Parameters class.
22800
22801         (ParameterDesc): Update to provide info on ref/out modifiers.
22802
22803         * class.cs (everywhere): Update call to InternalParameters to pass in
22804         the second argument too.
22805
22806         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22807         to return the modifier info [ref/out etc]
22808
22809         (InternalParameters, ReflectionParameters): Implement the above.
22810
22811         * expression.cs (Argument::ParameterModifier): Similar function to return
22812         info about the argument's modifiers.
22813
22814         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22815         too.
22816
22817         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22818         a new SetFormalParameters object which we pass to InternalParameters.
22819
22820 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22821
22822         * expression.cs (NewArray): Merge into the ArrayCreation class.
22823
22824 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22825
22826         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22827         NewUserdefinedArray into one as there wasn't much of a use in having
22828         two separate ones.
22829
22830         * expression.cs (Argument): Change field's name to ArgType from Type.
22831
22832         (Type): New readonly property which returns the proper type, taking into 
22833         account ref/out modifiers.
22834
22835         (everywhere): Adjust code accordingly for the above.
22836
22837         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22838         whether we are emitting for a ref or out parameter.
22839
22840         * expression.cs (Argument::Emit): Use the above field to set the state.
22841
22842         (LocalVariableReference::Emit): Update to honour the flag and emit the
22843         right stuff.
22844
22845         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22846
22847         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22848
22849         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22850
22851         (ReflectionParameters, InternalParameters): Implement the above method.
22852
22853         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22854         reporting errors.
22855
22856         (Invocation::FullMethodDesc): Ditto. 
22857
22858 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22859
22860         * cs-parser.jay: Add extra production for the second form of array
22861         creation. 
22862
22863         * expression.cs (ArrayCreation): Update to reflect the above
22864         change. 
22865
22866         * Small changes to prepare for Array initialization.
22867
22868 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22869
22870         * typemanager.cs (ImplementsInterface): interface might be null;
22871         Deal with this problem;
22872
22873         Also, we do store negative hits on the cache (null values), so use
22874         this instead of calling t.GetInterfaces on the type everytime.
22875
22876 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22877
22878         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22879
22880         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22881         split functionality out into different classes.
22882
22883         (New::FormArrayType): Move into NewBuiltinArray.
22884
22885         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22886         quite useless.
22887
22888         (NewBuiltinArray): New class to handle creation of built-in arrays.
22889
22890         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22891         account creation of one-dimensional arrays.
22892
22893         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22894
22895         (NewUserdefinedArray::DoResolve): Implement.
22896
22897         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22898
22899         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22900         we maintain inside the TypeManager. This is necessary to perform lookups on the
22901         module builder.
22902
22903         (LookupType): Update to perform GetType on the module builders too.     
22904
22905         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22906
22907         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22908
22909 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22910
22911         * expression.cs (New::DoResolve): Implement guts of array creation.
22912
22913         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22914
22915 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22916
22917         * expression.cs: Fix bug I introduced lsat night that broke
22918         Delegates. 
22919
22920         (Expression.Resolve): Report a 246 error (can not resolve name)
22921         if we find a SimpleName in the stream.
22922
22923         (Expression.ResolveLValue): Ditto.
22924
22925         (Expression.ResolveWithSimpleName): This function is a variant of
22926         ResolveName, this one allows SimpleNames to be returned without a
22927         warning.  The only consumer of SimpleNames is MemberAccess
22928
22929 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22930
22931         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22932         might arrive here.  I have my doubts that this is correct.
22933
22934         * statement.cs (Lock): Implement lock statement.
22935
22936         * cs-parser.jay: Small fixes to support `lock' and `using'
22937
22938         * cs-tokenizer.cs: Remove extra space
22939
22940         * driver.cs: New flag --checked, allows to turn on integer math
22941         checking. 
22942
22943         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22944         Threading.Monitor.Exit 
22945
22946 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22947
22948         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22949         Expression Class to be IndexerAccess.
22950
22951         Notice that Indexer::DoResolve sets the eclass to Value.
22952
22953 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22954
22955         * class.cs (TypeContainer::Emit): Emit code for indexers.
22956
22957         * assign.cs (IAssignMethod): New interface implemented by Indexers
22958         and Properties for handling assignment.
22959
22960         (Assign::Emit): Simplify and reuse code. 
22961
22962         * expression.cs (IndexerAccess, PropertyExpr): Implement
22963         IAssignMethod, clean up old code. 
22964
22965 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22966
22967         * typemanager.cs (ImplementsInterface): New method to determine if a type
22968         implements a given interface. Provides a nice cache too.
22969
22970         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22971         method.
22972
22973         (ConvertReferenceExplicit): Ditto.
22974
22975         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22976         various methods, with correct names etc.
22977
22978         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22979         Operator.UnaryNegation.
22980
22981         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22982         we have a unary plus or minus operator.
22983
22984         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22985         UnaryMinus.
22986
22987         * everywhere : update accordingly.
22988
22989         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22990         respectively.
22991
22992         * class.cs (Method::Define): For the case where we are implementing a method
22993         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22994         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22995
22996 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22997
22998         * interface.cs (FindMembers): Implement to work around S.R.E
22999         lameness.
23000
23001         * typemanager.cs (IsInterfaceType): Implement.
23002
23003         (FindMembers): Update to handle interface types too.
23004
23005         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23006         use IsAssignableFrom as that is not correct - it doesn't work.
23007
23008         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23009         and accordingly override EmitStatement.
23010
23011         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23012         using the correct logic :-)
23013
23014 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23015
23016         * ../errors/cs-11.cs : Add to demonstrate error -11 
23017
23018 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23019
23020         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23021         then pass this as a hint to ResolveLValue.
23022
23023         * expression.cs (FieldExpr): Add Location information
23024
23025         (FieldExpr::LValueResolve): Report assignment to readonly
23026         variable. 
23027
23028         (Expression::ExprClassFromMemberInfo): Pass location information.
23029
23030         (Expression::ResolveLValue): Add new method that resolves an
23031         LValue. 
23032
23033         (Expression::DoResolveLValue): Default invocation calls
23034         DoResolve. 
23035
23036         (Indexers): New class used to keep track of indexers in a given
23037         Type. 
23038
23039         (IStackStore): Renamed from LValue, as it did not really describe
23040         what this did.  Also ResolveLValue is gone from this interface and
23041         now is part of Expression.
23042
23043         (ElementAccess): Depending on the element access type
23044
23045         * typemanager.cs: Add `indexer_name_type' as a Core type
23046         (System.Runtime.CompilerServices.IndexerNameAttribute)
23047
23048         * statement.cs (Goto): Take a location.
23049
23050 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23051
23052         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23053         if two delegates are compatible.
23054
23055         (NewDelegate::DoResolve): Update to take care of the case when
23056         we instantiate a delegate from another delegate.
23057
23058         * typemanager.cs (FindMembers): Don't even try to look up members
23059         of Delegate types for now.
23060
23061 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23062
23063         * delegate.cs (NewDelegate): New class to take care of delegate
23064         instantiation.
23065
23066         * expression.cs (New): Split the delegate related code out into 
23067         the NewDelegate class.
23068
23069         * delegate.cs (DelegateInvocation): New class to handle delegate 
23070         invocation.
23071
23072         * expression.cs (Invocation): Split out delegate related code into
23073         the DelegateInvocation class.
23074
23075 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23076
23077         * expression.cs (New::DoResolve): Implement delegate creation fully
23078         and according to the spec.
23079
23080         (New::DoEmit): Update to handle delegates differently.
23081
23082         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23083         because of which we were printing out arguments in reverse order !
23084
23085         * delegate.cs (VerifyMethod): Implement to check if the given method
23086         matches the delegate.
23087
23088         (FullDelegateDesc): Implement.
23089
23090         (VerifyApplicability): Implement.
23091
23092         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23093         delegate invocations too.
23094
23095         (Invocation::Emit): Ditto.
23096
23097         * ../errors/cs1593.cs : Added.
23098
23099         * ../errors/cs1594.cs : Added.
23100
23101         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23102
23103 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23104
23105         * typemanager.cs (intptr_type): Core type for System.IntPtr
23106
23107         (InitCoreTypes): Update for the same.
23108
23109         (iasyncresult_type, asynccallback_type): Ditto.
23110
23111         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23112         correct.
23113
23114         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23115         too.
23116
23117         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23118         the builders for the 4 members of a delegate type :-)
23119
23120         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23121         type.
23122
23123         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23124
23125         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23126
23127 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23128
23129         * statement.cs (Break::Emit): Implement.   
23130         (Continue::Emit): Implement.
23131
23132         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23133         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23134         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23135         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23136         end loop
23137
23138         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23139         properties that track the label for the current loop (begin of the
23140         loop and end of the loop).
23141
23142 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23143
23144         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23145         use of emitting anything at all.
23146
23147         * class.cs, rootcontext.cs : Get rid of calls to the same.
23148
23149         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23150
23151         (Populate): Define the constructor correctly and set the implementation
23152         attributes.
23153
23154         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23155         have been defined.
23156
23157         (AddDelegateType): Implement.
23158
23159         (IsDelegateType): Implement helper method.
23160
23161         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23162
23163         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23164         and accordingly handle it.
23165
23166         * delegate.cs (Populate): Take TypeContainer argument.
23167         Implement bits to define the Invoke method. However, I still haven't figured out
23168         how to take care of the native int bit :-(
23169
23170         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23171         Qualify the name of the delegate, not its return type !
23172
23173         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23174         conversion.
23175
23176         (StandardConversionExists): Checking for array types turns out to be recursive.
23177
23178         (ConvertReferenceExplicit): Implement array conversion.
23179
23180         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23181
23182 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23183
23184         * cs-parser.jay (delegate_declaration): Store the fully qualified
23185         name as it is a type declaration.
23186
23187         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23188         readonly.
23189
23190         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23191         as TypeContainer::DefineType.
23192
23193         (Populate): Method in which all the definition of the various methods (Invoke)
23194         etc is done.
23195
23196         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23197         see.
23198
23199         (CloseDelegate): Finally creates the delegate.
23200
23201         * class.cs (TypeContainer::DefineType): Update to define delegates.
23202         (Populate, Emit and CloseType): Do the same thing here too.
23203
23204         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23205         delegates in all these operations.
23206
23207 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23208
23209         * expression.cs: LocalTemporary: a new expression used to
23210         reference a temporary that has been created.
23211
23212         * assign.cs: Handle PropertyAccess back here, so that we can
23213         provide the proper semantic access to properties.
23214
23215         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23216         a few more explicit conversions. 
23217
23218         * modifiers.cs: `NEW' modifier maps to HideBySig.
23219
23220         * expression.cs (PropertyExpr): Make this into an
23221         ExpressionStatement, and support the EmitStatement code path. 
23222
23223         Perform get/set error checking, clean up the interface.
23224
23225         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23226         them into toplevel access objects.
23227
23228 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23229
23230         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23231         SRE.
23232
23233         * typemanager.cs: Keep track here of our PropertyBuilders again to
23234         work around lameness in SRE.
23235
23236 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23237
23238         * expression.cs (LValue::LValueResolve): New method in the
23239         interface, used to perform a second resolution pass for LValues. 
23240
23241         (This::DoResolve): Catch the use of this in static methods.
23242
23243         (This::LValueResolve): Implement.
23244
23245         (This::Store): Remove warning, assigning to `this' in structures
23246         is 
23247
23248         (Invocation::Emit): Deal with invocation of
23249         methods on value types.  We need to pass the address to structure
23250         methods rather than the object itself.  (The equivalent code to
23251         emit "this" for structures leaves the entire structure on the
23252         stack instead of a pointer to it). 
23253
23254         (ParameterReference::DoResolve): Compute the real index for the
23255         argument based on whether the method takes or not a `this' pointer
23256         (ie, the method is static).
23257
23258         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23259         value types returned from functions when we need to invoke a
23260         method on the sturcture.
23261
23262
23263 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23264
23265         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23266         defining the type in the Modulebuilder or Typebuilder. This is to take
23267         care of nested types which need to be defined on the TypeBuilder using
23268         DefineNestedMethod.
23269
23270         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23271         methods in RootContext, only ported to be part of TypeContainer.
23272
23273         (TypeContainer::GetInterfaceOrClass): Ditto.
23274
23275         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23276
23277         * interface.cs (Interface::DefineInterface): New method. Does exactly
23278         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23279         too.
23280
23281         (Interface::GetInterfaces): Move from RootContext here and port.
23282
23283         (Interface::GetInterfaceByName): Same here.
23284
23285         * rootcontext.cs (ResolveTree): Re-write.
23286
23287         (PopulateTypes): Re-write.
23288
23289         * class.cs (TypeContainer::Populate): Populate nested types too.
23290         (TypeContainer::Emit): Emit nested members too.
23291
23292         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23293         instead just use the name argument passed in as it is already fully
23294         qualified.
23295
23296         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23297         to TypeContainer mapping to see if a type is user-defined.
23298
23299         * class.cs (TypeContainer::CloseType): Implement. 
23300
23301         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23302         the default constructor.
23303
23304         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23305         twice.
23306
23307         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23308
23309         * interface.cs (CloseType): Create the type here.
23310
23311         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23312         the hierarchy.
23313
23314         Remove all the methods which are now in TypeContainer.
23315
23316 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23317
23318         * delegate.cs (Define): Re-write bits to define the delegate
23319         correctly.
23320
23321 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23322
23323         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23324
23325         * expression.cs (ImplicitReferenceConversion): handle null as well
23326         as a source to convert to any reference type.
23327
23328         * statement.cs (Return): Perform any implicit conversions to
23329         expected return type.  
23330
23331         Validate use of return statement.  
23332
23333         * codegen.cs (EmitContext): Pass the expected return type here.
23334
23335         * class.cs (Method, Constructor, Property): Pass expected return
23336         type to EmitContext.
23337
23338 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23339
23340         * expression.cs: Make DoResolve take an EmitContext instead of a
23341         TypeContainer.
23342
23343         Replaced `l' and `location' for `loc', for consistency.
23344
23345         (Error, Warning): Remove unneeded Tc argument.
23346
23347         * assign.cs, literal.cs, constant.cs: Update to new calling
23348         convention. 
23349
23350         * codegen.cs: EmitContext now contains a flag indicating whether
23351         code is being generated in a static method or not.
23352
23353         * cs-parser.jay: DecomposeQI, new function that replaces the old
23354         QualifiedIdentifier.  Now we always decompose the assembled
23355         strings from qualified_identifier productions into a group of
23356         memberaccesses.
23357
23358 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23359
23360         * rootcontext.cs: Deal with field-less struct types correctly now
23361         by passing the size option to Define Type.
23362
23363         * class.cs: Removed hack that created one static field. 
23364
23365 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23366
23367         * statement.cs: Moved most of the code generation here. 
23368
23369 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23370
23371         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23372         seem very right.
23373
23374         (ElementAccess): Remove useless bits for now - keep checks as the spec
23375         says.
23376
23377 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23378
23379         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23380         and start performing checks according to the spec.
23381
23382 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23383
23384         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23385         rank_specifiers instead.
23386
23387         (rank_specifiers): Change the order in which the rank specifiers are stored
23388
23389         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23390
23391         * expression.cs (ElementAccess): Implement the LValue interface too.
23392
23393 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23394
23395         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23396         except that user defined conversions are not included.
23397
23398         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23399         perform the conversion of the return type, if necessary.
23400
23401         (New::DoResolve): Check whether we are creating an array or an object
23402         and accordingly do the needful.
23403
23404         (New::Emit): Same here.
23405
23406         (New::DoResolve): Implement guts of array creation.
23407
23408         (New::FormLookupType): Helper function.
23409
23410 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23411
23412         * codegen.cs: Removed most of the code generation here, and move the
23413         corresponding code generation bits to the statement classes. 
23414
23415         Added support for try/catch/finalize and throw.
23416
23417         * cs-parser.jay: Added support for try/catch/finalize.
23418
23419         * class.cs: Catch static methods having the flags override,
23420         virtual or abstract.
23421
23422         * expression.cs (UserCast): This user cast was not really doing
23423         what it was supposed to do.  Which is to be born in fully resolved
23424         state.  Parts of the resolution were being performed at Emit time! 
23425
23426         Fixed this code.
23427
23428 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23429
23430         * expression.cs: Implicity convert the result from UserCast.
23431
23432 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23433
23434         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23435         prevented it from working correctly. 
23436
23437         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23438         merely ConvertImplicit.
23439
23440 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23441
23442         * typemanager.cs: Make the LookupTypeContainer function static,
23443         and not per-instance.  
23444
23445         * class.cs: Make static FindMembers (the one that takes a Type
23446         argument). 
23447
23448         * codegen.cs: Add EmitForeach here.
23449
23450         * cs-parser.jay: Make foreach a toplevel object instead of the
23451         inline expansion, as we need to perform semantic analysis on it. 
23452
23453 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23454
23455         * expression.cs (Expression::ImplicitUserConversion): Rename to
23456         UserDefinedConversion.
23457
23458         (Expression::UserDefinedConversion): Take an extra argument specifying 
23459         whether we look for explicit user conversions too.
23460
23461         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23462
23463         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23464
23465         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23466         with the appropriate arguments.
23467
23468         * cs-parser.jay (cast_expression): Record location too.
23469
23470         * expression.cs (Cast): Record location info.
23471
23472         (Expression::ConvertExplicit): Take location argument.
23473
23474         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23475         to determine if we are doing explicit conversions.
23476
23477         (UserCast::Emit): Update accordingly.
23478
23479         (Expression::ConvertExplicit): Report an error if everything fails.
23480
23481         * ../errors/cs0030.cs : Add.
23482
23483 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23484
23485         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23486         virtual and newslot bits. 
23487
23488         * class.cs (TypeContainer::RegisterRequiredImplementations):
23489         Record methods we need.
23490
23491         (TypeContainer::MakeKey): Helper function to make keys for
23492         MethodBases, since the Methodbase key is useless.
23493
23494         (TypeContainer::Populate): Call RegisterRequiredImplementations
23495         before defining the methods.   
23496
23497         Create a mapping for method_builders_to_methods ahead of time
23498         instead of inside a tight loop.
23499
23500         (::RequireMethods):  Accept an object as the data to set into the
23501         hashtable so we can report interface vs abstract method mismatch.
23502
23503 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23504
23505         * report.cs: Make all of it static.
23506
23507         * rootcontext.cs: Drop object_type and value_type computations, as
23508         we have those in the TypeManager anyways.
23509
23510         Drop report instance variable too, now it is a global.
23511
23512         * driver.cs: Use try/catch on command line handling.
23513
23514         Add --probe option to debug the error reporting system with a test
23515         suite. 
23516
23517         * report.cs: Add support for exiting program when a probe
23518         condition is reached.
23519
23520 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23521
23522         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23523         we do a forcible conversion regardless of type, to check if 
23524         ForceConversion returns a null.
23525
23526         (Binary::error19): Use location to report error.
23527
23528         (Unary::error23): Use location here too.
23529
23530         * ../errors/cs0019.cs : Check in.
23531
23532         * ../errors/cs0023.cs : Check in.
23533
23534         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23535         case of a non-null MethodInfo object with a length of 0 !
23536
23537         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23538         an applicable member - according to the spec :-)
23539         Also fix logic to find members in base types.
23540
23541         (Unary::ResolveOperator): Same here.
23542
23543         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23544         as I was getting thoroughly confused between this and error19 :-)
23545
23546         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23547         (::FindMostEncompassedType): Implement.
23548         (::FindMostEncompassingType): Implement.
23549         (::StandardConversionExists): Implement.
23550
23551         (UserImplicitCast): Re-vamp. We now need info about most specific
23552         source and target types so that we can do the necessary conversions.
23553
23554         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23555         mathematical union with no duplicates.
23556
23557 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23558
23559         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23560         in order from base classes to child classes, so that we can in
23561         child classes look up in our parent for method names and
23562         attributes (required for handling abstract, virtual, new, override
23563         constructs: we need to instrospect our base class, and if we dont
23564         populate the classes in order, the introspection might be
23565         incorrect.  For example, a method could query its parent before
23566         the parent has any methods and would determine that the parent has
23567         no abstract methods (while it could have had them)).
23568
23569         (RootContext::CreateType): Record the order in which we define the
23570         classes.
23571
23572 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23573
23574         * class.cs (TypeContainer::Populate): Also method definitions can
23575         fail now, keep track of this.
23576
23577         (TypeContainer::FindMembers): Implement support for
23578         DeclaredOnly/noDeclaredOnly flag.
23579
23580         (Constructor::Emit) Return the ConstructorBuilder.
23581
23582         (Method::Emit) Return the MethodBuilder. 
23583         Check for abstract or virtual methods to be public.
23584
23585         * rootcontext.cs (RootContext::CreateType): Register all the
23586         abstract methods required for the class to be complete and the
23587         interface methods that must be implemented. 
23588
23589         * cs-parser.jay: Report error 501 (method requires body if it is
23590         not marked abstract or extern).
23591
23592         * expression.cs (TypeOf::Emit): Implement.
23593
23594         * typemanager.cs: runtime_handle_type, new global type.
23595
23596         * class.cs (Property::Emit): Generate code for properties.
23597
23598 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23599
23600         * expression.cs (Unary::ResolveOperator): Find operators on base type
23601         too - we now conform exactly to the spec.
23602
23603         (Binary::ResolveOperator): Same here.
23604
23605         * class.cs (Operator::Define): Fix minor quirk in the tests.
23606
23607         * ../errors/cs0215.cs : Added.
23608
23609         * ../errors/cs0556.cs : Added.
23610
23611         * ../errors/cs0555.cs : Added.
23612
23613 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23614
23615         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23616         single integer which is really efficient
23617
23618 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23619
23620         *  expression.cs (Expression::ImplicitUserConversion): Use location
23621         even in the case when we are examining True operators.
23622  
23623         * class.cs (Operator::Define): Perform extensive checks to conform
23624         with the rules for operator overloading in the spec.
23625
23626         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23627         some of the other conversions mentioned in the spec.
23628
23629         * typemanager.cs (array_type): New static member for the System.Array built-in
23630         type.
23631
23632         (cloneable_interface): For System.ICloneable interface.
23633
23634         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23635         we start resolving the tree and populating types.
23636
23637         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23638  
23639 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23640
23641         * expression.cs (Expression::ExprClassFromMemberInfo,
23642         Expression::Literalize): Create literal expressions from
23643         FieldInfos which are literals.
23644
23645         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23646         type casts, because they were wrong.  The test suite in tests
23647         caught these ones.
23648
23649         (ImplicitNumericConversion): ushort to ulong requires a widening
23650         cast. 
23651
23652         Int32 constant to long requires widening cast as well.
23653
23654         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23655         for integers because the type on the stack is not i4.
23656
23657 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23658
23659         * expression.cs (report118): require location argument. 
23660
23661         * parameter.cs: Do not dereference potential null value.
23662
23663         * class.cs: Catch methods that lack the `new' keyword when
23664         overriding a name.  Report warnings when `new' is used without
23665         anything being there to override.
23666
23667         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23668
23669         * class.cs: Only add constructor to hashtable if it is non-null
23670         (as now constructors can fail on define).
23671
23672         (TypeManager, Class, Struct): Take location arguments.
23673
23674         Catch field instance initialization in structs as errors.
23675
23676         accepting_filter: a new filter for FindMembers that is static so
23677         that we dont create an instance per invocation.
23678
23679         (Constructor::Define): Catch errors where a struct constructor is
23680         parameterless 
23681
23682         * cs-parser.jay: Pass location information for various new
23683         constructs. 
23684
23685         * delegate.cs (Delegate): take a location argument.
23686
23687         * driver.cs: Do not call EmitCode if there were problesm in the
23688         Definition of the types, as many Builders wont be there. 
23689
23690         * decl.cs (Decl::Decl): Require a location argument.
23691
23692         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23693         into integers, and find the most appropiate integer for it.
23694
23695         * literal.cs: Implement ULongLiteral.
23696
23697         * rootcontext.cs: Provide better information about the location of
23698         failure when CreateType fails.
23699
23700 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23701
23702         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23703         as well.
23704
23705         * expression.cs (Binary::CheckShiftArguments): Add missing type
23706         computation.
23707         (Binary::ResolveOperator): Add type to the logical and and logical
23708         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23709         before.
23710
23711         (Binary::DoNumericPromotions): In the case where either argument
23712         is ulong (and most signed types combined with ulong cause an
23713         error) perform implicit integer constant conversions as well.
23714
23715 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23716
23717         * expression.cs (UserImplicitCast): Method should always be
23718         non-null. 
23719         (Invocation::BetterConversion): Simplified test for IntLiteral.
23720
23721         (Expression::ImplicitNumericConversion): Split this routine out.
23722         Put the code that performs implicit constant integer conversions
23723         here. 
23724
23725         (Expression::Resolve): Become a wrapper around DoResolve so we can
23726         check eclass and type being set after resolve.
23727
23728         (Invocation::Badness): Remove this dead function
23729
23730         (Binary::ResolveOperator): Do not compute the expensive argumnets
23731         unless we have a union for it.
23732
23733         (Probe::Emit): Is needs to do an isinst and then
23734         compare against null.
23735
23736         (::CanConvert): Added Location argument.  If the Location argument
23737         is null (Location.Null), then we do not report errors.  This is
23738         used by the `probe' mechanism of the Explicit conversion.  We do
23739         not want to generate an error for something that the user
23740         explicitly requested to be casted.  But the pipeline for an
23741         explicit cast first tests for potential implicit casts.
23742
23743         So for now, if the Location is null, it means `Probe only' to
23744         avoid adding another argument.   Might have to revise this
23745         strategy later.
23746
23747         (ClassCast): New class used to type cast objects into arbitrary
23748         classes (used in Explicit Reference Conversions).
23749
23750         Implement `as' as well.
23751
23752         Reverted all the patches from Ravi below: they were broken:
23753
23754                 * The use of `level' as a mechanism to stop recursive
23755                   invocations is wrong.  That was there just to catch the
23756                   bug with a strack trace but not as a way of addressing
23757                   the problem.
23758
23759                   To fix the problem we have to *understand* what is going
23760                   on and the interactions and come up with a plan, not
23761                   just get things going.
23762
23763                 * The use of the type conversion cache that I proposed
23764                   last night had an open topic: How does this work across
23765                   protection domains.  A user defined conversion might not
23766                   be public in the location where we are applying the
23767                   conversion, a different conversion might be selected
23768                   (ie, private A->B (better) but public B->A (worse),
23769                   inside A, A->B applies, but outside it, B->A will
23770                   apply).
23771
23772                 * On top of that (ie, even if the above is solved),
23773                   conversions in a cache need to be abstract.  Ie, `To
23774                   convert from an Int to a Short use an OpcodeCast', not
23775                   `To convert from an Int to a Short use the OpcodeCast on
23776                   the variable 5' (which is what this patch was doing).
23777
23778 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23779
23780         * expression.cs (Invocation::ConversionExists): Re-write to use
23781         the conversion cache
23782
23783         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23784         cache all conversions done, not just user-defined ones.
23785
23786         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23787         to determine if a conversion exists instead of acutually trying to 
23788         perform the conversion. It's faster too.
23789
23790         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23791         and only then attempt the implicit conversion.
23792
23793 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23794
23795         * expression.cs (ConvertImplicit): Use a cache for conversions
23796         already found. Check level of recursion and bail out if necessary.
23797
23798 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23799
23800         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23801         Export standard methods that we expect for string operations.
23802
23803         * statement.cs (Block::UsageWarning): Track usage of variables and
23804         report the errors for not used variables.
23805
23806         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23807         operator. 
23808
23809 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23810
23811         * codegen.cs: remove unnneded code 
23812
23813         * expression.cs: Removed BuiltinTypeAccess class
23814
23815         Fix the order in which implicit conversions are
23816         done.  
23817
23818         The previous fixed dropped support for boxed conversions (adding a
23819         test to the test suite now)
23820
23821         (UserImplicitCast::CanConvert): Remove test for source being null,
23822         that code is broken.  We should not feed a null to begin with, if
23823         we do, then we should track the bug where the problem originates
23824         and not try to cover it up here.
23825
23826         Return a resolved expression of type UserImplicitCast on success
23827         rather than true/false.  Ravi: this is what I was talking about,
23828         the pattern is to use a static method as a "constructor" for
23829         objects. 
23830
23831         Also, do not create arguments until the very last minute,
23832         otherwise we always create the arguments even for lookups that
23833         will never be performed. 
23834
23835         (UserImplicitCast::Resolve): Eliminate, objects of type
23836         UserImplicitCast are born in a fully resolved state. 
23837
23838         * typemanager.cs (InitCoreTypes): Init also value_type
23839         (System.ValueType). 
23840
23841         * expression.cs (Cast::Resolve): First resolve the child expression.
23842
23843         (LValue): Add new method AddressOf to be used by
23844         the `&' operator.  
23845
23846         Change the argument of Store to take an EmitContext instead of an
23847         ILGenerator, because things like FieldExpr need to be able to call
23848         their children expression to generate the instance code. 
23849
23850         (Expression::Error, Expression::Warning): Sugar functions for
23851         reporting errors.
23852
23853         (Expression::MemberLookup): Accept a TypeContainer instead of a
23854         Report as the first argument.
23855
23856         (Expression::ResolvePrimary): Killed.  I still want to improve
23857         this as currently the code is just not right.
23858
23859         (Expression::ResolveMemberAccess): Simplify, but it is still
23860         wrong. 
23861
23862         (Unary::Resolve): Catch errors in AddressOf operators.
23863
23864         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23865         index to a byte for the short-version, or the compiler will choose
23866         the wrong Emit call, which generates the wrong data.
23867
23868         (ParameterReference::Emit, ::Store): same.
23869
23870         (FieldExpr::AddressOf): Implement.
23871
23872         * typemanager.cs: TypeManager: made public variable instead of
23873         property.
23874
23875         * driver.cs: document --fatal.
23876
23877         * report.cs (ErrorMessage, WarningMessage): new names for the old
23878         Error and Warning classes.
23879
23880         * cs-parser.jay (member_access): Turn built-in access to types
23881         into a normal simplename
23882
23883 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23884
23885         * expression.cs (Invocation::BetterConversion): Fix to cope
23886         with q being null, since this was introducing a bug.
23887
23888         * expression.cs (ConvertImplicit): Do built-in conversions first.
23889
23890 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23891
23892         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23893
23894 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23895
23896         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23897         I had introduced long ago (what's new ?).
23898
23899         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23900         the work of all the checking. 
23901         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23902         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23903
23904         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23905         that is the right way. 
23906
23907         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23908         overloading resolution. Use everywhere instead of cutting and pasting code.
23909
23910         (Binary::ResolveOperator): Use MakeUnionSet.
23911
23912         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23913         we have to convert to bool types. Not complete yet.
23914
23915 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23916
23917         * typemanager.cs (TypeManager::CSharpName): support ushort.
23918
23919         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23920         to provide an expression that performsn an implicit constant int
23921         conversion (section 6.1.6).
23922         (Expression::ConvertImplicitRequired): Reworked to include
23923         implicit constant expression conversions.
23924
23925         (Expression::ConvertNumericExplicit): Finished.
23926
23927         (Invocation::Emit): If InstanceExpression is null, then it means
23928         that we perform a call on this.
23929
23930 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23931
23932         * expression.cs (Unary::Emit): Remove some dead code.
23933         (Probe): Implement Resolve and Emit for `is'.
23934         (Expression::ConvertImplicitRequired): Attempt to do constant
23935         expression conversions here.  Maybe should be moved to
23936         ConvertImplicit, but I am not sure.
23937         (Expression::ImplicitLongConstantConversionPossible,
23938         Expression::ImplicitIntConstantConversionPossible): New functions
23939         that tell whether is it possible to apply an implicit constant
23940         expression conversion.
23941
23942         (ConvertNumericExplicit): Started work on explicit numeric
23943         conversions.
23944
23945         * cs-parser.jay: Update operator constants.
23946
23947         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23948         (Parameters::GetSignature): Hook up VerifyArgs here.
23949         (Parameters::VerifyArgs): Verifies that no two arguments have the
23950         same name. 
23951
23952         * class.cs (Operator): Update the operator names to reflect the
23953         ones that the spec expects (as we are just stringizing the
23954         operator names).
23955
23956         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23957         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23958         previous usage did only work for our methods.
23959         (Expression::ConvertImplicit): Handle decimal implicit numeric
23960         conversions as well.
23961         (Expression::InternalTypeConstructor): Used to invoke constructors
23962         on internal types for default promotions.
23963
23964         (Unary::Emit): Implement special handling for the pre/post
23965         increment/decrement for overloaded operators, as they need to have
23966         the same semantics as the other operators.
23967
23968         (Binary::ResolveOperator): ditto.
23969         (Invocation::ConversionExists): ditto.
23970         (UserImplicitCast::Resolve): ditto.
23971
23972 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23973
23974         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23975         operator, return after emitting body. Regression tests pass again !
23976
23977         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23978         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23979         (Invocation::OverloadResolve): Ditto.
23980         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23981
23982         * everywhere : update calls to the above methods accordingly.
23983
23984 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23985
23986         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23987
23988         * expression.cs (ExpressionStatement): New base class used for
23989         expressions that can appear in statements, so that we can provide
23990         an alternate path to generate expression that do not leave a value
23991         on the stack.
23992
23993         (Expression::Emit, and all the derivatives): We no longer return
23994         whether a value is left on the stack or not.  Every expression
23995         after being emitted leaves a single value on the stack.
23996
23997         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23998         facilties of ExpressionStatement if possible.
23999
24000         * cs-parser.jay: Update statement_expression.
24001
24002 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24003
24004         * driver.cs: Change the wording of message
24005
24006 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24007
24008         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24009         the type of the expression to the return type of the method if
24010         we have an overloaded operator match ! The regression tests pass again !
24011         (Unary::ResolveOperator): Ditto.
24012
24013         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24014         to find "op_Implicit", not "implicit" ;-)
24015         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24016         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24017
24018         * everywhere : Correct calls to the above accordingly.
24019
24020         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24021         (ConvertImplicit): Do user-defined conversion if it exists.
24022
24023 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24024
24025         * assign.cs: track location.
24026         (Resolve): Use implicit conversions on assignment.
24027
24028         * literal.cs: Oops.  Not good, Emit of short access values should
24029         pass (Bytes) or the wrong argument will be selected.
24030
24031         * expression.cs (Unary::Emit): Emit code for -expr.
24032
24033         (Unary::ResolveOperator): Handle `Substract' for non-constants
24034         (substract from zero from the non-constants).
24035         Deal with Doubles as well. 
24036
24037         (Expression::ConvertImplicitRequired): New routine that reports an
24038         error if no implicit conversion exists. 
24039
24040         (Invocation::OverloadResolve): Store the converted implicit
24041         expressions if we make them
24042
24043 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24044
24045         * class.cs (ConstructorInitializer): Take a Location argument.
24046         (ConstructorBaseInitializer): Same here.
24047         (ConstructorThisInitializer): Same here.
24048
24049         * cs-parser.jay : Update all calls accordingly.
24050
24051         * expression.cs (Unary, Binary, New): Take location argument.
24052         Update accordingly everywhere.
24053
24054         * cs-parser.jay : Update all calls to the above to take a location
24055         argument.
24056
24057         * class.cs : Ditto.
24058
24059 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24060
24061         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24062         (Invocation::BetterConversion): Same here
24063         (Invocation::ConversionExists): Ditto.
24064
24065         (Invocation::ConversionExists): Implement.
24066
24067 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24068
24069         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24070         Also take an additional TypeContainer argument.
24071
24072         * All over : Pass in TypeContainer as argument to OverloadResolve.
24073
24074         * typemanager.cs (CSharpName): Update to check for the string type and return
24075         that too.
24076
24077         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24078         a given method.
24079
24080 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24081
24082         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24083         (Invocation::BetterFunction): Implement.
24084         (Invocation::BetterConversion): Implement.
24085         (Invocation::ConversionExists): Skeleton, no implementation yet.
24086
24087         Okay, things work fine !
24088
24089 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24090
24091         * typemanager.cs: declare and load enum_type, delegate_type and
24092         void_type. 
24093
24094         * expression.cs (Expression::Emit): Now emit returns a value that
24095         tells whether a value is left on the stack or not.  This strategy
24096         might be reveted tomorrow with a mechanism that would address
24097         multiple assignments.
24098         (Expression::report118): Utility routine to report mismatches on
24099         the ExprClass.
24100
24101         (Unary::Report23): Report impossible type/operator combination
24102         utility function.
24103
24104         (Unary::IsIncrementableNumber): Whether the type can be
24105         incremented or decremented with add.
24106         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24107         complemented. 
24108         (Unary::ResolveOperator): Implement ++, !, ~,
24109
24110         (Invocation::Emit): Deal with new Emit convetion.
24111
24112         * All Expression derivatives: Updated their Emit method to return
24113         whether they leave values on the stack or not.
24114
24115         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24116         stack for expressions that are statements. 
24117
24118 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24119
24120         * expression.cs (LValue): New interface.  Must be implemented by
24121         LValue objects.
24122         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24123         LValue interface.
24124
24125         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24126         interface for generating code, simplifies the code.
24127
24128 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24129
24130         * expression.cs (everywhere): Comment out return statements in ::Resolve
24131         methods to avoid the warnings.
24132
24133 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24134
24135         * driver.cs (parse): Report error 2001 if we can not open the
24136         source file.
24137
24138         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24139         not resolve it.
24140
24141         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24142         object. 
24143
24144         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24145         otherwise nested blocks end up with the same index.
24146
24147         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24148
24149         * expression.cs:  Instead of having FIXMEs in the Resolve
24150         functions, throw exceptions so it is obvious that we are facing a
24151         bug. 
24152
24153         * cs-parser.jay (invocation_expression): Pass Location information.
24154
24155         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24156         Use a basename for those routines because .NET does not like paths
24157         on them. 
24158
24159         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24160         already defined.
24161
24162 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24163
24164         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24165         are loading the correct data types (throws an exception if not).
24166         (TypeManager::InitCoreTypes): Use CoreLookupType
24167
24168         * expression.cs (Unary::ResolveOperator): return the child
24169         expression for expressions which are just +expr.
24170         (Unary::ResolveOperator): Return negative literals for -LITERAL
24171         expressions (otherwise they are Unary {Literal}).
24172         (Invocation::Badness): Take into account `Implicit constant
24173         expression conversions'.
24174
24175         * literal.cs (LongLiteral): Implement long literal class.
24176         (IntLiteral): export the `Value' of the intliteral. 
24177
24178 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24179
24180         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24181
24182         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24183         instead of 'Operator'
24184
24185         * expression.cs (Binary::ResolveOperator): Update accordingly.
24186         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24187         and 'Minus'
24188
24189         * cs-parser.jay (unary_expression): Update to use the new names.
24190
24191         * gen-treedump.cs (GetUnary): Same here.
24192
24193         * expression.cs (Unary::Resolve): Implement.
24194         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24195         operators are found instead of making noise ;-)
24196         (Unary::ResolveOperator): New method to do precisely the same thing which
24197         Binary::ResolveOperator does for Binary expressions.
24198         (Unary.method, .Arguments): Add.
24199         (Unary::OperName): Implement.   
24200         (Unary::ForceConversion): Copy and Paste !
24201
24202         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24203         a unary operator.
24204
24205         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24206         for the inbuilt operators. Only overloading works for now ;-)
24207
24208 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24209
24210         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24211         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24212
24213         * expression.cs (This::Emit): Implement. 
24214         (This::Resolve): Implement.
24215         (TypeOf:Resolve): Implement.
24216         (Expression::ResolveSimpleName): Add an implicit this to instance
24217         field references. 
24218         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24219         Bind instance variable to Field expressions.
24220         (FieldExpr::Instance): New field used to track the expression that
24221         represents the object instance.
24222         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24223         binding 
24224         (FieldExpr::Emit): Implement.
24225
24226         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24227         the last instruction contains a return opcode to avoid generating
24228         the last `ret' instruction (this generates correct code, and it is
24229         nice to pass the peverify output).
24230
24231         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24232         initializer for static and instance variables.
24233         (Constructor::Emit): Allow initializer to be null in the case of
24234         static constructors.  Only emit initializer for instance
24235         constructors. 
24236
24237         (TypeContainer::FindMembers): Return a null array if there are no
24238         matches.
24239
24240         Also fix the code for the MemberTypes.Method branch, as it was not
24241         scanning that for operators (or tried to access null variables before).
24242
24243         * assign.cs (Assign::Emit): Handle instance and static fields. 
24244
24245         * TODO: Updated.
24246
24247         * driver.cs: Stop compilation if there are parse errors.
24248
24249         * cs-parser.jay (constructor_declaration): Provide default base
24250         initializer for non-static constructors.
24251         (constructor_declarator): Do not provide a default base
24252         initializers if none was specified.
24253         Catch the fact that constructors should not have parameters.
24254
24255         * class.cs: Do not emit parent class initializers for static
24256         constructors, that should be flagged as an error.
24257
24258 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24259
24260         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24261         Move back code into TypeContainer::Populate.
24262
24263 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24264
24265         * class.cs (TypeContainer::AddConstructor): Fix the check to
24266         compare against Name, not Basename. 
24267         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24268
24269         * cs-parser.jay : Update accordingly.
24270
24271         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24272         for methods, don't forget to look into the operators too.
24273         (RegisterMethodBuilder): Helper method to take care of this for
24274         methods, constructors and operators.
24275         (Operator::Define): Completely revamp.
24276         (Operator.OperatorMethod, MethodName): New fields.
24277         (TypeContainer::Populate): Move the registering of builders into
24278         RegisterMethodBuilder.
24279         (Operator::Emit): Re-write.
24280
24281         * expression.cs (Binary::Emit): Comment out code path to emit method
24282         invocation stuff for the case when we have a user defined operator. I am
24283         just not able to get it right !
24284
24285 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24286
24287         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24288         argument. 
24289
24290         (Expression::MemberLookup): Provide a version that allows to
24291         specify the MemberTypes and BindingFlags. 
24292
24293         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24294         so it was not fetching variable information from outer blocks.
24295
24296         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24297         Beforefieldinit as it was buggy.
24298
24299         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24300         that Ravi put here.  
24301
24302         * class.cs (Constructor::Emit): Only emit if block is not null.
24303         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24304         deal with this by semantically definining it as if the user had
24305         done it.
24306
24307         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24308         constructors as we now "emit" them at a higher level.
24309
24310         (TypeContainer::DefineDefaultConstructor): Used to define the
24311         default constructors if none was provided.
24312
24313         (ConstructorInitializer): Add methods Resolve and Emit. 
24314
24315         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24316
24317 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24318
24319         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24320         the default constructor builder with our hashtable for methodbuilders
24321         to methodcores.
24322
24323         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24324         and argument_count is 0 in which case we have a match.
24325         (Binary::ResolveOperator): More null checking and miscellaneous coding
24326         style cleanup.
24327
24328 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24329
24330         * rootcontext.cs (IsNameSpace): Compare against null.
24331
24332         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24333
24334         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24335         and Unary::Operator.
24336
24337         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24338         accordingly.
24339
24340         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24341         we have overloaded operators.
24342         (Binary::ResolveOperator): Implement the part which does the operator overload
24343         resolution.
24344
24345         * class.cs (Operator::Emit): Implement.
24346         (TypeContainer::Emit): Emit the operators we have too.
24347
24348         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24349         the case when we have a user-defined operator.
24350
24351 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24352
24353         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24354
24355 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24356
24357         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24358         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24359         (Constructor::Emit): Implement.
24360         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24361         if we have no work to do. 
24362         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24363         Emit method.
24364
24365         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24366         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24367
24368         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24369         of parent.parent.
24370
24371 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24372
24373         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24374         in the source.
24375         (Tree::RecordNamespace): Method to do what the name says ;-)
24376         (Tree::Namespaces): Property to get at the namespaces hashtable.
24377
24378         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24379         keep track.
24380
24381         * rootcontext.cs (IsNamespace): Fixed it :-)
24382
24383 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24384
24385         * class.cs (TypeContainer::FindMembers): Add support for
24386         constructors. 
24387         (MethodCore): New class that encapsulates both the shared aspects
24388         of a Constructor and a Method.  
24389         (Method, Constructor): Factored pieces into MethodCore.
24390
24391         * driver.cs: Added --fatal which makes errors throw exceptions.
24392         Load System assembly as well as part of the standard library.
24393
24394         * report.cs: Allow throwing exceptions on errors for debugging.
24395
24396         * modifiers.cs: Do not use `parent', instead use the real type
24397         container to evaluate permission settings.
24398
24399         * class.cs: Put Ravi's patch back in.  He is right, and we will
24400         have to cope with the
24401
24402 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24403
24404         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24405         FamORAssem, not FamANDAssem.
24406
24407 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24408
24409         * driver.cs: Added --parse option that only parses its input files
24410         and terminates.
24411
24412         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24413         incorrect.  IsTopLevel is not used to tell whether an object is
24414         root_types or not (that can be achieved by testing this ==
24415         root_types).  But to see if this is a top-level *class* (not
24416         necessarly our "toplevel" container). 
24417
24418 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24419
24420         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24421         parent instead of a direct call to GetType.
24422
24423 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24424
24425         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24426         Modifiers.TypeAttr. This should just be a call to that method.
24427
24428         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24429         object so that we can determine if we are top-level or not.
24430
24431         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24432         TypeContainer too.
24433
24434         * enum.cs (Enum::Define): Ditto.
24435
24436         * modifiers.cs (FieldAttr): Re-write.
24437
24438         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24439         (TypeContainer::HaveStaticConstructor): New property to provide access
24440         to precisely that info.
24441
24442         * modifiers.cs (MethodAttr): Re-write.
24443         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24444
24445         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24446         of top-level types as claimed.
24447
24448 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24449
24450         * expression.cs (MemberLookup): Fruitless attempt to lookup
24451         constructors.  Maybe I need to emit default constructors?  That
24452         might be it (currently .NET emits this for me automatically).
24453         (Invocation::OverloadResolve): Cope with Arguments == null.
24454         (Invocation::EmitArguments): new function, shared by the new
24455         constructor and us.
24456         (Invocation::Emit): Handle static and instance methods.  Emit
24457         proper call instruction for virtual or non-virtual invocations.
24458         (New::Emit): Implement.
24459         (New::Resolve): Implement.
24460         (MemberAccess:Resolve): Implement.
24461         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24462         to track instances.
24463         (FieldExpr::Resolve): Set type.
24464
24465         * support.cs: Handle empty arguments.
24466                 
24467         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24468         SimpleLookup): Auxiliary routines to help parse a qualifier
24469         identifier.  
24470
24471         Update qualifier_identifier rule.
24472
24473         * codegen.cs: Removed debugging messages.
24474
24475         * class.cs: Make this a global thing, this acts just as a "key" to
24476         objects that we might have around.
24477
24478         (Populate): Only initialize method_builders_to_methods once.
24479
24480         * expression.cs (PropertyExpr): Initialize type from the
24481         PropertyType. 
24482
24483         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24484         Resolve pattern.  Attempt to implicitly convert value to boolean.
24485         Emit code.
24486
24487         * expression.cs: Set the type for the int32/int32 argument case.
24488         (Binary::ResolveOperator): Set the return type to boolean for
24489         comparission operators
24490
24491         * typemanager.cs: Remove debugging print code.
24492
24493         (Invocation::Resolve): resolve type.
24494
24495         * class.cs: Allocate a MemberInfo of the correct size, as the code
24496         elsewhere depends on the test to reflect the correct contents.
24497
24498         (Method::) Keep track of parameters, due to System.Reflection holes
24499
24500         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24501         mapping here.
24502
24503         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24504         of the exact size and return that.
24505
24506         (Class::LookupMethodByBuilder): New function that maps
24507         MethodBuilders to its methods.  Required to locate the information
24508         on methods because System.Reflection bit us again.
24509
24510         * support.cs: New file, contains an interface ParameterData and
24511         two implementations: ReflectionParameters and InternalParameters
24512         used to access Parameter information.  We will need to grow this
24513         as required.
24514
24515         * expression.cs (Invocation::GetParameterData): implement a cache
24516         and a wrapper around the ParameterData creation for methods. 
24517         (Invocation::OverloadResolve): Use new code.
24518
24519 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24520
24521         * class.cs (TypeContainer::EmitField): Remove and move into 
24522         (Field::Define): here and modify accordingly.
24523         (Field.FieldBuilder): New member.
24524         (TypeContainer::Populate): Update accordingly.
24525         (TypeContainer::FindMembers): Implement.
24526
24527 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24528
24529         * statement.cs: (VariableInfo::VariableType): New field to be
24530         initialized with the full type once it is resolved. 
24531
24532 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24533
24534         * parameter.cs (GetParameterInfo): Use a type cache to compute
24535         things only once, and to reuse this information
24536
24537         * expression.cs (LocalVariableReference::Emit): Implement.
24538         (OpcodeCast::Emit): fix.
24539
24540         (ParameterReference::Resolve): Implement.
24541         (ParameterReference::Emit): Implement.
24542
24543         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24544         that are expressions need to stay as Expressions.
24545
24546         * typemanager.cs (CSharpName): Returns the C# name of a type if
24547         possible. 
24548
24549         * expression.cs (Expression::ConvertImplicit): New function that
24550         implements implicit type conversions.
24551
24552         (Expression::ImplicitReferenceConversion): Implements implicit
24553         reference conversions.
24554
24555         (EmptyCast): New type for transparent casts.
24556
24557         (OpcodeCast): New type for casts of types that are performed with
24558         a sequence of bytecodes.
24559
24560         (BoxedCast): New type used for casting value types into reference
24561         types.  Emits a box opcode.
24562
24563         (Binary::DoNumericPromotions): Implements numeric promotions of
24564         and computation of the Binary::Type.
24565
24566         (Binary::EmitBranchable): Optimization.
24567
24568         (Binary::Emit): Implement code emission for expressions.
24569
24570         * typemanager.cs (TypeManager): Added two new core types: sbyte
24571         and byte.
24572
24573 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24574
24575         * class.cs (TypeContainer::FindMembers): Method which does exactly
24576         what Type.FindMembers does, only we don't have to use reflection. No
24577         implementation yet.
24578
24579         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24580         typecontainer objects as we need to get at them.
24581         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24582
24583         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24584         typecontainer object.
24585
24586         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24587         of just a Report object.
24588
24589 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24590
24591         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24592         "remove_"
24593         (TypeContainer::Populate): Now define the delegates of the type too.
24594         (TypeContainer.Delegates): Property to access the list of delegates defined
24595         in the type.
24596
24597         * delegates.cs (Delegate::Define): Implement partially.
24598
24599         * modifiers.cs (TypeAttr): Handle more flags.
24600
24601 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24602
24603         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24604         and not <=
24605         (Operator::Define): Re-write logic to get types by using the LookupType method
24606         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24607         (Indexer::Define): Ditto.
24608         (Event::Define): Ditto.
24609         (Property::Define): Ditto.
24610
24611 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24612
24613         * class.cs (TypeContainer::Populate): Now define operators too. 
24614         (TypeContainer.Operators): New property to access the list of operators
24615         in a type.
24616         (Operator.OperatorMethodBuilder): New member to hold the method builder
24617         for the operator we are defining.
24618         (Operator::Define): Implement.
24619
24620 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24621
24622         * class.cs (Event::Define): Make the prefixes of the accessor methods
24623         addOn_ and removeOn_ 
24624
24625         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24626         of the location being passed in too. Ideally, this should go later since all
24627         error reporting should be done through the Report object.
24628
24629         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24630         (Populate): Iterate thru the indexers we have and define them too.
24631         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24632         for the get and set accessors.
24633         (Indexer::Define): Implement.
24634
24635 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24636
24637         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24638         my previous implementation, did not work.
24639
24640         * typemanager.cs: Add a couple of missing types (the longs).
24641
24642         * literal.cs: Use TypeManager.bool_type instead of getting it.
24643
24644         * expression.cs (EventExpr): New kind of expressions.
24645         (Expressio::ExprClassFromMemberInfo): finish
24646
24647 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24648
24649         * assign.cs: Emit stores to static fields differently.
24650
24651 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24652
24653         * Merge in changes and adjust code to tackle conflicts. Backed out my
24654         code in Assign::Resolve ;-) 
24655
24656 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24657
24658         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24659         instead Report.Error and also pass in the location.
24660         (CSharpParser::Lexer): New readonly property to return the reference
24661         to the Tokenizer object.
24662         (declare_local_variables): Use Report.Error with location instead of plain 
24663         old error.
24664         (CheckDef): Ditto.
24665
24666         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24667         (Operator.CheckBinaryOperator): Ditto.
24668
24669         * cs-parser.jay (operator_declarator): Update accordingly.
24670
24671         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24672         (CheckBinaryOperator): Same here.
24673
24674         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24675         on the name without any prefixes of namespace names etc. This is because we
24676         already might have something already fully qualified like 
24677         'System.Console.WriteLine'
24678
24679         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24680
24681 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24682
24683         * cs-tokenizer.cs (location): Return a string which also contains
24684         the file name.
24685
24686         * expression.cs (ElementAccess): New class for expressions of the
24687         type 'element access.'
24688         (BaseAccess): New class for expressions of the type 'base access.'
24689         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24690         respectively.
24691
24692         * cs-parser.jay (element_access): Implement action.
24693         (base_access): Implement actions.
24694         (checked_expression, unchecked_expression): Implement.
24695
24696         * cs-parser.jay (local_variable_type): Correct and implement.
24697         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24698
24699         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24700
24701         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24702         name and the specifiers.
24703
24704         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24705
24706         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24707         making them all public ;-)
24708
24709         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24710         class anyways.
24711
24712 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24713
24714         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24715         PropertyExprs.
24716         (FieldExpr, PropertyExprs): New resolved expressions.
24717         (SimpleName::MemberStaticCheck): Perform static checks for access
24718         to non-static fields on static methods. Maybe this should be
24719         generalized for MemberAccesses. 
24720         (SimpleName::ResolveSimpleName): More work on simple name
24721         resolution. 
24722
24723         * cs-parser.jay (primary_expression/qualified_identifier): track
24724         the parameter index.
24725
24726         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24727         (EmitContext::EmitBoolExpression): Chain to expression generation
24728         instead of temporary hack.
24729         (::EmitStatementExpression): Put generic expression code generation.
24730
24731         * assign.cs (Assign::Emit): Implement variable assignments to
24732         local variables, parameters and fields.
24733
24734 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24735
24736         * statement.cs (Block::GetVariableInfo): New method, returns the
24737         VariableInfo for a variable name in a block.
24738         (Block::GetVariableType): Implement in terms of GetVariableInfo
24739
24740         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24741         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24742
24743 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24744
24745         * cs-parser.jay (operator_declaration): Continue on my quest : update
24746         to take attributes argument.
24747         (event_declaration): Ditto.
24748         (enum_declaration): Ditto.
24749         (indexer_declaration): Ditto.
24750
24751         * class.cs (Operator::Operator): Update constructor accordingly.
24752         (Event::Event): Ditto.
24753
24754         * delegate.cs (Delegate::Delegate): Same here.
24755
24756         * enum.cs (Enum::Enum): Same here.
24757
24758 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24759
24760         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24761
24762         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24763
24764         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24765         being passed around as an arraylist.
24766         (Attributes::AddAttribute): Method to add attribute sections.
24767
24768         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24769         (struct_declaration): Update accordingly.
24770         (constant_declaration): Update.
24771         (field_declaration): Update.
24772         (method_header): Update.
24773         (fixed_parameter): Update.
24774         (parameter_array): Ditto.
24775         (property_declaration): Ditto.
24776         (destructor_declaration): Ditto.
24777
24778         * class.cs (Struct::Struct): Update constructors accordingly.
24779         (Class::Class): Ditto.
24780         (Field::Field): Ditto.
24781         (Method::Method): Ditto.
24782         (Property::Property): Ditto.
24783         (TypeContainer::OptAttribute): update property's return type.
24784
24785         * interface.cs (Interface.opt_attributes): New member.
24786         (Interface::Interface): Update to take the extra Attributes argument.
24787
24788         * parameter.cs (Parameter::Parameter): Ditto.
24789
24790         * constant.cs (Constant::Constant): Ditto.
24791
24792         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24793         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24794         the attributes as a parameter.
24795         (InterfaceProperty): Update constructor call.
24796         (InterfaceEvent): Ditto.
24797         (InterfaceMethod): Ditto.
24798         (InterfaceIndexer): Ditto.
24799
24800         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24801         pass the attributes too.
24802         (interface_event_declaration): Ditto.
24803         (interface_property_declaration): Ditto.
24804         (interface_method_declaration): Ditto.
24805         (interface_declaration): Ditto.
24806
24807 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24808
24809         * class.cs (Method::Define): Track the "static Main" definition to
24810         create an entry point. 
24811
24812         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24813         EntryPoint if we find it. 
24814
24815         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24816         (EmitContext::ig): Make this variable public.
24817
24818         * driver.cs: Make the default output file be the first file name
24819         with the .exe extension.  
24820
24821         Detect empty compilations
24822
24823         Handle various kinds of output targets.  Handle --target and
24824         rename -t to --dumper.
24825
24826         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24827         methods inherited from Expression return now an Expression.  This
24828         will is used during the tree rewriting as we resolve them during
24829         semantic analysis.
24830
24831         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24832         the spec.  Missing entirely is the information about
24833         accessability of elements of it.
24834
24835         (Expression::ExprClassFromMemberInfo): New constructor for
24836         Expressions that creates a fully initialized Expression based on
24837         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24838         a Type.
24839
24840         (Invocation::Resolve): Begin implementing resolution of invocations.
24841
24842         * literal.cs (StringLiteral):  Implement Emit.
24843
24844 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24845
24846         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24847         member.
24848
24849 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24850
24851         * cs-parser.jay (attribute_arguments): Implement actions.
24852         (attribute): Fix bug in production. Implement action.
24853         (attribute_list): Implement.
24854         (attribute_target): Implement.
24855         (attribute_target_specifier, opt_target_specifier): Implement
24856         (CheckAttributeTarget): New method to check if the attribute target
24857         is valid.
24858         (attribute_section): Implement.
24859         (opt_attributes): Implement.
24860
24861         * attribute.cs : New file to handle attributes.
24862         (Attribute): Class to hold attribute info.
24863
24864         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24865         (attribute_section): Modify production to use 2 different rules to 
24866         achieve the same thing. 1 s/r conflict down !
24867         Clean out commented, useless, non-reducing dimension_separator rules.
24868
24869         * class.cs (TypeContainer.attributes): New member to hold list
24870         of attributes for a type.
24871         (Struct::Struct): Modify to take one more argument, the attribute list.
24872         (Class::Class): Ditto.
24873         (Field::Field): Ditto.
24874         (Method::Method): Ditto.
24875         (Property::Property): Ditto.
24876
24877         * cs-parser.jay (struct_declaration): Update constructor call to
24878         pass in the attributes too.
24879         (class_declaration): Ditto.
24880         (constant_declaration): Ditto.
24881         (field_declaration): Ditto.
24882         (method_header): Ditto.
24883         (fixed_parameter): Ditto.
24884         (parameter_array): Ditto.
24885         (property_declaration): Ditto.
24886
24887         * constant.cs (Constant::Constant): Update constructor similarly.
24888         Use System.Collections.
24889
24890         * parameter.cs (Parameter::Parameter): Update as above.
24891
24892 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24893
24894         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24895         (TypeContainer.delegates): New member to hold list of delegates.
24896
24897         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24898         this time as I seem to be on crack ;-)
24899
24900 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24901
24902         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24903         tell whether an identifier represents a namespace.
24904
24905         * expression.cs (NamespaceExpr): A namespace expression, used only
24906         temporarly during expression resolution.
24907         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24908         utility functions to resolve names on expressions.
24909
24910 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24911
24912         * codegen.cs: Add hook for StatementExpressions. 
24913
24914         * class.cs: Fix inverted test for static flag in methods.
24915
24916 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24917
24918         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24919         to make it coincide with MS' number.
24920         (Operator::CheckBinaryOperator): Ditto.
24921
24922         * ../errors/errors.txt : Remove error numbers added earlier.
24923
24924         * ../errors/cs1019.cs : Test case for error # 1019
24925
24926         * ../errros/cs1020.cs : Test case for error # 1020
24927
24928         * cs-parser.jay : Clean out commented cruft.
24929         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24930         used anywhere - non-reducing rule.
24931         (namespace_declarations): Non-reducing rule - comment out.
24932
24933         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24934         with TypeContainer::AddEnum.
24935
24936         * delegate.cs : New file for delegate handling classes.
24937         (Delegate): Class for declaring delegates.
24938
24939         * makefile : Update.
24940
24941         * cs-parser.jay (delegate_declaration): Implement.
24942
24943 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24944
24945         * class.cs (Event::Define): Implement.
24946         (Event.EventBuilder): New member.
24947
24948         * class.cs (TypeContainer::Populate): Update to define all enums and events
24949         we have.
24950         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24951         readonly fields for all these cases ?
24952
24953 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24954
24955         * class.cs (Property): Revamp to use the convention of making fields readonly.
24956         Accordingly modify code elsewhere.
24957
24958         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24959         the Define method of the Property class.
24960
24961         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24962         trivial bug.
24963         (TypeContainer::Populate): Update to define all the properties we have. Also
24964         define all enumerations.
24965
24966         * enum.cs (Define): Implement.
24967
24968 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24969
24970         * cs-parser.jay (overloadable_operator): The semantic value is an
24971         enum of the Operator class.
24972         (operator_declarator): Implement actions.
24973         (operator_declaration): Implement.
24974
24975         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24976         validity of definitions.
24977         (Operator::CheckBinaryOperator): Static method to check for binary operators
24978         (TypeContainer::AddOperator): New method to add an operator to a type.
24979
24980         * cs-parser.jay (indexer_declaration): Added line to actually call the
24981         AddIndexer method so it gets added ;-)
24982
24983         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24984         already taken care of by the MS compiler ?  
24985
24986 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24987
24988         * class.cs (Operator): New class for operator declarations.
24989         (Operator::OpType): Enum for the various operators.
24990
24991 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24992
24993         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24994         ostensibly handle this in semantic analysis.
24995
24996         * cs-parser.jay (general_catch_clause): Comment out
24997         (specific_catch_clauses, specific_catch_clause): Ditto.
24998         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24999         (catch_args, opt_catch_args): New productions.
25000         (catch_clause): Rewrite to use the new productions above
25001         (catch_clauses): Modify accordingly.
25002         (opt_catch_clauses): New production to use in try_statement
25003         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25004         and re-write the code in the actions to extract the specific and
25005         general catch clauses by being a little smart ;-)
25006
25007         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25008         Hooray, try and catch statements parse fine !
25009
25010 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25011
25012         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25013         string from the hashtable of variables.
25014
25015         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25016         I end up making that mistake ;-)
25017         (catch_clauses): Fixed gross error which made Key and Value of the 
25018         DictionaryEntry the same : $1 !!
25019
25020 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25021
25022         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25023
25024         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25025         when the add and remove accessors are specified. 
25026
25027 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25028
25029         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25030         information about indexer_declarator.
25031         (indexer_declarator): Implement actions.
25032         (parsing_indexer): New local boolean used to keep track of whether
25033         we are parsing indexers or properties. This is necessary because 
25034         implicit_parameters come into picture even for the get accessor in the 
25035         case of an indexer.
25036         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25037
25038         * class.cs (Indexer): New class for indexer declarations.
25039         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25040         (TypeContainer::indexers): New member to hold list of indexers for the
25041         type.
25042
25043 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25044
25045         * cs-parser.jay (add_accessor_declaration): Implement action.
25046         (remove_accessor_declaration): Implement action.
25047         (event_accessors_declaration): Implement
25048         (variable_declarators): swap statements for first rule - trivial.
25049
25050         * class.cs (Event): New class to hold information about event
25051         declarations.
25052         (TypeContainer::AddEvent): New method to add an event to a type
25053         (TypeContainer::events): New member to hold list of events.
25054
25055         * cs-parser.jay (event_declaration): Implement actions.
25056
25057 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25058
25059         * cs-parser.jay (dim_separators): Implement. Make it a string
25060         concatenating all the commas together, just as they appear.
25061         (opt_dim_separators): Modify accordingly
25062         (rank_specifiers): Update accordingly. Basically do the same
25063         thing - instead, collect the brackets here.
25064         (opt_rank_sepcifiers): Modify accordingly.
25065         (array_type): Modify to actually return the complete type string
25066         instead of ignoring the rank_specifiers.
25067         (expression_list): Implement to collect the expressions
25068         (variable_initializer): Implement. We make it a list of expressions
25069         essentially so that we can handle the array_initializer case neatly too.
25070         (variable_initializer_list): Implement.
25071         (array_initializer): Make it a list of variable_initializers
25072         (opt_array_initializer): Modify accordingly.
25073
25074         * expression.cs (New::NType): Add enumeration to help us
25075         keep track of whether we have an object/delegate creation
25076         or an array creation.
25077         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25078         members to hold data about array creation.
25079         (New:New): Modify to update NewType
25080         (New:New): New Overloaded contructor for the array creation
25081         case.
25082
25083         * cs-parser.jay (array_creation_expression): Implement to call
25084         the overloaded New constructor.
25085
25086 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25087
25088         * class.cs (TypeContainer::Constructors): Return member
25089         constructors instead of returning null.
25090
25091 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25092
25093         * typemanager.cs (InitCoreTypes): Initialize the various core
25094         types after we have populated the type manager with the user
25095         defined types (this distinction will be important later while
25096         compiling corlib.dll)
25097
25098         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25099         on Expression Classification.  Now all expressions have a method
25100         `Resolve' and a method `Emit'.
25101
25102         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25103         generation from working.     Also add some temporary debugging
25104         code. 
25105
25106 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25107
25108         * codegen.cs: Lots of code generation pieces.  This is only the
25109         beginning, will continue tomorrow with more touches of polish.  We
25110         handle the fundamentals of if, while, do, for, return.  Others are
25111         trickier and I need to start working on invocations soon.
25112
25113         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25114         s.InitStatement. 
25115
25116         * codegen.cs (EmitContext): New struct, used during code
25117         emission to keep a context.   Most of the code generation will be
25118         here. 
25119
25120         * cs-parser.jay: Add embedded blocks to the list of statements of
25121         this block.  So code generation proceeds in a top down fashion.
25122
25123 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25124
25125         * statement.cs: Add support for multiple child blocks.
25126
25127 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25128
25129         * codegen.cs (EmitCode): New function, will emit the code for a
25130         Block of code given a TypeContainer and its ILGenerator. 
25131
25132         * statement.cs (Block): Standard public readonly optimization.
25133         (Block::Block constructors): Link children. 
25134         (Block::Child): Child Linker.
25135         (Block::EmitVariables): Emits IL variable declarations.
25136
25137         * class.cs: Drop support for MethodGroups here, delay until
25138         Semantic Analysis.
25139         (Method::): Applied the same simplification that I did before, and
25140         move from Properties to public readonly fields.
25141         (Method::ParameterTypes): Returns the parameter types for the
25142         function, and implements a cache that will be useful later when I
25143         do error checking and the semantic analysis on the methods is
25144         performed.
25145         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25146         and made a method, optional argument tells whether this is a class
25147         or a structure to apply the `has-this' bit.
25148         (Method::GetCallingConvention): Implement, returns the calling
25149         convention. 
25150         (Method::Define): Defines the type, a second pass is performed
25151         later to populate the methods.
25152
25153         (Constructor::ParameterTypes): implement a cache similar to the
25154         one on Method::ParameterTypes, useful later when we do semantic
25155         analysis. 
25156
25157         (TypeContainer::EmitMethod):  New method.  Emits methods.
25158
25159         * expression.cs: Removed MethodGroup class from here.
25160
25161         * parameter.cs (Parameters::GetCallingConvention): new method.
25162
25163 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25164
25165         * class.cs (TypeContainer::Populate): Drop RootContext from the
25166         argument. 
25167
25168         (Constructor::CallingConvention): Returns the calling convention.
25169         (Constructor::ParameterTypes): Returns the constructor parameter
25170         types. 
25171
25172         (TypeContainer::AddConstructor): Keep track of default constructor
25173         and the default static constructor.
25174
25175         (Constructor::) Another class that starts using `public readonly'
25176         instead of properties. 
25177
25178         (Constructor::IsDefault): Whether this is a default constructor. 
25179
25180         (Field::) use readonly public fields instead of properties also.
25181
25182         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25183         track of static constructors;  If none is used, turn on
25184         BeforeFieldInit in the TypeAttributes. 
25185
25186         * cs-parser.jay (opt_argument_list): now the return can be null
25187         for the cases where there are no arguments. 
25188
25189         (constructor_declarator): If there is no implicit `base' or
25190         `this', then invoke the default parent constructor. 
25191
25192         * modifiers.cs (MethodAttr): New static function maps a set of
25193         modifiers flags into a MethodAttributes enum
25194         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25195         MethodAttr, TypeAttr to represent the various mappings where the
25196         modifiers are used.
25197         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25198
25199 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25200
25201         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25202         method arguments.
25203
25204         * interface.cs (PopulateIndexer): Implemented the code generator
25205         for interface indexers.
25206
25207 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25208
25209         * interface.cs (InterfaceMemberBase): Now we track the new status
25210         here.  
25211
25212         (PopulateProperty): Implement property population.  Woohoo!  Got
25213         Methods and Properties going today. 
25214
25215         Removed all the properties for interfaces, and replaced them with
25216         `public readonly' fields. 
25217
25218 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25219
25220         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25221         initialize their hashtables/arraylists only when they are needed
25222         instead of doing this always.
25223
25224         * parameter.cs: Handle refs and out parameters.
25225
25226         * cs-parser.jay: Use an ArrayList to construct the arguments
25227         instead of the ParameterCollection, and then cast that to a
25228         Parameter[] array.
25229
25230         * parameter.cs: Drop the use of ParameterCollection and use
25231         instead arrays of Parameters.
25232
25233         (GetParameterInfo): Use the Type, not the Name when resolving
25234         types. 
25235
25236 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25237
25238         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25239         and instead use public readonly fields.
25240
25241         * class.cs: Put back walking code for type containers.
25242
25243 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25244
25245         * class.cs (MakeConstant): Code to define constants.
25246
25247         * rootcontext.cs (LookupType): New function.  Used to locate types 
25248
25249
25250 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25251
25252         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25253         this System.Reflection code is.  Kudos to Microsoft
25254
25255         * typemanager.cs: Implement a type cache and avoid loading all
25256         types at boot time.  Wrap in LookupType the internals.  This made
25257         the compiler so much faster.  Wow.  I rule!
25258
25259         * driver.cs: Make sure we always load mscorlib first (for
25260         debugging purposes, nothing really important).
25261
25262         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25263         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25264
25265         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25266         on namespaces that have been imported using the `using' keyword.
25267
25268         * class.cs (TypeContainer::TypeAttr): Virtualize.
25269         (Class::TypeAttr): Return attributes suitable for this bad boy.
25270         (Struct::TypeAttr): ditto.
25271         Handle nested classes.
25272         (TypeContainer::) Remove all the type visiting code, it is now
25273         replaced with the rootcontext.cs code
25274
25275         * rootcontext.cs (GetClassBases): Added support for structs. 
25276
25277 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25278
25279         * interface.cs, statement.cs, class.cs, parameter.cs,
25280         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25281         Drop use of TypeRefs, and use strings instead.
25282
25283 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25284
25285         * rootcontext.cs: 
25286
25287         * class.cs (Struct::Struct): set the SEALED flags after
25288         checking the modifiers.
25289         (TypeContainer::TypeAttr): new property, returns the
25290         TypeAttributes for a class.  
25291
25292         * cs-parser.jay (type_list): Oops, list production was creating a
25293         new list of base types.
25294
25295         * rootcontext.cs (StdLib): New property.
25296         (GetInterfaceTypeByName): returns an interface by type name, and
25297         encapsulates error handling here.
25298         (GetInterfaces): simplified.
25299         (ResolveTree): Encapsulated all the tree resolution here.
25300         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25301         types. 
25302
25303         * driver.cs: Add support for --nostdlib, to avoid loading the
25304         default assemblies.
25305         (Main): Do not put tree resolution here. 
25306
25307         * rootcontext.cs: Beginning of the class resolution.
25308
25309 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25310
25311         * rootcontext.cs: Provide better error reporting. 
25312
25313         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25314
25315         * rootcontext.cs (CreateInterface): Handle the case where there
25316         are no parent interfaces.
25317
25318         (CloseTypes): Routine to flush types at the end.
25319         (CreateInterface): Track types.
25320         (GetInterfaces): Returns an array of Types from the list of
25321         defined interfaces.
25322
25323         * typemanager.c (AddUserType): Mechanism to track user types (puts
25324         the type on the global type hash, and allows us to close it at the
25325         end). 
25326
25327 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25328
25329         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25330         RecordInterface instead.
25331
25332         * cs-parser.jay: Updated to reflect changes above.
25333
25334         * decl.cs (Definition): Keep track of the TypeBuilder type that
25335         represents this type here.  Not sure we will use it in the long
25336         run, but wont hurt for now.
25337
25338         * driver.cs: Smaller changes to accomodate the new code.
25339
25340         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25341         when done. 
25342
25343         * rootcontext.cs (CreateInterface):  New method, used to create
25344         the System.TypeBuilder type for interfaces.
25345         (ResolveInterfaces): new entry point to resolve the interface
25346         hierarchy. 
25347         (CodeGen): Property, used to keep track of the code generator.
25348
25349 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25350
25351         * cs-parser.jay: Add a second production for delegate_declaration
25352         with `VOID'.
25353
25354         (enum_body): Put an opt_comma here instead of putting it on
25355         enum_body or enum_member_declarations so we can handle trailing
25356         commas on enumeration members.  Gets rid of a shift/reduce.
25357
25358         (type_list): Need a COMMA in the middle.
25359
25360         (indexer_declaration): Tell tokenizer to recognize get/set
25361
25362         * Remove old targets.
25363
25364         * Re-add the parser target.
25365
25366 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25367
25368         * cs-parser.jay: Add precendence rules for a number of operators
25369         ot reduce the number of shift/reduce conflicts in the grammar.
25370
25371 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25372
25373         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25374         and put it here.
25375
25376         Get rid of old crufty code.
25377
25378         * rootcontext.cs: Use this to keep track of the parsed
25379         representation and the defined types available to the program. 
25380
25381         * gen-treedump.cs: adjust for new convention.
25382
25383         * type.cs: Split out the type manager, and the assembly builder
25384         from here. 
25385
25386         * typemanager.cs: the type manager will live here now.
25387
25388         * cil-codegen.cs: And the code generator here. 
25389
25390 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25391
25392         * makefile: Fixed up for easy making.
25393
25394 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25395
25396         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25397         the 
25398
25399         (unary_expression): Expand pre_increment_expression and
25400         post_decrement_expression to reduce a shift/reduce.
25401
25402 2001-07-11  Simon Cozens
25403
25404         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25405
25406         Improve allow_keyword_as_indent name.
25407
25408 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25409
25410         * Adjustments for Beta2. 
25411
25412 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25413
25414         * decl.cs: Added `Define' abstract method.
25415         (InTransit): new property, used to catch recursive definitions. 
25416
25417         * interface.cs: Implement `Define'. 
25418
25419         * modifiers.cs: Map Modifiers.constants to
25420         System.Reflection.TypeAttribute flags.
25421
25422         * class.cs: Keep track of types and user-defined types.
25423         (BuilderInit): New method for creating an assembly
25424         (ResolveType): New function to launch the resolution process, only
25425         used by interfaces for now.
25426
25427         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25428         that are inserted into the name space. 
25429
25430 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25431
25432         * ARGH.  I have screwed up my tree so many times due to the use of
25433         rsync rather than using CVS.  Going to fix this at once. 
25434
25435         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25436         load types.
25437
25438 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25439
25440         * Experiment successful: Use System.Type rather that our own
25441         version of Type.  
25442
25443 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25444
25445         * cs-parser.jay: Removed nsAliases from here.
25446
25447         Use new namespaces, handle `using XXX;' 
25448
25449         * namespace.cs: Reimplemented namespace handling, use a recursive
25450         definition of the class.  Now we can keep track of using clauses
25451         and catch invalid using clauses.
25452
25453 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25454
25455         * gen-treedump.cs: Adapted for all the renaming.
25456
25457         * expression.cs (Expression): this class now has a Type property
25458         which returns an expression Type.
25459
25460         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25461         `Type', as this has a different meaning now in the base
25462
25463 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25464
25465         * interface.cs, class.cs: Removed from all the sources the
25466         references to signature computation, as we can not do method
25467         signature computation during the parsing time, as we are not
25468         trying to solve at that point distinguishing:
25469
25470         class X {
25471                 void a (Blah x) {}
25472                 void a (NS.Blah x) {}
25473         }
25474
25475         Which depending on the context might be valid or not, as we do not
25476         know if Blah is the same thing as NS.Blah at that point.
25477
25478         * Redid everything so the code uses TypeRefs now instead of
25479         Types.  TypeRefs are just temporary type placeholders, that need
25480         to be resolved.  They initially have a pointer to a string and the
25481         current scope in which they are used.  This is used later by the
25482         compiler to resolve the reference to an actual Type. 
25483
25484         * DeclSpace is no longer a CIR.Type, and neither are
25485         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25486         are all DeclSpaces, but no Types. 
25487
25488         * type.cs (TypeRefManager): This implements the TypeRef manager,
25489         which keeps track of all the types that need to be resolved after
25490         the parsing has finished. 
25491
25492 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25493
25494         * ARGH.  We are going to have to store `foreach' as a class rather
25495         than resolving it, as we need to verify error 1579 after name
25496         resolution.   *OR* we could keep a flag that says `This request to
25497         IEnumerator comes from a foreach statement' which we can then use
25498         to generate the error.
25499
25500 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25501
25502         * class.cs (TypeContainer.AddMethod): we now add methods to the
25503         MethodGroup instead of the method hashtable.  
25504
25505         * expression.cs: Add MethodGroup abstraction, which gets us one
25506         step closer to the specification in the way we handle method
25507         declarations.  
25508
25509         * cs-parser.jay (primary_expression): qualified_identifier now
25510         tried to match up an identifier to a local variable reference or
25511         to a parameter reference.
25512
25513         current_local_parameters is now a parser global variable that
25514         points to the current parameters for the block, used during name
25515         lookup.
25516
25517         (property_declaration): Now creates an implicit `value' argument to
25518         the set accessor.
25519
25520 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25521
25522         * parameter.cs: Do not use `param' arguments as part of the
25523         signature, per the spec.
25524
25525 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25526
25527         * decl.cs: Base class for classes, structs and interfaces.  This
25528         is the "Declaration Space" 
25529
25530         * cs-parser.jay: Use CheckDef for checking declaration errors
25531         instead of having one on each function.
25532
25533         * class.cs: Factor out some code for handling error handling in
25534         accordance to the "Declarations" section in the "Basic Concepts"
25535         chapter in the ECMA C# spec.
25536
25537         * interface.cs: Make all interface member classes derive from
25538         InterfaceMemberBase.
25539
25540 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25541
25542         * Many things: all interfaces are parsed and generated in
25543         gen-treedump.  Support for member variables, constructors,
25544         destructors, properties, constants is there.
25545
25546         Beginning of the IL backend, but very little done, just there for
25547         testing purposes. 
25548
25549 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25550
25551         * cs-parser.jay: Fix labeled statement.
25552
25553         * cs-tokenizer.cs (escape): Escape " and ' always.
25554         ref_line, ref_name: keep track of the line/filename as instructed
25555         by #line by the compiler.
25556         Parse #line.
25557
25558 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25559
25560         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25561         to match the values in System.CodeDOM.
25562
25563         Divid renamed to Divide.
25564
25565         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25566         statements. 
25567         (Statements.set): remove.
25568
25569         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25570         statements. 
25571
25572         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25573         falseStatements always have valid values. 
25574
25575         * cs-parser.jay: Use System.CodeDOM now.
25576