2007-03-15 Jonathan Pobst <monkey@jpobst.com>
[mono.git] / mcs / mcs / ChangeLog
1 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2
3         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4         'returns'.
5         * statement.cs, iterators.cs, lambda.cs: Update to changes.
6
7         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
8         unconditionally.  Simplify explanation.
9         (Try.Resolve, Using.Resolve): Likewise.
10
11 2007-03-15  Martin Baulig  <martin@ximian.com>
12
13         Fix #80731.
14
15         * decl.cs (DeclSpace): If we're a partial class, use our
16         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
17
18 2007-03-15  Raja R Harinath  <rharinath@novell.com>
19
20         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
21         'throws'.
22         (FlowBranching.UsageVector): Update to changes.
23         (FlowBranching.MergeSiblings): Likewise.
24         * statement.cs: Likewise.
25
26 2007-03-15  Martin Baulig  <martin@ximian.com>
27
28         Fix #79302.
29
30         * decl.cs
31         (MemberCache): Added a special .ctor for type parameters.
32
33         * typemanager.cs
34         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
35         `MemberCache'.  
36
37 2007-03-09  Martin Baulig  <martin@ximian.com>
38
39         * enum.cs (Enum): Make this a TypeContainer.
40         (EnumMember): Derive from `Const'.
41
42         * const.cs
43         (Const.DoResolveValue): New protected virtual method; move most of
44         the functionality of ResolveValue() here so we can override it in
45         `EnumMember'.
46         (Const.CreateConstantReference): Make this virtual.
47
48         * class.cs (Kind): Add `Kind.Enum'.
49         (TypeContainer.Emit): Don't emit the enums here; they're already
50         in the `RootContext.typecontainer_resolve_order'.
51
52         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
53         here; they're already in the `typecontainer_resolve_order'.
54
55         * ecore.cs (EnumConstant.ConvertImplicitly): Add
56         TypeManager.DropGenericTypeArguments().
57
58         * typemanager.cs
59         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
60         (TypeManager.IsEnumType): Likewise.
61         (TypeManager.EnumToUnderlying): Likewise.
62         (TypeManager.IsEqual): Add support for enums.
63
64 2007-03-12  Raja R Harinath  <rharinath@novell.com>
65
66         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
67         DefaultParameterValueAttribute to be undefined, say if System.dll
68         is not referenced.
69
70 2007-03-11  Marek Safar  <marek.safar@gmail.com>
71
72         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
73         any mscorlib.
74
75 2007-03-10  Marek Safar  <marek.safar@gmail.com>
76
77         * class.cs, parameter.cs: Unified parameters verification.
78
79 2007-03-08  Martin Baulig  <martin@ximian.com>
80
81         * cs-parser.jay (constructor_header): Pass the location to the
82         newly created TopLevelBlock.
83
84 2007-03-07  Martin Baulig  <martin@ximian.com>
85
86         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
87
88 2007-03-06  Miguel de Icaza  <miguel@novell.com>
89
90         * convert.cs (ExplicitReferenceConversionExists): Sync this method
91         with the changes from David, fixes the build.
92
93 2007-03-05  David Mitchell  <dmitchell@logos.com>
94
95         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
96         and its base interfaces to a one-dimensional array type S[],
97         provided there is an implicit or explicit reference conversion
98         from S to T.
99
100 2007-03-03  Marek Safar  <marek.safar@gmail.com>
101
102         * cs-tokenizer.cs: Implemented basic linq grammar.
103
104         * driver.cs: Set linq lang version on demand.
105
106 2007-02-26  Marek Safar  <marek.safar@gmail.com>
107
108         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
109
110 2007-02-25  Marek Safar  <marek.safar@gmail.com>
111
112         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
113         (Fixes #80455)
114
115         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
116         here.
117         Check property and event extern attributes.
118
119         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
120         charset.
121
122 2007-02-24  Marek Safar  <marek.safar@gmail.com>
123
124         A fix for bug #80407
125         * ecore.cs: Don't report ambiguity error when methods have same parent.
126
127 2007-02-23  Marek Safar  <marek.safar@gmail.com>
128
129         A fix for bug #80878
130         * class.cs, cs-parser.jay: Event property can host anonymous methods.
131
132 2007-02-22  Marek Safar  <marek.safar@gmail.com>
133
134         * attribute.cs: Enable ExtensionAttribute presence test.
135
136 2007-02-22  Marek Safar  <marek.safar@gmail.com>
137
138         * class.cs: Warn about missing GetHashCode only when Equals is override.
139
140         * decl.cs: Check accessibility of type arguments.
141
142         * typemanager.cs: Correctly report nullable array.
143
144 2007-02-20  Marek Safar  <marek.safar@gmail.com>
145
146         * class.cs, report.cs: Capture more details when things go wrong.
147
148 2007-02-20  Marek Safar  <marek.safar@gmail.com>
149
150         A fix for bug #80650
151         * cs-parser.jay: Anonymous container starts at constructor declaration
152         and not at block beginning because it has to be usable in constructor
153         initializer.
154
155         * statement.cs: Use context location and not block one for error reporting.
156
157 2007-02-18  Marek Safar  <marek.safar@gmail.com>
158
159         A fix for bug #78712
160         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
161         too.
162
163 2007-02-18  Marek Safar  <marek.safar@gmail.com>
164
165         A fix for bug #80493 by Atsushi Enomoto
166         * cs-parser.jay: Ignore invalid attribute target.
167
168 2007-02-18  Marek Safar  <marek.safar@gmail.com>
169  
170         * cs-tokenizer.cs: Ignore '\0' as white space character.
171
172 2007-02-17  Miguel de Icaza  <miguel@novell.com>
173
174         * cs-parser.jay: Add support for lambda expressions to the mcs
175         compiler as well.
176
177         * lambda.cs: Only clone when we are probing, not on the final call
178         (Compatible is the final call). 
179
180         * statement.cs (CloneContext): Introduce class to provide block
181         remapping during clone.
182
183         All statements Clone themselves now.
184
185         (Clone): special handling for blocks, when we clone a block, we
186         register the block inside this routine, as children of the block
187         might trigger a lookup. 
188         
189         * expression.cs: Add support for CloneContext in all expressions. 
190         
191 2007-02-17  Marek Safar  <marek.safar@gmail.com>
192  
193         A fix for bug #80493
194         * statement.cs: Report ambiguous warning when interfaces are not related.
195
196 2007-02-15  Marek Safar  <marek.safar@gmail.com>
197
198         C# 3.0 extension methods.
199
200         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
201         cannot be used directly.
202
203         * class.cs (Class.Emit): Emit extension attribute if any class method
204         is extension method.
205         (Method.Define): Add basic extension method validation conditions.
206         (Method.Emit): Emit extension attribute for method.
207
208         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
209         extension method exists. Currently we follow same approach as Microsoft
210         does, emit even if a method or a class are private but this can change
211         later.
212
213         * cs-parser.jay: Add handling of `this' keyword in method parameters
214         context.
215
216         * decl.cs (DeclSpace.IsStaticClass): New property.
217         (MemberCache.FindExtensionMethods): Looks for extension methods with
218         defined name and extension type.
219
220         * doc.cs: Updated after OverloadResolve changes.
221
222         * driver.cs: Add new soft reference to System.Core.dll.
223
224         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
225         (ExtensionMethodGroupExpr): Represents group of extension methods.
226
227         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
228         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
229         to MethodGroupExpr and made non-static for easier customization.
230         (Invocation.DoResolve): Add extension method lookup when no standard
231         method was found.
232         (MemberAccess.DoResolve): Try extension methods if no member exists.
233
234         * modifiers.cs: Add METHOD_EXTENSION modifier.
235
236         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
237         as well as candidate extension type.
238         (ComputeNamespaces): When assembly constains extension methods registers
239         them.
240         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
241         extension method lookup.
242         (Namespace.LookupExtensionMethod): Looks for extension method in this
243         namespace.
244         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
245         find a method which matches name and extensionType.
246
247         * parameter.cs (Parameter): Add This modifer.
248         (HasExtensionMethodModifier): New property.
249         (Resolve): Add extension parameter check.
250         (ModFlags): turned to property to exclude this modifier as it is not real
251         parameter modifier.
252         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
253
254         * support.cs (ParameterData): Add ExtensionMethodType.
255         (ReflectionParameters): Implemented ExtensionMethodType interface property.
256
257         * typemanager.cs: Add type and ctor extension attribute type.
258
259 2007-02-15  Miguel de Icaza  <miguel@novell.com>
260
261         * report.cs (DisableErrors, EnableErrors): used to prevent error
262         output when we are "trying" to compile various methods with
263         different types. 
264
265         * ecore.cs (Expression): Add Clone method that calls the virtual
266         CloneTo method.  The current CloneTo method in Expression throws
267         an exception so we can track down all the places where this must
268         be implemented (not using abstract, because that would be a lot of
269         up-front-work before we can start testing the implementation
270         idea). 
271
272         Important: we only need Clone capabilities for expressions created
273         by the parser, as the expressions we will be cloning are
274         expressions in the pre-resolved state.   This vastly simplifies
275         the work required. 
276         
277         (SimpleName): Add CloneTo that does nothing.
278         (EmptyCast): Add CloneTo.
279         
280         * expression.cs (Binary): Implement CloneTo.
281         (Invocation.IsApplicable): Store the current ec in
282         EmitContext.TempEc and restore it on return.  This is used so we
283         do not have to sprinkle hundres of methods with an extra
284         EmitContext, we know that the only user is the lambda expression
285         ImplicitConversionExists code. 
286         
287         (Argument): Add Cloning capabilities.
288         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
289         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
290         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
291         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
292         IndexerAccess): Add Clone capability.
293
294         (LocalVariableReference, This): TODO: needs cloned Block mapping.
295
296         (Argument): Add cloning capability.
297
298         * assign.cs (Assign): Implement CloneTo.
299
300         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
301         
302         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
303         version by calling Convert with the EmitContext (that we are
304         currently storing in ec, this is not great, but will do for now,
305         to avoid passing EmitContext parameters to hundreds of functions
306         that do not need them now).
307
308         (SetExpression): Remove, it is not needed.
309         
310         (ContextualReturn): Implement CloneTo.
311
312         * statement.cs (Statement): Implement cloning infrastructure,
313         similar to expressions.
314
315         (Block): Partial implementation of Clone for statements.
316
317         (Return): Implement clone.
318         
319         * constant.cs (Constant.CloneTo): New method, does nothing.
320
321         * codegen.cs (TempEc): Add a static EmitContext as a temporary
322         solution, until we decide how to exactly do this.  
323         
324 2007-02-14  Marek Safar  <marek.safar@gmail.com>
325  
326         A fix for bug #80493
327         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
328         a property is override we need to use second accessor.
329
330 2007-02-13  Marek Safar  <marek.safar@gmail.com>
331  
332         A fix for bug #80418
333         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
334         methods.
335
336 2007-02-13  Marek Safar  <marek.safar@gmail.com>
337
338         Another fix for bug #80749
339         * pending.cs: Abstract class has priority over interfaces.
340
341 2007-02-13  Marek Safar  <marek.safar@gmail.com>
342
343         Another fix for bug #80749
344         * pending.cs: Abstract class has priority over interfaces.
345
346 2007-02-13  Marek Safar  <marek.safar@gmail.com>
347
348         Another fix for bug #80749
349         * pending.cs: Abstract class has priority over interfaces.
350
351 2007-02-13  Marek Safar  <marek.safar@gmail.com>
352
353         Another fix for bug #80749
354         * pending.cs: Abstract class has priority over interfaces.
355
356 2007-02-13  Marek Safar  <marek.safar@gmail.com>
357
358         * class.cs Better error message.
359
360         * driver.cs: Add shorter versions of -optimize option.
361
362 2007-02-13  Martin Baulig  <martin@ximian.com>
363
364         * class.cs (Constructor.Emit): Check the return value of
365         ec.ResolveTopBlock() and return on error.
366
367 2007-02-13  Raja R Harinath  <rharinath@novell.com>
368
369         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
370         message to fix error message regression.
371
372 2007-02-12  Marek Safar  <marek.safar@gmail.com>
373
374         * delegate.cs: Delegate creation expression cannot be of Nullable type.
375
376 2007-02-12  Marek Safar  <marek.safar@gmail.com>
377
378         A fix for bug #80749
379         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
380         its parent container.
381
382         * class.cs (DefineFieldInitializers): Each initializer can has different
383         resolve context.
384
385         * const.cs: Updated.
386
387 2007-02-11  Miguel de Icaza  <miguel@novell.com>
388
389         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
390         now all the heavy lifting to check that embedded statements or
391         expressions have the right form is done in the ContextualReturn.
392
393         (ContextualReturn): New class.  
394
395         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
396         method that can be invoked to report 201, so we do not replicate
397         this everywhere.
398
399         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
400         
401         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
402         treating tabs as spaces. 
403
404 2007-02-09  Marek Safar  <marek.safar@gmail.com>
405
406         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
407         * assign.cs: Use full implicit conversion for right side check.
408
409 2007-02-09  Marek Safar  <marek.safar@gmail.com>
410
411         * statement.cs (Switch): Switch over boolean type is not standardized.
412
413 2007-02-08  Marek Safar  <marek.safar@gmail.com>
414
415         A fix for bug #80755
416         * decl.cs (FindBaseEvent): Don't use method cache for events.
417
418 2007-02-07  Marek Safar  <marek.safar@gmail.com>
419
420         * cs-parser.jay: Better syntax error handling.
421
422         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
423         instead of underlying type value.
424
425 2007-02-06  Marek Safar  <marek.safar@gmail.com>
426
427         * driver.cs: Check define identifier before is registered.
428
429         * namespace.cs: Use existing error message.
430
431         * report.cs: New warning.
432
433 2007-02-06  Marek Safar  <marek.safar@gmail.com>
434
435         A fix for bug #80742
436         * expression.cs: Delegate Invoke method can be called directly.
437
438 2007-02-06  Marek Safar  <marek.safar@gmail.com>
439
440         A fix for bug #80676
441         * class.cs (IsEntryPoint): The Main method can have params modifier.
442
443 2007-02-04  Miguel de Icaza  <miguel@novell.com>
444
445         * parameter.cs (Parameter, Parameters): Add Clone method.
446
447         * anonymous.cs (Compatible): Turn method into virtual method, so
448         LambdaExpression can implement a different behavior.
449
450         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
451         out the basic checking here, so it can be used by
452         LambdaExpressions.
453         
454         * lambda.cs: Introduce "Compatible" function that will do the
455         heavy lifting.
456
457 2007-02-02  Marek Safar  <marek.safar@gmail.com>
458
459         * attribute.cs: Unified one error message.
460
461         * class.cs (Class): Use type attributes and not properties to test static
462         class.
463         (IsEntryPoint): Don's pass local variable.
464
465         * convert.cs: Removed duplicate check.
466
467         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
468
469         * driver.cs: Don't crash when soft reference does not exist.
470
471         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
472         (UsingEntry): Removed redundant allocation.
473
474         * parameter.cs: Add fast path for type parameters.
475
476         * support.cs: Don't allocate attribute when it's not used.
477
478 2007-01-30  Miguel de Icaza  <miguel@novell.com>
479
480         * anonymous.cs
481         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
482         this into a virtual method, so we can override it in LambdaExpression.
483
484         * driver.cs: Improve diagnostics in case of failure. 
485
486         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
487         write a function that is slightly more complex and that parses:
488
489         type identifier [, type identifier]* )
490
491         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
492         this expression:
493
494                 (canEmpty ? i >= 0 : i > 0)
495
496 2007-01-30  Raja R Harinath  <rharinath@novell.com>
497
498         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
499         exception on possibly valid code.
500
501 2007-01-29  Raja R Harinath  <rharinath@novell.com>
502
503         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
504         Push/PopPosition.
505         (parse_opt_type_arguments): Remove.  It's almost the same as
506         parse_less_than.
507         (parse_namespace_or_typename): Use parse_less_than.
508
509 2007-01-28  Miguel de Icaza  <miguel@novell.com>
510
511         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
512         this bug took a few hours to find, because the state saved and
513         restored by PushPosition and PopPosition was ignoring the state of
514         parse_generic_less_than.
515
516         I can also now remove the handling of OP_LT and OP_GT, this solves
517         the big mistery.
518         
519         * cs-tokenizer.cs: store the location for the ARROW token, we use
520         that in the parser.
521
522         (PushPosition, PopPosition): save/restore also `current_token',
523         restore `parse_generic_less_than' (was missing).
524
525         (parse_opt_type_arguments): use parse_type, not
526         parse_namespace_or_typename to parse types.
527
528         * lambda.cs: Empty new file, will eventually have the lambda
529         expression implementation.
530
531         * lambda.test: used to test the internal tokenizer. 
532
533         * report.cs (FeatureIsNotISO1): Rename from
534         FeatureIsNotStandardized, because it was about the language level
535         (1 vs 2) it was not about standarization.
536
537         (FeatureRequiresLINQ): New.
538
539         * support.cs (SeekableStreamReader): Only require that the reader
540         is a TextReader, not a StreamReader, so we can plug StringReader. 
541
542         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
543         given position in the input stream the following tokens can be
544         parsed as a type followed by an identifier.
545
546         (is_punct): after a '(' if parse_type_and_parameter returns true,
547         then return a special token OPEN_PARENS_LAMBDA which is used to
548         avoid reduce/reduce errors in the grammar for the
549         lambda_expression rules.
550
551         (parse_type): implement a type parser inside the
552         tokenizer, the parser only returns true or false depending on
553         whether the input at a given position can be parsed as a type.
554
555         (peek_token): new method used during type parsing.
556
557 2007-01-28  Raja R Harinath  <rharinath@novell.com>
558
559         Fix #80531
560         * anonymous.cs (ScopeInfo.InflateParameters): New.
561         (AnonymousContainer.Resolve): Use it to redirect types of
562         delegate parameters.
563
564 2007-01-27  Raja R Harinath  <rharinath@novell.com>
565
566         Fix #80530
567         * expression.cs (Error_InvalidArguments): Don't use two different
568         messages for CS1503.  Use ExtraInformation and
569         SymbolRelatedToPreviousError instead.
570
571         Fix #80358
572         * decl.cs (DeclSpace.initialize_type_params): Don't access
573         'type_params' of a partial class directly.
574
575 2007-01-26  Miguel de Icaza  <miguel@novell.com>
576
577         * constant.cs: Removed a handful of out-of-range checks that were
578         not necessary. 
579
580 2007-01-25  Marek Safar  <marek.safar@gmail.com>
581
582         * expression.cs (CheckUselessComparison): Add additional check for char
583         constants.
584
585         * namespace.cs: Fixed typo.
586
587 2007-01-23  Miguel de Icaza  <miguel@novell.com>
588
589         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
590         gone, instead we inline the test, preventing the needless casts to
591         longs, ulongs and doubles for the parameters, avoiding calls to
592         methods that overchecked stuff, and instead inlined things
593         nicely. 
594
595 2007-01-20  Marek Safar  <marek.safar@gmail.com>
596
597         * cs-parser.jay: Better parameter error handling.
598
599 2007-01-17  Marek Safar  <marek.safar@gmail.com>
600
601         A fix for bug #80368, #80522
602         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
603         whether array initializer contains constants only.
604         (ArrayCreation.Emit): Use better formula to decide when
605         are array initializers for static initialization.
606         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
607         have to emit even constants otherwise they are pre-initialized.
608
609 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
610             Raja R Harinath  <rharinath@novell.com>
611
612         Fix emit order of 'get' vs. 'set'.
613         * support.cs (Accessors): New.
614         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
615         Note the order in which accessors are declared in the source.
616         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
617         Refactored from Property.Define and Indexer.Define.
618         (PropertyBase.DefineAccessors): New helper that calls the above in
619         appropriate order as noted by the parser.
620         (Property.Define, Indexer.Define): Update to changes.
621         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
622
623 2007-01-17  Raja R Harinath  <rharinath@novell.com>
624
625         Fix cs0029-6.cs and gcs0029-2.cs (regression)
626         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
627         there's an implicit conversion from the current type to the target
628         type before converting the underlying constant.
629
630 2007-01-16  Marek Safar  <marek.safar@gmail.com>
631
632         * const.cs (ResolveValue): Updated after constant conversion was made more
633         generic.
634
635         * constant.cs (GetAttributableValue): constant to object conversion is
636         used for attributes only.
637         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
638         constant conversions.
639         (LongConstant.ConvertImplicitly): Ditto.
640
641         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
642         (ImplicitConversionStandard): Handle constant conversion as extra step.
643         It solves the issue when constant conversion was called indirectly like
644         inside array initializer and constant folding was skipped.
645
646         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
647         this change.
648
649         * statement.cs(ImplicitConversionStandard): Updated after constant
650         conversion was made more generic.
651
652 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
653
654         * expression.cs (As.DoResolve): Use GenericConstraints instead of
655         Constraints, solves the problem where the compiler incorrectly
656         reported that a type parameter was not constrained to a class (Bug
657         80518)
658
659 2007-01-14  Marek Habersack  <grendello@gmail.com>
660
661         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
662
663 2007-01-14  Marek Safar  <marek.safar@gmail.com>
664
665         A fix for bug #80368
666         * assign.cs (FieldInitializer): New class implements field
667         initializer statement.
668
669         * attribute.cs: Update after FieldMember rename.
670
671         * class.cs (PropertyBasedMember): New common class for property based
672         types.
673         (InterfaceMemberBase): New base class for all members which can be used as
674         an interface members.
675         (MethodCore): Moved really common code to InterfaceMemberBase.
676         (Method.Define): Equal and GetHasCode detection is relevant for methods
677         only.
678         (MethodData.Define): Don't assume that public event implements an
679         interface automatically.
680         (MethodData.DefineMethodBuilder): Issue an error even if only extern
681         modifier is used.
682         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
683         (FieldMember): Merged with FieldBase.
684         (EventProperty.AEventPropertyAccessor): New specialization to check whether
685         event extern modifier can be used.
686         (EventField.EventFieldAccessor): Moved event field specific code here.
687         (Event.AllowedModifiers): Even event can be extern.
688         (Event.FindOutBaseMethod): New override specific to events.
689         (Indexer.parameters): Reintroduce parameters because base class holds
690         only properties common data.
691         (Indexer.CheckForDuplications): Indexers are threated as methods so we
692         need do extra parameters check.
693
694         * const.cs: Update after FieldMember rename.
695
696         * decl.cs (MemberCache.FindBaseEvent): New method.
697
698         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
699         to reflect that indexer is now derived from PropertyBased.
700
701         * ecore.cs (GetMemberType): Made public.
702         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
703         obsolete event.
704
705         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
706         
707         * typemanager.cs (CSharpSignature): Correctly print event accessors.
708         (RegisterEvent): Removed.
709         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
710         (GetPrivateFieldOfEvent): Renamed to GetEventField.
711
712 2007-01-11  Raja R Harinath  <rharinath@novell.com>
713
714         Fix #80249
715         * statement.cs (CollectionForeach.TryType): Prefer generic
716         GetEnumerator over non-generic variant.  Fix code to follow comments.
717
718 2007-01-09  Raja R Harinath  <rharinath@novell.com>
719
720         Fix #80446
721         * support.cs (ReflectionParameter): Don't use an invalid index on
722         the generic parameter data.
723
724 2007-01-08  Miguel de Icaza  <miguel@novell.com>
725
726         * driver.cs: Just add a tiny bit of infrastructure.
727
728 2007-01-02  Marek Safar  <marek.safar@gmail.com>
729
730         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
731         where field type is struct from current assembly.
732         
733         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
734         it is possible.
735
736 2007-01-02  Marek Safar  <marek.safar@gmail.com>
737
738         A fix for bug #80381
739         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
740         the core types.
741
742         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
743         messages.
744         (Namespace.LookupType): Always use core types from corlib when speficied.
745
746         * report.cs: A new warning.
747
748         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
749         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
750         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
751
752         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
753         (InitCoreTypes): Set expression type of object_type and value_type
754         immediately after lookup.
755
756 2007-01-01  Miguel de Icaza  <miguel@novell.com>
757
758         * cs-tokenizer.cs: Accept Pc class characters (Connector
759         Punctuation) as valid identifiers.  Fixes #78259
760
761         * expression.cs (Invocation.DoResolve): Moved the check for the
762         use of `this' for doing method calls to the Invocation resolution
763         step, after overload resolution has taken place instead of doing
764         the check at the low-level `This.DoResolve' level.
765
766         The `This.DoResolve' happens before overload resolution, so it has
767         no way of knowing if the method that will be called will be
768         instace or static, triggering an erroneous report for cs0188 (Bug
769         78113).
770
771         We now do the check for instance method invocations after we know
772         what method will be called.
773
774         (This.CheckThisUsage): Move the actual use of this structure
775         checking into its own method and expose it. 
776
777         * Everywhere that called Error_ValueCannotBeConverted: pass a new
778         EmitContext.
779
780         Exceptions: Null.ConvertImplicitly,
781         Constant.ImplicitConversionRequired as there are too many call
782         sites for passing the ec. 
783
784         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
785         EmitContext, if the value is null, then we do not try to provide
786         the extra information from the error (If a userdefined conversion
787         exists, as UserDefinedConversion requires a non null-EmitContext).
788
789         Fixes: #80347
790
791 2006-12-30  Raja R Harinath  <rharinath@novell.com>
792
793         * flowanalysis.cs (MyBitVector): Document some invariants.
794         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
795         introduced below, and add a couple of others, 
796
797 2006-12-30  Marek Safar  <marek.safar@gmail.com>
798
799         * attribute.cs (GetMethodObsoleteAttribute): Uses new
800         GetPropertyFromAccessor and GetEventFromAccessor.
801         
802         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
803         overrides non-obsolete one.
804         (Indexer.Define): Error message has been moved to the parser.
805
806         * cs-parser.jay: Better syntax errors handling.
807
808         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
809         when an invocation has no arguments.
810
811         * ecore.cs: Removed not used caching.
812
813         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
814         implementation.
815
816         * report.cs: Add a new warning.
817
818         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
819
820         * typemanager.cs (enumeration_type): Removed.
821         (CSharpSignature): Reuses IsSpecialMethod.
822         (IsEqual): Hack for MS BCL.
823         (GetPropertyFromAccessor): New method.
824         (GetEventFromAccessor): New method.
825         (IsSpecialMethod): Fixed to handle more cases.
826
827 2006-12-30  Marek Safar  <marek.safar@gmail.com>
828
829         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
830         Made white spaces array static.
831
832         * ecore.cs (RemoveGenericArity): Optimized.
833
834         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
835         10 times faster).
836         (MyBitVector.initialize_vector): Simplified.
837
838 2006-12-22  Miguel de Icaza  <miguel@novell.com>
839
840         * ecore.cs: Am not entirely happy with this hack, but it seems to
841         address the issue in 80257 (a small test case for
842         CreativeDocs.NET). 
843
844         I set the MethodGroupExpr.Type to an internal compiler type
845         (itself in this case) to force the resolution to take place.   Why
846         it does not take place with a null is beyond me.
847
848 2006-12-20  Marek Safar  <marek.safar@gmail.com>
849
850         A fix for bug #80288
851         * expression.cs (ResolveOperator): Consider user defined conversion for
852         logical and operator too.
853         (EmitBranchable): Optimization for logical and when full constant folding
854         could not be applied but one operand is constant.
855
856 2006-12-19  Marek Safar  <marek.safar@gmail.com>
857
858         * class.cs (GetClassBases): Write 5 times every day, will never use
859         FullName for error reporting.
860
861         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
862
863 2006-12-19  Martin Baulig  <martin@ximian.com>
864
865         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
866         the symbol file info here.
867
868 2006-12-18  Marek Safar  <marek.safar@gmail.com>
869
870         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
871         of `elseif' is taking then following sections are not taking.
872         Fixes an issue reported on mono mailing list.
873
874 2006-12-18  Marek Safar  <marek.safar@gmail.com>
875
876         A fix for bug #80300
877         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
878         a caller is not taking.
879
880 2006-12-18  Raja R Harinath  <rharinath@novell.com>
881
882         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
883         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
884         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
885         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
886         * class.cs: Update to changes.
887
888 2006-12-17  Marek Safar  <marek.safar@gmail.com>
889
890         A fix for bug #79934
891         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
892         partial container.
893
894         * class.cs (ResolveMembers): Register an iterator in current container and
895         not in shared one.
896
897 2006-12-16  Raja R Harinath  <rharinath@novell.com>
898
899         Fix test-543.cs
900         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
901         satisfy a params annotated parameter.
902
903 2006-12-16  Marek Safar  <marek.safar@gmail.com>
904
905         A fix for bug #77014
906         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
907         paramters correctly and not rely on hacks in Parameters class.
908         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
909         at any possition.
910         (Invocation.VerifyArgumentsCompat): Ditto.
911         (Invocation.EmitArguments): Changed to correctly emit params arguments at
912         any possition.
913
914         * parameter.cs (HasParams): Don't assume that params is the last one.
915
916         * support.cs (ReflectionParameters.ctor): Look for params attribute
917         correctly.
918         (ReflectionParameters.ParameterType): Removed hack when we returned last
919         parameter for out of range parameters.
920         (ParameterName, ParameterModifier): Ditto.
921
922 2006-12-14  Marek Safar  <marek.safar@gmail.com>
923
924         A fix for bug #79987
925         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
926         when assembly is not CLS compliant but type is. I have no idea why is this
927         allowed.
928
929         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
930
931 2006-12-13  Miguel de Icaza  <miguel@novell.com>
932
933         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
934         in struct constructors, they are basically no-ops.
935
936 2006-12-12  Marek Safar  <marek.safar@gmail.com>
937
938         * cs-tokenizer.cs (Position): Save preprocessor status too.
939
940 2006-12-12  Marek Safar  <marek.safar@gmail.com>
941
942         A fix for bug #77794
943         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
944
945 2006-12-12  Marek Safar  <marek.safar@gmail.com>
946
947         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
948         Fixes #69299.
949         (pp_expr): Report error for an invalid expression.
950         (handle_preprocessing_directive): Simplified; add more error checking.
951
952 2006-12-11  Marek Safar  <marek.safar@gmail.com>
953
954         A fix for bug #74939
955         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
956         directives handling.
957
958 2006-12-10  Marek Safar  <marek.safar@gmail.com>
959
960         A fix for bugs #80093, and #75984
961         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
962         logic, it seems to me as it worked before "by coincidence".
963         (xtoken): Simplified to use reworked handle_preprocessing_directive.
964         (cleanup): Enabled endif check.
965
966 2006-12-09  Marek Safar  <marek.safar@gmail.com>
967
968         A fix for bug #80162
969         * statement.cs (CollectionForeach.TryType): Generics and non-generics
970         enumerators are never ambiguous.
971
972 2006-12-08  Raja R Harinath  <rharinath@novell.com>
973
974         Fix #80060
975         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
976
977 2006-12-06  Marek Safar  <marek.safar@gmail.com>
978
979         A fix for bug #80144
980         * class.cs (EventProperty.Define): Explicit implementation means
981         that an even is used.
982
983 2006-12-06  Marek Safar  <marek.safar@gmail.com>
984
985         Fixes the operators implementation (part II)
986
987         * cfold.cs (DoConstantNumericPromotions): Renamed to
988         DoBinaryNumericPromotions and simplified.
989         (BinaryFold): Couple of conversion fixes; simplified.
990
991         * constant.cs, ecore.cs, literal.cs
992         (ToType): Renamed to ConvertImplicitly.
993         (Reduce): Renamed to ConvertExplicitly.
994
995         * class.cs, convert.cs: Updated.
996
997         * expression.cs: TryReduce doesn't throw an exception.
998
999 2006-12-01  Marek Safar  <marek.safar@gmail.com>
1000
1001         A fix for bug #80108
1002         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
1003         compatible.
1004
1005 2006-11-30  Marek Safar  <marek.safar@gmail.com>
1006
1007         Fixes unary operators implementation (part I)
1008         Also fixes #80026
1009
1010         * cfold.cs (Error_CompileTimeOverflow): Made internal
1011
1012         * const.cs (IConstant): Changed to use reference to constant and
1013         not constant itself.
1014         Updated IConstant implementations.
1015
1016         * constant.cs (CreateConstant): New factory method.
1017         Updated IConstant implementation.
1018
1019         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
1020
1021         * ecore.cs: Updated to use CreateConstantReference.
1022
1023         * enum.cs: Reflects IConstant changes.
1024
1025         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
1026
1027         * literal.cs (NullConstant): Change to be independently usable.
1028
1029 2006-11-29  Martin Baulig  <martin@ximian.com>
1030
1031         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
1032         we need to emit the scope initializer before calling the base .ctor.
1033
1034         * anonymous.cs: Merged back from the new anonymous methods branch.
1035         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
1036
1037         * expression.cs (ParameterReference.DoResolveBase): Create a
1038         "normal" ScopeInfo when capturing parameters rather than using the
1039         root scope; this makes things work with anonymous methods having
1040         parameters.
1041
1042         * statement.cs
1043         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
1044
1045 2006-11-22  Marek Safar  <marek.safar@gmail.com>
1046
1047         A fix for bug #79987
1048         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
1049         check to a base class.
1050         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
1051         only when assembly has missing attribute.
1052         * report.cs: Update.
1053
1054 2006-11-21  Marek Safar  <marek.safar@gmail.com>
1055
1056         * cs-tokenizer.cs: Merged with gmcs version.
1057
1058 2006-11-20  Marek Safar  <marek.safar@gmail.com>
1059
1060         * cs-tokenizer.cs,
1061         * cs-parser.jay: Better error message when partial keyword is misplaced.
1062
1063 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
1064
1065         A fix for bug #79810
1066         report.cs: CS1058 only applies to 2.0 profile (gmcs).
1067         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
1068         a RuntimeWrappedException by default.
1069
1070 2006-11-18  Marek Safar  <marek.safar@gmail.com>
1071
1072         A fix for bug #79843
1073         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
1074         implementation.
1075         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
1076
1077 2006-11-18  Marek Safar  <marek.safar@gmail.com>
1078
1079         * driver.cs, namespace.cs: Uses faster IndexOf version.
1080
1081 2006-11-17  Marek Safar  <marek.safar@gmail.com>
1082
1083         A fix for bug #79941
1084         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
1085         operators.
1086         (Operator.Define): Implicit/Explicit operator of same type is duplicate
1087         even if internal name is different.
1088         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
1089         (UserDefinedConversion): Simplified as the operators cannot be internal.
1090         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
1091         conversions.
1092         (MethodLookup): Replaced EmitContext with parentType.
1093         * expression.cs: Updated.
1094
1095 2006-11-09  Raja R Harinath  <rharinath@novell.com>
1096
1097         * driver.cs (BadAssembly): Handle all the ugliness of
1098         DefineDynamicAssembly.
1099
1100 2006-11-08  Raja R Harinath  <rharinath@novell.com>
1101
1102         Address parts of #58244 -- most of what's left is in the runtime
1103         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
1104         CS1509 error checks, and handle them for all assembly loads, not
1105         just the first invocation.
1106         (LoadModule): Likewise.  Move handling of 'adder_method' ...
1107         * codegen.cs (AssemblyClass.AddModule): ... here.
1108
1109 2006-11-02  Marek Safar  <marek.safar@gmail.com>
1110
1111         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
1112         IEnumerable<T> is ambiguous.
1113
1114 2006-10-31  Marek Safar  <marek.safar@gmail.com>
1115
1116         A fix for bug #67689
1117         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
1118         GetEnumerator is ambiguous.
1119
1120         * report.cs: Add new warning.
1121
1122 2006-10-29  Marek Safar  <marek.safar@gmail.com>
1123
1124         A fix for bug #78602
1125         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1126         to protected member can be nested type.
1127
1128 2006-10-28  Marek Safar  <marek.safar@gmail.com>
1129
1130         A fix for bug #78965
1131         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1132         to protected member must derive from current type.
1133
1134 2006-10-27  Marek Safar  <marek.safar@gmail.com>
1135
1136         assign.cs: Reuses error method.
1137
1138         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
1139         instead of type for constants.
1140         (Expression.Error_ValueAssignment): Common error method.
1141
1142         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
1143         for any assignment.
1144
1145 2006-10-27  Marek Safar  <marek.safar@gmail.com>
1146
1147         A fix for bug #79081
1148         * expression.cs (MemberAccess.DoResolve): Check nested type
1149         accessibility.
1150
1151 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
1152
1153         * doc.cs : nested delegates were not handled. Fixed bug #79754.
1154
1155 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1156
1157         A fix for bug #76591
1158         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
1159
1160 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1161
1162         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
1163         type forwarder of the same type multiple times.
1164
1165 2006-10-26  Raja R Harinath  <rharinath@novell.com>
1166
1167         Fix #78820
1168         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
1169         instance as an rvalue, even when we later resolve as an lvalue.
1170
1171 2006-10-25  Martin Baulig  <martin@ximian.com>
1172
1173         * anonymous.cs: Fix #79673.
1174
1175 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
1176
1177         A fix for bug #79666
1178         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
1179         ignored when is optimized (= default value) as its value is already set.
1180
1181 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1182
1183         A fix for bug #79724
1184         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
1185         TypeContainer for type lookup.
1186
1187 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1188
1189         A fix for bug #79231
1190         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
1191         * expression.cs (OverloadResolve): Always convert type name for
1192         an error message.
1193         (ResolveNamespaceOrType): Don't confuse a nested type with any 
1194         other member.
1195
1196 2006-10-18  Martin Baulig <martin@ximian.com>
1197
1198         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
1199
1200 2006-10-17  Miguel de Icaza  <miguel@novell.com>
1201
1202         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
1203         an int32, but requesting an int64 from the conversion
1204
1205 2006-10-12  Martin Baulig  <martin@ximian.com>
1206
1207         * anonymous.cs
1208         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
1209         
1210 2006-10-12  Martin Baulig  <martin@ximian.com>
1211
1212         * statement.cs
1213         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
1214
1215 2006-10-11  Miguel de Icaza  <miguel@novell.com>
1216
1217         * convert.cs: Remove broken code: I was doing the "Existance"
1218         tests for Implicit conversions.
1219
1220 2006-10-10  Miguel de Icaza  <miguel@novell.com>
1221
1222         * convert.cs: Added one missing case in
1223         ImplicitStandardConversionExists uint64 to intptr.
1224
1225         Fixes #59800
1226         
1227         * typemanager.cs (uintptr_type): another core known type.   
1228
1229         * ecore.cs (OperatorCast): routine used to do cast operations that
1230         depend on op_Explicit.  We could change some of the Decimal
1231         conversions to use this.
1232
1233         This one has a probe mechanism that checks both types for an op_
1234         which it coudl be used to eliminate two classes: CastToDecimal
1235         and CastFromDecimal.
1236
1237         * convert.cs: Implement the conversions documented in #59800
1238         
1239 2006-10-10  Martin Baulig  <martin@ximian.com>
1240
1241         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
1242         before RootScope.ResolveMembers().
1243
1244         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
1245         `CurrentType' if appropriate.
1246
1247 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
1248
1249         A fix for bug #78568
1250         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
1251         when contains binary operators.
1252         * cs-parser.jay: Updated.
1253
1254 2006-10-09  Martin Baulig  <martin@ximian.com>
1255
1256         * delegate.cs
1257         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
1258         moved that into Define() and also do the other type parameter
1259         checks there.  Fixes #79094.  Added gtest-292.cs.
1260
1261         * expression.cs
1262         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
1263         since that doesn't include type parameters; don't use `Ldelema'
1264         for type parameters.  Fixes #78980.  Added gtest-293.cs.
1265
1266 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
1267
1268         A fix for #77796
1269         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
1270         conversion is allowed.
1271
1272 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1273
1274         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
1275         error reporting when no error occurs.
1276
1277 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1278
1279         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
1280         does not exist.
1281
1282 2006-10-06  Raja R Harinath  <rharinath@novell.com>
1283
1284         Fix #79584
1285         * class.cs (DefineTypeBuilder): Check circular dependencies before
1286         setting the parent of the TypeBuilder.
1287         (CheckRecursiveDefinition): Don't use 'BaseType', since
1288         it may not be valid until after DefineTypeBuilder.  Use
1289         'base_type' instead.
1290
1291 2006-10-04  Martin Baulig  <martin@ximian.com>
1292
1293         Merged the Anonymous Methods patch.
1294
1295         * anonymous.cs, iterators.cs: The new anonymous methods code.
1296
1297         * statement.cs (Variable): New public abstract class.
1298         (LocalInfo.Variable): New public property.
1299         (LocalInfo.ResolveVariable): New public method.
1300         (Block.Flags): Add `IsIterator'.
1301         (Block.AddVariable): Improved the CS0136 check.
1302         (Block.AnonymousChildren): New public property.
1303         (Block.AddAnonymousChild): New public method.
1304         (ToplevelBlock): Update to use the new anonymous method framework.
1305         (ToplevelBlock.ctor): `container' is now a `Block' and not a
1306         `ToplevelBlock'; this is required to correctly implement the
1307         CS0136 check.
1308         (Fixed, Using): Use `TemporaryVariable' instead of directly
1309         creating the `LocalBuilder'.
1310
1311         * parameter.cs (Parameter.ResolveVariable): New public method.
1312         (Parameters.ResolveVariable): Likewise.
1313
1314         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
1315
1316         * class.cs (TypeContainer): Replaced the `iterators' list and
1317         corresponding methods with a list of `CompilerGeneratedClass'es.
1318         (TypeContainer.ResolveMembers): New public method.
1319         (Method): `IIteratorContainer' has been replaced by
1320         `IAnonymousHost'.
1321
1322         * expression.cs (VariableReference): New public abstract base
1323         class for `LocalVariableReference', `ParameterReference' and
1324         `This'.
1325
1326         * codegen.cs (EmitContext): Removed `capture_context',
1327         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
1328         (EmitContext.EmitThis): Removed.
1329
1330         * cs-parser.jay: Replace `iterator_container' with
1331         `anonymous_host'.       
1332
1333 2006-10-04  Martin Baulig  <martin@ximian.com>
1334
1335         * generic.cs (GenericMethod): Don't make this abstract.
1336         (Constraints.Clone): Added dummy implementation.
1337
1338 2006-10-04  Raja R Harinath  <harinath@gmail.com>
1339
1340         Fix #79577
1341         * namespace.cs (LookForAnyGenericType): Avoid nullref on
1342         'declspaces'.  Avoid allocating arrays willy-nilly.
1343
1344         Fix #79553
1345         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
1346         cases out of the switch.
1347
1348 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
1349
1350         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
1351         message when non-generic type is used with the type arguments.
1352         * expression.cs: Updated.
1353
1354 2006-09-28  Raja R Harinath  <rharinath@novell.com>
1355
1356         Fix #79013
1357         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
1358         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1359         Change semantics slightly.  Don't insist on having only one
1360         temporary EmptyExpression -- just throttle the creation of new ones.
1361
1362         Fix #79451
1363         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
1364         non-interfaces too.  If no methods are found, don't try to create
1365         a MethodGroupExpr.
1366
1367 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
1368
1369         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
1370         generic type.
1371
1372         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
1373         us produce better error message.
1374
1375 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
1376
1377         * expression.cs (Binary.ResolveOperator): Warn about a side effect
1378         of the `|' operator.
1379
1380         * report.cs: A new warning added.
1381
1382 2006-09-27  Martin Baulig  <martin@ximian.com>
1383
1384         * generic.cs (GenericMethod): Don't make this abstract.
1385
1386 2006-09-27  Martin Baulig  <martin@ximian.com>
1387
1388         * report.cs
1389         (InternalErrorException): Added overloaded ctor taking a params array.
1390
1391 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
1392
1393         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
1394         Fixed the cases when same error was reported twice.
1395
1396         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
1397         now report symbol information.
1398
1399 2006-09-25  Martin Baulig  <martin@ximian.com>
1400
1401         * class.cs: Completely unified with the gmcs version.
1402
1403 2006-09-25  Martin Baulig  <martin@ximian.com>
1404
1405         * typemanager.cs (TypeManager.IsNullableType): New public function.
1406         (TypeManager.IsNullableTypeOf): Likewise.
1407         (TypeManager.IsNullableValueType): Likewise.
1408
1409         * class.cs (MethodCore): Added the `GenericMethod' argument from
1410         gmcs and also unified all classes derived from `MethodCore' with gmcs.
1411
1412 2006-09-24  Raja R Harinath  <harinath@gmail.com>
1413
1414         * convert.cs: Unify with gmcs version.
1415
1416 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1417
1418         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
1419         verify them as well.
1420
1421         * report.cs: New warning.
1422
1423 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1424
1425         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
1426         for anonymous block with out argument.
1427
1428 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1429
1430         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
1431         not used private events only.
1432
1433 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
1434
1435         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
1436
1437         * const.cs (Const.Define): Check for constant type.
1438         (Const.IsConstantTypeValid): Looks for valid constant types.
1439
1440         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
1441
1442         * ecore.cs (EmptyConstantCast): New common class for all constant based
1443         EmptyCast(s).
1444
1445         * expression.cs (Is.DoResolve): Handle null constant especially.
1446         (New.DoResolve): Check for new void().
1447         (MemberAccess.DoResolve): Cope with all kind of nulls.
1448
1449         * literal.cs (NullConstant): Uses EmptyConstantCast.
1450         (NullDefault): Based on EmptyConstantCast.
1451         (NullLiteral): Uses EmptyConstantCast.
1452
1453         * statement.cs (Block.ResolveMeta): Check for constant type.
1454
1455 2006-09-22  Martin Baulig  <martin@ximian.com>
1456
1457         * delegate.cs, attribute.cs: Merged with the gmcs versions.
1458
1459 2006-09-22  Raja R Harinath  <rharinath@novell.com>
1460
1461         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
1462         not the null type.
1463
1464         Fix part of #79451
1465         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
1466         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
1467         code slightly.
1468
1469 2006-09-22  Martin Baulig  <martin@ximian.com>
1470
1471         * ecore.cs: Merged with the gmcs version.
1472
1473         * generic.cs (ConstructedType): New dummy class.
1474         (TypeArguments): Don't make this abstract.
1475
1476         * typemanager.cs
1477         (TypeManager.IsGenericTypeDefinition): New method.
1478         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
1479
1480 2006-09-22  Raja R Harinath  <rharinath@novell.com>
1481
1482         * expression.cs (ComposedCast): Check for arrays of TypedReference
1483         before creating the type, not after.
1484
1485 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
1486
1487         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
1488         after ToType change.
1489
1490         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
1491         when constant must be implicitly convertible.
1492
1493         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
1494
1495         * ecore.cs (NullCast): Derives from NullConstant.
1496
1497         * expression.cs (Is.DoResolve): Removed useless variables.
1498         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
1499         (New.Constantify): Add enum support.
1500         (MemberAccess.DoResolve): Add warning when accessing null constant or
1501         variable.
1502
1503         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
1504         property.
1505
1506         * literal.cs (NullConstant): New abstract class with common
1507         functionality for all null specializations.
1508         (NullDefault): Represents default(X) when result can be
1509         reduced to null.
1510         (NullLiteral): Updated.
1511
1512         * report.cs: Add new warning.
1513
1514 2006-09-21  Martin Baulig  <martin@ximian.com>
1515
1516         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
1517
1518 2006-09-21  Martin Baulig  <martin@ximian.com>
1519
1520         * generic.cs (GenericConstraints): New dummy class.
1521         (Constraints): Likewise.
1522         (TypeParameter): Likewise.
1523         (TypeParameterName): Likewise.
1524         (GenericMethod): Likewise.
1525
1526         * typemanager.cs (TypeManager.GetGenericArguments): New method.
1527
1528         * decl.cs: Merged with the gmcs version.
1529
1530 2006-09-21  Raja R Harinath  <rharinath@novell.com>
1531
1532         * generic.cs (TypeParameter): Implement IMemberContainer.
1533         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
1534
1535         * rootcontext.cs: Unify with gmcs version.
1536
1537         * report.cs: Unify with gmcs version.
1538         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
1539         from gmcs/generics.cs.
1540         * generics.cs (TypeParameter): New dummy class.
1541
1542         * support.cs: Unify with gmcs version.
1543
1544 2006-09-20  Raja R Harinath  <rharinath@novell.com>
1545
1546         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
1547         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
1548
1549         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
1550         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
1551         * mcs.exe.sources: Add generic.cs.
1552
1553         * codegen.cs: Unify with gmcs version.
1554
1555         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1556         (EmitContext): Add GenericDeclContainer implementation.
1557         * decl.cs (MemberCore, DeclSpace): Likewise.
1558         * namespace.cs: Remove #ifdef GMCS_SOURCE.
1559
1560         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1561         MCS TypeManager has a corresponding dummy method.
1562
1563 2006-09-19  Martin Baulig  <martin@ximian.com>
1564
1565         * expression.cs: Completely merged with the gmcs version.
1566
1567 2006-09-19  Martin Baulig  <martin@ximian.com>
1568
1569         * expression.cs (Invocation): Merged with the gmcs version.
1570         (ArrayAccess.GetStoreOpcode): Likewise.
1571
1572 2006-09-19  Martin Baulig  <martin@ximian.com>
1573
1574         * typemanager.cs
1575         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1576         (TypeManager.IsGenericMethodDefinition): Likewise.
1577
1578 2006-09-19  Martin Baulig  <martin@ximian.com>
1579
1580         * typemanager.cs
1581         (TypeManager.IsEqual): Moved the gmcs implementation here.
1582         (TypeManager.DropGenericTypeArguments): Likewise.
1583         (TypeManager.DropGenericMethodArguments): Likewise.
1584         (TypeManager.GetTypeArguments): Moved here from gmcs.
1585         (TypeManager.HasGenericArguments): Likewise.
1586
1587 2006-09-19  Martin Baulig  <martin@ximian.com>
1588
1589         * expression.cs (Binary): Merged with the gmcs version.
1590
1591 2006-09-19  Martin Baulig  <martin@ximian.com>
1592
1593         * expression.cs (Probe, As, Is): Merged with the gmcs version.
1594
1595 2006-09-19  Martin Baulig  <martin@ximian.com>
1596
1597         * typemanager.cs: Merged with the gmcs version.
1598
1599 2006-09-16  Raja R Harinath  <rharinath@novell.com>
1600
1601         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1602         * driver.cs: Likewise.
1603
1604 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
1605
1606         A fix for #79401
1607         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1608         only if parent type is class.
1609         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1610         update.
1611
1612 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
1613
1614         * cs-parser.jay,
1615         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1616         keywords are used.
1617         * typemanager.cs(CSharpName): Converts NullType to null.
1618
1619 2006-09-15  Martin Baulig  <martin@ximian.com>
1620
1621         * typemanager.cs
1622         (TypeManager.GetMethodName): Added mcs implementation.
1623         (TypeManager.IsEqual): Likewise.
1624
1625         * ecore.cs
1626         (SimpleName.RemoveGenericArity): Added dummy implementation.
1627
1628         * pending.cs: Merged with the gmcs version.     
1629
1630 2006-09-15  Martin Baulig  <martin@ximian.com>
1631
1632         * statement.cs: Merge with the gmcs version.
1633
1634 2006-09-15  Martin Baulig  <martin@ximian.com>
1635
1636         * statement.cs (Switch): Merge with the gmcs implementation
1637         (without nullables), which is newer.
1638
1639 2006-09-15  Martin Baulig  <martin@ximian.com>
1640
1641         * statement.cs (Block.Variables): Make this public.
1642         (ToplevelBlock.Parameters): Make this a property.
1643         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1644
1645 2006-09-15  Martin Baulig  <martin@ximian.com>
1646
1647         * namespace.cs: Merge with the gmcs version.
1648
1649 2006-09-15  Martin Baulig  <martin@ximian.com>
1650
1651         * decl.cs (MemberName): Minor code cleanups.
1652
1653 2006-09-15  Martin Baulig  <martin@ximian.com>
1654
1655         * parameter.cs: Merge with the gmcs version.
1656
1657 2006-09-15  Martin Baulig  <martin@ximian.com>
1658
1659         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
1660         and an error in mcs.
1661
1662 2006-09-15  Martin Baulig  <martin@ximian.com>
1663
1664         * flowanalysis.cs: Merged from GMCS; added the generics code into
1665         a `GMCS_SOURCE' conditional so we can share this file.
1666
1667 2006-09-08  Martin Baulig  <martin@ximian.com>
1668
1669         * typemanager.cs (TypeManager.interlocked_type): New public field.
1670         (TypeManager.int_interlocked_compare-exchange): New public field.
1671         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
1672         enumerator types here and call InitGenericCoreTypes().
1673         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
1674         after calling InitEnumUnderlyingTypes().
1675
1676         * rootcontext.cs
1677         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
1678         `classes_second_stage'. 
1679
1680 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
1681
1682         * assign.cs, ecore.cs, expression.cs: Share error message text.
1683         * class.cs (FieldMember.Define): Check for varible of static type.
1684         * driver.cs (LoadAssembly): Uses error output for errors.
1685         * statement.cs: Updated.
1686
1687 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
1688
1689         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
1690         type instance.
1691
1692 2006-09-07  Martin Baulig  <martin@ximian.com>
1693
1694         * driver.cs
1695         (MainDriver): Revert r62663 from Marek; see #70506 for details.
1696
1697 2006-08-29  Miguel de Icaza  <miguel@novell.com>
1698
1699         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
1700         
1701 2006-08-17  Miguel de Icaza  <miguel@novell.com>
1702
1703         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
1704         #52019 and #79064, the use of the \uXXXX sequence in source code
1705         to represent unicode characters.
1706
1707 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
1708
1709         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
1710         support.
1711         * class.cs, ecore.cs, statement.cs: Merged to one error message.
1712
1713 2006-08-13  Miguel de Icaza  <miguel@novell.com>
1714
1715         * assign.cs: Catch attempts to assign to a method groups in += and
1716         report as 1656
1717
1718 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
1719
1720         A fix for #79056
1721         * cs-parser.jay: Don't destroy current array type by typeof of array's.
1722
1723 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
1724
1725         * class.cs (Method.Define): Issue a warning when generic method looks like
1726         an entry point.
1727         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1728         as well.
1729
1730 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
1731  
1732         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1733         looking for ctor.
1734         * decl.cs (MemberCache.FindMembers): When container is interface we need to
1735         search all base interfaces as a member can be ambiguous.
1736         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1737         Constructor member type filter. 
1738         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1739         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1740         reporting for returned memberinfos.
1741         * report.cs: Updated.
1742         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1743         version to work on all runtimes.
1744         (TypeManager.RealMemberLookup): Removed members filtering.
1745
1746 2006-08-08  Raja R Harinath  <rharinath@novell.com>
1747
1748         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1749         (PropertyExpr.EmitAssign): Likewise.
1750         * expression.cs (Indirection.EmitAssign): Likewise.
1751         (LocalVariableReference.EmitAssign): Likewise.
1752         (ParameterReference.EmitAssign): Likewise.
1753         (Invocation.EmitArguments): Likewise.
1754         (ArrayAccess.EmitAssign): Likewise.
1755         (IndexerAccess.EmitAssign): Likewise.
1756         (This.EmitAssign): Likewise.
1757         (ConditionalLogicalOperator.Emit): Likewise.
1758
1759         Fix #79026
1760         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
1761         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
1762         leave it in after returning it.
1763         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
1764
1765 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
1766
1767         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1768         message.
1769
1770 2006-08-03  Raja R Harinath  <rharinath@novell.com>
1771
1772         Fix cs0146-3.cs and cs0146-4.cs.
1773         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1774         enclosing types don't depend on the current type.
1775
1776 2006-08-02  Raja R Harinath  <rharinath@novell.com>
1777
1778         Fix #77963
1779         * class.cs (TypeContainer.DoDefineMembers): Use
1780         FindBaseMemberWithSameName on Parent, since we're interested in
1781         whether we hide inherited members or not.
1782         (FindBaseMemberWithSameName): Make slightly more robust.
1783
1784         Fix the non-generic testcase from #77396
1785         * decl.cs (DeclSpace.DeclContainer): Remove override.
1786
1787         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1788         declspaces for doppelgangers too.
1789         (UsingEntry): Implement IResolveContext.
1790         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
1791         'this' as the resolve context.
1792         (LocalAliasEntry): Likewise.
1793
1794         Implement parts of #77403
1795         * roottypes.cs (RootDeclSpace): New.  Used to represent the
1796         toplevel declaration space.  Each namespace declaration introduces
1797         a "partial" root declaretion space.
1798         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1799         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1800         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1801         from 'current_namespace.SlaveDeclSpace'.
1802         (namespace_declaration): Likewise.
1803         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1804         check.  It can't happen now.
1805         * decl.cs (DeclSpace.LookupType): Likewise.
1806         * driver.cs (MainDriver): Sanity check.
1807
1808 2006-08-01  Raja R Harinath  <rharinath@novell.com>
1809
1810         * decl.cs (DeclSpace.FindNestedType): Remove.
1811         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1812         LookupTypeContainer to get the container of the nested type.
1813         * class.cs (TypeContainer.FindNestedType): Make non-override.
1814
1815 2006-07-31  Raja R Harinath  <rharinath@novell.com>
1816
1817         * decl.cs (DeclSpace.PartialContainer): Move field from ...
1818         * class.cs (TypeContainer.PartialContainer): ... here.
1819         (TypeContainer.AddBasesForPart): New helper.
1820         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
1821         instead.
1822         * cs-parser.jay (current_class): Convert to DeclSpace.
1823         (struct_declaration, interface_declaration, class_declaration):
1824         Use AddBasesForPart instead of .Bases directly.
1825         * const.cs, iterators.cs: Update to changes.
1826
1827 2006-07-28  Raja R Harinath  <rharinath@novell.com>
1828
1829         * class.cs (TypeContainer.AddMemberType): Rename from
1830         AddToTypeContainer.
1831         (TypeContainer.AddMember): Rename from AddToMemberContainer.
1832         (AddTypeContainer): New.  Combine AddClassOrStruct and
1833         AddInterface.
1834         (AddPartial): Update.  Add 'is_partial' argument.
1835         * roottypes.cs: Update to changes.
1836         * cs-parser.jay (push_current_class): New helper for handling
1837         current_container and current_class.
1838         (struct_declaration, interface_declaration, class_declaration):
1839         Use it.
1840
1841 2006-07-26  Raja R Harinath  <rharinath@novell.com>
1842
1843         * roottypes.cs: Rename from tree.cs.
1844
1845         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1846         * tree.cs (Tree, ITreeDump): Remove types.
1847         * rootcontext.cs (tree, Tree): Remove fields.
1848         (root, ToplevelTypes): New.
1849         * *.cs: Update to rename.
1850
1851         * tree.cs (Tree.RecordDecl): Remove.
1852         (RootTypes.AddToTypeContainer): Record the toplevel type in its
1853         namespace here.
1854         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1855
1856 2006-07-23  Raja R Harinath  <harinath@gmail.com>
1857
1858         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1859         DoFlowAnalysis and OmitStructFlowAnalysis here.
1860         (ec.With): Rename from WithUnsafe and generalize.
1861         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
1862         (ec.WithFlowAnalyis): New.
1863         * ecore.cs, expression.cs, statement.cs: Update.
1864
1865 2006-07-22  Raja R Harinath  <harinath@gmail.com>
1866
1867         * statement.cs (Block.ResolveMeta): Simplify slightly.
1868
1869         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
1870         multiple boolean fields.  Convert InUnsafe, constant_check_state,
1871         check_state to flags.
1872         (CheckState, ConstantCheckState): Update.
1873         (InUnsafe): New read-only property.
1874         (FlagsHandle): Rename from CheckStateHandle and convert to handle
1875         arbitrary flags.
1876         (WithUnsafe): New helper similar to WithCheckState.
1877         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1878         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1879
1880 2006-07-21  Raja R Harinath  <rharinath@novell.com>
1881
1882         Make comparisons use the same IL irrespective of whether they're
1883         in a 'checked' or 'unchecked' context: one of the issues in #78899
1884         * codegen.cs (EmitContext.CheckState): Make read-only property.
1885         (EmitContext.ConstantCheckState): Likewise.
1886         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1887         helper that implement a save/restore stack for CheckState
1888         values.  This is the only way to change check-state.
1889         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1890         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1891         (CheckedExpr.EmitBranchable): New forwarding method.
1892         (UnCheckedExpr): Likewise.
1893         * statement.cs (Block.ResolveMeta): Use WithCheckState.
1894         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1895         (Checked.Resolve, checked.DoEmit): Likewise.
1896
1897 2006-07-20  Miguel de Icaza  <miguel@novell.com>
1898
1899         * anonymous.cs: Cache the resolved anonymous delegate, and return
1900         this so that the ResolveTopBlock is only triggered once, not
1901         twice.
1902
1903         Currently we trigger ResolvetopBlock twice due to a first pass of
1904         argument check compatibility, and a second pass that does the
1905         actual resolution.   
1906         
1907 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1908
1909         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1910         modifiers.
1911         * rootcontext.cs (Reset): Add helper_classes.
1912
1913 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1914
1915         A fix for #78860
1916         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1917         correctly.
1918
1919 2006-07-13  Miguel de Icaza  <miguel@novell.com>
1920
1921         * statement.cs (Lock): Handle expressions of type
1922         TypeManager.null_type specially.  Fixes #78770
1923
1924 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1925
1926         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1927         to an event.
1928
1929 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1930
1931         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1932         for accessors as well.
1933         * ecore.cs (EventExpr): Add AccessorTable.
1934
1935 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
1936
1937         A fix for #78738
1938         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1939         for CS0122 where appropriate.
1940         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1941         level attributes.
1942         (Filter): Assembly can be null in the case of top level attributes.
1943
1944 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
1945
1946         A fix for #78690
1947
1948         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1949         is done at global level.
1950
1951 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1952
1953         A fix for #77002, Implemented TypeForwarder support.
1954
1955         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1956         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1957         * typemanager.cs (): Add type_forwarder_attr_type.
1958
1959 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1960
1961         * report.cs: Add CS0469 warning.
1962
1963 2006-06-21  Martin Baulig  <martin@ximian.com>
1964
1965         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1966         the `try'-block, so we also report CS0016 etc. there.
1967
1968 2006-06-21  Martin Baulig  <martin@ximian.com>
1969
1970         * delegate.cs
1971         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1972
1973 2006-06-21  Martin Baulig  <martin@ximian.com>
1974
1975         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1976         also report CS1686 for parameters.
1977
1978 2006-06-21  Martin Baulig  <martin@ximian.com>
1979
1980         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1981         instead of an error if the value is not implicitly convertible to
1982         the switch types; fixes #77964.
1983
1984 2006-06-21  Raja R Harinath  <rharinath@novell.com>
1985
1986         Fix #78673
1987         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1988         FieldBuilder is null.
1989
1990         Fix #78662
1991         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1992         'left' and 'right' before error-checking.
1993
1994 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
1995
1996         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1997         Fixed bug #78601.
1998         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1999         (FieldExpr.DoResolve): likewise.
2000         (PropertyExpr.InstanceResolve): likewise.
2001         (EventExpr.InstanceResolve): likewise. 
2002
2003 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
2004
2005         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
2006         attribute applicable tests for attribute argument.
2007
2008 2006-06-02  Raja R Harinath  <rharinath@novell.com>
2009
2010         Fix #78079
2011         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
2012         (Binary.OverloadResolve_PredefinedIntegral): New.
2013         (Binary.OverloadResolve_PredefinedFloating): New.
2014         (Binary.OverloadResolve_PredefinedString): New.
2015         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
2016         Follow the standard more closely, and treat numeric promotions in
2017         terms of overload resolution.
2018         (Binary.CheckShiftArguments): Simplify.
2019
2020 2006-06-01  Raja R Harinath  <rharinath@novell.com>
2021
2022         * flowanalysis.cs (MyBitVector): Simplify representation.
2023         (MyBitVector.Clone): Avoid allocating BitArray.
2024         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
2025         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
2026         (*): Update.  Change all references to MyBitVector.And and
2027         MyBitVector.Or to &= and |=.
2028
2029 2006-05-29  Raja R Harinath  <rharinath@novell.com>
2030
2031         Fix cs0231-[34].cs.
2032         * cs-parser.jay (formal_parameter_list): Extend the pattern below
2033         to param arguments too.
2034
2035 2006-05-26  Miguel de Icaza  <miguel@novell.com>
2036
2037         * cs-parser.jay: Catch another parsing form for arglist being
2038         followed by other arguments.  Fixes #78313.
2039
2040 2006-05-24  Raja R Harinath  <rharinath@novell.com>
2041
2042         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
2043         checking of out parameters to ...
2044         (FlowBranchingToplevel.Merge): ... here.
2045         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
2046         set, propagate the origin upward, and only complain if there was
2047         no other error.
2048         (FlowBranchingException.AddContinueOrigin): Likewise.
2049         (FlowBranchingException.AddReturnOrigin): Likewise.
2050         (FlowBranchingException.AddGotoOrigin): Likewise.       
2051
2052 2006-05-23  Raja R Harinath  <rharinath@novell.com>
2053
2054         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
2055         unreachable, skip it.
2056         (FlowBranchingException.Merge): Always propagate jumps, even if
2057         the finally block renders subsequent code unreachable.
2058
2059 2006-05-18  Raja R Harinath  <rharinath@novell.com>
2060
2061         Fix #77601
2062         * statement.cs (Goto.Resolve): Move responsibility for resolving
2063         'goto' to FlowBranching.AddGotoOrigin.
2064         (Goto.SetResolvedTarget): New.  Callback to set the
2065         LabeledStatement that's the target of the goto.
2066         (Goto.DoEmit): Use Leave instead of Br when crossing an
2067         unwind-protect boundary.
2068         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
2069         LookupLabel and adjust to new semantics.
2070         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
2071         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
2072         Goto.SetResolvedTarget to update target.
2073         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
2074         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
2075         AddBreakOrigin & co.  Delay propagation until ...
2076         (FlowBranchingException.Merge): ... this.
2077
2078         * statement.cs (Block.Resolve): Always depend on flow-branching to
2079         determine unreachability.  Kill workaround that originally emitted
2080         only one statement after an "unreachable" label (see infloop in
2081         test-515.cs).
2082
2083         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
2084         This is still "wrong", but anything better would probably need a
2085         multi-pass algorithm.
2086         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
2087         usage vector.  Force current usage vector to be reachable, to
2088         optimistically signify backward jumps.
2089         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
2090         detected.
2091         (FlowBranchingLabeled.Merge): New.  If no backward jump was
2092         detected, return the original salted-away usage vector instead,
2093         updated with appropriate changes.  Print unreachable warning if
2094         necessary.
2095         * statement.cs (Block.Resolve): Don't print unreachable warning on
2096         a labeled statement.
2097
2098 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
2099
2100         * driver.cs: Pass filename without path to AssemblyBuilder's 
2101         AddResourceFile. Fixes bug #78407.
2102
2103 2006-05-17  Raja R Harinath  <rharinath@novell.com>
2104
2105         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
2106         * flowanalysis.cs (FlowBranchingLabeled): ... here.
2107         (FlowBranching.MergeChild): Overwrite
2108         reachability information from Labeled branchings too.
2109
2110 2006-05-16  Raja R Harinath  <rharinath@novell.com>
2111
2112         * statement.cs (Goto.Resolve): Merge jump origins here ...
2113         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
2114
2115         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
2116         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
2117         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
2118         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
2119         here, ...
2120         * statement.cs (Goto.Resolve): ... not here.
2121         (Goto.Emit): Remove CS1632 check.
2122
2123 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
2124
2125         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
2126         error message.
2127
2128 2006-05-11  Raja R Harinath  <rharinath@novell.com>
2129
2130         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
2131         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
2132         (FlowBranchingException.Label): Likewise.
2133
2134         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
2135         given value.
2136         (MyBitVector.Or): Use it to avoid losing information (Count).
2137         (FlowBranching.MergeOrigins): Likewise.
2138
2139         * flowanalysis.cs (UsageVector.IsDirty): Remove.
2140         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
2141         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
2142         (UsageVector.ToString): Simplify.
2143         (UsageVector.MergeSiblings): Move here from ...
2144         (FlowBranching.Merge): ... here.
2145         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
2146         not a MyBitVector.
2147
2148 2006-05-10  Raja R Harinath  <rharinath@novell.com>
2149
2150         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
2151         null bitvector is treated as all-true.
2152
2153         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
2154         (MyBitVector): Rationalize invariants.  'vector != null' implies
2155         that we have our own copy of the bitvector.  Otherwise,
2156         'InheritsFrom == null' implies all inherited bits are true.
2157
2158 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
2159
2160         * statement.cs (LocalInfo): Add IsConstant.
2161         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
2162         local variable for constants.
2163
2164 2006-05-09  Raja R Harinath  <rharinath@novell.com>
2165
2166         * flowanalysis.cs (MyBitVector.Empty): New.
2167         (MyBitVector): Don't allow InheritedFrom to be null.
2168         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
2169         (UsageVector, FlowBranching): Update to changes.
2170
2171         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
2172         recursion.  The 'Parent == null' condition isn't sufficient for
2173         anonymous methods.
2174         (FlowBranching.AddBreakOrigin): Likewise.
2175         (FlowBranching.AddContinueOrigin): Likewise.
2176         (FlowBranching.AddReturnOrigin): Likewise.
2177         (FlowBranching.StealFinallyClauses): Likewise.
2178         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
2179         (FlowBranching.CheckOutParameters): Likewise.
2180         (FlowBranchingToplevel): Terminate all the above recursions here.
2181         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
2182         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
2183
2184         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
2185         toplevel block.
2186         (FlowBranchingToplevel): New.  Empty for now.
2187         (FlowBranching.MergeTopBlock): Update.
2188         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
2189         branching for the anonymous delegate.
2190         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
2191
2192         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
2193         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
2194         information at the start of the merge.  Reorganize.
2195
2196 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2197
2198         * class.cs (MethodData.Define): Method cannot implement interface accessor.
2199
2200 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2201
2202         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
2203         to newly introduced ctor.
2204
2205         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
2206         message to one place.
2207         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
2208         global namespace.
2209
2210 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2211
2212         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
2213
2214         * ecore.cs (Expression.ResolveAsConstant): Updated.
2215
2216         * statement.cs (ResolveMeta): Updated.
2217
2218 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2219
2220         * cs-parser.jay: __arglist cannot be used in initializer.
2221
2222 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2223
2224         A fix for #77879
2225         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
2226         private types.
2227
2228 2006-05-05  Raja R Harinath  <rharinath@novell.com>
2229
2230         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
2231         (LabeledStatement): Add 'name' parameter.
2232         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
2233         (Block.AddLabel): Update to changes.
2234         * cs-parser.jay (labeled_statement): Likewise.
2235
2236         * flowanalysis.cs (BranchingType.Labeled): New.
2237         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
2238         (FlowBranchingLabeled): New.  Does nothing for now, but will
2239         eventually handle 'goto' flows.
2240         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
2241         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
2242         that's terminated ...
2243         (Block.Resolve): ... here.
2244
2245         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
2246         (UsageVector.MergeFinallyOrigins): Likewise.
2247         (FlowBranching.InTryOrCatch): Likewise.
2248         (FlowBranching.AddFinallyVector): Likewise.
2249         (FlowBranchingException): Update to changes.
2250
2251         Fix #78290
2252         * statement.cs (Return.Resolve): Move error checking to ...
2253         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
2254         (FlowBranchingException): Handle return origins like break and
2255         continue origins.
2256         (FlowBranching.UsageVector.CheckOutParameters): Remove.
2257
2258 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2259
2260         A fix for #76122
2261         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
2262         filter.
2263
2264 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2265
2266         A fix for #77543
2267         * class.cs (MethodData.Define): Do public accessor check only when method
2268         implements an interface.
2269
2270 2006-05-04  Raja R Harinath  <rharinath@novell.com>
2271
2272         Remove special handling of 'break'
2273         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
2274         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
2275         (UsageVector.Break): Remove.
2276         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
2277         reachability.
2278         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
2279
2280         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
2281         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
2282
2283 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2284
2285         A fix for #75726
2286         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
2287         be the interface member.
2288
2289 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2290
2291         A fix for #60069
2292         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
2293         for emitting small (int) values.
2294
2295 2006-05-03  Raja R Harinath  <rharinath@novell.com>
2296
2297         Fix #59427
2298         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
2299         control-flow passes through the 'finally' after merging-in all the
2300         control-flows from 'try' and the 'catch' clauses.
2301
2302         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
2303         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
2304         always true at the only non-recursive entry point.
2305         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
2306         FlowBranchingBreakable.
2307         (FlowBranchingLoop): Remove.
2308         * statement.cs (Return.DoResolve): Update to changes.
2309
2310         Fix #76471, #76665
2311         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
2312         (FlowBranching.CreateBranching): Handle it: create a
2313         FlowBranchingContinuable.
2314         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
2315         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
2316         except that it handles the 'continue' command.
2317         (FlowBranching.UsageVector.MergeOrigins): Rename from
2318         MergeBreakOrigins.
2319         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
2320         except that it overrides AddContinueOrigin.
2321         (FlowBranchingException): Override AddContinueOrigin, similar to
2322         AddBreakOrigin.
2323         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
2324         Create a new branching around the embedded statement.
2325         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
2326         control flow after the embedded statement.
2327         (Continue.Resolve): Move all error checking to AddContinueOrigin.
2328
2329         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
2330         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
2331         FlowBranchingBreakable.
2332         (FlowBranchingSwitch): Remove.
2333
2334         Fix test-503.cs
2335         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
2336         error reporting to ...
2337         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
2338         Rename from 'AddBreakVector'.  Add new location argument.  Return
2339         a bool indicating whether the 'break' crosses an unwind-protect.
2340         (FlowBranchingException.AddBreakOrigin): Add.
2341         (FlowBranchingException.Merge): Propagate 'break's to surrounding
2342         flowbranching after updating with the effects of the 'finally'
2343         clause.
2344         (FlowBranchingBreakable): New common base class for
2345         FlowBranchingLoop and FlowBranchingSwitch.
2346
2347         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
2348         embedded statement.
2349         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
2350
2351 2006-05-02  Raja R Harinath  <rharinath@novell.com>
2352
2353         * statement.cs (Do.Resolve): If the loop is infinite, set the
2354         barrier.
2355         (While.Resolve, For.Resolve): Set a barrier after the embedded
2356         statement.  There's no direct control flow that goes from the end
2357         of the embedded statement to the end of the loop.
2358         * flowanalysis.cs (FlowBranching.Infinite): Remove.
2359         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
2360         above ensure that the reachability is correctly computed.
2361
2362         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
2363         (UsageVector.MergeBreakOrigins): If the current path is
2364         unreachable, treat it as if all parameters/locals are initialized.
2365         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
2366         infinite loops before merging-in break origins.
2367
2368         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
2369         (Reachability.Reachable): Split part into ...
2370         (Reachability.Unreachable): ... this.  Simplify.
2371         (Reachability.IsUnreachable): Use 'Unreachable' instead.
2372
2373         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
2374         (Reachability.SetThrowsSometimes): Likewise.
2375         (FlowBranchingBlock.MergeTopBlock): Don't compare against
2376         TriState.Always, use corresponding property.
2377         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
2378         (Block.Resolve): Likewise.  Remove some redundant checks.
2379
2380 2006-05-02  Raja R Harinath  <harinath@gmail.com>
2381
2382         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
2383         (Reachability.Meet): Don't bother checking AlwaysThrows --
2384         barrier is always set.
2385         (FlowBranchingBlock.Merge): Likewise.
2386
2387 2006-05-01  Raja R Harinath  <harinath@gmail.com>
2388
2389         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
2390         checks for unreachable.
2391
2392 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
2393
2394         A fix for #77980
2395         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
2396
2397         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
2398         whether field is really assigned.
2399
2400 2006-04-30  Raja R Harinath  <harinath@gmail.com>
2401
2402         * flowanalysis.cs (Reachability): Make 4-argument constructor
2403         private.
2404         (Reachability.Meet): Rename from 'And'.  Remove static variant.
2405         (Reachability.Always): Rename from the highly misleading
2406         'Reachability.Never'.
2407         (FlowBranching.Merge): Update to changes.  Mark an impossible
2408         situation with a 'throw'.
2409         (*): Update to changes.
2410
2411 2006-04-29  Raja R Harinath  <harinath@gmail.com>
2412
2413         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
2414         Remove 'Undefined'.
2415         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
2416         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
2417         (*): Update to changes.
2418         * statement.cs: Update to changes.
2419
2420 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
2421
2422         A fix for #78049
2423         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
2424
2425 2006-04-28  Raja R Harinath  <harinath@gmail.com>
2426
2427         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
2428         dummy UsageVector.
2429
2430         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
2431         argument to two arguments: an usage-vector and a bool.  Move call
2432         to FlowBranching.Merge () ...
2433         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
2434
2435         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
2436         handling of loop and switch reachability to ...
2437         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
2438
2439 2006-04-27  Raja R Harinath  <harinath@gmail.com>
2440
2441         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
2442         handling to FlowBranchingLoop.InLoop.
2443         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
2444
2445 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
2446
2447         A fix for #78115
2448         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
2449         anonymous method is allowed from AnonymousContainer here.
2450
2451         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
2452
2453 2006-04-24  Raja R Harinath  <rharinath@novell.com>
2454
2455         Fix #78156
2456         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
2457
2458 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
2459
2460         A fix for #49011.
2461         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
2462         (DoubleConstant.Reduce): Ditto.
2463
2464 2006-04-23  Raja R Harinath  <rharinath@novell.com>
2465
2466         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
2467         Remove 'lvalue_right_side' argument.  Move parts to ...
2468         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
2469         (LocalVariable.DoResolveLValue): ... these.
2470
2471 2006-04-21  Raja R Harinath  <rharinath@novell.com>
2472
2473         Fix cs1655.cs
2474         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
2475         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
2476         (LocalVariableReference.DoResolveBase): Use it to implement new
2477         CS1655 check.
2478         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
2479         (Argument.Resolve): Simplify.  Move CS1510 check ...
2480         * ecore.cs (Expression.ResolveLValue): ... here.
2481         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
2482         (PropertyExpr.DoResolveLValue): Likewise.
2483         (FieldExpr.Report_AssignToReadonly): Likewise.
2484         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
2485         LValueMemberAccess or LValueMemberOutAccess on instance depending
2486         on it.
2487         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
2488         DoResolve as appropriate.
2489
2490 2006-04-20  Raja R Harinath  <rharinath@novell.com>
2491
2492         Fix #75800
2493         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
2494         implicit conversions on 'out' and 'ref' arguments.
2495
2496         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
2497         improve clarity.  Remove dead code.
2498
2499         Fix #66031
2500         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
2501         (Catch.Resolve): Resolve VarBlock if it exists.
2502
2503 2006-04-19  Miguel de Icaza  <miguel@novell.com>
2504
2505         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
2506         twice, this was some residual code, the enumerator was emitted
2507         properly in the two branche of if later.
2508
2509 2006-04-19  Raja R Harinath  <rharinath@novell.com>
2510
2511         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
2512         cast is never an lvalue.
2513         (Cast.DoResolve, Cast.ResolveRest): Combine.
2514         (Argument.Emit): Simplify slightly.  Move 'Expr is
2515         IMemoryLocation' check ...
2516         (Argument.Resolve): ... here.
2517         (Argument.Error_LValueRequired): Remove.  Inline into only user.
2518
2519         Simplifications.  Fix cs0191-2.cs
2520         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
2521         CS1649 and CS1651 to ...
2522         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
2523         the actual selection of the error code and message to a lookup
2524         table.  Add a dummy return value to simplify callsites.
2525         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
2526         readonly fields of other instances of the same type.  Move CS0197
2527         warning from ...
2528         * expression.cs (Argument.Resolve): ... here.  Simplify code.
2529         Ensure that ec.InRefOutArgumentResolving is only set during LValue
2530         resolution of an out or ref argument.  The code simplification
2531         above uses this invariant.
2532
2533 2006-04-18  Raja R Harinath  <rharinath@novell.com>
2534
2535         Possibly fix #77752.  Fix cs1690-[4-7].cs.
2536         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
2537         CheckMarshallByRefAccess.  Drop parameter.
2538         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
2539         warning.
2540         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
2541         InstanceExpression.
2542         * report.cs (AllWarnings): Add CS1690.
2543         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
2544         for ref access too.
2545         (LocalVariableReference.DoResolveBase): Update.
2546
2547 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2548
2549         * class.cs (MethodOrOperator): Moved common parts from method class.
2550         detect obsolete attributes.
2551         (Method.Define): Simplified as it reuses code from base.
2552         (Constructor.ValidAttributeTargets): Fixed issue found during
2553         refactoring.
2554         (Destructor.ValidAttributeTargets): Fixed issue found during
2555         refactoring.
2556         (Operator): Finished refactoring set off by #78020. Operator class is now
2557         ordinary method class.
2558
2559         * anonymous.cs: Updated.
2560
2561         * decl.cs (DeclSpace): Add IsGeneric
2562
2563 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2564
2565         * class.cs (Constructor.Emit): Don't emit the attributes twice.
2566
2567 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2568
2569         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2570         detect obsolete attributes.
2571         (Method.CreateEmitContext): Moved to MethodOrOperator.
2572
2573 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2574
2575         A fix for #78048.
2576         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2577         customized exception to make crash detection easier.
2578         (MethodOrOperator): Started to work on new base class for methods and
2579         operators.
2580         (Method): Derives from MethodOrOperator.
2581         (Constructor.Emit): Emits its own attributes.
2582         (AbstractPropertyEventMethod.Emit): Ditto.
2583         (Operator): Derives from MethodOrOperator, will refactor fully in extra
2584         patch.
2585         (Operator.Emit): It's temporary more tricky than should be.
2586         
2587         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2588
2589         * report.cs (InternalErrorException): Add ctor with inner exception.
2590
2591 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
2592
2593         A fix for #76744.
2594         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2595         only not visible.
2596
2597 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
2598
2599         A fix for #77916.
2600         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2601         array.
2602
2603 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2604
2605         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2606         attribute is present and Guid not.
2607         (Interface.ApplyAttributeBuilder): Ditto.
2608
2609         * attribute.cs: Add error message.
2610
2611 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2612
2613         A fix for #78020.
2614
2615         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2616         sources (it's composite) so hold them in extra array as they are used in
2617         Emit phase only. It worked in the previous versions by mistake.
2618         (Attribute.Emit): Emit attribute for more owners when exist.
2619
2620         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2621         it has now different behaviour.
2622
2623 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
2624
2625         * constant.cs (Constant.IsDefaultInitializer): New method.
2626
2627         * class.cs: Updated.
2628
2629         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2630         re-initialize default values. It saves KBs almost for every assembly.
2631         Thanks Zoltan for the idea.
2632         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2633         (ArrayCreation.DoResolve): Resolve only once.
2634         (ArrayCreation.Emit): Emit static initializer only when it is faster.
2635         (ArrayCreation.GetAttributableValue): Cope with optimized values.
2636
2637 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
2638
2639         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2640         From #77961.
2641
2642 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2643
2644         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2645         in an embedded statement too.
2646
2647 2006-04-01  Raja R Harinath  <rharinath@novell.com>
2648
2649         Fix #77958
2650         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2651
2652 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2653
2654         A fix for #77966.
2655
2656         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
2657         was not specified.
2658
2659         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
2660
2661 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
2662
2663         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
2664         phase.
2665
2666         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
2667         LocalTemporary change.
2668
2669         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
2670         TypeContainer.
2671         (ClassOrStruct.DefineFieldInitializers): Implemented static field
2672         initializers optimization.
2673         (ClassOrStruct.TypeAttr): Moved from modifiers.
2674         (Constructor.CheckBase): Don't crash when static ctor has parameters.
2675         (FieldBase.ResolveInitializer): Resolves initializer.
2676         (FieldBase.HasDefaultInitializer): New property.
2677
2678         * cs-parser.jay: Removed message.
2679
2680         * expression.cs (CompilerGeneratedThis): New specialization.
2681
2682         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
2683
2684 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
2685
2686         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
2687
2688 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
2689
2690         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
2691         be now EnumConstants only.
2692
2693 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
2694
2695         * attribute.cs, driver.cs: Reset more caches.
2696
2697 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2698
2699         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
2700
2701 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2702
2703         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
2704         for easier reuse. Updated all overrides.
2705         (IntegralConstant): New base class for all integral constants.
2706         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
2707         of the constant range, report custom error.
2708         (UIntConstant.Reduce): Fixed uint conversion.
2709
2710         * ecore.cs, literal.cs: Reduce updates.
2711
2712 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2713
2714         A fix for #75813.
2715
2716         * class.cs (Constructor.Define): Removed extra if for default ctors.
2717         A patch from Atsushi Enomoto.
2718
2719 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2720
2721         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2722         GetAttributableValue.
2723
2724         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2725         when required.
2726
2727         * convert.cs (ImplicitConversionRequired): Error message moved to
2728         DoubleLiteral.
2729
2730         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2731         automatic implicit conversion of an output value.
2732         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2733
2734         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2735         conversion.
2736         (TypeOf.GetAttributableValue): Add extra handling for object type.
2737
2738         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2739         special error message.
2740
2741 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
2742
2743         * class.cs (Constructor.Emit): Don't crash when struct ctor is
2744         InternalCall.
2745         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2746         compatible with MS runtime.
2747
2748 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
2749
2750         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2751         attribute arguments here.
2752
2753         * class.cs (Indexer.Define): The check was moved to attribute class.
2754
2755 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
2756
2757         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2758         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2759         easier.
2760
2761 2006-03-22  Raja R Harinath  <rharinath@novell.com>
2762
2763         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
2764         mcs to keep code differences small.
2765         * attribute.cs (Attribute.GetParameterDefaultValue): New.
2766         * typemanager.cs (parameter_default_value_attribute_type): New.
2767         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
2768         CS1908 check.
2769
2770 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2771
2772         * expression.cs (StringConcat.Append): Reverted back to no warning state.
2773
2774 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2775
2776         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2777
2778         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2779         the blocks too.
2780
2781 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
2782
2783         * doc-bootstrap.cs : fix build.
2784
2785 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2786
2787         * expression.cs (StringConcat.Append): Issue a warning when empty string
2788         is going to append.
2789
2790 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2791
2792         * assign.cs (CompoundAssign.ResolveSource): Removed.
2793
2794         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2795         clean up.
2796
2797         * class.cs (TypeContainer.FindMethods): Removed.
2798         (TypeContainer.CheckMemberUsage): Made static.
2799
2800         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2801
2802         * constant.cs (CheckRange): Removed unused type argument.
2803         (CheckUnsigned): Removed unused type argument.
2804
2805         * cs-parser.jay: Updated after MemberAccess clean up.
2806         Uses Length for empty string test.
2807
2808         * cs-tokenizer.cs: Uses Length for empty string test.
2809         (IsCastToken): Made static.
2810         (is_hex): Made static.
2811         (real_type_suffix): Made static.
2812
2813         * decl.cs (SetupCache): Made static.
2814         (OnGenerateDocComment): Removed unused ds argument.
2815
2816         * delegate.cs (VerifyDelegate): Removed unused argument.
2817
2818         * doc.cs: Uses Length for empty string test.
2819
2820         * driver.cs: Uses Length for empty string test.
2821
2822         * enum.cs (IsValidEnumType): Made static
2823
2824         * expression.cs (EnumLiftUp): Removed unused argument.
2825         (ResolveMethodGroup): Ditto.
2826         (BetterConversion): Ditto.
2827         (GetVarargsTypes): Ditto.
2828         (UpdateIndices): Ditto.
2829         (ValidateInitializers): Ditto.
2830         (MemberAccess.ctor): Ditto.
2831         (GetIndexersForType): Ditto.
2832
2833         * flowanalysis.cs: (MergeFinally): Removed unused argument.
2834
2835         * iterators.cs: Updated after MemberAccess clean up.
2836
2837         * location.cs: Uses Length for empty string test.
2838
2839         * namespace.cs: Uses Length for empty string test.
2840
2841          * report.cs (CheckWarningCode): Made static.
2842
2843         * statement.cs (LabeledStatement): Removed unused argument.
2844
2845         * typemanager.cs (FilterNone): Removed.
2846
2847 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2848
2849         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2850         obsolete.
2851
2852         * class.cs: Updated.
2853
2854 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2855
2856         * cs-parser.jay.cs: __arglist is not allowed for delegates.
2857
2858 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2859
2860         A fix for #77822.
2861
2862         * expression.cs (VerifyArgumentsCompat): Reverted to double error
2863         reporting, it's more tricky than I thought.
2864
2865 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2866
2867         A fix for #77816.
2868
2869         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
2870         host container.
2871         (AnonymousMethod.ImplicitStandardConversionExists): New method.
2872         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2873         Add more error reporting; Fixed issue with params.
2874
2875         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2876
2877         * cs-parser.jay: AnonymousMethod requires host container.
2878
2879         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2880
2881 2006-03-18  Raja R Harinath  <harinath@gmail.com>
2882
2883         * class.cs: Change 'TypeContainer ds' constructor argument to
2884         'DeclSpace parent'.  Some classes were missed below due to
2885         different naming convention.
2886
2887         * class.cs (MemberCore.Parent): Delete.  This makes the
2888         ParentContainer changes below enforceable by the compiler.
2889
2890         Treat pointers to enclosing declaration space as 'DeclSpace', not
2891         'TypeContainer'.
2892         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2893         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2894
2895         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2896         of TypeContainer.
2897         (Block.AddThisVariable): Likewise.
2898         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2899         (AbstractPropertyEventMethod.Emit): Likewise.
2900         (AbstractPropertyEventMethod.EmitMethod): Likewise.
2901         (GetMethod.Define, SetMethod.Define): Likewise.
2902         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2903         (DelegateMethod.EmitMethod): Likewise.
2904
2905         Fix regression test-partial-13.cs.
2906         Rationalize use of PartialContainer.  Ensure that the partial
2907         class semantics can be tied to type-correctness, i.e., any
2908         violation will cause a compile error.
2909         * class.cs, const.cs: Access all fields that belong to class
2910         TypeContainer via ParentContainer.  Arguments of EmitContexts and
2911         Resolve()-like functions still use 'Parent'.
2912
2913         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2914         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2915         (PropertyMethod.CheckModifiers): Remove unused argument.
2916         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2917         DeclSpace.
2918
2919 2006-03-17  Raja R Harinath  <harinath@gmail.com>
2920
2921         Make semantics of PartialContainer simpler.
2922         * decl.cs (DeclSpace.IsPartial): Remove.
2923         * class.cs (TypeContainer.IsPartial): Likewise.
2924         (TypeContainer..ctor): Set PartialContainer to point to self.
2925         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2926         (TypeContainer.FindNestedType): Likewise.
2927         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
2928
2929 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
2930
2931         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2932
2933 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2934
2935         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2936         classes.
2937
2938 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2939
2940         * class.cs (Operator.Define): An error for base conversion was not
2941         reported correctly.
2942
2943 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2944
2945         * iterator.cs : yield break is allowed in try statement which has
2946           catch clauses. Fixed bug #77767.
2947
2948 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
2949
2950         A fix for #77593, #77574.
2951
2952         * class.cs (MethodCore.CheckBase): Another if for operator.
2953
2954 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
2955
2956         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2957         were not resolved
2958
2959         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2960         (DelegateCreation.ImplicitStandardConversionExists): New method for just
2961         conversion test.
2962         
2963         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2964         not needed.
2965
2966         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2967         Updated after another emitcontext usage was clean up. It should help us to
2968         synchronize with gmcs easier.
2969
2970 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
2971
2972         A fix for #77353.
2973
2974         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2975         (Event.Define): ditto
2976         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2977
2978         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2979         Removed redundant code and set NewSlot for Invoke method too.
2980
2981         * parameter.cs (Parameters.ctor): Add custom, type ctor.
2982         (Parameters.MergeGenerated): New method. Use this method when you merge
2983         compiler generated argument with user arguments.
2984
2985 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
2986
2987         * attribute.cs (ResolveAsTypeTerminal): Removed.
2988
2989         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2990         specialization for predefined types; 30% speed up.
2991         Finally placed obsolete check to right place.
2992         (Expression.ResolveType): Removed.
2993
2994         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2995         Updated after ResolveType was removed.
2996
2997         * expression.cs (Cast.ctor): Check void cast.
2998         (Binary.ResolveAsTypeTerminal): Is never type.
2999         (Conditional.ResolveAsTypeTerminal): Is never type.
3000
3001         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
3002
3003 2006-03-01  Raja R Harinath  <rharinath@novell.com>
3004
3005         Fix #77679.
3006         * expression.cs (ParameterReference.DoResolveBase): Change return
3007         type to bool.
3008         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
3009         Update.
3010
3011         Fix #77628.
3012         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
3013
3014         Fix #77642.
3015         * typemanager.cs (GetFullNameSignature): Don't nullref on
3016         protected accessors.
3017
3018 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
3019
3020         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
3021         these two separated members to simplify the code.
3022         (Attribute.Resolve): Refactored to use new fields and methods.
3023         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
3024         implemented obsolete attribute checking.
3025         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
3026         implemented obsolete checking again. It look line never ending quest ;-)
3027         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
3028
3029         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
3030
3031         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
3032
3033         *class.cs (Property.Define): Add RegisterProperty call.
3034
3035         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
3036         argument groups (only 2).
3037
3038         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
3039         encoding expression to arguments.
3040         (Expression.ExprClassToResolveFlags): Just turned to property.
3041
3042         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
3043         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
3044         optimized as well as implemented support for zero-length attributes.
3045
3046         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
3047         Add caching of PropertyInfo's.
3048
3049 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3050
3051         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
3052         error multiple times.
3053
3054 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3055
3056         New partial class implementation.
3057         A fix for #77027, #77029, #77403
3058
3059         * attribute.cs (Attributable): Made attributes protected.
3060
3061         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
3062         the replacements of ClassPart and PartialContainer.
3063         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
3064         (TypeContainer.AddInterface): Ditto.
3065         (TypeContainer.AddPartial): The main method for partial classes. It checks
3066         for errors and merges ModFlags and attributes. At the end class is added to
3067         partial_parts list.
3068         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
3069         required here.
3070         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
3071         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
3072         from the rest of partial classes.
3073         (TypeContainer.GetClassBases): Simplified.
3074         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
3075         DefineType.
3076         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
3077         (TypeContainer.HasExplicitLayout): Uses Flags now.
3078         (PartialContainer): Removed.
3079         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
3080         (StaticClass): Was merged with Class.
3081         (Class.GetClassBases): class and static class bases are verified here.
3082         (Class.TypeAttr): Added static attributes when class is static.
3083         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
3084         (MemberBase): In some cases we need to call parent container for partial
3085         class. It should be eliminated but it's not easy now.
3086
3087         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
3088
3089         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
3090         partial classed to accumulate class comments.
3091         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
3092
3093         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
3094
3095         * driver.cs (MainDriver): Tree.GetDecl was removed.
3096
3097         * modifiers.cs (Modifiers): Add partial modifier.
3098
3099         * tree.cs (Tree.decl): Removed.
3100         (RootTypes): Started to use this class more often for root types
3101         specializations.
3102
3103 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
3104
3105         A fix for #77615
3106
3107         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
3108         external interface does not have an attribute.
3109
3110 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
3111
3112         Another prerequisites for new partial classs implementation.
3113         
3114         * attribute.cs (Attribute.Equal): Implemented.
3115         (Attribute.Emit): Changed as attributes can be applied more than twice.
3116         (Attributes.Emit): Check for duplicate attributes here.
3117
3118         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
3119         as a parameter, clean-up.
3120
3121 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
3122
3123         A fix for #77485
3124
3125         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
3126         contains obsolete attribute check which can in some cases look for base
3127         type of current class which is not initialized yet.
3128         (TypeContainer.BaseType): Replacement of ptype.
3129
3130         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
3131
3132 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
3133
3134         First of prerequisites for new partial classs implemention.
3135         
3136         * attribute.cs (Attributable): Extended by ResolveContext;
3137         Attributes finally have correct context for resolving in all cases.
3138         (AttachTo): Attribute owner is assigned here.
3139
3140         * codegen.cs (IResolveContext): Introduce new interface to hold
3141         all information needed in resolving phase.
3142         (EmitContext): Implements IResolveContext; more clean-up needed here.
3143         
3144         * decl.cs (MemberCore): Implemented IResolveContext.
3145
3146         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
3147         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
3148         parameter.cs, statement.cs, tree.cs, typemanager.cs:
3149         Refactored to use new IResolveContext instead of EmitContext; cleanup
3150
3151 2006-02-06  Miguel de Icaza  <miguel@novell.com>
3152
3153         * codegen.cs (EmitScopeInitFromBlock): check here the
3154         capture_context, there is no need to make two calls to the
3155         EmitContext. 
3156
3157         * anonymous.cs: Add some debugging messages that might help me
3158         track other instances of this problem in the future (the
3159         regression of test 467).
3160
3161         * cs-parser.jay: track the variable block, as we need to initalize
3162         any captured variables declared in this block for the "catch"
3163         portion of the "Try" statement.
3164
3165         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
3166         scope initialization for captured variables. 
3167
3168         Also, move the emit for the variables after the block location has
3169         been marked.
3170
3171 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
3172
3173         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
3174
3175 2006-02-02  Miguel de Icaza  <miguel@novell.com>
3176
3177         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
3178         commit yesterday, the initialization for the roots is necessary.
3179         What is not necessary is the scope activation.
3180
3181 2006-02-02  Raja R Harinath  <rharinath@novell.com>
3182
3183         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
3184         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
3185         CS0206 checks.
3186         (Argument.Resolve): Remove CS0206 checks.
3187
3188 2006-02-01  Miguel de Icaza  <miguel@novell.com>
3189
3190         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
3191         scopes for all the roots, the scopes will now be emitted when the
3192         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
3193
3194         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
3195         code.  This reduces a lot of existing cruft.
3196         
3197         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
3198         that the ScopeInfo is generated as we enter the scope, not at the
3199         time of use, which is what we used to do before.
3200
3201         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
3202         every time a Block is about to be emitted if we have a
3203         CaptureContext. 
3204
3205 2006-02-01  Raja R Harinath  <rharinath@novell.com>
3206
3207         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
3208         (Reset): Update.
3209         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
3210
3211         * typemanager.cs (cons_param_array_attribute): Make private.
3212         (Reset): Set it to null.
3213         (InitCoreHelpers): Don't initialize it.
3214         (ConsParamArrayAttribute): New.  Initialize it as needed.
3215         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
3216
3217 2006-01-31  Miguel de Icaza  <miguel@novell.com>
3218
3219         * expression.cs: There might be errors reported during the
3220         selection of applicable methods.  If there are errors, do not
3221         continue execution as it will lead the compiler to crash.
3222
3223 2006-01-30  Miguel de Icaza  <miguel@novell.com>
3224
3225         * expression.cs: Member access is not allowed on anonymous
3226         methods.  Fixes #77402.
3227
3228 2006-01-30  Raja R Harinath  <rharinath@novell.com>
3229
3230         Fix #77401
3231         * cs-parser.jay (VariableDeclaration): Don't set
3232         current_array_type to null.
3233         (field_declaration, event_declaration, declaration_statement):
3234         Set it to null here.
3235
3236 2006-01-28  Raja R Harinath  <harinath@gmail.com>
3237
3238         * typemanager.cs (GenericParameterPosition): New.
3239         * doc.cs: Use it.
3240
3241 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
3242
3243         * doc.cs : To process "include" elements, first we should create
3244           another list than XmlNodeList, because it could result in node
3245           removal, which could result in that the XmlNodeList gives up
3246           yielding next node.
3247
3248           (Also made code identical to gmcs again.)
3249
3250 2006-01-25  Miguel de Icaza  <miguel@novell.com>
3251
3252         * ecore.cs: Introduce an error report that we were not catching
3253         before, if not silent, we must report the error.  Gonzalo ran into
3254         it.
3255
3256 2006-01-23  Miguel de Icaza  <miguel@novell.com>
3257
3258         A fix for bug: #76957
3259         
3260         * iterators.cs (MoveNextMethod.CreateMethodHost): call
3261         ComputeMethodHost before creating the method, this is a new
3262         requirement. 
3263
3264         * anonymous.cs (AnonymousContainer): Now we track all the scopes
3265         that this method references (RegisterScope).  The actual scope
3266         where the method is hosted is computed with the ComputeMethodHost
3267         before we create the method.
3268
3269         Moved the Deepest routine here.
3270
3271         (AnonymousContainer.ComputeMethodHost): New routine used to
3272         compute the proper ScopeInfo that will host the anonymous method.
3273
3274         (ScopeInfo): Deal with multiple roots.  The problem was that we
3275         did not have a unique root where all ScopeInfos could be hanged
3276         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
3277         of roots.  
3278
3279         Remove AdjustMethodScope which is now computed at the end.  Remove
3280         LinkScope which did a partial link, instead link all ScopeInfos
3281         before code generation from the new "LinkScopes" routine. 
3282
3283         Simplify all the Add* routines as they no longer need to maintain
3284         the tree, they just need to record that they are using variables
3285         from a ScopeInfo.
3286
3287         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
3288         routines to produce the forest of ScopeInfo trees.
3289
3290         * class.cs (TypeContainer.AppendMethod): This is just like
3291         AddMethod, but ensures that an interface implementation method
3292         (IEnumerable.XXX) is not inserted at the beginning of the queue of
3293         methods, but at the end.
3294
3295         We use this functionality to ensure that the generated MoveNext
3296         method in the iterator class is resolved/emitted before the
3297         enumerator methods created.   
3298
3299         This is required because the MoveNext method computes the right
3300         ScopeInfo for the method.  And the other methods will eventually
3301         need to resolve and fetch information computed from the anonymous
3302         method. 
3303
3304 2006-01-21  Raja R Harinath  <harinath@gmail.com>
3305             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
3306
3307         Fix rest of #76995.
3308         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
3309         the 'aliases' hash.
3310         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
3311         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
3312
3313 2006-01-18  Raja R Harinath  <rharinath@novell.com>
3314
3315         Fix #76656, cs0231-2.cs.
3316         * cs-parser.jay (formal_parameter_list): Make error case catch
3317         more issues.
3318         (parenthesized_expression_0): Add CS1026 check.
3319         (invocation_expression): Remove unused { $$ = lexer.Location }.
3320
3321 2006-01-17  Raja R Harinath  <rharinath@novell.com>
3322
3323         Fix #76824.
3324         * cs-parser.jay (statement_expression): Don't list out the
3325         individual statement-expressions.  Convert syntax error into
3326         CS0201 check.
3327
3328 2006-01-16  Raja R Harinath  <rharinath@novell.com>
3329
3330         Fix #76874.
3331         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
3332         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
3333         CheckIntermediateModification.
3334         (FieldExpr.DoResolve): Add new two-argument version that
3335         allows us to resolve the InstanceExpression as an lvalue.
3336         The one-argument variant is now just a wrapper.
3337         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
3338         Resolve the lhs as an lvalue if the it has a value type.
3339         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
3340         from Assign.DoResolve.
3341         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
3342         resolved as an lvalue.
3343         (PropertyExpr.DoResolve): Update.
3344         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
3345         has a value type.  Move CS1612 check here from
3346         CheckIntermediateModification.
3347         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
3348         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
3349         'right_side' of a ResolveLValue on an 'out' argument.
3350         (EmptyExpression.LValueMemberAccess): New.  Used as the
3351         'right_side' of a propagated ResolveLValue on a value type.
3352         (LocalVariableReference.DoResolveBase): Recognize
3353         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
3354         Add CS1654 check.
3355         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
3356         EmptyExpression.Null.
3357
3358 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
3359
3360         * typemanager.cs : added IsGenericParameter(). In mcs it always
3361           return false.
3362         * doc.cs : for generic parameters, use GenericParameterPosition,
3363           not FullName.
3364
3365 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
3366
3367         * expression.cs: Fix Console.WriteLine ((this = x).foo);
3368
3369 2006-01-12  Miguel de Icaza  <miguel@novell.com>
3370
3371         This fixes the problem where we used ldfld instead of ldflda to
3372         load the "THIS" pointer on captured parameters, when THIS is a
3373         value type.  See bug #77205.
3374         
3375         * iterators.cs (CapturedThisReference.Emit): Pass false to
3376         EmitThis (we do not need the address).
3377
3378         * codegen.cs (EmitThis): it needs to know whether we need the
3379         address of `this' or not.  This is used by value types.  
3380
3381         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
3382         every other call passes false.
3383
3384 2006-01-12  Raja R Harinath  <rharinath@novell.com>
3385
3386         Fix #77221.
3387         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
3388         GetOverride.
3389         * expression.cs (Invocation.OverloadResolve): Update.
3390         (Invocation.DoResolve): Avoid double resolution of invocation.
3391
3392 2006-01-11  Raja R Harinath  <rharinath@novell.com>
3393
3394         Fix #77180.
3395         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
3396         unary negation of floating point types as 0-expr; negation cannot
3397         overflow in floating point types.
3398
3399         Fix #77204.
3400         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
3401         on operands of 'void' type.
3402
3403         Fix #77200.
3404         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
3405         and ExclusiveOr for boolean constants too.
3406
3407 2006-01-09  Raja R Harinath  <rharinath@novell.com>
3408
3409         Fix #75636.
3410         * expression.cs (Invocation.OverloadResolve): Replace reflected
3411         override methods with their base virtual methods, rather than
3412         skipping over them.
3413         * typemanager.cs (TypeManager.GetOverride): New.
3414
3415 2006-01-05  Jb Evain  <jbevain@gmail.com>
3416
3417         * class.cs (Property.Define, Indexer.Define): do not tag the
3418         properties as SpecialName | RTSpecialName.
3419
3420 2006-01-04  Miguel de Icaza  <miguel@novell.com>
3421
3422         * class.cs (MethodCore.IsDuplicateImplementation): This method was
3423         doing a low-level comparission of parameter types.  It was lacking
3424         a check for __argslist. 
3425
3426 2005-12-30  Miguel de Icaza  <miguel@novell.com>
3427
3428         * expression.cs (ParameterReference.DoResolveBase): Allow
3429         reference parameters if they are local to this block. 
3430
3431         This allows the ref and out parameters of a delegate to be used in
3432         an anonymous method, for example:
3433
3434         delegate void set (out int x);
3435
3436         set s = delegate (out int x){
3437                 x = 0;
3438         };
3439
3440         This is used by functionality introduced late in the C# language.
3441         
3442         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
3443         method that take ref and out parameters. 
3444
3445         Fixes #77119 which was a late change in the spec.
3446
3447 2005-12-23  Miguel de Icaza  <miguel@novell.com>
3448
3449         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
3450         parent if its the same scope.  Fixes #77060.
3451
3452 2005-12-21  Miguel de Icaza  <miguel@novell.com>
3453
3454         * driver.cs: Report the case of no source files and no -out:
3455         argument provided.
3456
3457 2005-12-20  Raja R Harinath  <rharinath@novell.com>
3458
3459         Fix #77035.
3460         * expression.cs (ComposedCast.GetSignatureForError): Define.
3461
3462 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3463
3464         Fix #76995
3465
3466         * namespace.cs (NamespaceEntry): Add extern_aliases as a
3467         ListDictionary, to contain the ExternAliasEntry entries (in
3468         addition to the NamespaceEntry.aliases hashtable). This field is
3469         shared between the original entry and its doppelganger (bodyless 
3470         copy of it).
3471         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
3472         extern_aliases field.
3473         (NamespaceEntry.Lookup): Move the IsImplicit check after the
3474         lookup in extern_aliases.
3475
3476 2005-12-16  Raja R Harinath  <rharinath@novell.com>
3477
3478         Fix #77006.
3479         * class.cs (TypeContainer.Mark_HasEquals): New.
3480         (TypeContainer.Mark_HasGetHashCode): New.
3481         (ClassPart): Override them.
3482         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
3483
3484         Fix #77008.
3485         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
3486         'parent' argument to the base constructor.
3487
3488         Remove all mention of TypeContainer from decl.cs.
3489         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
3490         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
3491         (DeclSpace.DeclSpace): Likewise.
3492         (DeclSpace.DefineMembers): Remove unused argument.
3493         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
3494         debugging check -- we don't care if the debug code throws an
3495         InvalidCastException instead of an InternalErrorException.
3496         * class.cs (TypeContainer.DefineMembers): Update to changes.
3497         (TypeContainer.DoDefineMembers): Likewise.
3498         (TypeContainer.GetMethods): Likewise.
3499         (PropertyMember.Define): Likewise.
3500         (MemberBase.Parent): New property that forwards to
3501         MemberCore.Parent, but ensures that we get a TypeContainer.
3502         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
3503         (RootContext.PopulateTypes): Likewise.  Remove special case code
3504         for !RootContext.StdLib: DefineMembers is idempotent.
3505
3506 2005-12-14  Miguel de Icaza  <miguel@novell.com>
3507
3508         * convert.cs (ExplicitConversionCore): Check the return value from
3509         ExplicitConversionCore which can return null on failure.  Fixes #76914
3510
3511 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
3512
3513         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
3514
3515 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
3516
3517         * doc.cs : The search for referenced namespace was insufficient to
3518           get global one as it used to do. Fixed bug #76965.
3519
3520 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
3521
3522         * doc.cs : check name in cref in the last phase that whether it is
3523           namespace or not.
3524
3525 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3526
3527         * cs-tokenizer.cs : reverted the latest change: it somehow broke
3528           Mono.C5.
3529
3530 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3531
3532         * doc.cs : so it turned out that we cannot skip override check for 
3533           interface members. Fixed bug #76954.
3534
3535 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3536
3537         * cs-tokenizer.cs : fixed bug #75984:
3538           - #warning and #error should not be handled when the source line
3539             is disabled.
3540           - #line is not checked strictly when the source line is disabled.
3541           - #define and #undef is on the other hand checked strictly at any
3542             state.
3543
3544 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
3545
3546         * cs-tokenizer.cs : missing Location (actually, filename) in one of
3547           CS1027 report.
3548
3549 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3550
3551         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
3552
3553         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
3554         event initializers.
3555         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3556         (FieldBase.Initializer): Initializer is now optional.
3557         (EventField.Define): Only event field can have initializer.
3558
3559         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3560
3561         * const.cs (Const): Reuse initializer.
3562
3563         * cs-parser.jay: Updated after FieldBase changes.
3564         Added current_array_type to simplify array initializers.
3565
3566         * ecore.cs (NullCast.IsDefaultValue): Implemented.
3567
3568         * expression.cs, iterators.cs: Updated.
3569
3570         * namespace.cs (NamespaceEntry): Made UsingFound private.
3571
3572 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3573
3574         * parameterCollection.cs: Obsolete, removed.
3575         * parser.cs: Obsolete, removed.
3576
3577 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3578
3579         Fix #76849.
3580         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3581
3582         * enum.cs (Enum.Define): Set obsolete context here.
3583
3584 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3585
3586         * doc.cs :
3587           - FindDocumentedMember() now expects 1) paramList as null
3588             when "we don't have to check the number of parameters" and
3589             2) Type.EmptyTypes when "there is no arguments".
3590           - Introduced FoundMember struct to hold the exact type which was
3591             used to find the documented member (the above change broke
3592             test-xml-044; it might be better just to use DeclaringType than
3593             what MS does, like this change does, but it depends on usage.)
3594
3595 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3596
3597         * doc.cs : documented member might be from DeclaringType for nested
3598           types. Fixed bug #76782.
3599
3600 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
3601
3602         * anonymous.cs: Have the param code handle leaving copies on the
3603         stack etc. Allows anonymous params to take part in the assignment
3604         code (++, +=, etc). Fixes bug #76550
3605
3606         * expression.cs: Handle the prepare_for_load/leave_copy by passing
3607         it down to the anon code.
3608
3609         * iterators.cs: Use dummy var here
3610
3611         * codegen.cs: Handle new vars
3612
3613 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3614
3615         Fix #76849.
3616         * class.cs (MethodData.Define): Set proper Obsolete context.
3617
3618         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3619         obsolete context.
3620         (FieldExpr.DoResolve): Ditto.
3621
3622 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3623
3624         Fix #76849.
3625         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3626         parent is not obsolete.
3627
3628 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
3629
3630         * doc.cs : (FindDocumentedMember) find parameterless members first
3631           and get CS0419 in the early stage. Fixed first case of bug #76727.
3632
3633 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
3634
3635         Fix #76859.
3636         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3637         no error was reported.
3638
3639         *expression.cs (Binary.DoResolve): left can be null.
3640
3641 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
3642
3643         Fix #76783.
3644         * class.cs (MethodData.Emit): Parameters should be labeled first.
3645
3646 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
3647
3648         Fix #76761.
3649         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3650
3651 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
3652
3653         * attribute.cs (AreParametersCompliant): Moved to Parameter.
3654
3655         * class.cs (MethodCore): Parameter clean up.
3656         (IMethodData): Added ParameterInfo.
3657         (MethodData): Parameter clean up.
3658         (Indexer.Define): Parameter clean up.
3659
3660         * anonymous.cs,
3661         * codegen.cs,
3662         * cs-parser.jay,
3663         * decl.cs,
3664         * doc.cs,
3665         * ecore.cs,
3666         * flowanalysis.cs,
3667         * iterators.cs,
3668         * pending.cs,
3669         * statement.cs,
3670         * typemanager.cs: Parameter clean up.
3671
3672         * delegate.cs (Define): Get rid of duplicated code.
3673
3674         * expression.cs (ParameterReference): Removed useless parameters
3675         and simplified.
3676         (Invocation): Ditto.
3677
3678         * parameter.cs (ParamsParameter): New class, params specialization.
3679         (ArglistParameter): Attemp to separate arglist.
3680         (Parameter): Refactored to be reusable and faster.
3681         (Parameter.Modifier): Made understandable.
3682         (Parameters): Changed to be used as a class for `this' assembly
3683         parameters. Refactored to use new specialized classes.
3684
3685         * support.cs (ParameterData): Added Types property.
3686         (InternalParameters): Deleted.
3687
3688 2005-08-20  Martin Baulig  <martin@ximian.com>
3689
3690         Merging this patch from GMCS to fix #75867.
3691
3692         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3693         scope if we don't already have it.
3694
3695 2005-11-17  Martin Baulig  <martin@ximian.com>
3696
3697         * anonymous.cs
3698         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3699         inherit the scope from our parent.  Fixes #76653.
3700
3701 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3702
3703         * doc.cs : the previous patch does not actually fix the bug.
3704           PropertyInfo override check is now implemented and really fixed it.
3705         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3706
3707 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3708
3709         * doc.cs : apply "override filter" also to properties.
3710           Fixed bug #76730.
3711
3712 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3713
3714         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3715           no need to check overrides. For classes, omit those results from 
3716           interfaces since they must exist in the class. Fixed bug #76726.
3717
3718 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3719
3720         * typemanager.cs : (GetFullNameSignature) differentiate indexers
3721           with different parameters. Fixed the second problem in #76685.
3722
3723 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3724
3725         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3726           get expected 'protected' access in CheckValidFamilyAccess()).
3727           Fixed bug #76692.
3728
3729 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3730
3731         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3732           Fixed bug #76705.  CS1569 was incorrectly commented out.
3733
3734 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3735
3736         * doc.cs : use Invocation.IsOverride() to do real override check.
3737         * expression.cs : made Invocation.IsOverride() internal.
3738
3739 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3740
3741         * doc.cs : use TypeManager.FindMembers() instead of (possible)
3742           TypeBuilder.FindMembers() and filter overriden base members out.
3743           Fixed bug #76990.
3744
3745 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3746
3747         * doc.cs : ref/out parameters are represented as '@' (instead of
3748           '&' in type FullName). Fixed bug #76630 (additionally crefs).
3749
3750 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3751
3752         * doc.cs : when there was no '.' in cref to methods in doc comment,
3753           then parameters were missing in the output. Fixed bug #76691.
3754
3755 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3756
3757         * driver.cs : don't output docs when there is an error.
3758           Fixed bug #76693.
3759
3760 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3761
3762         * doc.cs :
3763           Now it should detect indexers. Fixed primary concern in bug #76685.
3764           Fixed CS0419 message to not show the identical member signature in
3765           the message.
3766
3767 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3768
3769         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3770           instead of Type.FindMembers() since it does not handle events.
3771           Fixed bug #71604.
3772
3773 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3774
3775         * codegen.cs: Fixed typo (speficied -> specified).
3776
3777 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3778
3779         Fix #76369.
3780         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3781
3782 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3783
3784         * attribute.cs: Changed error message.
3785
3786         * cs-tokenizer.cs: One more check.
3787
3788 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3789
3790         * statement.cs (Block.Resolve): Ignore empty statement.
3791
3792 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3793
3794         * report.cs: Made error/warning methods more strict to avoid
3795         their misuse.
3796
3797         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3798         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3799         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3800         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3801
3802 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3803
3804         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3805         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3806
3807         * class.cs (TypeContainer.IsComImport): New property.
3808         (Constructor.Define): Create proper ctor for ComImport types.
3809
3810         * expression.cs (New.CheckComImport): Fixed.
3811
3812 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3813
3814         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3815         that a parameter has been captured does not mean that we do not
3816         have to do the rest of the processing.  This fixes the second part
3817         of #76592.  If there was another anonymous method capturing
3818         values in the past, the Scope would never be set for the second
3819         method that captured the same parameter.
3820
3821         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3822         properly manipulate the stack.   Second part of fix for #76592.
3823
3824         * expression.cs (New): Add support for invoking "new" on
3825         interfaces that have been flagged with the ComImport attribute and
3826         the CoClass.  Fixes #76637 
3827
3828         * statement.cs (Try.DoEmit): When a variable is captured, do not
3829         try to emit the vi.LocalBuilder variable as it has been captured.
3830         Create a temporary variable and store the results on the
3831         FieldBuilder.  Fixes #76642
3832
3833 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3834
3835         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3836
3837         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3838
3839         * expression.cs (Binary.DoResolve): Added && optimalization.
3840     
3841         * typemanager.cs (AddUserType): Removed useless argument.
3842
3843 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3844
3845         * statement.cs (Block.variables): Uses ListDictionary.
3846
3847 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3848
3849         Fix #75969.
3850         * class.cs (PartialContainer.EmitType): Customized to emit
3851         security attributes.
3852         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3853         for partial classes.
3854
3855 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3856
3857         Fix #76599.
3858         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3859         access has to be fixed.
3860         
3861         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3862
3863 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3864
3865         Fix #76590.
3866         * ecore.cs (NullCast.Reduce): Implemented.
3867
3868         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3869         constant type.
3870         
3871         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3872         properly.
3873         (Foreach.Resolve): Catch null properly.
3874
3875 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3876  
3877         * cs-tokenizer.cs: Warning text fix.
3878
3879         * driver.cs: AllWarningNumbers exposed on public interface.
3880
3881         * report.cs (): Reviewed warning numbers.
3882         (IsValidWarning): Use binary search.
3883
3884 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3885  
3886         * driver.cs: Implemeted resource visibility.
3887         (Resources): New class for code sharing between /res: and
3888         /linkres:
3889  
3890 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3891
3892         Fix #76568.
3893         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3894         folding.
3895         
3896         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3897         contants only.
3898         
3899         * ecore.cs (NullCast): Child is contant only.
3900         
3901         * literal.cs (NullLiteral.Reduce): null can be converted to any
3902         reference type.
3903
3904 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3905
3906         * driver.cs: Use Encoding.Default as default code page instead
3907           of ISO-28591.
3908
3909 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3910
3911         Fix #76085.
3912         * expression.cs (Invocation.Error_InvalidArguments): Handle
3913         __arglist parameters.
3914         (Invocation.VerifyArgumentsCompat): Likewise.
3915         * support.cs (ReflectionParameters.GetSignatureForError): Print
3916         __arglist parameters.
3917         (InternalParamters.GetSignatureForError): Likewise.
3918         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3919
3920 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3921
3922         * attribute.cs (GetPropertyValue): Made public.
3923
3924         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3925         Resolve.
3926         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3927         attribute.
3928         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3929         is not defined.
3930         
3931         * driver.cs: Reflect method name change.
3932         
3933         * statement.cs (Try.Resolve): Warn when try has both general
3934         exception handlers.
3935         
3936         * typemanager.cs: runtime_compatibility_attr_type new predefined
3937         type.
3938
3939 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3940
3941         Fix #76419.
3942         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3943         treat it as an empty parameter list.
3944
3945 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3946
3947         Fix #76271.     
3948         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3949         ResolveAsTypeStep silent.
3950         * statement.cs (Block.AddConstant): Mark block as used.
3951         (Block.ResolveMeta): Avoid piling on error messages
3952         if a constant initializer resolution fails.
3953
3954 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3955
3956         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3957         Remove.
3958         (NamespaceEntry.VerifyAllUsing): New.
3959         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3960         behaviour.  Delegates actual resolution of alias to ...
3961         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3962         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3963         Update.
3964         * driver.cs (Driver.MainDriver): Update.
3965         
3966         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3967         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3968         property.
3969         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3970         Remove.
3971         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3972         RootNamespace.DefineNamespacesForAll.
3973
3974 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3975
3976         * typemanager.cs (assemblies, external_aliases, modules)
3977         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3978         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3979         overhead.  Move resposibility ...
3980         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3981         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3982
3983 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3984
3985         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3986         cached_namespaces.  Improve usage.
3987         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3988         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3989         Move from GlobalRootNamespace and simplify.
3990         (RootNamespace.Global): Make instance variable.
3991         (RootNamespace.RootNamespace): Add "alias name" parameter.
3992         (GlobalRootNamespace): Simplify drastically.
3993         (Namespace.Lookup): Don't use GetNamespace.
3994         * typemanager.cs (GetRootNamespace): Rename from
3995         ComputeNamespaceForAlias.
3996         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3997
3998 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3999
4000         * anonymous.cs (AnonymousContainer): Don't crash when container
4001         doesn't exist.
4002
4003 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4004
4005         * expression.cs (Binary.DoResolve): Warn when comparing same
4006         values.
4007
4008 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4009
4010         Fix #76486.
4011         * expression.cs (Binary.DoResolve): It looks like there are no
4012         convetsion rules in enum context.
4013
4014 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4015
4016         Add support for extern alias qualifiers.
4017         * typemanager.cs: Move some LookupTypeReflection code
4018         to namespace.cs, to have cleaner code. Added some methods
4019         to help us keep track of the extern aliased references.
4020         * driver.cs: Add suport for extern alias assemblies on command
4021         line and check for their warnings/errors. Also keep track of the
4022         extern aliased assemblies.
4023         * namespace.cs: Move the global functionality of Namespace
4024         to GlobalRootNamespace/RootNamespace. Now the global namespace
4025         is GlobalRootNamespace.Globa. Also the code moved from 
4026         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
4027         Finally added LocalAliasEntry (AliasEntry before) and
4028         ExternAliasEntry, to handle alias statements.
4029         * cs-parser.jay: Add support in the grammar for extern alias
4030         statement.
4031         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
4032         Update callings to Namespace (now in GlobalRootNamespace).
4033
4034 2005-10-18  Raja R Harinath  <rharinath@novell.com>
4035
4036         Fix #76371.
4037         * class.cs (TypeContainer.DefineType): Move updating of
4038         topological sort earlier in the code.
4039         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
4040
4041 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
4042
4043         Fix #76273.
4044         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
4045         
4046         * constant.cs (Constant.TryReduce): Moved from Cast class.
4047         (Reduce): Made little bit more OO and fixed missing conversions.
4048         
4049         * ecore.cs (Reduce): Implemented.
4050         (Binary.EnumLiftUp): New method to upgrade values to enum values.
4051         
4052         * literal.cs (Reduce): Implemented.
4053         
4054         * class.cs: Reverted Miguel's wrong commit.
4055
4056 2005-10-14  Miguel de Icaza  <miguel@novell.com>
4057
4058         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
4059
4060 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
4061
4062         * cs-parser.jay, expression.cs : CS0214 was missing error location
4063           for constants. Fixed bug #76404.
4064
4065 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
4066
4067         Fix #76370.
4068         * convert.cs (ExplicitConversionCore): Fixed object->enum
4069         conversion.
4070
4071 2005-10-10  Raja R Harinath  <rharinath@novell.com>
4072
4073         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
4074         InstanceExpression.
4075         (PropertyExpr.EmitCall): Likewise.
4076         * expression.cs (Invocation.EmitArguments): Handle case where
4077         arguments == null.
4078         (Invocation.EmitCall): Avoid allocating temporary variable if
4079         there are no arguments.
4080
4081 2005-10-07  Raja R Harinath  <rharinath@novell.com>
4082
4083         Fix #76323.
4084         * convert.cs (ImplicitConversionStandard): Move conversion of
4085         void* to arbitrary pointer types ...
4086         (ExplicitConversionStandard): .. here.
4087         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
4088         error to always print typenames.
4089
4090 2005-10-07  Raja R Harinath  <rharinath@novell.com>
4091
4092         * convert.cs (GetConversionOperator): Rename from
4093         GetConversionOperators.  Move operator selection code from ...
4094         (UserDefinedConversion): ... here.
4095
4096 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
4097
4098         * convert.cs (ExplicitConversionCore): Removed duplicate enum
4099         conversion.
4100
4101 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
4102
4103         * assign.cs (Assign.DoResolve): Error method changed.
4104
4105         * cfold.cs (DoConstantNumericPromotions): Error method changed.
4106         
4107         * const.cs (ResolveValue): Reset in_transit immediately.
4108         
4109         * constant.cs: Error method changed.
4110         
4111         * convert.cs: Removed useless location parameter.
4112         (ExplicitNumericConversion): Don't do double enum check.
4113         (ExplicitConversionCore): Renamed from ExplicitConversion.
4114         (ExplicitUnsafe): Extracted from ExplicitConversion.
4115         (ExplicitConversion): Uses for error reporting.
4116         
4117         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
4118         error messages.
4119         (ResolveBoolean): Uses common error method.
4120         (CastToDecimal): Get rid of ec.
4121         (CastFromDecimal): Optimized.
4122         (ConvCast): Get rid of ec.
4123         
4124         * enum.cs (ResolveValue): Reset in_transit immediately.
4125         (Emit): Return after first error.
4126         
4127         * expression.cs: Convert changes.
4128         
4129         * literal.cs: Error method changed.
4130         
4131         * statement.cs: Error method changed.
4132
4133 2005-10-03  Raja R Harinath  <rharinath@novell.com>
4134
4135         * support.cs (SeekableStreamReader.Position): Don't error out when
4136         the requested position is just beyond the end of the current
4137         buffered data.
4138
4139 2005-09-28  Raja R Harinath  <rharinath@novell.com>
4140
4141         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
4142         try to keep in sync with the byte count of the underlying Stream.
4143         However, this limits us to a window size of 2048 characters: i.e.,
4144         the maximum lookahead of our lexer/parser can be 2048 characters.
4145
4146 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
4147
4148         Fix #76255.
4149         * driver.cs: Fix compilation files with full root path.
4150
4151 2005-09-25  Miguel de Icaza  <miguel@novell.com>
4152
4153         * report.cs (SymbolRelatedToPreviousError): Format the output so
4154         it does not use an open parenthesis that is never closed. 
4155
4156         * driver.cs: Follow coding guidelines
4157
4158 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4159
4160         Fix #72930.
4161         * const.cs (Const.ResolveValue): Check for assigning non-null
4162         value to reference type.
4163
4164 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4165
4166         * anonymous.cs: Implemented ExprClassName.
4167         
4168         * assign.cs (Assign.DoResolve): Don't chrash when type is not
4169         delegate.
4170         
4171         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
4172         check.
4173         
4174         * class.cs (StaticClass.DefineContainerMembers): Report protected
4175         members as error.
4176         
4177         * codegen.cs: if(ed) PRODUCTION.
4178         
4179         * convert.cs (Error_CannotImplicitConversion): Better error
4180         distinction.
4181         
4182         * cs-parser.jay: More error checks.
4183         
4184         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
4185         
4186         * driver.cs (CSCParseOption): Enabled wrong option check.
4187         
4188         * ecore.cs (Expression.ExprClassName): Turned to property.
4189         (MemberExpr.CheckIntermediateModification): For checking boxed
4190         value types     modification.
4191         
4192         * statement.cs (Fixed.Resolve): Expression type must be
4193         convertible to fixed type.
4194         (CollectionForeach.GetEnumeratorFilter,TryType):
4195         Small refactoring for easier error checking.
4196
4197 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
4198
4199         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4200         attributes.
4201         
4202         * class.cs (GeneratedBaseInitializer): New class for customization
4203         compiler generated initializers.
4204         (MemberBase.DoDefine): Check Obsolete attribute here.
4205         (FieldMember.DoDefine): Ditto.
4206         
4207         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
4208         constants.
4209         
4210         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
4211         (MemberCore.GetObsoleteAttribute): Removed argument.
4212         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
4213         (MemberCore.CheckObsoleteType): New helper.
4214         
4215         * delegate.cs,
4216         * enum.cs,
4217         * statement.cs: Updates after MemberCore changes.
4218         
4219         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
4220         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
4221         
4222         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
4223         obsolete attribute for compiler construct.
4224         (As.DoResolve): Cache result.
4225         
4226         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
4227
4228 2005-09-26  Raja R Harinath  <rharinath@novell.com>
4229
4230         Fix #76133.
4231         * expression.cs (This.VerifyFixed): In a value type T, the type of
4232         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
4233         value type R, 'this' is treated as a value parameter.
4234
4235 2005-09-22  Miguel de Icaza  <miguel@novell.com>
4236
4237         * statement.cs (Lock): Use the TemporaryVariable class instead of
4238         manually using local variables as those do not work when variables
4239         are captured.
4240
4241         * ecore.cs: Moved the TemporaryVariable class from being a nested
4242         class inside Foreach to be a public class that can be employed in
4243         other places. 
4244
4245 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
4246
4247         * cs-parser.jay: interface_accessors replaced by
4248         accessor_declarations.
4249
4250         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
4251         location.
4252         
4253         * statement.cs (GotoCase.Resolve): Convert null constant to
4254         null case.
4255         (SwitchLabel.ResolveAndReduce): Ditto.
4256         (SwitchLabel.NullStringCase): Custom null stamp.
4257         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
4258         
4259         typemanager.cs (CSharpSignature): Don't skip first argument
4260         for full names.
4261
4262 2005-09-18  Miguel de Icaza  <miguel@novell.com>
4263
4264         * driver.cs: Set InEmacs based on the environment variable EMACS. 
4265
4266         * location.cs (InEmacs): in this mode, do not report column
4267         location as it confuses Emacs.
4268
4269 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
4270
4271         * cfold.cs, constant.cs, convert.cs, ecore.cs,
4272         expression.cs, iterators.cs, literal.cs: Store constants and
4273         literals location.
4274         
4275         * class.cs (MemberBase.ShortName): Pass location.
4276         
4277         * cs-parser.jay: Some location fixes.
4278         
4279         * ecore.cs (Expression.Location): Made virtual.
4280
4281 2005-09-05  Miguel de Icaza  <miguel@novell.com>
4282
4283         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
4284         if the underlying types are the same, otherwise we need to produce
4285         code that will do the proper cast.
4286
4287         This was exposed by Marek's constant rewrite which produced
4288         invalid code for the call site:
4289
4290         enum X : long { a }
4291         void Method (X v) {}
4292
4293         Method ((X) 5)
4294
4295         This fixes test-49.cs
4296
4297 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4298
4299         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
4300           Type/Object should be allowed as well. Fixed bug #75968.
4301
4302 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4303
4304         * expression.cs : (Binary.DoResolve): when one is enum constant and
4305           another is constant 0, then return enum one *as enum type*.
4306           Fixed bug 74846.
4307
4308 2005-09-02  Raja R Harinath  <rharinath@novell.com>
4309
4310         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4311         internal.
4312
4313         Fix #75941.
4314         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4315         flow-branching for LocalVariableReferences in case we were invoked
4316         from a MemberAccess.
4317         * expression.cs (LocalVariableReference.VerifyAssigned): New.
4318         Carved out of ...
4319         (LocalVariableReference.DoResolveBase): ... this.
4320         (MemberAccess.Resolve): Do the check that was disabled during
4321         SimpleNameResolve.
4322
4323 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4324
4325         * class.cs :
4326           (PartialContainer.Create): check abstract/sealed/static strictly
4327           but abstract/sealed can exist only at one side. Fixed bug #75883.
4328
4329 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
4330
4331         Fix #75945.
4332         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4333         specified, don't default to UnmanagedType.I4.
4334
4335 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4336
4337         * expression.cs : conditional operator should check possibly
4338           incorrect assign expression. Fixed bug #75946.
4339
4340 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
4341
4342         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
4343           Reverting the change. gmcs is much complex than mcs on this matter.
4344
4345 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
4346
4347         * cs-tokenizer.cs : To read another token ahead of the actual 
4348           consumption, use new SavedToken and cache token instead of moving
4349           back the stream with SeekableStreamReader (it seemed problematic).
4350         * cs-parser.jay,
4351           driver.cs : Thus use StreamReader directly.
4352         * support.cs : Thus removed SeekableStreamReader.
4353
4354 2005-08-30  Raja R Harinath  <rharinath@novell.com>
4355
4356         Fix #75934.
4357         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
4358         (ScopeInfo.EmitScopeType): Use it to construct field names from
4359         names of captured locals.
4360
4361         Fix #75929.
4362         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
4363         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
4364         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
4365         (ExplicitConversion): Remove enum cases already handled by
4366         implicit conversion.  Move implicit conversion check to the beginning.
4367         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
4368         * expression.cs (ArrayCreation.EmitDynamicInitializers):
4369         Don't treat System.Enum as a struct.
4370
4371 2005-08-30  Jb Evain  <jbevain@gmail.com>
4372
4373         * attribute.cs: handles as expression in parameters.
4374
4375 2005-08-30  Raja R Harinath  <rharinath@novell.com>
4376
4377         Fix #75802.
4378         * class.cs (TypeContainer.VerifyClsName): Don't use a
4379         PartialContainer when verifying CLS compliance.
4380         (AbstractPropertyEventMethod): Set Parent here, ...
4381         (PropertyMethod): ... not here.
4382
4383 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
4384
4385         * attribute.cs : escaped attribute name should not be allowed to be
4386           resolved (e.g. @class as classAttribute). Fixed bug #75930.
4387
4388 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4389
4390         Fix #75927.
4391         * convert.cs (ImplicitStandardConversionExists): Allow zero also
4392         when converting a long constant to unsigned long.
4393         * expression.cs (Invocation.OverloadResolve): Add sanity check to
4394         detect where IsApplicable and VerifyArgumentsCompat disagree.
4395
4396 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4397         and Carlos Alberto Cortez  <carlos@unixmexico.org>
4398
4399         Fix #75848.
4400         * class.cs (TypeContainer.CanElideInitializer): New helper.
4401         (TypeContainer.EmitFieldInitializers): Use it to determine if we
4402         can safely emitting the initializer of a field.
4403
4404 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4405
4406         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4407           allowed inside a switch (without loop). Fixed bug #75433.
4408
4409 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4410
4411         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4412         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4413
4414 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4415
4416         * driver.cs : kinda reverting the default encoding changes (not exact 
4417           revert since I noticed that "codepage:reset" might not work fine).
4418
4419 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4420
4421         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4422           Location. Now getter and setter store location correctly.
4423           (errors/cs0111-12.cs now reports the expected location.)
4424
4425 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4426
4427         * driver.cs : Use default encoding on the environment.
4428           Removed (now that) extra parameter for SeekableStreamReader.
4429         * support.cs : (SeekableStreamReader) third .ctor() argument for
4430           StreamReader is not required (always true). preamble size could
4431           be acquired in simpler and safe way.
4432
4433 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4434
4435         * cs-parser.jay: report CS0642 at warning level 3
4436           and report CS0642 for an if else statement also
4437           fixes bug #74745. Patch by John Luke (and a bit
4438           modified by me).
4439           Removed extra CS0642 warning check for "while",
4440           "for" and "fixed".
4441         * statement.cs: In Block.Resolve(), CS0642 check
4442           is reimplemented to check a sequence of an empty
4443           statement and a block.
4444
4445           Both fix bug #66777.
4446
4447 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
4448
4449         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4450         detection until I fix it.
4451         
4452         * cs-tokenizer.cs: Changed error message.
4453         
4454         * cs-parser.jay: Fixed 2 error locations.
4455         
4456         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4457         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4458         properties.
4459         
4460         * enum.cs (GetSignatureForError): Fixed.
4461         
4462         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4463         method detection.
4464         
4465         * class.cs,
4466         * typemanager.cs (RegisterProperty): Removed.
4467         
4468         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4469
4470 2005-08-24  Raja R Harinath  <rharinath@novell.com>
4471
4472         Fix #75874.
4473         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4474         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4475
4476 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4477
4478         * expression.cs : tiny fix is required for not warning positive ulong.
4479           See test-441.cs.
4480
4481 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4482
4483         * expression.cs : add CS0652 check for constant and integral
4484           expression. Fixed bug #53974.
4485
4486 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4487
4488         * expression.cs : in DoNumericPromotions(), check if there is implicit
4489           conversion overload for string (to check CS0034). Fixed bug #52492.
4490
4491 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4492
4493         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4494
4495 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4496
4497         * ecore.cs : report location when it is *not* Null.
4498
4499 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4500
4501         * codegen.cs,
4502           ecore.cs,
4503           flowanalysis.cs,
4504           expression.cs:
4505           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4506           correctly. Fixed bug #75721.
4507
4508 2005-08-23  Raja R Harinath  <rharinath@novell.com>
4509
4510         * support.cs (SeekableStreamReader.Position): Avoid an expensive
4511         loop that performs 'min (pos, char_count)'.
4512
4513         Fix #75862.
4514         * expression.cs (Unary.ResolveOperator): Don't discard implicit
4515         converted value in Operator.OnesComplement.
4516
4517 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
4518
4519         * anonymous.cs: If the anon method is pulled into a helper class,
4520         it needs to be `internal' not `private'. Fixes runtime behavior on
4521         msft. bug #75704
4522
4523 2005-08-20  Martin Baulig  <martin@ximian.com>
4524
4525         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4526         scope if we don't already have it.
4527
4528         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4529         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4530         fixes #75867.
4531
4532 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
4533
4534         Fix #75803
4535         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4536         is a partial class.
4537
4538 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
4539
4540         The big constants rewrite
4541         Fix #75746, #75685 and more
4542         As a side effect saved 1MB for MWF ;-)
4543         
4544         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4545         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4546         enum based for corlib compilation.
4547         
4548         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4549         subtractions.
4550         
4551         * class.cs (FixedField.Define): Use ResolveAsConstant.
4552         
4553         * const.cs (IConstant): Interface constants and enums.
4554         (Const.ResolveValue): New method for constant resolvning.
4555         (ExternalConstant): Constants from imported assemblies.
4556         
4557         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4558         conversion; like enums.
4559         (Constant.ToType): Converts this constant to different type.
4560         (Constant.Increment): Adds 1.
4561         
4562         * convert.cs (ImplicitConversionRequired): Simplified.
4563         
4564         * cs-parser.jay: Create EnumMember directly.
4565         
4566         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4567         
4568         * doc.cs (GenerateEnumDocComment): Removed.
4569         
4570         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4571         (ConvertIntLiteral): Removed.
4572         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4573         
4574         * enum.cs (EnumMember): Implement IConstant.
4575         (Enum.IsValidEnumConstant): Removed.
4576         (Enum.GetNextDefaultValue): Removed.
4577         (Enum.FindMembers): Updated.
4578         (Enum.GenerateDocComment): Iterate enum members.
4579         
4580         * expression.cs (Cast.TryReduce): Handle enums correctly.
4581         (New.Constantify): Made public.
4582         (MemberAccess.DoResolve): Removed contant specific if(s).
4583         
4584         * literal.cs (NullLiteral): Implement new abstract methods.
4585         
4586         * statement.cs (GotoCase.Resolve): Use new constant methods.
4587         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4588         
4589         * typemanager.cs (LookupEnum): Removed.
4590         (IsEnumType): Fixed to work with corlib.
4591         (RegisterConstant): Removed.
4592         (LookupConstant): Removed.
4593         (GetConstant): Changed to work with IConstant.
4594
4595 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4596
4597         * location.cs : Fixed overflown (>255) column number.
4598
4599 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4600
4601         First cut of the qualified-alias-member feature.
4602         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4603         token.
4604         * cs-parser.jay (DOUBLE_COLON): New token.
4605         (namespace_or_type_name): Add rule for recognizing
4606         qualified-alias-members.
4607         (primary_expression): Likewise.
4608         (element_access): Allow QualifiedAliasMember as a possible
4609         type-bearing expression.
4610         (local_variable_type, local_variable_pointer_type): Likewise.
4611         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4612         aliases in the current and enclosing namespace declarations.
4613         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4614         * decl.cs (MemberName.is_double_colon): New.
4615         (MemberName.MemberName): Add new constructor for alias-member.
4616         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4617         * expression.cs (QualifiedAliasMember): New expression type.
4618
4619 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4620
4621         * location.cs : it borked when no argument was specified.
4622
4623 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4624
4625         * location.cs : tiny ToString() format fix.
4626
4627 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4628
4629         * statement.cs : oops, it was missing.
4630
4631 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4632
4633         A set of fixes for precise line/column location.
4634
4635         * location.cs :
4636           "token" field now holds a file/line "delta", a line number offset 
4637           from the segment, and a column number. See also:
4638           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4639           December/009508.html
4640           Removed static IsNull. Use instance IsNull property instead.
4641         * cs-tokenizer.cs :
4642           For some tokens it stores Location. For Identifier it stores
4643           LocatedToken which is a pair of string name and location.
4644           Column numbers are adjusted only at getChar().
4645         * report.cs :
4646           Use Location.ToString() for reporting (it now contains column).
4647         * cs-parser.jay :
4648           Largely modified to use LocatedToken instead of
4649           string (IDENTIFIER), and to acquire Location from some tokens.
4650         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4651           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4652           codegen.cs :
4653           Now MemberName holds Location. DeclSpace.ctor() receives Location
4654           as a parameter. Removed extra parameters to all derived classes.
4655           Replaced Location.IsNull() with instance property.
4656         * assign.cs, expression.cs :
4657           Added .ctor() overload that omits Location.
4658         * attribute.cs :
4659           Added "nameEscaped" flag that indicates the identifier was escaped
4660           in the source file. This fixes bug #57047.
4661
4662 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4663
4664         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4665         New method, looking for lo-case imported cls type.
4666
4667         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4668         here.
4669
4670         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4671
4672         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4673
4674         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4675         all_imported_types.
4676         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4677
4678         Optimized to save 3.5 MB for SWF compilation.
4679
4680 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4681
4682         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4683         (PartialContainer.Create): Moved logic AddToContainer.
4684         (PartialContainer.MarkForDuplicationCheck): Shares name.
4685         
4686         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4687         place.
4688         
4689         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4690         initialization.
4691         (Namespace.GetSignatureForError): New method.
4692         
4693         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4694         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4695
4696 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4697
4698         Fix #75669.
4699         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4700         member lookup rather than qualifier_type, since qualifier_type can
4701         be null.
4702
4703 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4704
4705         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4706         enum member.
4707
4708 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4709
4710         * statement.cs: Copy the local exception into the exception
4711         captured local.  Fixes 75674
4712
4713 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4714
4715         Fix #75658.
4716         * expression.cs (Invocation.OverloadResolve): Don't report error
4717         CS1501 if error CS1502 has been reported.
4718         (New.DoResolve): Delegate CS1501 reporting to
4719         Invocation.OverloadResolve.
4720
4721         Fix #75656.
4722         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4723         invariant-meaning-in-block property in an enclosing block if
4724         necessary.
4725
4726 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4727
4728         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4729         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4730         (Switch.CheckSwitch): Just save 50kb for SWF.
4731
4732 2005-07-27  Martin Baulig  <martin@ximian.com>
4733
4734         * anonymous.cs (CaptureContext.AddField): Added
4735         `AnonymousContainer am' argument; compute its toplevel scope if
4736         it's not already computed.  Fixes #75649.
4737
4738 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4739
4740         Fix #75628.
4741         * class.cs (Constructor.Emit): Reset block to null if the block
4742         resolve fails.
4743
4744 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4745
4746         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4747
4748 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4749
4750         * class.cs (MethodData.Define): Check whether accessor implementing
4751         interface is public.
4752
4753         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4754
4755 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4756
4757         Fix #57245
4758         * namespace.cs (LookupType): Moved same type check to...
4759         
4760         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4761         with the same name.
4762
4763 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4764
4765         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4766         already found a typebuilder.
4767         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4768         MemberNames, not strings.
4769
4770         * const.cs (Error_ExpressionMustBeConst): 
4771         Rename from Error_EpressionMustBeConst.
4772         * const.cs, class.cs, statement.cd: Update.
4773
4774 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4775
4776         Fix #65573
4777
4778         * const.cs (Const.LookupConstantValue): Report missing contant expression
4779         everytime.
4780         (Error_EpressionMustBeConstant): Only one error method.
4781
4782         * class.cs, statement.c: Updated.
4783
4784 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4785
4786         * statement.cs (Block.Flags): Add back HasVarargs.
4787         (Block.flags): Make protected.
4788         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4789
4790         * typemanager.cs (types, typecontainers, user_types): Remove.
4791         (UserTypes, TypeContainers): Likewise.
4792         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4793         (CleanUp, Reset): Update.
4794         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4795         (GetNestedType): Use Type.GetNestedType.
4796         (CoreLookupType): Take two arguments, the namespace and the
4797         basename of the type.  Update to use the Namespace.Lookup
4798         mechanism.
4799         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4800         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4801         string concatenation and substring matches.
4802         * class.cs, enum.cs, delegate.cs: Update to changes.
4803
4804 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4805
4806         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4807         Expression and made virtual.
4808
4809         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4810         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4811
4812         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4813
4814         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4815         error message.
4816
4817         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4818         change.
4819
4820 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4821
4822         Fix #57707
4823         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4824         AssemblyCultureAttribute is not used on executable.
4825
4826         * rootcontext.cs,
4827         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4828
4829 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4830
4831         Fix #60638.
4832         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4833         New.  Reports CS0252/CS0253.
4834         Mostly taken from preliminary patch by Duncak Mak.
4835         (Binary.DoResolveOperator): Store results of operator lookup.
4836         Use them to detect if we need to warn about unintended reference
4837         comparisons.
4838
4839 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4840
4841         Fix #72969.
4842         * namespace.cs (Namespace.Lookup): Add back location parameter.
4843         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4844         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4845
4846         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4847         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4848         (Namespace.LookupType): ... this.
4849         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4850         of namespaces.
4851         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4852         purported to handle pointers.
4853         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4854         CoreLookupType.
4855
4856 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4857
4858         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4859         type as namespace.
4860
4861 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4862
4863         * namespace.cs (Namespace.Lookup): Drop location parameter.
4864         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4865         (NamespaceEntry.Lookup): ... this.
4866         (NamespaceEntry.Error_AmbiguousTypeReference):
4867         Move here from DeclSpace.
4868         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4869         names ...
4870         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4871         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4872         Move to NamespaceEntry.
4873         * delegate.cs, expression.cs: Update to changes.
4874
4875 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4876
4877         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4878         CheckAttributeType and refactored.
4879         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4880         ResolveAsTypeTerminal error handling.
4881         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4882         handling.
4883         (GetSignatureForError): Print errors in same way.
4884
4885         * class.cs,
4886         * codegen.cs: Reflect attribute GetSignatureForError change.
4887
4888         * ecore.cs,
4889         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4890
4891         * namespace.cs (UsingEntry): Refactored to make fields private.
4892
4893         * assign.cs,
4894         statement.cs: Error_UnexpectedKind has extra parameter.
4895
4896 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4897
4898         * ecore.cs (IAlias): Remove.
4899         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4900         that implement the interface.
4901         * namespace.cs (Namespace): Likewise.
4902         (Namespace.declspaces): Renamed from 'defined_names'.
4903         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4904         DeclSpace instead of an IAlias.
4905         * tree.cs (Tree.AddDecl): Update.
4906
4907 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4908
4909         * statement.cs (Block.Flags); Remove HasVarargs.
4910         (Block.HasVarargs): Move to ToplevelBlock.
4911         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4912         (Block.Variables): Make protected.  Initialize variable hashtable
4913         if necessary.
4914         (Block.AddVariable): Update.
4915         (Block.Resolve): Update to changes.
4916         (ToplevelBlock.HasVarargs): New boolean.
4917         (ToplevelBlock.ThisVariable): Move here from Block.
4918         (ToplevelBlock.AddThisVariable): Likewise.
4919         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4920         * expression.cs (This.ResolveBase): Update to changes.
4921         (ArglistAccess.DoResolve): Likewise.
4922
4923 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4924
4925         Fix #75321
4926         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4927
4928         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4929         not used and not used & assigned.
4930         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4931
4932 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4933
4934         Fix #75053
4935         * expression.cs (Is.DoResolve): null is never provided type.
4936
4937 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4938
4939         Fix #52496
4940         * cs-parser.jay: Less strict event error rule to catch more errors.
4941
4942 2005-07-08  Martin Baulig  <martin@ximian.com>
4943
4944         Fix test-iter-10.cs - distinguish whether we `yield' in a property
4945         gettter (allowed) or setter (not allowed).
4946
4947         * class.cs (Accessor): Implement IIteratorContainer.
4948         (Accessor.Yields): New public field.
4949         (PropertyBase.PropertyMethod.Define): Handle iterators on a
4950         per-accessor basis.
4951
4952         * cs-parser.jay
4953         (get_accessor_declaration, set_accessor_declaration): Set the
4954         `yields' flag on the accessor, not the property.
4955         (property_declaration): Do the iterators check on a per-accessor
4956         basis and not for the whole property.
4957
4958 2005-07-08  Martin Baulig  <martin@ximian.com>
4959
4960         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4961         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4962
4963 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4964
4965         Fix #74975
4966         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4967         (ExtractSecurityPermissionSet): Cope with self referencing security
4968         attributes properly.
4969
4970         * driver.cs (SetOutputFile): Made public property OutputFile.
4971
4972 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4973
4974         Fix #75486.
4975         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4976         has_nonstatic_fields.  Make into a FieldBase pointer.
4977         (TypeContainer.AddField): Add CS0282 check.
4978         (TypeContainer.EmitType): Update.
4979
4980 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4981
4982         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4983         compare if they start with __.
4984
4985 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4986
4987         * statement.cs (Switch.SwitchGoverningType): Only look at
4988         UserCasts that don't need implicit standard conversions to one of
4989         the allowed switch types (Fixes test-322.cs).
4990         (LocalInfo.Resolve): Re-enable sanity-test.
4991
4992 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4993
4994         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4995         
4996         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4997         
4998         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4999
5000 2005-07-06  Raja R Harinath  <rharinath@novell.com>
5001
5002         Fix #75472.
5003         * ecore.cs (SimpleName.GetSignatureForError): Add.
5004         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
5005         (MemberAccess.GetSignatureForError): Add.
5006
5007 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
5008  
5009         The big error and warning messages review.
5010         
5011         * anonymous.cs,
5012         * assign.cs,
5013         * attribute.cs,
5014         * class.cs,
5015         * codegen.cs,
5016         * convert.cs,
5017         * cs-parser.jay,
5018         * cs-tokenizer.cs,
5019         * decl.cs,
5020         * delegate.cs,
5021         * doc.cs,
5022         * driver.cs,
5023         * ecore.cs,
5024         * enum.cs,
5025         * expression.cs,
5026         * flowanalysis.cs,
5027         * iterators.cs,
5028         * literal.cs,
5029         * location.cs,
5030         * modifiers.cs,
5031         * namespace.cs,
5032         * parameter.cs,
5033         * pending.cs,
5034         * report.cs,
5035         * rootcontext.cs,
5036         * statement.cs,
5037         * support.cs,
5038         * tree.cs,
5039         * typemanager.cs: Updated.
5040         
5041         * class.cs: (MethodCore.SetYields): Moved here to share.
5042         (PropertyMethod.Define): Moved iterator setup here.
5043         
5044         * iterators.cs: Add orig_method to have full access to parent
5045         container.
5046
5047 2005-07-05  Raja R Harinath  <rharinath@novell.com>
5048
5049         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
5050         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
5051         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
5052         variable of struct type.
5053         * expression.cs (Unary.ResolveOperator): Update to change.
5054         (Indirection.VerifyFixed): Likewise.
5055         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
5056         (ParameterReference.VerifyFixed): Value parameters are fixed.
5057         (This.VerifyFixed): Treat 'this' as a value parameter.
5058         * statement.cs (LocalInfo.IsFixed): Remove.
5059
5060 2005-07-01  Martin Baulig  <martin@ximian.com>
5061
5062         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
5063         `ec.EmitThis ()' to get the correct scope.
5064
5065 2005-07-01  Martin Baulig  <martin@ximian.com>
5066
5067         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
5068         instance is a ParameterReference; fixes #75299.
5069
5070 2005-07-01  Martin Baulig  <martin@ximian.com>
5071
5072         Reverted Marek's latest patch (r46725):
5073         - it contains structural changes which are neither mentioned in
5074           the ChangeLog nor explained anywhere; for example the additional
5075           argument of EmitContext's and Iterator's .ctor's and the
5076           TypeContainer.DefineMembers() change.
5077         - structural changes like this should go in in seperate patches
5078           and not be hidden in a huge patch which just seems to affect
5079           warnings and errors.
5080           a big and hard to understand patch.
5081         - it breaks iterators and causes regressions, for instance in
5082           test-iter-03.cs.      
5083
5084 2005-06-30  Raja R Harinath  <rharinath@novell.com>
5085
5086         Fix #75412.
5087         * expression.cs (Indexers.map): Remove.
5088         (Indexers.Append): Filter out inaccessible setters and getters.
5089         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
5090
5091         Fix #75283.
5092         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
5093         Refactored from ...
5094         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
5095         (FieldExpr.Emit, PropertyExpr.Emit): Update.
5096         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
5097         * expression.cs (Invocation.EmitCall): Add CS0120 check.
5098
5099 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
5100
5101         Fix #75322
5102         * class.cs (FieldBase.GetInitializerExpression): One more field
5103         for backup.
5104
5105 2005-06-28  Miguel de Icaza  <miguel@novell.com>
5106
5107         * pending.cs: Do not define a proxy if the base method is virtual,
5108         it will be picked up by the runtime (bug 75270).
5109
5110 2005-06-08  Martin Baulig  <martin@ximian.com>
5111
5112         The big Iterators rewrite :-)
5113
5114         * iterators.cs: Rewrite this to use the anonymous methods framework.
5115
5116         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5117         before the TypeContainers; see 2test-21.cs.
5118
5119         * class.cs
5120         (TypeContainer.DefineType): Don't create a new EmitContext if we
5121         already have one (this only happens if we're an Iterator).
5122         (TypeContainer.Define): Also call Define() on all our iterators.
5123         (Method.CreateEmitContext): Added support for iterators.
5124
5125         * anonymous.cs
5126         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5127         (AnonymousContainer.CreateMethodHost): Moved here from
5128         AnonymousMethod and made abstract.
5129         (AnonymousContainer.CreateScopeType): New abstract method.
5130         (AnonymousContainer.IsIterator): New public property.
5131         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5132         get the ScopeTypeBuilder rather than manually defining it here. 
5133         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5134         iterators here.
5135
5136         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5137         before RootContext.DefineTypes().
5138
5139         * codegen.cs (EmitContext.RemapToProxy): Removed.
5140         (EmitContext.CurrentAnonymousMethod): Changed type from
5141         AnonymousMethod -> AnonymousContainer.
5142         (EmitContext.ResolveTopBlock): Protect from being called twice.
5143         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5144         (EmitContext.EmitThis): Removed the iterators hacks; use the
5145         anonymous methods framework for that.
5146
5147         * statement.cs
5148         (ToplevelBlock.Container): Make this a property, not a field.
5149         (ToplevelBlock.ReParent): New public method; move the
5150         ToplevelBlock into a new container.
5151         (Foreach.TemporaryVariable): Simplify.
5152
5153 2005-06-05  Martin Baulig  <martin@ximian.com>
5154
5155         * statement.cs (LocalInfo.CompilerGenerated): New flag.
5156         (Block.AddTemporaryVariable): New public method; creates a new
5157         `LocalInfo' for a temporary variable.
5158         (Block.EmitMeta): Create the LocalBuilders for all the temporary
5159         variables here.
5160         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5161         non-iterator variables.
5162
5163 2005-06-05  Martin Baulig  <martin@ximian.com>
5164
5165         * statement.cs (Foreach.TemporaryVariable): Create the
5166         LocalBuilder in the Emit phase and not in Resolve since in some
5167         situations, we don't have an ILGenerator during Resolve; see
5168         2test-19.cs for an example.
5169
5170 2005-06-04  Martin Baulig  <martin@ximian.com>
5171
5172         **** Merged r45395 from GCS ****
5173
5174         The big Foreach rewrite - Part II.
5175
5176         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5177         with `PropertyInfo ienumerator_getcurrent'.
5178
5179         * codegen.cs (VariableStorage): Removed.
5180
5181         * statement.cs
5182         (Foreach): Derive from Statement, not ExceptionStatement.
5183         (Foreach.CollectionForeach): New nested class.  Moved all the code
5184         dealing with collection foreach here.
5185         (Foreach.ForeachHelperMethods): Removed.
5186         (Foreach.TemporaryVariable): Implement IMemoryLocation.
5187
5188 2005-05-23  Martin Baulig  <martin@ximian.com>
5189
5190         * statement.cs (Try.DoResolve): Don't create a `finally' if we
5191         don't need to.  Fix #75014.
5192
5193 2005-05-20  Martin Baulig  <martin@ximian.com>
5194
5195         Merged r44808 from GMCS.
5196
5197         * class.cs (TypeContainer.CircularDepException): Removed.
5198         (TypeContainer.DefineType): Removed the `InTransit' stuff.
5199         (TypeContainer.CheckRecursiveDefinition): Check for circular class
5200         (CS0146) and interface (CS0529) dependencies here.
5201
5202 2005-06-21  Raja R Harinath  <rharinath@novell.com>
5203
5204         * expression.cs (Invocation.EmitCall): Fix initialization
5205         'this_call' to reflect current behaviour.  Fix indentation.
5206
5207         * convert.cs (FindMostEncompassedType): Add two trivial special
5208         cases (number_of_types == 0 || number_of_types == 1).
5209         (FindMostEncompasingType): Likewise.
5210
5211 2005-06-17  Raja R Harinath  <rharinath@novell.com>
5212
5213         Some cleanups preparing for the fix of #75283.
5214         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
5215         error testing.
5216         (EventExpr.InstanceResolve): Likewise.
5217         (EventExpr.DoResolve): Remove redundant checks.
5218
5219 2005-06-10  Duncan Mak  <duncan@novell.com>
5220
5221         * cs-tokenizer.cs (process_directives): New flag for controlling
5222         the processing of preprocessor directives.
5223         (x_token): After seeing a '#', return Token.NONE instead of going
5224         to handle_preprocessing_directive() when not processing
5225         directives. This avoids unnecessary processing during the token peek in
5226         is_punct().
5227
5228         This fixes #74939.
5229
5230         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
5231         the existing error reporting methods instead of Report.Error.
5232
5233         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
5234         after Raja's rewrite.
5235
5236 2005-06-08  Miguel de Icaza  <miguel@novell.com>
5237
5238         * class.cs: Small fix.
5239
5240 2005-06-08  Raja R Harinath  <rharinath@novell.com>
5241
5242         Fix #75160.
5243         * class.cs (GetPartialBases): Fix return value check of
5244         part.GetClassBases.
5245
5246 2005-06-07  Raja R Harinath  <rharinath@novell.com>
5247
5248         Ensure that partial classes are registered in their enclosing
5249         namespace.  Initial part of fix of #75160.
5250         * tree.cs (Tree.RecordDecl): Add new namespace argument.
5251         Register declspace with namespace here, not in
5252         DeclSpace.RecordDecl.
5253         * cs-parser.jay: Pass namespace to RecordDecl.
5254         * class.cs (PartialContainer.Create): Likewise.
5255         (ClassPart.DefineType): New sanity-check.  Throws an exception if
5256         called.
5257         * decl.cs (Declspace.RecordDecl): Remove.
5258         * namespace.cs (NamespaceEntry.DefineName): Remove.
5259
5260 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
5261
5262         * rootcontext.cs: Reset TargetExt as well.
5263
5264 2005-06-03  Raja R Harinath  <rharinath@novell.com>
5265
5266         * ecore.cs (Expression.Resolve): Emit CS0654 error when
5267         -langversion:ISO-1.
5268
5269 2005-06-02  Raja R Harinath  <rharinath@novell.com>
5270
5271         Fix #75080, cs0119.cs.
5272         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
5273         of ...
5274         (Expression.Resolve): ... this.  Use it.  Remove bogus code
5275         allowing ExprClass.Type and ExprClass.Namespace for
5276         ResolveFlags.VariableOrValue.
5277         (Expression.Resolve) [1-argument variant]: Change default resolve
5278         flags based on language version.
5279         (Expression.Error_UnexpectedKind): Use a simple string array
5280         rather than an ArrayList.
5281         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
5282         not ExprClass.Type.
5283         (TypeOfVoid.DoResolve): Likewise.
5284         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
5285         flags argument -- it always has the same value.
5286
5287 2005-05-31  Raja R Harinath  <rharinath@novell.com>
5288
5289         Fix #75081.
5290         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5291         Use it in the error message.
5292         * assign.cs, expression.cs, statement.cs: Update.
5293
5294 2005-05-30  Raja R Harinath  <rharinath@novell.com>
5295
5296         Fix #75088.
5297         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
5298         the "almostMatchedMember" case too.
5299         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
5300         that failed the accessibility checks to 'almost_match'.
5301
5302 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
5303
5304         * attribute.cs: Use internal MethodBuilder methods to set
5305         ExactSpelling and SetLastError on PInvoke methods, instead
5306         of passing them via charset.  Fixes #75060.
5307
5308 2005-05-27  Raja R Harinath  <rharinath@novell.com>
5309
5310         * parameter.cs (Parameter): Remove TODO comment.
5311         (Parameter.DefineParameter): Remove Location parameter.
5312         (Parameters.LabelParameters): Likewise.
5313         * class.cs (Constructor.Emit): Update to change.
5314         (MethodData.Emit): Likewise.
5315         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
5316         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5317
5318 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
5319
5320         * parameter.cs,
5321           Removed Parameters.Location and added Parameter.Location instead.
5322           Removed Location parameter from Emit() and GetSignature().
5323         * anonymous.cs,
5324           class.cs,
5325           cs-parser.jay,
5326           delegate.cs,
5327           iterators.cs,
5328           statement.cs :
5329           Modified all related calls.
5330
5331 2005-05-26  Raja R Harinath  <rharinath@novell.com>
5332
5333         Improve user-defined conversion handling.
5334         * convert.cs (GetConversionOperators): Rewrite.  Return only the
5335         applicable operators.
5336         (AddConversionOperators): New.  Helper for GetConversionOperators.
5337         (FindMostEncompassedType, FindMostEncompassingType): Verify that
5338         there is only one most encompassed/encompassing type.
5339         (FindMostSpecificSource, FindMostSpecificTarget): Remove
5340         "applicable operator" handling.
5341         (UserConversion): Move cache here from GetConversionOperators.
5342         Directly cache the chosen operator, rather than the whole
5343         MethodGroup.
5344         (ExplicitNumericConversion): Fix buggy implementation of Decimal
5345         case.  Allow conversion of decimal to sbyte and byte too.
5346         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5347         New static methods.  Used to avoid allocating EmptyExpressions in
5348         convert.cs.
5349
5350 2005-05-24  Duncan Mak  <duncan@novell.com>
5351
5352         * ecore.cs (CastFromDecimal): New class for casting a decimal to
5353         another class, used in Convert.ExplicitNumericConversion.
5354         (CastToDecimal): New class, similar to above, but casts to
5355         System.Decimal, used in Convert.ImplicitNumericConversion and also
5356         in explicit convesion from double/float to decimal.
5357
5358         * convert.cs (ImplicitNumericConversion): Handle implicit
5359         conversions to System.Decimal.
5360         (ExplicitNumericConversion): handle explicit conversions to
5361         System.Decimal.
5362
5363         This fixes #68711.
5364         
5365 2005-05-20  Miguel de Icaza  <miguel@novell.com>
5366
5367         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
5368         know the type at this stage, just break through.   Fixes #75008 
5369
5370 2005-05-19  Martin Baulig  <martin@ximian.com>
5371
5372         * delegate.cs
5373         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5374         to disable error reporting.
5375
5376         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5377         here since we don't want to report an error; see the new test-336.cs.
5378
5379 2005-05-19  Raja R Harinath  <rharinath@novell.com>
5380
5381         * statement.cs (ToplevelBlock.GetParameterReference)
5382         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5383         Move here from class Block.
5384         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5385         * expression.cs (ParameterReference.DoResolveBase): Likewise.
5386
5387 2005-05-18  Martin Baulig  <martin@ximian.com>
5388
5389         Fix #74978.
5390
5391         * flowanalysis.cs
5392         (FlowBranching.Reachability): Add non-static public And() and Or()
5393         methods.
5394         (FlowBranchingSwitch): New class; do the `break_origins' thing
5395         like in FlowBranchingLoop.
5396         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5397         reachability, not just locals and parameters.
5398         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5399         switch; MergeBreakOrigins() now takes care of that.
5400
5401 2005-05-18  Martin Baulig  <martin@ximian.com>
5402
5403         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5404         a loop and may leave it, reset the barrier; fixes #74974.
5405
5406 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
5407         
5408         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5409         is back.
5410         
5411         * cs-parser.jay: Catch more lexical errors.
5412         
5413         * report.cs: Add one more Error method.
5414         
5415         * rootcontext.cs,
5416         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5417
5418 2005-05-17  Martin Baulig  <martin@ximian.com>
5419
5420         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5421         #70970. 
5422
5423 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5424
5425         Fix test-382.cs.  Emit values of decimal constants.
5426         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5427         Carved out of ...
5428         (TypeContainer.AddField): ... this.
5429         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5430         with initializers to include 'Const's.
5431         (ClassPart.RegisterFieldForInitialization): Forward to
5432         PartialContainer.
5433         * const.cs (Const.Const): Pass initializer to base class.
5434         (Const.Define): In case of decimal constants, register them for
5435         initialization in a static constructor.
5436
5437 2005-05-14  Martin Baulig  <martin@ximian.com>
5438
5439         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5440         do not call ResolveUnreachable() on unreachable statements in
5441         here, see the comment in the source code.
5442
5443 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5444
5445         Fix #74934.
5446         * expression.cs (BinaryResolveOperator): If one of the operands of
5447         an equality comparison is 'null' and the other is a pointer type,
5448         convert the null to a NullPointer.
5449         * convert.cs (ImplicitReferenceConversion): If the expression is a
5450         NullLiteral and the target type is a pointer type, return a
5451         NullPointer instead.
5452         (ImplicitConversionStandard): Likewise.
5453
5454 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5455         
5456         * cs-parser.jay: Set readonly context based on special constructs.
5457         
5458         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5459         readonly variable error handling.
5460         
5461         * rootcontext.cs (EmitCode): Don't verify members when error
5462         occurred.
5463         
5464         * statement.cs (LocalInfo): Add reaodnly context information.
5465         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5466
5467 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5468
5469         * statement.cs (Block.Resolve): Revert change below.  Modify fix
5470         for #74041 to initialize 'resolved' to false only for explicit
5471         blocks.  Fixes #74873.
5472
5473 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5474
5475         Fix #74920.
5476         * typemanager.cs (unmanaged_enclosing_types): New.
5477         (IsUnmanagedType): Avoid infloops by using
5478         'unmanaged_enclosing_types' to talk with recursive invocations.
5479
5480 2005-05-13  Martin Baulig  <martin@ximian.com>
5481
5482         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5483         instance variable, not a local.  Fix #74873.
5484         (Block.ResolveUnreachable): Set it to true here.
5485
5486 2005-05-11  Duncan Mak  <duncan@novell.com>
5487
5488         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5489         continuing to process for 'arg'.
5490         (handle_preprocessing_directive): Check the argument of the #endif
5491         directive and report error CS1025 if there are any trailing
5492         characters.
5493
5494         According to the C# spec, having even whitespace after the #endif
5495         directive is illegal; however, because we call arg.TrimEnd ()
5496         beforehand, we have the same behavior as csc, allowing whitespace
5497         after the directive.
5498
5499         Fixes #74892.
5500
5501 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5502
5503         Fix #74863.
5504         
5505         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5506         (Constructor.GetObsoleteAttribute): Implemented correctly.
5507
5508 2005-05-10  Martin Baulig  <martin@ximian.com>
5509
5510         * support.cs (ReflectionParameters.ParameterModifier): Use
5511         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5512         and `ParameterAttributes.In'.  Fixes #74884.
5513
5514 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5515
5516         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5517         
5518         * expression.cs (Argument.GetParameterModifier): Turned to property.
5519         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5520         
5521         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5522         its C# equivalent.
5523         
5524 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5525
5526         Fix #74852.
5527         * decl.cs (MemberCache.AddMethods): Register override methods,
5528         rather than non-override methods.
5529         * typemanager.cs (RegisterOverride): New.
5530         (IsOverride): Update.
5531
5532 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5533
5534         Fix #73105.
5535         
5536         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5537         recursive declaration.
5538         
5539         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5540         
5541 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5542
5543         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5544         
5545         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5546
5547 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5548
5549         Fix #74797.
5550         * decl.cs (DeclSpace.FamilyAccessible): 
5551         Use TypeManager.IsNestedFamilyAccessible.
5552
5553         Fix reopened #64812.
5554         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5555         internal'.
5556
5557 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5558             Abin Thomas  <projectmonokochi@rediffmail.com>
5559             Anoob V E  <projectmonokochi@rediffmail.com>
5560             Harilal P R  <projectmonokochi@rediffmail.com>
5561
5562         Fix #64812.
5563         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5564         allow access to all static members.
5565
5566 2005-05-04  Martin Baulig  <martin@ximian.com>
5567
5568         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5569
5570 2005-05-04  Martin Baulig  <martin@ximian.com>
5571
5572         Fix #74655.
5573
5574         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5575         section at the end; make things work if `default' is not the last
5576         section.        
5577
5578 2005-05-04  Martin Baulig  <martin@ximian.com>
5579
5580         Fix #70400.
5581
5582         * statement.cs (Switch): Replaced the `got_default' field with a
5583         `default_section' one.
5584         (Switch.CheckSwitch): Set `default_section' here.
5585         (Switch.Resolve): If we're a constant switch and the constant is
5586         not found, use the default section.
5587
5588 2005-05-03  Martin Baulig  <martin@ximian.com>
5589
5590         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5591
5592         * statement.cs (Foreach.ArrayForeach): New nested class.
5593         (Foreach.TemporaryVariable): New nested class.
5594         (Foreach.EmitArrayForeach): Removed; this is now in the new
5595         ArrayForeach class.
5596
5597 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5598
5599         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5600         more conservative.
5601         (VerifyPendingMethods): Revert change below.
5602
5603         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5604         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5605         that used to trigger warning -28.  Remove warning -28.
5606         * expression.cs (Invocation.OverloadResolve): Use
5607         TypeManager.IsOverride to distinguish override methods.
5608
5609         Fix #74773.
5610         * pending.cs (VerifyPendingMethods): If a base type implements the
5611         requested interface, don't bother checking individual methods of
5612         the base type.  As a side-effect, this prevents the creation of
5613         unnecessary proxies.
5614
5615 2005-05-02  Martin Baulig  <martin@ximian.com>
5616
5617         Fix #70182.
5618
5619         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5620         Also `And' the locals if the old vector is null.
5621         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5622         null; in this case we basically reset all the variables.        
5623
5624 2005-05-02  Martin Baulig  <martin@ximian.com>
5625
5626         Fix #74529.
5627
5628         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5629         Added `FlowBranching branching' argument; always `and' the
5630         variables instead of `or'ing them unless we're an infinite loop.
5631
5632         * statement.cs (While.Resolve): Create a new sibling unless we're
5633         infinite.       
5634
5635 2005-05-02  Martin Baulig  <martin@ximian.com>
5636
5637         Fix #70140.
5638
5639         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5640         arguments; use it instead of creating a new TopLevelBlock.
5641         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5642         our ConstructorInitializer.
5643
5644         * statement.cs
5645         (TopLevelBlock.TopLevelBranching): New public property.
5646         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5647         and create our `TopLevelBranching'.
5648
5649         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5650         anonymous method host, use `block.TopLevelBranching' rather than
5651         creating a new branching.
5652
5653 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5654
5655         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5656         a ScopeInfo, if any of the current children is a child of the new
5657         entry, move those children there.
5658
5659 2005-04-30  Martin Baulig  <martin@ximian.com>
5660
5661         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5662         at the beginning of a SwitchSection.  Fix #73335.
5663
5664 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5665
5666         Fix #74378
5667         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5668         
5669         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5670         (FieldExpr.DoResolve): Obsolete members are ignored for field
5671         initializers.
5672         
5673 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5674
5675         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5676         of arrays detection.
5677
5678         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5679         verification.
5680         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5681
5682         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5683         arrays report.
5684
5685 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5686
5687         * cs-parser.jay: Use the prefered version of -unsafe in error
5688         message.
5689
5690 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5691
5692         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5693         circumstances.
5694
5695 2005-04-20  John Luke  <john.luke@gmail.com>
5696
5697         * driver.cs: fix typo in error message, --outout to --output
5698
5699 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5700
5701         * codegen.cs (InRefOutArgumentResolving): New field.
5702         
5703         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5704         fields outside contructor.
5705         
5706         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5707         
5708 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5709
5710         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5711         parameter code was not completed ever, so it was not as up-to-date
5712         as local variables.  Must finish it.
5713
5714         The bug fix was to compare the Toplevel of the block, not the
5715         current block.  Thanks for Ben for pointing this out. 
5716
5717 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5718
5719         * decl.cs (AddMethods): Use the declaring type of the problem
5720         method to determine if we want to squash a warning.
5721
5722 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5723
5724         * attribute.cs: Removed debug output.
5725
5726         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5727         
5728         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5729         Report.Stderr.
5730         
5731 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5732
5733         Fix #74481.
5734         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5735         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5736         all null comparisons against reference types.
5737
5738 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5739
5740         Fix# 74565
5741         * class.cs (TypeContainer.CircularDepException) New nested
5742         exception class.
5743         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5744         (TypeContainer.DefineType): Removed error, reset InTransit before
5745         exit.
5746         (Class.DefineType): Throw exception when is in Transit.
5747         Catch exception and report error.
5748         (Struct.DefineType): Throw exception when is in Transit.
5749         Catch exception and report error.
5750         (Interface.DefineType): Throw exception when is in Transit.
5751         Catch exception and report error.
5752
5753         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5754         handle nested exception handlers.
5755
5756         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5757         a catch.
5758
5759         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5760         InFinally and InCatch storage.
5761
5762         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5763         (Catch.Resolve): Set and Restore ec.InCatch.
5764         (Try.Resolve): Set and Restore ec.InFinally.
5765         (Try.HasCatch): True when try has catch.
5766
5767 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5768
5769         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5770           for the same event member, so exclude such cases from warning 419.
5771           Fixed bug #74633.
5772
5773 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5774
5775         * expression.cs (Binary.ResolveOperator): Apply patch from John
5776         Luke to fix bug 59864: operators &, | and ^ on enumerations
5777         require that the same enum type on both sides.
5778
5779         * driver.cs: Add warnings to old flag usage, this is to assist
5780         people who produce Makefiles and hope that the Makefiles will be
5781         used on Windows.
5782
5783         * class.cs (TypeContainer.EmitType): Moved the definition of the
5784         special $PRIVATE$ field from the resolve phase to the Emit phase.
5785         During resolve we do not know if we are a struct with
5786         HasExplicitLayout, we know this only after the attributes for the
5787         type are emitted.
5788
5789         Set the FieldOffset to zero on the dummy field that we create for
5790         the class.   Fixes 74590.
5791
5792 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5793
5794         Fix #73834.
5795         * ecore.cs (PropertyExpr.resolved): New.
5796         (DoResolve): Use it to handle a case of double resolution here.
5797         Handle a case of identical-name-and-type-name.
5798         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5799         resolution by storing the results of expression resolution back
5800         into the "probes" array.
5801
5802 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5803
5804         Fix cs0208-7.cs and cs0208-8.cs.
5805         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5806         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5807         error reporting to point out the reason a struct is not unmanaged.
5808
5809 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5810
5811         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5812           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5813
5814 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5815
5816         Fix #74528.
5817         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5818         IdenticalNameAndTypeName here.
5819         (EventExpr.InstanceResolve): Likewise.
5820
5821 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5822
5823         C# 2.0 DefaultCharSetAttribute implementation
5824         
5825         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5826         which allows us to set GlobalNamespace for every resolve.
5827         (Attribute.ResolveArguments): Cut from Resolve.
5828         (Attribute.GetCharSetValue): Returns CharSet named argument.
5829         (Attribute.DefinePInvokeMethod): Gets default charset from
5830         module settings.
5831         (GlobalAttribute.ResolveAsTypeStep): Override.
5832         (GlobalAttribute.ResolveArguments): Override.
5833         
5834         * class.cs (TypeAttr): Is protected.
5835         
5836         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5837         (ModuleClass.DefaultCharSetType): New memeber.
5838         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5839         
5840         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5841         charset from module.
5842         
5843         * delegate.cs (TypeAttr): Override.
5844         (Delegate.DefineType): Use this TypeAttr.
5845         
5846         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5847         at very early stage (before types are defined) to resolve model
5848         module attributes. It will probably not work with corlib but it
5849         should be ok.
5850         
5851         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5852         charset from module.
5853         
5854         * typemanager.cs (default_charset_type): New type.
5855
5856 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5857
5858         * decl.cs (MemberCache.AddMethods): Don't warn if
5859         System.Object.Finalize has buggy MethodAttributes.
5860
5861         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5862         removed below.
5863
5864 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5865
5866         * doc.cs : detect ambiguous reference to overloaded members.
5867           Fixed bug #71603. MS 1.1 csc does not detect it.
5868
5869 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5870
5871         * doc.cs : delegates must not be referenced with parameters.
5872           Fixed bug #71605.
5873
5874 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5875
5876         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5877
5878 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5879
5880         * driver.cs (MainDriver): Stop processing if the CLS stage found
5881         errors. 
5882
5883         (CompilerCallableEntryPoint.InvokeCompiler): Always
5884         reset after execution;   Take a TextWriter argument for the
5885         output.
5886
5887         * report.cs: Use the error stream instead of hardcoding stderr. 
5888
5889 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5890
5891         * class.cs: Reduce code paths to test, too small of an
5892         optimization to make it worth the extra testing.  Always perform
5893         it. 
5894
5895 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5896
5897         Fix #74510.
5898         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5899         operators that had errors reported on them.
5900
5901 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5902
5903         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5904         argument types.
5905         (Attribute.Resolve): Add named argument type checking.
5906         
5907         * class.cs (FixedField.Define): Use IsPrimitiveType
5908         
5909         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5910         
5911         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5912         unsafe parameter types.
5913         
5914         * statement.cs (Using.ResolveExpression): Add better error description.
5915         
5916         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5917         
5918 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5919
5920         Fix #74484.
5921         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5922         AttributeUsageAttribute in the emitcontext of the attribute class,
5923         not in the emitcontext of the attributable entity it was attached to.
5924         * cs-parser.jay: Use 'current_class', not 'current_container',
5925         when creating a GlobalAttribute.
5926
5927 2005-04-08  Alp Toker  <alp@atoker.com>
5928
5929         * pending.cs: The fix to #58413 failed to compile methods implementing
5930         interfaces with/without params modifiers and vice versa, even though
5931         params modifiers aren't part of the signature. Make the modifier check
5932         less strict as in csc.
5933
5934 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5935             Anoob V E  <projectmonokochi@rediffmail.com>
5936             Harilal P R  <projectmonokochi@rediffmail.com>
5937
5938         Fix #58413.
5939         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5940         modifiers of pending methods.
5941         (PendingImplementation.PendingImplementation): Initialize it.
5942         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5943         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5944         with ParameterData.  Add check for modifiers.
5945         * class.cs (MethodData.Define): Update to changes.
5946
5947 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5948
5949         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5950
5951 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5952
5953         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5954         property.
5955         
5956         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5957         
5958         * rootcontext.cs,
5959         * typemanager.cs: Registered RequiredAttributeAttribute.
5960         
5961 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5962
5963         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5964         Warning CS0169 is back at level 3.
5965         (IMethodData.SetMemberIsUsed): New method.
5966         
5967         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5968         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5969         
5970         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5971
5972         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5973         contants.
5974         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5975         is used.
5976         
5977         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5978         is used.
5979         
5980         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5981         to avoid the problems with nested types.
5982
5983 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5984             Anoob V.E  <projectmonokochi@rediffmail.com>
5985             Harilal P.R  <projectmonokochi@rediffmail.com>
5986             Raja R Harinath  <rharinath@novell.com>
5987
5988         Fix #73820.
5989         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5990         attribute.
5991         * typemanager (GetConstructor): Make public.
5992
5993 2005-04-05  John Luke  <john.luke@gmail.com>
5994             Raja R Harinath  <rharinath@novell.com>
5995
5996         Fix #62232.
5997         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5998         struct too.  Return false quicker in a few cases.
5999         (VerifyUnManaged): Use it.
6000
6001 2005-04-05  Raja R Harinath  <rharinath@novell.com>
6002
6003         Fix #74041.
6004         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
6005         not 'unreachable_seen'.
6006
6007 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
6008
6009         * attribute.cs (Attribute.GetValue): Removed unused.
6010         
6011         * codegen.cs (CodeGen.TrimExt): Removed unused.
6012         
6013         * cs-parser.jay (output): Removed unused.
6014         
6015         * cs-tokenizer.cs (hex_digits): Removed unused.
6016         
6017         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6018         
6019         * expression.cs (Indirection.LoadExprValue): Removed unused.
6020         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6021         
6022         * iterators.cs (Iterator.param_types): Removed unused.
6023         
6024         * statement.cs (Goto.block): Removed unused.
6025         (ToplevelBlock.did): Removed unused.
6026         (Switch.ResolveConstantSwitch): Removed unused.
6027
6028 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
6029
6030         * rootcontext.cs: Allow mcs to bootstrap with the compilation
6031         resetting thingy.
6032
6033 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6034
6035         Fix #74232 and cs0208-3.cs.
6036         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6037         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6038         unmanaged type.  Don't use FieldBuilders when 't' is a
6039         TypeBuilder.  Use ModFlags and MemberType fields.
6040         * class.cs (MemberBase.member_type): Rename from MemberType.
6041         (MemberBase.MemberType): New property.  Determines member_type on
6042         demand.
6043         (MemberBase.DoDefine): Don't initialize MemberType here.
6044         (FieldMember.Define): Likewise.
6045
6046 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
6047
6048         Fix #74241
6049         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6050         Attributes are emitted there.
6051         
6052 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6053
6054         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6055         keyword in 'partial enum' too.
6056         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6057         is not allowed).
6058         Report from Kamil Skalski <nazgul@omega.pl>.
6059
6060         Fix #74309.
6061         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6062         have partial containers too.
6063
6064         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6065         in block' checks to Block.CheckInvariantMeaningInBlock.
6066         * statement.cs (Block.GetKnownVariableInfo): Make private.
6067         (Block.IsVariableUsedInChildBlock): Remove.
6068         (Block.IsVariableUsedInBlock): Likewise.
6069         (Block.CheckInvariantMeaningInBlock): New.  Show location of
6070         conflicting declaration.
6071         (Block.AddVariable): Make error messages less long-winded and more
6072         specific.  Show location of conflicting declaration.
6073         * parameter.cs (Parameters.Location): New readonly property.
6074
6075 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6076
6077         Clean up semantics of invoking ResolveMemberAccess.
6078         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
6079         can have an instance, ensure that we pass in a non-TypeExpression
6080         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
6081         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
6082         argument.  Update to changes and simplify.
6083         (FieldExpr.Emitinstance): Remove CS0120 check.
6084         (PropertyExpr.EmitInstance): Likewise.
6085         * expression.cs (Argument.Resolve): Likewise.
6086         (Invocation.DoResolve): Update to changes in semantics of
6087         InstanceExpression.
6088
6089 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
6090
6091         Fix #74241
6092         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
6093         customization.
6094         
6095         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6096
6097 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6098
6099         Fix difference in behaviour with commandline invocation.
6100         * driver.cs (Driver.Reset): New.
6101         (CompilerCallableEntryPoint): Call it.
6102
6103         * statement.cs (If.Resolve): Avoid spurious "uninitialized
6104         variable" warnings if the boolean expression failed to resolve.
6105
6106 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
6107
6108         * attribute.cs: Fix the union of several permissions when some of them
6109         are unrestricted (so the result isn't an unrestricted permission set).
6110         Fix #74036.
6111
6112 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6113
6114         * ecore.cs (MemberExpr): New class.  Convert from interface
6115         IMemberExpr.
6116         (MemberExpr.ResolveMemberAccess): Refactor and move here from
6117         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
6118         error checks.
6119         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6120         (MethodGroupExpr.IsExplicitImpl): Remove.
6121         (Expression.GetFieldFromEvent): Remove.
6122         (SimpleName.MemberStaticCheck): Remove.
6123         (SimpleName.DoSimpleNameResolve): Update to changes.
6124         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6125         (MemberAccess.IdenticalNameAndTypeName): Remove.
6126         (MemberAccess.error176): Move to MemberExpr.
6127         (MemberAccess.DoResolve): Update to changes.
6128         (BaseAccess.DoResolve): Likewise.
6129
6130 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
6131
6132         C# 2.0 Conditional attribute class implementation
6133         
6134         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6135         Analyzes class whether it has attribute which has ConditionalAttribute
6136         and its condition is not defined.
6137         
6138         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6139         (Class.IsExcluded): New method. Search for at least one defined
6140         condition in ConditionalAttribute of attribute class.
6141
6142 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6143
6144         * ecore.cs (PropertyExpr): Derive from Expression, not
6145         ExpressionStatement.
6146         (PropertyExpr.EmitStatement): Remove.
6147
6148 2005-03-29  Raja R Harinath  <rharinath@novell.com>
6149
6150         Fix #74060.
6151         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6152         internal field "value__" of an enum be private.  The examples for
6153         "value__" that I found on MSDN all used FieldAttributes.Private.
6154
6155         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6156         Don't mention IL method attribute names.
6157
6158         Fix #47991.  Remove a TODO.
6159         * statement.cs (Block.Toplevel): Make into a field.
6160         (Block.Parameters): Move into ToplevelBlock.
6161         (Block.known_variables): Rename from child_variable_names.
6162         (Block.Block): Remove variants that take Parameters.  Initialize
6163         'Toplevel' with the immediately surrounding toplevel block.
6164         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
6165         LocalInfo parameter.
6166         (Block.GetKnownVariableInfo): New.
6167         (Block.IsVariableNameUsedInChildBlock): Update.
6168         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
6169         the block, even though it may not be in scope.
6170         (Block.AddVariable): Remove Parameters parameter.  Use
6171         Toplevel.Parameters instead.
6172         (Block.AddConstant): Remove Parameters parameter.
6173         (Block.GetParameterReference): Update to use Toplevel.Parameters.
6174         (Block.IsParamaterReference): Likewise.
6175         (Block.IsLocalParameter): Likewise.  Simplify a lot.
6176         (ToplevelBlock.Parameters): New.  Moved from Block.
6177         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
6178         initialize Parameters to a non-null value.
6179         * cs-parser.jay: Update to changes.
6180         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6181         simple names that mean different things in the same block.  Use
6182         Block.IsVariableNameUsedInBlock.
6183
6184 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6185
6186         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6187         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6188         GetTypeHandle.  It is possible for a reflected type to derive from
6189         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6190         System.Array during mscorlib compilation).
6191         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6192         contain a method_hash, don't create one either.  Don't create a
6193         deep copy of the base cache's method_hash.
6194         (MemberCache.SetupCache): Rename back from DeepCopy.
6195         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6196         already initialized.  If we see an override function, add its
6197         underlying base virtual function to the member_hash too.
6198
6199         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6200
6201 2005-03-26  Raja R Harinath  <harinath@acm.org>
6202
6203         Fix #73038.
6204         * assign.cs (Assign.DoResolve): When the RHS of an assignment
6205         fails to resolve, ensure that the LHS is still resolved as an
6206         lvalue.
6207
6208 2005-03-25  Raja R Harinath  <harinath@acm.org>
6209
6210         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6211         ec.ContainerType.
6212         (Enum.current_ec): Remove.
6213         (Enum.LookupEnumValue): Remove EmitContext argument.
6214         Just uses the one created during DefineType.
6215         (Enum.FindMembers): Update.
6216         * expression.cs (MemberAccess.DoResolve): Update.
6217
6218 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
6219
6220         * assign.cs (Assign.DoResolve): Check for CS1717 when
6221         source and target are same (uses Equals).
6222
6223         * expression.cs (LocalVariableReference, ParameterReference,
6224         This): Implemented Equals, GetHashCode.
6225
6226         * statement.cs (Block.GetParameterReference): Removed useless
6227         local variable.
6228
6229 2005-03-22  Raja R Harinath  <rharinath@novell.com>
6230
6231         Fix cs0128.cs
6232         * statement.cs (Block.AddVariable): Ensure that we skip implicit
6233         blocks before deciding whether the error is cs0136 or cs0128.
6234
6235         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6236         (using_alias_directive, using_namespace_directive): Pass
6237         MemberName, not an expression to Namespace.UsingAlias and
6238         Namespace.Using.
6239         (MakeName): Use the MemberName of the namespace.
6240         * namespace.cs (Namespace.MemberName): New.
6241         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6242         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6243         Likewise.
6244         * decl.cs (MemberName.Name): Make readonly.
6245         (MemberName.FromDotted): New "constructor".
6246         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6247         (MemberCore.Name): Compute from MemberName on demand.
6248         (MemberCore.SetMemberName): Provide a way to change the
6249         MemberName.
6250         (MemberCore.AddToContainer): Don't take a fullname parameter.
6251         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6252         fully qualified name of the container to the member name.
6253         (TypeContainer.AddToTypeContainer): Use a fully qualified name
6254         only if the type is a member of the root container.
6255         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6256         MemberName.Left rather than searching for an embedded ".".
6257         (PartialContainer.CreatePart): Update to changes in RootContext.
6258         (MemberBase.ShortName): Turn into a property.  Use
6259         MemberCore.SetMemberName.
6260         (MemberBase.ExplicitInterfaceName): Remove.
6261         (MemberBase.UpdateMemberName): Remove.
6262         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6263         (PropertyBase.SetMemberName): New override.
6264         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6265         (Tree.GetDecl): New.
6266         (Tree.AllDecls): Rename from Decls.
6267         * attribute.cs, enum.cs, report.cs: Update to changes.
6268         * driver.cs (MainDriver): Use MemberName.FromDotted on
6269         RootContext.MainClass.
6270
6271 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6272
6273         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6274         checks.
6275
6276         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6277
6278 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6279
6280         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6281         property accessor modifiers.
6282
6283         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6284         fixed buffer attribute (CS1716).
6285         (PropertyMethod.HasCustomAccessModifier): When property accessor
6286         has custom modifier.
6287
6288         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6289         modifiers.
6290         (PropertyExpr.DoResolveLValue): Add CS0272.
6291
6292 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6293
6294         * convert.cs: When converting to a pointer, use the proper Conv.U
6295         or Conv.I depending on the source data type.
6296
6297         * cs-tokenizer.cs: Make the size for large decimal constants,
6298         fixes #72957.
6299
6300 2005-03-17  Martin Baulig  <martin@ximian.com>
6301
6302         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6303         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6304
6305 2005-03-17  Martin Baulig  <martin@ximian.com>
6306
6307         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6308         to bool so we can return an error condition.
6309         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6310         returned an error.
6311
6312 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6313
6314         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6315         attributes.
6316
6317 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6318
6319         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6320         Refactor to avoid traversing the list of assemblies, and to avoid
6321         string concatenation.
6322         * typemanager.cs (guid_attr_type): Remove.
6323         (negative_hits, pointers, references): Remove hashes.
6324         (type_hash): New.
6325         (GetConstructedType): New.  Uses type_hash to handle constructed
6326         types (arrays, references, pointers).
6327         (GetReferenceType, GetPointerType): Use it.
6328         (GetNestedType): New.  Uses type_hash to handle nested types of
6329         reflected types.
6330         (LookupType, LookupTypeDirect): Remove.
6331         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6332         'types' hash and LookupTypeReflection directly.
6333         (params_string, params_object): Use GetConstructedType.
6334         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6335         top-level types.
6336         (Namespace.Lookup): Use cached_types.
6337         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6338         provided by old TypeManager.LookupType.
6339         * rootcontext.cs (MakeFQN): Remove.
6340         * decl.cs (DeclSpace.MakeFQN): Likewise.
6341         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6342         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6343         TypeManager.GetConstructedType.
6344         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6345
6346 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
6347
6348         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
6349         indexers.
6350
6351         * cs-parser.jay: Reports CS1527 for any namespace element.
6352
6353         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6354         Added CS0407.
6355
6356         * expression.cs (ParameterReference.IsAssigned): Changed error to
6357         CS0269.
6358         (Error_WrongNumArguments): Moved CS0245 detection here.
6359
6360         * statement.cs (Return.Resolve): Add CS1622 report.
6361
6362 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
6363
6364         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6365
6366 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
6367
6368         * attribute.cs expression.cs: Get rid of some allocations.
6369
6370 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
6371
6372         * doc.cs : just eliminate the latest change.
6373
6374 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6375
6376         * doc.cs : commented out the latest change. It breaks xml-030.cs
6377
6378 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6379
6380         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6381           fail. So invoke CreateType() in FindDocumentedType().
6382
6383 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6384
6385         * cs-tokenizer.cs : added IsKeyword().
6386         * doc.cs : Detect keyword incorrectly used as identifier.
6387           Allow identifiers prefixed by @.
6388
6389 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6390
6391         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6392         It caused exception in namespace resolving (again!).
6393         
6394         * class.cs (Class.ctor): Removed exit.
6395         (PropertyMethod.ctor): ditto.
6396         
6397         * codegen.cs (Codegen.Reset): Reset static data.
6398         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6399         
6400         * cs-tokenizer.cs (Cleanup): Removed.
6401         
6402         * driver.cs (GetSystemDir): Rewrote to one line command.
6403         It caused problem with unloaded dynamic modules.
6404         (UnixParseOption): Removed Exit.
6405         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6406         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6407         Now can be mcs used as library.
6408         
6409         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6410         empty location.
6411         
6412         * location.cs (Reset): Reset static data.
6413         
6414         * namespace.cs (Reset): Reset static data.
6415         
6416         * report.cs (Report.Reset): Reset static data.
6417         
6418         * rootcontext.cs (RootContext.Reset): Reset static data.
6419         
6420         * tree.cs (RootTypes.ctor): Use Location.Null
6421         
6422         * typemanager.cs (TypeManager.Reset): Reset static data.
6423         (CoreLookupType): Removed Exit.
6424         (TypeHandle.Reset): Reset static data.
6425         
6426 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6427
6428         Fix #73516.
6429         * typemanager.cs (ComputeNamespaces): Import namespaces from
6430         referenced modules too.
6431
6432 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6433
6434         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6435         than '.'.
6436
6437 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6438
6439         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6440         enclosing DeclSpace.  This ensures that a name-lookup populates
6441         more caches and there are fewer 'TypeExpression's.  Carve out
6442         nested type lookup into ...
6443         (LookupNestedTypeInHierarchy): ... this.
6444
6445 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6446
6447         Clean up a few partial-class semantics.  
6448         Fixes test-357.cs and cs1618-2.cs.
6449         * cs-parser.jay (struct_declaration): Use 'current_class' as
6450         parent of newly-created struct.  Remove call to Register ().
6451         Use 'pop_current_class' to complete handing the current struct.
6452         (interface_declaration): Likewise.
6453         (class_declaration): Likewise.
6454         (enum_declaration): Use 'current_class' as parent of newly created
6455         enum.
6456         (delegate_declaration): Likewise.
6457         (pop_current_class): New function.  This is used to handle closing
6458         up the 'current_class' and 'current_container', and pointing them
6459         to the enclosing class/container.
6460         (CSharpParser): Initialize 'current_class' too.
6461         * decl.cs (MemberCore): Add check for invariant: a partial
6462         container is not a parsed entity, and thus does not enclose any
6463         parsed members.
6464         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6465         (DeclSpace.BaseTypeExpr): Use it.
6466         (DeclSpace.LookupType): Add check for invariant.
6467         * class.cs (TypeContainer): Add check for invariant: a nested
6468         class should have the same NamespaceEntry as its enclosing class.
6469         (TypeContainer.EmitFieldInitializers): Make virtual.
6470         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6471         MemberCore.
6472         (TypeContainer.Register): Remove.
6473         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6474         null.  Use TypeResolveEmitContext for resolving base types and
6475         interfaces.  Move initialization of Parts.TypeBuilder here from
6476         ...
6477         (TypeContainer.DefineNestedTypes): ... here.
6478         (PartialContainer): Take a Namespace not a NamespaceEntry.
6479         (PartialContainer.Create): Don't use Register.  Call the
6480         appropriate Add... function directly.
6481         (ClassPart): Take both the PartialContainer and the enclosing
6482         class as constructor arguments.
6483         (ClassPart.EmitFieldInitializers): Override.
6484         (ClassPart.PartFindNestedTypes): Remove.
6485         (FieldBase.GetInitializerExpression): Resolve the initializer
6486         expression in the emit context of the enclosing class.
6487         * tree.cs (RootTypes): Remove Register ().
6488         
6489 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6490
6491         * cs-parser.jay: Removed CS0134.
6492         
6493         * driver.cs: Removed CS1901.
6494         
6495         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6496         for predefined types.
6497
6498 2005-03-07  Duncan Mak  <duncan@novell.com>
6499
6500         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6501         well. Fixes bug #73454.
6502
6503 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6504
6505         * cs-tokenizer.cs (xtoken): Add CS1035.
6506         
6507         * class.cs (MethodData.Define): Add CS0683.
6508         (FieldMember.ctor): Add CS0681.
6509
6510 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6511
6512         * ecore.cs (SimpleName.DoResolve): Rename from
6513         SimpleName.DoResolveAllowStatic.
6514         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6515         Pass 'intermediate' flag to MemberStaticCheck.
6516         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6517         of "intermediate" lookups via MemberAccess.
6518         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6519         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6520
6521 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6522
6523         Fix #73394.
6524         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6525         slipped in because of variable names that are identical to a
6526         builtin type's BCL equivalent ('string String;', 'int Int32;').
6527         (PropertyExpr.EmitInstance): Likewise.
6528
6529 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6530
6531         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6532         
6533         * report.cs (warning_ignore_table): Made public.
6534
6535 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6536
6537         Fix #73282.
6538         * class.cs (MethodData.Emit): Pass 'container' to
6539         container.GetObsoleteAttribute instead of 'container.Parent'.
6540
6541 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6542
6543         * cs-parser.jay: Add 1534 error test.
6544
6545         * iterators.cs (Yield.CheckContext): Add error 1629.
6546         (Iterator.ctor): Save unsafe modifier.
6547         (MoveNextMethod.DoEmit): Restore unsafe context.
6548
6549         * namespace.cs (UsingAlias): Better error message.
6550
6551 2005-03-03  Dan Winship  <danw@novell.com>
6552
6553         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6554         the warning message [#73219]
6555
6556 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6557
6558         Fix compile with MCS 1.0.0.0.
6559         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6560         w_restore to not depend on string constant folding.
6561
6562 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6563
6564         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6565         CS0246 check to users who passed 'silent = false'.
6566         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6567         check.
6568         (SimpleName.SimpleNameResolve): Update.
6569         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6570         (MemberAccess.IdenticalNameAndTypeName): Update.
6571         * doc.cs (FindDocumentedTypeNonArray): Update.
6572
6573 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6574
6575         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6576         * parameters.cs (ComputeAndDefineParameters): Remove.
6577         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6578         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6579         Use GetParameterInfo.
6580
6581 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6582
6583         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6584
6585 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6586
6587         Unify DeclSpace.LookupType and DeclSpace.FindType.
6588         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6589         is in charge of defining nested types on demand.
6590         (DeclSpace.LookupType): Use it when the current_type is a
6591         TypeBuilder.  Use LookupTypeDirect for reflected types.
6592         (DeclSpace.FindType): Remove.
6593         (DeclSpace.LookupInterfaceOrClass): Likewise.
6594         (DeclSpace.DefineTypeAndParents): Likewise.
6595         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6596         DeclSpace.LookupType.
6597         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6598         * typemanager.cs (LookupType): Simplify.
6599         (AddUserType): Remove type from negative_hits.
6600         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6601         * class.cs (TypeContainer.FindMembers): Move handling of nested
6602         types ...
6603         (TypeContainer.FindMembers_NestedTypes): ... here.
6604         (TypeContainer.FindNestedType): Implement override.
6605         (ClassPart.FindNestedType): Delegate to PartialContainer.
6606         (ClassPart.PartFindNestedType): Looks up the nested types of the
6607         part alone.
6608
6609 2005-03-02  Martin Baulig  <martin@ximian.com>
6610
6611         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6612         static constructor in static classes.
6613
6614 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6615
6616         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6617         sizeParamIndex is not specified.
6618
6619 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6620
6621         Fix #73117
6622         * report.cs (WarningMessage.IsEnabled): Missing null check.
6623
6624 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6625
6626         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6627         in the fields and not in the properties.
6628
6629 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6630
6631         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6632         fields as well.
6633
6634 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6635
6636         * attribute.cs: Small refactoring (improved robustness).
6637         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6638         (ValidateGuid): Removed.
6639         (Resolve): Removed referenced to above mentioned.
6640         (GetAttributeUsage): Made private and changed to work without
6641         class assistance.
6642         (GetIndexerAttributeValue): Don't crash.
6643         (GetConditionalAttributeValue): Ditto.
6644         (GetClsCompliantAttributeValue): Ditto.
6645         (ExtractSecurityPermissionSet): All attributes exceptions are
6646         error 648.
6647         (GetPropertyValue): New helper.
6648         (GetMethodImplOptions): New method.
6649         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6650         some missing properties.
6651         
6652         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6653         (Method.ApplyAttributeBuilder): Updated.
6654         
6655         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6656         exception.
6657
6658 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6659
6660         Fix #73052.
6661         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6662         non-simple types (array, pointer, reference).
6663
6664 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6665
6666         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6667
6668         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6669         for operators.
6670         (Method.CheckBase): Catch wrong destructor here.
6671         (MethodData.Define): Add errors 550, 668.
6672
6673         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6674
6675         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6676
6677         * pending.cs (VerifyPendingMethods): Add error 551.
6678
6679         * typemanager.cs (CSharpName): Next error report helper.
6680
6681 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6682
6683         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6684         attributes. Removed useless attribute double check.
6685         It saves almost 2MBs for corlib.
6686
6687 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6688
6689         Fix #72924.
6690         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6691         called twice in case of error.
6692
6693 2005-02-23  Chris Toshok  <toshok@ximian.com>
6694
6695         Fix compiler portions of #72827.
6696         * statement.cs (Block.Emit): call Begin/EndScope on the
6697         EmitContext instead of the ILGenerator.
6698
6699         * codegen.cs (EmitContext.BeginScope): new method, call
6700         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6701         we have one.)
6702         (EmitContext.BeginScope): same, but EndScope and CloseScope
6703
6704         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6705         offset and call the superclass's OpenScope(int) with it.
6706         (SymbolWriter.CloseScope): get the current il
6707         offset and call superclass's CloseScope(int) with it.
6708
6709 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6710
6711         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6712         CS1677 for out and ref as well.
6713
6714         * class.cs (Method.Define): Add error CS1599 detection.
6715         
6716         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6717         
6718         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6719         
6720         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6721         
6722         * support.cs.cs (ModifierDesc): New helper method.
6723
6724 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6725             Abin Thomas  <projectmonokochi@rediffmail.com>
6726             Anoob V E  <projectmonokochi@rediffmail.com>
6727             Harilal P R  <projectmonokochi@rediffmail.com>
6728
6729         Fix #57851, #72718.
6730         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6731         MemberLookup (used for error reporting) actually returns a result.
6732         Fix error report number (122, not 112).
6733
6734 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6735             Anoob V E  <projectmonokochi@rediffmail.com>
6736             Harilal P R  <projectmonokochi@rediffmail.com>
6737
6738         Fix #71134.
6739         * pending.cs (PendingImplementation.GetAbstractMethods):
6740         Find NonPublic members too.
6741
6742 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6743
6744         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6745         Fixed error 217.
6746         
6747         * class.cs (MethodCore.CheckMethodAgainstBase):
6748         Add error 239 report.
6749
6750 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6751
6752         Fix #68955.
6753         * expression.cs (Invocation.IsApplicable): Make public.
6754         (Invocation.IsParamsMethodApplicable): Likewise.
6755         * delegate.cs (Delegate.VerifyApplicability): Don't use
6756         Invocation.VerifyArgumentCompat for parameter applicability
6757         testing.  Use Invocation.IsApplicable and
6758         Invocation.IsParamsMethodApplicable.
6759
6760 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6761
6762         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6763         
6764         * class.cs (Operator.Define): Add error 217 report.
6765         
6766 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6767
6768         * namespace.cs (UsingEntry.Resolve): Undo change below.
6769
6770 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6771
6772         Fix #72756.
6773         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6774         disable the error message when the extended MemberLookup also
6775         fails.
6776         (Expression.MemberLookupFinal): Update.
6777         (SimpleName.DoSimpleNameResolve): Update.
6778         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6779         Don't use MemberLookupFinal.
6780         (New.DoResolve): Update.
6781         (BaseAccess.CommonResolve): Update.
6782
6783 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6784
6785         Fix #72732.
6786         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6787         occured previously, don't resolve again.
6788
6789 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6790
6791         Fix #69949
6792         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6793         argument. Call ResolveAttributeUsage for unresolved.
6794         when types doesn't match ctor arguments.
6795         
6796         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6797         for nested attribute classes.
6798         (Class.attribute_usage): Removed.
6799         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6800         for attribute class.
6801         
6802         * ecore.cs (IsAttribute): Removed.
6803         
6804         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6805         
6806         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6807         now normal types.
6808         (attribute_types): Removed.
6809         (EmitCode): Global attributes are emited as the latest.
6810
6811 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6812
6813         * class.cs (EmitFieldInitializers): Don't emit field initializer
6814         for default values when optimilization is on.
6815         
6816         * constant.cs (Constant.IsDefaultValue): New property.
6817         
6818         * driver.cs: Add /optimize handling.
6819         
6820         * constant.cs,
6821         * ecore.cs,
6822         * literal.cs: Implement new IsDefaultValue property.
6823         
6824         * rootcontext.cs (Optimize): New field, holds /optimize option.
6825
6826 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6827
6828         Fix crasher in re-opened #72347.
6829         * namespace.cs (Namespace.Lookup): Return null if
6830         DeclSpace.DefineType returns null.
6831
6832         Fix #72678.
6833         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6834
6835 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6836
6837         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6838         now returns null if it cannot resolve to an lvalue.
6839         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6840         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6841         returned null.  Remove check for SimpleName.
6842         (EventExpr.DoResolveLValue): New.
6843         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6844         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6845         error from ...
6846         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6847         avoid CS0131 error.
6848         (Unary.ResolveOperator): Move CS0211 check ...
6849         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6850         CS0131 error.
6851         (Unary.DoResolveLValue): Simplify.
6852         (AddressOf.DoResolveLValue): New.
6853         (ArrayAccess.DoResolveLValue): New.
6854
6855 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6856
6857         * attribute.cs (Attribute.Resolve): Add arguments casting for
6858         when types doesn't match ctor arguments.
6859
6860 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6861
6862         Fix parts of #63202.
6863         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6864         lookup of operator in base type.  Ensure that all checks happen
6865         when the operator resolves to an "op_..." method.
6866
6867 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6868
6869         Fix #71992.
6870         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6871         'ignore_cs0104' parameter.  Pass it to ...
6872         (NamespaceEntry.Lookup): ... this.
6873         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6874         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6875         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6876         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6877         Update.  Request that cs0104 errors be ignored.
6878         (ComposedCast.ResolveAsTypeStep): Update.
6879
6880 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6881
6882         Fix #59209.
6883         * expression.cs (Invocation.BetterFunction): Remove support for
6884         comparing virtual functions and their overrides.
6885         (Invocation.IsOverride): New.
6886         (Invocation.OverloadResolve): Don't consider 'override' functions
6887         during candidate selection.  Store them in a lookaside list.
6888         If the selected method is a 'virtual' function, use the list to
6889         find any overrides that are closer to the LHS type.
6890
6891 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6892
6893         * expression.cs (New.DoResolve): Add complex core type reduction.
6894         (New.Constantify): Converts complex core type syntax like 'new int ()'
6895         to simple constant.
6896         
6897 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6898
6899         * decl.cs (EntryType.EntryType): New constructor to create an
6900         updated copy of a cache entry.
6901         (MemberCache.AddMethods): Use it.
6902         (MemberCache.ClearDeclaredOnly): Remove.
6903         (MemberCache.MemberCache): Update.
6904
6905 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6906
6907         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6908         variable.  This one is represents the actual low-level declaration
6909         of the method, as opposed to the semantic level `IsStatic'.   
6910
6911         An anonymous method which is hosted into a static method might be
6912         actually an instance method.  IsStatic would reflect the
6913         container, while MethodIsStatic represents the actual code
6914         generated.
6915
6916         * expression.cs (ParameterReference): Use the new MethodIsStatic
6917         instead of IsStatic.
6918
6919         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6920         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6921         set on the current EmitContext. 
6922
6923         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6924         resolve our casted expression as an LValue.  This triggers the
6925         proper LValue processing that is later required by Assign.
6926
6927         This fixes 72347.
6928
6929         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6930
6931 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6932
6933         C# 2.0 Fixed buffer implementation
6934
6935         * anonymous.cs: Update after RegisterHelperClass renaming.
6936
6937         * attribute.cs (AttributeTester.fixed_buffer_cache):
6938         Cache of external fixed buffers.
6939         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6940         implementation if field is fixed buffer else null.
6941
6942         * class.cs
6943         (TypeContainer.AddField): Accept FieldMember instead of Field.
6944         (FieldBase.IsFieldClsCompliant): Extracted code from
6945         VerifyClsCompliance descendant customization.
6946         (FixedField): New class handles fixed buffer fields.
6947         (FixedFieldExternal): Keeps information about imported fixed
6948         buffer.
6949         (IFixedField): Make access to internal or external fixed buffer
6950         same.
6951
6952         * cs-parser.jay: Add fixed buffer parsing.
6953
6954         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6955         buffer.
6956
6957         * expression.cs (Indirection): Extended implementation to accept
6958         fixed buffer field.
6959         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6960         (ElementAccess.MakePointerAccess): Get type as parameter.
6961         (DoResolve): Add fixed buffer field expression conversion.
6962         (DoResolveLValue): Ditto.
6963         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6964         (ArrayPtr): Derives from FixedBufferPtr.
6965         (ArrayPtr.Emit): Add extra emit for array elements.
6966
6967         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6968
6969         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6970         for compiler generated types.
6971         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6972
6973         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6974         and consume less memory.
6975         (Fixed.Resolve): Add fixed buffer case.
6976
6977         * typemanager.cs (compiler_generated_attr_ctor,
6978         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6979         (HasElementType): Add our own implementation to work on every
6980         runtime.
6981
6982 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6983
6984         * anonymous.cs (CaptureContext): Track whether `this' has been
6985         referenced.   
6986
6987         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6988         only captured `this' if it was implicitly done (instance
6989         methods/variables were used). 
6990
6991         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6992         `this' must be captured.
6993
6994 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6995  
6996         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6997         is null it means that there has been no need to capture anything,
6998         so we just create a sibling.
6999
7000         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7001
7002         Just a partial fix.  The other half is fairly elusive.
7003         
7004 2005-02-10  Raja R Harinath  <rharinath@novell.com>
7005
7006         Fix #52586, cs0121-4.cs.
7007         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
7008         and return a hashtable.
7009         (MemberCache.ClearDeclaredOnly): New.
7010         (MemberCache.MemberCache): Update to change.  Make a deep copy of
7011         the method_hash of a base type too.
7012         (MemberCache.AddMethods): Adapt to having a deep copy of the base
7013         type methods.  Overwrite entries with the same MethodHandle so
7014         that the ReflectedType is correct.  The process leaves in base
7015         virtual functions and their overrides as distinct entries.
7016         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
7017         matters since it was boxed in a ArrayList before.
7018         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7019         modifier.
7020         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
7021         case of a virtual function and its override (choose the overload
7022         as better).
7023         (Invocation.OverloadResolve): Avoid 'override' members during
7024         'applicable_type' calculation.
7025
7026 2005-02-09  Raja R Harinath  <rharinath@novell.com>
7027
7028         Combine two near-redundant caches.
7029         * typemanager.cs (method_params): Rename from method_internal_params.
7030         (TypeManager.GetParameterData): New.  Replace
7031         Invocation.GetParameterData.
7032         (TypeManager.LookupParametersByBuilder): Remove.
7033         * expression.cs (Invocation.method_parameter_cache): Remove.
7034         (Invocation.GetParameterData): Remove.
7035         Update to changes.
7036         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7037         Update to changes.
7038
7039 2005-02-08  Raja R Harinath  <rharinath@novell.com>
7040
7041         Fix #72015.
7042         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7043         TypeManager.multicast_delegate_type is null, resolve it by looking
7044         up "System.MulticastDelegate".
7045         * rootcontext.cs (RootContext.ResolveCore): Simplify.
7046
7047 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
7048             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
7049             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
7050
7051         Fix cs0164.cs.
7052         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7053         (LabeledStatement.AddReference): New.  Set 'referenced'.
7054         (Goto.Resolve): Use it.
7055
7056 2005-02-05  John Luke  <john.luke@gmail.com>
7057
7058         * driver.cs: remove duplicate -doc line in Usage ()
7059
7060 2005-02-04  Raja R Harinath  <rharinath@novell.com>
7061
7062         * location.cs (Location.AddFile): Fix CS2002 error report.
7063
7064 2005-02-02  Martin Baulig  <martin@ximian.com>
7065
7066         * delegate.cs (Delegate.DefineType): Report an internal error if
7067         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7068         details.        
7069
7070 2005-02-02  Raja R Harinath  <rharinath@novell.com>
7071
7072         Fix a crasher in a variant of #31984.
7073         * const.cs (Constant.CheckBase): New override that defers the
7074         new-or-override check in case the base type hasn't been populated
7075         yet.
7076         (Constant.Define): Ensure the new-or-override check is performed.
7077
7078 2005-02-01  Duncan Mak  <duncan@ximian.com>
7079
7080         * const.cs (LookupConstantValue): Check that `ce' is not null
7081         before calling GetValue ().
7082
7083 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7084
7085         Fix test-334.cs (#69519).
7086         * cs-parser.jay (using_alias_directive): Pass in an expression to
7087         NamespaceEntry.UsingAlias.
7088         (using_namespace_directive): Pass in an expression to
7089         NamespaceEntry.Using.
7090         (namespace_name): Don't flatten to a string.
7091         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7092         (NamespaceEntry.AliasEntry.Resolve): Lookup using
7093         ResolveAsTypeStep.
7094         (NamespaceEntry.UsingEntry): Likewise.
7095         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7096         changes.
7097         (NamespaceEntry.LookupForUsing): Remove.
7098         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7099         names.
7100         (NamespaceEntry.Lookup): Remove support for dotted names.
7101
7102 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7103
7104         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7105         split into two.
7106         (NamespaceEntry.ImplicitParent): Compute on demand.
7107         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7108         parallels the current.
7109         (NamespaceEntry.LookupForUsing): Use it.
7110         (NamespaceEntry.Lookup): If the current namespace-entry is
7111         implicit, don't search aliases and using tables.
7112
7113 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7114
7115         Fix #31984.
7116         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7117         BaseCache here.
7118         (TypeContainer.BaseCache): Compute on demand.
7119         (TypeContainer.FindMembers): Define constants and types if they're
7120         not already created.
7121         (FieldMember.Define): Move resetting of ec.InUnsafe before error
7122         check.
7123         * const.cs (Constant.Define): Make idempotent.
7124
7125 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7126
7127         * pending.cs: Produce better code (no nops produced by using Ldarg
7128         + value).
7129         
7130         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7131         i - 1' it should be arg + 1.
7132
7133         Fixes bug #71819.
7134
7135 2005-01-28  Raja R Harinath  <rharinath@novell.com>
7136
7137         * attribute.cs (Attribute.CheckAttributeType): Make private
7138         non-virtual.
7139         (Attribute.ResolveType): Make virtual.
7140         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7141         handling of RootContext.Tree.Types.
7142
7143 2005-01-27  Raja R Harinath  <rharinath@novell.com>
7144
7145         Update attribute-handling to use the SimpleName/MemberAccess
7146         mechanisms.
7147         * cs-parser.jay (attribute): Pass in an expression to the
7148         constructors of Attribute and GlobalAttribute.
7149         * attribute.cs (Attribute): Take an expression for the name.
7150         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
7151         passed in attribute name expression.
7152         (Attribute.CheckAttributeType): Use it.
7153         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7154         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7155         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
7156         argument to prevent error messages if the lookup fails.
7157
7158 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
7159
7160         * expression.cs (Indirection): Implemented IVariable interface
7161         to support indirection in AddressOf operator.
7162         (PointerArithmetic.Emit): Add optimalization for case where
7163         result can be precomputed.
7164
7165 2005-01-26  Martin Baulig  <martin@ximian.com>
7166
7167         * class.cs (TypeContainer.AttributeTargets): Return the correct
7168         AttributeTargets depending on our `Kind' instead of throwing an
7169         exception; fixes #71632.
7170
7171 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
7172
7173         Fix #71257
7174         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7175         constant members.
7176
7177 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7178
7179         Fix #71602.
7180         * expression.cs (MemberAccess.DoResolve): Don't complain with
7181         cs0572 when the LHS of a member access has identical name and type
7182         name.
7183
7184 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7185
7186         Fix #71651, #71675
7187         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7188         CreatePermission.
7189         Create custom PermissionSet only for PermissionSetAttribute.
7190
7191 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7192
7193         Fix #71649
7194         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7195         delegates in static class.
7196
7197 2005-01-24  Martin Baulig  <martin@ximian.com>
7198
7199         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7200         merging an implicit block, just use its reachability.
7201
7202         * statement.cs (Block.Resolve): Make the unreachable code check
7203         work wrt. implicit blocks; see test-337 from #63842.
7204
7205 2005-01-21  Alp Toker  <alp@atoker.com>
7206  
7207         * cs-parser.jay: destructor_declaration's container is PartialContainer
7208         not Class when partial types are used, so use Kind prop instead of
7209         'is'.
7210         
7211 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7212
7213         * cs-parser.jay: Improve error reporting when an interface
7214         declares new types.
7215
7216 2005-01-20  Dick Porter  <dick@ximian.com>
7217
7218         * support.cs: SeekableStreamReader fix from Sandor Dobos
7219         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7220         chars are read.  Fixes bug 70369.
7221
7222 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7223
7224         * cs-parser.jay (catch_clause): Simplify current_block handling
7225         somewhat.
7226
7227 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7228
7229         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7230         code with ImplicitStandardConversion to handle the implicit
7231         conversion of method groups into valid delegate invocations. 
7232
7233         The problem is that in parameter handling we were using this code
7234         path.  Fixes bug #64698
7235
7236 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7237
7238         * cs-parser.jay: Fix several infelicities.
7239         - Avoid assigning to the parser value stack.  Code like 
7240           '$3 = null' is unclean.  Synthesize a value for the code block
7241           instead. 
7242         - Avoid using oob_stack for storing location information.  Use ...
7243         (_mark_): ... this.  New (empty) rule.  Saves the current location
7244         in $$.
7245         (foreach_statement): Avoid using oob_stack for current_block
7246         handling.  Use technique used in for_statement and
7247         using_statement.  Synthesize a value for the code block to store
7248         additional intermediate information.
7249
7250 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7251
7252         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7253         of a different type is only allowed to private fields of a
7254         containing type, not on fields of a base class.
7255
7256         See test-174.cs and error cs0122-9.cs
7257
7258 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7259
7260         Fix test-335.cs (bug #58126).
7261         * cs-parser.jay (argument): Split out non-expression parts of the
7262         rule into 'non_simple_argument'.
7263         (invocation_expression): Support parenthesized invocations with
7264         multiple arguments, and with single non-simple arguments.
7265
7266 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7267
7268         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7269         places.
7270
7271 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7272
7273         Fix cs0038-1.cs, cs1640-6.cs.
7274         * ecore.cs (Expression.Resolve): Remove special-case for
7275         SimpleName in error-handling.
7276         (Expression.almostMatchedMembers): Relax access permission to
7277         protected.
7278         (Expression.MemberLookupFailed): Handle duplicates in
7279         almostMatchedMembers list.
7280         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7281         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7282         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7283         overload if the passed in MemberInfo is a MethodBase.
7284
7285 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7286
7287         Fix #70749
7288         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7289         for non-CAS & merge permission sets properly.
7290
7291 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7292
7293         Improve standard-compliance of simple name and member access 
7294         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7295         * ecore.cs (FullNamedExpression): New abstract base class 
7296         for Namespaces and TypeExpressions.
7297         (ResolveFlags.SimpleName): Remove.
7298         (SimpleName): Remove support for dotted names.
7299         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7300         DeclSpace.FindType and DeclSpace.LookupType.
7301         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7302         (Expression.ExprClassName): Make member function.
7303         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7304         a namespace.  Remove creation of dotted "SimpleName"s.
7305         (MemberAccess.DoResolve): Likewise.
7306         * decl.cs (DeclSpace.Cache): Make private.
7307         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7308         (DeclSpace.FindType): Update.
7309         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7310         FullNamedExpression.
7311         * namespace.cs (Namespace): Derive from FullNamedExpression
7312         so that it can be part of expression resolution.
7313         (Namespace.Lookup): Return an FullNamedExpression.
7314         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7315         namespace.
7316         * rootcontext.cs (NamespaceLookup): Remove.
7317         (LookupType): Move to DeclSpace.
7318         * attribute.cs (CheckAttributeType): Update.
7319         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7320         (FindDocumentedTypeNonArray): Likewise.
7321
7322 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7323
7324         Fix cs0509.cs, cs1632.cs.
7325         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7326         is the same as IsInterface.
7327         (TypeContainer.GetClassBases): Likewise.
7328         * statement.cs (LabeledStatement.ig): New field.
7329         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7330         label.
7331         (LabeledStatement.DoEmit): Check that the label was created with
7332         the same ILGenerator.
7333
7334 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7335
7336         Fix #71058
7337         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7338         accessors to its properties.
7339
7340         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7341         from accessors to property.
7342         
7343 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7344
7345         Fix #70722
7346         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7347         only for overrides.
7348         
7349 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
7350
7351         * attribute.cs: Check for null and empty strings.  
7352
7353         I have lost another battle to Paolo.
7354
7355 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
7356
7357         Fix #70942
7358         * class.cs (PropertyMethod): Set Parent field in ctors.
7359         (SetMethod.InternalParameters): Add unsafe switch hack.
7360         Override MarkForDuplicationCheck where it is appropriate.
7361
7362         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7363         It says whether container allows members with the same name.
7364         Base default is no.
7365         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7366         Removed is_method parameter.
7367
7368 2005-01-06  Duncan Mak  <duncan@ximian.com>
7369
7370         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7371         because the previous change led to incorrect reporting of CS1032
7372         ("Cannot define/undefine preprocessor symbols after first token in
7373         file"). Instead of using `tokens_seen' as the only flag that
7374         triggers CS1040, introduce `comments_seen'. This new flag is used
7375         to signify having seen comments on the current line, so it is
7376         unset after a newline.
7377
7378 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7379
7380         * doc.cs : When searching for a type, find nested type too.
7381           This fixes bug #71040.
7382
7383 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7384
7385         * doc.cs :
7386           - Warn missing member comment on those classes which also does not
7387             have doc comments. Fixed bug #71041.
7388           - Don't warn missing doc comment on default constructor.
7389             Fixed bug #71042.
7390
7391 2005-01-06  Duncan Mak  <duncan@ximian.com>
7392
7393         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7394         comments, set `tokens_seen' to true. This allows us to detect
7395         misplaced preprocessor directives (i.e. not at the beginning of
7396         the a line, nor after whitespaces). In that case, report error
7397         CS1040. This fixes bug #56460.
7398
7399         * cs-parser.jay (interface_member_declaration): Add checks for
7400         IsExplicitImpl, and report CS0541 error if an interface member is
7401         defined as an explicit interface declaration.
7402
7403 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7404
7405         Fix #70817
7406         * class.cs (PropertyMethod): Set Parent field in ctors.
7407         (SetMethod.InternalParameters): Add unsafe switch hack.
7408         
7409         * decl.cs (MemberCore.Parent): Cannot be readonly.
7410
7411 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7412
7413         * decl.cs (DeclSpace.ResolveType): Remove.
7414         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7415         Merge in code from ...
7416         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7417         * class.cs, enum.cs: Update to changes.
7418
7419 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7420
7421         * anonymous.cs: Ensure that we init the scope of our parent if it
7422         has not been initialized yet.
7423
7424 2004-12-30  Duncan Mak  <duncan@ximian.com>
7425
7426         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7427         if field.FieldBuilder is null. Fixes #70758.
7428
7429         * convert.cs: Fixed some typos and updated some of the comments.
7430         (ImplicitStandardConversionExists):
7431         (TryImplicitIntConversion): If `target_type' is an interface and
7432         the type of `ic' implements this interface, return true or a new
7433         BoxedCast instead of null. This fixes #70468.
7434
7435 2004-12-29  Duncan Mak  <duncan@ximian.com>
7436
7437         * expression.cs (Argument.Emit): Check that Expr is
7438         IMemoryLocation before casting to it, and report CS1510 otherwise.
7439
7440         This fixes #70402.
7441
7442 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7443
7444         * statement.cs (Block.ThisVariable): remove the recursion here, to
7445         make the --profile more sane.
7446
7447 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7448
7449         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7450         assembly, by JB Evain.
7451
7452 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7453
7454         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7455           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7456         "parent" refers to enclosing type/class.  "base" refers to superclass.
7457
7458 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7459
7460         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7461         Ensure that we only have GlobalAttributes.
7462         * attribute.cs (Attribute.Emit): Make non-virtual.
7463         (GlobalAttribute.Emit): Remove.
7464         (Attribute.Resolve): Make virtual.
7465         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7466         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7467         the argument. Don't create one.
7468         (Attribute.GetObsoleteAttribute): Likewise.
7469         (Attribute.GetClsCompliantAttributeValue): Likewise.
7470         * class.cs, decl.cs: Update to changes.
7471
7472 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7473
7474         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7475         
7476         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7477         
7478         * statement.cs (Foreach.Resolve): Add error 186 report.
7479
7480 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7481
7482         * expression.cs (Conditional.DoResolve): Add warning 429.
7483         
7484         * statement.cs (If.Resolve): Add warning 665.
7485
7486 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7487
7488         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7489         except when in the parser, and in GlobalAttribute.
7490         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7491         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7492         RootContext.Tree.Types.NamespaceEntry once work is done.
7493         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7494         and resets RootContext.Tree.Types.NamespaceEntry.
7495
7496 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7497
7498         * cs-parser.jay: Don't create a block for every variable.
7499
7500 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7501
7502         * location.cs: Provide extra information.
7503
7504         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7505         variables from the captured environment, it is the ldarg_0.
7506
7507 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7508
7509         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7510         find a conclusion.
7511         
7512         * class.cs: Changed warning level for 169 to avoid developer
7513         displeasure from warning flooding. It will be changed back when they
7514         fix most of current BCL warnings.
7515         
7516         * RootContext.cs: Pushed default WarningLevel to 3.
7517         
7518         * statement.cs: Removed unused variable.
7519
7520 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7521
7522         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7523         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7524         Add error 502 report.
7525         (StaticClass.DefineType): Add error 441 report.
7526         (Class.AllowedModifiersProp): New virtual property as temporary
7527         extension to AllowedModifiers.
7528         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7529         to share implementation with StaticClass and don't call virtual
7530         methods from ctor.
7531         
7532         * driver.cs (MainDriver): Add error 1558 test.
7533
7534         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7535         report. Moved error 36 test here.
7536
7537         * statement.cs (Throw.Resolve): Add error 724 report.
7538
7539         * typemanager.cs: Add out_attribute_type core type.
7540         
7541 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7542
7543         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7544         3018 report.
7545         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7546
7547         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7548         3017 report.
7549         
7550         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7551
7552         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7553         Add error 3023 report.
7554         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7555
7556         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7557         implementation.
7558
7559 2004-12-12  John Luke  <john.luke@gmail.com>
7560
7561         * driver.cs (AddArgs): take -- into account when
7562         adding arguments, fixes bug 65710 
7563
7564 2004-12-12  Martin Baulig  <martin@ximian.com>
7565
7566         * expression.cs (Unary.TryReduceNegative): Added support for
7567         SByteConstant and ByteConstant.
7568         (Unary.Reduce): Check error values from TryReduceNegative().
7569
7570 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7571
7572         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7573         and report exception as error 182.
7574
7575 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7576
7577         * driver.cs (Main): Fix message when there are warnings.
7578
7579 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7580
7581         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7582
7583 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7584
7585         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7586         Reduced number of warnings.
7587         
7588         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7589
7590 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7591
7592         * driver.cs: Removed message.
7593
7594         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7595
7596 2004-12-08    <vargaz@freemail.hu>
7597
7598         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7599
7600 2004-12-08  Martin Baulig  <martin@ximian.com>
7601
7602         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7603         instead of a CS3002 for properties and indexer.
7604
7605 2004-12-08  Martin Baulig  <martin@ximian.com>
7606
7607         * decl.cs (MemberName.ToString): Make this work again.
7608
7609 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7610
7611         * attribute.cs (Resolve): Add error 591 detection.
7612
7613         * class.cs (FieldMember.Define): Add error 1547 detection.
7614         (Indexer.Define): Add error 620 detection.
7615         (Operator.Define): Add error 590 detection.
7616
7617         * ecore.cs: Missing argument for error 79.
7618
7619         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7620         detection.
7621
7622 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7623
7624         Fix #70106
7625         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7626         only.
7627
7628 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7629
7630         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7631           Some operator comments were suppressed.
7632         * doc.cs : Implicit/explicit operator name in doc comments are like
7633           "op_Explicit(type)~returnType", so added suffix handling.
7634
7635 2004-12-07  Martin Baulig  <martin@ximian.com>
7636
7637         * decl.cs
7638         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7639         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7640         (DeclSpace.ec): New protected field; store the EmitContext here.
7641         (DeclSpace.EmitContext): New public property; moved here from
7642         `TypeContainer'.
7643         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7644         EmitContext.
7645
7646         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7647         (Enum.Emit): Don't create a new EmitContext.
7648
7649         * delegate.cs (Delegate.DefineType): Always create the
7650         EmitContext.
7651
7652         * iterators.cs (Iterators.DefineIterator): Create a new
7653         EmitContext and store it in `ec'.
7654
7655 2004-08-24  Martin Baulig  <martin@ximian.com>
7656
7657         * typemanager.cs
7658         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7659         this for accessibility checks.
7660         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7661         IsNestedFamilyAccessible.
7662         (TypeManager.IsSubclassOf): New method, do what the name actually
7663         says.   
7664
7665 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7666
7667         Fix crash on cs0657-17.cs.
7668         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7669         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7670         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7671         the case where the NamespaceEntry gets overwritten.
7672
7673 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7674
7675         Fixed #69195, #56821
7676         * ecore.cs (ResolveBoolean): Tiny refactoring.
7677
7678         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7679         of right expression resolving when left is false constant and
7680         operator is LogicalAnd OR true constant and operator is LogicalOr.
7681
7682         * statement.cs (ResolveUnreachable): Always reports warning.
7683
7684 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7685
7686         * class.cs: Distinguish between 1721 and 1722 (just a little help
7687         for the programmer).
7688
7689 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7690
7691         * delegate.cs: Only allow this on new versions of the language. 
7692
7693 2004-12-02  Duncan Mak  <duncan@ximian.com>
7694
7695         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7696         Expression class.
7697         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7698         here as a static method. Take an additional bool out parameter
7699         `must_do_cs1540_check' for signaling to InstanceResolve.
7700         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7701         member field from PropertyExpr class and made it an argument of
7702         the method instead.
7703         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7704         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7705         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7706         and `remove_accessor' as well as InstanceResolve: report CS0122
7707         where applicable.
7708
7709         Fixes #70129.
7710
7711 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7712
7713         Fix test-327.cs, test-328.cs, and put in early infrastructure
7714         for eventually fixing #52697.
7715         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7716         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7717         from other methods.
7718         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7719         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7720         (VerifyUsing, error246): Update.
7721         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7722         'NamespaceEntry.LookupNamespaceOrType'.
7723
7724 2004-12-03  Martin Baulig  <martin@ximian.com>
7725
7726         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7727         method as our child, call AnonymousMethod.Compatible() on it.
7728
7729 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7730
7731         Disable XML documentation support in 'basic' profile.
7732         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7733         Redirect XmlElement to System.Object.
7734         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7735         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7736         * mcs.exe.sources: Add doc-bootstrap.cs.
7737         * doc-bootstrap.cs: New file.  Contains empty stub implementation
7738         of doc.cs.
7739
7740 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7741
7742         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7743           comments are allowed.
7744
7745 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7746
7747         * delegate.cs: Add checks for subtypes in paramaters and return values
7748         in VerifyMethod () to add support for Covariance/Contravariance
7749         in delegates.
7750         
7751 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7752
7753         * report.cs: Remove extra closing parenthesis.
7754
7755         * convert.cs (Error_CannotImplicitConversion): If the name of the
7756         types are the same, provide some extra information.
7757
7758         * class.cs (FieldBase): Use an unused bit field from the field to
7759         encode the `has_offset' property from the FieldMember.  This saves
7760         a couple of Ks on bootstrap compilation.
7761
7762         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7763         method as our child, return the AnonymousMethod resolved
7764         expression.
7765
7766         * expression.cs (New.DoResolve): Allow return values from
7767         NewDelegate to also include AnonymousMethods.
7768
7769         Fixes #70150.
7770
7771 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7772
7773         Fix bug #70102
7774         * attribute.cs (Resolve): Improved implementation of params
7775         attribute arguments.
7776
7777         * support.cs (ParameterData): Add HasParams to be faster.
7778
7779 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7780
7781         all things are for /doc support:
7782
7783         * doc.cs: new file that supports XML documentation generation.
7784         * mcs.exe.sources: added doc.cs.
7785         * driver.cs:
7786           Handle /doc command line option.
7787           Report error 2006 instead of 5 for missing file name for /doc.
7788           Generate XML documentation when required, after type resolution.
7789         * cs-tokenizer.cs:
7790           Added support for picking up documentation (/// and /** ... */),
7791           including a new XmlCommentState enumeration.
7792         * cs-parser.jay:
7793           Added lines to fill Documentation element for field, constant,
7794           property, indexer, method, constructor, destructor, operator, event
7795           and class, struct, interface, delegate, enum.
7796           Added lines to warn incorrect comment.
7797         * rootcontext.cs :
7798           Added Documentation field (passed only when /doc was specified).
7799         * decl.cs:
7800           Added DocComment, DocCommentHeader, GenerateDocComment() and
7801           OnGenerateDocComment() and some supporting private members for
7802           /doc feature to MemberCore.
7803         * class.cs:
7804           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7805         * delegate.cs:
7806           Added overriden DocCommentHeader.
7807         * enum.cs:
7808           Added overriden DocCommentHeader and GenerateDocComment().
7809
7810 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7811
7812         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7813         unwrapping the enumeration values, chain to
7814         DoConstantNumericPromotions again, so we can promote things to the
7815         fundamental types (takes care of enums that are bytes, sbytes).
7816
7817         Fixes bug #62054.
7818
7819 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7820
7821         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7822         Fix long-standing bug in type-lookup.  Use FindType instead of
7823         LookupType when ec.ResolvingTypeTree.
7824         (Attribute.ResolveType, Attribute.Resolve)
7825         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7826         Update to changes.
7827         (Attributes.Search): Remove internal version.  Update.
7828         (Attributes.SearchMulti): Update.
7829         (Attributes.GetClsCompliantAttribute): Remove.
7830         (Attributes.GetIndexerNameAttribute): Remove.
7831         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7832         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7833         * class.cs (Indexer.Define): Likewise.
7834
7835 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7836
7837         Fix bug #68790
7838         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7839         MarshallByReference members access.
7840
7841         * expression.cs: Use CheckMarshallByRefAccess;
7842         Better error CS0197 message.
7843
7844         * report.cs: Print whole related error message.
7845
7846 2004-11-30  Raja R Harinath  <rharinath@novell.com>
7847
7848         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7849         the current directory to help debugging.
7850
7851 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7852
7853         * class (GetClassBases): Better error 60 report.
7854         (EventProperty): Disabled warning 67 detection.
7855
7856 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7857
7858         Fix bug #60324
7859         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7860
7861         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7862         precise values.
7863
7864 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7865
7866         Fix bug #49488
7867         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7868
7869         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7870
7871 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7872
7873         * attribute.cs (Attribute.Resolve): Refine error reporting and
7874         report a cs0117 if the identifier does not exist, to distinguish
7875         from 0617 which is a miss-use of the actual identifier.
7876
7877         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7878         between cs0070 and cs0079.
7879
7880         * class.cs (MemberBase.DoDefine): When reporting a wrong
7881         accessibility level, we use MethodCore to compare instead of
7882         Method (this was a regression in some refactoring effort).
7883
7884         So now we correctly report cs0056 again.
7885
7886         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7887         testing the target_type (which was known to be object_type) and
7888         not the source type (which is anonymous_method).
7889
7890         Fixed reporting of error cs1660.
7891
7892         * expression.cs (UserCast.Source): Expose the underlying cast.
7893
7894         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7895         allowed types to find a match to int32 first (most common).
7896
7897         In addition, it ignores any ImplicitUserConversions that did an
7898         internal implicit conversion (as the switch statement allows only
7899         one integral conversion to exist).
7900
7901         * class.cs (PartialContainer.Create): rename `name' to
7902         `member_name' for clarity.  Then replace the string calls with a
7903         call to MemberName.GetPartialName, as now using
7904         MemberName.ToString is an error (this is due to the side effects
7905         it had, that were fixed in the past).
7906
7907         This will restore the error reporting on a number of partial class
7908         errors that were missusing this (and getting an exception as a
7909         results, which is now just a plain textual warning, because
7910         yyparse debug output would crash otherwise).
7911
7912 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7913
7914         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7915
7916 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7917
7918         * rootcontext.cs (LookupType): Make sure to cache lookups that
7919         don't give us a negative result. This saves about 5% of corlib
7920         compilation time.
7921
7922 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7923
7924         * report.cs (AbstractMessage.Print): messages are sent to stderr
7925
7926         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7927         non-interface in the list of interfaces (at this point, either
7928         parent was properly set, or a base class is being listed in the
7929         interfaces section).
7930
7931         This flags error 1722, and resolves the crash from bug 69259.
7932
7933 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7934
7935         * statement.cs (Using.EmitExpressionFinally): make this work right
7936         for valuetypes. Fixes 69926.
7937
7938 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7939
7940         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7941         converted to an enum" here, before we try to change the underlying
7942         type.  This code exists, but it is a different code path than the
7943         one used while encoding constants.
7944
7945         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7946         old bug: when converting from the null literal to a pointer,
7947         return an EmptyCast, not the NullLiteral.
7948
7949         This fixes #69921, the recent null_type changes probably made this
7950         bug more prominent.
7951
7952         (ImplicitReferenceConversionExists): In addition, resynchronized
7953         the code here, so it matches the same code in
7954         ImplicitReferenceConversionExists for the `from any class-type S
7955         to any interface-type T'.
7956         
7957
7958 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7959
7960         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7961
7962 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7963
7964         * cs-parser.jay: Use verbosity accordingly. 
7965
7966 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7967
7968         * expression.cs (Unary.ResolveOperator): Do not report warning;
7969         AddressOf reads from variable.
7970         
7971         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7972
7973 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7974
7975         Fix bug #69462
7976
7977         * attribute.cs (Attributable): Removed CheckTargets.
7978         (Attributes.Emit): Explicit attribute targets are tested here.
7979
7980         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7981         not enabled for interfaces.
7982
7983         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7984         (GetAssemblyName): Ouch next bug there.
7985
7986 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7987
7988         * expression.cs: Error 275 added.
7989         
7990 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7991
7992         Fix bug #69177 (Implemented decimal constant support)
7993
7994         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7995         (BinaryFold): Add DecimalConstant.
7996
7997         * const.cs (Define): Decimal constant 
7998         (is not constant.
7999         (ChangeType): Add decimal type handling.
8000         (LookupConstantValue): Don't set value for decimal type but
8001         emit DecimalConstantAttribute. Needed for constant optimization.
8002
8003         * constant.cs (ToDecimal): New method.
8004         (ConvertToDecimal): New method.
8005         (IntConstant): Implemented ConvertToDecimal.
8006         (DecimalConstant.Emit): Emit optimized version for decimals in
8007         int range.
8008
8009         * expression.cs (ResolveOperator): Changed order of constant
8010         reduction to work correctly with native types which have
8011         overloaded operators.
8012         (ResolveMemberAccess): Extract constant value from attribute
8013         for decimal type.
8014
8015         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8016
8017         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8018         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8019         (ChangeType): Decimal is special.
8020         (TypeToCoreType): Add decimal type.
8021
8022 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8023
8024         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8025         decimal types.
8026
8027 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8028
8029         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8030         test cs1667-5.cs.
8031
8032 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8033
8034         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8035
8036         * pending.cs (PendingImplementation): Grab only interfaces.
8037
8038 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8039
8040         * statement.cs (ForeachHelperMethods): Add location member and
8041         error 202 detection.
8042
8043 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8044
8045         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
8046         automatically handled by executable.make.
8047         (PROGRAM): Make profile-specific.
8048
8049 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8050
8051         * expression.cs (DoResolveBase): Fixed wrong warning for out
8052         variables.
8053
8054 2004-11-18  Martin Baulig  <martin@ximian.com>
8055
8056         Merged latest changes into gmcs.  Please keep this comment in
8057         here, it makes it easier for me to see what changed in MCS since
8058         the last time I merged.
8059
8060 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8061
8062         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8063         (TypeHandle.GetMemberCache): New.
8064         (TypeHandle.TypeHandle): Update.
8065         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8066         (TypeManager.LookupParentInterfacesCache):
8067         Rename from LookupInterfaceCache.  Optimize slightly.
8068         (TypeManager.MemberLookup_FindMembers): Update.
8069         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8070         multi-type variant.
8071         (AddCacheContents): Rename from AddHashtable.
8072         * class.cs (TypeContainer.parent_container): Remove.
8073         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8074         (TypeContainer.DoDefineMembers): Don't initialize it.
8075         Update to name changes.
8076         
8077 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8078
8079         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8080         that factors the code to check access modifiers on override.  
8081
8082         (PropertyBase): Use the code here.
8083
8084         Patch from Lluis S'anchez, fixes bug #69361.
8085
8086 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8087
8088         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8089         routine that is used to report the use of a captured variable
8090         whose address has been taken.
8091
8092         There are two checks: one when variables are being captured and
8093         the other check is when the address of a variable is taken. 
8094         
8095         (because an anonymous methods might be resolved before *or* after
8096         the address has been taken) and 
8097
8098         * expression.cs (Conditional.DoResolve): Remove the special
8099         casing that Martin added to trueExpr and falseExpr being both
8100         NullLiteral.  We get the right behavior now just by introducing
8101         the null_type into the compiler. 
8102
8103         * convert.cs (ExplicitConversion): Change the code to use
8104         null_type instead of testing `expr is NullLiteral'.
8105         (ImplicitConversionStandard): use null_type too.
8106         (ImplicitReferenceConversionExists): use null_type too.
8107         (ImplicitReferenceConversion): use null_type too.
8108
8109         * literal.cs: The type of `NullLiteral' is now null_type instead
8110         of object_type. 
8111         (Resolve): Set the type here.
8112
8113         * typemanager.cs: Introduce null_type.
8114
8115 2004-11-17  Martin Baulig  <martin@ximian.com>
8116
8117         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8118         direction, like FindMembers() does.  Fixes #69546, testcase is in
8119         test-315.cs.    
8120
8121 2004-11-16  Martin Baulig  <martin@ximian.com>
8122
8123         This is based on a patch from Marek Safar, see bug #69082.
8124         Fixes bugs #63705 and #67130.
8125
8126         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8127         method; create a MemberCache for an interface type and cache the
8128         result.
8129
8130         * decl.cs (IMemberContainer.ParentContainer): Removed.
8131         (IMemberContainer.ParentCache): New property.
8132         (MemberCache.SetupCacheForInterface): Removed.
8133         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8134         to create a cache for an interface's "parent".
8135
8136         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8137         interfaces too.
8138
8139 2004-11-16  Martin Baulig  <martin@ximian.com>
8140
8141         Merged back from gmcs; these changes already went into gmcs a
8142         couple of weeks ago.
8143
8144         * typemanager.cs
8145         (TypeManager.AddUserType): Removed the `ifaces' argument.
8146         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
8147         `TypeExpr []'.
8148         (TypeManager.AddUserInterface): Removed.
8149         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
8150         `TypeExpr []'.
8151         (TypeManager.GetInterfaces): Likewise.
8152         (TypeManager.GetExplicitInterfaces): Likewise.
8153
8154         * ecore.cs (TypeExpr.GetInterfaces): Removed.
8155
8156         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
8157         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
8158
8159 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8160
8161         * statement.cs: Avoid adding bools to a hashtable.
8162
8163 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8164
8165         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8166         calling an unsafe method from a safe location.
8167
8168 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8169
8170         Fix #69167
8171         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8172
8173 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8174
8175         * namespace.cs (VerifyUsing): use GetPartialName instead of
8176         ToString. 
8177
8178 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8179
8180         * statement.cs (Return.Resolve): Fix regression in typo: if
8181         `in_exc', we have to request a NeedReturnLabel, this was a typo
8182         introduced in the anonymous method check-in.  Fixes #69131.
8183
8184         * Indexers were using the ShortName when defining themselves,
8185         causing a regression in the compiler bootstrap when applying the
8186         patch from 2004-11-02 (first part), now they use their full name
8187         and the bug is gone.
8188
8189 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8190
8191         * driver.cs: Strip the path from the names of embedded resources. Fixes
8192         #68519.
8193
8194 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8195
8196         Fix error message regression: cs0104-2.cs.
8197         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8198         (AliasEntry.Resolve): Update.
8199         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8200         'silent' flag.
8201         (RootContext.LookupType): Update.
8202
8203 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8204
8205         * cs-parser.jay: Add support for handling accessor modifiers
8206         * class: Add support port accessor modifiers and error checking,
8207         define PropertyMethod.Define as virtual (not abstract anymore)
8208         * ecore.cs: Add checking for proeprties access with access modifiers
8209         * iterators.cs: Modify Accessor constructor call based in the modified
8210         constructor
8211 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8212
8213         * expression.cs (StringConcat): Handle being called twice,
8214         as when we have a concat in a field init with more than two
8215         ctors in the class
8216
8217 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8218
8219         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8220         special case explicit implementations, we should always produce
8221         the .property or .event declaration.
8222         
8223         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8224         since it will not return correct data if people use this
8225         unresolved in the presence of using statements (see test-313).
8226
8227         * class.cs (MethodData.Define): If we are an explicit interface
8228         implementation, set the method name to the full name of the
8229         interface plus the name of the method.  
8230
8231         Notice that using the method.MethodName.GetFullName() does not
8232         work, as it will only contain the name as declared on the source
8233         file (it can be a shorthand in the presence of using statements)
8234         and not the fully qualifed type name, for example:
8235
8236         using System;
8237
8238         class D : ICloneable {
8239                 object ICloneable.Clone ()  {
8240                 }
8241         }
8242
8243         Would produce a method called `ICloneable.Clone' instead of
8244         `System.ICloneable.Clone'.
8245
8246         * namespace.cs (Alias.Resolve): Use GetPartialName.
8247         
8248 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8249
8250         * cs-parser.jay: Add error 1055 report.
8251
8252 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8253
8254         * assign.cs (Assign.DoResolve): Only do the transform of
8255         assignment into a New if the types are compatible, if not, fall
8256         through and let the implicit code deal with the errors and with
8257         the necessary conversions. 
8258
8259 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8260
8261         * cs-parser.jay: Add error 1031 report.
8262
8263         * cs-tokenizer.cs: Add location for error 1038.
8264
8265 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8266
8267         * cs-parser.jay: Add error 1016 report.
8268
8269 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8270
8271         * cs-parser.jay: Add errors 1575,1611 report.
8272
8273 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8274
8275         * cs-parser.jay: Add error 1001 report.
8276
8277 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8278
8279         Fix #68850
8280         * attribute.cs (GetMarshal): Add method argument for
8281         caller identification.
8282
8283         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8284         agument for GetMarshal and RuntimeMissingSupport.
8285
8286 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8287
8288         * attribute.cs (ExtractSecurityPermissionSet): Removed
8289         TypeManager.code_access_permission_type.
8290
8291         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8292
8293 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8294
8295         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8296         for obsolete use of a variable here.   Fixes regression on errors
8297         cs0619-25 and cs0619-26.
8298
8299 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8300
8301         Fix #62358, implemented security attribute encoding.
8302
8303         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8304         Tests permitted SecurityAction for assembly or other types.
8305         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8306         data from SecurityPermissionAttribute to PermisionSet class.
8307
8308         * class.cs (ApplyAttributeBuilder): Added special handling
8309         for System.Security.Permissions.SecurityAttribute based types.
8310
8311         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8312         special handling for System.Security.Permissions.SecurityAttribute
8313         based types.
8314
8315         * enum.cs (ApplyAttributeBuilder): Added special handling
8316         for System.Security.Permissions.SecurityAttribute based types.
8317
8318         * parameter.cs (ApplyAttributeBuilder): Added special handling
8319         for System.Security.Permissions.SecurityAttribute based types.
8320
8321         * rootcontext.cs: Next 2 core types.
8322
8323         * typemanager.cs (TypeManager.security_permission_attr_type):
8324         Built in type for the SecurityPermission Attribute.
8325         (code_access_permission_type): Build in type.
8326
8327 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8328
8329         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8330         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8331         all of this information into
8332         EmitContext.EmitCapturedVariableInstance.
8333         
8334         * codegen.cs (EmitCapturedVariableInstance): move here the
8335         funcionality of emitting an ldarg.0 in the presence of a
8336         remapping.   This centralizes the instance emit code.
8337
8338         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8339         then emit a load of this: it means that we have reached the
8340         topmost ScopeInfo: the one that contains the pointer to the
8341         instance of the class hosting the anonymous method.
8342
8343         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8344         captures to the topmost CaptureContext.
8345
8346 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8347
8348         * expression.cs (LocalVariableReference): Move the knowledge about
8349         the iterators into codegen's EmitCapturedVariableInstance.
8350
8351 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8352
8353         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8354         all code paths return a value from an anonymous method (it is the
8355         same as the 161 error, but for anonymous methods).
8356
8357 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8358
8359         The introduction of anonymous methods in the compiler changed
8360         various ways of doing things in the compiler.  The most
8361         significant one is the hard split between the resolution phase
8362         and the emission phases of the compiler.
8363
8364         For instance, routines that referenced local variables no
8365         longer can safely create temporary variables during the
8366         resolution phase: they must do so from the emission phase,
8367         since the variable might have been "captured", hence access to
8368         it can not be done with the local-variable operations from the runtime.
8369         
8370         * statement.cs 
8371
8372         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8373         is a toplevel block.
8374
8375         (ToplevelBlock): A new kind of Block, these are the blocks that
8376         are created by the parser for all toplevel method bodies.  These
8377         include methods, accessors and anonymous methods.
8378
8379         These contain some extra information not found in regular blocks:
8380         A pointer to an optional CaptureContext (for tracking captured
8381         local variables and parameters).  A pointer to the parent
8382         ToplevelBlock.
8383         
8384         (Return.Resolve): Catch missmatches when returning a value from an
8385         anonymous method (error 1662).
8386         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8387         phase.
8388
8389         (Break.Resolve): ditto.
8390
8391         (SwitchLabel): instead of defining the labels during the
8392         resolution phase, we now turned the public ILLabel and ILLabelCode
8393         labels into methods called GetILLabelCode() and GetILLabel() that
8394         only define the label during the Emit phase.
8395
8396         (GotoCase): Track the SwitchLabel instead of the computed label
8397         (its contained therein).  Emit the code by using
8398         SwitchLabel.GetILLabelCode ().
8399
8400         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8401         whether the Local has been captured or not.
8402
8403         (LocalInfo.IsCaptured): New property, used to tell whether the
8404         local has been captured.
8405         
8406         * anonymous.cs: Vastly updated to contain the anonymous method
8407         support.
8408
8409         The main classes here are: CaptureContext which tracks any
8410         captured information for a toplevel block and ScopeInfo used to
8411         track the activation frames for various local variables.   
8412
8413         Each toplevel block has an optional capture context associated
8414         with it.  When a method contains an anonymous method both the
8415         toplevel method and the anonymous method will create a capture
8416         context.   When variables or parameters are captured, they are
8417         recorded on the CaptureContext that owns them, for example:
8418
8419         void Demo () {
8420              int a;
8421              MyDelegate d = delegate {
8422                  a = 1;
8423              }
8424         }
8425
8426         Here `a' will be recorded as captured on the toplevel
8427         CapturedContext, the inner captured context will not have anything
8428         (it will only have data if local variables or parameters from it
8429         are captured in a nested anonymous method.
8430
8431         The ScopeInfo is used to track the activation frames for local
8432         variables, for example:
8433
8434         for (int i = 0; i < 10; i++)
8435                 for (int j = 0; j < 10; j++){
8436                    MyDelegate d = delegate {
8437                         call (i, j);
8438                    }
8439                 }
8440
8441         At runtime this captures a single captured variable `i', but it
8442         captures 10 different versions of the variable `j'.  The variable
8443         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8444         recorded on a child.  
8445
8446         The toplevel ScopeInfo will also track information like the `this'
8447         pointer if instance variables were referenced (this is necessary
8448         as the anonymous method lives inside a nested class in the host
8449         type of the method). 
8450
8451         (AnonymousMethod): Expanded to track the Toplevel, implement
8452         `AnonymousMethod.Compatible' to tell whether an anonymous method
8453         can be converted to a target delegate type. 
8454
8455         The routine now also produces the anonymous method content
8456
8457         (AnonymousDelegate): A helper class that derives from
8458         DelegateCreation, this is used to generate the code necessary to
8459         produce the delegate for the anonymous method that was created. 
8460
8461         * assign.cs: API adjustments for new changes in
8462         Convert.ImplicitStandardConversionExists.
8463
8464         * class.cs: Adjustments to cope with the fact that now toplevel
8465         blocks are of type `ToplevelBlock'. 
8466
8467         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8468         insteda of standard blocks.
8469
8470         Flag errors if params arguments are passed to anonymous methods.
8471
8472         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8473         `CurrentAnonymousMethod' which points to the current Anonymous
8474         Method.  The variable points to the AnonymousMethod class that
8475         holds the code being compiled.  It is set in the new EmitContext
8476         created for the anonymous method.
8477
8478         (EmitContext.Phase): Introduce a variable and an enumeration to
8479         assist in enforcing some rules about when and where we are allowed
8480         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8481         only one that enfonces this right now).
8482
8483         (EmitContext.HaveCaptureInfo): new helper method that returns
8484         whether we have a CapturedContext initialized.
8485
8486         (EmitContext.CaptureVariable): New method used to register that a
8487         LocalInfo must be flagged for capturing. 
8488
8489         (EmitContext.CapturedParameter): New method used to register that a
8490         parameters must be flagged for capturing. 
8491         
8492         (EmitContext.CapturedField): New method used to register that a
8493         field must be flagged for capturing. 
8494
8495         (EmitContext.HaveCapturedVariables,
8496         EmitContext.HaveCapturedFields): Return whether there are captured
8497         variables or fields. 
8498
8499         (EmitContext.EmitMethodHostInstance): This is used to emit the
8500         instance for the anonymous method.  The instance might be null
8501         (static methods), this (for anonymous methods that capture nothing
8502         and happen to live side-by-side with the current method body) or a
8503         more complicated expression if the method has a CaptureContext.
8504
8505         (EmitContext.EmitTopBlock): Routine that drives the emission of
8506         code: it will first resolve the top block, then emit any metadata
8507         and then emit the code.  The split is done so that we can extract
8508         any anonymous methods and flag any captured variables/parameters.
8509         
8510         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8511         during this phase, the ILGenerator should not be used as labels
8512         and local variables declared here might not be accessible to any
8513         code that is part of an anonymous method.  
8514
8515         Exceptions to this include the temporary variables that are
8516         created by some statements internally for holding temporary
8517         variables. 
8518         
8519         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8520         metadata for a cb
8521
8522         (EmitContext.TemporaryReturn): This method is typically called
8523         from the Emit phase, and its the only place where we allow the
8524         ReturnLabel to be defined other than the EmitMeta.  The reason is
8525         that otherwise we would have to duplicate a lot of logic in the
8526         Resolve phases of various methods that today is on the Emit
8527         phase. 
8528
8529         (EmitContext.NeedReturnLabel): This no longer creates the label,
8530         as the ILGenerator is not valid during the resolve phase.
8531
8532         (EmitContext.EmitThis): Extended the knowledge in this class to
8533         work in anonymous methods in addition to iterators. 
8534
8535         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8536         code is necessary on the stack to access the instance to a local
8537         variable (the variable will be accessed as a field).
8538
8539         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8540         EmitContext.EmitAddressOfParameter): Routines to support
8541         parameters (not completed at this point). 
8542         
8543         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8544         will also remove the parameters.
8545
8546         * convert.cs (Convert): Define a `ConstantEC' which points to a
8547         null.  This is just to prefity some code that uses
8548         ImplicitStandardConversion code and do not have an EmitContext
8549         handy.
8550
8551         The idea is to flag explicitly that at that point in time, it is
8552         known that the conversion will not trigger the delegate checking
8553         code in implicit conversions (which requires a valid
8554         EmitContext). 
8555
8556         Everywhere: pass new EmitContext parameter since
8557         ImplicitStandardConversionExists now requires it to check for
8558         anonymous method conversions. 
8559
8560         (Convert.ImplicitStandardConversionExists): If the type of an
8561         expression is the anonymous_method_type, and the type is a
8562         delegate, we invoke the AnonymousMethod.Compatible method to check
8563         whether an implicit conversion is possible. 
8564
8565         (Convert.ImplicitConversionStandard): Only do implicit method
8566         group conversions if the language level is not ISO_1.
8567
8568         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8569         MethodInfo for the Invoke method.  used by Delegate and
8570         AnonymousDelegate.
8571
8572         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8573         method conversions if the target type is a delegate.
8574
8575         Removed extra debugging nops.
8576
8577         (LocalVariableReference): Turn the `local_info' into a public
8578         field. 
8579
8580         Add `prepared' field, the same hack used for FieldExprs to cope
8581         with composed assignments, as Local variables do not necessarily
8582         operate purely on the stack as they used to: they can be captured
8583         fields. 
8584
8585         Add `temp' for a temporary result, like fields.
8586
8587         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8588
8589         It now copes with Local variables that are captured and emits the
8590         proper instance variable to load it from a field in the captured
8591         case. 
8592
8593         (ParameterReference.DoResolveBase): During the resolve phase,
8594         capture parameters if we are in an anonymous method.
8595
8596         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8597         anonymous method, use the EmitContext helper routines to emit the
8598         parameter reference.
8599
8600         * iterators.cs: Set RemapToProxy to true/false during the
8601         EmitDispose class.
8602
8603         * parameters.cs (GetParameterByName): New helper method. 
8604
8605         * typemanager.cs (anonymous_method_type) a new type that
8606         represents an anonyous method.  This is always an internal type,
8607         used as a fencepost to test against the anonymous-methodness of an
8608         expression. 
8609         
8610 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8611
8612         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8613         561 report.
8614         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8615
8616 2004-10-18  Martin Baulig  <martin@ximian.com>
8617
8618         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8619         `Type' directly, but call ResolveType() on it.
8620         (Catch.Resolve): Likewise.
8621         (Foreach.Resolve): Likewise.
8622
8623 2004-10-18  Martin Baulig  <martin@ximian.com>
8624
8625         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8626         `Type' directly, but call ResolveType() on it.
8627         (Probe.DoResolve): Likewise.
8628         (ArrayCreation.LookupType): Likewise.
8629         (TypeOf.DoResolve): Likewise.
8630         (SizeOf.DoResolve): Likewise.
8631
8632 2004-10-18  Martin Baulig  <martin@ximian.com>
8633
8634         * expression.cs (Invocation.BetterFunction): Put back
8635         TypeManager.TypeToCoreType().
8636
8637 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8638
8639         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8640         the ResolveType.
8641
8642 2004-10-18  Martin Baulig  <martin@ximian.com>
8643
8644         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
8645         `Type' directly, but call ResolveType() on it.
8646
8647 2004-10-18  Martin Baulig  <martin@ximian.com>
8648
8649         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8650         `Type' directly, but call ResolveType() on it.
8651         (MemberBase.DoDefine): Likewise.
8652
8653         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8654         `Type' directly, but call ResolveType() on it.
8655         (ComposedCast.DoResolveAsTypeStep): Likewise.
8656
8657         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8658         `Type' directly, but call ResolveType() on it.
8659
8660 2004-10-17  John Luke  <john.luke@gmail.com>
8661
8662         * class.cs (Operator.GetSignatureForError): use CSharpName
8663
8664         * parameter.cs (Parameter.GetSignatureForError): Returns
8665         correct name even if was not defined.
8666
8667 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8668
8669         Fix #65816.
8670         * class.cs (TypeContainer.EmitContext): New property.
8671         (DefineNestedTypes): Create an emitcontext for each part.
8672         (MethodCore.DoDefineParameters): Use container's emitcontext.
8673         Pass type array to InternalParameters.
8674         (MemberBase.DoDefine): Use container's emitcontext.
8675         (FieldMember.Define): Likewise.
8676         (Event.Define): Likewise.
8677         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8678         Pass type array to InternalParameters.
8679         (SetIndexerMethod.GetParameterInfo): Likewise.
8680         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8681         * delegate.cs (Define): Pass emitcontext to
8682         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8683         array to InternalParameters.
8684         * expression.cs (ParameterReference.DoResolveBase): Pass
8685         emitcontext to GetParameterInfo.
8686         (ComposedCast.DoResolveAsTypeStep): Remove check on
8687         ec.ResolvingTypeTree.
8688         * parameter.cs (Parameter.Resolve): Change argument to
8689         EmitContext.  Use ResolveAsTypeTerminal.
8690         (Parameter.GetSignature): Change argument to EmitContext.
8691         (Parameters.ComputeSignature): Likewise.
8692         (Parameters.ComputeParameterTypes): Likewise.
8693         (Parameters.GetParameterInfo): Likewise.
8694         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8695         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8696         * support.cs (InternalParameters..ctor): Remove variant that takes
8697         a DeclSpace.
8698         * typemanager.cs (system_intptr_expr): New.
8699         (InitExpressionTypes): Initialize it.
8700
8701 2004-10-12  Chris Toshok  <toshok@ximian.com>
8702
8703         * cs-parser.jay: fix location for try_statement and catch_clause.
8704
8705 2004-10-11  Martin Baulig  <martin@ximian.com>
8706
8707         * report.cs: Don't make --fatal abort on warnings, we have
8708         -warnaserror for that.
8709
8710 2004-10-07  Raja R Harinath  <rharinath@novell.com>
8711
8712         More DeclSpace.ResolveType avoidance.
8713         * decl.cs (MemberCore.InUnsafe): New property.
8714         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
8715         with newly created EmitContext.
8716         (FieldMember.Define): Likewise.
8717         * delegate.cs (Delegate.Define): Likewise.
8718         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8719         only if normal name-lookup fails.
8720         (TypeExpr.DoResolve): Enable error-checking.
8721         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8722         (SizeOf.DoResolve): Likewise.
8723         (ComposedCast.DoResolveAsTypeStep): Likewise.
8724         (StackAlloc.DoResolve): Likewise.
8725         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8726         (Block.Unsafe): New property.
8727         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8728         (Unsafe): Set 'unsafe' flag of contained block.
8729         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8730         (Fixed.Resolve): Likewise.
8731         (Catch.Resolve): Likewise.
8732         (Using.ResolveLocalVariableDecls): Likewise.
8733         (Foreach.Resolve): Likewise.
8734
8735 2004-10-05  John Luke <john.luke@gmail.com>
8736
8737         * cs-parser.jay: add location to error CS0175
8738
8739 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8740
8741         * ecore.cs (Expression.Constantity): Add support for turning null
8742         into a constant.
8743
8744         * const.cs (Const.Define): Allow constants to be reference types
8745         as long as the value is Null.
8746
8747 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8748
8749         * namespace.cs (NamespaceEntry.Using): No matter which warning
8750         level is set, check if this namespace name has already been added.
8751
8752 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8753
8754         * expression.cs: reftype [!=]= null should always use br[true,false].
8755         # 67410
8756
8757 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8758
8759         Fix #67108
8760         * attribute.cs: Enum conversion moved to 
8761         GetAttributeArgumentExpression to be applied to the all
8762         expressions.
8763
8764 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8765
8766         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8767         * class.c (TypeContainer.DefineType): Flag error if
8768         base types aren't accessible due to access permissions.
8769         * decl.cs (DeclSpace.ResolveType): Move logic to
8770         Expression.ResolveAsTypeTerminal.
8771         (DeclSpace.ResolveTypeExpr): Thin layer over
8772         Expression.ResolveAsTypeTerminal.
8773         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8774         Refactor code into NestedAccess.  Use it.
8775         (DeclSpace.NestedAccess): New.
8776         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8777         argument to silence errors.  Check access permissions.
8778         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8779         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8780         (Cast.DoResolve): Likewise.
8781         (New.DoResolve): Likewise.
8782         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8783         (TypeOf.DoResolve): Likewise.
8784
8785         * expression.cs (Invocation.BetterConversion): Return the Type of
8786         the better conversion.  Implement section 14.4.2.3 more faithfully.
8787         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8788         section 14.4.2.2 explicit.
8789         (Invocation.OverloadResolve): Update.
8790         (Invocation): Remove is_base field.
8791         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8792         (Invocation.Emit): Likewise.
8793
8794 2004-09-27  Raja R Harinath  <rharinath@novell.com>
8795
8796         * README: Update to changes.
8797
8798 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8799
8800         * cs-parser.jay: Reverted 642 warning fix.
8801
8802 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8803
8804         Fix bug #66615
8805         * decl.cs (FindMemberWithSameName): Indexer can have more than
8806         1 argument.
8807
8808 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8809
8810         * expression.cs (LocalVariableReference.DoResolveLValue):
8811         Do not report warning 219 for out values.
8812         (EmptyExpression.Null): New member to avoid extra allocations.
8813
8814 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8815
8816         * cs-parser.jay: Fix wrong warning 642 report.
8817
8818         * cs-tokenizer.cs (CheckNextToken): New helper;
8819         Inspect next character if is same as expected.
8820
8821 2004-09-23  Martin Baulig  <martin@ximian.com>
8822
8823         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8824         (Convert.ImplicitReferenceConversionExists): Likewise.
8825
8826 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8827
8828         * class.cs (Operator.Define): Add error 448 and 559 report.
8829
8830 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8831
8832         * class.cs (MemberBase.IsTypePermitted): New protected
8833         method for checking error CS0610.
8834
8835 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8836
8837         * class.cs (TypeContainer.HasExplicitLayout): New property
8838         Returns whether container has StructLayout attribute set Explicit.
8839         (FieldMember): New abstract class for consts and fields.
8840         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8841         (Field): Reuse FieldMember.
8842
8843         * const.cs (Const): Reuse FieldMember.
8844
8845         * rootcontext.cs: EmitConstants call moved to class.
8846
8847 2004-09-22  Martin Baulig  <martin@ximian.com>
8848
8849         Thanks to Peter Sestoft for this bug report.
8850
8851         * expression.cs (Conditional): If both the `trueExpr' and the
8852         `falseExpr' is a NullLiteral, return a NullLiteral.
8853
8854 2004-09-22  Martin Baulig  <martin@ximian.com>
8855
8856         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8857         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8858         for the "get_Current" call.
8859
8860 2004-09-22  Martin Baulig  <martin@ximian.com>
8861
8862         Marek and me just fixed one of our oldest bugs: #28562 :-)
8863
8864         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8865
8866         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8867         we're an EnumConstant, just return that.
8868         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8869         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8870         to get the value which'll actually be written into the attribute.
8871         However, we have to use GetValue() to access the attribute's value
8872         in the compiler.        
8873
8874 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8875
8876         * constant.cs (Constant.IsNegative): New abstract property
8877         IsNegative.
8878
8879         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8880         (StackAlloc.DoResolve): Reused IsNegative.
8881
8882 2004-09-21  Martin Baulig  <martin@ximian.com>
8883
8884         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8885         if we're used in an iterator, we may be called from different
8886         methods.
8887
8888         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8889         we actually have an exception block.
8890
8891 2004-09-20  John Luke <jluke@cfl.rr.com>
8892
8893         * class.cs, cs-parser.jay: Improve the error report for 1520:
8894         report the actual line where the error happens, not where the
8895         class was declared.
8896
8897         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8898         Pass location information that was available elsewhere.
8899
8900 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
8901
8902         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8903         runtime to delay sign assemblies.
8904
8905 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8906
8907         * cs-parser.jay: Do not report the stack trace, this is barely
8908         used nowadays.
8909
8910 2004-08-22  John Luke  <john.luke@gmail.com>
8911  
8912         * driver.cs : check that a resource id is not already used
8913         before adding it, report CS1508 if it is, bug #63637
8914
8915 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8916
8917         * ecore.cs: Removed dead code.
8918
8919 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
8920
8921         * class.cs: Do not report warning CS0067 on the interfaces.
8922
8923 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8924
8925         * cs-parser.jay: Add error 504 report.
8926
8927 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8928
8929         * rootcontext.cs: WarningLevel is 4 by default now.
8930
8931         * statement.cs (Fixed.Resolve): Do not null
8932         VariableInfo.
8933
8934 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8935
8936         Fixed bug #55780
8937         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8938         deep search when property is not virtual.
8939         (PropertyExpr.ResolveAccessors): Make one call for both
8940         accessors.
8941
8942 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8943
8944         Fixed bug #65766
8945         * statement.cs: Error 152 report constains also location.
8946
8947 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8948
8949         Fixed bug #65766
8950         * const.cs: Explicitly set constant as static.
8951
8952 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8953
8954         Fixed bug #64226
8955         * cs-parser.jay: Add error 1017 report.
8956
8957 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8958
8959         Fixed bug #59980, #64224
8960         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8961
8962         * typemanager.cs (IsSpecialMethod): Simplified
8963
8964 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8965
8966         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8967         condition with better params.
8968
8969 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8970
8971         Fixed bug #65238
8972         * attribute.cs (Resolve): Property has to have both
8973         accessors.
8974
8975 2004-09-14  Martin Baulig  <martin@ximian.com>
8976
8977         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8978
8979 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8980
8981         Fixed bug #61902
8982         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8983         called and is obsolete then this member suppress message
8984         when call is inside next [Obsolete] method or type.
8985
8986         * expression.cs: Use TestObsoleteMethodUsage member.
8987
8988 2004-09-14  Martin Baulig  <martin@ximian.com>
8989
8990         * cs-parser.jay: Sync a bit with the GMCS version.
8991
8992 2004-09-14  Martin Baulig  <martin@ximian.com>
8993
8994         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8995         (CSharpParser.yacc_verbose_flag): New public field.
8996
8997         * genericparser.cs: Removed.
8998
8999 2004-09-14  Raja R Harinath  <rharinath@novell.com>
9000
9001         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
9002
9003 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9004
9005         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9006
9007 2004-09-10  Martin Baulig  <martin@ximian.com>
9008
9009         Backported my MemberName changes from GMCS into MCS.
9010
9011         - we are now using a special `MemberName' class instead of using
9012         strings; in GMCS, the `MemberName' also contains the type
9013         arguments.
9014
9015         - changed the grammar rules a bit:
9016           * the old `member_name' is now a `namespace_or_type_name':
9017             The rule is that we use `namespace_or_type_name' everywhere
9018             where we expect either a "member name" (GetEnumerator) or a
9019             "member name" with an explicit interface name
9020             (IEnumerable.GetEnumerator).
9021             In GMCS, the explicit interface name may include type arguments
9022             (IEnumerable<T>.GetEnumerator).
9023           * we use `member_name' instead of just `IDENTIFIER' for
9024             "member names":
9025             The rule is that we use `member_name' wherever a member may
9026             have type parameters in GMCS.       
9027
9028         * decl.cs (MemberName): New public class.
9029         (MemberCore.MemberName): New public readonly field.
9030         (MemberCore.ctor): Take a `MemberName' argument, not a string.
9031         (DeclSpace): Likewise.
9032
9033         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
9034         * enum.cs (Enum.ctor): Likewise.
9035
9036         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
9037         MemberName.     
9038         (AliasEntry.ctor): Take a MemberName, not an Expression.
9039         (AliasEntry.UsingAlias): Likewise.
9040
9041         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
9042         (IMethodData.MemberName): Changed type from string to MemberName.
9043         (MemberBase.ExplicitInterfaceName): Likewise.
9044         (AbstractPropertyEventMethod.SetupName): Make this private.
9045         (AbstractPropertyEventMethod.ctor): Added `string prefix'
9046         argument; compute the member name here.
9047         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
9048         on the `member.MemberName' and the `prefix'.
9049
9050         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
9051         not `type_name'.
9052         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
9053         thus, we get a `MemberName' instead of a `string'.  These
9054         declarations may have type parameters in GMCS.
9055         (interface_method_declaration, delegate_declaration): Likewise.
9056         (class_declaration, interface_declaration): Likewise.
9057         (method_header): Use `namespace_or_type_name' instead of
9058         `member_name'.  We may be an explicit interface implementation.
9059         (property_declaration, event_declaration): Likewise.
9060         (member_name): This is now just an `IDENTIFIER', not a
9061         `namespace_or_type_name'.
9062         (type_name, interface_type): Removed.
9063         (namespace_or_type_name): Return a MemberName, not an Expression.
9064         (primary_expression): Use `member_name' instead of `IDENTIFIER';
9065         call GetTypeExpression() on the MemberName to get an expression.
9066         (IndexerDeclaration.interface_type): Changed type from string to
9067         MemberName.
9068         (MakeName): Operate on MemberName's instead of string's.
9069
9070 2004-09-13  Raja R Harinath  <rharinath@novell.com>
9071
9072         Fix bug #55770.
9073         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
9074         (NamespaceEntry.Lookup): Add new argument to flag if we want the
9075         lookup to avoid symbols introduced by 'using'.
9076         * rootcontext.cs (NamespaceLookup): Update.
9077
9078 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9079
9080         * class.cs (TypeContainer.DoDefineMembers): Do not call
9081         DefineDefaultConstructor for static classes.
9082
9083 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9084
9085         * attribute.cs (Attribute.Resolve): Add error 653 report.
9086
9087         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9088         report.
9089         (Method.ApplyAttributeBuilder): Add error 685 report.
9090         (Operator.Define): Add error 564 report.
9091
9092         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9093
9094         * expression.cs (Invocation.DoResolve): Add error
9095         245 and 250 report.
9096
9097         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9098         error 674 report.
9099
9100 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9101
9102         * class.cs (ConstructorInitializer.Resolve):
9103         Wrong error number (515->516).
9104
9105 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9106
9107         * class.cs (Indexer.Define): Add error 631 report.
9108
9109 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9110
9111         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9112
9113 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9114
9115         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9116
9117 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9118
9119         * cs-parser.jay: Added error CS0241 report.
9120
9121 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9122
9123         * cs-parser.jay (fixed_statement): Introduce a scope for the
9124         declaration in the 'fixed' statement.
9125
9126 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9127
9128         * cs-parser.jay: Added CS0230 error report.
9129
9130 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9131
9132         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9133
9134 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9135
9136         * expression.cs (Argument.Resolve): Added error CS0192 and
9137         CS0199 report.
9138
9139 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9140
9141         C# 2.0 #pragma warning feature
9142
9143         * cs-tokenizer.cs (PreProcessPragma): New method; 
9144         Handles #pragma directive.
9145
9146         * report.cs (WarningRegions): New class; Support
9147         class for #pragma warning directive. It tests whether
9148         warning is enabled for a given line.
9149
9150 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9151
9152         * const.cs: Add more descriptive error report, tahnks to
9153         Sebastien. 
9154
9155 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9156
9157         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9158
9159 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9160
9161         * expression.cs: Apply patch from Ben: Remove dead code from
9162         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9163         as that code just threw an exception anwyays.
9164
9165         * const.cs: Remove the call to the turnintoconstant, for details
9166         see bug: #63144
9167         
9168         * literal.cs: The type of the null-literal is the null type;  So
9169         we use a placeholder type (literal.cs:System.Null, defined here)
9170         for it.
9171
9172         * expression.cs (Conditional.DoResolve): Remove some old code that
9173         is no longer needed, conversions have been fixed.
9174
9175         (ArrayCreationExpression.DoResolve): Return false if we fail to
9176         resolve the inner expression.
9177
9178 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9179
9180         Fix test-290.cs.
9181         * cs-parser.jay (delegate_declaration): Record a delegate
9182         declaration as a type declaration.
9183         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9184
9185 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9186
9187         * parameter.cs: Do not crash if the type can not be resolved. 
9188
9189         * expression.cs: Report errors with unsafe pointers, fixes #64896
9190
9191 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9192
9193         * expression.cs: Pointer arith always needs to do a conv.i
9194         if the operand is a long. fix 65320
9195
9196 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9197
9198         Fixed cs0619-37.cs, cs0619-38.cs
9199
9200         * enum.cs (GetObsoleteAttribute): Removed.
9201
9202         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9203         on Enum member is double staged. The first is tested member
9204         and then enum.
9205
9206 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9207
9208         Fixed #56986, #63631, #65231
9209
9210         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9211         adds member to name container.
9212         (TypeContainer.AddToTypeContainer): New method, adds type to
9213         name container.
9214         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9215         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9216         AddOperator): Simplified by reusing AddToMemberContainer.
9217         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9218         instead of field.
9219         (Method.CheckForDuplications): Fixed implementation to test all
9220         possibilities.
9221         (MemberBase): Detection whether member is explicit interface
9222         implementation is now in constructor.
9223         (MemberBase.UpdateMemberName): Handles IndexerName.
9224         (Accessor): Changed to keep also location information.
9225         (AbstractPropertyEventMethod): Is derived from MemberCore.
9226         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9227         will be emited or not.
9228         (PropertyBase.AreAccessorsDuplicateImplementation):
9229         Tests whether accessors are not in collision with some method.
9230         (Operator): Is derived from MethodCore to simplify common
9231         operations.
9232
9233         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9234         must be performed.
9235         (DeclSpace.AddToContainer): Adds the member to defined_names
9236         table. It tests for duplications and enclosing name conflicts.
9237
9238         * enum.cs (EnumMember): Clean up to reuse the base structures
9239
9240 2004-09-03  Martin Baulig  <martin@ximian.com>
9241
9242         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9243         into TypeContainer, to make partial classes work again.
9244
9245 2004-09-03  Martin Baulig  <martin@ximian.com>
9246
9247         * rootcontext.cs (RootContext.V2): Removed.
9248
9249 2004-03-23  Martin Baulig  <martin@ximian.com>
9250
9251         * expression.cs (Invocation.OverloadResolve): Added `bool
9252         may_fail' argument and use it instead of the Location.IsNull() hack.
9253
9254 2004-09-03  Martin Baulig  <martin@ximian.com>
9255
9256         Merged latest changes into gmcs.  Please keep this comment in
9257         here, it makes it easier for me to see what changed in MCS since
9258         the last time I merged.
9259
9260 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9261
9262         Fix #61128.
9263         * expression.cs (BetterConversion): Don't allow either conversion 
9264         to be null.  Remove redundant implicit conversion test when 'q ==
9265         null' -- when this function is invoked, we already know that the
9266         implicit conversion exists.
9267         (BetterFunction): Assume that 'best' is non-null.  Remove
9268         redundant reimplementation of IsApplicable when 'best' is null.
9269         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9270         number of arguments.
9271         (IsAncestralType): Extract from OverloadResolve.
9272         (OverloadResolve): Make robust to the MethodGroupExpr being
9273         unsorted.  Implement all the logic of Section 14.5.5.1, and
9274         support overloading of methods from multiple applicable types.
9275         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9276
9277         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9278         (RealError, Warning): Append type of report to related symbol.
9279
9280 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9281
9282         * enum.cs: Fixed CLS-Compliance checks for enum members.
9283         Error tests cs3008-8.cs, cs3014-8.cs
9284
9285 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9286
9287         Fixed bug #62342, #63102
9288         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9289         like ImplementMethod.
9290
9291 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9292
9293         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9294         Fixed bug #65170.
9295
9296 2004-09-02  Martin Baulig  <martin@ximian.com>
9297
9298         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9299         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9300         on the MethodBase.
9301
9302 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9303
9304         C# 2.0 Static classes implemented
9305
9306         * class.cs (TypeContainer): instance_constructors,
9307         initialized_fields, initialized_static_fields,
9308         default_constructor, base_inteface_types are protected to be
9309         accessible from StaticClass.
9310         (TypeContainer.DefineDefaultConstructor): New virtual method
9311         for custom default constructor generating
9312         (StaticClass): New class to handle "Static classes" feature.
9313
9314         * cs-parser.jay: Handle static keyword on class like instance
9315         of StaticClass.
9316
9317         * driver.cs: Added "/langversion" command line switch with two
9318         options (iso-1, default).
9319
9320 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9321
9322         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9323
9324 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9325
9326         * delegate.cs: Style.
9327
9328 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9329
9330         * delegate.cs: Add seperate instance expr field for miguel.
9331
9332 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9333
9334         * PointerArithmetic (Resolve): make sure we are not doing
9335         pointer arith on void*. Also, make sure we are resolved
9336         by not setting eclass until resolve.
9337
9338         All callers: Make sure that PointerArithmetic gets resolved.
9339
9340 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9341
9342         * ArrayCreation (LookupType): If the type does not resolve 
9343         to an array, give an error.
9344
9345 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9346
9347         * statement.cs (Try.Resolve): Fixed bug #64222
9348
9349 2004-08-27  Martin Baulig  <martin@ximian.com>
9350
9351         * class.cs
9352         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9353         crash here.     
9354
9355 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9356
9357         * ecore.cs (Constantify): Get underlying type via
9358         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9359         Windows in special cases.
9360
9361 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9362
9363         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9364         for obtaining also private methods.
9365         (GetRemoveMethod): Used GetRemoveMethod (true)
9366         for obtaining also private methods.
9367
9368 2004-08-24  Martin Baulig  <martin@ximian.com>
9369
9370         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9371         MethodAttributes.HideBySig for operators.
9372
9373 2004-08-23  Martin Baulig  <martin@ximian.com>
9374
9375         Back to the old error reporting system :-)
9376
9377         * report.cs (Message): Removed.
9378         (Report.MessageData, ErrorData, WarningData): Removed.
9379         (Report.Error, Warning): Back to the old system.
9380
9381 2004-08-23  Martin Baulig  <martin@ximian.com>
9382
9383         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9384
9385         * class.cs (TypeContainer.ParentContainer): New public virtual
9386         method; replaces the explicit interface implementation.
9387         (ClassPart.ParentContainer): Override.
9388
9389 2004-08-23  Martin Baulig  <martin@ximian.com>
9390
9391         * statement.cs (Switch): Added support for constant switches; see
9392         #59428 or test-285.cs.
9393
9394 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9395
9396         Fixed bug #62740.
9397         * statement.cs (GetEnumeratorFilter): Removed useless
9398         logic because C# specs is strict. GetEnumerator must be
9399         public.
9400
9401 2004-08-22  Martin Baulig  <martin@ximian.com>
9402
9403         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9404         a switch and may break, reset the barrier.  Fixes #59867.
9405
9406 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9407
9408         CLS-Compliance speed up (~5% for corlib)
9409
9410         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9411         New method. Tests container for CLS-Compliant names
9412
9413         * class.cs (TypeContainer.VerifyClsName): New method.
9414         Checks whether container name is CLS Compliant.
9415         (Constructor): Implements IMethodData.
9416
9417         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9418         low-case table for CLS Compliance test.
9419         (MemberCache.VerifyClsParameterConflict): New method.
9420         Checks method parameters for CS3006 error.
9421
9422         * enum.cs (EnumMember): Is derived from MemberCore.
9423         (Enum.VerifyClsName): Optimized for better performance.
9424
9425 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9426
9427         * report.cs: Renamed Error_T to Error and changed all
9428         references.
9429
9430 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9431
9432         * class.cs (TypeContainer.IndexerArrayList): New inner class
9433         container for indexers.
9434         (TypeContainer.DefaultIndexerName): New constant for default
9435         indexer name. Replaced all "Item" with this constant.
9436         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9437
9438         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9439         DefaultMemberAttribute constructor.
9440
9441 2004-08-05  Martin Baulig  <martin@ximian.com>
9442
9443         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9444         Fix bug #59429.
9445
9446 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9447
9448         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9449         multi platforms problem.
9450
9451         * compiler.csproj: Included shared files.
9452
9453 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9454
9455         Fix bug 60333, 55971 in the more general way
9456         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9457         Added arg_type argument for constant conversion.
9458         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9459
9460 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9461
9462         Fix bug #59760
9463         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9464         OperatorArrayList, MethodCoreArrayList for typecontainer
9465         containers. Changed class member types to these new types.
9466         (MethodArrayList.DefineMembers): Added test for CS0659.
9467
9468 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9469
9470         * cfold.cs: Synchronize the folding with the code in expression.cs
9471         Binary.DoNumericPromotions for uint operands.
9472
9473         * attribute.cs: Revert patch from Raja, it introduced a regression
9474         while building Blam-1.2.1 (hard to isolate a test case).
9475
9476 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9477
9478         Fix for #55382
9479         * class.cs:
9480         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9481         name collision.
9482         (MethodCore.parent_method): New member. The method we're overriding
9483         if this is an override method.
9484         (MethodCore.CheckBase): Moved from Method class and made common.
9485         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9486         private.
9487         (MethodCore.CheckForDuplications): New abstract method. For custom
9488         member duplication search in a container
9489         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9490         method and its return type.
9491         (Event.conflict_symbol): New member. Symbol with same name in the
9492         parent class.
9493
9494         * decl.cs:
9495         (MemberCache.FindMemberWithSameName): New method. The method
9496         is looking for conflict with inherited symbols.
9497
9498 2004-08-04  Martin Baulig  <martin@ximian.com>
9499
9500         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9501
9502         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9503
9504 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9505
9506         * report.cs (Message): New enum for better error, warning reference in
9507         the code.
9508         (MessageData): New inner abstract class. It generally handles printing of
9509         error and warning messages.
9510         Removed unused Error, Warning, Message methods.
9511
9512 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9513
9514         Fix for cs0592-8.cs test
9515         * attribute.cs
9516         (Attributable.ValidAttributeTargets): Made public.
9517         (Attribute.ExplicitTarget): New member for explicit target value.
9518         (Attribute.CheckTargets): Now we translate explicit attribute
9519         target to Target here.
9520
9521 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9522
9523         * ecore.cs (MethodGroupExpr): new IsBase property.
9524
9525         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9526
9527         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9528         rather than an instance expr.
9529
9530         (DelegateCreation.Emit): Use the method group rather than
9531         the instance expression. Also, if you have base.Foo as the
9532         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9533
9534         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9535
9536         (NewDelegate.DoResolve): Only check for the existance of Invoke
9537         if the method is going to be needed. Use MethodGroupExpr.
9538
9539         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9540
9541         * expression.cs: For pointer arith., make sure to use
9542         the size of the type, not the size of the pointer to
9543         the type.
9544
9545 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9546
9547         Fix for #60722
9548         * class.cs (Class): Added error CS0502 test.
9549
9550 2004-08-03  John Luke  <jluke@cfl.rr.com>
9551             Raja R Harinath  <rharinath@novell.com>
9552
9553         Fix for #60997.
9554         * attribute.cs (Attribute.complained_before): New flag.
9555         (Attribute.ResolveType, Attribute.Resolve),
9556         (Attribute.DefinePInvokeMethod): Set it.
9557         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9558         
9559 2004-08-03  Martin Baulig  <martin@ximian.com>
9560
9561         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9562         use a user-defined operator; we still need to do numeric
9563         promotions in case one argument is a builtin type and the other
9564         one has an implicit conversion to that type.  Fixes #62322.
9565
9566 2004-08-02  Martin Baulig  <martin@ximian.com>
9567
9568         * statement.cs (LocalInfo.Flags): Added `IsThis'.
9569         (LocalInfo.IsThis): New public property.
9570         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9571
9572 2004-08-01  Martin Baulig  <martin@ximian.com>
9573
9574         * class.cs (TypeContainer.GetClassBases): Don't set the default
9575         here since we may get called from GetPartialBases().
9576         (TypeContainer.DefineType): If GetClassBases() didn't return a
9577         parent, use the default one.
9578
9579 2004-07-30  Duncan Mak  <duncan@ximian.com>
9580
9581         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9582
9583 2004-07-30  Martin Baulig  <martin@ximian.com>
9584
9585         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9586
9587         * class.cs (SourceMethod): New public class, derive from the
9588         symbol writer's ISourceMethod.
9589         (Method): Use the new symbol writer API.
9590
9591         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9592         as argument and use the new symbol writer.
9593
9594         * location.cs
9595         (SourceFile): Implement the symbol writer's ISourceFile.
9596         (Location.SymbolDocument): Removed.
9597         (Location.SourceFile): New public property.
9598
9599         * symbolwriter.cs: Use the new symbol writer API.
9600
9601 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9602
9603         * Makefile (install-local): Remove.  Functionality moved to
9604         executable.make.
9605
9606 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9607
9608         * Makefile: Install mcs.exe.config file together with mcs.exe.
9609         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9610         correct runtime version.
9611         
9612 2004-07-25  Martin Baulig  <martin@ximian.com>
9613
9614         * class.cs
9615         (TypeContainer.RegisterOrder): Removed, this was unused.
9616         (TypeContainer, interface_order): Removed.
9617         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9618         TypeContainer as argument since we can also be called with a
9619         `PartialContainer' for a partial class/struct/interface.
9620         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9621         of checking whether we're an `Interface' - we could be a
9622         `PartialContainer'.
9623         (PartialContainer.Register): Override; call
9624         AddClass()/AddStruct()/AddInterface() on our parent.
9625
9626         * cs-parser.jay (interface_member_declaration): Add things to the
9627         `current_container', not the `current_class'.
9628
9629         * rootcontext.cs (RegisterOrder): The overloaded version which
9630         takes an `Interface' was unused, removed.
9631
9632         * typemanager.cs (TypeManager.LookupInterface): Return a
9633         `TypeContainer', not an `Interface'.
9634         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9635         contain a `PartialContainer' for an interface, so check it's
9636         `Kind' to figure out what it is.
9637
9638 2004-07-25  Martin Baulig  <martin@ximian.com>
9639
9640         * class.cs (Class.DefaultTypeAttributes): New public constant.
9641         (Struct.DefaultTypeAttributes): Likewise.
9642         (Interface.DefaultTypeAttributes): Likewise.
9643         (PartialContainer.TypeAttr): Override this and add the
9644         DefaultTypeAttributes.
9645
9646 2004-07-25  Martin Baulig  <martin@ximian.com>
9647
9648         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9649         we can just use the `Parent' field instead.
9650
9651 2004-07-25  Martin Baulig  <martin@ximian.com>
9652
9653         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9654
9655 2004-07-25  Martin Baulig  <martin@ximian.com>
9656
9657         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9658         our parts before defining any methods.
9659         (TypeContainer.VerifyImplements): Make this virtual.
9660         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9661         on our PartialContainer.
9662
9663 2004-07-25  Martin Baulig  <martin@ximian.com>
9664
9665         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9666
9667         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9668         argument, we can just use the `Parent' field instead.
9669
9670         * class.cs
9671         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9672         (MemberBase.DoDefine): Likewise.
9673
9674 2004-07-24  Martin Baulig  <martin@ximian.com>
9675
9676         * decl.cs (MemberCore.Parent): New public field.
9677         (DeclSpace.Parent): Moved to MemberCore.
9678
9679         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9680         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9681         parent's .ctor.
9682         (FieldBase, Field, Operator): Likewise.
9683         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9684         (EventField, Event): Likewise.
9685
9686 2004-07-23  Martin Baulig  <martin@ximian.com>
9687
9688         * class.cs (PartialContainer): New public class.
9689         (ClassPart): New public class.
9690         (TypeContainer): Added support for partial classes.
9691         (TypeContainer.GetClassBases): Splitted some of the functionality
9692         out into GetNormalBases() and GetPartialBases().
9693
9694         * cs-tokenizer.cs (Token.PARTIAL): New token.
9695         (Tokenizer.consume_identifier): Added some hacks to recognize
9696         `partial', but only if it's immediately followed by `class',
9697         `struct' or `interface'.
9698
9699         * cs-parser.jay: Added support for partial clases.
9700
9701 2004-07-23  Martin Baulig  <martin@ximian.com>
9702
9703         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9704         a `DeclSpace' and also made it readonly.
9705         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9706         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9707         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9708
9709         * cs-parser.jay: Pass the `current_class', not the
9710         `current_container' (at the moment, this is still the same thing)
9711         to a new Method, Property, Event, Indexer or Constructor.
9712
9713 2004-07-23  Martin Baulig  <martin@ximian.com>
9714
9715         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9716         and removed the `current_interface' one.
9717         (struct_declaration, class_declaration, interface_declaration):
9718         Set `current_class' to the newly created class/struct/interface;
9719         set their `Bases' and call Register() before parsing their body.
9720
9721 2004-07-23  Martin Baulig  <martin@ximian.com>
9722
9723         * class.cs (Kind): New public enum.
9724         (TypeContainer): Made this class abstract.
9725         (TypeContainer.Kind): New public readonly field.
9726         (TypeContainer.CheckDef): New public method; moved here from
9727         cs-parser.jay.
9728         (TypeContainer.Register): New public abstract method.
9729         (TypeContainer.GetPendingImplementations): New public abstract
9730         method.
9731         (TypeContainer.GetClassBases): Removed the `is_class' and
9732         `is_iface' parameters.
9733         (TypeContainer.DefineNestedTypes): Formerly known as
9734         DoDefineType().
9735         (ClassOrStruct): Made this class abstract.
9736
9737         * tree.cs (RootTypes): New public type. 
9738
9739 2004-07-20  Martin Baulig  <martin@ximian.com>
9740
9741         * tree.cs (Tree.RecordNamespace): Removed.
9742         (Tree.Namespaces): Removed.
9743
9744         * rootcontext.cs (RootContext.IsNamespace): Removed.
9745
9746         * cs-parser.jay (namespace_declaration): Just create a new
9747         NamespaceEntry here.
9748
9749 2004-07-20  Martin Baulig  <martin@ximian.com>
9750
9751         * statement.cs (ExceptionStatement): New abstract class.  This is
9752         now used as a base class for everyone who's using `finally'.
9753         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9754         our local variables before using them.
9755
9756         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9757         virtual method.  This is used by Yield.Resolve() to "steal" an
9758         outer block's `finally' clauses.
9759         (FlowBranchingException): The .ctor now takes an ExceptionStatement
9760         argument.
9761
9762         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9763         version which takes an ExceptionStatement.  This version must be
9764         used to create exception branchings.
9765
9766         * iterator.cs
9767         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9768         (Iterator.EmitMoveNext): Added exception support; protect the
9769         block with a `fault' clause, properly handle 'finally' clauses.
9770         (Iterator.EmitDispose): Run all the `finally' clauses here.
9771
9772 2004-07-20  Martin Baulig  <martin@ximian.com>
9773
9774         * iterator.cs: This is the first of a set of changes in the
9775         iterator code.  Match the spec more closely: if we're an
9776         IEnumerable, then GetEnumerator() must be called.  The first time
9777         GetEnumerator() is called, it returns the current instance; all
9778         subsequent invocations (if any) must create a copy.
9779
9780 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
9781
9782         * expression.cs: Resolve the constant expression before returning
9783         it. 
9784
9785 2004-07-19  Martin Baulig  <martin@ximian.com>
9786
9787         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9788         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9789         the return type of the new EmitContext.
9790
9791 2004-07-18  Martin Baulig  <martin@ximian.com>
9792
9793         * class.cs (Property.Define): Fix iterators.
9794
9795         * iterators.cs (Iterator.Define): Moved the
9796         `container.AddInterator (this)' call here from the .ctor; only do
9797         it if we resolved successfully.
9798
9799 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
9800
9801         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9802         `true' for preprocessing directives that we parse.  The return
9803         value indicates whether we should return to regular tokenizing or
9804         not, not whether it was parsed successfully.
9805
9806         In the past if we were in: #if false ... #line #endif, we would
9807         resume parsing after `#line'.  See bug 61604.
9808
9809         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9810         building: IsEnumType should return true only for enums, not for
9811         enums or System.Enum itself.  This fixes #61593.
9812
9813         Likely what happened is that corlib was wrong: mcs depended on
9814         this bug in some places.  The bug got fixed, we had to add the
9815         hack, which caused bug 61593.
9816
9817         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9818         that was a workaround for the older conditions.
9819
9820 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
9821
9822         * assign.cs: IAssignMethod has a new interface, as documented
9823         inline. All assignment code now uses this new api.
9824
9825         * ecore.cs, expression.cs: All classes which implement
9826         IAssignMethod now use the new interface.
9827
9828         * expression.cs (Invocation): add a hack to EmitCall so that
9829         IndexerAccess can be the target of a compound assignment without
9830         evaluating its arguments twice.
9831
9832         * statement.cs: Handle changes in Invocation api.
9833
9834 2004-07-16  Martin Baulig  <martin@ximian.com>
9835
9836         * iterators.cs: Rewrote this.  We're now using one single Proxy
9837         class for both the IEnumerable and the IEnumerator interface and
9838         `Iterator' derives from Class so we can use the high-level API.
9839
9840         * class.cs (TypeContainer.AddIterator): New method.
9841         (TypeContainer.DoDefineType): New protected virtual method, which
9842         is called from DefineType().
9843         (TypeContainer.DoDefineMembers): Call DefineType() and
9844         DefineMembers() on all our iterators.
9845         (TypeContainer.Emit): Call Emit() on all our iterators.
9846         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9847
9848         * codegen.cs (EmitContext.CurrentIterator): New public field.
9849
9850 2004-07-15  Martin Baulig  <martin@ximian.com>
9851
9852         * typemanager.cs
9853         (TypeManager.not_supported_exception_type): New type.   
9854
9855 2004-07-14  Martin Baulig  <martin@ximian.com>
9856
9857         * iterators.cs: Use real error numbers.
9858
9859 2004-07-14  Martin Baulig  <martin@ximian.com>
9860
9861         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9862         requires this to be a System.Collection.IEnumerable and not a
9863         class implementing that interface.
9864         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9865
9866 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9867
9868         * class.cs: Fixed previous fix, it broke some error tests.
9869
9870 2004-07-12  Martin Baulig  <martin@ximian.com>
9871
9872         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9873         Fixes #61293.
9874
9875 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9876
9877         * assign.cs (LocalTemporary): Add new argument: is_address,If
9878         `is_address' is true, then the value that we store is the address
9879         to the real value, and not the value itself.
9880         
9881         * ecore.cs (PropertyExpr): use the new local temporary
9882         stuff to allow us to handle X.Y += z (where X is a struct)
9883
9884 2004-07-08  Martin Baulig  <martin@ximian.com>
9885
9886         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9887         not always return, just like we're doing in Using.Resolve().
9888
9889 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9890
9891         * cs-parser.jay (fixed_statement): flag this as Pinned.
9892
9893 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9894
9895         * typemanager.cs (TypeManager): Removed MakePinned method, this
9896         mechanism is replaced with the .NET 2.x compatible mechanism of
9897         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9898
9899         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9900         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9901         `IsFixed' property which has a different meaning.
9902
9903 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9904
9905         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9906         visible from inside a nested class, not just the names of the
9907         immediately enclosing class.
9908         Fix for bug #60730.
9909
9910 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9911
9912         * expression.cs (BetterConversion): Remove buggy special-case
9913         handling of "implicit constant expression conversions".  At this
9914         point, we already know that the conversion is possible -- we're
9915         only checking to see which is better.
9916
9917 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9918
9919         * cs-parser.jay: Added error CS0210 test.
9920
9921 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9922
9923         * cs-parser.jay: Added error CS0134 test.
9924
9925 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9926
9927         Fix bug #52507
9928         * cs-parser.jay: Added error CS0145 test.
9929
9930 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9931
9932         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9933
9934 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9935         
9936         * expression.cs (StackAlloc.Resolve): The argument may not
9937         be a constant; deal with this case.
9938         
9939 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9940
9941         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9942         GetIndexerAttributeValue.
9943         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9944
9945         * class.cs (Indexer.Define): Added error tests for CS0415,
9946         CS0609.
9947
9948 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9949
9950         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9951         property code.
9952
9953 2004-06-23  Martin Baulig  <martin@ximian.com>
9954
9955         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9956         neither return nor throw, reset the barrier as well.  Fixes #60457.
9957
9958 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9959
9960         * class.cs : EventAttributes is now set to None by default.
9961           This fixes bug #60459.
9962
9963 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9964
9965         Fix bug #60219
9966         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9967         Don't throw exception but return null (it's sufficient now).
9968
9969 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9970
9971         * typemanager.cs (GetArgumentTypes): Faster implementation.
9972
9973 2004-06-18  Martin Baulig  <martin@ximian.com>
9974
9975         * attribute.cs (Attribute.Resolve): Check whether we're an
9976         EmptyCast which a Constant child.  Fixes #60333.
9977
9978 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9979
9980         * statement.cs (EmitCollectionForeach): Account for the fact that
9981         not all valuetypes are in areas which we can take the address of.
9982         For these variables, we store to a temporary variable. Also, make
9983         sure that we dont emit a `callvirt' on a valuetype method.
9984
9985 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9986
9987         * expression.cs (StackAlloc.DoReSolve): Added test for
9988         negative parameter (CS0247).
9989
9990 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9991
9992         Fix bug #59792
9993         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9994
9995 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9996
9997         Fix bug #59781
9998         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9999         ulong.
10000
10001 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10002
10003         Fix bug #58254 & cs1555.cs, cs1556.cs
10004         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10005
10006 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10007
10008         * cs-parser.jay: Added error CS1669 test for indexers.
10009
10010 2004-06-11  Martin Baulig  <martin@ximian.com>
10011
10012         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10013         call this twice: for params and varargs methods.
10014
10015 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10016
10017         * class.cs:
10018         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10019
10020 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10021
10022         * attribute.cs (Attribute.GetValidTargets): Made public.
10023
10024         * class.cs: 
10025         (AbstractPropertyEventMethod): New class for better code sharing.
10026         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10027         CS1667 report.
10028         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10029
10030 2004-06-11  Raja R Harinath  <rharinath@novell.com>
10031
10032         Fix bug #59477.
10033         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
10034         that the call to Resolve is part of a MemberAccess.
10035         (Expression.Resolve): Use it for SimpleName resolution.
10036         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
10037         Add 'intermediate' boolean argument.
10038         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
10039         error message when the SimpleName can be resolved ambiguously
10040         between an expression and a type.
10041         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
10042         public.
10043         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
10044         call on the left-side.
10045
10046 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10047
10048         * class.cs:
10049         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
10050
10051 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10052
10053         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
10054
10055 2004-06-11  Martin Baulig  <martin@ximian.com>
10056
10057         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
10058         varargs methods if applicable.
10059
10060 2004-06-11  Martin Baulig  <martin@ximian.com>
10061
10062         * expression.cs (Invocation.EmitCall): Don't use
10063         `method.CallingConvention == CallingConventions.VarArgs' since the
10064         method could also have `CallingConventions.HasThis'.
10065
10066 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10067
10068         * class.cs (Event.GetSignatureForError): Implemented.
10069         Fixed crash in error test cs3010.cs
10070
10071 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
10072
10073         * cs-tokenizer.cs: Change the way we track __arglist to be
10074         consistent with the other keywords.
10075
10076 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
10077
10078         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
10079         tomorrow.
10080
10081 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
10082
10083         * codegen.cs: Check that all referenced assemblies have a strongname
10084         before strongnaming the compiled assembly. If not report error CS1577.
10085         Fix bug #56563. Patch by Jackson Harper.
10086         * typemanager.cs: Added a method to return all referenced assemblies.
10087         Fix bug #56563. Patch by Jackson Harper.
10088
10089 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
10090
10091         * class.cs:
10092         (Method.ApplyAttributeBuilder): Moved and added conditional
10093         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
10094
10095         * delegate.cs:
10096         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
10097
10098 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
10099
10100         Fixed #59640
10101         * class.cs: (EventField.attribute_targets): Changed default target.
10102
10103 2004-06-08  Martin Baulig  <martin@ximian.com>
10104
10105         * expression.cs (Invocation.EmitCall): Enable varargs methods.
10106
10107 2004-06-08  Martin Baulig  <martin@ximian.com>
10108
10109         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
10110
10111 2004-06-07  Martin Baulig  <martin@ximian.com>
10112
10113         Added support for varargs methods.
10114
10115         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
10116         keyword.
10117
10118         * cs-parser.jay: Added support for `__arglist'.
10119
10120         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
10121
10122         * expression.cs (Argument.AType): Added `ArgList'.
10123         (Invocation): Added support for varargs methods.
10124         (ArglistAccess): New public class.
10125         (Arglist): New public class.
10126
10127         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
10128
10129         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
10130         a method's top-level block if the method has varargs.
10131
10132         * support.cs (ReflectionParameters, InternalParameters): Added
10133         support for varargs methods.    
10134
10135 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
10136
10137         * class.cs: Provide location in indexer error report.
10138
10139         * driver.cs: Use standard names.
10140
10141         * namespace.cs: Catch the use of using after a namespace has been
10142         declared also on using aliases.
10143
10144 2004-06-03  Raja R Harinath  <rharinath@novell.com>
10145
10146         Bug #50820.
10147         * typemanager.cs (closure_private_ok, closure_invocation_type)
10148         (closure_qualifier_type, closure_invocation_assembly)
10149         (FilterWithClosure): Move to ...
10150         (Closure): New internal nested class.
10151         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
10152         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
10153         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
10154         (MemberLookup, MemberLookupFailed): Use it.
10155         * expression.cs (New.DoResolve): Treat the lookup for the
10156         constructor as being qualified by the 'new'ed type.
10157         (Indexers.GetIndexersForTypeOrInterface): Update.
10158
10159 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
10160
10161         * attribute.cs
10162         (GetConditionalAttributeValue): New method. Returns
10163         condition of ConditionalAttribute.
10164         (SearchMulti): New method.  Returns all attributes of type 't'.
10165         Use it when attribute is AllowMultiple = true.
10166         (IsConditionalMethodExcluded): New method.
10167
10168         * class.cs
10169         (Method.IsExcluded): Implemented. Returns true if method has conditional
10170         attribute and the conditions is not defined (method is excluded).
10171         (IMethodData): Extended interface for ConditionalAttribute support.
10172         (PropertyMethod.IsExcluded): Implemented.
10173
10174         * decl.cs
10175         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
10176
10177         * expression.cs
10178         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
10179         on the method.
10180
10181 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10182
10183         * expression.cs (ArrayCreationExpression): Make this just an
10184         `expression'. It can't be a statement, so the code here was
10185         dead.
10186
10187 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10188
10189         Fixed #59072
10190         * typemanager.cs (GetFullNameSignature): New method for
10191         MethodBase types.
10192
10193 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10194
10195         Fixed #56452
10196         * class.cs (MemberBase.GetSignatureForError): New virtual method.
10197         Use this method when MethodBuilder is null.
10198         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
10199         Added test for error CS0626 (MONO reports error for this situation).
10200         (IMethodData.GetSignatureForError): Extended interface.
10201
10202 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10203
10204         * attribute.cs
10205         (AttributeTester.GetObsoleteAttribute): Returns instance of
10206         ObsoleteAttribute when type is obsolete.
10207
10208         * class.cs
10209         (TypeContainer.VerifyObsoleteAttribute): Override.
10210         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10211         (MethodCode.VerifyObsoleteAttribute): Override.
10212         (MemberBase.VerifyObsoleteAttribute): Override.
10213
10214         * decl.cs
10215         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10216         and report proper error.
10217
10218         *delegate.cs
10219         Delegate.VerifyObsoleteAttribute): Override.
10220
10221         * ecore.cs
10222         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10223         and report proper error.
10224         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10225
10226         * enum.cs
10227         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10228         and enum member.
10229
10230         * expression.cs
10231         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10232         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10233         Added test for ObsoleteAttribute.
10234
10235         * statement.cs
10236         (Catch): Derived from Statement.
10237
10238 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10239  
10240         Fixed bug #59071 & cs0160.cs
10241  
10242         * statement.cs (Try.Resolve): Check here whether order of catch
10243         clauses matches their dependencies.
10244
10245 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
10246
10247         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
10248         caused a regression: #59343.  Referencing nested classes from an
10249         assembly stopped working.
10250
10251 2004-05-31  Martin Baulig  <martin@ximian.com>
10252
10253         MCS is now frozen for beta 2.
10254
10255 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10256
10257         * convert.cs: add a trivial cache for overload operator resolution.
10258
10259 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10260
10261         * decl.cs: If possible, use lookuptypedirect here. We can only do
10262         this if there is no `.' after the namespace. Avoids using
10263         LookupType, which does lots of slow processing.
10264         (FindNestedType) New method, does what it says :-).
10265         * namespace.cs: use LookupTypeDirect.
10266         * rootcontext.cs: use membercache, if possible.
10267         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10268
10269 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10270
10271         * expression.cs:
10272         According to the spec, 
10273
10274         In a member access of the form E.I, if E is a single identifier,
10275         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10276         field, property, localvariable, or parameter with the same type as
10277         the meaning of E as a type-name (§3.8), then both possible
10278         meanings of E are permitted.
10279
10280         We did not check that E as a simple-name had the same type as E as
10281         a type name.
10282
10283         This trivial check gives us 5-7% on bootstrap time.
10284
10285 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10286
10287         * expression.cs (Invocation.OverloadResolve): Avoid the
10288         use of hashtables and boxing here by allocating on demand.
10289
10290 2004-05-30  Martin Baulig  <martin@ximian.com>
10291
10292         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10293         we're doing a silent lookup.  Don't try to lookup nested types in
10294         TypeManager.object_type (thanks to Ben Maurer).
10295
10296 2004-05-30  Martin Baulig  <martin@ximian.com>
10297
10298         Committing a patch from Ben Maurer.
10299
10300         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10301
10302 2004-05-29  Martin Baulig  <martin@ximian.com>
10303
10304         * class.cs (IMethodData.ShouldIgnore): New method.
10305
10306         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10307         `Location' argument, we don't need it anywhere.  Use
10308         `IMethodData.ShouldIgnore ()' instead of
10309         `MethodData.GetMethodFlags ()'.
10310         (TypeManager.AddMethod): Removed.
10311         (TypeManager.AddMethod2): Renamed to AddMethod.
10312
10313 2004-05-29  Martin Baulig  <martin@ximian.com>
10314
10315         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10316
10317         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10318         converting from a class type S to an interface type and we already
10319         have an object on the stack, don't box it again.  Fixes #52578.
10320
10321 2004-05-29  Martin Baulig  <martin@ximian.com>
10322
10323         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10324         Added support for `params' parameters.  Fixes #59267.
10325
10326 2004-05-29  Martin Baulig  <martin@ximian.com>
10327
10328         * literal.cs (NullPointer): Provide a private .ctor which sets
10329         `type' to TypeManager.object_type.  Fixes #59048.
10330
10331 2004-05-29  Martin Baulig  <martin@ximian.com>
10332
10333         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10334         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10335
10336         * ecore.cs (EventExpr.instance_expr): Make the field private.
10337
10338 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10339
10340         Fixed bug #50080 & cs0214-2.cs
10341         * expression.cs (Cast.DoResolve): Check unsafe context here.
10342         
10343         * statement.cs (Resolve.DoResolve): Likewise.
10344
10345 2004-05-26  Martin Baulig  <martin@ximian.com>
10346
10347         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10348
10349         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10350         (RootContext.LookupType): Pass down the `silent' flag.
10351
10352 2004-05-25  Martin Baulig  <martin@ximian.com>
10353
10354         * expression.cs
10355         (MethodGroupExpr.IdenticalTypeName): New public property.
10356         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10357         expression actually refers to a type.
10358
10359 2004-05-25  Martin Baulig  <martin@ximian.com>
10360
10361         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10362         for #56176 and made it actually work.
10363
10364 2004-05-25  Martin Baulig  <martin@ximian.com>
10365
10366         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10367         (FieldExpr, PropertyExpr): Override and implement
10368         CacheTemporaries.  Fixes #52279.
10369
10370 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10371
10372         * location.cs: In the new compiler listing a file twice is a
10373         warning, not an error.
10374
10375 2004-05-24  Martin Baulig  <martin@ximian.com>
10376
10377         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10378         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10379
10380 2004-05-24  Martin Baulig  <martin@ximian.com>
10381
10382         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10383         walking the `using' list.  Fixes #53921.
10384
10385 2004-05-24  Martin Baulig  <martin@ximian.com>
10386
10387         * const.cs (Const.LookupConstantValue): Added support for
10388         EmptyCast's; fixes #55251.
10389
10390 2004-05-24  Martin Baulig  <martin@ximian.com>
10391
10392         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10393         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10394         which does the CS0135 check.  The reason is that we first need to
10395         check whether the variable actually exists.
10396
10397 2004-05-24  Martin Baulig  <martin@ximian.com>
10398
10399         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10400         than RootContext.LookupType() to find the explicit interface
10401         type.  Fixes #58584.
10402
10403 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10404
10405         * Makefile: Simplify.  Use executable.make.
10406         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10407
10408 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10409
10410         * decl.cs:
10411         * enum.cs:
10412         Use the invariant culture when doing String.Compare for CLS case
10413         sensitivity.
10414         
10415 2004-05-23  Martin Baulig  <martin@ximian.com>
10416
10417         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10418         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10419
10420         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10421         
10422 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10423
10424         * class.cs (MemberBase.Define): Reuse MemberType member for 
10425         resolved type. Other methods can use it too.
10426
10427 2004-05-23  Martin Baulig  <martin@ximian.com>
10428
10429         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10430         the variable also exists in the current block (otherwise, we need
10431         to report a CS0103).  Fixes #58670.
10432
10433 2004-05-23  Martin Baulig  <martin@ximian.com>
10434
10435         * flowanalysis.cs (Reachability.Reachable): Compute this
10436         on-the-fly rather than storing it as a field.
10437
10438 2004-05-23  Martin Baulig  <martin@ximian.com>
10439
10440         * flowanalysis.cs (Reachability.And): Manually compute the
10441         resulting `barrier' from the reachability.      
10442        
10443 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10444
10445         Fix bug #57835
10446         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10447         instance of ObsoleteAttribute when symbol is obsolete.
10448
10449         * class.cs
10450         (IMethodData): Extended interface for ObsoleteAttribute support.
10451
10452 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10453
10454         * attribute.cs: Fix bug #55970
10455
10456 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10457
10458         Fix bug #52705
10459         * attribute.cs
10460         (GetObsoleteAttribute): New method. Creates the instance of
10461         ObsoleteAttribute.
10462         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10463         ObsoleteAttribute when member is obsolete.
10464         (AttributeTester.Report_ObsoleteMessage): Common method for
10465         Obsolete error/warning reporting.
10466
10467         * class.cs
10468         (TypeContainer.base_classs_type): New member for storing parent type.
10469
10470         * decl.cs
10471         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10472         for this MemberCore.
10473
10474 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10475
10476         * attribute.cs, const.cs: Fix bug #58590
10477
10478 2004-05-21  Martin Baulig  <martin@ximian.com>
10479
10480         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10481         out parameters if the end of the method is unreachable.  Fixes
10482         #58098. 
10483
10484 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10485
10486         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10487         Hari was right, why extra method.
10488
10489 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10490
10491         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10492
10493 2004-05-20  Martin Baulig  <martin@ximian.com>
10494
10495         Merged this back from gmcs to keep the differences to a minumum.
10496
10497         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
10498         instead of a Declspace.
10499         (Attribute.ResolveType): Likewise.
10500         (Attributes.Search): Likewise.
10501         (Attributes.Contains): Likewise.
10502         (Attributes.GetClsCompliantAttribute): Likewise.
10503
10504         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
10505         argument.
10506         (MethodData.ApplyAttributes): Take an EmitContext instead of a
10507         DeclSpace.
10508
10509 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10510
10511         Fix bug #58688 (MCS does not report error when the same attribute
10512         is assigned twice)
10513
10514         * attribute.cs (Attribute.Emit): Distinction between null and default.
10515
10516 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10517
10518         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10519         of a top-level attribute without an attribute target.
10520         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10521         Make non-static.
10522         (Attribute.Conditional_GetConditionName), 
10523         (Attribute.Obsolete_GetObsoleteMessage): Update.
10524         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10525         part of ScanForIndexerName.
10526         (Attribute.CanIgnoreInvalidAttribute): New function.
10527         (Attribute.ScanForIndexerName): Move to ...
10528         (Attributes.ScanForIndexerName): ... here.
10529         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10530         (Attributes.Search): New internal variant that can choose not to
10531         complain if types aren't resolved.  The original signature now
10532         complains.
10533         (Attributes.GetClsCompliantAttribute): Use internal variant, with
10534         complaints suppressed.
10535         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10536         only if it not useful.
10537         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10538         top-level for attributes that are shared between the assembly
10539         and a top-level class.
10540         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10541         * class.cs: Update to reflect changes.
10542         (DefineIndexers): Fuse loops.
10543         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10544         a couple more variants of attribute names.
10545
10546 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10547
10548         Fix bug #52585 (Implemented explicit attribute declaration)
10549
10550         * attribute.cs:
10551         (Attributable.ValidAttributeTargets): New abstract method. It gets
10552         list of valid attribute targets for explicit target declaration.
10553         (Attribute.Target): It holds target itself.
10554         (AttributeSection): Removed.
10555         (Attribute.CheckTargets): New method. It checks whether attribute
10556         target is valid for the current element.
10557
10558         * class.cs:
10559         (EventProperty): New class. For events that are declared like
10560         property (with add and remove accessors).
10561         (EventField): New class. For events that are declared like field.
10562         class.cs
10563
10564         * cs-parser.jay: Implemented explicit attribute target declaration.
10565
10566         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10567         Override ValidAttributeTargets.
10568
10569         * parameter.cs:
10570         (ReturnParameter): Class for applying custom attributes on 
10571         the return type.
10572         (ParameterAtribute): New class. Class for applying custom
10573         attributes on the parameter type.
10574
10575 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10576
10577         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10578         definitions. 
10579
10580         (Method): Allow UNSAFE here.
10581
10582         * modifiers.cs: Support unsafe reporting.
10583
10584 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10585
10586         * decl.cs: Fix bug #58478.
10587
10588 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10589
10590         * statement.cs: When checking for unreachable code on an EmptyStatement,
10591         set the location. Fixes bug #58488.
10592
10593 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10594
10595         * driver.cs: Add -pkg handling.
10596
10597         From Gonzalo: UseShelLExecute=false
10598
10599 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10600
10601         * attribute.cs:
10602         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10603         for attribute.
10604         (Attribute.IsClsCompliaceRequired): Moved to base for better
10605         accesibility.
10606         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10607         when attribute is AttributeUsageAttribute.
10608         (Attribute.GetValidTargets): Simplified.
10609         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10610         attribute for this type.
10611         (Attribute.ApplyAttributes): Method renamed to Emit and make
10612         non-static.
10613         (GlobalAttributeSection): New class for special handling of global
10614         attributes (assembly, module).
10615         (AttributeSection.Emit): New method.
10616
10617         * class.cs: Implemented Attributable abstract methods.
10618         (MethodCore.LabelParameters): Moved to Parameter class.
10619         (Accessor): Is back simple class.
10620         (PropertyMethod): Implemented Attributable abstract class.
10621         (DelegateMethod): Implemented Attributable abstract class.
10622         (Event): New constructor for disctintion between normal Event
10623         and Event with accessors.
10624
10625         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10626
10627         * codegen.cs, const.cs, decl.cs, delegate.cs:
10628         (CommonAssemblyModulClass): Implemented Attributable abstract class
10629         and simplified.
10630
10631         * enum.cs: Implement IAttributeSupport interface.
10632         (EnumMember): New class for emum members. Implemented Attributable
10633         abstract class
10634
10635         * parameter.cs:
10636         (ParameterBase): Is abstract.
10637         (ReturnParameter): New class for easier [return:] attribute handling.
10638
10639         * typemanager.cs: Removed builder_to_attr.
10640
10641 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10642
10643         Fix bug #57151.
10644         * attribute.cs (Attribute.GetPositionalValue): New function.
10645         * class.cs (TypeContainer.VerifyMembers): New function.
10646         (TypeContainer.Emit): Use it.
10647         (ClassOrStruct): New base class for Class and Struct.
10648         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10649         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10650         class.
10651         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10652         then each non-static field should have a FieldOffset attribute.
10653         Otherwise, none of the fields should have a FieldOffset attribute.
10654         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
10655         and FieldOffset attributes.
10656         * typemanager.cs (TypeManager.struct_layout_attribute_type)
10657         (TypeManager.field_offset_attribute_type): New core types.
10658         (TypeManager.InitCoreTypes): Initialize them.
10659
10660 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
10661
10662         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10663         Return correct type.
10664         From bug #58270.
10665
10666 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
10667
10668         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10669         be implicitly converted to ulong.
10670         
10671         * expression.cs: The logic for allowing operator &, | and ^ worked
10672         was wrong, it worked before because we did not report an error in
10673         an else branch.  Fixes 57895.
10674
10675         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10676         allow volatile fields to be reference types.
10677
10678 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
10679
10680         * driver.cs: Add support for /debug-
10681
10682 2004-05-07  Raja R Harinath  <rharinath@novell.com>
10683
10684         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
10685         Add a 'complain' parameter to silence errors.
10686         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
10687         silently overlooked type-resolutions.
10688         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10689         to reflect changes.
10690         (Attributes.Search): New function.
10691         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10692         (Attributes.GetAttributeFullName): Remove hack.
10693         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
10694         Update to reflect changes.
10695         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10696         Use Attributes.Search instead of nested loops.
10697
10698 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
10699
10700         * decl.cs:
10701         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10702         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10703         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10704
10705         * report.cs: (Report.Warning): Renamed to Warning_T because of
10706         parameter collision.
10707
10708 2004-05-05  Raja R Harinath  <rharinath@novell.com>
10709
10710         * expression.cs (MemberAccess.ResolveMemberAccess):
10711         Exit with non-zero status after Report.Error.
10712         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10713         Likewise.
10714         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10715
10716 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10717
10718         * support.cs: Don't hang when the file is empty.
10719
10720 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10721
10722         * support.cs: In SeekableStreamReader, compute the preamble size of the
10723           underlying stream. Position changes should take into account that initial
10724           count of bytes.
10725
10726 2004-05-03  Todd Berman  <tberman@sevenl.net>
10727
10728         * driver.cs: remove unused GetSysVersion function.
10729
10730 2004-05-03  Todd Berman  <tberman@sevenl.net>
10731
10732         * driver.cs: Remove the hack from saturday, as well as the hack
10733         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10734         link_paths to get that bit proper.
10735
10736 2004-05-01  Todd Berman  <tberman@sevenl.net>
10737
10738         * driver.cs: Try a LoadFrom before a Load, this checks the current
10739         path. This is currently a bug in mono that is be fixed, however, this
10740         provides a workaround for now. This will be removed when the bug
10741         is fixed.
10742
10743 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10744
10745         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10746         incomplete key pairs (#57941).
10747
10748 2004-05-01  Todd Berman  <tberman@sevenl.net>
10749
10750         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10751         from the GAC
10752
10753 2004-04-30  Jackson Harper  <jackson@ximian.com>
10754
10755         * codegen.cs: Open keys readonly.
10756         
10757 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10758
10759         * typemanager.cs: don't report cyclic struct layout when a struct
10760         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10761         which has 2 Pango.Rectangle fields.
10762
10763 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10764
10765         * expression.cs: Handle IntPtr comparisons with IL code
10766         rather than a method call.
10767
10768 2004-04-29  Martin Baulig  <martin@ximian.com>
10769
10770         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10771         the list of PropertyInfo's in class hierarchy and find the
10772         accessor.  Fixes #56013.
10773
10774 2004-04-29  Martin Baulig  <martin@ximian.com>
10775
10776         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10777
10778 2004-04-29  Martin Baulig  <martin@ximian.com>
10779
10780         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10781
10782         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10783
10784 2004-04-29  Martin Baulig  <martin@ximian.com>
10785
10786         * class.cs (ConstructorInitializer.Resolve): Check whether the
10787         parent .ctor is accessible.  Fixes #52146.
10788
10789 2004-04-29  Martin Baulig  <martin@ximian.com>
10790
10791         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10792
10793         * statement.cs (Using.EmitLocalVariableDecls): Use
10794         TypeManager.idisposable_type, not typeof (IDisposable).
10795         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10796
10797 2004-04-29  Martin Baulig  <martin@ximian.com>
10798
10799         * class.cs (Event.Define): Don't emit the field and don't set
10800         RTSpecialName and SpecialName for events on interfaces.  Fixes
10801         #57703. 
10802
10803 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10804
10805         Refactor Attribute.ApplyAttributes.
10806         * attribute.cs (Attributable): New base class for objects that can
10807         have Attributes applied on them.
10808         (Attribute): Make AttributeUsage fields public.
10809         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10810         (Attribute.IsInternalCall): New property.
10811         (Attribute.UsageAttr): Convert to a public read-only property.
10812         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10813         (Attribute.ResolveType, Attribute.Resolve)
10814         (Attribute.ScanForIndexerName): Update to reflect changes.
10815         (Attribute.CheckAttributeTarget): Re-format.
10816         (Attribute.ApplyAttributes): Refactor, to various
10817         Attributable.ApplyAttributeBuilder methods.
10818         * decl.cs (MemberCore): Make Attributable.
10819         * class.cs (Accessor): Make Attributable.
10820         (MethodData.ApplyAttributes): Use proper attribute types, not
10821         attribute names.
10822         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10823         (TypeContainer.ApplyAttributeBuilder)
10824         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10825         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10826         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10827         (Operator.ApplyAttributeBuilder): New factored-out methods.
10828         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10829         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10830         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10831         * parameter.cs (ParameterBase): New Attributable base class
10832         that can also represent Return types.
10833         (Parameter): Update to the changes.
10834
10835 2004-04-29  Jackson Harper  <jackson@ximian.com>
10836
10837         * driver.cs: Prefer the corlib system version when looking for
10838         assemblies in the GAC. This is still a hack, but its a better hack
10839         now.
10840         
10841 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10842
10843         * decl.cs, enum.cs: Improved error 3005 reporting.
10844   
10845         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10846         (related_symbols): New private member for list of symbols
10847         related to reported error/warning.
10848         
10849         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10850
10851 2004-04-29  Martin Baulig  <martin@ximian.com>
10852
10853         * ecore.cs (Expression.Constantify): If we're an enum and
10854         TypeManager.TypeToCoreType() doesn't give us another type, use
10855         t.UnderlyingSystemType.  Fixes #56178.  
10856
10857 2004-04-29  Martin Baulig  <martin@ximian.com>
10858
10859         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10860         interfaces and for each interface, only add members directly
10861         declared in that interface.  Fixes #53255.
10862
10863 2004-04-28  Martin Baulig  <martin@ximian.com>
10864
10865         * expression.cs (ConditionalLogicalOperator): Use a temporary
10866         variable for `left' to avoid that we evaluate it more than once;
10867         bug #52588.
10868
10869 2004-04-28  Martin Baulig  <martin@ximian.com>
10870
10871         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10872         `void[]' (CS1547).
10873
10874 2004-04-28  Martin Baulig  <martin@ximian.com>
10875
10876         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10877         void (CS1547).
10878
10879         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10880         whether the type is not void (CS1547).
10881
10882 2004-04-28  Martin Baulig  <martin@ximian.com>
10883
10884         * expression.cs (Unary.DoResolveLValue): Override this and report
10885         CS0131 for anything but Operator.Indirection.
10886
10887 2004-04-28  Martin Baulig  <martin@ximian.com>
10888
10889         Committing a patch from Ben Maurer; see bug #50820.
10890
10891         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10892         check for classes.
10893
10894         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10895         classes.        
10896
10897 2004-04-28  Martin Baulig  <martin@ximian.com>
10898
10899         Committing a patch from Ben Maurer; see bug #50820.
10900
10901         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10902         check for classes.
10903
10904         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10905         classes.        
10906
10907 2004-04-28  Martin Baulig  <martin@ximian.com>
10908
10909         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10910         (Block.AddLabel): Call DoLookupLabel() to only search in the
10911         current block.
10912
10913 2004-04-28  Martin Baulig  <martin@ximian.com>
10914
10915         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10916         comparing StringConstants and NullLiterals in Equality and Inequality.
10917
10918 2004-04-28  Jackson Harper  <jackson@ximian.com>
10919
10920         * driver.cs: Attempt to load referenced assemblies from the
10921         GAC. This is the quick and dirty version of this method that
10922         doesnt take into account versions and just takes the first
10923         canidate found. Will be good enough for now as we will not have more
10924         then one version installed into the GAC until I update this method.
10925
10926 2004-04-28  Martin Baulig  <martin@ximian.com>
10927
10928         * typemanager.cs (TypeManager.CheckStructCycles): New public
10929         static method to check for cycles in the struct layout.
10930
10931         * rootcontext.cs (RootContext.PopulateTypes): Call
10932         TypeManager.CheckStructCycles() for each TypeContainer.
10933         [Note: We only need to visit each type once.]
10934
10935 2004-04-28  Martin Baulig  <martin@ximian.com>
10936
10937         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10938
10939         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10940         success and added `out object value'.  Use a `bool resolved' field
10941         to check whether we've already been called rather than
10942         `ConstantValue != null' since this breaks for NullLiterals.
10943
10944 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10945
10946         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10947         setting of this flag, since the 'set' method may be non-public.
10948
10949 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10950
10951         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10952         check on current_vector.Block.
10953
10954 2004-04-27  Martin Baulig  <martin@ximian.com>
10955
10956         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10957         a field initializer.  Fixes #56459.
10958
10959 2004-04-27  Martin Baulig  <martin@ximian.com>
10960
10961         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10962         we're not attempting to use an indexer.  Fixes #52154.
10963
10964 2004-04-27  Martin Baulig  <martin@ximian.com>
10965
10966         * statement.cs (Return): Don't create a return label if we don't
10967         need it; reverts my change from January 20th.  Thanks to Ben
10968         Maurer for this.
10969
10970 2004-04-27  Martin Baulig  <martin@ximian.com>
10971
10972         According to the spec, `goto' can only leave a nested scope, but
10973         never enter it.
10974
10975         * statement.cs (Block.LookupLabel): Only lookup in the current
10976         block, don't recurse into parent or child blocks.
10977         (Block.AddLabel): Check in parent and child blocks, report
10978         CS0140/CS0158 if we find a duplicate.
10979         (Block): Removed this indexer for label lookups.
10980         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10981         this already does the error reporting for us.
10982
10983         * flowanalysis.cs
10984         (FlowBranching.UsageVector.Block): New public variable; may be null.
10985         (FlowBranching.CreateSibling): Added `Block' argument.
10986         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10987         label for the target of a `goto' and check whether we're not
10988         leaving a `finally'.
10989
10990 2004-04-27  Martin Baulig  <martin@ximian.com>
10991
10992         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10993         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10994         just for returns).
10995
10996 2004-04-27  Martin Baulig  <martin@ximian.com>
10997
10998         * statement.cs (Block.AddLabel): Also check for implicit blocks
10999         and added a CS0158 check.
11000
11001 2004-04-27  Martin Baulig  <martin@ximian.com>
11002
11003         * flowanalysis.cs (FlowBranchingLoop): New class.
11004         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11005         UsageVector's instead of an ArrayList.
11006         (FlowBranching.Label): Likewise.
11007         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11008         (FlowBranching.AddBreakVector): New method.
11009
11010 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11011
11012         * attribute.cs: Small regression fix: only convert the type if we
11013         the type is different, fixes System.Drawing build.
11014
11015 2004-04-27  Martin Baulig  <martin@ximian.com>
11016
11017         * attribute.cs (Attribute.Resolve): If we have a constant value
11018         for a named field or property, implicity convert it to the correct
11019         type.
11020
11021 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11022
11023         * statement.cs (Block.Block): Implicit blocks share
11024         'child_variable_names' fields with parent blocks.
11025         (Block.AddChildVariableNames): Remove.
11026         (Block.AddVariable): Mark variable as "used by a child block" in
11027         every surrounding block.
11028         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11029         been used in a child block, complain about violation of "Invariant
11030         meaning in blocks" rule.
11031         * cs-parser.jay (declare_local_variables): Don't use
11032         AddChildVariableNames.
11033         (foreach_statement): Don't create an implicit block: 'foreach'
11034         introduces a scope.
11035
11036 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11037
11038         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11039         converting from 0L to ulong.  Fixes 57522.
11040
11041 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11042
11043         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11044         derived class hides via 'new' keyword field from base class (test-242.cs).
11045         TODO: Handle this in the more general way.
11046         
11047         * class.cs (CheckBase): Ditto.
11048
11049 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11050
11051         * decl.cs (caching_flags): New member for storing cached values
11052         as bit flags.
11053         (MemberCore.Flags): New enum where bit flags for caching_flags
11054         are defined.
11055         (MemberCore.cls_compliance): Moved to caching_flags.
11056         (DeclSpace.Created): Moved to caching_flags.
11057
11058         * class.cs: Use caching_flags instead of DeclSpace.Created
11059         
11060 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11061
11062         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11063         if we are only a derived class, not a nested class.
11064
11065         * typemanager.cs: Same as above, but do this at the MemberLookup
11066         level (used by field and methods, properties are handled in
11067         PropertyExpr).   Allow for the qualified access if we are a nested
11068         method. 
11069
11070 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11071
11072         * class.cs: Refactoring.
11073         (IMethodData): New inteface; Holds links to parent members
11074         to avoid member duplication (reduced memory allocation).
11075         (Method): Implemented IMethodData interface.
11076         (PropertyBase): New inner classes for get/set methods.
11077         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11078         (Event): New inner classes for add/remove methods.
11079         (Event.DelegateMethod): Implemented IMethodData interface.
11080
11081         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11082         EmitContext (related to class.cs refactoring).
11083
11084 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11085
11086         * delegate.cs (Delegate.VerifyApplicability): If the number of
11087         arguments are the same as the number of parameters, first try to
11088         verify applicability ignoring  any 'params' modifier on the last
11089         parameter.
11090         Fixes #56442.
11091
11092 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11093
11094         * class.cs (TypeContainer.AddIndexer): Use
11095         'ExplicitInterfaceName' to determine if interface name was
11096         explicitly specified.  'InterfaceType' is not initialized at this time.
11097         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11098         Indexers array is already in the required order.  Initialize
11099         'IndexerName' only if there are normal indexers.
11100         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11101         (TypeContainer.Emit): Emit DefaultMember attribute only if
11102         IndexerName is initialized.
11103         Fixes #56300.
11104
11105 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11106
11107         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11108         Fixes #57007
11109
11110 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11111
11112         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11113         attributes.
11114         Fix for #56456.
11115
11116         * attribute.cs (Attribute.Resolve): Check for duplicate named
11117         attributes.
11118         Fix for #56463.
11119
11120 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11121
11122         * iterators.cs (MarkYield): track whether we are in an exception,
11123         and generate code accordingly.  Use a temporary value to store the
11124         result for our state.
11125
11126         I had ignored a bit the interaction of try/catch with iterators
11127         since their behavior was not entirely obvious, but now it is
11128         possible to verify that our behavior is the same as MS .NET 2.0
11129
11130         Fixes 54814
11131
11132 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11133
11134         * iterators.cs: Avoid creating temporaries if there is no work to
11135         do. 
11136
11137         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11138         Enumerations, use TypeManager.EnumToUnderlying and call
11139         recursively. 
11140
11141         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11142         bug #57013
11143
11144         (This.Emit): Use EmitContext.EmitThis to emit our
11145         instance variable.
11146
11147         (This.EmitAssign): Ditto.
11148
11149         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11150         codepaths, we will move all the functionality into
11151         Mono.CSharp.This 
11152
11153         (FieldExpr.EmitAssign): Ditto.
11154
11155         This fixes several hidden bugs that I uncovered while doing a code
11156         review of this today.
11157
11158         * codegen.cs (EmitThis): reworked so the semantics are more clear
11159         and also support value types "this" instances.
11160
11161         * iterators.cs: Changed so that for iterators in value types, we
11162         do not pass the value type as a parameter.  
11163
11164         Initialization of the enumerator helpers is now done in the caller
11165         instead of passing the parameters to the constructors and having
11166         the constructor set the fields.
11167
11168         The fields have now `assembly' visibility instead of private.
11169
11170 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11171
11172         * expression.cs (Argument.Resolve): Check if fields passed as ref
11173         or out are contained in a MarshalByRefObject.
11174
11175         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11176         another compiler type.
11177
11178 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11179
11180         * class.cs (Indexer.Define): use the new name checking method.
11181         Also, return false on an error.
11182         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11183         (is_identifier_[start/part]_character): make static.
11184
11185 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11186
11187         * expression.cs (Binary.ResolveOperator): Do no append strings
11188         twice: since we can be invoked more than once (array evaluation)
11189         on the same concatenation, take care of this here.  Based on a fix
11190         from Ben (bug #56454)
11191
11192 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11193
11194         * codegen.cs: Fix another case where CS1548 must be reported (when 
11195         delay-sign isn't specified and no private is available #56564). Fix
11196         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11197         error when MCS is used on the MS runtime and we need to delay-sign 
11198         (which seems unsupported by AssemblyBuilder - see #56621).
11199
11200 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11201
11202         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11203         (TypeManager.ComputeNamespaces): Faster implementation for
11204         Microsoft runtime.
11205
11206         * compiler.csproj: Updated AssemblyName to mcs.
11207
11208 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11209
11210         * rootcontext.cs: Add new types to the boot resolution.
11211
11212         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11213         MulticastDelegate is not allowed.
11214
11215         * typemanager.cs: Add new types to lookup: System.TypedReference
11216         and ArgIterator.
11217
11218         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11219         check for TypedReference or ArgIterator, they are not allowed. 
11220
11221         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11222         makes us properly catch 1510 in some conditions (see bug 56016 for
11223         details). 
11224
11225 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11226
11227         * CryptoConvert.cs: update from corlib version
11228         with endian fixes.
11229
11230 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11231
11232         * class.cs (Indexer.Define): Check indexername declaration
11233
11234 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
11235
11236         * attribute.cs (IsClsCompliant): Fixed problem with handling
11237         all three states (compliant, not-compliant, undetected).
11238
11239 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
11240
11241         * attribute.cs (Attribute): Location is now public.
11242         (Resolve): Store resolved arguments (pos_values) in attribute class.
11243         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11244         (GetClsCompliantAttributeValue): New method that gets
11245         CLSCompliantAttribute value.
11246         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11247         if exists else null.
11248         (AttributeTester): New class for CLS-Compliant verification routines.
11249
11250         * class.cs (Emit): Add CLS-Compliant verification.
11251         (Method.GetSignatureForError): Implemented.
11252         (Constructor.GetSignatureForError): Implemented
11253         (Constructor.HasCompliantArgs): Returns if constructor has
11254         CLS-Compliant arguments.
11255         (Constructor.Emit): Override.
11256         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11257         is needed to test only parameters.
11258         (FieldBase.GetSignatureForError): Implemented.
11259         (TypeContainer): New member for storing base interfaces.
11260         (TypeContainer.FindMembers): Search in base interfaces too.
11261
11262         * codegen.cs (GetClsComplianceAttribute): New method that gets
11263         assembly or module CLSCompliantAttribute value.
11264         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11265         for assembly.
11266         (ModuleClass.Emit): Add error 3012 test.
11267
11268         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11269
11270         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11271         state for all decl types.
11272         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11273         if CLS-Compliant tests are required.
11274         (IsClsCompliaceRequired): New method. Analyze whether code
11275         must be CLS-Compliant.
11276         (IsExposedFromAssembly): New method. Returns true when MemberCore
11277         is exposed from assembly.
11278         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11279         value or gets cached value.
11280         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11281         is explicitly marked with CLSCompliantAttribute.
11282         (IsIdentifierClsCompliant): New abstract method. This method is
11283         used to testing error 3005.
11284         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11285         for identifier and parameters CLS-Compliant testing.
11286         (VerifyClsCompliance): New method. The main virtual method for
11287         CLS-Compliant verifications.
11288         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11289         null. I don't know why is null (too many public members !).
11290         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11291         and get value of first CLSCompliantAttribute that found.
11292
11293         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11294         (VerifyClsCompliance): Override and add extra tests.
11295
11296         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11297         clscheck- disable CLS-Compliant verification event if assembly is has
11298         CLSCompliantAttribute(true).
11299
11300         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11301         ApllyAttribute is now called in emit section as in the other cases.
11302         Possible future Emit integration.
11303         (IsIdentifierClsCompliant): New override.
11304         (VerifyClsCompliance): New override.
11305         (GetEnumeratorName): Returns full enum name.
11306
11307         * parameter.cs (GetSignatureForError): Implemented.
11308
11309         * report.cs (WarningData): New struct for Warning message information.
11310         (LocationOfPreviousError): New method.
11311         (Warning): New method. Reports warning based on the warning table.
11312         (Error_T): New method. Reports error based on the error table.
11313
11314         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11315         verifications are done here.
11316
11317         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11318
11319         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11320         CLSCompliantAttribute.
11321         (all_imported_types): New member holds all imported types from other
11322         assemblies.
11323         (LoadAllImportedTypes): New method fills static table with exported types
11324         from all referenced assemblies.
11325         (Modules): New property returns all assembly modules.
11326
11327 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11328
11329         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11330         throwing a parser error.
11331
11332         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11333         which removes the hardcoded get_/set_ prefixes for properties, as
11334         IL allows for the properties to be named something else.  
11335
11336         Bug #56013
11337
11338         * expression.cs: Do not override operand before we know if it is
11339         non-null.  Fix 56207
11340
11341 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11342
11343         * typemanager.cs: support for pinned variables.
11344
11345 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11346
11347         * decl.cs, typemanager.cs: Avoid using an arraylist
11348         as a buffer if there is only one result set.
11349
11350 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11351
11352         * expression.cs: Make sure you cant call a static method
11353         with an instance expression, bug #56174.
11354
11355 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
11356
11357         * class.cs (IsDuplicateImplementation): Improve error reporting to
11358         flag 663 (method only differs in parameter modifier).
11359
11360         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11361         in preprocessor directives.
11362
11363         * location.cs (LookupFile): Allow for the empty path.
11364
11365         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
11366         better approach for some of that patch, but its failing with the
11367         CharSet enumeration.  For now try/catch will do.
11368
11369         * typemanager.cs: Do not crash if a struct does not have fields.
11370         Fixes 56150.
11371
11372 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11373
11374         * expression.cs: cs0213, cant fix a fixed expression.
11375         fixes 50231.
11376
11377 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11378
11379         * cs-parser.jay: detect invalid embeded statements gracefully.
11380         bug #51113.
11381
11382 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11383
11384         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11385         As a regex:
11386         s/
11387         the invocation type may not be a subclass of the tye of the item/
11388         The type of the item must be a subclass of the invocation item.
11389         /g
11390
11391         Fixes bug #50820.
11392
11393 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11394
11395         * attribute.cs: Added methods to get a string and a bool from an
11396         attribute. Required to information from AssemblyKeyFileAttribute,
11397         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11398         * codegen.cs: Modified AssemblyName creation to include support for
11399         strongnames. Catch additional exceptions to report them as CS1548.
11400         * compiler.csproj: Updated include CryptoConvert.cs.
11401         * compiler.csproj.user: Removed file - user specific configuration.
11402         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11403         Mono.Security assembly. The original class is maintained and tested in
11404         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11405         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11406         like CSC 8.0 (C# v2) supports.
11407         * Makefile: Added CryptoConvert.cs to mcs sources.
11408         * rootcontext.cs: Added new options for strongnames.
11409
11410 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11411
11412         * driver.cs: For --expect-error, report error code `2'
11413         if the program compiled with no errors, error code `1' if
11414         it compiled with an error other than the one expected.
11415
11416 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11417
11418         * compiler.csproj: Updated for Visual Studio .NET 2003.
11419         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11420         * compiler.sln: Updated for Visual Studio .NET 2003.
11421
11422 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11423
11424         * expression.cs: Fix bug #47234. We basically need to apply the
11425         rule that we prefer the conversion of null to a reference type
11426         when faced with a conversion to 'object' (csc behaviour).
11427
11428 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11429
11430         * statement.cs: Shorter form for foreach, eliminates
11431         a local variable. r=Martin.
11432
11433 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11434
11435         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11436         checks if we can use brtrue/brfalse to test for 0.
11437         * expression.cs: use the above in the test for using brtrue/brfalse.
11438         cleanup code a bit.
11439
11440 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11441
11442         * expression.cs: Rewrite string concat stuff. Benefits:
11443
11444         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11445         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11446         rather than a concat chain.
11447
11448         * typemanager.cs: Add lookups for more concat overloads.
11449
11450 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11451
11452         * expression.cs: Emit shorter il code for array init.
11453
11454         newarr
11455         dup
11456         // set 1
11457
11458         // set 2
11459
11460         newarr
11461         stloc.x
11462
11463         ldloc.x
11464         // set 1
11465
11466         ldloc.x
11467         // set 2
11468
11469 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11470
11471         * statement.cs: Before, two switch blocks would be merged if the
11472         total size of the blocks (end_item - begin_item + 1) was less than
11473         two times the combined sizes of the blocks.
11474
11475         Now, it will only merge if after the merge at least half of the
11476         slots are filled.
11477
11478         fixes 55885.
11479
11480 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11481
11482         * class.cs : csc build fix for GetMethods(). See bug #52503.
11483
11484 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11485
11486         * expression.cs: Make sure fp comparisons work with NaN.
11487         This fixes bug #54303. Mig approved this patch a long
11488         time ago, but we were not able to test b/c the runtime
11489         had a related bug.
11490
11491 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11492
11493         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11494
11495 2004-03-19  Martin Baulig  <martin@ximian.com>
11496
11497         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11498         error here and not in our caller.
11499
11500 2004-03-19  Martin Baulig  <martin@ximian.com>
11501
11502         * interface.cs: Completely killed this file.
11503         (Interface): We're now a TypeContainer and live in class.cs.
11504
11505         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11506         argument; we're now also called for interfaces.
11507         (TypeContainer.DefineMembers): Allow this method being called
11508         multiple times.
11509         (TypeContainer.GetMethods): New public method; formerly known as
11510         Interface.GetMethod().  This is used by PendingImplementation.
11511         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11512         it's now private and non-static.
11513         (Interface): Moved this here; it's now implemented similar to
11514         Class and Struct.
11515         (Method, Property, Event, Indexer): Added `bool is_interface'
11516         argument to their .ctor's.
11517         (MemberBase.IsInterface): New public field.
11518
11519         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11520         instances instead of InterfaceMethod, InterfaceProperty, etc.
11521         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11522         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11523
11524 2004-03-19  Martin Baulig  <martin@ximian.com>
11525
11526         * class.cs (MethodCore.IsDuplicateImplementation): New private
11527         method which does the CS0111 checking.
11528         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11529         Use IsDuplicateImplementation().
11530
11531 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11532
11533         * decl.cs (FindMemberToOverride): New method to find the correct
11534         method or property to override in the base class.
11535         * class.cs
11536             - Make Method/Property use the above method to find the
11537               version in the base class.
11538             - Remove the InheritableMemberSignatureCompare as it is now
11539               dead code.
11540
11541         This patch makes large code bases much faster to compile, as it is
11542         O(n) rather than O(n^2) to do this validation.
11543
11544         Also, it fixes bug 52458 which is that nested classes are not
11545         taken into account when finding the base class member.
11546
11547         Reviewed/Approved by Martin.
11548
11549 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11550
11551         * interface.cs: In all interface classes removed redundant
11552         member initialization.
11553
11554 2004-03-16  Martin Baulig  <martin@ximian.com>
11555
11556         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11557
11558 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11559
11560         * decl.cs (DefineTypeAndParents): New helper method to define a
11561         type's containers before the type itself is defined;  This is a
11562         bug exposed by the recent changes to Windows.Forms when an
11563         implemented interface was defined inside a class that had not been
11564         built yet.   
11565
11566         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11567
11568         (Check): Loop correctly to report errors modifiers
11569         (UNSAFE was not in the loop, since it was the same as TOP).
11570
11571         * interface.cs: Every interface member now takes a ModFlags,
11572         instead of a "is_new" bool, which we set on the base MemberCore. 
11573
11574         Every place where we called "UnsafeOk" in the interface, now we
11575         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11576         the unsafe settings from the member declaration instead of the
11577         container interface. 
11578
11579         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11580
11581         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11582         `set_indexer_name' to the pending bits (one per type).
11583
11584         We fixed a bug today that was picking the wrong method to
11585         override, since for properties the existing InterfaceMethod code
11586         basically ignored the method name.  Now we make sure that the
11587         method name is one of the valid indexer names.
11588
11589 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11590  
11591         * support.cs (SeekableStreamReader): Keep track of stream byte
11592         positions and don't mix them with character offsets to the buffer.
11593
11594         Patch from Gustavo Giráldez
11595
11596 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11597
11598         * interface.cs (InterfaceSetGetBase): Removed double member
11599         initialization, base class does it as well.
11600
11601 2004-03-13  Martin Baulig  <martin@ximian.com>
11602
11603         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11604         when compiling corlib.
11605
11606 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11607
11608         * convert.cs (ExplicitConversion): We were reporting an error on
11609         certain conversions (object_type source to a value type, when the
11610         expression was `null') before we had a chance to pass it through
11611         the user defined conversions.
11612
11613         * driver.cs: Replace / and \ in resource specifications to dots.
11614         Fixes 50752
11615
11616         * class.cs: Add check for duplicate operators.  Fixes 52477
11617
11618 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11619
11620         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11621         that are in the middle of the statements, not only at the end.
11622         Fixes #54987
11623
11624         * class.cs (TypeContainer.AddField): No longer set the
11625         `HaveStaticConstructor' flag, now we call it
11626         `UserDefineStaticConstructor' to diferentiate the slightly
11627         semantic difference.
11628
11629         The situation is that we were not adding BeforeFieldInit (from
11630         Modifiers.TypeAttr) to classes that could have it.
11631         BeforeFieldInit should be set to classes that have no static
11632         constructor. 
11633
11634         See:
11635
11636         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11637
11638         And most importantly Zoltan's comment:
11639
11640         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11641
11642         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11643          before its static fields are used', i.e. initialization does not need
11644          to be triggered by the first access to the type. Setting this flag
11645          helps the JIT to compile better code, since it can run the static
11646          constructor at JIT time, and does not need to generate code to call it
11647          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11648          this flag for lots of classes like String. 
11649          
11650          csc sets this flag if the type does not have an explicit static 
11651          constructor. The reasoning seems to be that if there are only static
11652          initalizers for a type, and no static constructor, then the programmer
11653          does not care when this initialization happens, so beforefieldinit
11654          can be used.
11655          
11656          This bug prevents the AOT compiler from being usable, since it 
11657          generates so many calls to mono_runtime_class_init that the AOT code
11658          is much slower than the JITted code. The JITted code is faster, 
11659          because it does not generate these calls if the vtable is type is
11660          already initialized, which is true in the majority of cases. But the
11661          AOT compiler can't do this."
11662
11663 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11664
11665         * class.cs (MethodData.Emit): Refactor the code so symbolic
11666         information is generated for destructors;  For some reasons we
11667         were taking a code path that did not generate symbolic information
11668         before. 
11669
11670 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11671
11672         * class.cs: Create a Constructor.CheckBase method that
11673         takes care of all validation type code. The method
11674         contains some code that was moved from Define.
11675
11676         It also includes new code that checks for duplicate ctors.
11677         This fixes bug #55148.
11678
11679 2004-03-09  Joshua Tauberer <tauberer@for.net>
11680
11681         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11682         a { ... }-style array creation invokes EmitStaticInitializers
11683         which is not good for reference-type arrays.  String, decimal
11684         and now null constants (NullCast) are not counted toward
11685         static initializers.
11686
11687 2004-03-05  Martin Baulig  <martin@ximian.com>
11688
11689         * location.cs (SourceFile.HasLineDirective): New public field;
11690         specifies whether the file contains or is referenced by a "#line"
11691         directive.
11692         (Location.DefineSymbolDocuments): Ignore source files which
11693         either contain or are referenced by a "#line" directive.        
11694
11695 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11696
11697         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11698         direct access to our parent, so check the method inline there.
11699
11700 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11701
11702         * expression.cs (Invocation.EmitCall): Miguel's last commit
11703         caused a regression. If you had:
11704
11705             T t = null;
11706             t.Foo ();
11707
11708         In Foo the implict this would be null.
11709
11710 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11711
11712         * expression.cs (Invocation.EmitCall): If the method is not
11713         virtual, do not emit a CallVirt to it, use Call.
11714
11715         * typemanager.cs (GetFullNameSignature): Improve the method to
11716         cope with ".ctor" and replace it with the type name.
11717
11718         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11719         as an argument the ConstructorBuilder where it is being defined,
11720         to catch the recursive constructor invocations.
11721
11722 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11723
11724         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11725         routines to check if a type is an enumerable/enumerator allow
11726         classes that implement the IEnumerable or IEnumerator interfaces.
11727
11728         * class.cs (Property, Operator): Implement IIteratorContainer, and
11729         implement SetYields.
11730
11731         (Property.Define): Do the block swapping for get_methods in the
11732         context of iterators.   We need to check if Properties also
11733         include indexers or not.
11734
11735         (Operator): Assign the Block before invoking the
11736         OperatorMethod.Define, so we can trigger the Iterator code
11737         replacement. 
11738
11739         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11740         Property and Operator classes are not created when we parse the
11741         declarator but until we have the block completed, so we use a
11742         singleton SimpleIteratorContainer.Simple to flag whether the
11743         SetYields has been invoked.
11744
11745         We propagate this setting then to the Property or the Operator to
11746         allow the `yield' to function.
11747
11748 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11749
11750         * codegen.cs: Implemented attribute support for modules.
11751         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11752         Assembly/Module functionality.
11753
11754         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11755         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11756         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11757
11758 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11759
11760         * interface.cs (FindMembers): The operation is performed on all base
11761         interfaces and not only on the first. It is required for future CLS Compliance patch.
11762
11763 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11764
11765         * statement.cs, codegen.cs:
11766         This patch deals with patterns such as:
11767
11768         public class List : IEnumerable {
11769
11770                 public MyEnumerator GetEnumerator () {
11771                         return new MyEnumerator(this);
11772                 }
11773
11774                 IEnumerator IEnumerable.GetEnumerator () {
11775                         ...
11776                 }
11777                 
11778                 public struct MyEnumerator : IEnumerator {
11779                         ...
11780                 }
11781         }
11782
11783         Before, there were a few things we did wrong:
11784         1) we would emit callvirt on a struct, which is illegal
11785         2) we emited ldarg when we needed to emit ldarga
11786         3) we would mistakenly call the interface methods on an enumerator
11787         type that derived from IEnumerator and was in another assembly. For example:
11788
11789         public class MyEnumerator : IEnumerator
11790
11791         Would have the interface methods called, even if there were public impls of the
11792         method. In a struct, this lead to invalid IL code.
11793
11794 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11795
11796         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11797           renamed to Emit.
11798
11799         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11800
11801 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11802
11803         * cs-parser.jay: Fix small regression: we were not testing V2
11804         compiler features correctly.
11805
11806         * interface.cs: If the emit context is null, then create one
11807
11808 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11809
11810         * decl.cs (GetSignatureForError): New virtual method to get full name
11811           for error messages.
11812
11813         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11814           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11815
11816         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11817           Duplicated members and code in these classes has been removed.
11818           Better encapsulation in these classes.
11819
11820 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11821
11822         * assign.cs (Assign.DoResolve): When dealing with compound
11823         assignments, there is a new rule in ECMA C# 2.4 (might have been
11824         there before, but it is documented here) that states that in:
11825
11826         a op= b;
11827
11828         If b is of type int, and the `op' is a shift-operator, then the
11829         above is evaluated as:
11830
11831         a = (int) a op b 
11832
11833         * expression.cs (Binary.ResolveOperator): Instead of testing for
11834         int/uint/long/ulong, try to implicitly convert to any of those
11835         types and use that in pointer arithmetic.
11836
11837         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11838         method to print information for from the type, not from the
11839         null-method we were given.
11840
11841 2004-02-01  Duncan Mak  <duncan@ximian.com>
11842
11843         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11844         parsing for cmd, fixes bug #53694.
11845
11846 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11847
11848         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11849         in the member name duplication tests. Property and operator name duplication
11850         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11851
11852 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11853
11854         * interface.cs (PopulateMethod): Fixed crash when interface method
11855         returns not existing type (error test cs0246-3.cs).
11856
11857 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11858
11859         * cs-parser.jay (interface_accessors): Re-write actions to also
11860         store attributes attached to get and set methods. Fix spelling
11861         while at it.
11862
11863         (inteface_property_declaration): Modify accordingly.
11864
11865         (InterfaceAccessorInfo): New helper class to store information to pass
11866         around between rules that use interface_accessors.
11867
11868         * interface.cs (Emit): Apply attributes on the get and set
11869         accessors of properties and indexers too.
11870
11871         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11872         right MethodBuilder when applying attributes to the get and set accessors.
11873
11874 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11875
11876         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11877
11878 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11879
11880         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11881
11882 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11883
11884         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11885         changes that treat `yield' specially when present before `break'
11886         or `return' tokens.
11887
11888         * cs-tokenizer.cs: yield is no longer a keyword.
11889
11890 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11891
11892         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11893         setting for default constructors.
11894         For default constructors are almost every time set wrong Modifier. The
11895         generated IL code has been alright. But inside mcs this values was
11896         wrong and this was reason why several of my CLS Compliance tests
11897         failed.
11898
11899 2004-01-22  Martin Baulig  <martin@ximian.com>
11900
11901         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11902         not a QualifiedIdentifier.  This is what `type_name_expression'
11903         was previously doing.
11904         (type_name_expression): Removed; the code is now in
11905         `namespace_or_type_name'.
11906         (qualified_identifier): Removed, use `namespace_or_type_name'
11907         instead.
11908         (QualifiedIdentifier): Removed this class.      
11909
11910 2004-01-22  Martin Baulig  <martin@ximian.com>
11911
11912         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11913         not a string as alias name.
11914
11915 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11916
11917         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11918         #52730 bug, and instead compute correctly the need to use a
11919         temporary variable when requesting an address based on the
11920         static/instace modified of the field and the constructor.
11921  
11922 2004-01-21  Martin Baulig  <martin@ximian.com>
11923
11924         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11925         class and namespace before looking up aliases.  Fixes #52517.
11926
11927 2004-01-21  Martin Baulig  <martin@ximian.com>
11928
11929         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11930         assinged in a 'try'; fixes exception4.cs.
11931
11932 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11933         * class.cs : Implemented parameter-less constructor for TypeContainer
11934
11935         * decl.cs: Attributes are now stored here. New property OptAttributes
11936
11937         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11938
11939         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11940
11941 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11942
11943         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11944           (CSharpSignature): New method for indexer and property signature.
11945
11946 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11947
11948         * pending.cs (IsVirtualFilter): Faster implementation.
11949
11950 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11951
11952         * typemanager.cs: Avoid inclusion of same assembly more than once.
11953
11954 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11955
11956         * cs-parser.jay: Fixed problem where the last assembly attribute
11957           has been applied also to following declaration (class, struct, etc.)
11958           
11959 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11960
11961         * class.cs: Added error CS0538, CS0539 reporting.
11962         Fixed crash on Microsoft runtime when field type is void.
11963
11964         * cs-parser.jay: Added error CS0537 reporting.
11965
11966         * pending.cs: Added error CS0535 reporting.
11967         Improved error report for errors CS0536, CS0534.
11968
11969 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11970
11971         Merge a few bits from the Anonymous Method MCS tree.
11972
11973         * statement.cs (ToplevelBlock): New class for toplevel methods,
11974         will hold anonymous methods, lifted variables.
11975
11976         * cs-parser.jay: Create toplevel blocks for delegates and for
11977         regular blocks of code. 
11978
11979 2004-01-20  Martin Baulig  <martin@ximian.com>
11980
11981         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11982         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11983         and `NeedExplicitReturn'; added `IsLastStatement'.
11984         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11985         have a `ReturnLabel' or we're not unreachable.
11986
11987         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11988         child's reachability; don't just override ours with it.  Fixes
11989         #58058 (lluis's example).
11990         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11991         InFinally(), InLoop(), InSwitch() and
11992         BreakCrossesTryCatchBoundary() methods.
11993
11994         * statement.cs (Return): Do all error checking in Resolve().
11995         Unless we are the last statement in a top-level block, always
11996         create a return label and jump to it.
11997         (Break, Continue): Do all error checking in Resolve(); also make
11998         sure we aren't leaving a `finally'.
11999         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12000         statement in a top-level block.
12001         (Block.Flags): Added `IsDestructor'.
12002         (Block.IsDestructor): New public property.
12003
12004 2004-01-20  Martin Baulig  <martin@ximian.com>
12005
12006         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12007
12008 2004-01-20  Martin Baulig  <martin@ximian.com>
12009
12010         * statement.cs (Statement.ResolveUnreachable): New public method.
12011         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12012         (Block.Resolve): Resolve unreachable statements.
12013
12014 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12015
12016         * expression.cs: We need to fix the case where we do
12017         not have a temp variable here.
12018
12019         * assign.cs: Only expression compound assignments need
12020         temporary variables.
12021
12022 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12023
12024         * flowanalysis.cs: Reduce memory allocation in a few ways:
12025           - A block with no variables should not allocate a bit
12026             vector for itself.
12027           - A method with no out parameters does not need any tracking
12028             for assignment of the parameters, so we need not allocate
12029             any data for it.
12030           - The arrays:
12031                 public readonly Type[] VariableTypes;
12032                 public readonly string[] VariableNames;
12033             Are redundant. The data is already stored in the variable
12034             map, so we need not allocate another array for it.
12035           - We need to add alot of checks for if (params | locals) == null
12036             due to the first two changes.
12037
12038 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12039
12040         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12041         implement IMemoryLocation, we store a copy on a local variable and
12042         take the address of it.  Patch from Benjamin Jemlich
12043
12044         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12045         to use a special "type_name_expression" rule which reduces the
12046         number of "QualifiedIdentifier" classes created, and instead
12047         directly creates MemberAccess expressions.
12048
12049 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12050
12051         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12052         that fixes #52853.  Null literal assignment to ValueType
12053
12054         * class.cs (MethodData.Emit): Instead of checking the name of the
12055         method to determine if its a destructor, create a new derived
12056         class from Method called Destructor, and test for that.  
12057
12058         * cs-parser.jay: Create a Destructor object instead of a Method.  
12059
12060         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12061
12062         Fixes: 52933
12063
12064 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12065
12066         * expression.cs (Binary.ResolveOperator): Perform an implicit
12067         conversion from MethodGroups to their delegate types on the
12068         Addition operation.
12069
12070         * delegate.cs: Introduce a new class DelegateCreation that is the
12071         base class for `NewDelegate' and `ImplicitDelegateCreation',
12072         factor some code in here.
12073
12074         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12075         conversion from MethodGroups to compatible delegate types. 
12076
12077         * ecore.cs (Expression.Resolve): Do not flag error 654
12078         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12079         we allow conversions from MethodGroups to delegate types now.
12080
12081         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12082         assignments in v2 either.
12083
12084 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12085
12086         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12087         static read-only fields in ctors.
12088
12089         Applied patch from Benjamin Jemlich 
12090
12091         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12092
12093 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12094
12095         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12096         here to return true, as they can be used like this:
12097
12098                 (XXX) int.MEMBER ()
12099
12100         Fixed 49836 and all the other dups
12101
12102 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12103
12104         * driver.cs: Implement /win32res and /win32icon.
12105
12106 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12107
12108         * cs-parser.jay: Add a rule to improve error handling for the
12109         common mistake of placing modifiers after the type.
12110
12111 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12112
12113         * cs-parser.jay (interface_event_declaration): Catch
12114         initialization of events on interfaces, and report cs0068
12115
12116         * cs-parser.jay (interface_event_declaration): Catch
12117         initialization of events. 
12118
12119         * ecore.cs: Better report missing constructors.
12120
12121         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12122         the error reporting done in the wrong place.  Fix.
12123
12124         * expression.cs (Binary.ResolveOperator): Catch the 
12125         operator + (E x, E y) error earlier, and later allow for implicit
12126         conversions in operator +/- (E e, U x) from U to the underlying
12127         type of E.
12128
12129         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12130         52596, if the container class is abstract, the default constructor
12131         is protected otherwise its public (before, we were always public).
12132
12133         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12134         fixed statement.
12135
12136         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12137         Jemlich that fixes bug #52597, MCS was generating invalid code for
12138         idisposable structs.   Thanks to Ben for following up with this
12139         bug as well.
12140
12141 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12142
12143         * driver.cs: Allow assemblies without code to be generated, fixes
12144         52230.
12145
12146 2004-01-07  Nick Drochak <ndrochak@gol.com>
12147
12148         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12149
12150 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12151
12152         * cs-parser.jay: Add rules to improve error reporting if fields or
12153         methods are declared at the namespace level (error 116)
12154
12155         * Add rules to catch event add/remove
12156
12157 2004-01-04  David Sheldon <dave-mono@earth.li>
12158
12159   * expression.cs: Added matching ")" to error message for 
12160   CS0077
12161
12162 2004-01-03 Todd Berman <tberman@gentoo.org>
12163
12164         * ecore.cs, attribute.cs:
12165         Applying fix from #52429.
12166
12167 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12168
12169         * ecore.cs, expression.cs, statement.cs:
12170         Total rewrite of how we handle branching. We
12171         now handle complex boolean expressions with fewer
12172         jumps. As well if (x == 0) no longer emits a ceq.
12173
12174         if (x is Foo) is much faster now, because we generate
12175         better code.
12176
12177         Overall, we get a pretty big improvement on our benchmark
12178         tests. The code we generate is smaller and more readable.
12179
12180         I did a full two-stage bootstrap. The patch was reviewed
12181         by Martin and Miguel.
12182
12183 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12184
12185         * cs-parser.jay: Make primary_expression not take a QI.
12186         we dont need this because the member_access rule covers
12187         us here. So we replace the rule with just IDENTIFIER.
12188
12189         This has two good effects. First, we remove a s/r conflict.
12190         Second, we allocate many fewer QualifiedIdentifier objects.
12191
12192 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12193
12194         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12195         set the correct information via SRE. This prevents
12196         hanging on the MS runtime. Fixes #29374.
12197
12198 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12199
12200         * convert.cs: correctly handle conversions to value types
12201         from Enum and ValueType as unboxing conversions.
12202
12203         Fixes bug #52569. Patch by Benjamin Jemlich.
12204
12205 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12206
12207         * expression.cs (BetterConversion): Prefer int -> uint
12208         over int -> ulong (csc's behaviour). This fixed bug #52046.
12209
12210 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12211
12212         * decl.cs (MemberCache.FindMembers): now returns a
12213         MemberInfo [].
12214
12215         * typemanager.cs: In general, go with with ^^.
12216         (CopyNewMethods): take an IList.
12217         (RealMemberLookup): Only allocate an arraylist
12218         if we copy from two sets of methods.
12219
12220         This change basically does two things:
12221         1) Fewer array lists allocated due to CopyNewMethods.
12222         2) the explicit cast in MemberList costed ALOT.
12223
12224 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12225
12226         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12227         a hashtable to avoid needless string allocations when an identifier is
12228         used more than once (the common case).
12229
12230 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12231
12232         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12233         is broken, it will not return anything. So, we
12234         have to use the information we have in mcs to
12235         do the task.
12236
12237         * typemanager.cs: Add a cache for GetInterfaces,
12238         since this will now be used more often (due to ^^)
12239
12240         (GetExplicitInterfaces) New method that gets the
12241         declared, not effective, interfaces on a type
12242         builder (eg, if you have interface IFoo, interface
12243         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12244         { IBar }.
12245
12246         This patch makes MCS able to bootstrap itself on
12247         Windows again.
12248
12249 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12250
12251         * expression.cs: Remove the Nop's that Miguel put
12252         in by mistake.
12253
12254 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12255
12256         * report.cs, codegen.cs: Give the real stack trace to
12257         the error when an exception is thrown.
12258
12259 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12260
12261         * decl.cs: only allocate hashtables for ifaces if 
12262         it is an iface!
12263
12264 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12265
12266         * expression.cs: fix the error from cs0121-2.cs
12267         (a parent interface has two child interfaces that
12268         have a function with the same name and 0 params
12269         and the function is called through the parent).
12270
12271 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12272
12273         * class.cs, rootcontext.cs, typmanager.cs: do not
12274         leak pointers.
12275
12276 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12277
12278         * codegen.cs: remove stack for the ec flow branching.
12279         It is already a linked list, so no need.
12280
12281 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12282
12283         * Makefile: Allow custom profiler here.
12284
12285 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12286
12287         * typemanager.cs (LookupType):
12288           - Use a static char [], because split takes
12289             a param array for args, so it was allocating
12290             every time.
12291           - Do not store true in a hashtable, it boxes.
12292
12293 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12294
12295         * flowanalysis.cs: bytify common enums.
12296
12297 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12298
12299         * modifiers.cs: Add a new set of flags for the
12300         flags allowed on explicit interface impls.
12301         * cs-parser.jay: catch the use of modifiers in
12302         interfaces correctly.
12303         * class.cs: catch private void IFoo.Blah ().
12304
12305         All related to bug #50572.
12306
12307 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12308
12309         * decl.cs: Rewrite the consistant accessability checking.
12310         Accessability is not linear, it must be implemented in
12311         a tableish way. Fixes #49704.
12312
12313 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12314
12315         * expression.cs: Handle negation in a checked context.
12316         We must use subtraction from zero. Fixes #38674.
12317
12318 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12319
12320         * class.cs: Ignore static void main in DLLs.
12321         * rootcontext.cs: Handle the target type here,
12322         since we are have to access it from class.cs
12323         * driver.cs: account for the above.
12324
12325 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12326
12327         * report.cs: Give line numbers and files if available.
12328
12329 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12330
12331         * driver.cs: Implement /addmodule.
12332
12333         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12334         ModuleBuilders.
12335
12336 2003-12-20  Martin Baulig  <martin@ximian.com>
12337
12338         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12339         (FieldBase.IsAssigned): Removed this field.
12340         (FieldBase.SetAssigned): New public method.
12341         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12342
12343 2003-12-20  Martin Baulig  <martin@ximian.com>
12344
12345         * expression.cs (LocalVariableReference.DoResolve): Don't set
12346         `vi.Used' if we're called from DoResolveLValue().
12347
12348         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12349         returns the usage vector it just merged into the current one -
12350         pass this one to UsageWarning().
12351         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12352         of the `EmitContext', don't call this recursively on our children.
12353
12354 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12355
12356         * driver.cs: Implement /target:module.
12357
12358 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12359
12360         * support.cs (CharArrayHashtable): New helper class.
12361
12362         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12363         char arrays, not strings, so we can avoid creating a string in
12364         consume_identifier if the identifier is a keyword.
12365
12366 2003-12-16  Martin Baulig  <martin@ximian.com>
12367
12368         * statement.cs (LocalInfo.Assigned): Removed this property.
12369         (LocalInfo.Flags): Removed `Assigned'.
12370         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12371         and uses flow analysis.
12372         (Block.UsageWarning): Made this method private.
12373         (Block.Resolve): Call UsageWarning() if appropriate.
12374
12375         * expression.cs (LocalVariableReference.DoResolve): Always set
12376         LocalInfo.Used here.
12377
12378 2003-12-13  Martin Baulig  <martin@ximian.com>
12379
12380         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12381         any value here; we're now using flow analysis to figure out
12382         whether a statement/block returns a value.
12383
12384 2003-12-13  Martin Baulig  <martin@ximian.com>
12385
12386         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12387         working again.
12388         (FlowBranching.MergeFinally): Don't call
12389         `branching.CheckOutParameters()' here, this is called in
12390         MergeTopBlock().
12391         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12392         when adding the `finally' vector.       
12393
12394 2003-12-13  Martin Baulig  <martin@ximian.com>
12395
12396         * flowanalysis.cs
12397         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12398         actually work and also fix #48962.
12399
12400 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12401
12402         * decl.cs: Do not check System.Object for nested types,
12403         since we know it does not have any. Big bang for buck:
12404
12405         BEFORE:
12406            Run 1:   8.35 seconds
12407            Run 2:   8.32 seconds
12408            corlib:  17.99 seconds
12409         AFTER:
12410            Run 1:   8.17 seconds
12411            Run 2:   8.17 seconds
12412            corlib:  17.39 seconds
12413
12414 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12415
12416         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12417         time we are returning 0 members, so we save alot here.
12418
12419 2003-12-11  Martin Baulig  <martin@ximian.com>
12420
12421         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12422         `MergeChild()', also just take the `FlowBranching' as argument;
12423         call Merge() on it and return the result.
12424         (FlowBranching.Merge): We don't need to do anything if we just
12425         have one sibling.
12426
12427 2003-12-11  Martin Baulig  <martin@ximian.com>
12428
12429         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12430         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12431         Maurer for this idea.
12432
12433 2003-12-11  Martin Baulig  <martin@ximian.com>
12434
12435         * flowanalysis.cs (MergeResult): This class is now gone; we now
12436         use the `UsageVector' for this.  The reason for this is that if a
12437         branching just has one sibling, we don't need to "merge" them at
12438         all - that's the next step to do.
12439         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12440         `MergeResult'.
12441
12442 2003-12-11  Martin Baulig  <martin@ximian.com>
12443
12444         Reworked flow analyis and made it more precise and bug-free.  The
12445         most important change is that we're now using a special `Reachability'
12446         class instead of having "magic" meanings of `FlowReturns'.  I'll
12447         do some more cleanups and optimizations and also add some more
12448         documentation this week.
12449
12450         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12451         largely reworked this class.
12452         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12453         the new `Reachability' class instead of having "magic" values here.
12454         (FlowBranching): We're now using an instance of `Reachability'
12455         instead of having separate `Returns', `Breaks' etc. fields.
12456
12457         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12458         based on flow analysis; ignore the return value of block.Emit ().
12459
12460 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12461
12462         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12463         if they are private.
12464
12465 2003-12-09  Martin Baulig  <martin@ximian.com>
12466
12467         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12468         call them directly on the UsageVector.
12469
12470 2003-12-09  Martin Baulig  <martin@ximian.com>
12471
12472         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12473         Changed return type from `FlowReturns' to `Reachability'.
12474
12475 2003-12-09  Martin Baulig  <martin@ximian.com>
12476
12477         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12478         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12479         `Reachable' fields with a single `Reachability' one.
12480
12481 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12482
12483         * class.cs (FindMembers): Remove foreach's.
12484
12485         Bootstrap times:
12486
12487         BEFORE
12488                 Run 1:   8.74 seconds
12489                 Run 2:   8.71 seconds
12490
12491         AFTER
12492                 Run 1:   8.64 seconds
12493                 Run 2:   8.58 seconds
12494
12495
12496 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12497
12498         * cs-parser.jay:
12499         * gen-treedump.cs:
12500         * statement.cs:
12501         This patch does a few things:
12502                 1. EmptyStatement is now a singleton, so it is never reallocated.
12503                 2. All blah is EmptyStatement constructs have been changed to
12504                    blah == EmptyStatement.Value, which is much faster and valid
12505                    now that EmptyStatement is a singleton.
12506                 3. When resolving a block, rather than allocating a new array for
12507                    the non-empty statements, empty statements are replaced with
12508                    EmptyStatement.Value
12509                 4. Some recursive functions have been made non-recursive.
12510         Mainly the performance impact is from (3), however (1) and (2) are needed for
12511         this to work. (4) does not make a big difference in normal situations, however
12512         it makes the profile look saner.
12513
12514         Bootstrap times:
12515
12516         BEFORE
12517         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12518         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12519         Total memory allocated: 56397 KB
12520
12521         AFTER
12522         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12523         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12524         Total memory allocated: 55666 KB
12525
12526 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12527
12528         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12529         than the hashtable in a hashtable version
12530
12531         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12532         we always end up concating a string. This results in a huge perf
12533         loss, because many strings have to be tracked by the GC. In this
12534         patch, we first use a hashtable that works with two keys, so that
12535         the strings do not need to be concat'ed.
12536
12537         Bootstrap times:
12538         BEFORE
12539                 Run 1:   8.74 seconds
12540                 Run 2:   8.71 seconds
12541
12542         AFTER
12543                 Run 1:   8.65 seconds
12544                 Run 2:   8.56 seconds
12545
12546 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12547
12548         * Makefile: Add a new target `do-time' that does a quick and simple
12549         profile, leaving easy to parse output.
12550
12551 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12552
12553         * codegen.cs (Init): Create the dynamic assembly with 
12554         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12555
12556 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12557
12558         * support.cs: Make the PtrHashtable use only one
12559         instance of its comparer.
12560
12561 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12562
12563         * typemanager.cs: Fix lookup of GetNamespaces.
12564
12565 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12566
12567         * expression.cs: Removed redundant line.
12568
12569         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12570         ArrayLists, use for loops with bounds.  
12571
12572         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12573         arraylist.
12574
12575         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12576         arraylists, use for loop with bounds.
12577
12578         The above three changes give us a 0.071 second performance
12579         improvement out of 3.294 seconds down to 3.223.  On my machine
12580         the above changes reduced the memory usage by 1,387 KB during
12581         compiler bootstrap.
12582
12583         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12584         QualifiedIdentifiers.  Before we created a new string through
12585         concatenation, and mostly later on, the result would be
12586         manipulated by DecomposeQI through string manipulation.
12587
12588         This reduced the compiler memory usage for bootstrapping from
12589         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12590         compile times in 0.05 seconds.
12591
12592 2003-11-28  Dick Porter  <dick@ximian.com>
12593
12594         * support.cs: Do string compares with the Invariant culture.
12595
12596         * rootcontext.cs: 
12597         * gen-treedump.cs: 
12598         * expression.cs: 
12599         * driver.cs: 
12600         * decl.cs: 
12601         * codegen.cs: 
12602         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12603         the comparison is done with the Invariant culture.
12604
12605 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12606
12607         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12608         GetEnumerator method.
12609
12610         (ProbeCollectionType): Iterate starting at the most specific type
12611         upwards looking for a GetEnumerator
12612
12613         * expression.cs: Shift count can be up to 31 for int/uint and 63
12614         for long/ulong.
12615
12616 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12617
12618         * statement.cs (Block.LookupLabel): Also look for the label on the
12619         children blocks.  Use a hash table to keep track of visited
12620         nodes. 
12621
12622         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12623         we actually did transform the other operand, otherwise fall back
12624         to the common codepath that casts to long.
12625
12626         * cs-tokenizer.cs: Use the same code pattern as the int case.
12627         Maybe I should do the parsing myself, and avoid depending on the
12628         Parse routines to get this done.
12629
12630 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12631
12632         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12633         which fixes bug 51347.  This time test it.
12634
12635         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12636         attributes for example can not tell the difference between these.
12637         The difference was only a syntax feature of the language. 
12638
12639         * attribute.cs: Apply attributes to delegates.
12640
12641         * delegate.cs: Call the apply attributes method.
12642
12643 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12644
12645         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12646         comparing 0 vs Byte.MinValue, not the value
12647
12648         (ImplicitConversionRequired): When reporting a conversion error,
12649         use error 31 to print out the constant error instead of the
12650         simpler 29.
12651
12652         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12653         which fixes bug 51347.
12654
12655 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12656
12657         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12658         which fixes the -warnaserror command line option.
12659
12660 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12661
12662         * cfold.cs (DoNumericPromotions): During constant folding of
12663         additions on UIntConstant, special case intconstants with
12664         IntConstants like we do on the expression binary operator. 
12665
12666 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12667
12668         * convert.cs (ImplicitReferenceConversion): We were missing a case
12669         (System.Enum are not value types or class types, so we need to
12670         classify them separatedly).
12671
12672         * driver.cs: We do not support error 2007.
12673
12674 2003-11-12 Jackson Harper <jackson@ximian.com>
12675
12676         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12677         system directory. Also use the full file name so users can
12678         libraries names mscorlib-o-tron.dll in a non system dir.
12679
12680 2003-11-10  Martin Baulig  <martin@ximian.com>
12681
12682         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12683         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12684         calling `ResolveType()' on them, directly assign their `Type'.
12685
12686 2003-11-08  Martin Baulig  <martin@ximian.com>
12687
12688         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12689         return value and the `out parent' parameter.
12690         (TypeContainer.DefineType): Moved the CS0644 check into
12691         GetClassBases().  Don't pass the interface types to the
12692         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12693         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12694
12695         * ecore.cs (TypeExpr.IsAttribute): New property.
12696         (TypeExpr.GetInterfaces): New method.
12697
12698         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12699         TypeExpr instead of a Type.
12700         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12701         (Interface.DefineType): Don't pass the interface types to the
12702         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12703         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12704
12705         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12706         instead of a `Type[]'.
12707         (TypeManager.RegisterBuilder): Likewise.
12708         (TypeManager.AddUserInterface): Likewise.
12709         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12710         `Type[]' and also return a `TypeExpr[]'.
12711         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12712
12713 2003-11-08  Martin Baulig  <martin@ximian.com>
12714
12715         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12716         Expression.     
12717
12718 2003-11-08  Martin Baulig  <martin@ximian.com>
12719
12720         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12721         TypeManager.ResolveExpressionTypes().
12722
12723         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12724         instead of an Expression.
12725         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12726         (TypeExpression): New public class; formerly known as `TypeExpr'.
12727
12728         * expression.cs (ComposedCast): Derive from TypeExpr.
12729
12730         * typemanager.cs (TypeManager.system_*_expr): These are now
12731         TypExpr's instead of Expression's.
12732         (TypeManager.ResolveExpressionTypes): New public static function;
12733         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12734         of them.        
12735
12736 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12737
12738         * expression.cs (New.DoResolve): Do not dereference value that
12739         might be a null return.
12740
12741         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12742         sure that the constant value has the right type.  Fixes an
12743         unreported bug, similar to 50425.
12744
12745         * const.cs (Const.LookupConstantValue): Call
12746         ImplicitStandardConversionExists before doing a conversion to
12747         avoid havng the TypeManager.ChangeType do conversions.
12748
12749         Reduced the number of casts used
12750
12751         (Const.ChangeType): New routine to enable reuse of the constant
12752         type changing code from statement.
12753
12754         * typemanager.cs (ChangeType): Move common initialization to
12755         static global variables.
12756
12757         Fixes #50425.
12758
12759         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12760         every value type to go through, even if it was void.  Fix that. 
12761
12762         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12763         character of the define, and the is_identifier_part_character for
12764         the rest of the string.
12765
12766 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12767
12768         * expression.cs (UnaryMutator.EmitCode): When I updated
12769         LocalVariableReference.DoResolve, I overdid it, and dropped an
12770         optimization done on local variable references.
12771
12772 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12773
12774         * ecore.cs: Convert the return from Ldlen into an int.
12775
12776 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12777
12778         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12779         the accessibility, this is a special case for toplevel non-public
12780         classes (internal for instance).
12781
12782 2003-10-20  Nick Drochak <ndrochak@gol.com>
12783
12784         * ecore.cs: Fix typo and build.  Needed another right paren.
12785
12786 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12787
12788         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12789         `internal' case regular and protected, but not allowing protected
12790         to be evaluated later.  Bug 49840
12791
12792 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12793
12794         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12795         to kb.Nlast, and not the kb.nFirst to isolate the switch
12796         statement.
12797
12798         Extract the underlying type, so enumerations of long/ulong are
12799         treated like long/ulong.
12800
12801 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12802
12803         * expression.cs (New): Overload the meaning of RequestedType to
12804         track the possible creation of the NewDelegate type, since
12805         DoResolve is invoked more than once for new constructors on field
12806         initialization.
12807
12808         See bugs: #48800 and #37014
12809
12810         * cs-parser.jay (declare_local_constants): Take an arraylist
12811         instead of a single constant.
12812
12813         (local_constant_declaration): It should take a
12814         constant_declarators, not a constant_declarator.  Fixes 49487
12815
12816         * convert.cs: Fix error report.
12817
12818 2003-10-13 Jackson Harper <jackson@ximian.com>
12819
12820         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12821         bug #49611
12822
12823 2003-10-09  Martin Baulig  <martin@ximian.com>
12824
12825         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12826         to the .ctor.
12827         (MethodCore.DoDefineParameters): Removed the TypeContainer
12828         argument; use the DeclSpace which was passed to the .ctor instead.
12829         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12830         TypeContainer; we only need a DeclSpace here.
12831
12832 2003-10-09  Martin Baulig  <martin@ximian.com>
12833
12834         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12835         to the .ctor.
12836         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12837         EmitContext's .ctor.    
12838
12839 2003-10-09  Martin Baulig  <martin@ximian.com>
12840
12841         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12842         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12843         AsAccessible(), moved them as well.
12844
12845         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12846
12847 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12848
12849         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12850
12851 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12852
12853         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12854         generation for >=, as spotted by Paolo, bug 48679.  
12855         Patch from David Waite.
12856
12857         * cs-tokenizer.cs: Add handling for #pragma.
12858
12859         * cs-parser.jay: Allow for both yield and yield return in the
12860         syntax.  The anti-cobolization of C# fight will go on!
12861
12862         * class.cs (TypeBuilder.DefineType): Catch error condition here
12863         (Parent.DefineType erroring out and returning null).
12864
12865         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12866         coping with enumerations variables, we were mistakenly processing
12867         them as a regular value type instead of built-in types.  Fixes the
12868         bug #48063
12869
12870         * typemanager.cs (IsBuiltinOrEnum): New method.
12871
12872 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12873
12874         * cs-parser.jay: Upgrade: yield now needs the return clause.
12875
12876 2003-09-19  Martin Baulig  <martin@ximian.com>
12877
12878         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12879         `MemberCache parent' argument.  Normally, an interface doesn't
12880         have a parent type except System.Object, but we use this in gmcs
12881         for generic type parameters.
12882
12883 2003-09-18  Martin Baulig  <martin@ximian.com>
12884
12885         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12886         on `type.IsInterface'; don't check whether the type has a parent
12887         to determine whether it's an interface.
12888
12889 2003-09-15  Martin Baulig  <martin@ximian.com>
12890
12891         * class.cs (TypeContainer.DefineType): Added an error flag to
12892         avoid reporting duplicate CS0146's ("class definition is
12893         circular.").
12894
12895         * driver.cs (Driver.MainDriver): Abort if
12896         RootContext.ResolveTree() reported any errors.
12897
12898 2003-09-07  Martin Baulig  <martin@ximian.com>
12899
12900         * report.cs (Error, Warning): Added overloaded versions which take
12901         a `params object[] args' and call String.Format().
12902
12903 2003-09-07  Martin Baulig  <martin@ximian.com>
12904
12905         * decl.cs (DeclSpace..ctor): Don't call
12906         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12907         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12908         (DeclSpace.RecordDecl): New method.
12909
12910         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12911
12912 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12913
12914         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12915         value attributes to be applied to ParameterBuilders.
12916
12917         * class.cs (MethodCore.LabelParameters): Make static and more
12918         generic so that it can be used from other places - like interface
12919         methods, for instance.
12920
12921         * interface.cs (Interface.Emit): Call LabelParameters before
12922         emitting attributes on the InterfaceMethod.
12923
12924 2003-08-26  Martin Baulig  <martin@ximian.com>
12925
12926         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12927         resolving aliases; fixes #47927.
12928
12929 2003-08-26  Martin Baulig  <martin@ximian.com>
12930
12931         * statement.cs (Using.DoResolve): This is internally emitting a
12932         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12933         do not always return.  Fixes #47681.
12934
12935 2003-08-26  Martin Baulig  <martin@ximian.com>
12936
12937         * decl.cs (MemberCore): Moved WarningNotHiding(),
12938         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12939         into MemberBase.
12940         (AdditionResult): Make this nested in DeclSpace.
12941         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12942         argument; call NamespaceEntry.Define() unless we're nested in a
12943         class or struct.
12944
12945         * namespace.cs (Namespace.DefineName): New public function.  This
12946         is called from DeclSpace's .ctor to add 
12947         (Namespace.Lookup): Include DeclSpaces in the lookup.
12948
12949         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12950
12951         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12952
12953 2003-08-25  Martin Baulig  <martin@ximian.com>
12954
12955         * convert.cs (Convert.ExplicitReferenceConversion): When
12956         converting from an interface type to a class, unbox if the target
12957         type is a struct type.  Fixes #47822.
12958
12959 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12960
12961         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12962         #47854.
12963
12964 2003-08-22  Martin Baulig  <martin@ximian.com>
12965
12966         * class.cs (TypeManager.DefineType): When defining a nested type,
12967         call DefineType() on our parent; fixes #47801.
12968
12969 2003-08-22  Martin Baulig  <martin@ximian.com>
12970
12971         * class.cs (MethodData.Define): While checking if a method is an
12972         interface implementation, improve the test a bit more to fix #47654.
12973
12974 2003-08-22  Martin Baulig  <martin@ximian.com>
12975
12976         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12977         correctly; fixes #47722.
12978
12979 2003-08-22  Martin Baulig  <martin@ximian.com>
12980
12981         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12982         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12983
12984         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12985
12986 2003-08-22  Martin Baulig  <martin@ximian.com>
12987
12988         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12989         can only be assigned in static constructors.  Fixes #47161.
12990
12991 2003-08-22  Martin Baulig  <martin@ximian.com>
12992
12993         Rewrote and improved the flow analysis code.
12994
12995         * flowbranching.cs (FlowBranching): Make this class abstract.
12996         (FlowBranching.CreateBranching): New static function to create a
12997         new flow branching.
12998         (FlowBranchingBlock, FlowBranchingException): New classes.
12999         (FlowBranching.UsageVector.Type): New public readonly field.
13000         (FlowBranching.UsageVector.Breaks): Removed the setter.
13001         (FlowBranching.UsageVector.Returns): Removed the setter.
13002         (FlowBranching.UsageVector): Added Break(), Return(),
13003         NeverReachable() and Throw() methods to modify the reachability.
13004         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13005         done by FlowBranching.Merge().
13006         (FlowBranching.UsageVector.MergeChild): New method; merges the
13007         merge result into the current vector.
13008         (FlowBranching.Merge): New abstract method to merge a branching.
13009
13010 2003-08-12  Martin Baulig  <martin@ximian.com>
13011
13012         * expression.cs (Indirection.CacheTemporaries): Create the
13013         LocalTemporary with the pointer type, not its element type.
13014
13015 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13016
13017         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13018         token was a keyword or not.
13019
13020         Add `error' options where an IDENTIFIER was expected;  Provide
13021         CheckToken and CheckIdentifierToken convenience error reporting
13022         functions. 
13023
13024         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13025
13026         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13027         NameSpaceEntry NameSpaceEntry.
13028
13029         (LookupInterfaceOrClass): Avoid creating a full qualified name
13030         from namespace and name: avoid doing lookups when we know the
13031         namespace is non-existant.   Use new Tree.LookupByNamespace which
13032         looks up DeclSpaces based on their namespace, name pair.
13033
13034         * driver.cs: Provide a new `parser verbose' to display the
13035         exception thrown during parsing.  This is turned off by default
13036         now, so the output of a failure from mcs is more graceful.
13037
13038         * namespace.cs: Track all the namespaces defined in a hashtable
13039         for quick lookup.
13040
13041         (IsNamespace): New method
13042
13043 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13044
13045         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13046         we know that we need to concatenate (full typename can never be
13047         null). 
13048
13049         * class.cs: ditto.
13050
13051         * statement.cs: Use a bitfield;  Do not initialize to null things
13052         which are done by the constructor by default.
13053
13054         * cs-parser.jay: bug fix, parameter was 4, not 3.
13055
13056         * expression.cs: Just use the property;
13057
13058         * statement.cs: No need for GetVariableInfo method.
13059
13060 2003-08-08  Martin Baulig  <martin@ximian.com>
13061
13062         * flowanalysis.cs (FlowReturns): This is now nested in the
13063         `FlowBranching' class.
13064         (MyBitVector): Moved this here from statement.cs.
13065         (FlowBranching.SiblingType): New enum type.
13066         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13067
13068 2003-08-07  Martin Baulig  <martin@ximian.com>
13069
13070         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13071         `FlowBranching' class and called `BranchingType'.
13072
13073 2003-08-07  Martin Baulig  <martin@ximian.com>
13074
13075         * flowanalysis.cs: Moved all the control flow analysis code into
13076         its own file.
13077
13078 2003-08-07  Martin Baulig  <martin@ximian.com>
13079
13080         * assign.cs (Assign.DoResolve): `target' must either be an
13081         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13082         #37319.
13083
13084 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13085
13086         * expression.cs (BinaryMethod): This kind of expression is created by the
13087         Binary class if it determines that the operator has to be handled
13088         by a method.
13089
13090         (BinaryDelegate): This kind of expression is created if we are
13091         dealing with a + or - operator on delegates.
13092
13093         (Binary): remove method, argumetns, and DelegateOperator: when
13094         dealing with methods, 
13095
13096         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13097
13098         * statement.cs (Block): use bitfields for the three extra booleans
13099         we had in use.   Remove unused topblock parameter.
13100
13101         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13102
13103         * assign.cs: Drop extra unneeded tests.
13104
13105 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13106
13107         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13108
13109         * statement.cs (Foreach): Use VariableStorage instead of
13110         LocalBuilders.   
13111
13112         * codegen.cs (VariableStorage): New class used by clients that
13113         require a variable stored: locals or fields for variables that
13114         need to live across yield.
13115
13116         Maybe provide a convenience api for EmitThis+EmitLoad?
13117
13118         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13119         these bad boys.
13120
13121 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13122
13123         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13124         RemapParameterLValue): New methods that are used to turn a
13125         precomputed FieldInfo into an expression like this:
13126
13127                 instance.FieldInfo
13128
13129         The idea is to use this instead of making LocalVariableReference
13130         have more than one meaning.
13131
13132         * cs-parser.jay: Add error production to BASE.
13133
13134         * ecore.cs: Deal with TypeManager.GetField returning null, which
13135         is now a valid return value.
13136
13137         (FieldExprNoAddress): New expression for Fields whose address can
13138         not be taken.
13139
13140         * expression.cs (LocalVariableReference): During the resolve
13141         phases, create new expressions if we are in a remapping context.
13142         Remove code that dealt with remapping here.
13143
13144         (ParameterReference): same.
13145
13146         (ProxyInstance): New expression, like the `This' expression, but
13147         it is born fully resolved.  We know what we are doing, so remove
13148         the errors that are targeted to user-provided uses of `this'.
13149
13150         * statement.cs (Foreach): our variable is now stored as an
13151         Expression;  During resolution, follow the protocol, dont just
13152         assume it will return this.
13153
13154 2003-08-06  Martin Baulig  <martin@ximian.com>
13155
13156         * support.cs (SeekableStreamReader.cs): New public class.
13157
13158         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13159         SeekableStreamReader instead of the normal StreamReader.
13160
13161 2003-08-04  Martin Baulig  <martin@ximian.com>
13162
13163         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13164         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13165         deambiguate casts and delegate invocations.
13166         (parenthesized_expression): Use the new tokens to ensure this is
13167         not a cast of method invocation.
13168
13169         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13170         when reading a `)' and Deambiguate_CloseParens () was previously
13171         called.
13172
13173         * expression.cs (ParenthesizedExpression): New class.  This is
13174         just used for the CS0075 test.
13175         (Binary.DoResolve): Check for CS0075.   
13176
13177 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13178
13179         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13180         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13181         reference comparison.
13182
13183         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13184         examine the ReturnType for equality - this is necessary in the
13185         cases of implicit and explicit operators whose signature also
13186         includes the return type.
13187
13188 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13189
13190         * namespace.cs: Cache the result of the namespace computation,
13191         instead of computing it every time.
13192
13193 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13194
13195         * decl.cs: Use a global arraylist that we reuse over invocations
13196         to avoid excesive memory consumption.  Reduces memory usage on an
13197         mcs compile by one meg (45 average).
13198
13199         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13200         private, work around that.
13201
13202 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13203
13204         * literal.cs (IntLiteral): Define Zero and One static literals. 
13205
13206         * cs-parser.jay (integer_literal): use static literals to reduce
13207         memory usage for the most used literals (0, 1 and -1).  211kb
13208         reduced in memory usage.
13209
13210         Replace all calls to `new ArrayList' with `new
13211         ArrayList(4)' which is a good average number for most allocations,
13212         and also requires only 16 bytes of memory for its buffer by
13213         default. 
13214
13215         This reduced MCS memory usage in seven megabytes for the RSS after
13216         bootstrapping.
13217
13218 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13219
13220         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13221         handle params methods the correct way by forming only one
13222         applicable set with params and normal methods in them. Earlier we
13223         were looking at params methods only if we found no normal methods
13224         which was not the correct thing to do.
13225
13226         (Invocation.BetterFunction): Take separate arguments indicating
13227         when candidate and the best method are params methods in their
13228         expanded form.
13229
13230         This fixes bugs #43367 and #46199.
13231
13232         * attribute.cs: Documentation updates.
13233
13234         (CheckAttribute): Rename to CheckAttributeTarget.
13235         (GetValidPlaces): Rename to GetValidTargets.
13236
13237         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13238         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13239
13240         Fixes bug #44468.
13241
13242 2003-07-28  Martin Baulig  <martin@ximian.com>
13243
13244         * class.cs (TypeContainer.DefineMembers): Use the base type's full
13245         name when looking up the base class of a nested class.  Fixes #46977.
13246
13247 2003-07-26  Martin Baulig  <martin@ximian.com>
13248
13249         * expression.cs (Indexers.Indexer): New nested struct; contains
13250         getter, setter and the indexer's type.
13251         (Indexers.Properties): This is now an ArrayList of
13252         Indexers.Indexer's.
13253         (IndexerAccess.DoResolveLValue): Correctly set the type if the
13254         indexer doesn't have any getters.
13255
13256         * assign.cs (Assign.DoResolve): Also do the implicit conversions
13257         for embedded property and indexer assignments.
13258
13259 2003-07-26  Martin Baulig  <martin@ximian.com>
13260
13261         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
13262         preprocessor directive is not the first non-whitespace character
13263         on a line.
13264
13265 2003-07-26  Martin Baulig  <martin@ximian.com>
13266
13267         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
13268         namespace parsing, follow the spec more closely.
13269
13270         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
13271         NamespaceEntry.Lookup().
13272
13273 2003-07-25  Martin Baulig  <martin@ximian.com>
13274
13275         * MethodCore.cs (OverridesSomething): New public field; it's set
13276         from TypeContainer.DefineMembers if this method overrides
13277         something (which doesn't need to be a method).  Fix #39462.
13278
13279 2003-07-25  Ravi Pratap  <ravi@ximian.com>
13280
13281         * typemanager.cs (GetMembers): Ensure that the list of members is
13282         reversed. This keeps things in sync.
13283
13284         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
13285         find an AttributeUsage attribute.
13286
13287         * expression.cs (Invocation.OverloadResolve): Perform the check
13288         which disallows Invoke to be directly called on a Delegate.
13289
13290         (Error_InvokeOnDelegate): Report error cs1533.
13291
13292 2003-07-25  Martin Baulig  <martin@ximian.com>
13293
13294         * expression.cs (Indexers.GetIndexersForType): Only look in the
13295         interface hierarchy if the requested type is already an
13296         interface.  Fixes #46788 while keeping #46502 fixed.
13297
13298 2003-07-25  Martin Baulig  <martin@ximian.com>
13299
13300         * class.cs (TypeContainer.DefineMembers): Check whether all
13301         readonly fields have been assigned and report warning CS0649 if
13302         not.
13303
13304         * statement.cs (LocalInfo.IsFixed): Always return true if this is
13305         a valuetype.
13306
13307 2003-07-24  Ravi Pratap  <ravi@ximian.com>
13308
13309         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
13310         returned from GetMethods to make things consistent with the
13311         assumptions MCS makes about ordering of methods.
13312
13313         This should comprehensively fix bug #45127 and it does :-)
13314
13315         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
13316         ordering is actually reverse.
13317
13318         * Clean up some debug messages I left lying around.
13319
13320         * interface.cs (Populate*): Get rid of code which emits attributes
13321         since the stage in which we emit attributes is the 'Emit' stage,
13322         not the define stage.
13323
13324         (Emit): Move attribute emission for interface members here.
13325
13326 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13327
13328         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13329         closely: we eliminate methods in base types when we have an
13330         applicable method in a top-level type.
13331
13332         Please see section 14.5.5.1 for an exact description of what goes
13333         on. 
13334
13335         This fixes bug #45127 and a host of other related to corlib compilation.
13336
13337         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13338         array is the method corresponding to the top-level type (this is
13339         because of the changes made to icall.c) so we change this
13340         accordingly.
13341
13342         (MethodGroupExpr.Name): This too.
13343
13344         * typemanager.cs (GetElementType): New method which does the right
13345         thing when compiling corlib. 
13346
13347         * everywhere: Make use of the above in the relevant places.
13348
13349 2003-07-22  Martin Baulig  <martin@ximian.com>
13350
13351         * cs-parser.jay (invocation_expression): Moved
13352         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13353         `cast_expression', but create a InvocationOrCast which later
13354         resolves to either an Invocation or a Cast.
13355
13356         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13357         method; call this before EmitStatement() to make sure that this
13358         expression can be used as a statement.
13359
13360         * expression.cs (InvocationOrCast): New class; resolves to either
13361         an Invocation or a Cast.
13362
13363         * statement.cs (StatementExpression): Call ResolveStatement() on
13364         the ExpressionStatement before emitting it.
13365
13366 2003-07-21  Martin Baulig  <martin@ximian.com>
13367
13368         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13369         `ref' and `out' attributes match; fixes #46220.
13370         (MemberAccess.ResolveMemberAccess): You can't reference a type
13371         through an expression; fixes #33180.
13372         (Indexers.GetIndexersForType): Don't return the indexers from
13373         interfaces the class implements; fixes #46502.
13374
13375 2003-07-21  Martin Baulig  <martin@ximian.com>
13376
13377         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13378         CS0661 checks; fixes bug #30442.
13379
13380 2003-07-21  Martin Baulig  <martin@ximian.com>
13381
13382         * decl.cs (AdditionResult): Added `Error'.
13383
13384         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13385
13386         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
13387         makes cs0031.cs actually work.
13388
13389 2003-07-20  Martin Baulig  <martin@ximian.com>
13390
13391         * namespace.cs: Fixed that bug which caused a crash when compiling
13392         the debugger's GUI.
13393
13394 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13395
13396         * typemanager.cs (LookupTypeReflection): Never expose types which
13397         are NotPublic, NestedPrivate, NestedAssembly, or
13398         NestedFamANDAssem.  We used to return these, and later do a check
13399         that would report a meaningful error, but the problem is that we
13400         would not get the real match, if there was a name override.
13401
13402 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13403
13404         * namespace.cs (Namespace, Name): Do not compute the namespace
13405         name dynamically, compute it in the constructor.  This reduced
13406         memory usage by 1697 KB.
13407
13408         * driver.cs: Use --pause to pause at the end.
13409
13410 2003-07-17  Peter Williams  <peter@newton.cx>
13411
13412         * Makefile: Change the name of the test target so that it doesn't
13413         conflict with the recursive test target.
13414
13415 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13416
13417         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13418         AddressOf): Do not use EmitThis, that was wrong, use the actual
13419         this pointer.
13420
13421 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13422
13423         * class.cs (MethodData.Define): While checking if a method is an
13424         interface implementation, improve the test: If we are not public
13425         (use new test here: use the computed MethodAttributes directly,
13426         instead of the parsed modifier flags) check if the `implementing'
13427         method comes from an interface or not.
13428
13429         * pending.cs (VerifyPendingMethods): Slightly better error
13430         message.
13431
13432         * makefile: add test target that does the mcs bootstrap.
13433
13434 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13435
13436         * interface.cs (Define): Do nothing here since there are no
13437         members to populate etc. Move the attribute emission out of here
13438         since this was just totally the wrong place to put it. Attribute
13439         application happens during the 'Emit' phase, not in the 'Define'
13440         phase.
13441
13442         (Emit): Add this method and move the attribute emission here
13443
13444         * rootcontext.cs (EmitCode): Call the Emit method on interface
13445         types too.
13446
13447 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13448
13449         * expression.cs (OverloadResolve): Report error only if Location
13450         is not 'Null' which means that there was a probe going on.
13451
13452 2003-07-14  Martin Baulig  <martin@ximian.com>
13453
13454         * expression.cs (ConditionalLogicalOperator): New public class to
13455         implement user defined conditional logical operators.
13456         This is section 14.11.2 in the spec and bug #40505.
13457
13458 2003-07-14  Martin Baulig  <martin@ximian.com>
13459
13460         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13461
13462 2003-07-14  Martin Baulig  <martin@ximian.com>
13463
13464         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13465
13466         * ecore.cs (IVariable.VerifyFixed): New interface method.
13467
13468         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13469         operator, check whether the variable is actually fixed.  Fixes bug
13470         #36055.  Set a variable definitely assigned when taking its
13471         address as required by the spec.
13472
13473         * statement.cs (LocalInfo.IsFixed): New field.
13474         (LocalInfo.MakePinned): Set `IsFixed' to true.
13475
13476 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13477
13478         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13479         for .ctors, ensure that we only ask for members declared in the
13480         attribute type (BindingFlags.DeclaredOnly).
13481
13482         Fixes bug #43632.
13483
13484         * expression.cs (Error_WrongNumArguments): Report error 1501
13485         correctly the way CSC does.
13486
13487 2003-07-13  Martin Baulig  <martin@ximian.com>
13488
13489         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13490         lookup on the fully qualified name, to make things like "X.X" work
13491         where "X.X" is a fully qualified type name, but we also have a
13492         namespace "X" in the using list.  Fixes #41975.
13493
13494 2003-07-13  Martin Baulig  <martin@ximian.com>
13495
13496         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13497         function. If we're a CompoundAssign, we need to create an embedded
13498         CompoundAssign, not an embedded Assign.
13499         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13500         Fixes #45854.
13501
13502 2003-07-13  Martin Baulig  <martin@ximian.com>
13503
13504         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13505         work to fix bug #46088.
13506
13507 2003-07-13  Ravi Pratap <ravi@ximian.com>
13508
13509         * class.cs (Operator.Emit): Do not emit attributes here - it is
13510         taken care of by the Method class that we delegate too. This takes
13511         care of bug #45876.
13512
13513 2003-07-10  Martin Baulig  <martin@ximian.com>
13514
13515         * expression.cs (TypeOfVoid): New class.
13516         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13517
13518 2003-07-10  Martin Baulig  <martin@ximian.com>
13519
13520         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13521         bug #35957.
13522
13523 2003-07-10  Martin Baulig  <martin@ximian.com>
13524
13525         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13526         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13527
13528         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13529
13530         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13531
13532 2003-07-10  Martin Baulig  <martin@ximian.com>
13533
13534         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13535         of decimal.  Fixes #42850.
13536
13537         NOTE: I also fixed the created byte blob, but this doesn't work on
13538         the MS runtime and csc never produces any byte blobs for decimal
13539         arrays.
13540
13541 2003-07-10  Martin Baulig  <martin@ximian.com>
13542
13543         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13544         structs; fixes #32068.
13545         (Block.AddChildVariableNames): Fixed #44302.
13546
13547 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13548
13549         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13550
13551 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13552
13553         * attribute.cs: And this test is onger needed.
13554
13555 2003-07-08  Martin Baulig  <martin@ximian.com>
13556
13557         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13558         inaccessible types.  Fixes #36313.
13559
13560         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13561
13562         * namespace.cs (NamespaceEntry): Create implicit entries for all
13563         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13564         implicit entries for N1.N2 and N1.
13565
13566 2003-07-08  Martin Baulig  <martin@ximian.com>
13567
13568         Rewrote the handling of namespaces to fix a lot of the issues
13569         wrt. `using' aliases etc.
13570
13571         * namespace.cs (Namespace): Splitted this class into a
13572         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13573
13574         * typemanager.cs (TypeManager.IsNamespace): Removed.
13575         (TypeManager.ComputeNamespaces): Only compute namespaces from
13576         loaded assemblies here, not the namespaces from the assembly we're
13577         currently compiling.
13578
13579 2003-07-08  Martin Baulig  <martin@ximian.com>
13580
13581         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13582
13583 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13584
13585         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13586         already fixed it.  
13587
13588         I thought about the memory savings here, but LookupTypeReflection
13589         is used under already very constrained scenarios.  Compiling
13590         corlib or mcs only exposes one hit, so it would not really reduce
13591         any memory consumption.
13592
13593 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13594
13595         * typemanager.cs: fixes bug #45889 by only adding public types from
13596         other assemblies to the list of known types.
13597
13598 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13599
13600         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13601         on the type we resolved.
13602
13603 2003-07-05  Martin Baulig  <martin@ximian.com>
13604
13605         * pending.cs (PendingImplementation.ParentImplements): Don't
13606         create the proxy if the parent is abstract.
13607
13608         * class.cs (TypeContainer.DefineIndexers): Process explicit
13609         interface implementations first.  Fixes #37714.
13610
13611 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13612
13613         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13614         defined recursively;  but since we modify the input parameters
13615         (left is set to `this' temporarily), we reset this value if the
13616         left_is_explicit is false, which gives the original semantics to
13617         the code.  
13618
13619         * literal.cs (NullPointer): new class used to represent a null
13620         literal in a pointer context.
13621
13622         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13623         type is a pointer, use a NullPointer object instead of a
13624         NullLiteral.   Closes 43687
13625
13626         (ExplicitConversion): Convert pointer values using
13627         the conv opcode to the proper type.
13628
13629         * ecore.cs (New): change ValueTypeVariable property into a method,
13630         that returns whether the valuetype is suitable for being used.
13631
13632         * expression.cs (Binary.DoNumericPromotions): Only return if we
13633         the int constant was a valid uint, and we can return both left and
13634         right as uints.  If not, we continue processing, to trigger the
13635         type conversion.  This fixes 39018.
13636
13637         * statement.cs (Block.EmitMeta): During constant resolution, set
13638         the CurrentBlock property on the emitcontext, so that we resolve
13639         constants propertly.
13640
13641 2003-07-02  Martin Baulig  <martin@ximian.com>
13642
13643         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13644         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13645
13646         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13647         than emitting it here.
13648
13649         * statement.cs: Fixed some more flow analysis bugs.
13650
13651 2003-07-02  Martin Baulig  <martin@ximian.com>
13652
13653         * class.cs (MethodData.Define): When implementing interface
13654         methods, set Final unless we're Virtual.
13655
13656         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13657         check work for interface methods.
13658
13659 2003-07-01  Martin Baulig  <martin@ximian.com>
13660
13661         * ecore.cs (EmitContext.This): Replaced this property with a
13662         GetThis() method which takes a Location argument.  This ensures
13663         that we get the correct error location for a CS0188.
13664
13665 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13666
13667         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13668         ImplicitStandardConversion.
13669
13670         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13671
13672 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13673
13674         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13675         optimization.
13676
13677 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13678
13679         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13680         constructors.
13681
13682         (MethodData.Define): Turn off initlocals for unsafe methods.
13683
13684 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13685
13686         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13687         complete;  Fixes #37521.
13688
13689         * delegate.cs: Use Modifiers.TypeAttr to compute the
13690         TypeAttributes, instead of rolling our own.  This makes the flags
13691         correct for the delegates.
13692
13693 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13694
13695         * class.cs (Constructor.Define): Set the private flag for static
13696         constructors as well.
13697
13698         * cs-parser.jay (statement_expression): Set the return value to
13699         null, to avoid a crash when we catch an error.
13700
13701 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13702
13703         * cs-parser.jay: Applied patch from Jackson that adds support for
13704         extern and unsafe modifiers to destructor declarations.
13705
13706         * expression.cs: Report error 21 if the user is trying to index a
13707         System.Array.
13708
13709         * driver.cs: Add an error message, suggested by the bug report.
13710
13711         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13712         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13713
13714 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13715
13716         * namespace.cs: Add some information to reduce FAQs.
13717
13718 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13719
13720         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13721         underlying enumeration types.  Fixes #43915.
13722
13723         * expression.cs: Treat ushort/short as legal values to be used in
13724         bitwise operations.
13725
13726 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13727
13728         * delegate.cs: transfer custom attributes for paramenters from
13729         the delegate declaration to Invoke and BeginInvoke.
13730
13731 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13732
13733         * attribute.cs: handle custom marshalers and emit marshal info
13734         for fields, too.
13735
13736 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13737
13738         * makefile.gnu: Added anonymous.cs to the compiler sources.
13739
13740 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13741
13742         * iterators.cs: Change the name of the proxy class to include two
13743         underscores.
13744
13745         * cs-parser.jay: Update grammar to include anonymous methods.
13746
13747         * anonymous.cs: new file.
13748
13749 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13750
13751         * class.cs (Field.Define): Add missing test for pointers and
13752         safety. 
13753
13754 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13755
13756         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13757         we use the stobj opcode.
13758
13759         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13760         since it wasn't the correct fix. 
13761
13762         It still is puzzling that we are required to use stobj for IntPtr
13763         which seems to be a ValueType.
13764
13765 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13766
13767         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13768         during regular simple name resolution.   Now, the trick is that
13769         instead of returning for processing the simplename, we do a
13770         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13771         contextual lookup type).   If a match is found, return that, if
13772         not, return for further composition.
13773
13774         This fixes long-standing 30485.
13775
13776         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13777         using the address to initialize an object, do an Stobj instead of
13778         using the regular Stelem.
13779
13780         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13781         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13782         Because if we are a BaseIndexerAccess that value will be true.
13783         Fixes 43643.
13784
13785         * statement.cs (GotoCase.Resolve): Return after reporting an
13786         error, do not attempt to continue. 
13787
13788         * expression.cs (PointerArithmetic.Emit): If our operand is a
13789         long, convert our constants to match the operand before
13790         multiplying.  Convert to I type before adding.   Fixes 43670.
13791
13792 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13793
13794         * enum.cs (ImplicitConversionExists) : Rename to
13795         ImplicitEnumConversionExists to remove ambiguity. 
13796
13797         * ecore.cs (NullCast): New type of cast expression class which
13798         basically is very similar to EmptyCast with the difference being
13799         it still is a constant since it is used only to cast a null to
13800         something else
13801         (eg. (string) null)
13802
13803         * convert.cs (ImplicitReferenceConversion): When casting a null
13804         literal, we return a NullCast.
13805
13806         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13807         should be around anymore.
13808
13809         The renaming (reported was slightly wrong). Corrections:
13810
13811         ConvertImplicitStandard -> ImplicitConversionStandard
13812         ConvertExplicitStandard -> ExplicitConversionStandard
13813
13814         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13815         before passing them in !
13816
13817         * convert.cs (ImplicitConversionStandard): When comparing for
13818         equal expr and target types, ensure that expr is not a
13819         NullLiteral.
13820
13821         In general, we must not be checking (expr_type ==
13822         target_type) in the top level conversion methods
13823         (ImplicitConversion, ExplicitConversion etc). This checking is
13824         done in the methods that they delegate to.
13825
13826 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13827
13828         * convert.cs: Move Error_CannotConvertType,
13829         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13830         ImplicitNumericConversion, ImplicitConversionExists,
13831         ImplicitUserConversionExists, StandardConversionExists,
13832         FindMostEncompassedType, FindMostSpecificSource,
13833         FindMostSpecificTarget, ImplicitUserConversion,
13834         ExplicitUserConversion, GetConversionOperators,
13835         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13836         TryImplicitIntConversion, Error_CannotConvertImplicit,
13837         ConvertImplicitRequired, ConvertNumericExplicit,
13838         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13839         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13840         its own file.
13841
13842         Perform the following renames:
13843
13844         StandardConversionExists -> ImplicitStandardConversionExists
13845         ConvertImplicit -> ImplicitConversion
13846         ConvertImplicitStandard -> ImplicitStandardConversion
13847         TryImplicitIntConversion -> ImplicitIntConversion
13848         ConvertImplicitRequired -> ImplicitConversionRequired
13849         ConvertNumericExplicit -> ExplicitNumericConversion
13850         ConvertReferenceExplicit -> ExplicitReferenceConversion
13851         ConvertExplicit -> ExplicitConversion
13852         ConvertExplicitStandard -> ExplicitStandardConversion
13853
13854 2003-05-19  Martin Baulig  <martin@ximian.com>
13855
13856         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13857         (TypeInfo): Added support for structs having structs as fields.
13858
13859         * ecore.cs (FieldExpr): Implement IVariable.
13860         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13861         VariableInfo for the field.
13862
13863 2003-05-18  Martin Baulig  <martin@ximian.com>
13864
13865         * expression.cs (This.DoResolve): Report a CS0027 if we're
13866         emitting a field initializer.
13867
13868 2003-05-18  Martin Baulig  <martin@ximian.com>
13869
13870         * expression.cs (This.ResolveBase): New public function.
13871         (This.DoResolve): Check for CS0188.
13872
13873         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13874         This.Resolve().
13875
13876         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13877         `instance_expression' to null if we don't have any non-static
13878         methods.
13879
13880 2003-05-18  Martin Baulig  <martin@ximian.com>
13881
13882         Reworked the way how local variables and parameters are handled by
13883         the flow analysis code.
13884
13885         * statement.cs (TypeInfo, VariableMap): New public classes.
13886         (VariableInfo): New public class.  This is now responsible for
13887         checking whether a variable has been assigned.  It is used for
13888         parameters and local variables.
13889         (Block.EmitMeta): Take the InternalParameters as argument; compute
13890         the layout of the flow vectors here.
13891         (Block.LocalMap, Block.ParameterMap): New public properties.
13892         (FlowBranching): The .ctor doesn't get the InternalParameters
13893         anymore since Block.EmitMeta() now computes the layout of the flow
13894         vector.
13895         (MyStructInfo): This class is now known as `StructInfo' and nested
13896         in `TypeInfo'; we don't access this directly anymore.
13897
13898         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13899         property and removed IsAssigned(), IsFieldAssigned(),
13900         SetAssigned() and SetFieldAssigned(); we now call them on the
13901         VariableInfo so we don't need to duplicate this code everywhere.
13902
13903         * expression.cs (ParameterReference): Added `Block block' argument
13904         to the .ctor.
13905         (LocalVariableReference, ParameterReference, This): The new
13906         VariableInfo class is now responsible for all the definite
13907         assignment stuff.
13908
13909         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13910         IsParameterAssigned, SetParameterAssigned): Removed.
13911
13912 2003-05-18  Martin Baulig  <martin@ximian.com>
13913
13914         * typemanager.cs (InitCoreTypes): Try calling
13915         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13916         the 3-args-version.  Corlib now also needs our `void_type'.
13917         (GetMethod): Added overloaded version which takes an optional
13918         `bool report_errors' to allow lookups of optional methods.
13919
13920 2003-05-12  Martin Baulig  <martin@ximian.com>
13921
13922         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13923         only used for locals and not for parameters.
13924
13925 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13926
13927         * support.cs (InternalParameters.ParameterType): Return the
13928         ExternalType of the parameter.
13929
13930         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13931         they were unused.
13932
13933 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13934
13935         * class.cs (MethodData.Define): Do not set the `newslot' on
13936         interface members, if they are also flagged as "override".
13937
13938         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13939         better code for ++i and i++.  This only works for static fields
13940         and local variables.
13941
13942         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13943         want to pull the DeclSpace out of the builder_to_declspace instead
13944         of the TypeBuilder (like in TypeContainer.FindMembers).
13945
13946         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13947         instead of LookupTypeContainer.  Fixes the crash on .NET for
13948         looking up interface members.
13949
13950         * const.cs: Create our own emit context during the Definition
13951         stage, so that constants are evaluated in the proper context, when
13952         a recursive definition happens.
13953
13954 2003-05-11  Martin Baulig  <martin@ximian.com>
13955
13956         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13957         new block for a switch section.
13958         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13959         the adding/lookup in the switch block.  Fixes #39828.
13960
13961 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13962
13963         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13964         functionality: I needed to convert the data after I had performed
13965         the add/sub operation into the operands type size.
13966
13967         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13968         pass the type for the box operation, otherwise the resulting
13969         object would have been of type object.
13970
13971         (BoxedCast): Add constructor to specify the type to box as.
13972
13973 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13974
13975         * iterators.cs: I was reusing the `count' variable inadvertently,
13976         take steps to not allow this to happen.
13977
13978 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13979
13980         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13981         by creating an array at the point where the params starts and
13982         putting all those arguments there, then adjusting the size of the
13983         array.
13984
13985 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13986
13987         * expression.cs (New.AddressOf): Implement interface
13988         IMemoryLocation.  This is used when the `new' operator is used in
13989         the context of an invocation to a method on a value type.
13990
13991         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13992         example. 
13993
13994         * namespace.cs: Also check the using aliases here.
13995
13996         * driver.cs: Move the test for using validity after the types have
13997         been entered, so we do a single pass that also includes the using
13998         aliases. 
13999
14000         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14001         in the regular case.   CreateSiblingForFinally is doing extra
14002         error checking.
14003
14004         * attribute.cs (GetAttributeArgumentExpression): Store the result
14005         on an out value, and use the return value to indicate failure
14006         instead of using null (which is a valid return for Constant.GetValue).
14007
14008         * statement.cs: Perform the analysis flow for the increment
14009         portion after the statement, because this will be the real flow of
14010         execution.  Fixes #42385
14011
14012         * codegen.cs (EmitContext.EmitArgument,
14013         EmitContext.EmitStoreArgument): New helper functions when the
14014         RemapToProxy flag is set.
14015
14016         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14017         function.
14018
14019         Add support for remapping parameters. 
14020
14021         * iterators.cs: Propagate parameter values;  Store parameter
14022         values in the proxy classes.
14023
14024 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14025
14026         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14027         need a proxy reference;  I do not know what I was thinking
14028
14029         * cs-parser.jay (constructor_initializer): catch another error,
14030         and display nice message.
14031
14032         (field_declaration): catch void field declaration
14033         to flag a better error. 
14034
14035         * class.cs (MemberBase.CheckBase): Report an error instead of a
14036         warning if a new protected member is declared in a struct. 
14037         (Field.Define): catch the error of readonly/volatile.
14038
14039         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14040
14041         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14042         volatile variable is taken
14043
14044 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14045
14046         * statement.cs (Fixed.Resolve): Report an error if we are not in
14047         an unsafe context.
14048
14049 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14050
14051         * typemanager.cs: reuse the code that handles type clashes for
14052         delegates and enumerations.
14053
14054         * class.cs (Report28): Always report.
14055
14056         * expression.cs (EncodeAsAttribute): Allow nulls here.
14057
14058 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14059
14060         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14061         the functionality for testing whether an expression is valid for
14062         an attribute here.  Also handle the case of arrays of elements
14063         being stored. 
14064
14065         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14066         encoding a linear array into an array of objects that are suitable
14067         to be passed to an CustomAttributeBuilder.
14068
14069         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14070
14071         * ecore.cs: (FieldExpr): Handle field remapping here.
14072
14073         * iteratators.cs: Pass the instance variable (if the method is an
14074         instance method) to the constructors, so we can access the field
14075         variables on the class.
14076
14077         TODO: Test this with structs.  I think the THIS variable on
14078         structs might have to be a pointer, and not a refenrece
14079
14080 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14081
14082         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14083         local variables to fields in a proxy class.
14084
14085         * iterators.cs (PopulateProxy): Rename our internal fields to
14086         <XXX>.  
14087         Create a <THIS> field if we are an instance method, so we can
14088         reference our parent container variables.
14089         (MapVariable): Called back from the EmitContext code to enter a
14090         new variable to field mapping into the proxy class (we just create
14091         a FieldBuilder).
14092
14093         * expression.cs
14094         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14095         for using the remapped locals to fields.
14096
14097         I placed the code here, because that gives the same semantics to
14098         local variables, and only changes the Emit code.
14099
14100         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14101         statements inside iterators.
14102         (VariableInfo): Add a FieldBuilder for the cases when we are
14103         remapping local variables to fields in a proxy class
14104
14105         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14106         current_block != null.
14107
14108         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14109         not cope with strings, as it has been moved to the
14110         TableSwitchEmit.  Fixed bug in switch generation.
14111
14112         * expression.cs (New.DoResolve): Provide more context for the user
14113         when reporting an error.
14114
14115         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14116         pointers. 
14117
14118         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14119         check the permissions for it.  Note than in a type-resolution
14120         context the check was already present in DeclSpace.ResolveType,
14121         but was missing from the MemberAccess.
14122
14123         (ArrayCreation.CheckIndices): warn if the user has
14124         more nested levels of expressions, but there are no more
14125         dimensions specified.  Avoids crash on bug 41906.
14126
14127 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14128
14129         * statement.cs (Block): replace Implicit bool, for a generic
14130         flags.   
14131         New flag: `Unchecked'.  This is used during the EmitMeta phase
14132         (which is out-of-line with the regular Resolve/Emit process for a
14133         statement, as this is done ahead of time, but still gets a chance
14134         to call constant resolve).
14135
14136         (Block.Flags): new enum for adding a new flag.
14137
14138         (Block.EmitMeta): track the state of unchecked.
14139
14140         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14141         to enable constant resolution to work there as well.
14142
14143 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14144
14145         * typemanager.cs (ienumerable_type): Also look up
14146         System.Collections.IEnumerable. 
14147
14148 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14149
14150         TODO: Test more than one conditional per method.
14151
14152         * class.cs (Indexer.Define): Report the location where the user is
14153         referencing the unsupported feature.
14154
14155         (MethodData): Overload the use of `conditionals' to
14156         minimize the creation of needless ArrayLists.   This saves roughly
14157         212kb on my machine.
14158
14159         (Method): Implement the new IIteratorContainer interface.
14160         (Method.SetYields): Implement the method by setting the ModFlags
14161         to contain METHOD_YIELDS.
14162
14163         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14164         which just got set to null.
14165
14166         * iterators.cs: New file.
14167
14168         (Yield, YieldBreak): New statements.
14169
14170         * statement.cs (Return.Resolve): Flag an error if we are used in
14171         an iterator method.
14172
14173         * codegen.cs (InIterator): New flag set if the code is being
14174         compiled in an iterator method.
14175
14176         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14177         internal modifier, and we just use it to avoid adding extra
14178         fields, as this is seldom used.  
14179
14180         * cs-parser.jay: Add yield_statement (yield and yield break).
14181
14182         * driver.cs: New flag -v2 to turn on version 2 features. 
14183
14184         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14185         hashtable when v2 is enabled.
14186
14187 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14188
14189         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14190         there is already a namespace defined with this name.
14191
14192         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14193         people upgraded their corlibs.
14194
14195         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14196         always use fully qualified types, no need to use the compiler
14197         front end.
14198
14199         (TypeManager.IsNamespace): Use binarysearch.
14200
14201         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14202         AddDelegate): I did not quite use the new IsValid API properly: I
14203         have to pass the short-name and the fullname.  I was passing only
14204         the basename instead of the fullname sometimes. 
14205
14206         (TypeContainer.DefineType): call NamespaceClash.
14207
14208         * interface.cs (Interface.DefineType): use NamespaceClash before
14209         defining the type.
14210
14211         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14212         defining the type.
14213
14214         * enum.cs: (Enum.DefineType): use NamespaceClash before
14215         defining the type.
14216
14217         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14218         speed increase.  First, use the negative_hits cache when we get a
14219         negative.  Second, add the type with its full original name
14220         instead of the new . and + encoded name (reflection uses + to
14221         separate type from a nested type).  Use LookupTypeReflection
14222         directly which bypasses the type->name hashtable (that we already
14223         know does not contain the type.
14224
14225         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14226         location/container type. 
14227
14228         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14229
14230 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14231
14232         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14233
14234         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14235         method is being referenced in the method group from a static
14236         context, and report error 120 if so.
14237
14238         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14239         Error118. 
14240
14241         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14242         is created, we create the A namespace).
14243
14244         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14245         Fixes #41591
14246
14247 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14248
14249         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14250         invocation to ModuleBuilder.GetType with the same values will
14251         return a new type instance, so we need to cache its return
14252         values. 
14253
14254         * expression.cs (Binary.ResolveOperator): Only allow the compare
14255         operators on enums if they are of the same type.
14256
14257         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14258         types of ValueType on their own case.  Before we were giving them
14259         the same treatment as objects.
14260
14261         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14262         fullname.  Short name is used to compare against container name.
14263         Fullname is used to check against defined namespace names.
14264
14265         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14266         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14267
14268         (Method.CheckBase): Call parent.
14269         (MemberBase.CheckBase): Check for protected members on sealed
14270         classes.
14271         (PropertyBase.CheckBase): Call parent.
14272         (Field.Define): Call parent.
14273
14274         * report.cs: Negative error codes are now mapped to 8000 - code,
14275         so that the display is render more nicely.
14276
14277         * typemanager.cs: Do not use try/catch, instead report a regular
14278         error. 
14279
14280         (GetPointerType, GetReferenceType): These methods provide
14281         mechanisms to obtain the T* and T& from a T.  We had the code
14282         previously scattered around the code base, and it also used
14283         TypeManager.LookupType that would go through plenty of caches.
14284         This one goes directly to the type source.
14285
14286         In some places we did the Type.GetType followed by
14287         ModuleBuilder.GetType, but not in others, so this unifies the
14288         processing as well.
14289
14290         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14291         statements now that we have namespace information.
14292
14293         * typemanager.cs (IsNamespace): New method, returns whether the
14294         string presented is a namespace or not.
14295
14296         (ComputeNamespaces): New public entry point, computes the list of
14297         available namespaces, using the GetNamespaces API call in Mono, or
14298         the slower version in MS.NET.   
14299
14300         Now before we start the semantic analysis phase, we have a
14301         complete list of namespaces including everything that the user has
14302         provided.
14303
14304         Deleted old code to cache namespaces in .nsc files.
14305
14306 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14307
14308         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14309         class/struct location definition Location for the implicit
14310         constructor location.
14311
14312         (Operator.Define): Use the location of the operator for the
14313         implicit Method definition.
14314
14315         (Constructor.Emit): use the constructor location for the implicit
14316         base initializer constructor.
14317
14318         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14319         and the Expression class now contains two new methods:
14320
14321         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14322         isolate type lookup from the rest of the resolution process.
14323
14324         Since we use Expressions to hold type definitions due to the way
14325         we parse the input we have historically overloaded Resolve to
14326         perform the Type lookups if a special flag is passed.  Now this is
14327         eliminated and two methods take their place. 
14328
14329         The differences in the two methods between xStep and xTerminal is
14330         that xStep is involved in our current lookup system that uses
14331         SimpleNames to compose a name, while xTerminal is used just to
14332         catch the case where the simplename lookup failed.
14333
14334 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14335
14336         * expression.cs (ResolveMemberAccess): Remove redundant code.
14337         TypeExpr expressions are always born fully resolved.
14338
14339         * interface.cs (PopulateMethod): Do not lookup the types twice.
14340         We were doing it once during SemanticAnalysis and once during
14341         PopulateMethod.
14342
14343         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14344         in local variable type definitions, were being returned as a
14345         SimpleName (we decomposed everything into a string), that is
14346         because primary_expression was being used instead of a type in the
14347         grammar (reduce/reduce conflicts).
14348
14349         The part that was wrong is that we converted the expression into a
14350         string (an oversimplification in one hand, compounded with primary
14351         expressions doing string concatenation).
14352
14353         So things like:
14354
14355         A.B.C [] x;
14356
14357         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14358         using clauses from working on this particular context.  And a type
14359         was being matched directly against "A.B.C[]".
14360
14361         We now use the correct approach, and allow for ComposedCast to be
14362         part of the unary expression.  So the "A.B.C []" become a composed
14363         cast of "A.B.C" (as a nested group of MemberAccess with a
14364         SimpleName at the end) plus the rank composition "[]". 
14365
14366         Also fixes 35567
14367
14368 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14369
14370         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14371         for the access level checking.
14372
14373         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14374         `TypeContainer container', because I kept getting confused when I
14375         was debugging this code.
14376
14377         * expression.cs (Indexers): Instead of tracking getters/setters,
14378         we now track them in parallel.  We create one arraylist less, but
14379         most importantly it is possible now for the LValue code to find a
14380         matching get for a set.
14381
14382         (IndexerAccess.DoResolveLValue): Update the code.
14383         GetIndexersForType has been modified already to extract all the
14384         indexers from a type.  The code assumed it did not.
14385
14386         Also make the code set the correct return type for the indexer.
14387         This was fixed a long time ago for properties, but was missing for
14388         indexers.  It used to be void_type.
14389
14390         (Binary.Emit): Test first for doubles instead of
14391         floats, as they are more common.
14392
14393         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14394         when dealing with floats and the <=, >= operators.  This fixes bug
14395         #39314 
14396
14397         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14398         to load the array value by emitting a load on the foreach variable
14399         type.  This was incorrect.  
14400
14401         We now emit the code to load an element using the the array
14402         variable type, and then we emit the conversion operator.
14403
14404         Fixed #40176
14405
14406 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14407
14408         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14409
14410 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14411
14412         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14413         test for protection before we test for signatures. 
14414
14415         (MethodSignature.ToString): implement.
14416
14417         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14418         to the case where we reduced into a LongConstant.
14419
14420         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14421         depend on whether the information is acurrate, because the
14422         Microsoft runtime will always claim that the array type is public,
14423         regardless of the real state.
14424
14425         If the type is a pointer, another problem happens: the type is
14426         reported as non-public in Microsoft.  
14427
14428         In both cases we have to call CheckAccessLevel recursively with
14429         the underlying type as the argument to be tested.
14430
14431 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14432
14433         * assign.cs (Assign.Emit): If we are dealing with a compound
14434         assignment expression, we should use the code path that stores the
14435         intermediate result in a temporary value.  This fixes #40903.
14436
14437         *expression.cs (Indirection.ToString): Provide ToString method for
14438         debugging. 
14439
14440 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14441
14442         * class.cs: Null out fields holding references to Block objects so
14443         they can be garbage collected.
14444
14445         * expression.cs (OverloadResolve): Remove unused local.
14446
14447 2003-04-07  Martin Baulig  <martin@ximian.com>
14448
14449         * codegen.cs (EmitContext.CurrentFile): New public field.
14450         (EmitContext.Mark): Use the CurrentFile to check whether the
14451         location is in the correct file.
14452         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14453
14454 2003-04-07  Martin Baulig  <martin@ximian.com>
14455
14456         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14457
14458         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14459         location.  [FIXME: The location argument which gets passed to this
14460         method is sometimes wrong!]
14461
14462 2003-04-07  Nick Drochak <ndrochak@gol.com>
14463
14464         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14465
14466 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14467
14468         * expression.cs (Indirection.EmitAssign): We were using the
14469         temporary, but returning immediately instead of continuing the
14470         EmitAssing flow.
14471
14472 2003-04-06  Martin Baulig  <martin@ximian.com>
14473
14474         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14475         if it's a nested child, but also deriving from the outer class.
14476         See test 190.cs.
14477
14478         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14479         nested child, but also deriving from the outer class.  See
14480         test-190.cs.
14481         (FilterWithClosure): We may access private members of the outer
14482         class if we're a nested child and deriving from the outer class.
14483         (RealMemberLookup): Only set `closure_private_ok' if the
14484         `original_bf' contained BindingFlags.NonPublic.
14485
14486 2003-04-05  Martin Baulig  <martin@ximian.com>
14487
14488         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
14489
14490 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14491
14492         * class.cs (Event.Define): Do not allow abstract events to have
14493         initializers. 
14494
14495 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14496
14497         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14498         block in event declarations.
14499
14500         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14501         value type, get its address.
14502
14503         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14504         leaving a class on the stack instead of a boolean value (int
14505         0/1).  Change the code so we compare against null, and then the
14506         result against zero.
14507
14508         * class.cs (TypeContainer.GetClassBases): We were checking for the
14509         parent class being sealed too late.
14510
14511         * expression.cs (Binary.Emit): For <= and >= when dealing with
14512         floating point values, use cgt.un and clt.un instead of cgt and
14513         clt alone.
14514
14515 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14516
14517         * statement.cs: Apply the same optimization as MS: skip the 
14518         GetEnumerator returning an IEnumerator, and use the one returning a 
14519         CharEnumerator instead. This allows us to avoid the try-finally block 
14520         and the boxing.
14521
14522 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14523
14524         * cs-parser.jay: Attributes cannot be applied to
14525                          namespaces. Fixes #40473
14526
14527 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14528
14529         * class.cs:
14530         (Add*): check if the name is valid using the full name for constants,
14531         fields, properties and events.
14532
14533 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14534
14535         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14536         char constants to be part of the enumeration.
14537
14538         * expression.cs (Conditional.DoResolve): Add support for operator
14539         true. Implements the missing functionality from 14.12
14540
14541         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14542         operator true/false as required by the spec.
14543
14544         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14545         implicit conversion to boolean.
14546
14547         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14548         also one where the type implements `operator true'. 
14549
14550         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14551         get an expression that will invoke operator true based on an
14552         expression.  
14553
14554         (GetConversionOperators): Removed the hack that called op_True
14555         here.  
14556
14557         (Expression.ResolveBoolean): Move this from Statement.
14558
14559 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14560
14561         * ecore.cs (FieldExpr): do not allow initialization of initonly
14562         fields on derived classes
14563
14564 2003-03-13  Martin Baulig  <martin@ximian.com>
14565
14566         * statement.cs (Block.Emit): Call ig.BeginScope() and
14567         ig.EndScope() when compiling with debugging info; call
14568         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14569
14570 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14571
14572         * expression.cs (Indexers): Do not construct immediately, allow
14573         for new members to be appended as we go.  Fixes 38143
14574
14575 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14576
14577         * expression.cs: save/restore context when resolving an unchecked
14578         expression.
14579
14580 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14581
14582         * cfold.cs: Catch division by zero in modulus operator during
14583         constant folding.
14584
14585 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14586
14587         * interface.cs (Interface.DefineMembers): Avoid defining members
14588         twice. 
14589
14590 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14591
14592         * driver.cs: handle the +/- options for -noconfig
14593
14594         * statement.cs (Unckeched.Resolve): Also track the state of
14595         unchecked in the Resolve phase.
14596
14597 2003-02-27  Martin Baulig  <martin@ximian.com>
14598
14599         * ecore.cs (Expression.MemberLookup): Don't create a
14600         MethodGroupExpr for something which is not a method.  Fixes #38291.
14601
14602 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14603
14604         * class.cs (MemberBase.CheckParameters): Also check that the type
14605         is unmanaged if it is a pointer.
14606
14607         * expression.cs (SizeOf.Resolve): Add location information.
14608
14609         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14610         a managed type is declared.
14611
14612         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14613         parameter modifiers as well.  Fixes bug 38606
14614
14615         * class.cs: Very sad.  Am backing out the speed up changes
14616         introduced by the ArrayList -> Array in the TypeContainer, as they
14617         were not actually that much faster, and introduced a bug (no error
14618         reports on duplicated methods).
14619
14620         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14621         source first, this will guarantee that we have a valid expression
14622         before calling in lower levels functions that will require a
14623         resolved object.  Then use this original_source in the
14624         target.ResolveLValue instead of the original source that was
14625         passed to us.
14626
14627         Another change.  Use target.Resolve instead of LValueResolve.
14628         Although we are resolving for LValues, we will let the Assign code
14629         take care of that (it will be called again from Resolve).  This
14630         basically allows code like this:
14631
14632         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14633         class Y { void A (X x) { x [0] += o; }
14634
14635         The problem was that the indexer was trying to resolve for
14636         set_Item (idx, object o) and never finding one.  The real set_Item
14637         was set_Item (idx, X).  By delaying the process we get the right
14638         semantics. 
14639
14640         Fixes bug 36505
14641
14642 2003-02-23  Martin Baulig  <martin@ximian.com>
14643
14644         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14645         while calling DoEmit ().
14646
14647         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14648         source files; if you use the #line directive inside a method, the
14649         compiler stops emitting line numbers for the debugger until it
14650         reaches the end of the method or another #line directive which
14651         restores the original file.
14652
14653 2003-02-23  Martin Baulig  <martin@ximian.com>
14654
14655         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14656
14657 2003-02-23  Martin Baulig  <martin@ximian.com>
14658
14659         * statement.cs (Block.AddChildVariableNames): We need to call this
14660         recursively, not just for our immediate children.
14661
14662 2003-02-23  Martin Baulig  <martin@ximian.com>
14663
14664         * class.cs (Event.Define): Always make the field private, like csc does.
14665
14666         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14667         actually work, fixes bug #37521.
14668
14669 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14670
14671         * delegate.cs: When creating the various temporary "Parameters"
14672         classes, make sure that we call the ComputeAndDefineParameterTypes
14673         on those new parameters (just like we do with the formal ones), to
14674         allow them to be resolved in the context of the DeclSpace.
14675
14676         This fixes the bug that Dick observed in Bugzilla #38530.
14677
14678 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14679
14680         * expression.cs (ResolveMemberAccess): When resolving a constant,
14681         do not attempt to pull a constant if the value was not able to
14682         generate a valid constant.
14683
14684         * const.cs (LookupConstantValue): Do not report more errors than required.
14685
14686 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14687
14688         * expression.cs: fixes bug #38328.
14689
14690 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14691
14692         * class.cs: Changed all the various members that can be part of a
14693         class from being an ArrayList to be an Array of the right type.
14694         During the DefineType type_list, interface_list, delegate_list and
14695         enum_list are turned into types, interfaces, delegates and enums
14696         arrays.  
14697
14698         And during the member population, indexer_list, event_list,
14699         constant_list, field_list, instance_constructor_list, method_list,
14700         operator_list and property_list are turned into their real arrays.
14701
14702         Although we could probably perform this operation earlier, for
14703         good error reporting we need to keep the lists and remove the
14704         lists for longer than required.
14705
14706         This optimization was triggered by Paolo profiling the compiler
14707         speed on the output of `gen-sample-program.pl' perl script. 
14708
14709         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14710         not crash in methods like MemberLookupFailed that use this field.  
14711
14712         This problem arises when the compiler fails to resolve a type
14713         during interface type definition for example.
14714
14715 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14716
14717         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14718         inherit from System.Object, so we have to stop at null, not only
14719         when reaching System.Object.
14720
14721 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14722
14723         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14724         DeclaredOnly because the parent indexer might have had a different
14725         name, but did not loop until the top of the hierarchy was reached.
14726
14727         The problem this one fixes is 35492: when a class implemented an
14728         indexer from an interface, we were getting the interface method
14729         (which was abstract) and we were flagging an error (can not invoke
14730         abstract method).
14731
14732         This also keeps bug 33089 functioning, and test-148 functioning.
14733
14734         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14735         out if a method is special is to see if it is declared in a
14736         property or event, or whether it is one of the predefined operator
14737         names.   This should fix correctly #36804.
14738
14739 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14740
14741         The goal here is to remove the dependency on EmptyCast.Peel ().
14742         Killing it completely.
14743
14744         The problem is that currently in a number of places where
14745         constants are expected, we have to "probe" for an EmptyCast, and
14746         Peel, which is not the correct thing to do, as this will be
14747         repetitive and will likely lead to errors. 
14748
14749         The idea is to remove any EmptyCasts that are used in casts that
14750         can be reduced to constants, so we only have to cope with
14751         constants. 
14752
14753         This bug hunt was triggered by Bug 37363 and the desire to remove
14754         the duplicate pattern where we were "peeling" emptycasts to check
14755         whether they were constants.  Now constants will always be
14756         constants.
14757
14758         * ecore.cs: Use an enumconstant here instead of wrapping with
14759         EmptyCast.  
14760
14761         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14762         throwing me off.  By handling this we can get rid of a few hacks.
14763
14764         * statement.cs (Switch): Removed Peel() code.
14765
14766 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14767
14768         * class.cs: Location information for error 508
14769
14770         * expression.cs (New.DoResolve): Add a guard against double
14771         resolution of an expression.  
14772
14773         The New DoResolve might be called twice when initializing field
14774         expressions (see EmitFieldInitializers, the call to
14775         GetInitializerExpression will perform a resolve on the expression,
14776         and later the assign will trigger another resolution
14777
14778         This leads to bugs (#37014)
14779
14780         * delegate.cs: The signature for EndInvoke should contain any ref
14781         or out parameters as well.  We were not doing this in the past. 
14782
14783         * class.cs (Field.Define): Do not overwrite the type definition
14784         inside the `volatile' group.  Turns out that volatile enumerations
14785         were changing the type here to perform a validity test, which
14786         broke conversions. 
14787
14788 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14789
14790         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14791         and structs, we do not want to load the instance variable
14792
14793         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14794         enum_type has to be handled like an object reference (implicit
14795         conversions exists from this to object), but the regular IsClass
14796         and IsValueType tests will never return true for this one.
14797
14798         Also we use TypeManager.IsValueType instead of type.IsValueType,
14799         just for consistency with the rest of the code (this is only
14800         needed if we ever use the construct exposed by test-180.cs inside
14801         corlib, which we dont today).
14802
14803 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14804
14805         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14806         just InternalCall.
14807
14808 2003-02-09  Martin Baulig  <martin@ximian.com>
14809
14810         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14811         (Namespace.DefineNamespaces): New static public method; this is
14812         called when we're compiling with debugging to add all namespaces
14813         to the symbol file.
14814
14815         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14816         pass it to the Namespace's .ctor.
14817
14818         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14819         and MethodBase arguments; pass the namespace ID to the symwriter;
14820         pass the MethodBase instead of the token to the symwriter.
14821         (SymbolWriter.DefineNamespace): New method to add a namespace to
14822         the symbol file.
14823
14824 2003-02-09  Martin Baulig  <martin@ximian.com>
14825
14826         * symbolwriter.cs: New file.  This is a wrapper around
14827         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14828         methods here in near future.
14829
14830 2003-02-09  Martin Baulig  <martin@ximian.com>
14831
14832         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14833         ILGenerator.MarkSequencePoint() which are actually used by the
14834         symbol writer.
14835
14836 2003-02-09  Martin Baulig  <martin@ximian.com>
14837
14838         * location.cs (SourceFile): New public sealed class.  This
14839         contains the name and an index which is used in the location's token.
14840         (Location): Reserve an appropriate number of bits in the token for
14841         the source file instead of walking over that list, this gives us a
14842         really huge performance improvement when compiling with debugging.
14843
14844         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14845         `SourceFile' argument instead of a string.
14846         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14847         but don't parse/tokenize here, we need to generate the list of all
14848         source files before we do that.
14849         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14850         the files.
14851
14852         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14853         instead of a string.
14854
14855         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14856         of a string.
14857
14858 2003-02-09  Martin Baulig  <martin@ximian.com>
14859
14860         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14861         filename on `#line default'.
14862
14863 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14864
14865         * statement.cs: don't clear the pinned var when the fixed statement
14866         returns from the method (fixes bug#37752).
14867
14868 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14869
14870         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14871         to IsValueType.
14872
14873 2003-02-07  Martin Baulig  <martin@ximian.com>
14874
14875         * driver.cs: Removed the `--debug-args' command line argument.
14876
14877         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14878         automatically by the AsssemblyBuilder.
14879         (CodeGen.InitializeSymbolWriter): We don't need to call any
14880         initialization function on the symbol writer anymore.  This method
14881         doesn't take any arguments.
14882
14883 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14884
14885         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14886         from referenced assemblies as well.
14887
14888 2003-02-02  Martin Baulig  <martin@ximian.com>
14889
14890         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14891
14892 2003-02-02  Martin Baulig  <martin@ximian.com>
14893
14894         * class.cs (Constructor.Emit): Open the symbol writer before
14895         emitting the constructor initializer.
14896         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14897         single-stepping through constructor initializers.
14898
14899 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14900
14901         * class.cs: Handle error 549: do not allow virtual methods in
14902         sealed classes. 
14903
14904 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14905
14906         * decl.cs: Check access levels when resolving types
14907
14908 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14909
14910         * statement.cs: Add parameters and locals set in catch blocks that might 
14911         return to set vector
14912
14913 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14914
14915         * class.cs (Operator): Set the SpecialName flags for operators.
14916
14917         * expression.cs (Invocation.DoResolve): Only block calls to
14918         accessors and operators on SpecialName methods.
14919
14920         (Cast.TryReduce): Handle conversions from char constants.
14921
14922
14923 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14924
14925         * statement.cs: small memory and time optimization in FlowBranching.
14926
14927 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14928
14929         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14930         problem that the last fix but in the other sid (Set).
14931
14932         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14933         access when there is no indexer in the hierarchy.
14934
14935 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14936
14937         * class.cs: Combine some if statements.
14938
14939 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14940
14941         * driver.cs: fixed bug #37187.
14942
14943 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14944
14945         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14946         any indexer, it's needed to build a list with all the indexers in the
14947         hierarchy (AllGetters), else we have problems. Fixes #35653.
14948
14949 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14950
14951         * class.cs (MethodData.Define): It is wrong for an interface
14952         implementation to be static in both cases: explicit and implicit.
14953         We were only handling this in one case.
14954
14955         Improve the if situation there to not have negations.
14956
14957         * class.cs (Field.Define): Turns out that we do not need to check
14958         the unsafe bit on field definition, only on usage.  Remove the test.
14959
14960 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14961
14962         * driver.cs: use assembly.Location instead of Codebase (the latest
14963         patch made mcs fail when using MS assemblies).
14964
14965 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14966
14967         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14968         get the path to *corlib.dll.
14969
14970 2003-01-21  Nick Drochak <ndrochak@gol.com>
14971
14972         * cs-tokenizer.cs:
14973         * pending.cs:
14974         * typemanager.cs: Remove compiler warnings
14975
14976 2003-01-20  Duncan Mak  <duncan@ximian.com>
14977
14978         * AssemblyInfo.cs: Bump the version number to 0.19.
14979
14980 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14981
14982         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14983
14984 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14985
14986         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14987
14988 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14989
14990         * cs-parser.jay: Small fix: we were not comparing the constructor
14991         name correctly.   Thanks to Zoltan for the initial pointer.
14992
14993 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14994
14995         * cs-tokenizer.cs: Set file name when specified with #line
14996
14997 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14998
14999         * cs-parser.jay: Only perform the constructor checks here if we
15000         are named like the class;  This will help provider a better
15001         error.  The constructor path is taken when a type definition is
15002         not found, but most likely the user forgot to add the type, so
15003         report that rather than the constructor error.
15004
15005 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15006
15007         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15008         allocations.
15009
15010 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15011
15012         * cs-parser.jay: Add cleanup call.
15013
15014 2003-01-13  Duncan Mak  <duncan@ximian.com>
15015
15016         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15017         consistent with other methods.
15018
15019 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15020
15021         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15022
15023 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15024
15025         * attribute.cs: only set GuidAttr to true when we have a
15026         GuidAttribute.
15027
15028 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15029
15030         * ecore.cs:
15031         * expression.cs:
15032         * typemanager.cs: fixes to allow mcs compile corlib with the new
15033         Type.IsSubclassOf fix.
15034
15035 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15036
15037         * expression.cs (LocalVariableReference.DoResolve): Classify a
15038         constant as a value, not as a variable.   Also, set the type for
15039         the variable.
15040
15041         * cs-parser.jay (fixed_statement): take a type instead of a
15042         pointer_type, so we can produce a better error message later.
15043
15044         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15045         as an error.  
15046
15047         (For.DoEmit): Make inifinite loops have a
15048         non-conditional branch back.
15049
15050         (Fixed.DoEmit): First populate the pinned variables, then emit the
15051         statement, then clear the variables.  Before I was emitting the
15052         code once for each fixed piece.
15053
15054
15055 2003-01-08  Martin Baulig  <martin@ximian.com>
15056
15057         * statement.cs (FlowBranching.MergeChild): A break in a
15058         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15059
15060 2003-01-08  Martin Baulig  <martin@ximian.com>
15061
15062         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15063         lives in the same number space than `param_map'.  Fixes #36154.
15064
15065 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15066
15067         * cs-parser.jay (constructor_declaration): Set the
15068         Constructor.ModFlags before probing for it.  This makes the
15069         compiler report 514, 515 and 132 (the code was there, but got
15070         broken). 
15071
15072         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15073         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15074         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15075
15076 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15077
15078         * enum.cs: create the enum static fields using the enum type.
15079
15080 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15081
15082         * class.cs: don't try to create the ParamBuilder for the return
15083         type if it's not needed (and handle it breaking for the ms runtime
15084         anyway).
15085
15086 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15087
15088         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15089
15090 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15091
15092         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15093         the command.   This showed up while compiling the JANET source
15094         code, which used \r as its only newline separator.
15095
15096 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15097
15098         * class.cs (Method.Define): If we are an operator (because it
15099         reuses our code), then set the SpecialName and HideBySig.  #36128
15100
15101 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15102
15103         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15104         exception, report error 120 `object reference required'.
15105
15106         * driver.cs: Add --pause option, used during to measure the size
15107         of the process as it goes with --timestamp.
15108
15109         * expression.cs (Invocation.DoResolve): Do not allow methods with
15110         SpecialName to be invoked.
15111
15112 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15113
15114         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15115         number before adding it.
15116
15117 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15118
15119         * ecore.cs (StandardImplicitConversion): When in an unsafe
15120         context, we allow conversion between void * to any other pointer
15121         type. This fixes bug #35973.
15122
15123 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15124
15125         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15126         is not thrown when extensionless outputs are used 
15127
15128 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15129
15130         * rootcontext.cs: fixed compilation of corlib.
15131
15132 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15133
15134         * attribute.cs (Attributes.Contains): Add new method.
15135
15136         * class.cs (MethodCore.LabelParameters): if the parameter is an
15137         `out' parameter, check that no attribute `[In]' has been passed.
15138
15139         * enum.cs: Handle the `value__' name in an enumeration.
15140
15141 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15142
15143         * decl.cs: Added special case to allow overrides on "protected
15144         internal" methods
15145
15146 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15147
15148         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15149         since it makes much more sense.
15150
15151         (Attributes.ctor): Don't require a Location parameter.
15152
15153         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15154
15155         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15156         since we already have that information per attribute.
15157
15158         * everywhere : make appropriate changes.
15159
15160         * class.cs (LabelParameters): Write the code which actually
15161         applies attributes to the return type. We can't do this on the MS
15162         .NET runtime so we flag a warning in the case an exception is
15163         thrown.
15164
15165 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15166
15167         * const.cs: Handle implicit null conversions here too.
15168
15169 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15170
15171         * class.cs (MethodCore.LabelParameters): Remove the extra
15172         Type [] parameter since it is completely unnecessary. Instead
15173         pass in the method's attributes so that we can extract
15174         the "return" attribute.
15175
15176 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15177
15178         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15179         of ignoring it and letting the compile continue.
15180
15181         * typemanager.cs (ChangeType): use an extra argument to return an
15182         error condition instead of throwing an exception.
15183
15184 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15185
15186         * expression.cs (Unary.TryReduce): mimic the code for the regular
15187         code path.  Perform an implicit cast in the cases where we can
15188         implicitly convert to one of the integral types, and then reduce
15189         based on that constant.   This fixes bug #35483.
15190
15191 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15192
15193         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15194
15195 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15196
15197         * namespace.cs: fixed bug #35489.
15198
15199 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15200
15201         * class.cs: Remove some dead code.
15202
15203         * cs-parser.jay: Estimate the number of methods needed
15204         (RootContext.MethodCount);
15205
15206         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15207         numbers instead of StringBuilders.
15208
15209         * support.cs (PtrHashtable): Add constructor with initial size;
15210         We can now reduce reallocations of the method table.
15211
15212 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15213
15214         * attribute.cs (ApplyAttributes): Keep track of the emitted
15215         attributes on a per-target basis. This fixes bug #35413.
15216
15217 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15218
15219         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15220         default to the Windows 1252 encoding.
15221
15222         (UnixParseOption): Support version, thanks to Alp for the missing
15223         pointer. 
15224
15225         * AssemblyInfo.cs: Add nice assembly information.
15226
15227         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15228         (bug 35169).
15229
15230         * cs-parser.jay: Allow a trailing comma before the close bracked
15231         in the attribute_section production.
15232
15233         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15234         address of the instance was being taken, I will take this out,
15235         because we take the address of the object immediately here.
15236
15237 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15238
15239         * typemanager.cs (AreMultipleAllowed): Take care of the most
15240         obvious case where attribute type is not in the current assembly -
15241         stupid me ;-)
15242
15243 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15244
15245         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15246         definitions, instead of doing that afterwards.  
15247
15248         Also we use a nice little hack, depending on the constructor, we
15249         know if we are a "composed" name or a simple name.  Hence, we
15250         avoid the IndexOf test, and we avoid 
15251
15252         * codegen.cs: Add code to assist in a bug reporter to track down
15253         the source of a compiler crash. 
15254
15255 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15256
15257         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15258         types have been emitted for a given element and flag an error
15259         if something which does not have AllowMultiple set is used more
15260         than once.
15261
15262         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15263         attribute types and their corresponding AllowMultiple properties
15264
15265         (AreMultipleAllowed): Check the property for a given type.
15266
15267         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15268         property in the case we have a TypeContainer.
15269
15270         (Attributes.AddAttribute): Detect duplicates and just skip on
15271         adding them. This trivial fix catches a pretty gross error in our
15272         attribute emission - global attributes were being emitted twice!
15273
15274         Bugzilla bug #33187 is now fixed.
15275
15276 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15277
15278         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15279         instead of pp_and).
15280
15281         * expression.cs (Binary.ResolveOperator): I can only use the
15282         Concat (string, string, string) and Concat (string, string,
15283         string, string) if the child is actually a concatenation of
15284         strings. 
15285
15286 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15287
15288         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15289         context where we need a 2-character lookahead.
15290
15291         * pending.cs (PendingImplementation): Rework so we can keep track
15292         of interface types all the time, and flag those which were
15293         implemented by parents as optional.
15294
15295 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15296
15297         * expression.cs (Binary.ResolveOperator): Use
15298         String.Concat(string,string,string) or
15299         String.Concat(string,string,string,string) when possible. 
15300
15301         * typemanager: More helper methods.
15302
15303
15304 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15305
15306         * pending.cs: remove the bogus return from GetMissingInterfaces()
15307         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15308
15309 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15310
15311         * namespace.cs: avoid duplicated 'using xxx' being added to
15312         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15313         when we get more than one 'using' statement for the same namespace.
15314         Report a CS0105 warning for it.
15315
15316 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15317
15318         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15319         of calling getChar/putback, uses internal knowledge of it.    
15320
15321         (xtoken): Reorder tokenizer so most common patterns are checked
15322         first.  This reduces the compilation time in another 5% (from 8.11s
15323         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15324
15325         The parsing time is 22% of the compilation in mcs, and from that
15326         64% is spent on the tokenization process.  
15327
15328         I tried using a binary search for keywords, but this is slower
15329         than the hashtable.  Another option would be to do a couple of
15330         things:
15331
15332                 * Not use a StringBuilder, instead use an array of chars,
15333                   with a set value.  Notice that this way we could catch
15334                   the 645 error without having to do it *afterwards*.
15335
15336                 * We could write a hand-parser to avoid the hashtable
15337                   compares altogether.
15338
15339         The identifier consumption process takes 37% of the tokenization
15340         time.  Another 15% is spent on is_number.  56% of the time spent
15341         on is_number is spent on Int64.Parse:
15342
15343                 * We could probably choose based on the string length to
15344                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15345                   computations. 
15346
15347         Another 3% is spend on wrapping `xtoken' in the `token' function.
15348
15349         Handle 0xa0 as whitespace (#34752)
15350
15351 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15352
15353         * typemanager.cs (IsCLRType): New routine to tell whether a type
15354         is one of the builtin types.  
15355
15356         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15357         typecode in more places instead of doing pointer comparissions.
15358         We could leverage some knowledge about the way the typecodes are
15359         laid out.
15360
15361         New code to cache namespaces in assemblies, it is currently not
15362         invoked, to be used soon.
15363
15364         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15365
15366         * expression.cs (Binary.ResolveOperator): specially handle
15367         strings, and do not perform user-defined operator overloading for
15368         built-in types.
15369
15370 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15371
15372         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15373         internalcall as it is a pretty simple operation;  Avoid whenever
15374         possible to call Char.IsLetter.
15375
15376         (consume_identifier): Cut by half the number of
15377         hashtable calls by merging the is_keyword and GetKeyword behavior.
15378
15379         Do not short-circuit, because if we do, we
15380         report errors (ie, #if false && true would produce an invalid
15381         directive error);
15382
15383
15384 2002-11-24  Martin Baulig  <martin@ximian.com>
15385
15386         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15387         check constant ranges and report a CS0221.  Fixes #33186.
15388
15389 2002-11-24  Martin Baulig  <martin@ximian.com>
15390
15391         * cs-parser.jay: Make this work for uninitialized variable
15392         declarations in the `for' initializer.  Fixes #32416.
15393
15394 2002-11-24  Martin Baulig  <martin@ximian.com>
15395
15396         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15397         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15398
15399 2002-11-24  Martin Baulig  <martin@ximian.com>
15400
15401         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15402         argument; if true, we also check for user-defined conversions.
15403         This is only needed if both arguments are of a user-defined type.
15404         Fixes #30443, added test-175.cs.
15405         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15406
15407         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15408
15409 2002-11-24  Martin Baulig  <martin@ximian.com>
15410
15411         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15412         function to get the store opcode.
15413         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15414         only emit the Ldelema if the store opcode is Stobj.  You must run
15415         both test-34 and test-167 to test this.  Fixes #34529.
15416
15417 2002-11-23  Martin Baulig  <martin@ximian.com>
15418
15419         * ecore.cs (Expression.MemberLookup): Added additional
15420         `qualifier_type' argument which is used when we're being called
15421         from MemberAccess.DoResolve() and null if we're called from a
15422         SimpleName lookup.
15423         (Expression.MemberLookupFailed): New method to report errors; this
15424         does the CS1540 check and reports the correct error message.
15425
15426         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15427         argument for the CS1540 check and redone the way how we're dealing
15428         with private members.  See the comment in the source code for details.
15429         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15430         `closure_start_type' to `closure_qualifier_type' and check whether
15431         it's not null.  It was not this filter being broken, it was just
15432         being called with the wrong arguments.
15433
15434         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15435         and pass it the correct `qualifier_type'; this also does the error
15436         handling for us.
15437
15438 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15439
15440         * expression.cs (Invocation.EmitParams): If the we are dealing
15441         with a non-built-in value type, load its address as well.
15442
15443         (ArrayCreation): Use a a pretty constant instead
15444         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15445         static initializers.  
15446
15447         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15448         because they are not really value types, just glorified integers. 
15449
15450         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15451
15452         * ecore.cs: Remove redundant code for enumerations, make them use
15453         the same code path as everything else, fixes the casting issue
15454         with enumerations in Windows.Forms.
15455
15456         * attribute.cs: Do only cast to string if it is a string, the
15457         validation happens later.
15458
15459         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15460         people upgrade their corlibs.
15461
15462         * ecore.cs: Oops, enumerations were not following the entire code path
15463
15464 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15465
15466         * typemanager.cs (FilterWithClosure): Commented out the test for
15467         1540 in typemanager.cs, as it has problems when accessing
15468         protected methods from a parent class (see test-174.cs). 
15469
15470         * attribute.cs (Attribute.ValidateGuid): new method.
15471         (Attribute.Resolve): Use above.
15472
15473 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15474
15475         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15476
15477         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15478         handling for enumerations, as we only needed the TypeContainer
15479         functionality to begin with (this is required for the fix below to
15480         work for enums that reference constants in a container class for
15481         example). 
15482
15483         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15484
15485         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15486         a valid TypeBuilder to perform lookups on.o
15487
15488         * class.cs (InheritableMemberSignatureCompare): Use true in the
15489         call to GetGetMethod and GetSetMethod, because we are comparing
15490         the signature, and we need to get the methods *even* if they are
15491         private. 
15492
15493         (PropertyBase.CheckBase): ditto.
15494
15495         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15496         GotoCase.Resolve): Use Peel on EmpytCasts.
15497
15498         * ecore.cs (EmptyCast): drop child, add Peel method.
15499
15500 2002-11-17  Martin Baulig  <martin@ximian.com>
15501
15502         * ecore.cs (EmptyCast.Child): New public property.
15503
15504         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15505         label resolved to an EmptyCast.  Fixes #34162.
15506         (GotoCase.Resolve): Likewise.
15507         (Block.EmitMeta): Likewise.
15508
15509 2002-11-17  Martin Baulig  <martin@ximian.com>
15510
15511         * expression.cs (Invocation.BetterConversion): Prefer int over
15512         uint; short over ushort; long over ulong for integer literals.
15513         Use ImplicitConversionExists instead of StandardConversionExists
15514         since we also need to check for user-defined implicit conversions.
15515         Fixes #34165.  Added test-173.cs.
15516
15517 2002-11-16  Martin Baulig  <martin@ximian.com>
15518
15519         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15520         with the `true' and `false' literals.  Fixes #33151.
15521
15522 2002-11-16  Martin Baulig  <martin@ximian.com>
15523
15524         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15525         October 22nd; don't do the cs1540 check for static members.
15526
15527         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15528         now using our own filter here and doing the cs1540 check again.
15529
15530 2002-11-16  Martin Baulig  <martin@ximian.com>
15531
15532         * support.cs (InternalParameters): Don't crash if we don't have
15533         any fixed parameters.  Fixes #33532.
15534
15535 2002-11-16  Martin Baulig  <martin@ximian.com>
15536
15537         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15538         when looking up static methods to make this work on Windows.
15539         Fixes #33773.
15540
15541 2002-11-16  Martin Baulig  <martin@ximian.com>
15542
15543         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15544         a setter rather than using PropertyInfo.CanWrite.
15545
15546 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15547
15548         * class.cs: Allow acces to block member by subclasses. Fixes build
15549         breaker.
15550
15551 2002-11-14  Martin Baulig  <martin@ximian.com>
15552
15553         * class.cs (Constructor.Emit): Added the extern/block check.
15554         Fixes bug #33678.
15555
15556 2002-11-14  Martin Baulig  <martin@ximian.com>
15557
15558         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15559         iteration while looking for indexers, this is needed because the
15560         indexer may have a different name in our base classes.  Fixed the
15561         error reporting (no indexers at all, not get accessor, no
15562         overloaded match).  Fixes bug #33089.
15563         (IndexerAccess.DoResolveLValue): Likewise.
15564
15565 2002-11-14  Martin Baulig  <martin@ximian.com>
15566
15567         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15568         indexers.  Fixes the first part of bug #33089.
15569         (MethodSignature.InheritableMemberSignatureCompare): Added support
15570         for properties.
15571
15572 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15573
15574         * attribute.cs (Attribute.Resolve): Catch the
15575         NullReferenceException and report it since it isn't supposed to
15576         happen. 
15577
15578 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15579
15580         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15581         LogicalOr and LogicalAnd that can benefit from recursively
15582         handling EmitBranchable.  The code now should be nice for Paolo.
15583
15584 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15585
15586         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15587         the Type lookups, as we perform quite a number of lookups on
15588         non-Types.  This can be removed once we can deterministically tell
15589         whether we have a type or a namespace in advance.
15590
15591         But this might require special hacks from our corlib.
15592
15593         * TODO: updated.
15594
15595         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15596         and double which avoids a conversion from an integer to a double.
15597
15598         * expression.cs: tiny optimization, avoid calling IsConstant,
15599         because it effectively performs the lookup twice.
15600
15601 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15602
15603         But a bogus return here to keep the semantics of the old code
15604         until the Mono runtime is fixed.
15605
15606         * pending.cs (GetMissingInterfaces): New method used to remove all
15607         the interfaces that are already implemented by our parent
15608         classes from the list of pending methods. 
15609
15610         * interface.cs: Add checks for calls after ResolveTypeExpr.
15611
15612 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15613
15614         * class.cs (Class.Emit): Report warning 67: event not used if the
15615         warning level is beyond 3.
15616
15617         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15618         being a NullLiteral.
15619
15620         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15621         specifiers. 
15622
15623         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15624         path that might fail if a type can not be resolved.
15625
15626         * expression.cs (Binary.Emit): Emit unsigned versions of the
15627         operators. 
15628
15629         * driver.cs: use error 5.
15630
15631 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15632
15633         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15634
15635 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15636
15637         * cs-parser.jay (switch_section): A beautiful patch from Martin
15638         Baulig that fixed 33094.
15639
15640 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15643         Check whether the base is abstract and report an error if so.
15644
15645         * expression.cs (IndexerAccess.DoResolveLValue,
15646         IndexerAccess.DoResolve): ditto. 
15647
15648         (Invocation.DoResolve): ditto.
15649
15650         (Invocation.FullMethodDesc): Improve the report string.
15651
15652         * statement.cs (Block): Eliminate IsVariableDefined as it is
15653         basically just a wrapper for GetVariableInfo.
15654
15655         * ecore.cs (SimpleName): Use new 
15656
15657         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15658         type, as we return the actual parameter ref/unref state on a
15659         different call.
15660
15661 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15662
15663         * support.cs: Return proper flags REF/OUT fixing the previous
15664         commit.  
15665
15666         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15667         not used to mean `ref' but `ref or out' in ParameterReference
15668
15669         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15670         full type signature instead of calling TypeManger.CSharpName
15671         ourselves. 
15672
15673         * support.cs (InternalParameters.ParameterDesc): Do not compare
15674         directly to the modflags, because REF/OUT will actually be bitsets
15675         if set. 
15676
15677         * delegate.cs (VerifyMethod): Check also the modifiers.
15678
15679         * cs-tokenizer.cs: Fix bug where floating point values with an
15680         exponent where a sign was missing was ignored.
15681
15682         * driver.cs: Allow multiple assemblies to be specified in a single
15683         /r: argument
15684
15685 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15686
15687         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15688         because identifiers after a parenthesis would end up in this kind
15689         of production, and we needed to desamiguate it for having casts
15690         like:
15691
15692                 (UserDefinedType *) xxx
15693
15694 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15695
15696         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15697         we should set on the Bindingflags.NonPublic, but not turn on
15698         private_ok.  private_ok controls whether a Private member is
15699         returned (this is chekced on the filter routine), while the
15700         BindingFlags.NonPublic just controls whether private/protected
15701         will be allowed.   This fixes the problem part of the problem of
15702         private properties being allowed to be used in derived classes.
15703
15704         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15705         so we can call the children DoResolveLValue method (this will
15706         properly signal errors on lvalue assignments to base properties)
15707
15708         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15709         getter are null, and we have a property info, we know that this
15710         happened because the lookup failed, so we report an error 122 for
15711         protection level violation.
15712
15713         We also silently return if setter and getter are null in the
15714         resolve functions, this condition only happens if we have flagged
15715         the error before.  This is the other half of the problem. 
15716
15717         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15718         not have accessibility information, that is why we were returning
15719         true in the filter function in typemanager.cs.
15720
15721         To properly report 122 (property is inaccessible because of its
15722         protection level) correctly, we report this error in ResolveAccess
15723         by failing if both the setter and the getter are lacking (ie, the
15724         lookup failed). 
15725
15726         DoResolve and DoLResolve have been modified to check for both
15727         setter/getter being null and returning silently, the reason being
15728         that I did not want to put the knowledge about this error in upper
15729         layers, like:
15730
15731         int old = Report.Errors;
15732         x = new PropertyExpr (...);
15733         if (old != Report.Errors)
15734                 return null;
15735         else
15736                 return x;
15737
15738         So the property expr is returned, but it is invalid, so the error
15739         will be flagged during the resolve process. 
15740
15741         * class.cs: Remove InheritablePropertySignatureCompare from the
15742         class, as we no longer depend on the property signature to compute
15743         whether it is possible to implement a method or not.
15744
15745         The reason is that calling PropertyInfo.GetGetMethod will return
15746         null (in .NET, in Mono it works, and we should change this), in
15747         cases where the Get Method does not exist in that particular
15748         class.
15749
15750         So this code:
15751
15752         class X { public virtual int A { get { return 1; } } }
15753         class Y : X { }
15754         class Z : Y { public override int A { get { return 2; } } }
15755
15756         Would fail in Z because the parent (Y) would not have the property
15757         defined.  So we avoid this completely now (because the alternative
15758         fix was ugly and slow), and we now depend exclusively on the
15759         method names.
15760
15761         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15762         reference method, instead of using the property.
15763
15764         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15765         routines are gone now.
15766
15767         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15768         names, they were incorrectly named.
15769
15770         * cs-tokenizer.cs: Return are more gentle token on failure. 
15771
15772         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15773         had an out-of-sync index variable, which caused it to remove from
15774         the list of pending methods the wrong method sometimes.
15775
15776 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15777
15778         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15779         CanWrite, because those refer to this particular instance of the
15780         property, and do not take into account the fact that we can
15781         override single members of a property.
15782
15783         Constructor requires an EmitContext.  The resolution process does
15784         not happen here, but we need to compute the accessors before,
15785         because the resolution does not always happen for properties.
15786
15787         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15788         subclass, before we did not update this flag, but we did update
15789         bindingflags. 
15790
15791         (GetAccessors): Drop this routine, as it did not work in the
15792         presence of partially overwritten set/get methods. 
15793
15794         Notice that this broke the cs1540 detection, but that will require
15795         more thinking. 
15796
15797 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15798
15799         * class.cs:
15800         * codegen.cs:
15801         * driver.cs: issue a warning instead of an error if we don't support
15802         debugging for the platform. Also ignore a couple of errors that may
15803         arise when trying to write the symbols. Undo my previous patch.
15804
15805 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15806
15807         * driver.cs: ignore /debug switch except for Unix platforms.
15808
15809 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15810
15811         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15812
15813 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15814
15815         * driver.cs: Do not make mcs-debug conditional, so we do not break
15816         builds that use it.
15817
15818         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15819         review this patch.  But basically after all the children variables
15820         have been merged, the value of "Breaks" was not being set to
15821         new_breaks for Switch blocks.  I think that it should be set after
15822         it has executed.  Currently I set this to the value of new_breaks,
15823         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15824         conservative, but I do not understand this code very well.
15825
15826         I did not break anything in the build, so that is good ;-)
15827
15828         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15829
15830 2002-10-20  Mark Crichton  <crichton@gimp.org>
15831
15832         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15833
15834 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15835
15836         * cfold.cs: Fixed compile blocker.
15837
15838 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15839
15840         * driver.cs: I was chekcing the key, not the file.
15841
15842 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15843
15844         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15845         message that we were generating - we just need to silently return
15846         a null.
15847
15848 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15849
15850         * class.cs (Event.Define): Change my previous commit, as this
15851         breaks the debugger.  This is a temporary hack, as it seems like
15852         the compiler is generating events incorrectly to begin with.
15853
15854         * expression.cs (Binary.ResolveOperator): Added support for 
15855         "U operator - (E x, E y)"
15856
15857         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15858         y)".
15859
15860         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15861         init-only variables, but this path did not take into account that
15862         there might be also instance readonly variables.  Correct this
15863         problem. 
15864
15865         This fixes bug 32253
15866
15867         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15868         delegates as well.
15869
15870         * driver.cs: Change the extension for modules to `netmodule'
15871
15872         * cs-parser.jay: Improved slightly the location tracking for
15873         the debugger symbols.
15874
15875         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15876         modifiers that were specified instead of the hardcoded value
15877         (FamAndAssem).  This was basically ignoring the static modifier,
15878         and others.  Fixes 32429.
15879
15880         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15881         fixed a bug in the process (32476)
15882
15883         * expression.cs (ArrayAccess.EmitAssign): Patch from
15884         hwang_rob@yahoo.ca that fixes bug 31834.3
15885
15886 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15887
15888         * driver.cs: Make the module extension .netmodule.
15889
15890 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15891
15892         * driver.cs: Report an error if the resource file is not found
15893         instead of crashing.
15894
15895         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15896         false, like Emit does.
15897
15898 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15899
15900         * typemanager.cs: Remove unused private member.  Also reported mcs
15901         bug to report this as a warning like csc.
15902
15903 2002-10-15  Martin Baulig  <martin@gnome.org>
15904
15905         * statement.cs (Statement.Emit): Made this a virtual method; emits
15906         the line number info and calls DoEmit().
15907         (Statement.DoEmit): New protected abstract method, formerly knows
15908         as Statement.Emit().
15909
15910         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15911
15912 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15913
15914         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15915         have fixed a remaining problem: not every AddXXXX was adding a
15916         fully qualified name.  
15917
15918         Now everyone registers a fully qualified name in the DeclSpace as
15919         being defined instead of the partial name.  
15920
15921         Downsides: we are slower than we need to be due to the excess
15922         copies and the names being registered this way.  
15923
15924         The reason for this is that we currently depend (on the corlib
15925         bootstrap for instance) that types are fully qualified, because
15926         we dump all the types in the namespace, and we should really have
15927         types inserted into the proper namespace, so we can only store the
15928         basenames in the defined_names array.
15929
15930 2002-10-10  Martin Baulig  <martin@gnome.org>
15931
15932         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15933         from bug #31834, see the bug report for a testcase which is
15934         miscompiled.
15935
15936 2002-10-10  Martin Baulig  <martin@gnome.org>
15937
15938         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15939         flow analysis code for this.
15940
15941         * statement.cs (Do, While, For): Tell the flow analysis code about
15942         infinite loops.
15943         (FlowBranching.UsageVector): Added support for infinite loops.
15944         (Block.Resolve): Moved the dead code elimination here and use flow
15945         analysis to do it.
15946
15947 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15948
15949         * class.cs (Field.Define): Catch cycles on struct type
15950         definitions. 
15951
15952         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15953         fields if the fields are static.  We only need to check instance
15954         fields. 
15955
15956         * expression.cs (As.DoResolve): Test for reference type.
15957
15958         * statement.cs (Using.ResolveExpression): Use
15959         ConvertImplicitRequired, not ConvertImplicit which reports an
15960         error on failture
15961         (Using.ResolveLocalVariableDecls): ditto.
15962
15963         * expression.cs (Binary.ResolveOperator): Report errors in a few
15964         places where we had to.
15965
15966         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15967
15968 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15969
15970         * expression.cs: Use StoreFromPtr instead of extracting the type
15971         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15972
15973         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15974         an enumeration value to a System.Enum, but System.Enum is not a
15975         value type, but an class type, so we need to box.
15976
15977         (Expression.ConvertExplicit): One codepath could return
15978         errors but not flag them.  Fix this.  Fixes #31853
15979
15980         * parameter.cs (Resolve): Do not allow void as a parameter type.
15981
15982 2002-10-06  Martin Baulig  <martin@gnome.org>
15983
15984         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15985         if it's a class type and not a struct.  Fixes #31815.
15986
15987 2002-10-06  Martin Baulig  <martin@gnome.org>
15988
15989         * statement.cs: Reworked the flow analysis code a bit to make it
15990         usable for dead code elimination.
15991
15992 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15993
15994         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15995
15996 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15997
15998         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15999         to fix the test 165, will investigate deeper.
16000
16001 2002-10-04  Martin Baulig  <martin@gnome.org>
16002
16003         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16004         finally blocks actually work.
16005         (Try.Resolve): We don't need to create a sibling for `finally' if
16006         there is no finally block.
16007
16008 2002-10-04  Martin Baulig  <martin@gnome.org>
16009
16010         * class.cs (Constructor.Define): The default accessibility for a
16011         non-default constructor is private, not public.
16012
16013 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16014
16015         * class.cs (Constructor): Make AllowedModifiers public, add
16016         EXTERN.
16017
16018         * cs-parser.jay: Perform the modifiers test here, as the
16019         constructor for the Constructor class usually receives a zero
16020         because of the way we create it (first we create, later we
16021         customize, and we were never checking the modifiers).
16022
16023         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16024         is a version of LookupTypeReflection that includes the type-name
16025         cache.  This can be used as a fast path for functions that know
16026         the fully qualified name and are only calling into *.GetType() to
16027         obtain a composed type.
16028
16029         This is also used by TypeManager.LookupType during its type
16030         composition.
16031
16032         (LookupType): We now also track the real type name, as sometimes
16033         we can get a quey for the real type name from things like
16034         ComposedCast.  This fixes bug 31422.
16035
16036         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16037         complete type fullname, it does not have to go through the type
16038         resolution system to obtain the composed version of the type (for
16039         obtaining arrays or pointers).
16040
16041         (Conditional.Emit): Use the EmitBoolExpression to
16042         generate nicer code, as requested by Paolo.
16043
16044         (ArrayCreation.CheckIndices): Use the patch from
16045         hwang_rob@yahoo.ca to validate the array initializers. 
16046
16047 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16048
16049         * class.cs (ConstructorInitializer.Emit): simplify code by using
16050         Invocation.EmitCall, and at the same time, fix the bugs in calling
16051         parent constructors that took variable arguments. 
16052
16053         * ecore.cs (Expression.ConvertNumericExplicit,
16054         Expression.ImplicitNumericConversion): Remove the code that
16055         manually wrapped decimal (InternalTypeConstructor call is now gone
16056         as well).
16057
16058         * expression.cs (Cast.TryReduce): Also handle decimal types when
16059         trying to perform a constant fold on the type.
16060
16061         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16062
16063         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16064         that only turned off an error report, and did nothing else. 
16065
16066 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16067
16068         * driver.cs: Handle and ignore /fullpaths
16069
16070 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16071
16072         * expression.cs (Binary.ResolveOperator): Catch the case where
16073         DoNumericPromotions returns true, 
16074
16075         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16076
16077 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16078
16079         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16080         report error 70.
16081
16082 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16083
16084         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16085         conversion exists, but it is also required that the conversion be
16086         performed.  This manifested in "(Type64Enum) 2".  
16087
16088         * class.cs (TypeManager.AddMethod): The fix is not to change
16089         AddEnum, because that one was using a fully qualified name (every
16090         DeclSpace derivative does), but to change the AddMethod routine
16091         that was using an un-namespaced name.  This now correctly reports
16092         the duplicated name.
16093
16094         Revert patch until I can properly fix it.  The issue
16095         is that we have a shared Type space across all namespaces
16096         currently, which is wrong.
16097
16098         Options include making the Namespace a DeclSpace, and merge
16099         current_namespace/current_container in the parser.
16100
16101 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16102
16103         * cs-parser.jay: Improve error reporting when we get a different
16104         kind of expression in local_variable_type and
16105         local_variable_pointer_type. 
16106
16107         Propagate this to avoid missleading errors being reported.
16108
16109         * ecore.cs (ImplicitReferenceConversion): treat
16110         TypeManager.value_type as a target just like object_type.   As
16111         code like this:
16112
16113         ValueType v = 1;
16114
16115         Is valid, and needs to result in the int 1 being boxed before it
16116         is assigned to the value type v.
16117
16118         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16119         to validate the enumeration name.
16120
16121         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16122         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16123         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16124
16125         * ecore.cs (TryImplicitIntConversion): When doing an
16126         implicit-enumeration-conversion, check if the type is 64-bits and
16127         perform a conversion before passing to EnumConstant.
16128
16129 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16130
16131         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16132         report ambiguous type references.  Unlike the MS version, we
16133         report what the ambiguity is.   Innovation at work ;-)
16134
16135         (DeclSpace.FindType): Require a location argument to
16136         display when we display an ambiguous error.
16137
16138         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16139
16140         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16141
16142         * expression.cs (EmitDynamicInitializers): Apply patch from
16143         hwang_rob@yahoo.ca that fixes the order in which we emit our
16144         initializers. 
16145
16146 2002-09-21  Martin Baulig  <martin@gnome.org>
16147
16148         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16149         delegate takes no arguments.
16150
16151 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16152
16153         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16154         from integers.
16155
16156         * expression.cs: Extract the underlying type.
16157
16158         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16159
16160         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16161
16162 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16163
16164         * class.cs (TypeContainer.DefineType): We can not use the nice
16165         PackingSize with the size set to 1 DefineType method, because it
16166         will not allow us to define the interfaces that the struct
16167         implements.
16168
16169         This completes the fixing of bug 27287
16170
16171         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16172         means also structs.  This fixes part of the problem. 
16173         (Expresion.ImplicitReferenceConversionExists): ditto.
16174
16175         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16176         error if there were no errors reported during the type lookup
16177         process, to avoid duplicates or redundant errors.  Without this
16178         you would get an ambiguous errors plus a type not found.  We have
16179         beaten the user enough with the first error.  
16180
16181         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16182         reference. 
16183
16184         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16185         during the resolution process, stop the lookup, this avoids
16186         repeated error reports (same error twice).
16187
16188         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16189
16190         * typemanager.cs (LookupType): Redo the type lookup code to match
16191         the needs of System.Reflection.  
16192
16193         The issue is that System.Reflection requires references to nested
16194         types to begin with a "+" sign instead of a dot.  So toplevel
16195         types look like: "NameSpace.TopLevelClass", and nested ones look
16196         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16197         levels. 
16198
16199 2002-09-19  Martin Baulig  <martin@gnome.org>
16200
16201         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16202         says that a method always returns or always throws an exception,
16203         don't report the CS0161.
16204
16205         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16206         set `Returns = new_returns'.
16207
16208 2002-09-19  Martin Baulig  <martin@gnome.org>
16209
16210         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16211         to an enum constant, check for a CS0176.
16212
16213 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16214
16215         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16216         for operators that must be in pairs and report errors.
16217
16218         * ecore.cs (SimpleName.DoResolveType): During the initial type
16219         resolution process, when we define types recursively, we must
16220         check first for types in our current scope before we perform
16221         lookups in the enclosing scopes.
16222
16223         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16224
16225         (Invocation.VerifyArgumentsCompat): Call
16226         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16227         I thought we were supposed to always call this, but there are a
16228         few places in the code where we dont do it.
16229
16230 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16231
16232         * driver.cs: Add support in -linkres and -resource to specify the
16233         name of the identifier.
16234
16235 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16236
16237         * ecore.cs (StandardConversionExists): Sync with the conversion
16238         code: allow anything-* to void* conversions.
16239
16240         (FindMostSpecificSource): Use an Expression argument
16241         instead of a Type, because we might be handed over a Literal which
16242         gets a few more implicit conversions that plain types do not.  So
16243         this information was being lost.
16244
16245         Also, we drop the temporary type-holder expression when not
16246         required.
16247
16248 2002-09-17  Martin Baulig  <martin@gnome.org>
16249
16250         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16251         this is an explicit interface implementation.
16252
16253 2002-09-17  Martin Baulig  <martin@gnome.org>
16254
16255         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16256         different `IndexerName' attributes.
16257
16258         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16259         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16260         virtual CommonResolve().
16261
16262 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16263
16264         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16265         and convert that to the UnderlyingType.
16266
16267         * statement.cs (Foreach.Resolve): Indexers are just like variables
16268         or PropertyAccesses.
16269
16270         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16271         inside quoted strings, we were not doing this before.
16272
16273 2002-09-16  Martin Baulig  <martin@gnome.org>
16274
16275         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16276         resolve it.  This is needed for the definite assignment check of the
16277         instance expression, fixes bug #29846.
16278         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16279
16280 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16281
16282         * parameter.cs: Fix compile error.  Cannot reference static member
16283         from an instance object.  Is this an mcs bug?
16284
16285 2002-09-14  Martin Baulig  <martin@gnome.org>
16286
16287         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16288         multiple times.  Fixes bug #30295, added test-166.cs.
16289
16290 2002-09-14  Martin Baulig  <martin@gnome.org>
16291
16292         * statement.cs (Block.Emit): Don't emit unreachable code.
16293         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16294         `break' statements.
16295         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16296
16297 2002-09-14  Martin Baulig  <martin@gnome.org>
16298
16299         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16300         is set.
16301
16302 2002-09-14  Martin Baulig  <martin@gnome.org>
16303
16304         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16305         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16306         be false on the ms runtime.
16307
16308 2002-09-13  Martin Baulig  <martin@gnome.org>
16309
16310         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16311         the CS0038 error message.
16312
16313 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16314
16315         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16316         constant inside, return it.
16317
16318 2002-09-12  Martin Baulig  <martin@gnome.org>
16319
16320         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16321         implicit conversion can be done between enum types.
16322
16323         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16324         check whether an implicit conversion to the current enum's UnderlyingType
16325         exists and report an error if not.
16326
16327         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16328         without debugging support.
16329
16330         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16331         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16332
16333 2002-09-12  Martin Baulig  <martin@gnome.org>
16334
16335         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16336
16337         * ecore.cs (IMemberExpr.DeclaringType): New property.
16338         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16339         nonstatic member of an outer type (CS0038).
16340
16341 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16342
16343         * driver.cs: Activate the using-error detector at warning level
16344         4 (at least for MS-compatible APIs).
16345
16346         * namespace.cs (VerifyUsing): Small buglett fix.
16347
16348         * pending.cs (PendingImplementation): pass the container pointer. 
16349
16350         * interface.cs (GetMethods): Allow for recursive definition.  Long
16351         term, I would like to move every type to support recursive
16352         definitions, not the current ordering mechanism that we have right
16353         now.
16354
16355         The situation is this: Attributes are handled before interfaces,
16356         so we can apply attributes to interfaces.  But some attributes
16357         implement interfaces, we will now handle the simple cases
16358         (recursive definitions will just get an error).  
16359
16360         * parameter.cs: Only invalidate types at the end if we fail to
16361         lookup all types.  
16362
16363 2002-09-09  Martin Baulig  <martin@gnome.org>
16364
16365         * ecore.cs (PropertyExpr.Emit): Also check for
16366         TypeManager.system_int_array_get_length so this'll also work when
16367         compiling corlib.  Fixes #30003.
16368
16369 2002-09-09  Martin Baulig  <martin@gnome.org>
16370
16371         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16372         and throw an exception if we can't get the type's size.  Fixed #30040,
16373         added test-165.cs.
16374
16375 2002-09-09  Martin Baulig  <martin@gnome.org>
16376
16377         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16378
16379         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16380         context.  Fixes bug #30027.
16381
16382         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16383         virtual functions.  Fixes bug #30043, added test-164.cs.
16384
16385 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16386
16387         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16388
16389 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16390
16391         * driver.cs: Use an object to get the windows codepage since it's not a
16392         static property.
16393
16394 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16395
16396         * statement.cs (For.Emit): for infinite loops (test == null)
16397         return whether there is a break inside, not always "true".
16398
16399         * namespace.cs (UsingEntry): New struct to hold the name of the
16400         using definition, the location where it is defined, and whether it
16401         has been used in a successful type lookup.
16402
16403         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16404         strings.
16405
16406         * decl.cs: ditto.
16407
16408 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16409
16410         * attribute.cs : Fix incorrect code which relied on catching
16411         a NullReferenceException to detect a null being passed in
16412         where an object was expected.
16413
16414 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16415
16416         * statement.cs (Try): flag the catch variable as assigned
16417
16418         * expression.cs (Cast): Simplified by using ResolveType instead of
16419         manually resolving.
16420
16421         * statement.cs (Catch): Fix bug by using ResolveType.
16422
16423 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16424
16425         * expression.cs (BetterConversion): Special case for when we have
16426         a NullLiteral as the argument and we have to choose between string
16427         and object types - we choose string the way csc does.
16428
16429         * attribute.cs (Attribute.Resolve): Catch the
16430         NullReferenceException and report error #182 since the Mono
16431         runtime no more has the bug and having this exception raised means
16432         we tried to select a constructor which takes an object and is
16433         passed a null.
16434
16435 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16436
16437         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16438         message (1502, 1503) when we can't locate a method after overload
16439         resolution. This is much more informative and closes the bug
16440         Miguel reported.
16441
16442         * interface.cs (PopulateMethod): Return if there are no argument
16443         types. Fixes a NullReferenceException bug.
16444
16445         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16446         expressions too. Previously we were checking only in one place for
16447         positional arguments leaving out named arguments.
16448
16449         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16450         type to the enum type is not allowed. Remove code corresponding to
16451         that.
16452
16453         (ConvertNumericExplicit): Allow explicit conversions from
16454         the underlying type to enum type. This precisely follows the spec
16455         and closes a bug filed by Gonzalo.
16456
16457 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16458
16459         * compiler.csproj:
16460         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16461
16462 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16463
16464         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16465         it was important that we stored the right value after the
16466         reduction in `converted'.
16467
16468 2002-09-04  Martin Baulig  <martin@gnome.org>
16469
16470         * location.cs (Location.SymbolDocument): Use full pathnames for the
16471         source files.
16472
16473 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16474
16475         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16476         of the expression resolve mechanism, because that will catch the
16477         SimpleName error failures.
16478
16479         (Conditional): If we can not resolve the
16480         expression, return, do not crash.
16481
16482 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16483
16484         * cs-tokenizer.cs:
16485         (location): display token name instead of its number.
16486
16487 2002-08-28  Martin Baulig  <martin@gnome.org>
16488
16489         * expression.cs (Binary.ResolveOperator): Don't silently return
16490         but return an error if an operator cannot be applied between two
16491         enum types.
16492
16493 2002-08-28  Martin Baulig  <martin@gnome.org>
16494
16495         * class.cs (Constructor.Define): Set the permission attributes
16496         correctly instead of making all constructors public.
16497
16498 2002-08-28  Martin Baulig  <martin@gnome.org>
16499
16500         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16501         for private members before reporting a CS0103; if we find anything,
16502         it's a CS0122.
16503
16504 2002-08-28  Martin Baulig  <martin@gnome.org>
16505
16506         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16507         to check whether `closure_start_type == closure_invocation_type',
16508         we also need to check whether `m.DeclaringType == closure_invocation_type'
16509         before bypassing the permission checks.  We might be accessing
16510         protected/private members from the base class.
16511         (TypeManager.RealMemberLookup): Only set private_ok if private
16512         members were requested via BindingFlags.NonPublic.
16513
16514         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16515
16516         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16517         MethodGroupExpr.IsExplicitImpl if appropriate.
16518         (Invocation.DoResolve): Don't report the CS0120 for explicit
16519         interface implementations.
16520
16521 2002-08-27  Martin Baulig  <martin@gnome.org>
16522
16523         * expression.cs (Invocation.DoResolve): If this is a static
16524         method and we don't have an InstanceExpression, we must report
16525         a CS0120.
16526
16527 2002-08-25  Martin Baulig  <martin@gnome.org>
16528
16529         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16530         `==' between a valuetype and an object.
16531
16532 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16533
16534         * ecore.cs (TypeExpr): Provide a ToString method.
16535
16536 2002-08-24  Martin Baulig  <martin@gnome.org>
16537
16538         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16539         now called proggie.dbg and it's a binary file.
16540
16541 2002-08-23  Martin Baulig  <martin@gnome.org>
16542
16543         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16544
16545 2002-08-23  Martin Baulig  <martin@gnome.org>
16546
16547         * struct.cs (MyStructInfo.ctor): Make this work with empty
16548         structs; it's not allowed to use foreach() on null.
16549
16550 2002-08-23  Martin Baulig  <martin@gnome.org>
16551
16552         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16553         writer the full pathname of the generated assembly.
16554
16555 2002-08-23  Martin Baulig  <martin@gnome.org>
16556
16557         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16558         A `finally' block never returns or breaks; improved handling of
16559         unreachable code.
16560
16561 2002-08-23  Martin Baulig  <martin@gnome.org>
16562
16563         * statement.cs (Throw.Resolve): Allow `throw null'.
16564
16565 2002-08-23  Martin Baulig  <martin@gnome.org>
16566
16567         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16568         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16569         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16570         MemberLookup would return a wrong event if this is an explicit
16571         interface implementation and the class has an event with the same
16572         name.
16573
16574 2002-08-23  Martin Baulig  <martin@gnome.org>
16575
16576         * statement.cs (Block.AddChildVariableNames): New public method.
16577         (Block.AddChildVariableName): Likewise.
16578         (Block.IsVariableNameUsedInChildBlock): Likewise.
16579         (Block.AddVariable): Check whether a variable name has already
16580         been used in a child block.
16581
16582         * cs-parser.jay (declare_local_variables): Mark all variable names
16583         from the current block as being used in a child block in the
16584         implicit block.
16585
16586 2002-08-23  Martin Baulig  <martin@gnome.org>
16587
16588         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16589         find the symbol writer.
16590
16591         * driver.cs: csc also allows the arguments to /define being
16592         separated by commas, not only by semicolons.
16593
16594 2002-08-23  Martin Baulig  <martin@gnome.org>
16595
16596         * interface.cs (Interface.GetMembers): Added static check for events.
16597
16598 2002-08-15  Martin Baulig  <martin@gnome.org>
16599
16600         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16601         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16602
16603         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16604         why the MethodData.EmitDestructor() change was necessary.
16605
16606 2002-08-20  Martin Baulig  <martin@gnome.org>
16607
16608         * class.cs (TypeContainer.FindMembers): Added static check for events.
16609
16610         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16611
16612         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16613         use Type.GetEvents(), not Type.FindMembers().
16614
16615 2002-08-20  Martin Baulig  <martin@gnome.org>
16616
16617         * decl.cs (MemberCache): Added a special method cache which will
16618         be used for method-only searched.  This ensures that a method
16619         search will return a MethodInfo with the correct ReflectedType for
16620         inherited methods.      
16621
16622 2002-08-20  Martin Baulig  <martin@gnome.org>
16623
16624         * decl.cs (DeclSpace.FindMembers): Made this public.
16625
16626 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16627
16628         * delegate.cs: fixed build on windows.
16629         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16630
16631 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16632
16633         * ecore.cs (StandardConversionExists): Return a false
16634         if we are trying to convert the void type to anything else
16635         since that is not allowed.
16636
16637         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16638         we flag error 70 in the event an event is trying to be accessed
16639         directly from outside the declaring type.
16640
16641 2002-08-20  Martin Baulig  <martin@gnome.org>
16642
16643         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16644         MemberCache from typemanager.cs to decl.cs.
16645
16646 2002-08-19  Martin Baulig  <martin@gnome.org>
16647
16648         * class.cs (TypeContainer): Implement IMemberContainer.
16649         (TypeContainer.DefineMembers): Create the MemberCache.
16650         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16651         return public members if BindingFlags.Public was given, check
16652         whether members are static.
16653
16654 2002-08-16  Martin Baulig  <martin@gnome.org>
16655
16656         * decl.cs (DeclSpace.Define): Splitted this in Define and
16657         DefineMembers.  DefineMembers is called first and initializes the
16658         MemberCache.
16659
16660         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16661         DefineMembers() on all our DeclSpaces.
16662
16663         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16664         but call DefineMembers() on all nested interfaces.  We call their
16665         Define() in our new Define() function.
16666
16667         * interface.cs (Interface): Implement IMemberContainer.
16668         (Interface.Define): Moved all code except the attribute stuf to
16669         DefineMembers().
16670         (Interface.DefineMembers): Initialize the member cache.
16671
16672         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16673         need this anymore since we can use MemberCache.FindMembers directly.
16674
16675 2002-08-19  Martin Baulig  <martin@gnome.org>
16676
16677         * typemanager.cs (MemberCache): When creating the cache for an
16678         interface type, add all inherited members.
16679         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16680         to `out bool used_cache' and documented it.
16681         (TypeManager.MemberLookup): If we already used the cache in the first
16682         iteration, we don't need to do the interfaces check.
16683
16684 2002-08-19  Martin Baulig  <martin@gnome.org>
16685
16686         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16687         here from IMemberFinder and don't implement this interface anymore.
16688         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16689
16690         * typemanager.cs (IMemberFinder): This interface is now only used by
16691         classes which actually support the member cache.
16692         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16693         since we only put DeclSpaces into this Hashtable.
16694         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16695         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16696
16697 2002-08-16  Martin Baulig  <martin@gnome.org>
16698
16699         * typemanager.cs (ICachingMemberFinder): Removed.
16700         (IMemberFinder.MemberCache): New property.
16701         (TypeManager.FindMembers): Merged this with RealFindMembers().
16702         This function will never be called from TypeManager.MemberLookup()
16703         so we can't use the cache here, just the IMemberFinder.
16704         (TypeManager.MemberLookup_FindMembers): Check whether the
16705         IMemberFinder has a MemberCache and call the cache's FindMembers
16706         function.
16707         (MemberCache): Rewrote larger parts of this yet another time and
16708         cleaned it up a bit.
16709
16710 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16711
16712         * driver.cs (LoadArgs): Support quoting.
16713
16714         (Usage): Show the CSC-like command line arguments.
16715
16716         Improved a few error messages.
16717
16718 2002-08-15  Martin Baulig  <martin@gnome.org>
16719
16720         * typemanager.cs (IMemberContainer.Type): New property.
16721         (IMemberContainer.IsInterface): New property.
16722
16723         The following changes are conditional to BROKEN_RUNTIME, which is
16724         defined at the top of the file.
16725
16726         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16727         class'es members, but add all members from TypeHandle.ObjectType
16728         if we're an interface.
16729         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16730         is the current type.
16731         (MemberCache.CacheEntry.Container): Removed this field.
16732         (TypeHandle.GetMembers): Include inherited members.
16733
16734 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16735
16736         * typemanager.cs: fixed compilation and added a comment on a field that
16737         is never used.
16738
16739 2002-08-15  Martin Baulig  <martin@gnome.org>
16740
16741         * class.cs (ConstructorInitializer.Resolve): In the
16742         Expression.MemberLookup call, use the queried_type as
16743         invocation_type.
16744
16745         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16746         declared' attribute, it's always true.
16747         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16748         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16749         temporary wrapper for FindMembers which tells MemberLookup whether
16750         members from the base classes are included in the return value.
16751         This will go away soon.
16752         (TypeManager.MemberLookup): Use this temporary hack here; once the
16753         new MemberCache is completed, we don't need to do the DeclaredOnly
16754         looping here anymore since the MemberCache will take care of this.
16755         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16756         (MemberCache): When creating the MemberCache for a class, get
16757         members from the current class and all its base classes.
16758         (MemberCache.CacheEntry.Container): New field.  This is a
16759         temporary hack until the Mono runtime is fixed to distinguish
16760         between ReflectedType and DeclaringType.  It allows us to use MCS
16761         with both the MS runtime and the unfixed Mono runtime without
16762         problems and without accecting performance.
16763         (MemberCache.SearchMembers): The DeclaredOnly looping from
16764         TypeManager.MemberLookup is now done here.      
16765
16766 2002-08-14  Martin Baulig  <martin@gnome.org>
16767
16768         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16769         Type.GetFields on dynamic types but get the fields from the
16770         corresponding TypeContainer.
16771         (MyStructInfo.GetStructInfo): Added check for enum types.
16772
16773         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16774         (MemberList.SyncRoot): Implemented.
16775         (TypeManager.FilterWithClosure): No need to check permissions if
16776         closure_start_type == closure_invocation_type, don't crash if
16777         closure_invocation_type is null.
16778
16779 2002-08-13  Martin Baulig  <martin@gnome.org>
16780
16781         Rewrote TypeContainer.FindMembers to use a member cache.  This
16782         gives us a speed increase of about 35% for the self-hosting MCS
16783         build and of about 15-20% for the class libs (both on GNU/Linux).
16784
16785         * report.cs (Timer): New class to get enhanced profiling.  This
16786         whole class is "TIMER" conditional since it remarkably slows down
16787         compilation speed.
16788
16789         * class.cs (MemberList): New class.  This is an IList wrapper
16790         which we're now using instead of passing MemberInfo[]'s around to
16791         avoid copying this array unnecessarily.
16792         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16793         (ICachingMemberFinder, IMemberContainer): New interface.
16794         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16795         has already been checked, otherwise use it for the name comparision.
16796         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16797         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16798         if possible.  Returns a MemberList, not a MemberInfo [].
16799         (TypeHandle): New class, implements IMemberContainer.  We create
16800         one instance of this class per type, it contains a MemberCache
16801         which is used to do the member lookups.
16802         (MemberCache): New class.  Each instance of this class contains
16803         all members of a type and a name-based hash table.
16804         (MemberCache.FindMembers): This is our new member lookup
16805         function.  First, it looks up all members of the requested name in
16806         the hash table.  Then, it walks this list and sorts out all
16807         applicable members and returns them.
16808
16809 2002-08-13  Martin Baulig  <martin@gnome.org>
16810
16811         In addition to a nice code cleanup, this gives us a performance
16812         increase of about 1.4% on GNU/Linux - not much, but it's already
16813         half a second for the self-hosting MCS compilation.
16814
16815         * typemanager.cs (IMemberFinder): New interface.  It is used by
16816         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16817         Enum, Delegate or Interface.
16818         (TypeManager.finder_to_member_finder): New PtrHashtable.
16819         (TypeManager.finder_to_container): Removed.
16820         (TypeManager.finder_to_delegate): Removed.
16821         (TypeManager.finder_to_interface): Removed.
16822         (TypeManager.finder_to_enum): Removed.
16823
16824         * interface.cs (Interface): Implement IMemberFinder.
16825
16826         * delegate.cs (Delegate): Implement IMemberFinder.
16827
16828         * enum.cs (Enum): Implement IMemberFinder.
16829
16830         * class.cs (TypeContainer): Implement IMemberFinder.
16831
16832 2002-08-12  Martin Baulig  <martin@gnome.org>
16833
16834         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16835
16836 2002-08-12  Martin Baulig  <martin@gnome.org>
16837
16838         * ecore.cs (ITypeExpression): New interface for expressions which
16839         resolve to a type.
16840         (TypeExpression): Renamed to TypeLookupExpression.
16841         (Expression.DoResolve): If we're doing a types-only lookup, the
16842         expression must implement the ITypeExpression interface and we
16843         call DoResolveType() on it.
16844         (SimpleName): Implement the new ITypeExpression interface.
16845         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16846         hack, the situation that we're only looking up types can't happen
16847         anymore when this method is called.  Moved the type lookup code to
16848         DoResolveType() and call it.
16849         (SimpleName.DoResolveType): This ITypeExpression interface method
16850         is now doing the types-only lookup.
16851         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16852         (ResolveFlags): Added MaskExprClass.
16853
16854         * expression.cs (MemberAccess): Implement the ITypeExpression
16855         interface.
16856         (MemberAccess.DoResolve): Added support for a types-only lookup
16857         when we're called via ITypeExpression.DoResolveType().
16858         (ComposedCast): Implement the ITypeExpression interface.
16859
16860         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16861         Expression.Resolve() with ResolveFlags.Type instead.
16862
16863 2002-08-12  Martin Baulig  <martin@gnome.org>
16864
16865         * interface.cs (Interface.Define): Apply attributes.
16866
16867         * attribute.cs (Attribute.ApplyAttributes): Added support for
16868         interface attributes.
16869
16870 2002-08-11  Martin Baulig  <martin@gnome.org>
16871
16872         * statement.cs (Block.Emit): Only check the "this" variable if we
16873         do not always throw an exception.
16874
16875         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16876         whether the property has a set accessor.
16877
16878 2002-08-11  Martin Baulig  <martin@gnome.org>
16879
16880         Added control flow analysis support for structs.
16881
16882         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16883         with control flow analysis turned off.
16884         (IVariable): New interface.
16885         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16886         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16887         (FieldExpr.DoResolve): Resolve the instance expression with flow
16888         analysis turned off and do the definite assignment check after the
16889         resolving when we know what the expression will resolve to.
16890
16891         * expression.cs (LocalVariableReference, ParameterReference):
16892         Implement the new IVariable interface, only call the flow analysis
16893         code if ec.DoFlowAnalysis is true.
16894         (This): Added constructor which takes a Block argument.  Implement
16895         the new IVariable interface.
16896         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16897         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16898         This does the definite assignment checks for struct members.
16899
16900         * class.cs (Constructor.Emit): If this is a non-static `struct'
16901         constructor which doesn't have any initializer, call
16902         Block.AddThisVariable() to tell the flow analysis code that all
16903         struct elements must be initialized before control returns from
16904         the constructor.
16905
16906         * statement.cs (MyStructInfo): New public class.
16907         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16908         argument to this indexer.  If non-zero, check an individual struct
16909         member, not the whole struct.
16910         (FlowBranching.CheckOutParameters): Check struct members.
16911         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16912         overloaded versions of these methods which take an additional
16913         `int field_idx' argument to check struct members.
16914         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16915         overloaded versions of these methods which take an additional
16916         `string field_name' argument to check struct member.s
16917         (VariableInfo): Implement the IVariable interface.
16918         (VariableInfo.StructInfo): New public property.  Returns the
16919         MyStructInfo instance of the variable if it's a struct or null.
16920         (Block.AddThisVariable): New public method.  This is called from
16921         Constructor.Emit() for non-static `struct' constructor which do
16922         not have any initializer.  It creates a special variable for the
16923         "this" instance variable which will be checked by the flow
16924         analysis code to ensure that all of the struct's fields are
16925         initialized before control returns from the constructor.
16926         (UsageVector): Added support for struct members.  If a
16927         variable/parameter is a struct with N members, we reserve a slot
16928         in the usage vector for each member.  A struct is considered fully
16929         initialized if either the struct itself (slot 0) or all its
16930         members are initialized.
16931
16932 2002-08-08  Martin Baulig  <martin@gnome.org>
16933
16934         * driver.cs (Driver.MainDriver): Only report an error CS5001
16935         if there were no compilation errors.
16936
16937         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16938         `UnsafeContext' property to determine whether the parent is in
16939         unsafe context rather than checking the parent's ModFlags:
16940         classes nested in an unsafe class are unsafe as well.
16941
16942 2002-08-08  Martin Baulig  <martin@gnome.org>
16943
16944         * statement.cs (UsageVector.MergeChildren): Distinguish between
16945         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16946         we return.  Added test17() and test18() to test-154.cs.
16947
16948 2002-08-08  Martin Baulig  <martin@gnome.org>
16949
16950         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16951         Family access, make sure the invoking type isn't a subclass of the
16952         queried type (that'd be a CS1540).
16953
16954         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16955         this method which takes an additional `Type invocation_type'.
16956
16957         * expression.cs (BaseAccess.DoResolve): Use the base type as
16958         invocation and query type.
16959         (MemberAccess.DoResolve): If the lookup failed and we're about to
16960         report a CS0122, try a lookup with the ec.ContainerType - if this
16961         succeeds, we must report a CS1540.
16962
16963 2002-08-08  Martin Baulig  <martin@gnome.org>
16964
16965         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16966         (MethodGroupExpr): Implement the IMemberExpr interface.
16967
16968         * expression (MemberAccess.ResolveMemberAccess): No need to have
16969         any special code for MethodGroupExprs anymore, they're now
16970         IMemberExprs.   
16971
16972 2002-08-08  Martin Baulig  <martin@gnome.org>
16973
16974         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16975         Family, FamANDAssem and FamORAssem permissions.
16976         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16977
16978 2002-08-08  Martin Baulig  <martin@gnome.org>
16979
16980         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16981         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16982         or loop block.
16983
16984 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16985
16986         * driver.cs: implemented /resource option to embed managed resources.
16987
16988 2002-08-07  Martin Baulig  <martin@gnome.org>
16989
16990         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16991         (FieldBase.HasFieldInitializer): New public property.
16992         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16993         returns the field initializer and makes sure it is only resolved once.
16994         (TypeContainer.EmitFieldInitializers): Call
16995         FieldBase.GetInitializerExpression to get the initializer, this ensures
16996         that it isn't resolved multiple times.
16997
16998         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16999         the resolving process (SimpleName/MemberLookup) that we're currently
17000         emitting a field initializer (which must not access any instance members,
17001         this is an error CS0236).
17002
17003         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17004         argument, if the `IsFieldInitializer' flag is set, we must report and
17005         error CS0236 and not an error CS0120.   
17006
17007 2002-08-07  Martin Baulig  <martin@gnome.org>
17008
17009         * ecore.cs (IMemberExpr): New public interface.
17010         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17011         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17012         if the expression is an IMemberExpr.
17013
17014         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17015         to be null, implicitly default to `this' if we're non-static in
17016         this case.  Simplified the code a lot by using the new IMemberExpr
17017         interface.  Also fixed bug #28176 here.
17018
17019 2002-08-06  Martin Baulig  <martin@gnome.org>
17020
17021         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17022         ParameterReferences during semantic analysis so that we can do a
17023         type-only search when resolving Cast, TypeOf and SizeOf.
17024         (block): Pass the `current_local_parameters' to the Block's
17025         constructor.
17026
17027         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17028         argument to the constructor.
17029         (ConstructorInitializer.Resolve): Create a temporary implicit
17030         block with the parameters.
17031
17032         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17033         references here if we aren't doing a type-only search.
17034
17035         * statement.cs (Block): Added constructor which takes a
17036         `Parameters parameters' argument.
17037         (Block.Parameters): New public property.
17038
17039         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17040         to `Parameters' and made it public readonly.
17041
17042 2002-08-06  Martin Baulig  <martin@gnome.org>
17043
17044         * ecore.cs (Expression.Warning): Made this public as well.
17045
17046         * report.cs (Report.Debug): Print the contents of collections.
17047
17048 2002-08-06  Martin Baulig  <martin@gnome.org>
17049
17050         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17051         used to tell Resolve() which kinds of expressions it may return.
17052         (Expression.Resolve): Added overloaded version of this method which
17053         takes a `ResolveFlags flags' argument.  This can be used to tell
17054         Resolve() which kinds of expressions it may return.  Reports a
17055         CS0118 on error.
17056         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17057         ResolveFlags.SimpleName.
17058         (Expression.Error118): Added overloaded version of this method which
17059         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17060         which kinds of expressions are allowed.
17061
17062         * expression.cs (Argument.ResolveMethodGroup): New public method.
17063         Resolves an argument, but allows a MethodGroup to be returned.
17064         This is used when invoking a delegate.
17065
17066         * TODO: Updated a bit.
17067
17068 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17069
17070         Fixed compilation with csc.
17071
17072         * ecore.cs: Expression.Error made public. Is this correct? Should
17073         Warning be made public too?
17074
17075         * expression.cs: use ea.Location instead of ea.loc.
17076         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17077
17078 2002-08-06  Martin Baulig  <martin@gnome.org>
17079
17080         * ecore.cs (Expression.loc): Moved the location here instead of
17081         duplicating it in all derived classes.
17082         (Expression.Location): New public property.
17083         (Expression.Error, Expression.Warning): Made them non-static and
17084         removed the location argument.
17085         (Expression.Warning): Added overloaded version which takes an
17086         `int level' argument.
17087         (Expression.Error118): Make this non-static and removed the
17088         expression and location arguments.
17089         (TypeExpr): Added location argument to the constructor.
17090
17091         * expression.cs (StaticCallExpr): Added location argument to
17092         the constructor.
17093         (Indirection, PointerArithmetic): Likewise.
17094         (CheckedExpr, UnCheckedExpr): Likewise.
17095         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17096         (StringPtr): Likewise.
17097
17098
17099 2002-08-05  Martin Baulig  <martin@gnome.org>
17100
17101         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17102
17103         * assign.cs (Assign.DoResolve): Check whether the source
17104         expression is a value or variable.
17105
17106         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17107         while resolving the corresponding blocks.
17108
17109         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17110         an error, don't silently return null.
17111
17112         * statement.cs (Block.AddVariable): Do the error reporting here
17113         and distinguish between CS0128 and CS0136.
17114         (Block.DoResolve): Report all unused labels (warning CS0164).
17115         (LabeledStatement): Pass the location to the constructor.
17116         (LabeledStatement.HasBeenReferenced): New property.
17117         (LabeledStatement.Resolve): Set it to true here.
17118
17119         * statement.cs (Return.Emit): Return success even after reporting
17120         a type mismatch error (CS0126 or CS0127), this is what csc does and
17121         it avoids confusing the users with any consecutive errors.
17122
17123 2002-08-05  Martin Baulig  <martin@gnome.org>
17124
17125         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17126
17127         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17128
17129         * expression.cs (MemberAccess.DoResolve): Silently return if an
17130         error has already been reported.
17131
17132         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17133         error has already been reported.
17134
17135 2002-08-05  Martin Baulig  <martin@gnome.org>
17136
17137         * statement.cs (UsageVector): Only initialize the `parameters'
17138         vector if we actually have any "out" parameters.
17139
17140 2002-08-05  Martin Baulig  <martin@gnome.org>
17141
17142         * expression.cs (Binary.ResolveOperator): When combining delegates,
17143         they must have the same type.
17144
17145 2002-08-05  Martin Baulig  <martin@gnome.org>
17146
17147         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17148         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17149         work with the ms runtime and we also don't need it: if we're a
17150         PropertyBuilder and not in the `indexer_arguments' hash, then we
17151         are a property and not an indexer.
17152
17153         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17154         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17155         since the latter one doesn't work with the ms runtime.
17156
17157 2002-08-03  Martin Baulig  <martin@gnome.org>
17158
17159         Fixed bugs #27998 and #22735.
17160
17161         * class.cs (Method.IsOperator): New public field.
17162         (Method.CheckBase): Report CS0111 if there's already a method
17163         with the same parameters in the current class.  Report CS0508 when
17164         attempting to change the return type of an inherited method.
17165         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17166         and it's not marked abstract or extern.
17167         (PropertyBase): New abstract base class for Property and Indexer.
17168         (PropertyBase.CheckBase): Moved here from Property and made it work
17169         for indexers.
17170         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17171         the same so we can reuse it there.
17172         (Property, Indexer): Derive from PropertyBase.
17173         (MethodSignature.inheritable_property_signature_filter): New delegate
17174         to find properties and indexers.
17175
17176         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17177         argument and improved error reporting.
17178
17179         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17180         EmptyReadOnlyParameters and made it a property.
17181
17182         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17183         version of this method which takes a `PropertyInfo indexer'.
17184         (TypeManager.RegisterIndexer): New method.
17185
17186         * class.cs: Added myself as author of this file :-)
17187
17188 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17189
17190         * class.cs: fixed compilation on windoze.
17191
17192 2002-08-03  Martin Baulig  <martin@gnome.org>
17193
17194         * interface.cs (Interface.GetInterfaceBases): Check whether all
17195         base interfaces are at least as accessible than the current one.
17196
17197         * class.cs (TypeContainer.GetClassBases): Check whether base types
17198         are at least as accessible than the current type.
17199         (TypeContainer.AsAccessible): Implemented and made non-static.
17200         (MemberBase.CheckParameters): Report errors if the accessibility
17201         checks fail.
17202
17203         * delegate.cs (Delegate.Delegate): The default visibility is
17204         internal for top-level types and private for nested types.
17205         (Delegate.Define): Report errors if the accessibility checks fail.
17206
17207         * enum.cs (Enum.Enum): The default visibility is internal for
17208         top-level types and private for nested types.
17209         (Enum.DefineType): Compute the correct visibility.
17210
17211         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17212         function which takes a `bool is_toplevel' instead of a TypeContainer.
17213
17214         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17215         builtin type.
17216
17217 2002-08-02  Martin Baulig  <martin@gnome.org>
17218
17219         * expression.cs (LocalVariableReferenc): Added constructor which
17220         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17221         (LocalVariableReference.IsReadOnly): New property.
17222         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17223         variable is readonly, use our own readonly flag to do this; you can
17224         use the new constructor to get a writable reference to a read-only
17225         variable.
17226
17227         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17228         reference to the local variable.
17229
17230 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17231
17232         * rootcontext.cs (ResolveCore): Also include System.Exception
17233
17234         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17235         we reach an EmptyStatement.
17236
17237         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17238         is also fine.
17239
17240         * expression.cs (Binary.ResolveOperator): Check error result in
17241         two places.
17242
17243         use brtrue/brfalse directly and avoid compares to null.
17244
17245 2002-08-02  Martin Baulig  <martin@gnome.org>
17246
17247         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17248         Fixes bug #28407, added test-155.cs.
17249
17250 2002-08-01  Martin Baulig  <martin@gnome.org>
17251
17252         * class.cs (Event.EmitDefaultMethod): Make this work with static
17253         events.  Fixes #28311, added verify-3.cs.
17254
17255 2002-08-01  Martin Baulig  <martin@gnome.org>
17256
17257         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17258         `is_disposable' fields.
17259         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17260         `hm.is_disposable' if we're using the collection pattern.
17261         (Foreach.EmitCollectionForeach): Use the correct type for the
17262         enumerator's local variable, only emit the try/finally block if
17263         necessary (fixes #27713).
17264
17265 2002-08-01  Martin Baulig  <martin@gnome.org>
17266
17267         * ecore.cs (Expression.report118): Renamed to Error118 and made
17268         it public static.
17269
17270         * statement.cs (Throw.Resolve): Check whether the expression is of
17271         the correct type (CS0118) and whether the type derives from
17272         System.Exception (CS0155).
17273         (Catch.Resolve): New method.  Do the type lookup here and check
17274         whether it derives from System.Exception (CS0155).
17275         (Catch.CatchType, Catch.IsGeneral): New public properties.
17276
17277         * typemanager.cs (TypeManager.exception_type): Added.
17278
17279 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17280
17281         * driver.cs: Updated About function.
17282
17283 2002-07-31  Martin Baulig  <martin@gnome.org>
17284
17285         Implemented Control Flow Analysis.
17286
17287         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17288         (EmitContext.CurrentBranching): Added.
17289         (EmitContext.StartFlowBranching): Added.
17290         (EmitContext.EndFlowBranching): Added.
17291         (EmitContext.KillFlowBranching): Added.
17292         (EmitContext.IsVariableAssigned): Added.
17293         (EmitContext.SetVariableAssigned): Added.
17294         (EmitContext.IsParameterAssigned): Added.
17295         (EmitContext.SetParameterAssigned): Added.
17296         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17297         Added control flow analysis stuff here.
17298
17299         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17300         resolve the expression as lvalue.
17301         (LocalVariableReference.DoResolve): Check whether the variable has
17302         already been assigned.
17303         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17304         the parameter as assigned here.
17305         (ParameterReference.DoResolve): Check whether the parameter has already
17306         been assigned.
17307         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17308         expression as lvalue.
17309
17310         * statement.cs (FlowBranching): New class for the flow analysis code.
17311         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17312         (LabeledStatement.IsDefined): New public property.
17313         (LabeledStatement.AddUsageVector): New public method to tell flow
17314         analyis that the label may be reached via a forward jump.
17315         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17316         flow analysis.
17317         (VariableInfo.Number): New public field.  This is used by flow analysis
17318         to number all locals of a block.
17319         (Block.CountVariables): New public property.  This is the number of
17320         local variables in this block (including the locals from all parent
17321         blocks).
17322         (Block.EmitMeta): Number all the variables.
17323
17324         * statement.cs: Added flow analysis support to all classes.
17325
17326 2002-07-31  Martin Baulig  <martin@gnome.org>
17327
17328         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17329         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17330         then use this argument.
17331
17332         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17333
17334         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17335         use this to specify /define options.
17336
17337 2002-07-29  Martin Baulig  <martin@gnome.org>
17338
17339         * statement.cs (Fixed): Moved all code that does variable lookups
17340         and resolvings from Emit to Resolve.
17341
17342         * statement.cs (For): Moved all code that does variable lookups
17343         and resolvings from Emit to Resolve.
17344
17345         * statement.cs (Using): Moved all code that does variable lookups
17346         and resolvings from Emit to Resolve.
17347
17348 2002-07-29  Martin Baulig  <martin@gnome.org>
17349
17350         * attribute.cs (Attribute.Resolve): Explicitly catch a
17351         System.NullReferenceException when creating the
17352         CustromAttributeBuilder and report a different warning message.
17353
17354 2002-07-29  Martin Baulig  <martin@gnome.org>
17355
17356         * support.cs (ParameterData.ParameterName): Added method to
17357         get the name of a parameter.
17358
17359         * typemanager.cs (TypeManager.IsValueType): New public method.
17360
17361 2002-07-29  Martin Baulig  <martin@gnome.org>
17362
17363         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17364         is a flag which specifies that it's either ref or out.
17365         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17366         the out parameter to `out Parameter.Modifier mod', also set the
17367         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17368
17369         * support.cs (InternalParameters.ParameterModifier): Distinguish
17370         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17371         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17372
17373         * expression.cs (Argument.GetParameterModifier): Distinguish
17374         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17375         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17376
17377 2002-07-29  Martin Baulig  <martin@gnome.org>
17378
17379         * expression.cs (ParameterReference.ParameterReference): Added
17380         `Location loc' argument to the constructor.
17381
17382         * cs-parser.jay: Pass location to ParameterReference.
17383
17384 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17385
17386         * statement.cs (Try): Initialize the location.
17387
17388         * cs-parser.jay: pass location to Try.
17389
17390         * expression.cs (Unary.Reduce): Change the prototype to return
17391         whether a constant fold could be performed or not.  The result is
17392         returned in an out parameters.  In the case of Indirection and
17393         AddressOf, we want to perform the full tests.
17394
17395 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17396
17397         * statement.cs (Statement.Emit): Flag dead code.
17398
17399 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17400
17401         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17402
17403 2002-07-27  Martin Baulig  <martin@gnome.org>
17404
17405         * class.cs (MethodData.Define): Put back call to
17406         TypeManager.AddMethod(), accidentally commented this out.
17407
17408         * report.cs (Debug): New public method to print debugging information,
17409         this is `[Conditional ("DEBUG")]'.
17410
17411 2002-07-26  Martin Baulig  <martin@gnome.org>
17412
17413         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17414         (switch_statement): Push the current_block to the switch_stack and
17415         pop it again when we're done with the switch.
17416         (switch_section): The new block is a child of the current_block.
17417         Fixes bug #24007, added test-152.cs.
17418
17419 2002-07-27  Martin Baulig  <martin@gnome.org>
17420
17421         * expression.cs (Invocation.EmitArguments): When calling a varargs
17422         function with only its fixed arguments, we need to pass an empty
17423         array.
17424
17425 2002-07-27  Martin Baulig  <martin@gnome.org>
17426
17427         Mono 0.13 has been released.
17428
17429 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17430
17431         * driver.cs: Rename --resource to --linkres, because that is what
17432         we do currently, we dont support --resource yet.
17433
17434         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17435
17436 2002-07-25  Martin Baulig  <martin@gnome.org>
17437
17438         * class.cs (MethodData): New public class.  This is a `method builder'
17439         class for a method or one accessor of a Property/Indexer/Event.
17440         (MethodData.GetMethodFlags): Moved here from MemberBase.
17441         (MethodData.ApplyAttributes): Likewise.
17442         (MethodData.ApplyObsoleteAttribute): Likewise.
17443         (MethodData.ApplyConditionalAttribute): Likewise.
17444         (MethodData.ApplyDllImportAttribute): Likewise.
17445         (MethodData.CheckAbstractAndExternal): Likewise.
17446         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17447         (MethodData.Emit): Formerly known as Method.Emit().
17448         (MemberBase): Moved everything which was specific to a single
17449         accessor/method to MethodData.
17450         (Method): Create a new MethodData and call Define() and Emit() on it.
17451         (Property, Indexer, Event): Create a new MethodData objects for each
17452         accessor and call Define() and Emit() on them.
17453
17454 2002-07-25  Martin Baulig  <martin@gnome.org>
17455
17456         Made MethodCore derive from MemberBase to reuse the code from there.
17457         MemberBase now also checks for attributes.
17458
17459         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17460         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17461         as virtual.
17462         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17463         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17464         (MemberBase.ApplyAttributes): New virtual method; applies the
17465         attributes to a method or accessor.
17466         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17467         (MemberBase.ApplyConditionalAttribute): Likewise.
17468         (MemberBase.ApplyDllImportAttribute): Likewise.
17469         (MemberBase.CheckAbstractAndExternal): Likewise.
17470         (MethodCore.ParameterTypes): This is now a property instead of a
17471         method, it's initialized from DoDefineParameters().
17472         (MethodCore.ParameterInfo): Removed the set accessor.
17473         (MethodCore.DoDefineParameters): New protected virtual method to
17474         initialize ParameterTypes and ParameterInfo.
17475         (Method.GetReturnType): We can now simply return the MemberType.
17476         (Method.GetMethodFlags): Override the MemberBase version and add
17477         the conditional flags.
17478         (Method.CheckBase): Moved some code from Define() here, call
17479         DoDefineParameters() here.
17480         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17481         here to avoid some larger code duplication.
17482         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17483         ensure that abstract and external accessors don't declare a body.
17484
17485         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17486         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17487         lookup in the attribute's parent classes, so we need to abort as soon
17488         as we found the first match.
17489         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17490         the attribute has no arguments.
17491
17492         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17493         of a Method.
17494
17495 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17496
17497         * cs-parser.jay: reverted previous patch.
17498
17499 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17500
17501         * cs-parser.jay: fixed bug #22119.
17502
17503 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17504
17505         * attribute.cs: fixed compilation. The error was:
17506         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17507         be assigned to before control leaves the current method."
17508         [FIXME:  Filed as bug #28186: MCS must report this error.]
17509
17510 2002-07-25  Martin Baulig  <martin@gnome.org>
17511
17512         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17513         method to pull the condition name ouf of a Conditional attribute.
17514         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17515         the obsolete message and error flag out of an Obsolete attribute.
17516
17517         * class.cs (Method.GetMethodFlags): New public method to get the
17518         TypeManager.MethodFlags for this method.
17519         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17520         private methods.
17521         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17522         if we're overriding a virtual function, set the new private variable
17523         `parent_method'; call the new TypeManager.AddMethod().
17524
17525         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17526         the MethodBuilder and the Method in a PtrHashtable.
17527         (TypeManager.builder_to_method): Added for this purpose.
17528         (TypeManager.MethodFlags): Added IsObsoleteError.
17529         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17530         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17531         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17532         the message from the attribute.
17533
17534 2002-07-24  Martin Baulig  <martin@gnome.org>
17535
17536         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17537         preprocessor directives, ensure that the argument to #define/#undef is
17538         exactly one identifier and that it's actually an identifier.
17539
17540         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17541         did not work ....
17542
17543 2002-07-24  Martin Baulig  <martin@gnome.org>
17544
17545         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17546         initialize it to TypeManager.object_type in the constructor.
17547         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17548         of the `hm.get_current' method if we're using the collection pattern.
17549         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17550         for the explicit conversion to make it work when we're using the collection
17551         pattern and the `Current' property has a different return type than `object'.
17552         Fixes #27713.
17553
17554 2002-07-24  Martin Baulig  <martin@gnome.org>
17555
17556         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17557         does not match, but don't report any errors.  This method is called in
17558         order for all methods in a MethodGroupExpr until a matching method is
17559         found, so we don't want to bail out if the first method doesn't match.
17560         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17561         matches, report the 123.  Fixes #28070.
17562
17563 2002-07-24  Martin Baulig  <martin@gnome.org>
17564
17565         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17566         TypeManager.TypeToCoreType() to the top of the method so the
17567         following equality checks will work.  Fixes #28107.
17568
17569 2002-07-24  Martin Baulig  <martin@gnome.org>
17570
17571         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17572         operand is of type uint, and the other operand is of type sbyte,
17573         short or int, the operands are converted to type long." -
17574         Actually do what this comment already told us.  Fixes bug #28106,
17575         added test-150.cs.
17576
17577 2002-07-24  Martin Baulig  <martin@gnome.org>
17578
17579         * class.cs (MethodBase): New abstract class.  This is now a base
17580         class for Property, Indexer and Event to avoid some code duplication
17581         in their Define() and DefineMethods() methods.
17582         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17583         generic methods for Define() and DefineMethods().
17584         (FieldBase): Derive from MemberBase, not MemberCore.
17585         (Property): Derive from MemberBase, not MemberCore.
17586         (Property.DefineMethod): Moved all the code from this method to the
17587         new MethodBase.DefineAccessor(), just call it with appropriate
17588         argumetnts.
17589         (Property.Define): Call the new Property.DoDefine(), this does some
17590         sanity checks and we don't need to duplicate the code everywhere.
17591         (Event): Derive from MemberBase, not MemberCore.
17592         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17593         accessors, this will also make them work with interface events.
17594         (Indexer): Derive from MemberBase, not MemberCore.
17595         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17596         (Indexer.Define): Use the new MethodBase functions.
17597
17598         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17599         argument to the constructor.
17600         (Interface.FindMembers): Added support for interface events.
17601         (Interface.PopluateEvent): Implemented.
17602
17603         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17604
17605 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17606
17607         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17608         but this is required to check for a method name being the same as
17609         the containing class.  
17610
17611         Handle this now.
17612
17613 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17614
17615         * interface.cs: initialize variable.
17616
17617 2002-07-23  Martin Baulig  <martin@gnome.org>
17618
17619         Implemented the IndexerName attribute in interfaces.
17620
17621         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17622         name if this is an explicit interface implementation.
17623         (Indexer.InterfaceIndexerName): New public variable.  If we're
17624         implementing an interface indexer, this is the IndexerName in that
17625         interface.  Otherwise, it's the IndexerName.
17626         (Indexer.DefineMethod): If we're implementing interface indexer,
17627         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17628         and Pending.ImplementIndexer methods.
17629         (Indexer.Define): Also define the PropertyBuilder if we're
17630         implementing an interface indexer and this is neither an explicit
17631         interface implementation nor do the IndexerName match the one in
17632         the interface.
17633
17634         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17635         If a method is defined here, then we always need to create a proxy
17636         for it.  This is used when implementing interface indexers.
17637         (Pending.IsInterfaceIndexer): New public method.
17638         (Pending.ImplementIndexer): New public method.
17639         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17640         This is used when implementing interface indexers to define a proxy
17641         if necessary.
17642         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17643         define a proxy if necessary.
17644
17645         * interface.cs (Interface.IndexerName): New public variable.
17646         (Interface.PopulateIndexer): Set the IndexerName.
17647         (Interface.DefineIndexers): New private method.  Populate all the
17648         indexers and make sure their IndexerNames match.
17649
17650         * typemanager.cs (IndexerPropertyName): Added support for interface
17651         indexers.
17652
17653 2002-07-22  Martin Baulig  <martin@gnome.org>
17654
17655         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17656         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17657         ret if HasReturnLabel.
17658         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17659         variables.
17660
17661         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17662         and set the ec.LoopBeginTryCatchLevel.
17663         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17664         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17665         the current ec.TryCatchLevel, the branch goes out of an exception
17666         block.  In this case, we need to use Leave and not Br.
17667
17668 2002-07-22  Martin Baulig  <martin@gnome.org>
17669
17670         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17671         block unless the block does not always return or it is contained in
17672         another try { ... } catch { ... } block.  Fixes bug #26506.
17673         Added verify-1.cs to the test suite.
17674
17675 2002-07-22  Martin Baulig  <martin@gnome.org>
17676
17677         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17678         then we do not always return.  Fixes bug #24985.
17679
17680 2002-07-22  Martin Baulig  <martin@gnome.org>
17681
17682         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17683         lookup on a per-class level; ie. walk up the class hierarchy until we
17684         found at least one applicable method, then choose the best among them.
17685         Fixes bug #24463 and test-29.cs.
17686
17687 2002-07-22  Martin Baulig  <martin@gnome.org>
17688
17689         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17690         return types of the methods.  The return type is not part of the
17691         signature and we must not check it to make the `new' modifier work.
17692         Fixes bug #27999, also added test-147.cs.
17693         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17694
17695         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17696         on the method's return type.
17697
17698 2002-07-21  Martin Baulig  <martin@gnome.org>
17699
17700         * assign.cs: Make this work if the rightmost source is a constant and
17701         we need to do an implicit type conversion.  Also adding a few more tests
17702         to test-38.cs which should have caught this.
17703
17704         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17705         target in the makefile for this.  The makefile.gnu is primarily intended
17706         for end-users who don't want to debug the compiler.
17707
17708 2002-07-21  Martin Baulig  <martin@gnome.org>
17709
17710         * assign.cs: Improved the Assign class so it can now handle embedded
17711         assignments (X = Y = Z = something).  As a side-effect this'll now also
17712         consume less local variables.  test-38.cs now passes with MCS, added
17713         a few new test cases to that test.
17714
17715 2002-07-20  Martin Baulig  <martin@gnome.org>
17716
17717         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17718         instructions.  Fixes bug #27977, also added test-146.cs.
17719
17720 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17721
17722         * cs-tokenizer.cs: fixed getHex ().
17723
17724 2002-07-19  Martin Baulig  <martin@gnome.org>
17725
17726         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17727         not Type.GetType() to lookup the array type.  This is needed when
17728         we're constructing an array of a user-defined type.
17729         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17730         single-dimensional arrays, but also for single-dimensial arrays of
17731         type decimal.
17732
17733 2002-07-19  Martin Baulig  <martin@gnome.org>
17734
17735         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17736         this function is called, it's not allowed to share LocalBuilders
17737         among ILGenerators.
17738
17739 2002-07-19  Martin Baulig  <martin@gnome.org>
17740
17741         * expression.cs (Argument.Resolve): Report an error 118 when trying
17742         to pass a type as argument.
17743
17744 2002-07-18  Martin Baulig  <martin@gnome.org>
17745
17746         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17747         Conv_R_Un for the signed `long' type.
17748
17749 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17750
17751         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17752         `expr' for the temporary result, as that will fail if we do
17753         multiple resolves on the same expression.
17754
17755 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17756
17757         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17758         ec.TypeContainer for looking up aliases. 
17759
17760         * class.cs (TypeContainer): Remove LookupAlias from here.
17761
17762         * decl.cs (DeclSpace); Move here.
17763
17764 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17765
17766         * class.cs (FindMembers): Only call filter if the constructor
17767         bulider is not null.
17768
17769         Also handle delegates in `NestedTypes' now.  Now we will perform
17770         type lookups using the standard resolution process.  This also
17771         fixes a bug.
17772
17773         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17774         This uses Expressions (the limited kind that can be parsed by the
17775         tree) instead of strings.
17776
17777         * expression.cs (ComposedCast.ToString): Implement, used to flag
17778         errors since now we have to render expressions.
17779
17780         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17781         FormArrayType. 
17782
17783         * ecore.cs (SimpleName.ToString): ditto.
17784
17785         * cs-parser.jay: Instead of using strings to assemble types, use
17786         Expressions to assemble the type (using SimpleName, ComposedCast,
17787         MemberAccess).  This should fix the type lookups in declarations,
17788         because we were using a different code path for this.
17789
17790         * statement.cs (Block.Resolve): Continue processing statements
17791         even when there is an error.
17792
17793 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17794
17795         * class.cs (Event.Define): Also remove the `remove' method from
17796         the list of pending items.
17797
17798         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17799         generate more compact code. 
17800
17801 2002-07-17  Martin Baulig  <martin@gnome.org>
17802
17803         * const.cs (Const.LookupConstantValue): Add support for constant
17804         `unchecked' and `checked' expressions.
17805         Also adding test case test-140.cs for this.
17806
17807 2002-07-17  Martin Baulig  <martin@gnome.org>
17808
17809         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17810         check whether mi.ReturnType implements the IEnumerator interface; the
17811         `==' and the IsAssignableFrom() will fail in this situation.
17812
17813 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17814
17815         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17816         here too.
17817
17818 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17819
17820         * expression.cs: fixed bug #27811.
17821
17822 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17823
17824         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17825         Molaro: when we are a ref, the value already contains a pointer
17826         value, do not take the address of it.
17827
17828 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17829         * removed mb-parser.jay and mb-tokenizer.cs
17830
17831 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17832
17833         * expression.cs: check against the building corlib void type.
17834
17835 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17836
17837         * ecore.cs: fix for valuetype static readonly fields: when 
17838         initializing them, we need their address, not the address of a copy.
17839
17840 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17841
17842         * typemanager.cs: register also enum_type in corlib.
17843
17844 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17845
17846         * class.cs: allow calling this (but not base) initializers in structs.
17847
17848 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17849
17850         * ecore.cs: make sure we compare against the building base types
17851         in GetTypeSize ().
17852
17853 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17854
17855         * typemanager.cs: fix TypeToCoreType() to handle void and object
17856         (corlib gets no more typerefs after this change).
17857
17858 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17859
17860         * expression.cs (ArrayCreation.EmitArrayArguments): use
17861         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17862
17863         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17864         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17865         array indexes, the runtime actually forbids them.
17866
17867         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17868         for array arguments here.
17869
17870         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17871         instead of the default for ValueTypes.
17872
17873         (New.DoEmit): Use IsValueType instead of
17874         IsSubclassOf (value_type)
17875         (New.DoResolve): ditto.
17876         (Invocation.EmitCall): ditto.
17877
17878         * assign.cs (Assign): ditto.
17879
17880         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17881         Statements *are* currently doing part of their resolution during
17882         Emit.  
17883
17884         Expressions do always resolve during resolve, but statements are
17885         only required to propagate resolution to their children.
17886
17887 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17888
17889         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17890
17891         (LoadAssembly): Do not add the dll if it is already specified
17892
17893         (MainDriver): Add the System directory to the link path at the end,
17894         after all the other -L arguments. 
17895
17896         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17897         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17898         ldelem.u1) and using the opposite for sbytes.
17899
17900         This fixes Digger, and we can finally run it.
17901
17902         * driver.cs (UnixParseOption): Move the option parsing here.  
17903         (CSCParseOption): Implement CSC-like parsing of options.
17904
17905         We now support both modes of operation, the old Unix way, and the
17906         new CSC-like way.  This should help those who wanted to make cross
17907         platform makefiles.
17908
17909         The only thing broken is that /r:, /reference: and /lib: are not
17910         implemented, because I want to make those have the same semantics
17911         as the CSC compiler has, and kill once and for all the confussion
17912         around this.   Will be doing this tomorrow.
17913
17914         * statement.cs (Unsafe.Resolve): The state is checked during
17915         resolve, not emit, so we have to set the flags for IsUnsfe here.
17916
17917 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17918
17919         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17920         not catch the Error_ObjectRefRequired in SimpleName (as it is
17921         possible to have a class/instance variable name that later gets
17922         deambiguated), we have to check this here.      
17923
17924 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17925
17926         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17927         make static and put into Expression.
17928
17929         (Event.Define): Register the private field of the event with the 
17930         TypeManager so that GetFieldFromEvent can get at it.
17931
17932         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17933         keep track of the private field associated with an event which
17934         has no accessors.
17935
17936         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17937         private field.
17938
17939         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17940
17941 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17942
17943         * expression.cs (Binary.EmitBranchable): this routine emits the
17944         Binary expression in a branchable context.  This basically means:
17945         we need to branch somewhere, not just get the value on the stack.
17946
17947         This works together with Statement.EmitBoolExpression.
17948
17949         * statement.cs (Statement.EmitBoolExpression): Use
17950         EmitBranchable. 
17951
17952 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17953
17954         * statement.cs (For): Reduce the number of jumps in loops.
17955
17956         (For): Implement loop inversion for the For statement.
17957
17958         (Break): We can be breaking out of a Try/Catch controlled section
17959         (foreach might have an implicit try/catch clause), so we need to
17960         use Leave instead of Br.
17961
17962         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17963         now).  If the instace expression supports IMemoryLocation, we use
17964         the AddressOf method from the IMemoryLocation to extract the
17965         address instead of emitting the instance.
17966
17967         This showed up with `This', as we were emitting the instance
17968         always (Emit) instead of the Address of This.  Particularly
17969         interesting when This is a value type, as we dont want the Emit
17970         effect (which was to load the object).
17971
17972 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17973
17974         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17975
17976         * statement.cs (Checked): Set the CheckedState during the resolve
17977         process too, as the ConvCast operations track the checked state on
17978         the resolve process, and not emit.
17979
17980         * cs-parser.jay (namespace_member_declaration): Flag that we have
17981         found a declaration when we do.  This is used to flag error 1529
17982
17983         * driver.cs: Report ok when we display the help only.
17984
17985 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17986
17987         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17988
17989 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17990
17991         * cs-tokenizer.cs (define): We also have to track locally the
17992         defines.  AllDefines is just used for the Conditional Attribute,
17993         but we also need the local defines for the current source code. 
17994
17995 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17996
17997         * statement.cs (While, For, Do): These loops can exit through a
17998         Break statement, use this information to tell whether the
17999         statement is the last piece of code.
18000
18001         (Break): Flag that we break.
18002
18003         * codegen.cs (EmitContexts): New `Breaks' state variable.
18004
18005 2002-07-03  Martin Baulig  <martin@gnome.org>
18006
18007         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18008         modifiers in method declarations in structs.  Otherwise, you won't
18009         be able to override things like Object.Equals().
18010
18011 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18012
18013         * class.cs (Method, Property, Indexer): Do not allow the public
18014         modifier to be used in explicit interface implementations.
18015
18016         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18017         override modifiers in method declarations in structs
18018
18019 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18020
18021         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18022         integer or real overflow, report an error
18023
18024 2002-07-02  Martin Baulig  <martin@gnome.org>
18025
18026         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18027         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18028         to tell the runtime about our newly created System.Object and
18029         System.ValueType types.
18030
18031 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18032
18033         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18034         struct instead of Ldarg/Starg.
18035
18036 2002-07-02  Martin Baulig  <martin@gnome.org>
18037
18038         * expression.cs (Indirection.Indirection): Call
18039         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18040
18041 2002-07-02  Martin Baulig  <martin@gnome.org>
18042
18043         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18044         ValueType, call TypeManager.TypeToCoreType() on it.
18045         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18046         the OpCodes.Newarr argument.
18047
18048 2002-07-02  Martin Baulig  <martin@gnome.org>
18049
18050         * expression.cs (Invocation.EmitCall): When compiling corlib,
18051         replace all calls to the system's System.Array type to calls to
18052         the newly created one.
18053
18054         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18055         System.Array methods.
18056         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18057         from the system's System.Array type which must be replaced.
18058
18059 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18060
18061         * typemanager.cs: load unverifiable_code_ctor so we can build
18062         corlib using the correct type. Avoid using GetTypeCode() with
18063         TypeBuilders.
18064         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18065         TypeManager.object_type to allow building corlib.
18066
18067 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18068
18069         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18070
18071 2002-07-01  Martin Baulig  <martin@gnome.org>
18072
18073         * class.cs: Make the last change actually work, we need to check
18074         whether `ifaces != null' to avoid a crash.
18075
18076 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18077
18078         * class.cs: when we build structs without fields that implement
18079         interfaces, we need to add the interfaces separately, since there is
18080         no API to both set the size and add the interfaces at type creation
18081         time.
18082
18083 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18084
18085         * expression.cs: the dimension arguments to the array constructors
18086         need to be converted if they are a long.
18087
18088 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18089
18090         * class.cs: don't emit ldarg.0 if there is no parent constructor
18091         (fixes showstopper for corlib).
18092
18093 2002-06-29  Martin Baulig  <martin@gnome.org>
18094
18095         MCS now compiles corlib on GNU/Linux :-)
18096
18097         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18098         ie. check for MethodImplOptions.InternalCall.
18099
18100         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18101         and TypeManager.attribute_type are null, so we must explicitly check
18102         whether parent is not null to find out whether it's an attribute type.
18103         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18104         and SetBuilder, not only if the property is neither abstract nor external.
18105         This is necessary to set the MethodImplOptions on the accessor methods.
18106         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18107         SetBuilder, see Property.Emit().
18108
18109         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18110         populate "System.Object", "System.ValueType" and "System.Attribute" since
18111         they've already been populated from BootCorlib_PopulateCoreTypes().
18112
18113 2002-06-29  Martin Baulig  <martin@gnome.org>
18114
18115         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18116         is the NullLiteral, we also need to make sure that target_type is not
18117         an enum type.   
18118
18119 2002-06-29  Martin Baulig  <martin@gnome.org>
18120
18121         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18122         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18123         before calling BootstrapCorlib_ResolveDelegate ().
18124
18125 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18126
18127         * statement.cs: fixed build-breaker. All tests passed ok.
18128
18129 2002-06-27  Martin Baulig  <martin@gnome.org>
18130
18131         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18132         for System.Decimal when compiling corlib.
18133
18134 2002-06-27  Martin Baulig  <martin@gnome.org>
18135
18136         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18137         switch blocks which contain nothing but a default clause.
18138
18139 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18140
18141        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18142
18143 2002-06-27  Martin Baulig  <martin@gnome.org>
18144
18145         * ecore.cs (PropertyExpr.PropertyExpr): Call
18146         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18147
18148         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18149         is already a TypeBuilder.
18150
18151 2002-06-27  Martin Baulig  <martin@gnome.org>
18152
18153         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18154         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18155         the "from an array-type to System.Array" case.  This makes it work
18156         when compiling corlib.
18157
18158 2002-06-27  Martin Baulig  <martin@gnome.org>
18159
18160         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18161         non-static PropertyExpr, set its InstanceExpression.  This makes
18162         the `ICollection.Count' property work in System/Array.cs.
18163
18164 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18165
18166         * driver.cs: Made error handling more consistent.  Errors now
18167         tracked by Report class, so many methods which used to return int
18168         now return void.  Main() now prints success/failure and 
18169         errors/warnings message.
18170
18171         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18172         the magic number return values (123 and 124).  Now, if the
18173         expected error occurs, the compiler exits with success (exit value
18174         0).  If the compilation completes without seeing that particular
18175         error, the compiler exits with failure (exit value 1).  The
18176         makefile in mcs/errors has been changed to handle the new behaviour.
18177
18178         * report.cs: Made 'expected error' number a property and renamed
18179         it from 'Probe' to 'ExpectedError'.
18180
18181         * genericparser.cs: Removed error handling support, since it is
18182         now all done by Report class.
18183
18184         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18185         class, so parse() no longer returns an int.
18186
18187         * namespace.cs: Use Report.Error instead of GenericParser.error
18188
18189 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18190
18191         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18192         TypeContainer.AddOperator): At the front of the list put the
18193         explicit implementations, so they get resolved/defined first. 
18194
18195 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18196
18197         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18198         interface type is implemented by this TypeContainer.  Used during
18199         explicit interface implementation.
18200
18201         (Property.Define, Indexer.Define, Method.Define): Validate that
18202         the given interface in the explicit implementation is one of the
18203         base classes for the containing type.
18204
18205         Also if we are explicitly implementing an interface, but there is
18206         no match in the pending implementation table, report an error.
18207
18208         (Property.Define): Only define the property if we are
18209         not explicitly implementing a property from an interface.  Use the
18210         correct name also for those properties (the same CSC uses,
18211         although that is really not needed).
18212
18213         (Property.Emit): Do not emit attributes for explicitly implemented
18214         properties, as there is no TypeBuilder.
18215
18216         (Indexer.Emit): ditto.
18217
18218         Hiding then means that we do not really *implement* a pending
18219         implementation, which makes code fail.
18220
18221 2002-06-22  Martin Baulig  <martin@gnome.org>
18222
18223         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18224         the return value of Object.GetType().  [FIXME: we need to do this whenever
18225         we get a type back from the reflection library].
18226
18227 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18228
18229         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18230
18231 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18232
18233         * attribute.cs: Return null if we can not look up the type.
18234
18235         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18236         the interface types found.
18237
18238         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18239         interface types found.
18240
18241         * typemanager.cs (GetInterfaces): Make this routine returns alll
18242         the interfaces and work around the lame differences between
18243         System.Type and System.Reflection.Emit.TypeBuilder in the results
18244         result for GetInterfaces.
18245
18246         (ExpandInterfaces): Given an array of interface types, expand and
18247         eliminate repeated ocurrences of an interface.  This expands in
18248         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18249         be IA, IB, IC.
18250
18251 2002-06-21  Martin Baulig  <martin@gnome.org>
18252
18253         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18254         on System.Enum.
18255
18256 2002-06-21  Martin Baulig  <martin@gnome.org>
18257
18258         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18259         and called with one of the core types, return the corresponding typebuilder for
18260         that type.
18261
18262         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18263         element type.
18264
18265 2002-06-21  Martin Baulig  <martin@gnome.org>
18266
18267         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18268         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18269         (Expression.ConvertReferenceExplicit): Likewise.
18270
18271         * expression.cs (ElementAccess.DoResolve): Likewise.
18272         (ElementAccess.DoResolveLValue): Likewise.
18273
18274 2002-06-10  Martin Baulig  <martin@gnome.org>
18275
18276         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18277         add the "value" parameter to the parameter list.
18278
18279         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18280         to our caller.
18281
18282 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18283
18284         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18285         the argument to an int, uint, long or ulong, per the spec.  Also
18286         catch negative constants in array creation.
18287
18288 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18289
18290         * class.cs: do not allow the same interface to appear twice in
18291         the definition list.
18292
18293 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18294
18295         * ecore.cs: don't use ldlen with System.Array.
18296
18297 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18298
18299         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18300
18301 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18302
18303         * modifiers.cs: produce correct field attributes for protected
18304         internal. Easy fix so miguel can work on ther harder stuff:-)
18305
18306 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18307
18308         * pending.cs: New file.  Move the code from class.cs here.
18309         Support clearning the pending flag for all methods (when not doing
18310         explicit interface implementation).
18311
18312 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18313
18314         * rootcontext.cs: added a couple more types needed to bootstrap.
18315
18316 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18317
18318         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18319         constructor in the type, instead of any constructor in the type
18320         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18321         a bug in the Mono runtime when applying the params attribute). 
18322
18323 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18324         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18325
18326 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18327
18328         * expression.cs (Unary.ResolveOperator): Use TypeManager
18329         to resolve the type.
18330
18331 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18332
18333         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18334         attached.
18335
18336         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18337         with each member too.
18338
18339         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18340         field builders too - this takes care of the enum member case.
18341
18342 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18343
18344         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18345         address-of operator on both value types and pointers.
18346
18347 2002-06-10  Martin Baulig  <martin@gnome.org>
18348
18349         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18350         PropertyBuilder to the `property_builders' list.
18351
18352         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18353         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18354         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18355         find any indexers which are inherited from an interface.
18356
18357 2002-06-09  Martin Baulig  <martin@gnome.org>
18358
18359         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18360         the same type as the constant if necessary.  There's also a test-130.cs
18361         for this.
18362
18363         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18364
18365         * typemanager.cs (TypeManager.ChangeType): Previously known as
18366         Enum.ChangeEnumType().
18367
18368 2002-06-09  Martin Baulig  <martin@gnome.org>
18369
18370         * expression.cs (Cast.TryReduce): Added support for consts.
18371
18372 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18373
18374         * class.cs (Accessor): Hold attributes information so we can pass
18375         it along.
18376
18377         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18378         Modify to pass in attributes attached to the methods.
18379
18380         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18381
18382         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18383         to handle the Accessor kind :-)
18384
18385         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18386
18387 2002-06-08  Martin Baulig  <martin@gnome.org>
18388
18389         * expression.cs (Unary.TryReduceNegative): Added support for
18390         ULongConstants.
18391
18392 2002-06-08  Martin Baulig  <martin@gnome.org>
18393
18394         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18395         name can't be found in the `defined_names' - the caller will do a
18396         MemberLookup in this case and thus find methods in System.Enum
18397         such as Enum.IsDefined().
18398
18399 2002-06-08  Martin Baulig  <martin@gnome.org>
18400
18401         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18402         Convert.ChangeType() which works with TypeBuilder created types.
18403         (Enum.LookupEnumValue, Enum.Define): Use it here.
18404
18405         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18406         `TypeBuilder.BaseType != null' check.
18407         (TypeContainer.FindMembers): Only lookup parent members if we
18408         actually have a parent.
18409         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18410         (ConstructorInitializer.Resolve): Likewise.
18411
18412         * interface.cs (Interface.FindMembers): Added
18413         `TypeBuilder.BaseType != null' check.
18414
18415         * rootcontext.cs (RootContext.ResolveCore): Added
18416         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18417         classes_second_stage.
18418
18419         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18420         debug_type and trace_type when compiling with --nostdlib.       
18421
18422 2002-06-07  Martin Baulig  <martin@gnome.org>
18423
18424         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18425         (AddField): Set it to true when adding a non-static field.
18426         (DefineType): Use `have_nonstatic_fields' to find out whether we
18427         have non-static fields, not `Fields != null'.
18428
18429 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18430
18431         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18432         dereferencing a null on the static-field code path)
18433
18434 2002-05-30  Martin Baulig  <martin@gnome.org>
18435
18436         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18437         to take command line arguments.  Use reflection to call the new
18438         custom `Initialize' function on the symbol writer and pass it the
18439         command line arguments.
18440
18441         * driver.cs (--debug-args): New command line argument to pass command
18442         line arguments to the symbol writer.
18443
18444 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18445
18446         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18447         the target type for indexers and properties.  Thanks to Joe for
18448         catching this.
18449
18450 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18451
18452         * typemanager.cs (MethodFlags): returns the method flags
18453         (Obsolete/ShouldIgnore) that control warning emission and whether
18454         the invocation should be made, or ignored. 
18455
18456         * expression.cs (Invocation.Emit): Remove previous hack, we should
18457         not do this on matching a base type, we should do this based on an attribute
18458
18459         Only emit calls to System.Diagnostics.Debug and
18460         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18461         on the command line.
18462
18463         * rootcontext.cs: Global settings for tracing and debugging.
18464
18465         * cs-tokenizer.cs (define): New utility function to track
18466         defines.   Set the global settings for TRACE and DEBUG if found.
18467
18468 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18469
18470         * interface.cs (Populate*): Pass in the TypeContainer as well as
18471         the DeclSpace as parameters so that we can create EmitContexts and
18472         then use that to apply attributes etc.
18473
18474         (PopulateMethod, PopulateEvent, PopulateProperty)
18475         (PopulateIndexer): Apply attributes everywhere.
18476
18477         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18478         etc.
18479
18480         (ApplyAttributes): Update accordingly.
18481
18482         We now apply interface attributes for all members too.
18483
18484 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18485
18486         * class.cs (Indexer.Define); Correctly check if we are explicit
18487         implementation (instead of checking the Name for a ".", we
18488         directly look up if the InterfaceType was specified).
18489
18490         Delay the creation of the PropertyBuilder.
18491
18492         Only create the PropertyBuilder if we are not an explicit
18493         interface implementation.   This means that explicit interface
18494         implementation members do not participate in regular function
18495         lookups, and hence fixes another major ambiguity problem in
18496         overload resolution (that was the visible effect).
18497
18498         (DefineMethod): Return whether we are doing an interface
18499         implementation. 
18500
18501         * typemanager.cs: Temporary hack until we get attributes in
18502         interfaces (Ravi is working on that) and we get IndexerName
18503         support in interfaces.
18504
18505         * interface.cs: Register the indexers as properties.
18506
18507         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18508         warning, I have verified that this is a bug in the .NET runtime
18509         (JavaScript suffers of the same problem).
18510
18511         * typemanager.cs (MemberLookup): When looking up members for
18512         interfaces, the parent of an interface is the implicit
18513         System.Object (so we succeed in searches of Object methods in an
18514         interface method invocation.  Example:  IEnumerable x;  x.ToString
18515         ()) 
18516
18517 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18518
18519         * class.cs (Event): Events should also register if they do
18520         implement the methods that an interface requires.
18521
18522         * typemanager.cs (MemberLookup); use the new GetInterfaces
18523         method. 
18524
18525         (GetInterfaces): The code used to lookup interfaces for a type is
18526         used in more than one place, factor it here. 
18527
18528         * driver.cs: Track the errors at the bottom of the file, we kept
18529         on going.
18530
18531         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18532         instance if the method we are calling is static!
18533
18534 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18535
18536         * attribute.cs (ApplyAttributes): Make this function filter out
18537         the IndexerName attribute (as that attribute in reality is never
18538         applied) and return the string constant for the IndexerName
18539         attribute. 
18540
18541         * class.cs (TypeContainer.Emit): Validate that all the indexers
18542         have the same IndexerName attribute, and if so, set the
18543         DefaultName attribute on the class. 
18544
18545         * typemanager.cs: The return value might contain other stuff (not
18546         only methods).  For instance, consider a method with an "Item"
18547         property and an Item method.
18548
18549         * class.cs: If there is a problem with the parameter types,
18550         return. 
18551
18552 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18553
18554         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18555         looks at user defined conversion after making a call to 
18556         StandardConversionExists - we need this for overload resolution.
18557
18558         * expression.cs : Update accordingly the various method calls.
18559
18560         This fixes 2 bugs filed against implicit user defined conversions 
18561
18562 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18563
18564         * statement.cs: Track the result of the assignment.
18565
18566 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18567
18568         * expression.cs (MemberAccess): Improved error reporting for
18569         inaccessible members.
18570
18571 2002-05-22  Martin Baulig  <martin@gnome.org>
18572
18573         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18574         itself with debugging support.
18575
18576 2002-05-22  Martin Baulig  <martin@gnome.org>
18577
18578         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18579         Removed, this isn't needed anymore.
18580
18581 2002-05-20  Martin Baulig  <martin@gnome.org>
18582
18583         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18584         be underlying type for an enum.
18585
18586 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18587
18588         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18589         that splits out the loading of just the core types.
18590
18591         * rootcontext.cs (ResolveCore): Split the struct resolution in
18592         two, so we can load the enumeration underlying types before any
18593         enums are used.
18594
18595         * expression.cs (Is): Bandaid until we fix properly Switch (see
18596         bug #24985 for details).
18597
18598         * typemanager.cs (ImplementsInterface): The hashtable will contain
18599         a null if there are no interfaces implemented.
18600
18601 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18602
18603         * cs-parser.jay (indexer_declarator): It is fine to have array
18604         parameters
18605
18606 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18607
18608         * typemanager.cs: (RegisterBuilder): New function used to register
18609         TypeBuilders that implement interfaces.  Since
18610         TypeBuilder.GetInterfaces (as usual) does not work with lame
18611         Reflection.Emit. 
18612         (AddUserType): register interfaces.
18613
18614         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18615         dealing with TypeBuilder.  Also, arrays are showing up as
18616         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18617         methods can not be invoked on them!
18618
18619         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18620         (ImplicitReferenceConversionExists): Split out from
18621         StandardConversionExists. 
18622
18623         * expression.cs (As): We were only implementing one of the three
18624         cases for the as operator.  We now implement them all.
18625         (Is): Implement the various other cases for Is as well.
18626
18627         * typemanager.cs (CACHE): New define used to control if we want or
18628         not the FindMembers cache.  Seems to have a negative impact on
18629         performance currently
18630
18631         (MemberLookup): Nested types have full acess to
18632         enclosing type members
18633
18634         Remove code that coped with instance/static returns for events, we
18635         now catch this in RealFindMembers.
18636
18637         (RealFindMembers): only perform static lookup if the instance
18638         lookup did not return a type or an event.  
18639
18640 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18641
18642         * assign.cs (CompoundAssign): We pass more semantic information
18643         now to Compound Assignments than we did before: now we have all
18644         the information at hand, and now we resolve the target *before* we
18645         do the expression expansion, which allows the "CacheValue" method
18646         to have the effect we intended (before, a [x] += 1 would generate
18647         two differen ArrayAccess expressions from the ElementAccess,
18648         during the resolution process).
18649
18650         (CompoundAssign.DoResolve): Resolve target and original_source here.
18651
18652 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18653
18654         * expression.cs (ArrayAccess): dropped debugging information. 
18655
18656         * typemanager.cs: Small bug fix: I was always returning i_members,
18657         instead of one of i_members or s_members (depending on which had
18658         the content).
18659
18660         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18661         method is invoked before any code generation takes place, and it
18662         is a mechanism to inform that the expression will be invoked more
18663         than once, and that the method should use temporary values to
18664         avoid having side effects
18665
18666         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18667
18668         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18669         implementation.
18670
18671         * expression.cs (Indirection, ArrayAccess): Add support for
18672         CacheTemporaries in these two bad boys. 
18673
18674         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18675         ldobj or ldind_ref.  
18676         (StoreFromPtr): Handle stobj as well.
18677
18678         * expression.cs (UnaryMutator): Share more code.
18679
18680         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18681         down: I was not tracking the Filter function as well, which
18682         was affecting the results of the cache.
18683
18684 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18685
18686         * attribute.cs: Remove the hack to handle the CharSet property on
18687         StructLayouts. 
18688
18689 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18690
18691         * attribute.cs (DoResolve): More uglyness, we now only try to
18692         resolve the attribute partially, to extract the CharSet
18693         information (only if we are a StructLayout attribute).  Otherwise 
18694
18695         (GetExtraTypeInfo): Add some code to conditionally kill in the
18696         future this.   I am more and more convinced that the .NET
18697         framework has special code to handle the attribute setting on
18698         certain elements.
18699
18700         * expression.cs (IsParamsMethodApplicable): Revert my previous
18701         foreach change here, it was wrong.
18702
18703 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18704
18705         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18706         (pp_expr): do not abort on unknown input, just return.
18707         (eval): abort if there are pending chars.
18708
18709         * attribute.cs (Attribute.Resolve): Positional parameters are
18710         optional.  Deal with that case.
18711
18712         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18713         the Ansi/Unicode/Auto information for the type.
18714
18715         (TypeContainer.DefineType): instantiate the EmitContext here, as
18716         we will be using it during the type definition (to resolve
18717         attributes) and during the emit phase.
18718
18719         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18720         to pull type information out of the attributes
18721
18722         (Attribute.Resolve): track the constructor builder, and allow for
18723         multiple invocations (structs and classes will use this).
18724
18725         * ecore.cs (MemberLookupFinal): new version with all the
18726         parameters customizable.
18727
18728         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18729         constructors.  Return if the result value is null (as the error
18730         would have been flagged already by MemberLookupFinal)
18731
18732         Do not allow instances of abstract classes or interfaces to be
18733         created.
18734
18735         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18736         We have to compare the assembly property here when dealing with
18737         FamANDAssem and Assembly access modifiers, because we might be
18738         creating an assembly from *modules* (that means that we are not
18739         getting TypeBuilders for types defined in other modules that are
18740         part of this assembly).
18741
18742         (Method.Emit): If the method is marked abstract and has a body,
18743         emit an error. 
18744
18745         (TypeContainer.DefineMembers): If both the defined member and the
18746         parent name match are methods, then do not emit any warnings: let
18747         the Method.Define routine take care of flagging warnings.  But if
18748         there is a mismatch (method overrides something else, or method is
18749         overriwritten by something, then emit warning).
18750
18751         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18752         set to null, this means `do not check for the return type on the
18753         signature'. 
18754
18755         (Method.Define): set the return type for the method signature to
18756         null, so that we get methods with the same name and parameters and
18757         different return types.  This is used to flag warning 114 (you are
18758         hiding a method, and you probably want to use the new/override
18759         keywords instead).
18760
18761         * typemanager.cs (MemberLookup): Implemented proper access
18762         control, closing a long standing set of bug reports.  The problem
18763         was that the Framework only has two bits: Public and NonPublic,
18764         and NonPublic includes private and protected methods, but we need
18765         to enforce the FamANDAssem, FamOrAssem and Family. 
18766
18767 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18768
18769         * statement.cs (GotoCase): Return true: Ammounts to giving up
18770         knowledge on whether we return or not, and letting the other case
18771         be responsible for it.
18772
18773 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18774
18775         * driver.cs: Do not load directories for each file processed, only
18776         do it if there is a pattern.
18777
18778         * ecore.cs: Report readonly assigns here as well, as we might have
18779         been resolved only by MemberAccess.
18780
18781         (SimpleName.SimpleNameResolve): Also be useful for LValue
18782         resolution.   We need this to propagate assign to local readonly variables
18783
18784         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18785         do not want to reuse potential criteria memory.
18786
18787         * class.cs (MyEventBuilder): Set reflected_type;
18788
18789         * ecore.cs (Constantify): Added support for constifying bools.
18790
18791         (RootContext.LookupType): Added a cache for values looked up in
18792         the declaration space.
18793
18794         * typemanager.cs (FindMembers): Now is a front-end to
18795         RealFindMembers, and provides a two-level hashtable-based cache to
18796         the request.  
18797
18798         15% performance improvement: from 22.5 to 19.2 seconds.
18799
18800         * expression.cs (IsParamsMethodApplicable): use foreach.
18801         (Invocation.DoResolve): ditto.
18802         (New.DoResolve): ditto.
18803         (ArrayCreation.DoResolve): ditto.
18804
18805         * ecore.cs (FindMostEncompassingType): use foreach.
18806
18807         * delegate.cs (NewDelegate.DoResolve): Use foreach
18808
18809         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18810         (RemoveMethods): use foreach.
18811
18812         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18813         nested foreach statements instead of for, and also break out of
18814         the inner loop once a match is found.
18815
18816         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18817
18818 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18819
18820         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18821         we actually unwrap the expression to allow for extra information
18822         to be extracted. 
18823
18824         * expression.cs: Use Shr_Un on unsigned operations. 
18825
18826 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18827
18828         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18829         applicable operators was not being considered correctly. This closes
18830         the bug Miguel reported.
18831
18832 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18833
18834         * attribute.cs: check that the type derives from System.Attribute
18835         and report the correct error in that case (moved the duplicate code to
18836         its own method, too).
18837
18838 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18839
18840         * attribute.cs: lookup attribute type name as the spec says: first the
18841         bare attribute name and then name + "Attribute" (nant compiles with
18842         mcs after this fix).
18843
18844 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18845
18846         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18847         Because of the way we parse things, we should try to see if a
18848         UIntConstant can fit in an integer.
18849
18850 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18851
18852         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18853         when we are in an explicit context.
18854
18855         (ConvertReferenceExplicit): When converting from Iface type S to Class
18856         T make sure the rules are implemented as an OR.
18857
18858         * parameter.cs (ParameterType): Make it a property for now although the
18859         purpose really isn't anything immediate.
18860
18861         * expression.cs (Is*Applicable): Do better checking on the parameter type
18862         of a ref/out parameter. The ones from the system assemblies are already 
18863         marked with the correct type so we don't need to do any correction.
18864
18865         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18866         the object type is standard too so include that.
18867
18868 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18869
18870         * ecore.cs (StandardConversionExists): Augment with missing code:
18871         deal with IntConstant, LongConstants and Enumerations.
18872
18873         * assign.cs: Report the error, instead of failing silently
18874
18875         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18876         typecontainer that they are declared, because the
18877         typecontainer/namespace will have the list of using clauses that
18878         need to be applied.
18879
18880         Assembly Attributes were escaping the normal registration
18881         mechanism. 
18882
18883         (EmitCode): Apply attributes within an EmitContext that represents
18884         the container they were declared on.
18885
18886         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18887
18888 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18889
18890         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18891         Revamp completely - make much cleaner as we now operate only
18892         on a set of Types.
18893
18894         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18895         to implement the logic detailed in the spec more correctly.
18896
18897         (UserDefinedConversion): Update accordingly.
18898
18899 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18900
18901         * statement.cs: Return flow analysis information up.
18902
18903         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18904         and the default.
18905
18906         (token): Do not consume an extra character before calling
18907         decimal_digits.
18908
18909 2002-05-06  Piers Haken <piersh@friskit.com>
18910
18911         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18912
18913 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18914
18915         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18916         EmitContext during the instance constructor initializer
18917         resolution, to stop access to instance variables.
18918
18919         This is mandated by the spec, last paragraph of the `constructor
18920         initializers' section. 
18921
18922 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18923
18924         * cs-parser.jay, class.cs (Accessor): new class used to represent
18925         an accessor (get or set).  In the past we used `null' to represent
18926         a missing accessor.  But this is ambiguous because there was no
18927         way to tell in abstract indexers/properties if one of them was
18928         specified.
18929
18930         Now there is a way of addressing that.
18931
18932         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18933         instead of FindMembers.
18934
18935         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18936         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18937
18938         * attribute.cs: Treat indexers and properties as the same in terms
18939         of applying attributes
18940
18941         * ecore.cs (FindMostEncompassedType): Use statically initialized
18942         EmptyExpressions()s like we do elsewhere to avoid creating useless
18943         objects (and we take this out of the tight loop).
18944
18945         (GetConversionOperators): Move the code to extract the actual
18946         operators to a separate routine to clean things up.
18947
18948 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18949
18950         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18951         events are always registered FieldBuilders.
18952
18953         * class.cs (FieldBase): New class shared by Fields 
18954
18955         * delegate.cs: If we are a toplevel delegate, use our full name.
18956         If we are a nested delegate, then only use our tail name.
18957
18958 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18959
18960         * expression.cs (IsApplicable): Ensure that we add the "&" to
18961         ref/out types before comparing it with the type of the argument.
18962
18963         (IsParamsMethodApplicable): Ditto.
18964
18965         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18966         silly me ;-)
18967
18968         * delegate.cs : Handle the case when we have more than one applicable
18969         method. Flag an error only when we finish checking all.
18970
18971 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18972
18973         * expression.cs: Add support for boolean static initializers.
18974
18975 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18976
18977         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18978
18979         * parameter.cs (ComputeParameterTypes,
18980         ComputeAndDefineParameterTypes): Better error handling: now we
18981         clear the `types' cache if we fail during any of the type lookups.
18982         We also return the status code correctly to our caller
18983
18984         * delegate.cs: If we fail to define a delegate, abort the extra
18985         steps. 
18986
18987         * expression.cs (Binary.ResolveOperator): for
18988         operator==(object,object) and operator !=(object, object) we also
18989         have to verify that there is an implicit conversion from one to
18990         the other.
18991
18992         (ArrayAccess.DoResolve): Array Access can operate on
18993         non-variables. 
18994
18995 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18996
18997         * assign.cs (CompoundAssign): A new class used as a "flag" that
18998         the assignment actually is happening as part of a compound
18999         assignment operator.
19000
19001         During compound assignment, a few new rules exist to enable things
19002         like:
19003
19004         byte b |= 1 + 2
19005
19006         From the spec:
19007
19008         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19009         to the type of x) if y is implicitly convertible to the type of x,
19010         and the operator is a builtin operator and the return type of the
19011         operator is explicitly convertible to the type of x. 
19012
19013         * rootcontext.cs: Reset warning level to 2.  4 catches various
19014         "interesting" features in mcs, we must clean this up at some
19015         point, but currently am trying to kill other bugs ;-)
19016
19017         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19018         in container classes as well.  
19019
19020         * expression.cs (Binary.ResolveOperator): Handle string case
19021         before anything else (as operator overloading does emit an error
19022         before doing anything else).
19023
19024         This code could go away when we move to a table driven model, but
19025         i could not come up with a good plan last night.
19026
19027 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19028
19029         * typemanager.cs (CSharpName): reimplementation using regex.
19030         * class.cs: added null check for fields in Emit
19031         * rootcontext.cs: set warninglevel to 4
19032
19033 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19034
19035         * typemanager.cs (CSharpName): reimplemented with Lupus
19036         suggestion.
19037
19038 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19039
19040         * statement.cs (If): correclty implement Resolve, because we were
19041         not catching sem errors in there.  The same process is needed
19042         everywhere else. 
19043         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19044
19045
19046         (Statement.Warning_DeadCodeFound): Factorize code.
19047         (While): Report dead code here too.
19048
19049         (Statement): Added Resolve virtual method to allow
19050         for resolution split from the emit code.
19051
19052 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19053
19054         * statement.cs (EmitBoolExpression): No longer try to resolve the
19055         expression here.    
19056         (MakeBoolean): New utility function that resolve, implicitly
19057         converts to boolean and tags the expression. 
19058
19059
19060         (If, Do): Implement dead code elimination.
19061         (While): Implement loop inversion
19062
19063         (Do, While, For, If): Resolve the expression prior to calling our
19064         code generation.
19065
19066 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19067
19068         * class.cs:
19069           - added method Report28 (warning: program has more than one entry point)
19070           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19071           - modified method Method.Define, the part at the end of the method
19072
19073         * rootcontext.cs: added static public Location EntryPointLocation;
19074           
19075         * ../errors/cs0028.cs : Add test case for the above warning.              
19076
19077         * typemanager.cs:
19078           - modified method CSharpName to allow arrays of primitive type to
19079             be printed nicely (e.g. instead of System.Int32[][] it now prints
19080             int[][])
19081           - added method CSharpSignature: returns the signature of a method
19082             in string format to be used in reporting errors, warnings, etc.
19083
19084         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19085         with String.Empty.
19086
19087 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19088
19089         * delegate.cs (Define): Fix extremely silly bug where I was
19090         setting the type of the 'object' parameter of the BeginInvoke
19091         method to System.IAsyncResult instead of System.Object ;-)
19092
19093 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19094
19095         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19096         here. 
19097
19098         (Constructor.Emit): return if we fail to initialize the
19099         constructor.  Another door closed!  
19100
19101         * expression.cs (New.DoResolve): Improve error message (from -6 to
19102         1501).  Use DeclaredOnly lookup to find the exact constructor.
19103
19104         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19105         loop.  This is useful.
19106
19107         * cs-parser.jay: Adjust the default parameters so that destructors
19108         have the proper signature.
19109
19110 2002-04-26  Martin Baulig  <martin@gnome.org>
19111
19112         * driver.cs (LoadAssembly): If `assembly' contains any characters
19113         which are only valid in path names and not in assembly names
19114         (currently slash, backslash and point), use Assembly.LoadFrom ()
19115         instead of Assembly.Load () on the `assembly' (before iteration
19116         over the link_paths).
19117
19118 2002-04-26  Martin Baulig  <martin@gnome.org>
19119
19120         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19121
19122 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19123
19124         * class.cs (Property): use the new typemanager.MemberLookup
19125
19126         (TypeContainer.MemberLookup): Implement using the
19127         TypeManager.MemberLookup now. 
19128
19129         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19130         and return MemberInfos, so that these can be used without an
19131         EmitContext (what we had before).
19132
19133 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19134
19135         * expression.cs: Fix the case where the argument to params if the
19136         type of the params.  I omitted handling this before.   Fixed
19137
19138 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19139
19140         * driver.cs: Call BootCorlib_PopulateCoreType
19141
19142         * class.cs (Property.CheckBase): Check for properties only, not
19143         for all members. 
19144
19145         * interface.cs: Temporary hack: try/catch around the
19146         CustomAttributeBuilder, because I am getting an exception that I
19147         do not understand.
19148
19149         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19150         types whose definitions are required to be there (attributes are
19151         defined before standard types).
19152
19153         Compute definitions as we boot the various types, as they are used
19154         immediately (value_type class will need object_type, but if we do
19155         not initialize object_type, we will pass a null, which will let
19156         the runtime pick the System.Object from the existing corlib, which
19157         is not what we want).
19158
19159 2002-04-22  Patrik Torstensson <totte@labs2.com>
19160
19161         * cs-tokenizer.cs: fixed a number of trim() issues.
19162
19163 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19164
19165         * expression.cs (Argument.Type): Ensure that we return the correct
19166         type when we have out or ref parameters [in which case we 
19167         append a "&"].
19168
19169 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19170
19171         * class.cs (Property, Indexer): Allow extern modifier in there. 
19172
19173         * typemanager.cs (InitBaseTypes): Initializes object_type and
19174         value_type, since those will be used early on during the bootstrap
19175         process to compile corlib.
19176
19177         (InitCoreTypes): Move code from here to InitBaseTypes.
19178
19179 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19180
19181         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19182         single-dimension arrays as using the ldlen opcode.  
19183
19184         Daniel Lewis discovered this optimization.  
19185
19186         * typemanager.cs: Add signature for System.Array::get_Length
19187
19188 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19189
19190         * statement.cs: report the error when the foreach does not apply to an
19191         array nor a collection.
19192
19193 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19194
19195         * expression.cs: Add implicit conversions to the operator ~.
19196
19197         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19198
19199         * typemanager.cs: Locate the decimal constructor.
19200
19201 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19202
19203         * attribute.cs: use the new property of TypeOf.
19204         * expression.cs: added 'get' property around typearg.
19205
19206         These changes fix a build breaker reported by NickD. Is this the
19207         correct way to fix?  If not, please, revert my changes and make it
19208         work :-).
19209
19210 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19211
19212         * attribute.cs: Add support for typeof in attribute invocations.
19213         I am not sure that this is right though.
19214
19215 2002-04-14  Duncan Mak  <duncan@ximian.com>
19216
19217         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19218         Binary.Operator.Division case.
19219
19220 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19221
19222         * class.cs (DefineType): Ensure that we do a proper check on
19223         attribute types and also register it with the TypeManager.
19224
19225         (TypeContainer.Targets): The default for attribute types is
19226         AttributeTargets.All.
19227
19228         * attribute.cs (ApplyAttributes): Registering the attribute type
19229         is done elsewhere, not when we discover we have a Usage attribute.
19230
19231 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19232
19233         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19234         and get rid of is_delegate parameter.
19235
19236         * everywhere : update.
19237
19238 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19239
19240         * cs-parser.jay (compilation_unit): Revamp completely to use
19241         some new ideas that I got from Rhys' grammar to solve the problems
19242         with assembly level attributes.
19243
19244         (outer_declaration): New grammar production.
19245
19246         (attribute_sections): Add.
19247
19248         (opt_attributes): Base on attribute_sections
19249
19250         (namespace_declaration): Allow opt_attributes to tackle the case
19251         when we have assembly level attributes - we are clever in this
19252         regard now ;-)
19253
19254         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19255         attributes in the non-global context.
19256
19257         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19258         instead of SetGlobalAttributes.
19259
19260         * class.cs, rootcontext.cs : Ensure we define and generate 
19261         attribute types before anything else.
19262
19263         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19264         and flag the new error -20 for the case when the attribute type
19265         does not have valid targets specified. csc does not catch this.
19266
19267         * ../errors/errors.txt : update for error # -20
19268
19269 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19270
19271         * support.cs (InternalParameters.ParameterModifier): Do some null
19272         checking and return sane values.
19273
19274         * class.cs (Method.Define): If we are a PInvoke method, ensure
19275         that we are static and extern. Report error # 601
19276
19277         * ../errors/cs0601.cs : Add test case for the above error.
19278
19279 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19280
19281         * rootcontext.cs (attribute_types): We need to keep type of
19282         all attribute types separately and emit code for them first.
19283
19284         (RegisterAttribute) : Implement.
19285
19286         * class.cs (DefineType): Check if the current Type is a custom
19287         attribute type and register it accordingly.
19288
19289         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19290         adding the first attribute twice and rename to
19291
19292         (SetGlobalAttributes): this.
19293
19294         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19295         lookups.
19296
19297         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19298         if we are processing global arguments. Hmm, I am unsure of this.
19299
19300 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19301
19302         * expression.cs: added static array of strings to avoid calling
19303         Enum.ToString () for Operator in Binary. Significant recover of
19304         performance.
19305
19306 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19307
19308         * class.cs (FindMembers): Allow the Builders of the various
19309         members to be null.  If they are skip them.  This only happens
19310         during the PInvoke declaration.
19311
19312 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19313
19314         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19315         failure, so we do not keep going afterwards.
19316
19317         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19318         wanted to pass `false' as the `is_delegate' argument.  If this is
19319         the case, why not use delegate_type == null to mean `is_delegate =
19320         false' and anything else as is_delegate = true.
19321
19322 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19323
19324         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19325         code for the section, not the beginning of the tests.
19326
19327 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19328
19329         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19330
19331         * expression.cs (Binary): same.  Warn about errors where we have
19332         Enum/Enum in operator + as well.
19333
19334 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19335
19336         * statement.cs:
19337                 - added support for switch(bool)
19338                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19339                 - add TableSwitchEmit() to handle table-based switch statements
19340
19341 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19342
19343         * expression.cs (Invocation.OverloadResolve): Factor out code which
19344         does parameter compatibility checking with arguments so that we can 
19345         re-use the code even from Delegate.VerifyApplicability
19346
19347         (VerifyArgumentsCompat): Move above code here.
19348
19349         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19350         and instead make a call to the above method.
19351
19352 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19353
19354         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19355         We use it to keep track of classes which are attribute types.
19356
19357 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19358
19359         * delegate.cs (Delegate.Define): Correctly define the types in the
19360         presence of fixed and array parameters.
19361
19362         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19363         doing FindMembers.
19364
19365         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19366         include NonPublic after the first iteration.
19367
19368         * class.cs (Indexer.CheckBase): Only check if both parents are
19369         non-null. 
19370
19371         * cs-parser.jay (accessor_body): If empty, set to null.
19372
19373         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19374         same code path here to resolve constants names that we did have in
19375         MemberAccess.DoResolve.  There is too much code duplicated here.
19376
19377 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19378
19379         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19380
19381         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19382         to MakeUnionSet.
19383
19384         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19385         tokens, numbers and strings.
19386
19387         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19388         parenthesis.
19389
19390         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19391         asyncronous parameters and the regular parameters.  
19392
19393         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19394         specify the target directory.
19395
19396         * expression.cs: (This.DoResolve): Simplify
19397         (As.Emit): Optimize, do not generate IsInst if the expression is
19398         always of the given type.
19399
19400         (Is.DoResolve): Bug fix, we were reporting both always/never for
19401         the is expression.
19402
19403         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19404         creating too many unnecessary arrays.
19405
19406 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19407
19408         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19409         fields instead of rolling our own initializer.   Takes care of all
19410         implicit conversions, and drops unnecessary static checks/argument.
19411
19412 2002-03-31  Dick Porter  <dick@ximian.com>
19413
19414         * driver.cs: use the GetDirectories() return values properly, and
19415         use "/" as path separator.
19416
19417 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19418
19419         * expression.cs (Unary): Optimize - - expr into expr.
19420         (Binary): Optimize a + (-b) into a -b.
19421
19422         * codegen.cs (CodeGen): Made all methods static.
19423
19424 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19425
19426         * rootcontext.cs: 
19427
19428         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19429         TypeBuilder property.
19430
19431         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19432         instead. 
19433
19434         * tree.cs: Removed the various RecordXXXX, and replaced with a
19435         single RecordDecl.  Removed all the accessor methods, and just
19436         left a single access point Type 
19437
19438         * enum.cs: Rename DefineEnum to DefineType.
19439
19440         * decl.cs: New abstract method `DefineType' used to unify the
19441         Defines for Enumerations, Interfaces, TypeContainers and
19442         Delegates.
19443
19444         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19445         LookupBaseClasses method that used to live in class.cs and
19446         interface.cs here, and renamed to FindType.
19447
19448         * delegate.cs: Implement DefineType.  Take advantage of the
19449         refactored pattern for locating the parent builder without taking
19450         the parent_builder argument (which we know does not work if we are
19451         nested, and triggering a toplevel definition).
19452
19453 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19454
19455         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19456         accessibility of a member has changed during override and report
19457         an error if so.
19458
19459         * class.cs (Method.Define, Property.Define): Only complain on
19460         overrides if the method is private, any other accessibility is
19461         fine (and since we just checked the permission is the same, we are
19462         good to go).
19463
19464         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19465         and elif are processed always.  The other pre-processing
19466         directives are only processed if we are "taking" the path
19467
19468 2002-03-29  Martin Baulig  <martin@gnome.org>
19469
19470         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19471         current location is not Null.
19472
19473         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19474         a separate method so we can profile it.
19475
19476         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19477         `span.Seconds' are just seconds, but no minutes or hours.
19478         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19479
19480 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19481
19482         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19483         Remove the gratuitous set of Final:
19484
19485                                 // If an interface implementation, then we can set Final.
19486                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19487                                     implementing.DeclaringType.IsInterface)
19488                                         flags |= MethodAttributes.Final;
19489
19490         I do not know what I was smoking when I used that.
19491
19492
19493         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19494         step into fixing the name resolution issues for delegates and
19495         unifying the toplevel name resolution.
19496
19497 2002-03-28  Martin Baulig  <martin@gnome.org>
19498
19499         * class.cs (Method.Emit): If we have a symbol writer, call its
19500         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19501         tell it about the current method.
19502
19503         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19504         writer that we're going to emit the first byte of IL code for a new
19505         statement (a new source line).
19506         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19507         EmitContext.Mark() before emitting any code.
19508
19509         * location.cs (SymbolDocument): Return null when we're Null.
19510
19511         * statement.cs (Statement): Moved the `Location loc' variable here.
19512         (Statement.EmitBoolExpression): If we have a symbol writer, call
19513         ec.Mark() before emitting any code to tell it that we're at the
19514         beginning of a new statement.
19515         (StatementExpression): Added `Location' argument to the constructor.
19516         (Block): Added public readonly variable `StartLocation' and public
19517         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19518         (Block): Added constructor which takes a start and end location.
19519         (Block.SetEndLocation): New method. This sets the end location.
19520         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19521         local variables we create.
19522         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19523         each statement and do also mark the begin and end of the block.
19524
19525         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19526         tell it the current lexer.Location, use Location.Null for the end of the
19527         block.
19528         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19529         current block, set its end location using SetEndLocation().
19530         (statement_expression): StatementExpression constructor now takes the
19531         lexer.Location as additional argument.
19532         (for_statement, declare_local_variables): Likewise.
19533         (declare_local_variables): When creating a new implicit block, use the
19534         new Block constructor and pass it the lexer.Location.
19535
19536 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19537
19538         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19539         members also on the parent interfaces recursively.
19540
19541 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19542
19543         * report.cs: Use new formats, since Gonzalo finished the missing
19544         bits. 
19545
19546         * expression.cs (Binary.ResolveOperator): added missing operator|
19547         operator& and operator^ for bool/bool.
19548
19549         * cs-parser.jay: CheckDef now takes a Location argument that is
19550         used to report errors more precisly (instead of reporting the end
19551         of a definition, we try to track something which is a lot closer
19552         to the source of the problem).
19553
19554         * cs-tokenizer.cs: Track global token use, so we can properly flag
19555         the use of #define/#undef after the first token has been seen.
19556
19557         Also, rename the reportXXXX to Error_DescriptiveName
19558
19559         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19560         TypeContainer, so that Enum and Interface can use this too.
19561
19562         * class.cs (TypeContainer.LookupInterfaceOrClass,
19563         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19564         `builder' argument.  Typically this was used to pass the parent
19565         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19566         the definition).  
19567
19568         The problem is that a nested class could trigger the definition of
19569         a toplevel class, and the builder would be obviously wrong in that
19570         case. 
19571
19572         So we drop this argument, and we compute dynamically the
19573         TypeBuilder/ModuleBuilder (the correct information was available
19574         to us anyways from DeclSpace.Parent)
19575
19576         * interface.cs (Interface.DefineInterface): Drop builder
19577         parameter cleanup like class.cs
19578
19579         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19580         like class.cs
19581
19582         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19583         values. 
19584
19585         (Try.Emit): Propagate the returns value from the statement.
19586
19587         (Return.Emit): Even if we are leavning 
19588
19589         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19590
19591         * modifiers.cs: Fix the computation of MethodAttributes flags.
19592
19593 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19594
19595         * driver.cs: allow compilation of files that start with '/'.
19596         Add a default case when checking the argument of --target.
19597
19598 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19599
19600         * interface.cs: Implement the same search algorithm for types in
19601         the interface code.
19602
19603         * delegate.cs: Do not allow multiple definition.
19604
19605         * Recovered ChangeLog that got accidentally amputated
19606
19607         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19608
19609         * rootcontext.cs: Load manually enum to allow core classes to
19610         contain enumerations.
19611
19612         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19613         Update to new static methods in TypeManager.
19614
19615         * typemanager.cs (GetMethod, GetConstructor): Use our
19616         implementation of FindMembers to find the members, since during
19617         corlib compilation, the types are TypeBuilders and GetMethod and
19618         GetConstructor do not work.
19619
19620         Make all methods in TypeManager static.
19621
19622         (InitCodeHelpers): Split the functionality from
19623         the InitCodeTypes function.
19624
19625         * driver.cs: Call InitCodeHelpers after we have populated the
19626         types. 
19627
19628         * cs-parser.jay (delegate_declaration): we did not used to compute
19629         the delegate name correctly for void delegates.
19630
19631 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19632
19633         * rootcontext.cs (RootContext): Init the interface_resolve_order
19634         and type_container_resolve_order always.
19635
19636         (ResolveCore, BootstrapCorlib_ResolveClass,
19637         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19638         compiler when compiling with --nostdlib
19639
19640         * class.cs (TypeContainer.DefineType): Check that our parent is
19641         not null.  This test is most important when we are bootstraping
19642         the core types.
19643
19644         * codegen.cs: Split out the symbol writing code.
19645
19646 2002-03-25  Martin Baulig  <martin@gnome.org>
19647
19648         * driver.cs (-g): Made -g an alias for --debug.
19649
19650 2002-03-24  Martin Baulig  <martin@gnome.org>
19651
19652         * codegen.cs (SymbolWriter): New public variable. Returns the
19653         current symbol writer.
19654         (CodeGen): Added `bool want_debugging_support' argument to the
19655          constructor. If true, tell the ModuleBuild that we want debugging
19656         support and ask it for the ISymbolWriter.
19657         (Save): If we have a symbol writer, call it's Close() method after
19658         saving the assembly.
19659
19660         * driver.c (--debug): New command line argument to create a
19661         debugger information file.
19662
19663         * location.cs (SymbolDocument): New public property. Returns an
19664         ISymbolDocumentWriter object for the current source file or null
19665         if we don't have a symbol writer.
19666
19667 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19668
19669         * driver.cs (LoadAssembly): Correctly return when all the paths
19670         have been tried and not before.
19671
19672         * statement.cs (Switch.Emit): return the actual coverage for this
19673         statement (returns/not-returns)
19674
19675         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19676         switch of the statement if we are the last switch section.  That
19677         kills two problems: try/catch problems (we used to emit an empty
19678         nop at the end) and switch statements where all branches would
19679         return. 
19680
19681 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19682
19683         * driver.cs: Add default assemblies (the equivalent to the
19684         Microsoft CSC.RSP file)
19685
19686         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19687         also update tokens_seen and set it to false.
19688
19689         * driver.cs: Implement --recurse for Mike.
19690
19691         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19692         correctly splitting out the paths.
19693
19694 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19695
19696         * interface.cs (Interface.PopulateProperty): Instead of using
19697         `parent' as the declaration space for the set parameters, use
19698         `this' 
19699
19700         * support.cs (InternalParameters): InternalParameters constructor
19701         takes a DeclSpace instead of a TypeContainer.
19702
19703         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19704         types are being initialized, load the address of it before calling
19705         the function.  
19706
19707         (New): Provide a mechanism to disable the generation of local
19708         value type temporaries when the caller will be providing us with
19709         an address to store it.
19710
19711         (ArrayCreation.EmitDynamicInitializers): Use it.
19712
19713 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19714
19715         * expression.cs (Invocation.EmitArguments): Only probe for array
19716         property if there is more than one argument.  Sorry about that.
19717
19718         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19719         empty param arrays.
19720
19721         * class.cs (Method.LabelParameters): Fix incorrect code path that
19722         prevented the `ParamArrayAttribute' from being applied to the
19723         params attribute.
19724
19725 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19726
19727         * support.cs (ReflectionParameters): Correctly compute whether the
19728         last argument is a params array.  Fixes the problem with
19729         string.Split ('a')
19730
19731         * typemanager.cs: Make the assemblies array always be non-null
19732         (empty, but non-null)
19733
19734         * tree.cs (RecordDecl): New function that abstracts the recording
19735         of names.  This reports error 101, and provides a pointer to the
19736         previous declaration.  Fixes a crash in the compiler.
19737
19738         * cs-parser.jay (constructor_declaration): Update to new grammar,
19739         and provide a constructor_body that can be empty.
19740
19741 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19742
19743         * driver.cs: Add support for --resources.
19744
19745         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19746         Make all types for the various array helper methods be integer.
19747
19748         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19749         CheckState to ConvCast.
19750
19751         (ConvCast): Now it takes a `checked' state argument, to avoid
19752         depending on the emit context for the conversion, and just using
19753         the resolve time setting.
19754
19755         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19756         instead of Invocation.EmitArguments.  We do not emit the original
19757         arguments, instead we emit those which have been converted to
19758         unsigned int expressions.
19759
19760         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19761
19762         * codegen.cs: ditto.
19763
19764         * expression.cs (LocalVariableReference): Drop the use of the
19765         Store function that depended on the variable index.
19766
19767         * statement.cs (VariableInfo): Drop the `Idx' property from this
19768         class, as this is not taking into account the indexes for
19769         temporaries tat we generate during the execution, getting the
19770         indexes wrong.
19771
19772         * class.cs: First emit class initializers, then call the parent
19773         constructor. 
19774
19775         * expression.cs (Binary): Fix opcode emision.
19776         (UnaryMutator.EmitCode): Support checked code generation
19777
19778         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19779         matches for events for both the Static and Instance scans,
19780         pointing to the same element.   Fix that.
19781
19782 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19783
19784         * rootcontext.cs (ResolveTree): Always set the
19785         interface_resolve_order, because nested interfaces will be calling
19786         into us.
19787
19788         * class.cs (GetInterfaceOrClass): Track the same resolution
19789         process used by TypeManager.LookupType.  This fixes the nested
19790         type lookups in class declarations (separate path from
19791         LookupType). 
19792
19793         (TypeContainer.DefineType): Also define nested interfaces.
19794         (TypeContainer.RegisterOrder): New public function used to
19795         register the order in which child interfaces need to be closed.
19796
19797         Nested interfaces need to be closed after their parents have been
19798         created. 
19799
19800         * interface.cs (InterfaceAttr): Put all the logic for computing
19801         the interface attribute here. 
19802
19803         (DefineInterface): Register our interface order with the
19804         RootContext or with the TypeContainer depending on the case.
19805
19806 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19807
19808         * cs-parser.jay: rework foreach statement to work with the new
19809         changes to the policy on SimpleNames.
19810
19811         * report.cs: support Stacktrace on warnings as well.
19812
19813         * makefile: drop --unsafe and /unsafe from the compile.
19814
19815 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19816
19817         * ecore.cs (StandardConversionExists): Modify to take an Expression
19818         as the first parameter. Ensure we do null -> reference type conversion
19819         checking.
19820
19821         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19822         temporary Expression objects.
19823
19824 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19825
19826         * interface.cs: workaround bug in method overloading resolution
19827         (there is already a bugzilla bug for it).
19828
19829 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19830
19831         We could also solve this problem by having a separate path for
19832         performing type lookups, instead of DoResolve, we could have a
19833         ResolveType entry point, and only participating pieces of the
19834         production (simplename, deref, array) would implement this. 
19835
19836         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19837         signal SimpleName to only resolve type names and not attempt to
19838         resolve anything else.
19839
19840         * expression.cs (Cast): Set the flag.
19841
19842         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19843
19844         * class.cs: Only report 108 if there is no `new' modifier.
19845
19846         * cs-parser.jay: rework foreach statement to work with the new
19847         changes to the policy on SimpleNames.
19848
19849         * report.cs: support Stacktrace on warnings as well.
19850
19851         * makefile: drop --unsafe and /unsafe from the compile.
19852
19853 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19854
19855         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19856         lookups here, instead of doing that at parse time.  This means
19857         that our grammar will not introduce `LocalVariableReferences' as
19858         expressions at this point.  That solves the problem of code like
19859         this:
19860
19861         class X {
19862            static void Main ()
19863            { int X = 1;
19864             { X x = null }}}
19865
19866         This is only half the fix.  The full fix requires parameters to
19867         also be handled in this way.
19868
19869         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19870         makes the use more obvious of the DeclSpace.  The
19871         ec.TypeContainer.TypeBuilder is now only used to pull the
19872         TypeBuilder for it.
19873
19874         My theory is that I can get rid of the TypeBuilder completely from
19875         the EmitContext, and have typecasts where it is used (from
19876         DeclSpace to where it matters).  
19877
19878         The only pending problem is that the code that implements Aliases
19879         is on TypeContainer, and probably should go in DeclSpace.
19880
19881         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19882         lookups here, instead of doing that at parse time.  This means
19883         that our grammar will not introduce `LocalVariableReferences' as
19884         expressions at this point.  That solves the problem of code like
19885         this:
19886
19887         class X {
19888            static void Main ()
19889            { int X = 1;
19890             { X x = null }}}
19891
19892         This is only half the fix.  The full fix requires parameters to
19893         also be handled in this way.
19894
19895         * class.cs (Property.DefineMethod): When implementing an interface
19896         method, set newslot, when implementing an abstract method, do not
19897         set the flag (before we tried never setting it, or always setting
19898         it, which is the difference).
19899         (Indexer.DefineMethod): same.
19900         (Method.DefineMethod): same.
19901
19902         * ecore.cs: Only set the status used flag if we get back a Field.
19903
19904         * attribute.cs: Temporary hack, so Paolo can keep working.
19905
19906 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19907
19908         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19909         the unmanaged type in the case we have a MarshalAs attribute.
19910
19911         (Resolve): Handle the case when we are parsing the special MarshalAs
19912         attribute [we need to store the unmanaged type to use later]
19913
19914         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19915         MarshalAs Attribute.
19916
19917         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19918         on parameters and accordingly set the marshalling info.
19919
19920 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19921
19922         * class.cs: Optimizing slightly by removing redundant code after
19923         we switched to the `NoTypes' return value.
19924         (Property.DefineMethod): use NoTypes here too.
19925
19926         This fixes the bug I introduced in my last batch of changes.
19927
19928 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19929
19930         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19931
19932         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19933         Enums since those are types too. 
19934
19935         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19936
19937         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19938         thanks to a call during the lookup process.
19939
19940 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19941
19942         * statement.cs (Foreach): Lots of work to accomodate a particular
19943         kind of foreach statement that I had not kept in mind.  It is
19944         possible to have foreachs on classes that provide a GetEnumerator
19945         method that return objects that implement the "pattern" for using
19946         a foreach, there is no need to support GetEnumerator
19947         specifically. 
19948
19949         This is needed to compile nant.
19950
19951         * decl.cs: Only report 114 if the member is not `Finalize' and if
19952         the warning level is at least 2.
19953
19954         * class.cs: Moved the compare function from Method to
19955         MethodSignature. 
19956
19957         (MethodSignature.InheritableMemberSignatureCompare): Add new
19958         filter function that is used to extract inheritable methods from a
19959         class. 
19960
19961         (Method.Define): Use the new `inheritable_method_signature_filter'
19962         delegate
19963
19964         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19965         command. 
19966
19967 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19968
19969         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19970
19971         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19972
19973         * expression.cs: Pass location information to
19974         ConvertImplicitStandard. 
19975
19976         * class.cs: Added debugging code to track return values from
19977         interfaces. 
19978
19979 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19980
19981         * expression.cs (Is.DoResolve): If either side of the `is' is an
19982         interface, do not flag the warning.
19983
19984         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19985         for interfaces
19986
19987         * report.cs: Allow for --fatal to be used with --probe.
19988
19989         * typemanager.cs (NoTypes): Move the definition for the empty Type
19990         array here. 
19991
19992         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19993         properties. 
19994         (TypeContainer.DefineProxy): New function used to proxy to parent
19995         implementations when implementing interfaces.
19996         (TypeContainer.ParentImplements): used to lookup if our parent
19997         implements a public function that is required by an interface.
19998         (TypeContainer.VerifyPendingMethods): Hook this up.
19999
20000         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20001         `modules' and `assemblies' arraylists into arrays.  We only grow
20002         these are the very early start up of the program, so this improves
20003         the speedof LookupType (nicely measured).
20004
20005         * expression.cs (MakeByteBlob): Replaced unsafe code with
20006         BitConverter, as suggested by Paolo.
20007
20008         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20009         folding of string concatenation, but if either side is a string,
20010         and the other is not, then return null, and let the runtime use
20011         the concatenation on the string plus the object (using
20012         `Object.ToString'). 
20013
20014 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20015
20016         Constant Folding has been implemented now.
20017
20018         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20019         the error instead on types that are not supported in one's
20020         complement. 
20021
20022         * constant.cs (Constant and all children): New set of functions to
20023         perform implict and explicit conversions.
20024
20025         * ecore.cs (EnumConstant): Implement the new functions to perform
20026         conversion by proxying to the child expression.
20027
20028         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20029         own separate setting that can not be turned off from the command
20030         line using --unchecked or --checked and is only controlled using
20031         the checked/unchecked statements and expressions.  This setting is
20032         used by the constant folder to flag errors.
20033
20034         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20035         ConstantCheckState as well.   
20036
20037         During Resolve, they also have to flag the state, because the
20038         constant folder runs completely in the Resolve phase.
20039
20040         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20041         well.
20042
20043 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20044
20045         * cfold.cs: New file, this file contains the constant folder.
20046
20047         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20048         argument to track whether we are using the resulting address to
20049         load or store a value and provide better error messages. 
20050
20051         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20052         new AddressOf arguments.
20053
20054         * statement.cs (Foreach.EmitCollectionForeach): Update
20055
20056         * expression.cs (Argument.Emit): Call AddressOf with proper
20057         arguments to track usage.
20058
20059         (New.DoEmit): Call AddressOf with new arguments.
20060
20061         (Unary.Emit): Adjust AddressOf call.
20062
20063 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20064
20065         * cs-parser.jay (member_access): Change the case for pre-defined types
20066         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20067         this suggestion.
20068
20069         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20070         a method body.
20071
20072         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20073         essentially like methods and apply attributes like MethodImplOptions to them too.
20074
20075         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20076         not being null.
20077
20078         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20079         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20080         is the DeclSpace.
20081
20082         * Update code everywhere accordingly.
20083
20084         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20085
20086         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20087
20088 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20089
20090         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20091         try performing lookups against those instead of jumping straight into using
20092         the 'using' clauses.
20093
20094         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20095
20096         (LookupType): Perform lookups in implicit parents too.
20097
20098         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20099         sequence as RootContext.LookupType. 
20100
20101         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20102         the various cases of namespace lookups into this method.
20103
20104 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20105
20106         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20107         in positional arguments)
20108
20109         * class.cs (Operator): Update the AllowedModifiers to contain
20110         extern. 
20111
20112         * cs-parser.jay: Update operator declaration to allow for the
20113         operator body to be empty.
20114
20115         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20116         values. 
20117
20118 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20119
20120         * class.cs (Method.Emit): Label parameters.
20121
20122         * driver.cs: Return 1 or 0 as the program exit code.
20123
20124 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * expression.cs: Special case the `null' object when trying to
20127         auto-compute the type, as anything can be explicitly converted to
20128         that. 
20129
20130         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20131         spotting this Paolo.
20132
20133         (Expression.ImplicitNumericConversion): Perform comparissions of
20134         the type using the underlying type in the case of an enumeration
20135         rather than using the enumeration type for the compare.
20136
20137         Cope with the underlying == type case, which is not possible to
20138         catch before. 
20139
20140         (Expression.ConvertNumericExplicit): Perform comparissions of
20141         the type using the underlying type in the case of an enumeration
20142         rather than using the enumeration type for the compare.
20143
20144         * driver.cs: If the user does not supply an extension, assume .exe
20145
20146         * cs-parser.jay (if_statement): Rewrote so that we can track the
20147         location for the if statement.
20148
20149         * expression.cs (Binary.ConstantFold): Only concat strings when
20150         the operation is "+", not everything ;-)
20151
20152         * statement.cs (Statement.EmitBoolExpression): Take a location
20153         argument. 
20154         (If, While, Do): Track location.
20155
20156         * expression.cs (Binary.ResolveOperator): In the object + string
20157         case, I was missing a call to ConvertImplicit
20158
20159 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20160
20161         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20162         Location arguments. Ensure we use RootContext.LookupType to do our work
20163         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20164
20165         * interface.cs (PopulateMethod): Handle the type of the parameter being
20166         null gracefully.
20167
20168         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20169         have a params method with no fixed arguments and a call is made with no
20170         arguments.
20171
20172 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20173
20174         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20175         the verbatim-string-literal
20176
20177         * support.cs (InternalParameters.ParameterModifier): handle null
20178         fixed parameters.
20179         (InternalParameters.ParameterType): ditto.
20180
20181         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20182         duplicating the name of the variable parameter.
20183         (GetParameterByName): Fix bug where we were not looking up array
20184         paramters if they were the only present (thanks Paolo!).
20185         (GetParameterInfo): We only have an empty set of types if both
20186         fixed and array are set to null.
20187         (GetParameterInfo-idx): Handle FixedParameter == null
20188
20189         * cs-parser.jay: Handle the case where there is no catch
20190         statements (missing null test).
20191
20192 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20193
20194         * driver.cs (MainDriver): Be conservative on our command line
20195         handling.
20196
20197         Catch DirectoryNotFoundException when calling GetFiles.
20198
20199         (SplitPathAndPattern): Used to split the input specification into
20200         a path and a pattern that we can feed to Directory.GetFiles.
20201
20202 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20203
20204         * statement.cs (Fixed): Implement the last case of the Fixed
20205         statement (string handling).
20206
20207         * expression.cs (StringPtr): New class used to return a char * to
20208         a string;  Used by the Fixed statement.
20209
20210         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20211
20212         * expression.cs (Binary.ResolveOperator): Remove redundant
20213         MemberLookup pn parent type.
20214         Optimize union call, we do not need a union if the types are the same.
20215         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20216         type.
20217
20218         Specialize the use of MemberLookup everywhere, instead of using
20219         the default settings. 
20220
20221         (StackAlloc): Implement stackalloc keyword.
20222
20223         * cs-parser.jay: Add rule to parse stackalloc.
20224
20225         * driver.cs: Handle /h, /help, /?
20226
20227         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20228         before we supported unsafe code.
20229
20230         * makefile: add --unsafe to the self compilation of mcs.
20231
20232 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20233
20234         * expression.cs (PointerArithmetic): New class that is used to
20235         perform pointer arithmetic.
20236         (Binary.Resolve): Handle pointer arithmetic
20237         Handle pointer comparission.
20238         (ArrayPtr): Utility expression class that is used to take the
20239         address of an array.
20240
20241         (ElementAccess): Implement array access for pointers
20242
20243         * statement.cs (Fixed): Implement fixed statement for arrays, we
20244         are missing one more case before we are done.
20245
20246         * expression.cs (Indirection): Implement EmitAssign and set the
20247         ExprClass to Variable.  This allows pointer dereferences to be
20248         treated as variables, and to have values assigned to them.
20249
20250         * ecore.cs (Expression.StoreFromPtr): New utility function to
20251         store values dereferencing.
20252
20253 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20254
20255         * expression.cs (Binary.ResolveOperator): Ensure that we are
20256         not trying to operate on a void type - this fixes the reported
20257         bug.
20258
20259         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20260         the parent implementation is sealed.
20261
20262         * ../errors/cs0239.cs : Add.
20263
20264         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20265
20266         * typemanager.cs (unverifiable_code_type): Corresponds to 
20267         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20268         which have unsafe code in them.
20269
20270         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20271         unsafe context.
20272
20273 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20274
20275         * cs-tokenizer.cs: Add support for @"litreal strings"
20276
20277         Make tokenizer accept pre-processor directives
20278         on any column (remove the old C-like limitation). 
20279
20280         * rootcontext.cs (EmitCode): Emit any global attributes.
20281         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20282
20283         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20284
20285         * cs-parser.jay: Add support for global attributes.  
20286
20287 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20288
20289         * expression.cs (Indirection): New helper class.  Unary will
20290         create Indirection classes to be able to implement the
20291         IMemoryLocation interface on it.
20292
20293 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20294
20295         * cs-parser.jay (fixed_statement): reference the right statement.
20296
20297         * statement.cs (Fixed.Emit): Finish implementing the fixed
20298         statement for the &x case.
20299
20300 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20301
20302         * class.cs (Property.Define, Method.Define): Remove newslot when
20303         `implementing'.  
20304
20305         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20306         wrong.  NewSlot should only be used if the `new' keyword is present.
20307
20308         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20309         locating our system dir.  Sorry about this.
20310
20311 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20312
20313         * driver.cs (GetSystemDir): Compute correctly the location of our
20314         system assemblies.  I was using the compiler directory instead of
20315         the library directory.
20316
20317 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20318
20319         * expression.cs (BetterFunction): Put back in what Miguel commented out
20320         since it is the correct fix. The problem is elsewhere ;-)
20321
20322         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20323         parameters of the parms method are themselves compatible or not !
20324
20325         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20326         to check that a class implements an interface before saying that an implicit
20327         conversion was allowed. Use ImplementsInterface to do the checking.
20328
20329 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20330
20331         * class.cs (Method.Define): Track whether we are an explicit
20332         implementation or not.  And only call DefineMethodOverride if we
20333         are an explicit implementation.
20334
20335         (Property.DefineMethod): Ditto.
20336
20337 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20338
20339         * expression.cs (BetterFunction): Catch hideous bug which was
20340          preventing us from detecting ambiguous calls due to implicit casts i.e
20341         cs0121.
20342
20343 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20344
20345         * support.cs (Pair): Remove un-needed method.  I figured why I was
20346         getting the error in cs-parser.jay, the variable in a foreach loop
20347         is readonly, and the compiler does not really treat this as a variable.
20348
20349         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20350         instead of EQUALS in grammar.  
20351
20352         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20353
20354         * expression.cs (Unary.DoResolve): Check whether the argument is
20355         managed or not.
20356
20357 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20358
20359         * support.cs: Api for Pair to set a value.  Despite the fact that
20360         the variables are public the MS C# compiler refuses to compile
20361         code that accesses the field if the variable is part of a foreach
20362         statement. 
20363
20364         * statement.cs (Fixed): Begin implementation of the fixed
20365         statement.
20366
20367         (Block.AddVariable): Return the VariableInfo on success and null
20368         on failure instead of true/false. 
20369
20370         * cs-parser.jay (foreach): Catch errors on variables already
20371         defined (we were ignoring this value before) and properly unwind
20372         the block hierarchy
20373
20374         (fixed_statement): grammar for the fixed statement.
20375
20376 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20377
20378         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20379         pointer types to be incretemented.
20380
20381         (SizeOf): Implement.
20382
20383         * cs-parser.jay (pointer_member_access): Implement
20384         expr->IDENTIFIER production.
20385
20386         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20387         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20388         on safe contexts.
20389
20390         (Unary): Implement indirection.
20391
20392         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20393         use in non-unsafe context).
20394
20395         (SimpleName.DoResolve): Check for pointers in field access on safe
20396         contexts. 
20397
20398         (Expression.LoadFromPtr): Factor the load-indirect code in this
20399         function.  This was duplicated in UnboxCast and ParameterReference
20400
20401 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20402
20403         * expression.cs (ComposedCast): report an error if a pointer cast
20404         is used in a safe region.
20405
20406         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20407         pointer type casts in unsafe context.
20408
20409         * codegen.cs (EmitContext): Set up IsUnsafe.
20410
20411         * cs-parser.jay (non_expression_type): Add productions for pointer
20412         casts. 
20413
20414         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20415         code.  We should not use force into static mode if the method is
20416         not virtual.  Fixes bug in MIS
20417
20418         * statement.cs (Do.Emit, While.Emit, For.Emit,
20419         Statement.EmitBoolExpression): Add support to Do and While to
20420         propagate infinite loop as `I do return' semantics.
20421
20422         Improve the For case to also test for boolean constants.
20423
20424         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20425         to the list of attributes we can add.
20426
20427         Remove `EmitContext' argument.
20428
20429         * class.cs (Method.Define): Apply parameter attributes.
20430         (Constructor.Define): Apply parameter attributes.
20431         (MethodCore.LabelParameters): Move here the core of labeling
20432         parameters. 
20433
20434         * support.cs (ReflectionParameters.ParameterModifier,
20435         InternalParameters.ParameterModifier): Use IsByRef on the type and
20436         only return the OUT bit for these parameters instead of in/out/ref
20437         flags.
20438
20439         This is because I miss-understood things.  The ParameterInfo.IsIn
20440         and IsOut represent whether the parameter has the [In] and [Out]
20441         attributes set.  
20442
20443 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20444
20445         * ecore.cs (FieldExpr.Emit): Release temporaries.
20446
20447         * assign.cs (LocalTemporary.Release): new function.
20448
20449         * codegen.cs (EmitContext.GetTemporaryStorage,
20450         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20451         temporary storage.  Now we can "put back" localbuilders when we
20452         are done with them
20453
20454 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20455
20456         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20457         need to make a copy of the variable to generate verifiable code.
20458
20459 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20460
20461         * driver.cs: Compute dynamically the system directory.
20462
20463         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20464         Slower, but more generally useful.  Used by the abstract
20465         registering implementation. 
20466
20467         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20468         the rules for the special rule on Type/instances.  First check if
20469         we have the same name, and if so, try that special static path
20470         rather than the instance path.
20471
20472 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20473
20474         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20475         for, while and if.
20476
20477         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20478         Enum, ValueType, Delegate or Array for non-corlib compiles.
20479
20480         * cs-tokenizer.cs: Catch long identifiers (645)
20481
20482         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20483         piece of code.
20484
20485         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20486         fix, we were returning too early, so we were not registering
20487         pending methods from abstract classes.
20488
20489         Do not register pending methods if the class is abstract.
20490
20491         * expression.cs (Conditional.DoResolve): Report circular implicit
20492         conversions when we neecd to compute it for conditional
20493         expressions. 
20494
20495         (Is.DoResolve): If the expression is always of the provided type,
20496         flag warning 183.  If the expression can not ever be of the
20497         provided type flag warning 184.
20498
20499         * class.cs: Catch 169 as well.
20500
20501         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20502         read. 
20503
20504 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20505
20506         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20507
20508 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20509
20510         * interface.cs: (PopulateMethod): Check for pointers being defined
20511         only if the unsafe context is active.
20512         (PopulateProperty): ditto.
20513         (PopulateIndexer): ditto.
20514
20515         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20516         specified.  If pointers are present, make sure that they are
20517         present in an unsafe context.
20518         (Constructor, Constructor.Define): ditto.
20519         (Field, Field.Define): ditto.
20520         (Property, Property.Define): ditto.
20521         (Event, Event.Define): ditto.
20522
20523         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20524         hashtable if there are classes or structs defined.
20525
20526         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20527         code, as the constant resolution moved.
20528
20529         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20530         the metadata, so we can flag error 133. 
20531
20532         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20533         pointer is being declared in an unsafe context.
20534
20535 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20536
20537         * modifiers.cs (Modifiers.Check): Require a Location argument.
20538         Report error 227 for Unsafe use.
20539
20540         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20541
20542         * statement.cs (For.Emit): If the test is null, then report that
20543         we do `return', as we wont reach anything afterwards.
20544
20545         (Switch.SwitchGoverningType): Track the expression that matched
20546         the conversion.
20547
20548         * driver.cs: Allow negative numbers as an error code to flag.
20549
20550         * cs-parser.jay: Handle 1551.
20551
20552         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20553
20554 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20555
20556         * cs-parser.jay: Report 1518 (type declaration can only contain
20557         class, struct, interface, enum or delegate)
20558
20559         (switch_label): Report 1523 (keywords `case' or `default' must
20560         preced code)
20561
20562         (opt_switch_sections): Report 1522 (empty switch)
20563
20564         * driver.cs: Report 1515 (response file specified multiple times)
20565         Report 1516 (Source file specified multiple times).
20566
20567         * expression.cs (Argument.Resolve): Signal 1510
20568
20569         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20570         access not allowed in static code)
20571
20572 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20573
20574         * typemanager.cs (IsPointerType): Utility method which we are going
20575         to need a lot.
20576
20577         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20578         the object type, so we take care of that.
20579
20580         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20581
20582         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20583         added to non-params parameters :-)
20584
20585         * typemanager.cs (CSharpName): Include 'void' type too. 
20586
20587         (void_ptr_type): Include in the set of core types.
20588
20589         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20590         duplicating code.
20591
20592         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20593         an unsafe context.
20594
20595         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20596         completely forgotten about it.
20597
20598 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20599
20600         * cs-parser.jay (pointer_type): Add. This begins our implementation
20601         of parsing rules for unsafe code.
20602
20603         (unsafe_statement): Implement.
20604
20605         (embedded_statement): Modify to include the above.
20606
20607         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20608
20609         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20610         if the current context is an unsafe one.
20611
20612         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20613         are handled differently, we need separate rules for them.
20614
20615         (local_variable_declaration): Update to use local_variable_pointer_type
20616         to allow variable declarations of unmanaged pointer types.
20617
20618         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20619         in unsafe contexts.
20620
20621         * ../errors/cs0214.cs : Add.
20622
20623 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20624
20625         * makefile: remove 'response' file when cleaning.
20626
20627 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20628
20629         * cs-parser.jay: Report 1524.
20630
20631 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20632
20633         * typemanager.cs (RegisterMethod): drop checking if we have
20634         registered this from here
20635
20636 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20637
20638         * class.cs (Method.EmitDestructor): Implement calling our base
20639         destructor. 
20640
20641         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20642         value of InFinally.
20643
20644         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20645         this routine and will wrap the call in a try/catch block.  Deal
20646         with the case.
20647
20648 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20649
20650         * ecore.cs (Expression.MemberLookup): instead of taking a
20651         parameter `same_type' that was used to tell whether we could
20652         access private members we compute our containing type from the
20653         EmitContext.
20654
20655         (FieldExpr): Added partial support for volatile fields.  This does
20656         not work for volatile fields exposed from assemblies, as I can not
20657         figure out how to extract the modreq from it.
20658
20659         Updated all the source files to use this.
20660
20661         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20662         because it is referenced by MemberLookup very often. 
20663
20664 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20665
20666         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20667         TypeBuilder.GetCustomAttributes to retrieve what we need.
20668
20669         Get rid of redundant default_member_attr_type as this is the same as
20670         default_member_type which already exists.
20671
20672         * interface.cs, attribute.cs : Update accordingly.
20673
20674 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20675
20676         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20677         work for TYpeBuilders though.  Ravi, can you please fix this?
20678
20679         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20680
20681         * expression.cs (Argument.Emit): Handle the case of ref objects
20682         being passed to ref functions;  
20683
20684         (ParameterReference.EmitLoad): Loads the content of the pointer
20685         without dereferencing.
20686
20687 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20688
20689         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20690
20691 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20692
20693         * class.cs (Indexer.DefineMethod): Incorporate the interface
20694         type in the name of the method if we are doing explicit interface
20695         implementation.
20696
20697         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20698
20699         (BetterConversion): Fix extremely trivial bug where we were referring to
20700         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20701         again !
20702
20703         * ../errors/bug16.cs : Add although we have fixed it.
20704
20705 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20706
20707         * expression.cs (BaseIndexer): Begin implementation.
20708
20709         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20710
20711         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20712         production directly to remove a shift/reduce, and implement
20713         explicit interface implementation.
20714
20715         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20716         after a floating point suffix.
20717
20718         * expression.cs (DoNumericPromotions): Improved the conversion for
20719         uint/uint.  If we have a constant, we avoid doing a typecast to a
20720         larger type.
20721
20722         * class.cs (Indexer): Implement explicit interface implementation
20723         for indexers.
20724
20725 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20726
20727         * class.cs: make the default instance constructor public and hidebysig.
20728
20729 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20730
20731         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20732         so we can call it from elsewhere.
20733
20734         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20735         we emit it internally if the class has a defined indexer; otherwise the user
20736         emits it by decorating the class definition with the DefaultMemberAttribute.
20737
20738         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20739         attribute is not used on a type which defines an indexer.
20740
20741         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20742         character when we skip whitespace.
20743
20744         * ../errors/cs0646.cs : Add.
20745
20746 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20747
20748         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20749         again. 
20750
20751         * makefile: Add practical target `mcs3.exe' which builds the third
20752         generation compiler. 
20753
20754         * expression.cs (New): Fix structures constructor calling.
20755
20756         * class.cs (Property, Method, Indexer): Emit Final flag on the
20757         method if we are an interface implementation and we are not
20758         abstract. 
20759
20760         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20761         whether this property is referencing a `base' method.
20762
20763         * expression.cs (Invocation.EmitCall): take an extra argument:
20764         is_base, this is used to determine whether the `call' or
20765         `callvirt' opcode should be used.
20766
20767
20768         * delegate.cs: update EmitCall.
20769
20770         * class.cs (Method.Define): Set NewSlot for the cases where we are
20771         not implementing an interface method.
20772
20773         (Property.Define): ditto.
20774
20775 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20776
20777         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20778         'r'.  Allows mcs to parse itself fully.
20779
20780 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20781
20782         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20783         of the number of initializers that require the InitializeArray method.
20784
20785         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20786         update the above field where necessary.
20787
20788         (MakeByteBlob): Update accordingly.
20789
20790         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20791         greater than 2.
20792
20793         (EmitDynamicInitializers): Update in accordance with the new optimization.
20794
20795         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20796         same OpCode applies.
20797
20798         * cs-parser.jay : Fix some glaring errors I introduced.
20799
20800 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20801
20802         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20803         so that we can check for name clashes there too.
20804
20805         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20806         for interface indexers.
20807
20808         * interfaces.cs (Define): Emit the default member attribute.
20809
20810         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20811         variable was being referred to while setting the value ;-)
20812
20813 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20814
20815         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20816         byte-by-byte information when we know the data is zero.
20817
20818         Make the block always a multiple of 4, because
20819         DefineInitializedData has a bug.
20820
20821         * assign.cs: Fix, we should assign from the temporary, not from
20822         the source. 
20823
20824         * expression.cs (MakeByteBlob): Fix my incorrect code.
20825
20826 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20827
20828         * typemanager.cs (EnumToUnderlying): This function is used to get
20829         the underlying type from an enumeration, because it does not
20830         always work. 
20831
20832         * constant.cs: Use the I4_S form for values between -128 and 127.
20833
20834         * statement.cs (Block.LookupLabel): Looks up a label.
20835         (Block): Drop support for labeled blocks.
20836
20837         (LabeledStatement): New kind of statement that represents a label
20838         only.
20839
20840         (Goto): Finally implement this bad boy.
20841
20842         * cs-parser.jay: Update to reflect new mechanism to implement
20843         labels.
20844
20845 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20846
20847         * codegen.cs (EmitContext.This): a codegen property that keeps the
20848         a single instance of this instead of creating many different this
20849         instances. 
20850
20851         * delegate.cs (Delegate.DoResolve): Update to use the property;
20852
20853         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20854
20855         * expression.cs (BaseAccess.DoResolve): Ditto.
20856
20857 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20858
20859         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20860         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20861
20862         (InitCoreTypes): Update accordingly.
20863
20864         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20865         so we can quickly store the state.
20866
20867         (ApplyAttributes): Set the correct implementation flags
20868         for InternalCall methods.
20869
20870 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20871
20872         * expression.cs (EmitCall): if a method is not virtual, then do
20873         not use callvirt on it.
20874
20875         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20876         user defined stuff) requires the use of stobj, which takes an
20877         address on the stack instead of an array and an index.  So emit
20878         the Ldelema operation for it.
20879
20880         (EmitStoreOpcode): Use stobj for valuetypes.
20881
20882         (UnaryMutator.EmitCode): Use the right 1 value depending on
20883         whether we are dealing with int64/uint64, float or doubles.
20884
20885         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20886         constructors that I implemented last night.
20887
20888         (Constructor.IsDefault): Fix to work properly for static
20889         constructors.
20890
20891         * cs-parser.jay (CheckDef): report method signature errors.
20892         Update error number 103 to be 132.
20893
20894         * decl.cs: New AdditionResult enumeration value: MethodExists.
20895         Although we do this check for methods later on in the semantic
20896         analysis, catching repeated default constructors is so easy that
20897         we catch these here. 
20898
20899         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20900         promotions code.
20901
20902         (ParameterReference.EmitAssign, Emit): handle
20903         bools as bytes.
20904
20905         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20906         (ArrayAccess.EmitStoreOpcode): ditto.
20907
20908         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20909
20910         * expression.cs (MakeByteBlob): Complete all the missing types
20911         (uint, short, ushort, byte, sbyte)
20912
20913         * class.cs: Only init instance field initializers on instance
20914         constructors. 
20915
20916         Rename `constructors' to instance_constructors. 
20917
20918         (TypeContainer.AddConstructor): Only add constructors to the list
20919         if it is not static.
20920
20921         Make sure that we handle default_static_constructor independently
20922         everywhere where we handle instance_constructors
20923
20924 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20925
20926         * class.cs: Do not lookup or create a base initializer for a
20927         static constructor.
20928
20929         (ConstructorInitializer.Resolve): use the proper type to lookup
20930         for constructors.
20931
20932         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20933
20934         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20935         in DeclSpace. 
20936
20937         * decl.cs: CloseType is now an virtual method, the default
20938         implementation just closes this type.
20939
20940 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20941
20942         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20943         to PreserveSig by default. Also emit HideBySig on such methods.
20944
20945         Basically, set the defaults to standard values.
20946
20947         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20948         argument, if candidate is better, it can't be worse than the best !
20949
20950         (Invocation): Re-write bits to differentiate between methods being
20951         applicable in their expanded form and their normal form - for params
20952         methods of course.
20953
20954         Get rid of use_standard everywhere as only standard conversions are allowed
20955         in overload resolution. 
20956
20957         More spec conformance.
20958
20959 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20960
20961         * driver.cs: Add --timestamp, to see where the compiler spends
20962         most of its time.
20963
20964         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20965         `this' in static code.
20966
20967         (SimpleName.DoResolve): Implement in terms of a helper function
20968         that allows static-references to be passed upstream to
20969         MemberAccess.
20970
20971         (Expression.ResolveWithSimpleName): Resolve specially simple
20972         names when called by MemberAccess to implement the special
20973         semantics. 
20974
20975         (Expression.ImplicitReferenceConversion): Handle conversions from
20976         Null to reference types before others, as Null's type is
20977         System.Object. 
20978
20979         * expression.cs (Invocation.EmitCall): Handle the special case of
20980         calling methods declared on a reference type from a ValueType
20981         (Base classes System.Object and System.Enum)
20982
20983         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20984         the left hand side is a TypeExpr, not on every enumeration. 
20985
20986         (Binary.Resolve): If types are reference types, then do a cast to
20987         object on operators != and == of both arguments.
20988
20989         * typemanager.cs (FindMembers): Extract instance and static
20990         members if requested.
20991
20992         * interface.cs (PopulateProperty): Use void_type instead of null
20993         as the return type for the setter method.
20994
20995         (PopulateIndexer): ditto.
20996
20997 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20998
20999         * support.cs (ReflectionParameters): Fix minor bug where we
21000         were examining the wrong parameter for the ParamArray attribute.
21001
21002         Cope with requests for the type of the parameter at position
21003         greater than the params parameter's. We now return the element
21004         type of the params array as that makes more sense.
21005
21006         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21007         accordingly as we no longer have to extract the element type
21008         ourselves.
21009
21010         (Invocation.OverloadResolve): Update.
21011
21012 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21013
21014         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21015         against IEnumerator, test whether the return value is a descendant
21016         of the IEnumerator interface.
21017
21018         * class.cs (Indexer.Define): Use an auxiliary method to implement
21019         the other bits of the method definition.  Begin support for
21020         explicit interface implementation.
21021
21022         (Property.DefineMethod): Use TypeManager.void_type instead of null
21023         for an empty return value.
21024
21025 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21026
21027         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21028         dealing with a FieldExpr which is composed of a FieldBuilder, in
21029         the code path we did extract the constant, but we should have
21030         obtained the underlying value to be able to cast it (otherwise we
21031         end up in an infinite loop, this is what Ravi was running into).
21032
21033         (ArrayCreation.UpdateIndices): Arrays might be empty.
21034
21035         (MemberAccess.ResolveMemberAccess): Add support for section
21036         14.5.4.1 that deals with the special case of E.I when E is a type
21037         and something else, that I can be a reference to a static member.
21038
21039         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21040         handle a particular array type to create byte blobs, it is just
21041         something we dont generate byteblobs for.
21042
21043         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21044         arguments. 
21045
21046         * location.cs (Push): remove the key from the hashtable that we
21047         are about to add.   This happens for empty files.
21048
21049         * driver.cs: Dispose files after we have parsed them.
21050
21051         (tokenize): new function that only runs the tokenizer on its
21052         input, for speed testing.
21053
21054 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21055
21056         * class.cs (Event.Define): Define the private field only if there
21057         are no accessors defined.
21058
21059         * expression.cs (ResolveMemberAccess): If there is no associated
21060         field with the event, that means we have an event defined with its
21061         own accessors and we should flag error cs0070 since transforming
21062         ourselves into a field is not valid in that case.
21063
21064         * ecore.cs (SimpleName.DoResolve): Same as above.
21065
21066         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21067         and charset to sane values.
21068
21069 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21070
21071         * assign.cs (DoResolve): Perform check on events only if they 
21072         are being accessed outside the declaring type.
21073
21074         * cs-parser.jay (event_declarations): Update rules to correctly
21075         set the type of the implicit parameter etc.
21076
21077         (add_accessor, remove_accessor): Set current local parameters.
21078
21079         * expression.cs (Binary): For delegate addition and subtraction,
21080         cast the return value from the method into the appropriate delegate
21081         type.
21082
21083 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21084
21085         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21086         of these as the workaround is unnecessary.
21087
21088         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21089         delegate data - none of that is needed at all.
21090
21091         Re-write bits to extract the instance expression and the delegate method
21092         correctly.
21093
21094         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21095         on delegates too.
21096
21097         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21098         of attaching attributes instead of duplicating code everywhere.
21099
21100         * everywhere : Update code to do attribute emission using the above method.
21101
21102 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21103
21104         * expression.cs (IsParamsMethodApplicable): if there are not
21105         parameters, return immediately.
21106
21107         * ecore.cs: The 0 literal can be implicity converted to an enum
21108         type. 
21109
21110         (SimpleName.DoResolve): First lookup the type, then lookup the
21111         members. 
21112
21113         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21114         want to get its address.  If the InstanceExpression is not
21115         addressable, store the result in a temporary variable, then get
21116         the address of it.
21117
21118         * codegen.cs: Only display 219 errors on warning level or above. 
21119
21120         * expression.cs (ArrayAccess): Make it implement the
21121         IMemoryLocation interface.
21122
21123         (Binary.DoResolve): handle the operator == (object a, object b)
21124         and operator != (object a, object b) without incurring into a
21125         BoxedCast (because 5 != o should never be performed).
21126
21127         Handle binary enumerator operators.
21128
21129         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21130         value type, otherwise use Ldelem_ref.
21131
21132         Use precomputed names;
21133
21134         (AddressOf): Implement address of
21135
21136         * cs-parser.jay (labeled_statement): Fix recursive block
21137         addition by reworking the production.
21138
21139         * expression.cs (New.DoEmit): New has a special case:
21140                 
21141                  If we are dealing with a ValueType, we have a few
21142                  situations to deal with:
21143                 
21144                     * The target of New is a ValueType variable, that is
21145                       easy, we just pass this as the variable reference
21146                 
21147                     * The target of New is being passed as an argument,
21148                       to a boxing operation or a function that takes a
21149                       ValueType.
21150                 
21151                       In this case, we need to create a temporary variable
21152                       that is the argument of New.
21153
21154
21155 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21156
21157         * rootcontext.cs (LookupType): Check that current_type is not null before
21158         going about looking at nested types.
21159
21160         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21161         not implement the IAssignMethod interface any more.
21162
21163         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21164         where we tranform them into FieldExprs if they are being resolved from within
21165         the declaring type.
21166
21167         * ecore.cs (SimpleName.DoResolve): Do the same here.
21168
21169         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21170
21171         * ../errors/bug10.cs : Add.
21172
21173         * ../errors/cs0070.cs : Add.
21174
21175         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21176
21177         * assign.cs : Get rid of EventIsLocal everywhere.
21178
21179 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21180
21181         * ecore.cs (ConvertIntLiteral): finished the implementation.
21182
21183         * statement.cs (SwitchLabel): Convert the value we are using as a
21184         key before looking up the table.
21185
21186 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21187
21188         * codegen.cs (EmitTopBlock): Require a Location argument now.
21189
21190         * cs-parser.jay (constructor_declarator): We need to setup
21191         current_local_parameters before we parse the
21192         opt_constructor_initializer, to allow the variables to be bound
21193         to the constructor arguments.
21194
21195         * rootcontext.cs (LookupType): First lookup nested classes in our
21196         class and our parents before we go looking outside our class.
21197
21198         * expression.cs (ConstantFold): Extract/debox the values at the
21199         beginnning. 
21200
21201         * rootcontext.cs (EmitCode): Resolve the constants first before we
21202         resolve the types.  This is not really needed, but it helps debugging.
21203
21204         * statement.cs: report location.
21205
21206         * cs-parser.jay: pass location to throw statement.
21207
21208         * driver.cs: Small bug fix.
21209
21210         * report.cs: Updated format to be 4-zero filled digits.
21211
21212 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21213
21214         * expression.cs (CheckIndices): Fix minor bug where the wrong
21215         variable was being referred to ;-)
21216
21217         (DoEmit): Do not call EmitStaticInitializers when the 
21218         underlying type is System.Object.
21219
21220 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21221
21222         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21223         and do the usual workaround for SRE.
21224
21225         * class.cs (MyEventBuilder.EventType): New member to get at the type
21226         of the event, quickly.
21227
21228         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21229
21230         * assign.cs (Assign.DoResolve): Handle the case when the target
21231         is an EventExpr and perform the necessary checks.
21232
21233         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21234         interface.
21235
21236         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21237
21238         (EventExpr): Set the type in the constructor itself since we 
21239         are meant to be born fully resolved.
21240
21241         (EventExpr.Define): Revert code I wrote earlier.
21242                 
21243         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21244         instance expression is null. The instance expression is a This in that case
21245         or a null, depending on whether it is a static method or not.
21246
21247         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21248         refers to more than one method.
21249
21250         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21251         and accordingly flag errors.
21252
21253 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21254
21255         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21256
21257 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21258
21259         * location.cs (ToString): Provide useful rutine.
21260
21261 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21262
21263         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21264         objects, return the actual integral boxed.
21265
21266         * statement.cs (SwitchLabel): define an ILLabel for each
21267         SwitchLabel. 
21268
21269         (Switch.CheckSwitch): If the value is a Literal, extract
21270         the underlying literal.
21271
21272         Also in the unused hashtable we had, add the SwitchLabel so we can
21273         quickly look this value up.
21274
21275         * constant.cs: Implement a bunch of new constants.  Rewrite
21276         Literal based on this.  Made changes everywhere to adapt to this.
21277
21278         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21279         dereferencing array only once, and also copes with enumrations.
21280
21281         bytes are two bytes wide, not one.
21282
21283         (Cast): Perform constant conversions.
21284
21285         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21286         wrappers to the literals here.
21287
21288         * expression.cs (DoNumericPromotions): long literals can converted
21289         to ulong implicity (this is taken care of elsewhere, but I was
21290         missing this spot).
21291
21292         * ecore.cs (Expression.Literalize): Make the return type Literal,
21293         to improve type checking.
21294
21295         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21296
21297 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21298
21299         * literal.cs: Revert code from ravi that checked the bounds.  The
21300         bounds are sane by the definition of the type itself. 
21301
21302         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21303         need to actually look up in our parent hierarchy for interfaces
21304         implemented. 
21305
21306         * const.cs: Use the underlying type for enumerations
21307
21308         * delegate.cs: Compute the basename for the delegate creation,
21309         that should fix the delegate test case, and restore the correct
21310         Type Lookup semantics in rootcontext
21311
21312         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21313         referencing a nested type with the Reflection API is using the "+"
21314         sign. 
21315
21316         * cs-parser.jay: Do not require EOF token at the end.
21317
21318 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21319
21320         * rootcontext.cs (LookupType): Concatenate type names with
21321         a '.' instead of a '+' The test suite passes again.
21322
21323         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21324         field of the enumeration.
21325
21326         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21327         the case when the member is an EventExpr.
21328
21329         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21330         static has an associated instance expression.
21331
21332         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21333
21334         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21335
21336         * class.cs (Event.Define): Register event and perform appropriate checks
21337         for error #111.
21338
21339         We define the Add and Remove methods even if the use provides none because
21340         in that case, we provide default implementations ourselves.
21341
21342         Define a private field of the type of the event. This is done by the CSC compiler
21343         and we should be doing it too ;-)
21344
21345         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21346         More methods we use in code we generate.
21347
21348         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21349         is important.
21350
21351         (InitCoreTypes): Update accordingly for the above.
21352
21353         * class.cs (Event.Emit): Generate code for default accessors that we provide
21354
21355         (EmitDefaultMethod): Do the job in the above.
21356
21357         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21358         appropriate place.
21359
21360 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21361
21362         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21363         builders even if we were missing one.
21364
21365         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21366         pass the Basename as our class name instead of the Name.  The
21367         basename will be correctly composed for us.
21368
21369         * parameter.cs (Paramters): Now takes a Location argument.
21370
21371         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21372         make all the code call directly LookupType in RootContext and take
21373         this chance to pass the Location information everywhere.
21374
21375         * Everywhere: pass Location information.
21376
21377 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21378
21379         * class.cs (Constructor.Define): Updated way of detecting the
21380         length of the parameters.
21381
21382         (TypeContainer.DefineType): Use basename as the type name for
21383         nested types.
21384
21385         (TypeContainer.Define): Do not recursively define types here, as
21386         definition is taken care in order by the RootContext.
21387
21388         * tree.cs: Keep track of namespaces in a per-file basis.
21389
21390         * parameter.cs (Parameter.ComputeSignature): Update to use
21391         DeclSpace. 
21392
21393         (Parameters.GetSignature): ditto.
21394
21395         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21396         instead of a TypeContainer.
21397
21398         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21399         resolve names.  Because we need to be resolve in our context, not
21400         our parents.
21401
21402         * driver.cs: Implement response files.
21403
21404         * class.cs (TypeContainer.DefineType): If we are defined, do not
21405         redefine ourselves.
21406
21407         (Event.Emit): Emit the code for add/remove handlers.
21408         (Event.Define): Save the MethodBuilders for add/remove.
21409
21410         * typemanager.cs: Use pair here too.
21411
21412         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21413         DictionaryEntry requires the first argument to be non-null.  
21414
21415         (enum_declaration): Compute full name for registering the
21416         enumeration.
21417
21418         (delegate_declaration): Instead of using
21419         formal_parameter_list, use opt_formal_parameter_list as the list
21420         can be empty.
21421
21422         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21423         (EventParsing): New property that controls whether `add' and
21424         `remove' are returned as tokens or identifiers (for events);
21425
21426 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21427
21428         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21429         use MyEventBuilder only and let it wrap the real builder for us.
21430
21431         (MyEventBuilder): Revamp constructor etc.
21432
21433         Implement all operations that we perform on EventBuilder in precisely the same
21434         way here too.
21435
21436         (FindMembers): Update to use the EventBuilder member.
21437
21438         (Event.Emit): Update accordingly.
21439
21440 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21441
21442         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21443         by calling the appropriate methods.
21444
21445         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21446         useful.
21447
21448         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21449
21450 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21451
21452         * delegate.cs (Delegate.Populate): Check that the return type
21453         and various parameters types are indeed accessible.
21454
21455         * class.cs (Constructor.Define): Same here.
21456
21457         (Field.Define): Ditto.
21458
21459         (Event.Define): Ditto.
21460
21461         (Operator.Define): Check that the underlying Method defined itself
21462         correctly - so it's MethodBuilder should not be null.
21463
21464         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21465         expression happens to be null.
21466
21467         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21468         members but as of now we don't seem to be able to do anything really useful with it.
21469
21470         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21471         not the EventBuilder.
21472
21473 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21474
21475         * cs-tokenizer.cs: Add support for defines.
21476         Add support for #if, #elif, #else, #endif
21477
21478         (eval_var): evaluates a variable.
21479         (eval): stubbed for evaluating functions.
21480
21481         * cs-parser.jay: Pass the defines information
21482
21483         * driver.cs: Add --define command line option.
21484
21485         * decl.cs: Move MemberCore here.
21486
21487         Make it the base class for DeclSpace.  This allows us to catch and
21488         report 108 and 109 for everything now.
21489
21490         * class.cs (TypeContainer.Define): Extract all the members
21491         before populating and emit the warning 108 (new keyword required
21492         to override) instead of having each member implement this.
21493
21494         (MemberCore.Define): New abstract method, we will be using this in
21495         the warning reporting engine in Populate.
21496
21497         (Operator.Define): Adjust to new MemberCore protocol. 
21498
21499         * const.cs (Const): This does not derive from Expression, it is a
21500         temporary object we use to create fields, it is a MemberCore. 
21501
21502         * class.cs (Method.Define): Allow the entry point to be in a
21503         specific class.
21504
21505         * driver.cs: Rewrite the argument handler to clean it up a bit.
21506
21507         * rootcontext.cs: Made it just an auxiliary namespace feature by
21508         making everything static.
21509
21510         * driver.cs: Adapt code to use RootContext type name instead of
21511         instance variable.
21512
21513         * delegate.cs: Remove RootContext argument.
21514
21515         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21516         argument. 
21517
21518         * class.cs (Event.Define): The lookup can fail.
21519
21520         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21521
21522         * expression.cs: Resolve the this instance before invoking the code.
21523
21524 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21525
21526         * cs-parser.jay: Add a production in element_access that allows
21527         the thing to become a "type" reference.  This way we can parse
21528         things like "(string [])" as a type.
21529
21530         Note that this still does not handle the more complex rules of
21531         casts. 
21532
21533
21534         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21535
21536         * ecore.cs: (CopyNewMethods): new utility function used to
21537         assemble the list of methods from running FindMembers.
21538
21539         (MemberLookup): Rework FindMembers so that 
21540
21541 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21542
21543         * class.cs (TypeContainer): Remove Delegates who fail to be
21544         defined.
21545
21546         * delegate.cs (Populate): Verify that we dont get null return
21547         values.   TODO: Check for AsAccessible.
21548
21549         * cs-parser.jay: Use basename to emit error 574 (destructor should
21550         have the same name as container class), not the full name.
21551
21552         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21553         possible representation.  
21554
21555         Also implements integer type suffixes U and L.
21556
21557 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21558
21559         * expression.cs (ArrayCreation.DoResolve): We need to do the
21560         argument resolution *always*.
21561
21562         * decl.cs: Make this hold the namespace.  Hold the root context as
21563         well.
21564         (LookupType): Move here.
21565
21566         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21567
21568         * location.cs (Row, Name): Fixed the code, it was always returning
21569         references to the first file.
21570
21571         * interface.cs: Register properties defined through interfaces.
21572
21573         * driver.cs: Add support for globbing on the command line
21574
21575         * class.cs (Field): Make it derive from MemberCore as well.
21576         (Event): ditto.
21577
21578 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21579
21580         * class.cs (Event::Define): Check that the type of the event is a delegate
21581         type else flag error #66.
21582
21583         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21584         same.
21585
21586         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21587         values of EntryPoint, CharSet etc etc.
21588
21589         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21590
21591         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21592         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21593         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21594         which needs this to do its work.
21595
21596         * ../errors/cs0066.cs : Add.
21597
21598 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21599
21600         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21601         helper functions.
21602
21603         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21604         clears out the parameters field.
21605         (MemberSignatureCompare): Cleanup
21606
21607         (MemberCore): New base class used to share code between MethodCore
21608         and Property.
21609
21610         (RegisterRequiredImplementations) BindingFlags.Public requires
21611         either BindingFlags.Instace or Static.  Use instance here.
21612
21613         (Property): Refactored code to cope better with the full spec.
21614
21615         * parameter.cs (GetParameterInfo): Return an empty array instead
21616         of null on error.
21617
21618         * class.cs (Property): Abstract or extern properties have no bodies.
21619
21620         * parameter.cs (GetParameterInfo): return a zero-sized array.
21621
21622         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21623         method modifier validation to the typecontainer so we can reuse
21624         this on properties.
21625
21626         (MethodCore.ParameterTypes): return an empty sized array of types.
21627
21628         (Property.Define): Test property modifier validity.
21629
21630         Add tests for sealed/override too.
21631
21632         (Method.Emit): abstract or extern methods have no bodies.
21633
21634 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21635
21636         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21637         thing.
21638
21639         (Method::Define, ::Emit): Modify accordingly.
21640
21641         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21642
21643         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21644
21645         * makefile: Pass in /unsafe.
21646
21647 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21648
21649         * class.cs (MakeKey): Kill routine.
21650
21651         * class.cs (TypeContainer.Define): Correctly define explicit
21652         method implementations (they require the full interface name plus
21653         the method name).
21654
21655         * typemanager.cs: Deply the PtrHashtable here and stop using the
21656         lame keys.  Things work so much better.
21657
21658         This of course broke everyone who depended on `RegisterMethod' to
21659         do the `test for existance' test.  This has to be done elsewhere.
21660
21661         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21662         the object stupid Equals method (because, that like fails all over
21663         the place).  We still do not use it.
21664
21665         * class.cs (TypeContainer.SetRequiredInterface,
21666         TypeContainer.RequireMethods): Killed these two routines and moved
21667         all the functionality to RegisterRequiredImplementations.
21668
21669         (TypeContainer.RegisterRequiredImplementations): This routine now
21670         registers all the implementations required in an array for the
21671         interfaces and abstract methods.  We use an array of structures
21672         which can be computed ahead of time to reduce memory usage and we
21673         also assume that lookups are cheap as most classes will not
21674         implement too many interfaces.
21675
21676         We also avoid creating too many MethodSignatures.
21677
21678         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21679         clear the "pending" bit if we find that there are problems with
21680         the declaration.
21681
21682         (TypeContainer.VerifyPendingMethods): Update to report errors of
21683         methods that look like implementations but are not.
21684
21685         (TypeContainer.Define): Add support for explicit interface method
21686         implementation. 
21687
21688 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21689
21690         * typemanager.cs: Keep track of the parameters here instead of
21691         being a feature of the TypeContainer.
21692
21693         * class.cs: Drop the registration of parameters here, as
21694         InterfaceMethods are also interface declarations.
21695
21696         * delegate.cs: Register methods with the TypeManager not only with
21697         the TypeContainer.  This code was buggy.
21698
21699         * interface.cs: Full registation here.
21700
21701 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21702
21703         * expression.cs: Remove reducer for binary expressions, it can not
21704         be done this way.
21705
21706         * const.cs: Put here the code that used to go into constant.cs
21707
21708         * constant.cs: Put here the code for constants, this is a new base
21709         class for Literals.
21710
21711         * literal.cs: Make Literal derive from Constant.
21712
21713 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21714
21715         * statement.cs (Return.Emit): Report error 157 if the user
21716         attempts to return from a finally block.
21717
21718         (Return.Emit): Instead of emitting a return, jump to the end of
21719         the function.
21720
21721         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21722         LocalBuilder to store the result of the function.  ReturnLabel is
21723         the target where we jump.
21724
21725
21726 2001-12-09  Radek Doulik  <rodo@ximian.com>
21727
21728         * cs-parser.jay: remember alias in current namespace
21729
21730         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21731         namespaces
21732
21733         * class.cs (LookupAlias): lookup alias in my_namespace
21734
21735         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21736         aliases hashtable
21737         (LookupAlias): lookup alias in this and if needed in parent
21738         namespaces
21739
21740 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21741
21742         * support.cs: 
21743
21744         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21745         making things static.  I need this to avoid passing the
21746         TypeContainer when calling ParameterType.
21747
21748         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21749         that did string manipulation to compute the type and then call
21750         GetType.  Use Parameter.ParameterType instead.
21751
21752         * cs-tokenizer.cs: Consume the suffix for floating values.
21753
21754         * expression.cs (ParameterReference): figure out whether this is a
21755         reference parameter or not.  Kill an extra variable by computing
21756         the arg_idx during emission.
21757
21758         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21759         function that returns whether a parameter is an out/ref value or not.
21760
21761         (Parameter.ParameterType): The type of the parameter (base,
21762         without ref/out applied).
21763
21764         (Parameter.Resolve): Perform resolution here.
21765         (Parameter.ExternalType): The full type (with ref/out applied).
21766
21767         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21768         support for expressions on the using statement.
21769
21770 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21771
21772         * statement.cs (Using.EmitLocalVariableDecls): Split the
21773         localvariable handling of the using statement.
21774
21775         (Block.EmitMeta): Keep track of variable count across blocks.  We
21776         were reusing slots on separate branches of blocks.
21777
21778         (Try.Emit): Emit the general code block, we were not emitting it. 
21779
21780         Check the type of the declaration to be an IDisposable or
21781         something that can be implicity converted to it. 
21782
21783         Emit conversions if required.
21784
21785         * ecore.cs (EmptyExpression): New utility class.
21786         (Expression.ImplicitConversionExists): New utility function.
21787
21788 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21789
21790         * statement.cs (Using): Implement.
21791
21792         * expression.cs (LocalVariableReference): Support read only variables.
21793
21794         * statement.cs: Remove the explicit emit for the Leave opcode.
21795         (VariableInfo): Add a readonly field.
21796
21797 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21798
21799         * ecore.cs (ConvCast): new class used to encapsulate the various
21800         explicit integer conversions that works in both checked and
21801         unchecked contexts.
21802
21803         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21804         properly generate the overflow opcodes.
21805
21806 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21807
21808         * statement.cs: The correct type for the EmptyExpression is the
21809         element_type, not the variable type.  Ravi pointed this out.
21810
21811 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21812
21813         * class.cs (Method::Define): Handle PInvoke methods specially
21814         by using DefinePInvokeMethod instead of the usual one.
21815
21816         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21817         above to do the task of extracting information and defining the method.
21818
21819 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21820
21821         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21822         of the condition for string type.
21823
21824         (Emit): Move that here. 
21825
21826         (ArrayCreation::CheckIndices): Keep string literals in their expression
21827         form.
21828
21829         (EmitDynamicInitializers): Handle strings appropriately.
21830
21831 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21832
21833         * codegen.cs (EmitContext): Replace multiple variables with a
21834         single pointer to the current Switch statement.
21835
21836         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21837         EmitContext.
21838
21839 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21840
21841         * statement.cs 
21842
21843         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21844         default'.
21845
21846         (Foreach.Emit): Foreach on arrays was not setting
21847         up the loop variables (for break/continue).
21848
21849         (GotoCase): Semi-implented.
21850
21851 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21852
21853         * attribute.cs (CheckAttribute): Handle system attributes by using
21854         Attribute.GetAttributes to examine information we need.
21855
21856         (GetValidPlaces): Same here.
21857
21858         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21859
21860         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21861
21862         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21863
21864         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21865
21866         (Method::Emit): Handle the case when we are a PInvoke method.
21867
21868 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21869
21870         * expression.cs: Use ResolveWithSimpleName on compound names.
21871
21872 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21873
21874         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21875         before trying to reduce it.
21876
21877         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21878
21879         * constant.cs (LookupConstantValue): Implement.
21880
21881         (EmitConstant): Use the above in emitting the constant.
21882
21883         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21884         that are user-defined by doing a LookupConstantValue on them.
21885
21886         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21887         too, like above.
21888
21889 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21890
21891         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21892
21893         (BaseAccess.DoResolve): Implement.
21894
21895         (MemberAccess.DoResolve): Split this routine into a
21896         ResolveMemberAccess routine that can be used independently
21897
21898 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21899
21900         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21901         As that share bits of the implementation.  Is returns a boolean,
21902         while As returns the Type that is being probed.
21903
21904 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21905
21906         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21907         instead of a Literal - much easier.
21908
21909         (EnumInTransit): Remove - utterly useless :-)
21910
21911         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21912
21913         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21914
21915         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21916         chain when we have no associated expression.
21917
21918 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21919
21920         * constant.cs (Define): Use Location while reporting the errror.
21921
21922         Also emit a warning when 'new' is used and there is no inherited
21923         member to hide.
21924
21925         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21926         populated.
21927
21928         (LookupEnumValue): Implement to lookup an enum member's value and define it
21929         if necessary.
21930
21931         (Populate): Re-write accordingly to use the above routine.
21932
21933 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21934
21935         * expression.cs (This): Fix prototype for DoResolveLValue to
21936         override the base class DoResolveLValue.
21937
21938         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21939         declarations) 
21940
21941         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21942         (we need to load the address of the field here).  This fixes
21943         test-22. 
21944
21945         (FieldExpr.DoResolveLValue): Call the DoResolve
21946         function to initialize the Instance expression.
21947
21948         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21949         correctly the GetEnumerator operation on a value type.
21950
21951         * cs-parser.jay: Add more simple parsing error catches.
21952
21953         * statement.cs (Switch): Add support for string switches.
21954         Handle null specially.
21955
21956         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21957
21958 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21959
21960         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21961
21962         (declare_local_constant): New helper function.
21963
21964         * statement.cs (AddConstant): Keep a separate record of constants
21965
21966         (IsConstant): Implement to determine if a variable is a constant.
21967
21968         (GetConstantExpression): Implement.
21969
21970         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21971
21972         * statement.cs (IsVariableDefined): Re-write.
21973
21974 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21975
21976         * class.cs (TypeContainer::FindMembers): Look for constants
21977         in the case when we are looking for MemberTypes.Field
21978
21979         * expression.cs (MemberAccess::DoResolve): Check that in the
21980         case we are a FieldExpr and a Literal, we are not being accessed
21981         by an instance reference.
21982
21983         * cs-parser.jay (local_constant_declaration): Implement.
21984
21985         (declaration_statement): Implement for constant declarations.
21986
21987 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21988
21989         * statement.cs (Switch): Catch double defaults.
21990
21991         (Switch): More work on the switch() statement
21992         implementation.  It works for integral values now, need to finish
21993         string support.
21994
21995
21996 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21997
21998         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21999         integer literals into other integer literals.  To be used by
22000         switch. 
22001
22002 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22003
22004         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22005         some memory.
22006
22007         (EmitDynamicInitializers): Cope with the above since we extract data
22008         directly from ArrayData now.
22009
22010         (ExpectInitializers): Keep track of whether initializers are mandatory
22011         or not.
22012
22013         (Bounds): Make it a hashtable to prevent the same dimension being 
22014         recorded for every element in that dimension.
22015
22016         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22017         from being found.
22018
22019         Also fix bug which was causing the indices to be emitted in the reverse
22020         order.
22021
22022 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22023
22024         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22025         unfinished.  They do not work, because the underlying code is
22026         sloppy.
22027
22028 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22029
22030         * cs-parser.jay: Remove bogus fixme.
22031
22032         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22033         on Switch statement.
22034
22035 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22036
22037         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22038         the same. 
22039
22040         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22041         parameter. Apparently, any expression is allowed. 
22042
22043         (ValidateInitializers): Update accordingly.
22044
22045         (CheckIndices): Fix some tricky bugs thanks to recursion.
22046
22047         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22048         I was being completely brain-dead.
22049
22050         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22051         and re-write acordingly.
22052
22053         (DelegateInvocation): Re-write accordingly.
22054
22055         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22056
22057         (MakeByteBlob): Handle types more correctly.
22058
22059         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22060         initialization from expressions but it is incomplete because I am a complete
22061         Dodo :-|
22062
22063 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22064
22065         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22066         on If.  Basically, we have to return `true' (ie, we do return to
22067         our caller) only if both branches of the if return.
22068
22069         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22070         short-circuit operators, handle them as short circuit operators. 
22071
22072         (Cast.DoResolve): Resolve type.
22073         (Cast.Cast): Take an expression as the target type.
22074
22075         * cs-parser.jay (cast_expression): Remove old hack that only
22076         allowed a limited set of types to be handled.  Now we take a
22077         unary_expression and we resolve to a type during semantic
22078         analysis.
22079
22080         Use the grammar productions from Rhys to handle casts (this is
22081         not complete like Rhys syntax yet, we fail to handle that corner
22082         case that C# has regarding (-x), but we will get there.
22083
22084 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22085
22086         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22087         field which is an array type.
22088
22089         * cs-parser.jay (declare_local_variables): Support array initialization too.
22090
22091         * typemanager.cs (MakeKey): Implement.
22092
22093         (everywhere): Use the above appropriately.
22094
22095         * cs-parser.jay (for_statement): Update for array initialization while
22096         declaring variables.
22097
22098         * ecore.cs : The error message was correct, it's the variable's names that
22099         were misleading ;-) Make the code more readable.
22100
22101         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22102         the correct type etc.
22103
22104         (ConvertExplicit): Handle Enum types by examining the underlying type.
22105
22106 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22107
22108         * parameter.cs (GetCallingConvention): Always return
22109         CallingConventions.Standard for now.
22110
22111 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22112
22113         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22114         and `r' after calling DoNumericPromotions.
22115
22116         * ecore.cs: Fix error message (the types were in the wrong order).
22117
22118         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22119         BindingFlags.Instance as well 
22120
22121         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22122         implicit int literal conversion in an empty cast so that we
22123         propagate the right type upstream.
22124
22125         (UnboxCast): new class used to unbox value types.
22126         (Expression.ConvertExplicit): Add explicit type conversions done
22127         by unboxing.
22128
22129         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22130         the target type before applying the implicit LongLiterals to ULong
22131         literal cast.
22132
22133 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22134
22135         * cs-parser.jay (for_statement): Reworked the way For works: now
22136         we declare manually any variables that are introduced in
22137         for_initializer to solve the problem of having out-of-band code
22138         emition (that is what got for broken).
22139
22140         (declaration_statement): Perform the actual variable declaration
22141         that used to be done in local_variable_declaration here.
22142
22143         (local_variable_declaration): Do not declare anything, just pass
22144         the information on a DictionaryEntry
22145
22146 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22147
22148         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22149         re-write of the logic to now make it recursive.
22150
22151         (UpdateIndices): Re-write accordingly.
22152
22153         Store element data in a separate ArrayData list in the above methods.
22154
22155         (MakeByteBlob): Implement to dump the array data into a byte array.
22156
22157 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22158
22159         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22160         into CheckIndices.
22161
22162         * constant.cs (Define): Implement.
22163
22164         (EmitConstant): Re-write fully.
22165
22166         Pass in location info.
22167
22168         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22169         respectively.
22170
22171         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22172         DictionaryEntry since we need location info too.
22173
22174         (constant_declaration): Update accordingly.
22175
22176         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22177         code into another method : UpdateIndices.
22178
22179 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22180
22181         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22182         some type checking etc.
22183
22184 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22185
22186         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22187         bits to provide dimension info if the user skips doing that.
22188
22189         Update second constructor to store the rank correctly.
22190
22191 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22192
22193         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22194         and try to implement.
22195
22196         * ../errors/cs0150.cs : Add.
22197
22198         * ../errors/cs0178.cs : Add.
22199
22200 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22201
22202         * statement.cs: Implement foreach on multi-dimensional arrays. 
22203
22204         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22205         name of the params argument.
22206
22207         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22208         initializing the array.
22209
22210         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22211         we can use this elsewhere.
22212
22213         * statement.cs: Finish implementation of foreach for single
22214         dimension arrays.
22215
22216         * cs-parser.jay: Use an out-of-band stack to pass information
22217         around, I wonder why I need this.
22218
22219         foreach_block: Make the new foreach_block the current_block.
22220
22221         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22222         function used to return a static Parameters structure.  Used for
22223         empty parameters, as those are created very frequently.
22224
22225         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22226
22227 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22228
22229         * interface.cs : Default modifier is private, not public. The
22230         make verify test passes again.
22231
22232 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22233
22234         * support.cs (ReflectionParameters): Fix logic to determine
22235         whether the last parameter is a params one. Test 9 passes again.
22236
22237         * delegate.cs (Populate): Register the builders we define with
22238         RegisterParameterForBuilder. Test 19 passes again.
22239
22240         * cs-parser.jay (property_declaration): Reference $6 instead
22241         of $$ to get at the location.
22242
22243         (indexer_declaration): Similar stuff.
22244
22245         (attribute): Ditto.
22246
22247         * class.cs (Property): Register parameters for the Get and Set methods
22248         if they exist. Test 23 passes again.
22249
22250         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22251         call to EmitArguments as we are sure there aren't any params arguments. 
22252         Test 32 passes again.
22253
22254         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22255         IndexOutOfRangeException. 
22256
22257         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22258         Test 33 now passes again.
22259
22260 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22261
22262         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22263         broke a bunch of things.  Will have to come up with a better way
22264         of tracking locations.
22265
22266         * statement.cs: Implemented foreach for single dimension arrays.
22267
22268 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22269
22270         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22271         an error.  This removes the lookup from the critical path.
22272
22273         * cs-parser.jay: Removed use of temporary_loc, which is completely
22274         broken. 
22275
22276 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22277
22278         * support.cs (ReflectionParameters.ParameterModifier): Report
22279         whether the argument is a PARAMS argument or not.
22280
22281         * class.cs: Set the attribute `ParamArrayAttribute' on the
22282         parameter argument.
22283
22284         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22285         and cons_param_array_attribute (ConstructorInfo for
22286         ParamArrayAttribute)., 
22287
22288         * codegen.cs: Emit the return using the `Return' statement, that
22289         way we can report the error correctly for missing return values. 
22290
22291         * class.cs (Method.Emit): Clean up.
22292
22293         * expression.cs (Argument.Resolve): Take another argument: the
22294         location where this argument is used.  Notice that this is not
22295         part of the "Argument" class as to reduce the size of the
22296         structure (we know the approximate location anyways).
22297
22298         Test if the argument is a variable-reference, if not, then
22299         complain with a 206.
22300
22301         (Argument.Emit): Emit addresses of variables.
22302
22303         (Argument.FullDesc): Simplify.
22304
22305         (Invocation.DoResolve): Update for Argument.Resolve.
22306
22307         (ElementAccess.DoResolve): ditto.
22308
22309         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22310         method should be virtual, as this method is always virtual.
22311
22312         (NewDelegate.DoResolve): Update for Argument.Resolve.
22313
22314         * class.cs (ConstructorInitializer.DoResolve): ditto.
22315
22316         * attribute.cs (Attribute.Resolve): ditto.
22317
22318 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22319
22320         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22321
22322         * expression.cs (ParameterReference): Drop IStackStorage and implement
22323         IAssignMethod instead. 
22324
22325         (LocalVariableReference): ditto.
22326
22327         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22328         IAssignMethod instead. 
22329
22330 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22331
22332         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22333         enumerations that are used in heavily used structures derive from
22334         byte in a laughable and pathetic attempt to reduce memory usage.
22335         This is the kind of pre-optimzations that you should not do at
22336         home without adult supervision.
22337
22338         * expression.cs (UnaryMutator): New class, used to handle ++ and
22339         -- separatedly from the other unary operators.  Cleans up the
22340         code, and kills the ExpressionStatement dependency in Unary.
22341
22342         (Unary): Removed `method' and `Arguments' from this class, making
22343         it smaller, and moving it all to SimpleCall, so I can reuse this
22344         code in other locations and avoid creating a lot of transient data
22345         strucutres when not required.
22346
22347         * cs-parser.jay: Adjust for new changes.
22348
22349 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22350
22351         * enum.cs (Enum.Populate): If there is a failure during
22352         definition, return
22353
22354         * cs-parser.jay (opt_enum_base): we used to catch type errors
22355         here, but this is really incorrect.  The type error should be
22356         catched during semantic analysis.
22357
22358 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22359
22360         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22361         current_local_parameters as expected since I, in my stupidity, had forgotten
22362         to do this :-)
22363
22364         * attribute.cs (GetValidPlaces): Fix stupid bug.
22365
22366         * class.cs (Method::Emit): Perform check on applicability of attributes.
22367
22368         (Constructor::Emit): Ditto.
22369
22370         (Field::Emit): Ditto.
22371
22372         (Field.Location): Store location information.
22373
22374         (Property, Event, Indexer, Operator): Ditto.
22375
22376         * cs-parser.jay (field_declaration): Pass in location for each field.
22377
22378         * ../errors/cs0592.cs : Add.
22379
22380 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22381
22382         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22383
22384         (InitCoreTypes): Update accordingly.
22385
22386         (RegisterAttrType, LookupAttr): Implement.
22387
22388         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22389         info about the same.
22390
22391         (Resolve): Update to populate the above as necessary.
22392
22393         (Error592): Helper.
22394
22395         (GetValidPlaces): Helper to the above.
22396
22397         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22398
22399         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22400
22401 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22402
22403         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22404
22405         * ../errors/cs0617.cs : Add.
22406
22407 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22408
22409         * enum.cs (Emit): Rename to Populate to be more consistent with what
22410         we expect it to do and when exactly it is called.
22411
22412         * class.cs, rootcontext.cs : Update accordingly.
22413
22414         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22415         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22416
22417         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22418
22419         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22420         of a fieldinfo using the above, when dealing with a FieldBuilder.
22421
22422 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22423
22424         * ../errors/cs0031.cs : Add.
22425
22426         * ../errors/cs1008.cs : Add.
22427
22428         * ../errrors/cs0543.cs : Add.
22429
22430         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22431         enum type.
22432
22433         (FindMembers): Implement.
22434
22435         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22436         enums and delegates too.
22437
22438         (enum_types): Rename to builder_to_enum.
22439
22440         (delegate_types): Rename to builder_to_delegate.
22441
22442         * delegate.cs (FindMembers): Implement.
22443
22444 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22445
22446         * typemanager.cs (IsEnumType): Implement.
22447
22448         * enum.cs (Emit): Re-write parts to account for the underlying type
22449         better and perform checking etc.
22450
22451         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22452         of the underlying type.
22453
22454         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22455         value
22456
22457         * enum.cs (error31): Helper to report error #31.
22458
22459         * cs-parser.jay (enum_declaration): Store location of each member too.
22460
22461         * enum.cs (member_to_location): New hashtable. 
22462
22463         (AddEnumMember): Update location hashtable.
22464
22465         (Emit): Use the location of each member while reporting errors.
22466
22467 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22468
22469         * cs-parser.jay: A for_initializer if is a
22470         local_variable_declaration really ammount to have an implicit
22471         block with the variable declaration and no initializer for for.
22472
22473         * statement.cs (For.Emit): Cope with null initializers.
22474
22475         This fixes the infinite loop on for initializers.
22476
22477 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22478
22479         * enum.cs: More cleanup.
22480
22481         * ecore.cs: Remove dead code.
22482
22483         * class.cs (Property.Emit): More simplification.
22484         (Event.Emit): ditto.
22485
22486         Reworked to have less levels of indentation.
22487
22488 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22489
22490         * class.cs (Property): Emit attributes.
22491
22492         (Field): Ditto.
22493
22494         (Event): Ditto.
22495
22496         (Indexer): Ditto.
22497
22498         (Operator): Ditto.
22499
22500         * enum.cs (Emit): Ditto.
22501
22502         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22503         Enums too.
22504
22505         * class.cs (Field, Event, etc.): Move attribute generation into the
22506         Emit method everywhere.
22507
22508         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22509         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22510         as we had no way of defining nested enums !
22511
22512         * rootcontext.cs : Adjust code accordingly.
22513
22514         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22515
22516 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22517
22518         * expression.cs (EvalConstantExpression): Move into ecore.cs
22519
22520         * enum.cs (Enum): Rename some members and make them public and readonly
22521         according to our convention.
22522
22523         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22524         nothing else.
22525
22526         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22527
22528         (Enum::Emit): Write a simple version for now which doesn't try to compute
22529         expressions. I shall modify this to be more robust in just a while.
22530
22531         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22532
22533         (TypeContainer::CloseType): Create the Enum types too.
22534
22535         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22536
22537         * expression.cs (EvalConstantExpression): Get rid of completely.
22538
22539         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22540         user-defined values and other cases.
22541
22542         (IsValidEnumLiteral): Helper function.
22543
22544         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22545         out there in the case we had a literal FieldExpr.
22546
22547         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22548
22549         (Literalize): Revamp a bit to take two arguments.
22550
22551         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22552
22553 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22554
22555         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22556
22557         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22558
22559         (Resolve): Use the above to ensure we have proper initializers.
22560
22561 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22562
22563         * expression.cs (Expression::EvalConstantExpression): New method to 
22564         evaluate constant expressions.
22565
22566         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22567
22568 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22569
22570         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22571         in an array.
22572
22573         (Binary.ResolveOperator): Handle operator != (object a, object b)
22574         and operator == (object a, object b);
22575
22576         (Binary.DoNumericPromotions): Indicate whether the numeric
22577         promotion was possible.
22578
22579         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22580         Implement.  
22581
22582         Made the ArrayAccess implement interface IAssignMethod instead of
22583         IStackStore as the order in which arguments are passed reflects
22584         this.
22585
22586         * assign.cs: Instead of using expr.ExprClass to select the way of
22587         assinging, probe for the IStackStore/IAssignMethod interfaces.
22588
22589         * typemanager.cs: Load InitializeArray definition.
22590
22591         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22592         static data that can be used to initialize arrays. 
22593
22594 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22595
22596         * expression.cs: Handle operator== and operator!= for booleans.
22597
22598         (Conditioal.Reduce): Implement reducer for the ?: operator.
22599
22600         (Conditional.Resolve): Implement dead code elimination.
22601
22602         (Binary.Resolve): Catch string literals and return a new
22603         concatenated string.
22604
22605         (Unary.Reduce): Implement reduction of unary expressions.
22606
22607         * ecore.cs: Split out the expression core handling here.
22608
22609         (Expression.Reduce): New method used to perform constant folding
22610         and CSE.  This is needed to support constant-expressions. 
22611
22612         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22613         targets, and optimize for !x.
22614
22615 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22616
22617         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22618         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22619         set custom atttributes.
22620
22621         * literal.cs (Literal::GetValue): New abstract method to return the actual
22622         value of the literal, cast as an object.
22623
22624         (*Literal): Implement GetValue method.
22625
22626         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22627         expressions to the arraylist but objects of type Argument.
22628
22629         * class.cs (TypeContainer::Emit): Emit our attributes too.
22630
22631         (Method::Emit, Constructor::Emit): Ditto.
22632
22633         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22634         to be ignoring earlier.
22635
22636 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22637
22638         * attribute.cs (AttributeSection::Define): Implement to do the business
22639         of constructing a CustomAttributeBuilder.
22640
22641         (Attribute): New trivial class. Increases readability of code.  
22642
22643         * cs-parser.jay : Update accordingly.
22644
22645         (positional_argument_list, named_argument_list, named_argument): New rules
22646
22647         (attribute_arguments): Use the above so that we are more correct.
22648
22649 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22650
22651         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22652         to perform all checks for a method with a params parameter.
22653
22654         (Invocation::OverloadResolve): Update to use the above method and therefore
22655         cope correctly with params method invocations.
22656
22657         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22658         params too.
22659
22660         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22661         constructors in our parent too because we can't afford to miss out on 
22662         protected ones ;-)
22663
22664         * attribute.cs (AttributeSection): New name for the class Attribute
22665
22666         Other trivial changes to improve readability.
22667
22668         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22669         use the new class names.
22670
22671 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22672
22673         * class.cs (Method::Define): Complete definition for params types too
22674
22675         (Indexer::Define): Ditto.
22676
22677         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22678         Cope everywhere with a request for info about the array parameter.
22679
22680 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22681
22682         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22683
22684         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22685         local_variable_type to extract the string corresponding to the type.
22686
22687         (local_variable_type): Fixup the action to use the new helper method.
22688
22689         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22690         go.
22691
22692         * expression.cs : Clean out code which uses the above.
22693
22694 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22695
22696         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22697         and bale out if necessary by returning a false.
22698
22699         (RegisterProperty): Ditto.
22700
22701         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22702         and print out appropriate error messages.
22703
22704         * interface.cs (everywhere): Ditto.
22705
22706         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22707         location to constructor.
22708
22709         * class.cs (Property, Event, Indexer): Update accordingly.
22710
22711         * ../errors/cs111.cs : Added.
22712
22713         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22714         of a method, as laid down by the spec.
22715
22716         (Invocation::OverloadResolve): Use the above method.
22717
22718 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22719
22720         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22721         now take a TypeContainer and a Parameters object.
22722
22723         (ParameterData): Modify return type of ParameterModifier method to be 
22724         Parameter.Modifier and not a string.
22725
22726         (ReflectionParameters, InternalParameters): Update accordingly.
22727
22728         * expression.cs (Argument::GetParameterModifier): Same here.
22729
22730         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22731         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22732         symbol in it at all so maybe this is only for now.
22733
22734 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22735
22736         * support.cs (InternalParameters): Constructor now takes an extra argument 
22737         which is the actual Parameters class.
22738
22739         (ParameterDesc): Update to provide info on ref/out modifiers.
22740
22741         * class.cs (everywhere): Update call to InternalParameters to pass in
22742         the second argument too.
22743
22744         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22745         to return the modifier info [ref/out etc]
22746
22747         (InternalParameters, ReflectionParameters): Implement the above.
22748
22749         * expression.cs (Argument::ParameterModifier): Similar function to return
22750         info about the argument's modifiers.
22751
22752         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22753         too.
22754
22755         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22756         a new SetFormalParameters object which we pass to InternalParameters.
22757
22758 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22759
22760         * expression.cs (NewArray): Merge into the ArrayCreation class.
22761
22762 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22763
22764         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22765         NewUserdefinedArray into one as there wasn't much of a use in having
22766         two separate ones.
22767
22768         * expression.cs (Argument): Change field's name to ArgType from Type.
22769
22770         (Type): New readonly property which returns the proper type, taking into 
22771         account ref/out modifiers.
22772
22773         (everywhere): Adjust code accordingly for the above.
22774
22775         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22776         whether we are emitting for a ref or out parameter.
22777
22778         * expression.cs (Argument::Emit): Use the above field to set the state.
22779
22780         (LocalVariableReference::Emit): Update to honour the flag and emit the
22781         right stuff.
22782
22783         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22784
22785         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22786
22787         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22788
22789         (ReflectionParameters, InternalParameters): Implement the above method.
22790
22791         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22792         reporting errors.
22793
22794         (Invocation::FullMethodDesc): Ditto. 
22795
22796 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22797
22798         * cs-parser.jay: Add extra production for the second form of array
22799         creation. 
22800
22801         * expression.cs (ArrayCreation): Update to reflect the above
22802         change. 
22803
22804         * Small changes to prepare for Array initialization.
22805
22806 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22807
22808         * typemanager.cs (ImplementsInterface): interface might be null;
22809         Deal with this problem;
22810
22811         Also, we do store negative hits on the cache (null values), so use
22812         this instead of calling t.GetInterfaces on the type everytime.
22813
22814 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22815
22816         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22817
22818         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22819         split functionality out into different classes.
22820
22821         (New::FormArrayType): Move into NewBuiltinArray.
22822
22823         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22824         quite useless.
22825
22826         (NewBuiltinArray): New class to handle creation of built-in arrays.
22827
22828         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22829         account creation of one-dimensional arrays.
22830
22831         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22832
22833         (NewUserdefinedArray::DoResolve): Implement.
22834
22835         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22836
22837         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22838         we maintain inside the TypeManager. This is necessary to perform lookups on the
22839         module builder.
22840
22841         (LookupType): Update to perform GetType on the module builders too.     
22842
22843         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22844
22845         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22846
22847 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22848
22849         * expression.cs (New::DoResolve): Implement guts of array creation.
22850
22851         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22852
22853 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22854
22855         * expression.cs: Fix bug I introduced lsat night that broke
22856         Delegates. 
22857
22858         (Expression.Resolve): Report a 246 error (can not resolve name)
22859         if we find a SimpleName in the stream.
22860
22861         (Expression.ResolveLValue): Ditto.
22862
22863         (Expression.ResolveWithSimpleName): This function is a variant of
22864         ResolveName, this one allows SimpleNames to be returned without a
22865         warning.  The only consumer of SimpleNames is MemberAccess
22866
22867 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22868
22869         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22870         might arrive here.  I have my doubts that this is correct.
22871
22872         * statement.cs (Lock): Implement lock statement.
22873
22874         * cs-parser.jay: Small fixes to support `lock' and `using'
22875
22876         * cs-tokenizer.cs: Remove extra space
22877
22878         * driver.cs: New flag --checked, allows to turn on integer math
22879         checking. 
22880
22881         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22882         Threading.Monitor.Exit 
22883
22884 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22885
22886         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22887         Expression Class to be IndexerAccess.
22888
22889         Notice that Indexer::DoResolve sets the eclass to Value.
22890
22891 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22892
22893         * class.cs (TypeContainer::Emit): Emit code for indexers.
22894
22895         * assign.cs (IAssignMethod): New interface implemented by Indexers
22896         and Properties for handling assignment.
22897
22898         (Assign::Emit): Simplify and reuse code. 
22899
22900         * expression.cs (IndexerAccess, PropertyExpr): Implement
22901         IAssignMethod, clean up old code. 
22902
22903 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22904
22905         * typemanager.cs (ImplementsInterface): New method to determine if a type
22906         implements a given interface. Provides a nice cache too.
22907
22908         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22909         method.
22910
22911         (ConvertReferenceExplicit): Ditto.
22912
22913         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22914         various methods, with correct names etc.
22915
22916         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22917         Operator.UnaryNegation.
22918
22919         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22920         we have a unary plus or minus operator.
22921
22922         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22923         UnaryMinus.
22924
22925         * everywhere : update accordingly.
22926
22927         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22928         respectively.
22929
22930         * class.cs (Method::Define): For the case where we are implementing a method
22931         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22932         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22933
22934 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22935
22936         * interface.cs (FindMembers): Implement to work around S.R.E
22937         lameness.
22938
22939         * typemanager.cs (IsInterfaceType): Implement.
22940
22941         (FindMembers): Update to handle interface types too.
22942
22943         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22944         use IsAssignableFrom as that is not correct - it doesn't work.
22945
22946         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22947         and accordingly override EmitStatement.
22948
22949         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22950         using the correct logic :-)
22951
22952 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22953
22954         * ../errors/cs-11.cs : Add to demonstrate error -11 
22955
22956 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22957
22958         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22959         then pass this as a hint to ResolveLValue.
22960
22961         * expression.cs (FieldExpr): Add Location information
22962
22963         (FieldExpr::LValueResolve): Report assignment to readonly
22964         variable. 
22965
22966         (Expression::ExprClassFromMemberInfo): Pass location information.
22967
22968         (Expression::ResolveLValue): Add new method that resolves an
22969         LValue. 
22970
22971         (Expression::DoResolveLValue): Default invocation calls
22972         DoResolve. 
22973
22974         (Indexers): New class used to keep track of indexers in a given
22975         Type. 
22976
22977         (IStackStore): Renamed from LValue, as it did not really describe
22978         what this did.  Also ResolveLValue is gone from this interface and
22979         now is part of Expression.
22980
22981         (ElementAccess): Depending on the element access type
22982
22983         * typemanager.cs: Add `indexer_name_type' as a Core type
22984         (System.Runtime.CompilerServices.IndexerNameAttribute)
22985
22986         * statement.cs (Goto): Take a location.
22987
22988 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22989
22990         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22991         if two delegates are compatible.
22992
22993         (NewDelegate::DoResolve): Update to take care of the case when
22994         we instantiate a delegate from another delegate.
22995
22996         * typemanager.cs (FindMembers): Don't even try to look up members
22997         of Delegate types for now.
22998
22999 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23000
23001         * delegate.cs (NewDelegate): New class to take care of delegate
23002         instantiation.
23003
23004         * expression.cs (New): Split the delegate related code out into 
23005         the NewDelegate class.
23006
23007         * delegate.cs (DelegateInvocation): New class to handle delegate 
23008         invocation.
23009
23010         * expression.cs (Invocation): Split out delegate related code into
23011         the DelegateInvocation class.
23012
23013 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23014
23015         * expression.cs (New::DoResolve): Implement delegate creation fully
23016         and according to the spec.
23017
23018         (New::DoEmit): Update to handle delegates differently.
23019
23020         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23021         because of which we were printing out arguments in reverse order !
23022
23023         * delegate.cs (VerifyMethod): Implement to check if the given method
23024         matches the delegate.
23025
23026         (FullDelegateDesc): Implement.
23027
23028         (VerifyApplicability): Implement.
23029
23030         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23031         delegate invocations too.
23032
23033         (Invocation::Emit): Ditto.
23034
23035         * ../errors/cs1593.cs : Added.
23036
23037         * ../errors/cs1594.cs : Added.
23038
23039         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23040
23041 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23042
23043         * typemanager.cs (intptr_type): Core type for System.IntPtr
23044
23045         (InitCoreTypes): Update for the same.
23046
23047         (iasyncresult_type, asynccallback_type): Ditto.
23048
23049         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23050         correct.
23051
23052         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23053         too.
23054
23055         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23056         the builders for the 4 members of a delegate type :-)
23057
23058         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23059         type.
23060
23061         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23062
23063         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23064
23065 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23066
23067         * statement.cs (Break::Emit): Implement.   
23068         (Continue::Emit): Implement.
23069
23070         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23071         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23072         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23073         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23074         end loop
23075
23076         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23077         properties that track the label for the current loop (begin of the
23078         loop and end of the loop).
23079
23080 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23081
23082         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23083         use of emitting anything at all.
23084
23085         * class.cs, rootcontext.cs : Get rid of calls to the same.
23086
23087         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23088
23089         (Populate): Define the constructor correctly and set the implementation
23090         attributes.
23091
23092         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23093         have been defined.
23094
23095         (AddDelegateType): Implement.
23096
23097         (IsDelegateType): Implement helper method.
23098
23099         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23100
23101         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23102         and accordingly handle it.
23103
23104         * delegate.cs (Populate): Take TypeContainer argument.
23105         Implement bits to define the Invoke method. However, I still haven't figured out
23106         how to take care of the native int bit :-(
23107
23108         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23109         Qualify the name of the delegate, not its return type !
23110
23111         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23112         conversion.
23113
23114         (StandardConversionExists): Checking for array types turns out to be recursive.
23115
23116         (ConvertReferenceExplicit): Implement array conversion.
23117
23118         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23119
23120 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23121
23122         * cs-parser.jay (delegate_declaration): Store the fully qualified
23123         name as it is a type declaration.
23124
23125         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23126         readonly.
23127
23128         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23129         as TypeContainer::DefineType.
23130
23131         (Populate): Method in which all the definition of the various methods (Invoke)
23132         etc is done.
23133
23134         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23135         see.
23136
23137         (CloseDelegate): Finally creates the delegate.
23138
23139         * class.cs (TypeContainer::DefineType): Update to define delegates.
23140         (Populate, Emit and CloseType): Do the same thing here too.
23141
23142         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23143         delegates in all these operations.
23144
23145 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23146
23147         * expression.cs: LocalTemporary: a new expression used to
23148         reference a temporary that has been created.
23149
23150         * assign.cs: Handle PropertyAccess back here, so that we can
23151         provide the proper semantic access to properties.
23152
23153         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23154         a few more explicit conversions. 
23155
23156         * modifiers.cs: `NEW' modifier maps to HideBySig.
23157
23158         * expression.cs (PropertyExpr): Make this into an
23159         ExpressionStatement, and support the EmitStatement code path. 
23160
23161         Perform get/set error checking, clean up the interface.
23162
23163         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23164         them into toplevel access objects.
23165
23166 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23167
23168         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23169         SRE.
23170
23171         * typemanager.cs: Keep track here of our PropertyBuilders again to
23172         work around lameness in SRE.
23173
23174 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23175
23176         * expression.cs (LValue::LValueResolve): New method in the
23177         interface, used to perform a second resolution pass for LValues. 
23178
23179         (This::DoResolve): Catch the use of this in static methods.
23180
23181         (This::LValueResolve): Implement.
23182
23183         (This::Store): Remove warning, assigning to `this' in structures
23184         is 
23185
23186         (Invocation::Emit): Deal with invocation of
23187         methods on value types.  We need to pass the address to structure
23188         methods rather than the object itself.  (The equivalent code to
23189         emit "this" for structures leaves the entire structure on the
23190         stack instead of a pointer to it). 
23191
23192         (ParameterReference::DoResolve): Compute the real index for the
23193         argument based on whether the method takes or not a `this' pointer
23194         (ie, the method is static).
23195
23196         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23197         value types returned from functions when we need to invoke a
23198         method on the sturcture.
23199
23200
23201 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23202
23203         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23204         defining the type in the Modulebuilder or Typebuilder. This is to take
23205         care of nested types which need to be defined on the TypeBuilder using
23206         DefineNestedMethod.
23207
23208         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23209         methods in RootContext, only ported to be part of TypeContainer.
23210
23211         (TypeContainer::GetInterfaceOrClass): Ditto.
23212
23213         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23214
23215         * interface.cs (Interface::DefineInterface): New method. Does exactly
23216         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23217         too.
23218
23219         (Interface::GetInterfaces): Move from RootContext here and port.
23220
23221         (Interface::GetInterfaceByName): Same here.
23222
23223         * rootcontext.cs (ResolveTree): Re-write.
23224
23225         (PopulateTypes): Re-write.
23226
23227         * class.cs (TypeContainer::Populate): Populate nested types too.
23228         (TypeContainer::Emit): Emit nested members too.
23229
23230         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23231         instead just use the name argument passed in as it is already fully
23232         qualified.
23233
23234         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23235         to TypeContainer mapping to see if a type is user-defined.
23236
23237         * class.cs (TypeContainer::CloseType): Implement. 
23238
23239         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23240         the default constructor.
23241
23242         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23243         twice.
23244
23245         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23246
23247         * interface.cs (CloseType): Create the type here.
23248
23249         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23250         the hierarchy.
23251
23252         Remove all the methods which are now in TypeContainer.
23253
23254 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23255
23256         * delegate.cs (Define): Re-write bits to define the delegate
23257         correctly.
23258
23259 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23260
23261         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23262
23263         * expression.cs (ImplicitReferenceConversion): handle null as well
23264         as a source to convert to any reference type.
23265
23266         * statement.cs (Return): Perform any implicit conversions to
23267         expected return type.  
23268
23269         Validate use of return statement.  
23270
23271         * codegen.cs (EmitContext): Pass the expected return type here.
23272
23273         * class.cs (Method, Constructor, Property): Pass expected return
23274         type to EmitContext.
23275
23276 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23277
23278         * expression.cs: Make DoResolve take an EmitContext instead of a
23279         TypeContainer.
23280
23281         Replaced `l' and `location' for `loc', for consistency.
23282
23283         (Error, Warning): Remove unneeded Tc argument.
23284
23285         * assign.cs, literal.cs, constant.cs: Update to new calling
23286         convention. 
23287
23288         * codegen.cs: EmitContext now contains a flag indicating whether
23289         code is being generated in a static method or not.
23290
23291         * cs-parser.jay: DecomposeQI, new function that replaces the old
23292         QualifiedIdentifier.  Now we always decompose the assembled
23293         strings from qualified_identifier productions into a group of
23294         memberaccesses.
23295
23296 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23297
23298         * rootcontext.cs: Deal with field-less struct types correctly now
23299         by passing the size option to Define Type.
23300
23301         * class.cs: Removed hack that created one static field. 
23302
23303 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23304
23305         * statement.cs: Moved most of the code generation here. 
23306
23307 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23308
23309         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23310         seem very right.
23311
23312         (ElementAccess): Remove useless bits for now - keep checks as the spec
23313         says.
23314
23315 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23316
23317         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23318         and start performing checks according to the spec.
23319
23320 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23321
23322         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23323         rank_specifiers instead.
23324
23325         (rank_specifiers): Change the order in which the rank specifiers are stored
23326
23327         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23328
23329         * expression.cs (ElementAccess): Implement the LValue interface too.
23330
23331 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23332
23333         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23334         except that user defined conversions are not included.
23335
23336         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23337         perform the conversion of the return type, if necessary.
23338
23339         (New::DoResolve): Check whether we are creating an array or an object
23340         and accordingly do the needful.
23341
23342         (New::Emit): Same here.
23343
23344         (New::DoResolve): Implement guts of array creation.
23345
23346         (New::FormLookupType): Helper function.
23347
23348 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23349
23350         * codegen.cs: Removed most of the code generation here, and move the
23351         corresponding code generation bits to the statement classes. 
23352
23353         Added support for try/catch/finalize and throw.
23354
23355         * cs-parser.jay: Added support for try/catch/finalize.
23356
23357         * class.cs: Catch static methods having the flags override,
23358         virtual or abstract.
23359
23360         * expression.cs (UserCast): This user cast was not really doing
23361         what it was supposed to do.  Which is to be born in fully resolved
23362         state.  Parts of the resolution were being performed at Emit time! 
23363
23364         Fixed this code.
23365
23366 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23367
23368         * expression.cs: Implicity convert the result from UserCast.
23369
23370 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23371
23372         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23373         prevented it from working correctly. 
23374
23375         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23376         merely ConvertImplicit.
23377
23378 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23379
23380         * typemanager.cs: Make the LookupTypeContainer function static,
23381         and not per-instance.  
23382
23383         * class.cs: Make static FindMembers (the one that takes a Type
23384         argument). 
23385
23386         * codegen.cs: Add EmitForeach here.
23387
23388         * cs-parser.jay: Make foreach a toplevel object instead of the
23389         inline expansion, as we need to perform semantic analysis on it. 
23390
23391 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23392
23393         * expression.cs (Expression::ImplicitUserConversion): Rename to
23394         UserDefinedConversion.
23395
23396         (Expression::UserDefinedConversion): Take an extra argument specifying 
23397         whether we look for explicit user conversions too.
23398
23399         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23400
23401         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23402
23403         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23404         with the appropriate arguments.
23405
23406         * cs-parser.jay (cast_expression): Record location too.
23407
23408         * expression.cs (Cast): Record location info.
23409
23410         (Expression::ConvertExplicit): Take location argument.
23411
23412         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23413         to determine if we are doing explicit conversions.
23414
23415         (UserCast::Emit): Update accordingly.
23416
23417         (Expression::ConvertExplicit): Report an error if everything fails.
23418
23419         * ../errors/cs0030.cs : Add.
23420
23421 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23422
23423         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23424         virtual and newslot bits. 
23425
23426         * class.cs (TypeContainer::RegisterRequiredImplementations):
23427         Record methods we need.
23428
23429         (TypeContainer::MakeKey): Helper function to make keys for
23430         MethodBases, since the Methodbase key is useless.
23431
23432         (TypeContainer::Populate): Call RegisterRequiredImplementations
23433         before defining the methods.   
23434
23435         Create a mapping for method_builders_to_methods ahead of time
23436         instead of inside a tight loop.
23437
23438         (::RequireMethods):  Accept an object as the data to set into the
23439         hashtable so we can report interface vs abstract method mismatch.
23440
23441 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23442
23443         * report.cs: Make all of it static.
23444
23445         * rootcontext.cs: Drop object_type and value_type computations, as
23446         we have those in the TypeManager anyways.
23447
23448         Drop report instance variable too, now it is a global.
23449
23450         * driver.cs: Use try/catch on command line handling.
23451
23452         Add --probe option to debug the error reporting system with a test
23453         suite. 
23454
23455         * report.cs: Add support for exiting program when a probe
23456         condition is reached.
23457
23458 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23459
23460         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23461         we do a forcible conversion regardless of type, to check if 
23462         ForceConversion returns a null.
23463
23464         (Binary::error19): Use location to report error.
23465
23466         (Unary::error23): Use location here too.
23467
23468         * ../errors/cs0019.cs : Check in.
23469
23470         * ../errors/cs0023.cs : Check in.
23471
23472         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23473         case of a non-null MethodInfo object with a length of 0 !
23474
23475         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23476         an applicable member - according to the spec :-)
23477         Also fix logic to find members in base types.
23478
23479         (Unary::ResolveOperator): Same here.
23480
23481         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23482         as I was getting thoroughly confused between this and error19 :-)
23483
23484         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23485         (::FindMostEncompassedType): Implement.
23486         (::FindMostEncompassingType): Implement.
23487         (::StandardConversionExists): Implement.
23488
23489         (UserImplicitCast): Re-vamp. We now need info about most specific
23490         source and target types so that we can do the necessary conversions.
23491
23492         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23493         mathematical union with no duplicates.
23494
23495 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23496
23497         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23498         in order from base classes to child classes, so that we can in
23499         child classes look up in our parent for method names and
23500         attributes (required for handling abstract, virtual, new, override
23501         constructs: we need to instrospect our base class, and if we dont
23502         populate the classes in order, the introspection might be
23503         incorrect.  For example, a method could query its parent before
23504         the parent has any methods and would determine that the parent has
23505         no abstract methods (while it could have had them)).
23506
23507         (RootContext::CreateType): Record the order in which we define the
23508         classes.
23509
23510 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23511
23512         * class.cs (TypeContainer::Populate): Also method definitions can
23513         fail now, keep track of this.
23514
23515         (TypeContainer::FindMembers): Implement support for
23516         DeclaredOnly/noDeclaredOnly flag.
23517
23518         (Constructor::Emit) Return the ConstructorBuilder.
23519
23520         (Method::Emit) Return the MethodBuilder. 
23521         Check for abstract or virtual methods to be public.
23522
23523         * rootcontext.cs (RootContext::CreateType): Register all the
23524         abstract methods required for the class to be complete and the
23525         interface methods that must be implemented. 
23526
23527         * cs-parser.jay: Report error 501 (method requires body if it is
23528         not marked abstract or extern).
23529
23530         * expression.cs (TypeOf::Emit): Implement.
23531
23532         * typemanager.cs: runtime_handle_type, new global type.
23533
23534         * class.cs (Property::Emit): Generate code for properties.
23535
23536 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23537
23538         * expression.cs (Unary::ResolveOperator): Find operators on base type
23539         too - we now conform exactly to the spec.
23540
23541         (Binary::ResolveOperator): Same here.
23542
23543         * class.cs (Operator::Define): Fix minor quirk in the tests.
23544
23545         * ../errors/cs0215.cs : Added.
23546
23547         * ../errors/cs0556.cs : Added.
23548
23549         * ../errors/cs0555.cs : Added.
23550
23551 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23552
23553         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23554         single integer which is really efficient
23555
23556 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23557
23558         *  expression.cs (Expression::ImplicitUserConversion): Use location
23559         even in the case when we are examining True operators.
23560  
23561         * class.cs (Operator::Define): Perform extensive checks to conform
23562         with the rules for operator overloading in the spec.
23563
23564         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23565         some of the other conversions mentioned in the spec.
23566
23567         * typemanager.cs (array_type): New static member for the System.Array built-in
23568         type.
23569
23570         (cloneable_interface): For System.ICloneable interface.
23571
23572         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23573         we start resolving the tree and populating types.
23574
23575         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23576  
23577 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23578
23579         * expression.cs (Expression::ExprClassFromMemberInfo,
23580         Expression::Literalize): Create literal expressions from
23581         FieldInfos which are literals.
23582
23583         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23584         type casts, because they were wrong.  The test suite in tests
23585         caught these ones.
23586
23587         (ImplicitNumericConversion): ushort to ulong requires a widening
23588         cast. 
23589
23590         Int32 constant to long requires widening cast as well.
23591
23592         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23593         for integers because the type on the stack is not i4.
23594
23595 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23596
23597         * expression.cs (report118): require location argument. 
23598
23599         * parameter.cs: Do not dereference potential null value.
23600
23601         * class.cs: Catch methods that lack the `new' keyword when
23602         overriding a name.  Report warnings when `new' is used without
23603         anything being there to override.
23604
23605         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23606
23607         * class.cs: Only add constructor to hashtable if it is non-null
23608         (as now constructors can fail on define).
23609
23610         (TypeManager, Class, Struct): Take location arguments.
23611
23612         Catch field instance initialization in structs as errors.
23613
23614         accepting_filter: a new filter for FindMembers that is static so
23615         that we dont create an instance per invocation.
23616
23617         (Constructor::Define): Catch errors where a struct constructor is
23618         parameterless 
23619
23620         * cs-parser.jay: Pass location information for various new
23621         constructs. 
23622
23623         * delegate.cs (Delegate): take a location argument.
23624
23625         * driver.cs: Do not call EmitCode if there were problesm in the
23626         Definition of the types, as many Builders wont be there. 
23627
23628         * decl.cs (Decl::Decl): Require a location argument.
23629
23630         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23631         into integers, and find the most appropiate integer for it.
23632
23633         * literal.cs: Implement ULongLiteral.
23634
23635         * rootcontext.cs: Provide better information about the location of
23636         failure when CreateType fails.
23637
23638 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23639
23640         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23641         as well.
23642
23643         * expression.cs (Binary::CheckShiftArguments): Add missing type
23644         computation.
23645         (Binary::ResolveOperator): Add type to the logical and and logical
23646         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23647         before.
23648
23649         (Binary::DoNumericPromotions): In the case where either argument
23650         is ulong (and most signed types combined with ulong cause an
23651         error) perform implicit integer constant conversions as well.
23652
23653 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23654
23655         * expression.cs (UserImplicitCast): Method should always be
23656         non-null. 
23657         (Invocation::BetterConversion): Simplified test for IntLiteral.
23658
23659         (Expression::ImplicitNumericConversion): Split this routine out.
23660         Put the code that performs implicit constant integer conversions
23661         here. 
23662
23663         (Expression::Resolve): Become a wrapper around DoResolve so we can
23664         check eclass and type being set after resolve.
23665
23666         (Invocation::Badness): Remove this dead function
23667
23668         (Binary::ResolveOperator): Do not compute the expensive argumnets
23669         unless we have a union for it.
23670
23671         (Probe::Emit): Is needs to do an isinst and then
23672         compare against null.
23673
23674         (::CanConvert): Added Location argument.  If the Location argument
23675         is null (Location.Null), then we do not report errors.  This is
23676         used by the `probe' mechanism of the Explicit conversion.  We do
23677         not want to generate an error for something that the user
23678         explicitly requested to be casted.  But the pipeline for an
23679         explicit cast first tests for potential implicit casts.
23680
23681         So for now, if the Location is null, it means `Probe only' to
23682         avoid adding another argument.   Might have to revise this
23683         strategy later.
23684
23685         (ClassCast): New class used to type cast objects into arbitrary
23686         classes (used in Explicit Reference Conversions).
23687
23688         Implement `as' as well.
23689
23690         Reverted all the patches from Ravi below: they were broken:
23691
23692                 * The use of `level' as a mechanism to stop recursive
23693                   invocations is wrong.  That was there just to catch the
23694                   bug with a strack trace but not as a way of addressing
23695                   the problem.
23696
23697                   To fix the problem we have to *understand* what is going
23698                   on and the interactions and come up with a plan, not
23699                   just get things going.
23700
23701                 * The use of the type conversion cache that I proposed
23702                   last night had an open topic: How does this work across
23703                   protection domains.  A user defined conversion might not
23704                   be public in the location where we are applying the
23705                   conversion, a different conversion might be selected
23706                   (ie, private A->B (better) but public B->A (worse),
23707                   inside A, A->B applies, but outside it, B->A will
23708                   apply).
23709
23710                 * On top of that (ie, even if the above is solved),
23711                   conversions in a cache need to be abstract.  Ie, `To
23712                   convert from an Int to a Short use an OpcodeCast', not
23713                   `To convert from an Int to a Short use the OpcodeCast on
23714                   the variable 5' (which is what this patch was doing).
23715
23716 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23717
23718         * expression.cs (Invocation::ConversionExists): Re-write to use
23719         the conversion cache
23720
23721         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23722         cache all conversions done, not just user-defined ones.
23723
23724         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23725         to determine if a conversion exists instead of acutually trying to 
23726         perform the conversion. It's faster too.
23727
23728         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23729         and only then attempt the implicit conversion.
23730
23731 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23732
23733         * expression.cs (ConvertImplicit): Use a cache for conversions
23734         already found. Check level of recursion and bail out if necessary.
23735
23736 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23737
23738         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23739         Export standard methods that we expect for string operations.
23740
23741         * statement.cs (Block::UsageWarning): Track usage of variables and
23742         report the errors for not used variables.
23743
23744         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23745         operator. 
23746
23747 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23748
23749         * codegen.cs: remove unnneded code 
23750
23751         * expression.cs: Removed BuiltinTypeAccess class
23752
23753         Fix the order in which implicit conversions are
23754         done.  
23755
23756         The previous fixed dropped support for boxed conversions (adding a
23757         test to the test suite now)
23758
23759         (UserImplicitCast::CanConvert): Remove test for source being null,
23760         that code is broken.  We should not feed a null to begin with, if
23761         we do, then we should track the bug where the problem originates
23762         and not try to cover it up here.
23763
23764         Return a resolved expression of type UserImplicitCast on success
23765         rather than true/false.  Ravi: this is what I was talking about,
23766         the pattern is to use a static method as a "constructor" for
23767         objects. 
23768
23769         Also, do not create arguments until the very last minute,
23770         otherwise we always create the arguments even for lookups that
23771         will never be performed. 
23772
23773         (UserImplicitCast::Resolve): Eliminate, objects of type
23774         UserImplicitCast are born in a fully resolved state. 
23775
23776         * typemanager.cs (InitCoreTypes): Init also value_type
23777         (System.ValueType). 
23778
23779         * expression.cs (Cast::Resolve): First resolve the child expression.
23780
23781         (LValue): Add new method AddressOf to be used by
23782         the `&' operator.  
23783
23784         Change the argument of Store to take an EmitContext instead of an
23785         ILGenerator, because things like FieldExpr need to be able to call
23786         their children expression to generate the instance code. 
23787
23788         (Expression::Error, Expression::Warning): Sugar functions for
23789         reporting errors.
23790
23791         (Expression::MemberLookup): Accept a TypeContainer instead of a
23792         Report as the first argument.
23793
23794         (Expression::ResolvePrimary): Killed.  I still want to improve
23795         this as currently the code is just not right.
23796
23797         (Expression::ResolveMemberAccess): Simplify, but it is still
23798         wrong. 
23799
23800         (Unary::Resolve): Catch errors in AddressOf operators.
23801
23802         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23803         index to a byte for the short-version, or the compiler will choose
23804         the wrong Emit call, which generates the wrong data.
23805
23806         (ParameterReference::Emit, ::Store): same.
23807
23808         (FieldExpr::AddressOf): Implement.
23809
23810         * typemanager.cs: TypeManager: made public variable instead of
23811         property.
23812
23813         * driver.cs: document --fatal.
23814
23815         * report.cs (ErrorMessage, WarningMessage): new names for the old
23816         Error and Warning classes.
23817
23818         * cs-parser.jay (member_access): Turn built-in access to types
23819         into a normal simplename
23820
23821 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23822
23823         * expression.cs (Invocation::BetterConversion): Fix to cope
23824         with q being null, since this was introducing a bug.
23825
23826         * expression.cs (ConvertImplicit): Do built-in conversions first.
23827
23828 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23829
23830         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23831
23832 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23833
23834         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23835         I had introduced long ago (what's new ?).
23836
23837         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23838         the work of all the checking. 
23839         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23840         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23841
23842         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23843         that is the right way. 
23844
23845         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23846         overloading resolution. Use everywhere instead of cutting and pasting code.
23847
23848         (Binary::ResolveOperator): Use MakeUnionSet.
23849
23850         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23851         we have to convert to bool types. Not complete yet.
23852
23853 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23854
23855         * typemanager.cs (TypeManager::CSharpName): support ushort.
23856
23857         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23858         to provide an expression that performsn an implicit constant int
23859         conversion (section 6.1.6).
23860         (Expression::ConvertImplicitRequired): Reworked to include
23861         implicit constant expression conversions.
23862
23863         (Expression::ConvertNumericExplicit): Finished.
23864
23865         (Invocation::Emit): If InstanceExpression is null, then it means
23866         that we perform a call on this.
23867
23868 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23869
23870         * expression.cs (Unary::Emit): Remove some dead code.
23871         (Probe): Implement Resolve and Emit for `is'.
23872         (Expression::ConvertImplicitRequired): Attempt to do constant
23873         expression conversions here.  Maybe should be moved to
23874         ConvertImplicit, but I am not sure.
23875         (Expression::ImplicitLongConstantConversionPossible,
23876         Expression::ImplicitIntConstantConversionPossible): New functions
23877         that tell whether is it possible to apply an implicit constant
23878         expression conversion.
23879
23880         (ConvertNumericExplicit): Started work on explicit numeric
23881         conversions.
23882
23883         * cs-parser.jay: Update operator constants.
23884
23885         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23886         (Parameters::GetSignature): Hook up VerifyArgs here.
23887         (Parameters::VerifyArgs): Verifies that no two arguments have the
23888         same name. 
23889
23890         * class.cs (Operator): Update the operator names to reflect the
23891         ones that the spec expects (as we are just stringizing the
23892         operator names).
23893
23894         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23895         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23896         previous usage did only work for our methods.
23897         (Expression::ConvertImplicit): Handle decimal implicit numeric
23898         conversions as well.
23899         (Expression::InternalTypeConstructor): Used to invoke constructors
23900         on internal types for default promotions.
23901
23902         (Unary::Emit): Implement special handling for the pre/post
23903         increment/decrement for overloaded operators, as they need to have
23904         the same semantics as the other operators.
23905
23906         (Binary::ResolveOperator): ditto.
23907         (Invocation::ConversionExists): ditto.
23908         (UserImplicitCast::Resolve): ditto.
23909
23910 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23911
23912         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23913         operator, return after emitting body. Regression tests pass again !
23914
23915         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23916         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23917         (Invocation::OverloadResolve): Ditto.
23918         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23919
23920         * everywhere : update calls to the above methods accordingly.
23921
23922 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23923
23924         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23925
23926         * expression.cs (ExpressionStatement): New base class used for
23927         expressions that can appear in statements, so that we can provide
23928         an alternate path to generate expression that do not leave a value
23929         on the stack.
23930
23931         (Expression::Emit, and all the derivatives): We no longer return
23932         whether a value is left on the stack or not.  Every expression
23933         after being emitted leaves a single value on the stack.
23934
23935         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23936         facilties of ExpressionStatement if possible.
23937
23938         * cs-parser.jay: Update statement_expression.
23939
23940 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23941
23942         * driver.cs: Change the wording of message
23943
23944 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23945
23946         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23947         the type of the expression to the return type of the method if
23948         we have an overloaded operator match ! The regression tests pass again !
23949         (Unary::ResolveOperator): Ditto.
23950
23951         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23952         to find "op_Implicit", not "implicit" ;-)
23953         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23954         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23955
23956         * everywhere : Correct calls to the above accordingly.
23957
23958         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23959         (ConvertImplicit): Do user-defined conversion if it exists.
23960
23961 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23962
23963         * assign.cs: track location.
23964         (Resolve): Use implicit conversions on assignment.
23965
23966         * literal.cs: Oops.  Not good, Emit of short access values should
23967         pass (Bytes) or the wrong argument will be selected.
23968
23969         * expression.cs (Unary::Emit): Emit code for -expr.
23970
23971         (Unary::ResolveOperator): Handle `Substract' for non-constants
23972         (substract from zero from the non-constants).
23973         Deal with Doubles as well. 
23974
23975         (Expression::ConvertImplicitRequired): New routine that reports an
23976         error if no implicit conversion exists. 
23977
23978         (Invocation::OverloadResolve): Store the converted implicit
23979         expressions if we make them
23980
23981 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23982
23983         * class.cs (ConstructorInitializer): Take a Location argument.
23984         (ConstructorBaseInitializer): Same here.
23985         (ConstructorThisInitializer): Same here.
23986
23987         * cs-parser.jay : Update all calls accordingly.
23988
23989         * expression.cs (Unary, Binary, New): Take location argument.
23990         Update accordingly everywhere.
23991
23992         * cs-parser.jay : Update all calls to the above to take a location
23993         argument.
23994
23995         * class.cs : Ditto.
23996
23997 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23998
23999         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24000         (Invocation::BetterConversion): Same here
24001         (Invocation::ConversionExists): Ditto.
24002
24003         (Invocation::ConversionExists): Implement.
24004
24005 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24006
24007         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24008         Also take an additional TypeContainer argument.
24009
24010         * All over : Pass in TypeContainer as argument to OverloadResolve.
24011
24012         * typemanager.cs (CSharpName): Update to check for the string type and return
24013         that too.
24014
24015         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24016         a given method.
24017
24018 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24019
24020         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24021         (Invocation::BetterFunction): Implement.
24022         (Invocation::BetterConversion): Implement.
24023         (Invocation::ConversionExists): Skeleton, no implementation yet.
24024
24025         Okay, things work fine !
24026
24027 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24028
24029         * typemanager.cs: declare and load enum_type, delegate_type and
24030         void_type. 
24031
24032         * expression.cs (Expression::Emit): Now emit returns a value that
24033         tells whether a value is left on the stack or not.  This strategy
24034         might be reveted tomorrow with a mechanism that would address
24035         multiple assignments.
24036         (Expression::report118): Utility routine to report mismatches on
24037         the ExprClass.
24038
24039         (Unary::Report23): Report impossible type/operator combination
24040         utility function.
24041
24042         (Unary::IsIncrementableNumber): Whether the type can be
24043         incremented or decremented with add.
24044         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24045         complemented. 
24046         (Unary::ResolveOperator): Implement ++, !, ~,
24047
24048         (Invocation::Emit): Deal with new Emit convetion.
24049
24050         * All Expression derivatives: Updated their Emit method to return
24051         whether they leave values on the stack or not.
24052
24053         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24054         stack for expressions that are statements. 
24055
24056 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24057
24058         * expression.cs (LValue): New interface.  Must be implemented by
24059         LValue objects.
24060         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24061         LValue interface.
24062
24063         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24064         interface for generating code, simplifies the code.
24065
24066 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24067
24068         * expression.cs (everywhere): Comment out return statements in ::Resolve
24069         methods to avoid the warnings.
24070
24071 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24072
24073         * driver.cs (parse): Report error 2001 if we can not open the
24074         source file.
24075
24076         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24077         not resolve it.
24078
24079         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24080         object. 
24081
24082         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24083         otherwise nested blocks end up with the same index.
24084
24085         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24086
24087         * expression.cs:  Instead of having FIXMEs in the Resolve
24088         functions, throw exceptions so it is obvious that we are facing a
24089         bug. 
24090
24091         * cs-parser.jay (invocation_expression): Pass Location information.
24092
24093         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24094         Use a basename for those routines because .NET does not like paths
24095         on them. 
24096
24097         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24098         already defined.
24099
24100 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24101
24102         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24103         are loading the correct data types (throws an exception if not).
24104         (TypeManager::InitCoreTypes): Use CoreLookupType
24105
24106         * expression.cs (Unary::ResolveOperator): return the child
24107         expression for expressions which are just +expr.
24108         (Unary::ResolveOperator): Return negative literals for -LITERAL
24109         expressions (otherwise they are Unary {Literal}).
24110         (Invocation::Badness): Take into account `Implicit constant
24111         expression conversions'.
24112
24113         * literal.cs (LongLiteral): Implement long literal class.
24114         (IntLiteral): export the `Value' of the intliteral. 
24115
24116 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24117
24118         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24119
24120         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24121         instead of 'Operator'
24122
24123         * expression.cs (Binary::ResolveOperator): Update accordingly.
24124         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24125         and 'Minus'
24126
24127         * cs-parser.jay (unary_expression): Update to use the new names.
24128
24129         * gen-treedump.cs (GetUnary): Same here.
24130
24131         * expression.cs (Unary::Resolve): Implement.
24132         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24133         operators are found instead of making noise ;-)
24134         (Unary::ResolveOperator): New method to do precisely the same thing which
24135         Binary::ResolveOperator does for Binary expressions.
24136         (Unary.method, .Arguments): Add.
24137         (Unary::OperName): Implement.   
24138         (Unary::ForceConversion): Copy and Paste !
24139
24140         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24141         a unary operator.
24142
24143         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24144         for the inbuilt operators. Only overloading works for now ;-)
24145
24146 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24147
24148         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24149         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24150
24151         * expression.cs (This::Emit): Implement. 
24152         (This::Resolve): Implement.
24153         (TypeOf:Resolve): Implement.
24154         (Expression::ResolveSimpleName): Add an implicit this to instance
24155         field references. 
24156         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24157         Bind instance variable to Field expressions.
24158         (FieldExpr::Instance): New field used to track the expression that
24159         represents the object instance.
24160         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24161         binding 
24162         (FieldExpr::Emit): Implement.
24163
24164         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24165         the last instruction contains a return opcode to avoid generating
24166         the last `ret' instruction (this generates correct code, and it is
24167         nice to pass the peverify output).
24168
24169         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24170         initializer for static and instance variables.
24171         (Constructor::Emit): Allow initializer to be null in the case of
24172         static constructors.  Only emit initializer for instance
24173         constructors. 
24174
24175         (TypeContainer::FindMembers): Return a null array if there are no
24176         matches.
24177
24178         Also fix the code for the MemberTypes.Method branch, as it was not
24179         scanning that for operators (or tried to access null variables before).
24180
24181         * assign.cs (Assign::Emit): Handle instance and static fields. 
24182
24183         * TODO: Updated.
24184
24185         * driver.cs: Stop compilation if there are parse errors.
24186
24187         * cs-parser.jay (constructor_declaration): Provide default base
24188         initializer for non-static constructors.
24189         (constructor_declarator): Do not provide a default base
24190         initializers if none was specified.
24191         Catch the fact that constructors should not have parameters.
24192
24193         * class.cs: Do not emit parent class initializers for static
24194         constructors, that should be flagged as an error.
24195
24196 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24197
24198         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24199         Move back code into TypeContainer::Populate.
24200
24201 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24202
24203         * class.cs (TypeContainer::AddConstructor): Fix the check to
24204         compare against Name, not Basename. 
24205         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24206
24207         * cs-parser.jay : Update accordingly.
24208
24209         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24210         for methods, don't forget to look into the operators too.
24211         (RegisterMethodBuilder): Helper method to take care of this for
24212         methods, constructors and operators.
24213         (Operator::Define): Completely revamp.
24214         (Operator.OperatorMethod, MethodName): New fields.
24215         (TypeContainer::Populate): Move the registering of builders into
24216         RegisterMethodBuilder.
24217         (Operator::Emit): Re-write.
24218
24219         * expression.cs (Binary::Emit): Comment out code path to emit method
24220         invocation stuff for the case when we have a user defined operator. I am
24221         just not able to get it right !
24222
24223 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24224
24225         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24226         argument. 
24227
24228         (Expression::MemberLookup): Provide a version that allows to
24229         specify the MemberTypes and BindingFlags. 
24230
24231         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24232         so it was not fetching variable information from outer blocks.
24233
24234         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24235         Beforefieldinit as it was buggy.
24236
24237         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24238         that Ravi put here.  
24239
24240         * class.cs (Constructor::Emit): Only emit if block is not null.
24241         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24242         deal with this by semantically definining it as if the user had
24243         done it.
24244
24245         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24246         constructors as we now "emit" them at a higher level.
24247
24248         (TypeContainer::DefineDefaultConstructor): Used to define the
24249         default constructors if none was provided.
24250
24251         (ConstructorInitializer): Add methods Resolve and Emit. 
24252
24253         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24254
24255 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24256
24257         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24258         the default constructor builder with our hashtable for methodbuilders
24259         to methodcores.
24260
24261         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24262         and argument_count is 0 in which case we have a match.
24263         (Binary::ResolveOperator): More null checking and miscellaneous coding
24264         style cleanup.
24265
24266 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24267
24268         * rootcontext.cs (IsNameSpace): Compare against null.
24269
24270         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24271
24272         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24273         and Unary::Operator.
24274
24275         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24276         accordingly.
24277
24278         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24279         we have overloaded operators.
24280         (Binary::ResolveOperator): Implement the part which does the operator overload
24281         resolution.
24282
24283         * class.cs (Operator::Emit): Implement.
24284         (TypeContainer::Emit): Emit the operators we have too.
24285
24286         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24287         the case when we have a user-defined operator.
24288
24289 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24290
24291         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24292
24293 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24294
24295         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24296         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24297         (Constructor::Emit): Implement.
24298         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24299         if we have no work to do. 
24300         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24301         Emit method.
24302
24303         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24304         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24305
24306         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24307         of parent.parent.
24308
24309 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24310
24311         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24312         in the source.
24313         (Tree::RecordNamespace): Method to do what the name says ;-)
24314         (Tree::Namespaces): Property to get at the namespaces hashtable.
24315
24316         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24317         keep track.
24318
24319         * rootcontext.cs (IsNamespace): Fixed it :-)
24320
24321 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24322
24323         * class.cs (TypeContainer::FindMembers): Add support for
24324         constructors. 
24325         (MethodCore): New class that encapsulates both the shared aspects
24326         of a Constructor and a Method.  
24327         (Method, Constructor): Factored pieces into MethodCore.
24328
24329         * driver.cs: Added --fatal which makes errors throw exceptions.
24330         Load System assembly as well as part of the standard library.
24331
24332         * report.cs: Allow throwing exceptions on errors for debugging.
24333
24334         * modifiers.cs: Do not use `parent', instead use the real type
24335         container to evaluate permission settings.
24336
24337         * class.cs: Put Ravi's patch back in.  He is right, and we will
24338         have to cope with the
24339
24340 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24341
24342         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24343         FamORAssem, not FamANDAssem.
24344
24345 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24346
24347         * driver.cs: Added --parse option that only parses its input files
24348         and terminates.
24349
24350         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24351         incorrect.  IsTopLevel is not used to tell whether an object is
24352         root_types or not (that can be achieved by testing this ==
24353         root_types).  But to see if this is a top-level *class* (not
24354         necessarly our "toplevel" container). 
24355
24356 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24357
24358         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24359         parent instead of a direct call to GetType.
24360
24361 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24362
24363         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24364         Modifiers.TypeAttr. This should just be a call to that method.
24365
24366         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24367         object so that we can determine if we are top-level or not.
24368
24369         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24370         TypeContainer too.
24371
24372         * enum.cs (Enum::Define): Ditto.
24373
24374         * modifiers.cs (FieldAttr): Re-write.
24375
24376         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24377         (TypeContainer::HaveStaticConstructor): New property to provide access
24378         to precisely that info.
24379
24380         * modifiers.cs (MethodAttr): Re-write.
24381         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24382
24383         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24384         of top-level types as claimed.
24385
24386 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24387
24388         * expression.cs (MemberLookup): Fruitless attempt to lookup
24389         constructors.  Maybe I need to emit default constructors?  That
24390         might be it (currently .NET emits this for me automatically).
24391         (Invocation::OverloadResolve): Cope with Arguments == null.
24392         (Invocation::EmitArguments): new function, shared by the new
24393         constructor and us.
24394         (Invocation::Emit): Handle static and instance methods.  Emit
24395         proper call instruction for virtual or non-virtual invocations.
24396         (New::Emit): Implement.
24397         (New::Resolve): Implement.
24398         (MemberAccess:Resolve): Implement.
24399         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24400         to track instances.
24401         (FieldExpr::Resolve): Set type.
24402
24403         * support.cs: Handle empty arguments.
24404                 
24405         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24406         SimpleLookup): Auxiliary routines to help parse a qualifier
24407         identifier.  
24408
24409         Update qualifier_identifier rule.
24410
24411         * codegen.cs: Removed debugging messages.
24412
24413         * class.cs: Make this a global thing, this acts just as a "key" to
24414         objects that we might have around.
24415
24416         (Populate): Only initialize method_builders_to_methods once.
24417
24418         * expression.cs (PropertyExpr): Initialize type from the
24419         PropertyType. 
24420
24421         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24422         Resolve pattern.  Attempt to implicitly convert value to boolean.
24423         Emit code.
24424
24425         * expression.cs: Set the type for the int32/int32 argument case.
24426         (Binary::ResolveOperator): Set the return type to boolean for
24427         comparission operators
24428
24429         * typemanager.cs: Remove debugging print code.
24430
24431         (Invocation::Resolve): resolve type.
24432
24433         * class.cs: Allocate a MemberInfo of the correct size, as the code
24434         elsewhere depends on the test to reflect the correct contents.
24435
24436         (Method::) Keep track of parameters, due to System.Reflection holes
24437
24438         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24439         mapping here.
24440
24441         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24442         of the exact size and return that.
24443
24444         (Class::LookupMethodByBuilder): New function that maps
24445         MethodBuilders to its methods.  Required to locate the information
24446         on methods because System.Reflection bit us again.
24447
24448         * support.cs: New file, contains an interface ParameterData and
24449         two implementations: ReflectionParameters and InternalParameters
24450         used to access Parameter information.  We will need to grow this
24451         as required.
24452
24453         * expression.cs (Invocation::GetParameterData): implement a cache
24454         and a wrapper around the ParameterData creation for methods. 
24455         (Invocation::OverloadResolve): Use new code.
24456
24457 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24458
24459         * class.cs (TypeContainer::EmitField): Remove and move into 
24460         (Field::Define): here and modify accordingly.
24461         (Field.FieldBuilder): New member.
24462         (TypeContainer::Populate): Update accordingly.
24463         (TypeContainer::FindMembers): Implement.
24464
24465 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24466
24467         * statement.cs: (VariableInfo::VariableType): New field to be
24468         initialized with the full type once it is resolved. 
24469
24470 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24471
24472         * parameter.cs (GetParameterInfo): Use a type cache to compute
24473         things only once, and to reuse this information
24474
24475         * expression.cs (LocalVariableReference::Emit): Implement.
24476         (OpcodeCast::Emit): fix.
24477
24478         (ParameterReference::Resolve): Implement.
24479         (ParameterReference::Emit): Implement.
24480
24481         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24482         that are expressions need to stay as Expressions.
24483
24484         * typemanager.cs (CSharpName): Returns the C# name of a type if
24485         possible. 
24486
24487         * expression.cs (Expression::ConvertImplicit): New function that
24488         implements implicit type conversions.
24489
24490         (Expression::ImplicitReferenceConversion): Implements implicit
24491         reference conversions.
24492
24493         (EmptyCast): New type for transparent casts.
24494
24495         (OpcodeCast): New type for casts of types that are performed with
24496         a sequence of bytecodes.
24497
24498         (BoxedCast): New type used for casting value types into reference
24499         types.  Emits a box opcode.
24500
24501         (Binary::DoNumericPromotions): Implements numeric promotions of
24502         and computation of the Binary::Type.
24503
24504         (Binary::EmitBranchable): Optimization.
24505
24506         (Binary::Emit): Implement code emission for expressions.
24507
24508         * typemanager.cs (TypeManager): Added two new core types: sbyte
24509         and byte.
24510
24511 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24512
24513         * class.cs (TypeContainer::FindMembers): Method which does exactly
24514         what Type.FindMembers does, only we don't have to use reflection. No
24515         implementation yet.
24516
24517         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24518         typecontainer objects as we need to get at them.
24519         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24520
24521         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24522         typecontainer object.
24523
24524         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24525         of just a Report object.
24526
24527 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24528
24529         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24530         "remove_"
24531         (TypeContainer::Populate): Now define the delegates of the type too.
24532         (TypeContainer.Delegates): Property to access the list of delegates defined
24533         in the type.
24534
24535         * delegates.cs (Delegate::Define): Implement partially.
24536
24537         * modifiers.cs (TypeAttr): Handle more flags.
24538
24539 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24540
24541         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24542         and not <=
24543         (Operator::Define): Re-write logic to get types by using the LookupType method
24544         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24545         (Indexer::Define): Ditto.
24546         (Event::Define): Ditto.
24547         (Property::Define): Ditto.
24548
24549 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24550
24551         * class.cs (TypeContainer::Populate): Now define operators too. 
24552         (TypeContainer.Operators): New property to access the list of operators
24553         in a type.
24554         (Operator.OperatorMethodBuilder): New member to hold the method builder
24555         for the operator we are defining.
24556         (Operator::Define): Implement.
24557
24558 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24559
24560         * class.cs (Event::Define): Make the prefixes of the accessor methods
24561         addOn_ and removeOn_ 
24562
24563         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24564         of the location being passed in too. Ideally, this should go later since all
24565         error reporting should be done through the Report object.
24566
24567         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24568         (Populate): Iterate thru the indexers we have and define them too.
24569         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24570         for the get and set accessors.
24571         (Indexer::Define): Implement.
24572
24573 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24574
24575         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24576         my previous implementation, did not work.
24577
24578         * typemanager.cs: Add a couple of missing types (the longs).
24579
24580         * literal.cs: Use TypeManager.bool_type instead of getting it.
24581
24582         * expression.cs (EventExpr): New kind of expressions.
24583         (Expressio::ExprClassFromMemberInfo): finish
24584
24585 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24586
24587         * assign.cs: Emit stores to static fields differently.
24588
24589 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24590
24591         * Merge in changes and adjust code to tackle conflicts. Backed out my
24592         code in Assign::Resolve ;-) 
24593
24594 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24595
24596         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24597         instead Report.Error and also pass in the location.
24598         (CSharpParser::Lexer): New readonly property to return the reference
24599         to the Tokenizer object.
24600         (declare_local_variables): Use Report.Error with location instead of plain 
24601         old error.
24602         (CheckDef): Ditto.
24603
24604         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24605         (Operator.CheckBinaryOperator): Ditto.
24606
24607         * cs-parser.jay (operator_declarator): Update accordingly.
24608
24609         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24610         (CheckBinaryOperator): Same here.
24611
24612         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24613         on the name without any prefixes of namespace names etc. This is because we
24614         already might have something already fully qualified like 
24615         'System.Console.WriteLine'
24616
24617         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24618
24619 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24620
24621         * cs-tokenizer.cs (location): Return a string which also contains
24622         the file name.
24623
24624         * expression.cs (ElementAccess): New class for expressions of the
24625         type 'element access.'
24626         (BaseAccess): New class for expressions of the type 'base access.'
24627         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24628         respectively.
24629
24630         * cs-parser.jay (element_access): Implement action.
24631         (base_access): Implement actions.
24632         (checked_expression, unchecked_expression): Implement.
24633
24634         * cs-parser.jay (local_variable_type): Correct and implement.
24635         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24636
24637         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24638
24639         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24640         name and the specifiers.
24641
24642         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24643
24644         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24645         making them all public ;-)
24646
24647         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24648         class anyways.
24649
24650 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24651
24652         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24653         PropertyExprs.
24654         (FieldExpr, PropertyExprs): New resolved expressions.
24655         (SimpleName::MemberStaticCheck): Perform static checks for access
24656         to non-static fields on static methods. Maybe this should be
24657         generalized for MemberAccesses. 
24658         (SimpleName::ResolveSimpleName): More work on simple name
24659         resolution. 
24660
24661         * cs-parser.jay (primary_expression/qualified_identifier): track
24662         the parameter index.
24663
24664         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24665         (EmitContext::EmitBoolExpression): Chain to expression generation
24666         instead of temporary hack.
24667         (::EmitStatementExpression): Put generic expression code generation.
24668
24669         * assign.cs (Assign::Emit): Implement variable assignments to
24670         local variables, parameters and fields.
24671
24672 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24673
24674         * statement.cs (Block::GetVariableInfo): New method, returns the
24675         VariableInfo for a variable name in a block.
24676         (Block::GetVariableType): Implement in terms of GetVariableInfo
24677
24678         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24679         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24680
24681 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24682
24683         * cs-parser.jay (operator_declaration): Continue on my quest : update
24684         to take attributes argument.
24685         (event_declaration): Ditto.
24686         (enum_declaration): Ditto.
24687         (indexer_declaration): Ditto.
24688
24689         * class.cs (Operator::Operator): Update constructor accordingly.
24690         (Event::Event): Ditto.
24691
24692         * delegate.cs (Delegate::Delegate): Same here.
24693
24694         * enum.cs (Enum::Enum): Same here.
24695
24696 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24697
24698         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24699
24700         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24701
24702         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24703         being passed around as an arraylist.
24704         (Attributes::AddAttribute): Method to add attribute sections.
24705
24706         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24707         (struct_declaration): Update accordingly.
24708         (constant_declaration): Update.
24709         (field_declaration): Update.
24710         (method_header): Update.
24711         (fixed_parameter): Update.
24712         (parameter_array): Ditto.
24713         (property_declaration): Ditto.
24714         (destructor_declaration): Ditto.
24715
24716         * class.cs (Struct::Struct): Update constructors accordingly.
24717         (Class::Class): Ditto.
24718         (Field::Field): Ditto.
24719         (Method::Method): Ditto.
24720         (Property::Property): Ditto.
24721         (TypeContainer::OptAttribute): update property's return type.
24722
24723         * interface.cs (Interface.opt_attributes): New member.
24724         (Interface::Interface): Update to take the extra Attributes argument.
24725
24726         * parameter.cs (Parameter::Parameter): Ditto.
24727
24728         * constant.cs (Constant::Constant): Ditto.
24729
24730         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24731         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24732         the attributes as a parameter.
24733         (InterfaceProperty): Update constructor call.
24734         (InterfaceEvent): Ditto.
24735         (InterfaceMethod): Ditto.
24736         (InterfaceIndexer): Ditto.
24737
24738         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24739         pass the attributes too.
24740         (interface_event_declaration): Ditto.
24741         (interface_property_declaration): Ditto.
24742         (interface_method_declaration): Ditto.
24743         (interface_declaration): Ditto.
24744
24745 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24746
24747         * class.cs (Method::Define): Track the "static Main" definition to
24748         create an entry point. 
24749
24750         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24751         EntryPoint if we find it. 
24752
24753         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24754         (EmitContext::ig): Make this variable public.
24755
24756         * driver.cs: Make the default output file be the first file name
24757         with the .exe extension.  
24758
24759         Detect empty compilations
24760
24761         Handle various kinds of output targets.  Handle --target and
24762         rename -t to --dumper.
24763
24764         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24765         methods inherited from Expression return now an Expression.  This
24766         will is used during the tree rewriting as we resolve them during
24767         semantic analysis.
24768
24769         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24770         the spec.  Missing entirely is the information about
24771         accessability of elements of it.
24772
24773         (Expression::ExprClassFromMemberInfo): New constructor for
24774         Expressions that creates a fully initialized Expression based on
24775         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24776         a Type.
24777
24778         (Invocation::Resolve): Begin implementing resolution of invocations.
24779
24780         * literal.cs (StringLiteral):  Implement Emit.
24781
24782 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24783
24784         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24785         member.
24786
24787 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24788
24789         * cs-parser.jay (attribute_arguments): Implement actions.
24790         (attribute): Fix bug in production. Implement action.
24791         (attribute_list): Implement.
24792         (attribute_target): Implement.
24793         (attribute_target_specifier, opt_target_specifier): Implement
24794         (CheckAttributeTarget): New method to check if the attribute target
24795         is valid.
24796         (attribute_section): Implement.
24797         (opt_attributes): Implement.
24798
24799         * attribute.cs : New file to handle attributes.
24800         (Attribute): Class to hold attribute info.
24801
24802         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24803         (attribute_section): Modify production to use 2 different rules to 
24804         achieve the same thing. 1 s/r conflict down !
24805         Clean out commented, useless, non-reducing dimension_separator rules.
24806
24807         * class.cs (TypeContainer.attributes): New member to hold list
24808         of attributes for a type.
24809         (Struct::Struct): Modify to take one more argument, the attribute list.
24810         (Class::Class): Ditto.
24811         (Field::Field): Ditto.
24812         (Method::Method): Ditto.
24813         (Property::Property): Ditto.
24814
24815         * cs-parser.jay (struct_declaration): Update constructor call to
24816         pass in the attributes too.
24817         (class_declaration): Ditto.
24818         (constant_declaration): Ditto.
24819         (field_declaration): Ditto.
24820         (method_header): Ditto.
24821         (fixed_parameter): Ditto.
24822         (parameter_array): Ditto.
24823         (property_declaration): Ditto.
24824
24825         * constant.cs (Constant::Constant): Update constructor similarly.
24826         Use System.Collections.
24827
24828         * parameter.cs (Parameter::Parameter): Update as above.
24829
24830 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24831
24832         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24833         (TypeContainer.delegates): New member to hold list of delegates.
24834
24835         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24836         this time as I seem to be on crack ;-)
24837
24838 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24839
24840         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24841         tell whether an identifier represents a namespace.
24842
24843         * expression.cs (NamespaceExpr): A namespace expression, used only
24844         temporarly during expression resolution.
24845         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24846         utility functions to resolve names on expressions.
24847
24848 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24849
24850         * codegen.cs: Add hook for StatementExpressions. 
24851
24852         * class.cs: Fix inverted test for static flag in methods.
24853
24854 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24855
24856         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24857         to make it coincide with MS' number.
24858         (Operator::CheckBinaryOperator): Ditto.
24859
24860         * ../errors/errors.txt : Remove error numbers added earlier.
24861
24862         * ../errors/cs1019.cs : Test case for error # 1019
24863
24864         * ../errros/cs1020.cs : Test case for error # 1020
24865
24866         * cs-parser.jay : Clean out commented cruft.
24867         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24868         used anywhere - non-reducing rule.
24869         (namespace_declarations): Non-reducing rule - comment out.
24870
24871         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24872         with TypeContainer::AddEnum.
24873
24874         * delegate.cs : New file for delegate handling classes.
24875         (Delegate): Class for declaring delegates.
24876
24877         * makefile : Update.
24878
24879         * cs-parser.jay (delegate_declaration): Implement.
24880
24881 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24882
24883         * class.cs (Event::Define): Implement.
24884         (Event.EventBuilder): New member.
24885
24886         * class.cs (TypeContainer::Populate): Update to define all enums and events
24887         we have.
24888         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24889         readonly fields for all these cases ?
24890
24891 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24892
24893         * class.cs (Property): Revamp to use the convention of making fields readonly.
24894         Accordingly modify code elsewhere.
24895
24896         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24897         the Define method of the Property class.
24898
24899         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24900         trivial bug.
24901         (TypeContainer::Populate): Update to define all the properties we have. Also
24902         define all enumerations.
24903
24904         * enum.cs (Define): Implement.
24905
24906 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24907
24908         * cs-parser.jay (overloadable_operator): The semantic value is an
24909         enum of the Operator class.
24910         (operator_declarator): Implement actions.
24911         (operator_declaration): Implement.
24912
24913         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24914         validity of definitions.
24915         (Operator::CheckBinaryOperator): Static method to check for binary operators
24916         (TypeContainer::AddOperator): New method to add an operator to a type.
24917
24918         * cs-parser.jay (indexer_declaration): Added line to actually call the
24919         AddIndexer method so it gets added ;-)
24920
24921         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24922         already taken care of by the MS compiler ?  
24923
24924 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24925
24926         * class.cs (Operator): New class for operator declarations.
24927         (Operator::OpType): Enum for the various operators.
24928
24929 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24930
24931         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24932         ostensibly handle this in semantic analysis.
24933
24934         * cs-parser.jay (general_catch_clause): Comment out
24935         (specific_catch_clauses, specific_catch_clause): Ditto.
24936         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24937         (catch_args, opt_catch_args): New productions.
24938         (catch_clause): Rewrite to use the new productions above
24939         (catch_clauses): Modify accordingly.
24940         (opt_catch_clauses): New production to use in try_statement
24941         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24942         and re-write the code in the actions to extract the specific and
24943         general catch clauses by being a little smart ;-)
24944
24945         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24946         Hooray, try and catch statements parse fine !
24947
24948 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24949
24950         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24951         string from the hashtable of variables.
24952
24953         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24954         I end up making that mistake ;-)
24955         (catch_clauses): Fixed gross error which made Key and Value of the 
24956         DictionaryEntry the same : $1 !!
24957
24958 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24959
24960         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24961
24962         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24963         when the add and remove accessors are specified. 
24964
24965 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24966
24967         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24968         information about indexer_declarator.
24969         (indexer_declarator): Implement actions.
24970         (parsing_indexer): New local boolean used to keep track of whether
24971         we are parsing indexers or properties. This is necessary because 
24972         implicit_parameters come into picture even for the get accessor in the 
24973         case of an indexer.
24974         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24975
24976         * class.cs (Indexer): New class for indexer declarations.
24977         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24978         (TypeContainer::indexers): New member to hold list of indexers for the
24979         type.
24980
24981 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24982
24983         * cs-parser.jay (add_accessor_declaration): Implement action.
24984         (remove_accessor_declaration): Implement action.
24985         (event_accessors_declaration): Implement
24986         (variable_declarators): swap statements for first rule - trivial.
24987
24988         * class.cs (Event): New class to hold information about event
24989         declarations.
24990         (TypeContainer::AddEvent): New method to add an event to a type
24991         (TypeContainer::events): New member to hold list of events.
24992
24993         * cs-parser.jay (event_declaration): Implement actions.
24994
24995 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24996
24997         * cs-parser.jay (dim_separators): Implement. Make it a string
24998         concatenating all the commas together, just as they appear.
24999         (opt_dim_separators): Modify accordingly
25000         (rank_specifiers): Update accordingly. Basically do the same
25001         thing - instead, collect the brackets here.
25002         (opt_rank_sepcifiers): Modify accordingly.
25003         (array_type): Modify to actually return the complete type string
25004         instead of ignoring the rank_specifiers.
25005         (expression_list): Implement to collect the expressions
25006         (variable_initializer): Implement. We make it a list of expressions
25007         essentially so that we can handle the array_initializer case neatly too.
25008         (variable_initializer_list): Implement.
25009         (array_initializer): Make it a list of variable_initializers
25010         (opt_array_initializer): Modify accordingly.
25011
25012         * expression.cs (New::NType): Add enumeration to help us
25013         keep track of whether we have an object/delegate creation
25014         or an array creation.
25015         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25016         members to hold data about array creation.
25017         (New:New): Modify to update NewType
25018         (New:New): New Overloaded contructor for the array creation
25019         case.
25020
25021         * cs-parser.jay (array_creation_expression): Implement to call
25022         the overloaded New constructor.
25023
25024 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25025
25026         * class.cs (TypeContainer::Constructors): Return member
25027         constructors instead of returning null.
25028
25029 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25030
25031         * typemanager.cs (InitCoreTypes): Initialize the various core
25032         types after we have populated the type manager with the user
25033         defined types (this distinction will be important later while
25034         compiling corlib.dll)
25035
25036         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25037         on Expression Classification.  Now all expressions have a method
25038         `Resolve' and a method `Emit'.
25039
25040         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25041         generation from working.     Also add some temporary debugging
25042         code. 
25043
25044 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25045
25046         * codegen.cs: Lots of code generation pieces.  This is only the
25047         beginning, will continue tomorrow with more touches of polish.  We
25048         handle the fundamentals of if, while, do, for, return.  Others are
25049         trickier and I need to start working on invocations soon.
25050
25051         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25052         s.InitStatement. 
25053
25054         * codegen.cs (EmitContext): New struct, used during code
25055         emission to keep a context.   Most of the code generation will be
25056         here. 
25057
25058         * cs-parser.jay: Add embedded blocks to the list of statements of
25059         this block.  So code generation proceeds in a top down fashion.
25060
25061 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25062
25063         * statement.cs: Add support for multiple child blocks.
25064
25065 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25066
25067         * codegen.cs (EmitCode): New function, will emit the code for a
25068         Block of code given a TypeContainer and its ILGenerator. 
25069
25070         * statement.cs (Block): Standard public readonly optimization.
25071         (Block::Block constructors): Link children. 
25072         (Block::Child): Child Linker.
25073         (Block::EmitVariables): Emits IL variable declarations.
25074
25075         * class.cs: Drop support for MethodGroups here, delay until
25076         Semantic Analysis.
25077         (Method::): Applied the same simplification that I did before, and
25078         move from Properties to public readonly fields.
25079         (Method::ParameterTypes): Returns the parameter types for the
25080         function, and implements a cache that will be useful later when I
25081         do error checking and the semantic analysis on the methods is
25082         performed.
25083         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25084         and made a method, optional argument tells whether this is a class
25085         or a structure to apply the `has-this' bit.
25086         (Method::GetCallingConvention): Implement, returns the calling
25087         convention. 
25088         (Method::Define): Defines the type, a second pass is performed
25089         later to populate the methods.
25090
25091         (Constructor::ParameterTypes): implement a cache similar to the
25092         one on Method::ParameterTypes, useful later when we do semantic
25093         analysis. 
25094
25095         (TypeContainer::EmitMethod):  New method.  Emits methods.
25096
25097         * expression.cs: Removed MethodGroup class from here.
25098
25099         * parameter.cs (Parameters::GetCallingConvention): new method.
25100
25101 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25102
25103         * class.cs (TypeContainer::Populate): Drop RootContext from the
25104         argument. 
25105
25106         (Constructor::CallingConvention): Returns the calling convention.
25107         (Constructor::ParameterTypes): Returns the constructor parameter
25108         types. 
25109
25110         (TypeContainer::AddConstructor): Keep track of default constructor
25111         and the default static constructor.
25112
25113         (Constructor::) Another class that starts using `public readonly'
25114         instead of properties. 
25115
25116         (Constructor::IsDefault): Whether this is a default constructor. 
25117
25118         (Field::) use readonly public fields instead of properties also.
25119
25120         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25121         track of static constructors;  If none is used, turn on
25122         BeforeFieldInit in the TypeAttributes. 
25123
25124         * cs-parser.jay (opt_argument_list): now the return can be null
25125         for the cases where there are no arguments. 
25126
25127         (constructor_declarator): If there is no implicit `base' or
25128         `this', then invoke the default parent constructor. 
25129
25130         * modifiers.cs (MethodAttr): New static function maps a set of
25131         modifiers flags into a MethodAttributes enum
25132         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25133         MethodAttr, TypeAttr to represent the various mappings where the
25134         modifiers are used.
25135         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25136
25137 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25138
25139         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25140         method arguments.
25141
25142         * interface.cs (PopulateIndexer): Implemented the code generator
25143         for interface indexers.
25144
25145 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25146
25147         * interface.cs (InterfaceMemberBase): Now we track the new status
25148         here.  
25149
25150         (PopulateProperty): Implement property population.  Woohoo!  Got
25151         Methods and Properties going today. 
25152
25153         Removed all the properties for interfaces, and replaced them with
25154         `public readonly' fields. 
25155
25156 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25157
25158         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25159         initialize their hashtables/arraylists only when they are needed
25160         instead of doing this always.
25161
25162         * parameter.cs: Handle refs and out parameters.
25163
25164         * cs-parser.jay: Use an ArrayList to construct the arguments
25165         instead of the ParameterCollection, and then cast that to a
25166         Parameter[] array.
25167
25168         * parameter.cs: Drop the use of ParameterCollection and use
25169         instead arrays of Parameters.
25170
25171         (GetParameterInfo): Use the Type, not the Name when resolving
25172         types. 
25173
25174 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25175
25176         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25177         and instead use public readonly fields.
25178
25179         * class.cs: Put back walking code for type containers.
25180
25181 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25182
25183         * class.cs (MakeConstant): Code to define constants.
25184
25185         * rootcontext.cs (LookupType): New function.  Used to locate types 
25186
25187
25188 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25189
25190         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25191         this System.Reflection code is.  Kudos to Microsoft
25192
25193         * typemanager.cs: Implement a type cache and avoid loading all
25194         types at boot time.  Wrap in LookupType the internals.  This made
25195         the compiler so much faster.  Wow.  I rule!
25196
25197         * driver.cs: Make sure we always load mscorlib first (for
25198         debugging purposes, nothing really important).
25199
25200         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25201         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25202
25203         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25204         on namespaces that have been imported using the `using' keyword.
25205
25206         * class.cs (TypeContainer::TypeAttr): Virtualize.
25207         (Class::TypeAttr): Return attributes suitable for this bad boy.
25208         (Struct::TypeAttr): ditto.
25209         Handle nested classes.
25210         (TypeContainer::) Remove all the type visiting code, it is now
25211         replaced with the rootcontext.cs code
25212
25213         * rootcontext.cs (GetClassBases): Added support for structs. 
25214
25215 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25216
25217         * interface.cs, statement.cs, class.cs, parameter.cs,
25218         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25219         Drop use of TypeRefs, and use strings instead.
25220
25221 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25222
25223         * rootcontext.cs: 
25224
25225         * class.cs (Struct::Struct): set the SEALED flags after
25226         checking the modifiers.
25227         (TypeContainer::TypeAttr): new property, returns the
25228         TypeAttributes for a class.  
25229
25230         * cs-parser.jay (type_list): Oops, list production was creating a
25231         new list of base types.
25232
25233         * rootcontext.cs (StdLib): New property.
25234         (GetInterfaceTypeByName): returns an interface by type name, and
25235         encapsulates error handling here.
25236         (GetInterfaces): simplified.
25237         (ResolveTree): Encapsulated all the tree resolution here.
25238         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25239         types. 
25240
25241         * driver.cs: Add support for --nostdlib, to avoid loading the
25242         default assemblies.
25243         (Main): Do not put tree resolution here. 
25244
25245         * rootcontext.cs: Beginning of the class resolution.
25246
25247 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25248
25249         * rootcontext.cs: Provide better error reporting. 
25250
25251         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25252
25253         * rootcontext.cs (CreateInterface): Handle the case where there
25254         are no parent interfaces.
25255
25256         (CloseTypes): Routine to flush types at the end.
25257         (CreateInterface): Track types.
25258         (GetInterfaces): Returns an array of Types from the list of
25259         defined interfaces.
25260
25261         * typemanager.c (AddUserType): Mechanism to track user types (puts
25262         the type on the global type hash, and allows us to close it at the
25263         end). 
25264
25265 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25266
25267         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25268         RecordInterface instead.
25269
25270         * cs-parser.jay: Updated to reflect changes above.
25271
25272         * decl.cs (Definition): Keep track of the TypeBuilder type that
25273         represents this type here.  Not sure we will use it in the long
25274         run, but wont hurt for now.
25275
25276         * driver.cs: Smaller changes to accomodate the new code.
25277
25278         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25279         when done. 
25280
25281         * rootcontext.cs (CreateInterface):  New method, used to create
25282         the System.TypeBuilder type for interfaces.
25283         (ResolveInterfaces): new entry point to resolve the interface
25284         hierarchy. 
25285         (CodeGen): Property, used to keep track of the code generator.
25286
25287 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25288
25289         * cs-parser.jay: Add a second production for delegate_declaration
25290         with `VOID'.
25291
25292         (enum_body): Put an opt_comma here instead of putting it on
25293         enum_body or enum_member_declarations so we can handle trailing
25294         commas on enumeration members.  Gets rid of a shift/reduce.
25295
25296         (type_list): Need a COMMA in the middle.
25297
25298         (indexer_declaration): Tell tokenizer to recognize get/set
25299
25300         * Remove old targets.
25301
25302         * Re-add the parser target.
25303
25304 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25305
25306         * cs-parser.jay: Add precendence rules for a number of operators
25307         ot reduce the number of shift/reduce conflicts in the grammar.
25308
25309 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25310
25311         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25312         and put it here.
25313
25314         Get rid of old crufty code.
25315
25316         * rootcontext.cs: Use this to keep track of the parsed
25317         representation and the defined types available to the program. 
25318
25319         * gen-treedump.cs: adjust for new convention.
25320
25321         * type.cs: Split out the type manager, and the assembly builder
25322         from here. 
25323
25324         * typemanager.cs: the type manager will live here now.
25325
25326         * cil-codegen.cs: And the code generator here. 
25327
25328 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25329
25330         * makefile: Fixed up for easy making.
25331
25332 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25333
25334         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25335         the 
25336
25337         (unary_expression): Expand pre_increment_expression and
25338         post_decrement_expression to reduce a shift/reduce.
25339
25340 2001-07-11  Simon Cozens
25341
25342         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25343
25344         Improve allow_keyword_as_indent name.
25345
25346 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25347
25348         * Adjustments for Beta2. 
25349
25350 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25351
25352         * decl.cs: Added `Define' abstract method.
25353         (InTransit): new property, used to catch recursive definitions. 
25354
25355         * interface.cs: Implement `Define'. 
25356
25357         * modifiers.cs: Map Modifiers.constants to
25358         System.Reflection.TypeAttribute flags.
25359
25360         * class.cs: Keep track of types and user-defined types.
25361         (BuilderInit): New method for creating an assembly
25362         (ResolveType): New function to launch the resolution process, only
25363         used by interfaces for now.
25364
25365         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25366         that are inserted into the name space. 
25367
25368 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25369
25370         * ARGH.  I have screwed up my tree so many times due to the use of
25371         rsync rather than using CVS.  Going to fix this at once. 
25372
25373         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25374         load types.
25375
25376 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25377
25378         * Experiment successful: Use System.Type rather that our own
25379         version of Type.  
25380
25381 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25382
25383         * cs-parser.jay: Removed nsAliases from here.
25384
25385         Use new namespaces, handle `using XXX;' 
25386
25387         * namespace.cs: Reimplemented namespace handling, use a recursive
25388         definition of the class.  Now we can keep track of using clauses
25389         and catch invalid using clauses.
25390
25391 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25392
25393         * gen-treedump.cs: Adapted for all the renaming.
25394
25395         * expression.cs (Expression): this class now has a Type property
25396         which returns an expression Type.
25397
25398         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25399         `Type', as this has a different meaning now in the base
25400
25401 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25402
25403         * interface.cs, class.cs: Removed from all the sources the
25404         references to signature computation, as we can not do method
25405         signature computation during the parsing time, as we are not
25406         trying to solve at that point distinguishing:
25407
25408         class X {
25409                 void a (Blah x) {}
25410                 void a (NS.Blah x) {}
25411         }
25412
25413         Which depending on the context might be valid or not, as we do not
25414         know if Blah is the same thing as NS.Blah at that point.
25415
25416         * Redid everything so the code uses TypeRefs now instead of
25417         Types.  TypeRefs are just temporary type placeholders, that need
25418         to be resolved.  They initially have a pointer to a string and the
25419         current scope in which they are used.  This is used later by the
25420         compiler to resolve the reference to an actual Type. 
25421
25422         * DeclSpace is no longer a CIR.Type, and neither are
25423         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25424         are all DeclSpaces, but no Types. 
25425
25426         * type.cs (TypeRefManager): This implements the TypeRef manager,
25427         which keeps track of all the types that need to be resolved after
25428         the parsing has finished. 
25429
25430 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25431
25432         * ARGH.  We are going to have to store `foreach' as a class rather
25433         than resolving it, as we need to verify error 1579 after name
25434         resolution.   *OR* we could keep a flag that says `This request to
25435         IEnumerator comes from a foreach statement' which we can then use
25436         to generate the error.
25437
25438 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25439
25440         * class.cs (TypeContainer.AddMethod): we now add methods to the
25441         MethodGroup instead of the method hashtable.  
25442
25443         * expression.cs: Add MethodGroup abstraction, which gets us one
25444         step closer to the specification in the way we handle method
25445         declarations.  
25446
25447         * cs-parser.jay (primary_expression): qualified_identifier now
25448         tried to match up an identifier to a local variable reference or
25449         to a parameter reference.
25450
25451         current_local_parameters is now a parser global variable that
25452         points to the current parameters for the block, used during name
25453         lookup.
25454
25455         (property_declaration): Now creates an implicit `value' argument to
25456         the set accessor.
25457
25458 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25459
25460         * parameter.cs: Do not use `param' arguments as part of the
25461         signature, per the spec.
25462
25463 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25464
25465         * decl.cs: Base class for classes, structs and interfaces.  This
25466         is the "Declaration Space" 
25467
25468         * cs-parser.jay: Use CheckDef for checking declaration errors
25469         instead of having one on each function.
25470
25471         * class.cs: Factor out some code for handling error handling in
25472         accordance to the "Declarations" section in the "Basic Concepts"
25473         chapter in the ECMA C# spec.
25474
25475         * interface.cs: Make all interface member classes derive from
25476         InterfaceMemberBase.
25477
25478 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25479
25480         * Many things: all interfaces are parsed and generated in
25481         gen-treedump.  Support for member variables, constructors,
25482         destructors, properties, constants is there.
25483
25484         Beginning of the IL backend, but very little done, just there for
25485         testing purposes. 
25486
25487 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25488
25489         * cs-parser.jay: Fix labeled statement.
25490
25491         * cs-tokenizer.cs (escape): Escape " and ' always.
25492         ref_line, ref_name: keep track of the line/filename as instructed
25493         by #line by the compiler.
25494         Parse #line.
25495
25496 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25497
25498         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25499         to match the values in System.CodeDOM.
25500
25501         Divid renamed to Divide.
25502
25503         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25504         statements. 
25505         (Statements.set): remove.
25506
25507         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25508         statements. 
25509
25510         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25511         falseStatements always have valid values. 
25512
25513         * cs-parser.jay: Use System.CodeDOM now.
25514